/* The interactive app demo on Home. It keeps the app's own black-and-white
   palette (the owner's choice), with its own dark theme. */
.demo { --d-bg: #FFFFFF; --d-ink: #141414; --d-border: #141414; --d-muted: #8A857C; --d-faint: #B4AFA5; --d-tab: #9B968C;
  --d-hair: rgba(20,20,20,0.12); --d-line: rgba(20,20,20,0.25); --d-hover: #F6F4F0; --d-row-on: #F2EFE9;
  --d-on-bg: #141414; --d-on-fg: #FFFFFF; --d-win: #FDFCFA; --d-win-text: rgba(20,20,20,0.4); --d-win-line: rgba(20,20,20,0.1);
  --d-win-fill: rgba(20,20,20,0.07); --d-win-head: rgba(20,20,20,0.16); --d-win-grid: rgba(20,20,20,0.09);
  background: var(--demo-section); padding: 0 var(--pad) 56px; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; }
html[data-theme="dark"] .demo { --d-bg: #1A1A1A; --d-ink: #CBC6B8; --d-border: #3D3D3D; --d-muted: #A39C8F; --d-faint: #7F7A71; --d-tab: #8F8A80;
  --d-hair: rgba(244,241,234,0.15); --d-line: rgba(244,241,234,0.28); --d-hover: #222222; --d-row-on: #262626;
  --d-on-bg: rgba(244,241,234,0.14); --d-on-fg: #F4F1EA; --d-win: #0D0D0D; --d-win-text: rgba(203,198,184,0.7); --d-win-line: rgba(244,241,234,0.15);
  --d-win-fill: rgba(244,241,234,0.09); --d-win-head: rgba(244,241,234,0.16); --d-win-grid: rgba(244,241,234,0.1); }
.demo button { font-family: inherit; }
.demo-frame { max-width: 1060px; margin: 0 auto; }
.demo-lid { background: #1C1C1C; border-radius: 18px 18px 0 0; padding: 12px 14px 14px; box-shadow: 0 30px 60px rgba(20,20,20,0.18); }
.demo-cam { display: flex; justify-content: center; padding-bottom: 9px; }
.demo-cam i { width: 5px; height: 5px; border-radius: 50%; background: #3D3D3D; }
.demo-screen { display: grid; grid-template-columns: 340px 1fr; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--d-border); background: var(--d-bg); }
.demo-base { position: relative; height: 17px; margin: 0 -34px; background: linear-gradient(#41403E, #2A2928 70%, #1C1C1C); border-radius: 3px 3px 15px 15px; }
.demo-base i { position: absolute; left: 50%; top: 0; transform: translateX(-50%); width: 130px; height: 8px; background: #1C1C1C; border-radius: 0 0 10px 10px; }

.d-panel { border-right: 1px solid var(--d-border); display: flex; flex-direction: column; min-height: 0; overflow: hidden; background: var(--d-bg); color: var(--d-ink); }
.d-head { padding: 20px 24px 0; display: flex; align-items: baseline; justify-content: space-between; }
.d-word { font-family: 'Bodoni Moda', serif; font-size: 24px; letter-spacing: 0.04em; color: var(--d-ink); }
.d-sub { padding: 4px 24px 0; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 9px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--d-muted); }
.d-sub .faint { color: var(--d-faint); } .d-sub b { font-weight: 400; color: var(--d-ink); }
.d-tabs { display: flex; flex-wrap: nowrap; gap: 7px; justify-content: space-between; overflow-x: auto; padding: 16px 20px 0; border-bottom: 1px solid var(--d-border); }
.d-tab { background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; flex: 0 0 auto; padding: 0 0 11px; margin-bottom: -1px; font-size: 8.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--d-tab); white-space: nowrap; }
.d-tab[aria-selected="true"] { color: var(--d-ink); border-bottom-color: var(--d-ink); }
.d-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 22px 24px; }
.d-foot { padding: 12px 24px; background: #141414; color: #F4F1EA; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 9px; letter-spacing: 0.24em; text-transform: uppercase; }
.d-foot a { border: 1px solid #F4F1EA; color: #F4F1EA; font-size: 9px; letter-spacing: 0.2em; padding: 6px 12px; }
.d-foot a:hover { background: #F4F1EA; color: #141414; }
.d-col { display: flex; flex-direction: column; } .d-gap8 { gap: 8px; } .d-gap10 { gap: 10px; } .d-gap16 { gap: 16px; } .d-gap18 { gap: 18px; } .d-gap22 { gap: 22px; }
.d-label { font-size: 10px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--d-muted); }
.d-labelrow { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.d-hint { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--d-faint); }
.d-note { font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 15px; color: var(--d-muted); line-height: 1.4; }
.d-val { font-family: 'Bodoni Moda', serif; font-size: 15px; color: var(--d-ink); }
.d-seg { cursor: pointer; border: 1px solid var(--d-border); background: var(--d-bg); color: var(--d-ink); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; padding: 9px 2px; }
.d-seg.on { background: var(--d-on-bg); color: var(--d-on-fg); }
.d-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .d-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.d-chip { cursor: default; border: 1px solid var(--d-border); background: var(--d-on-bg); color: var(--d-on-fg); font-size: 9px; letter-spacing: 0.18em; text-transform: uppercase; padding: 7px 12px; }
.d-chip.dashed { border-style: dashed; border-color: var(--d-muted); background: none; color: var(--d-muted); }
.d-phrase { display: flex; align-items: baseline; gap: 12px; padding: 11px 2px; border-bottom: 1px solid var(--d-hair); }
.d-phrase .n { font-size: 9px; letter-spacing: 0.1em; color: var(--d-faint); width: 18px; }
.d-phrase .t { flex: 1; font-family: 'Cormorant Garamond', serif; font-size: 17px; line-height: 1.3; color: var(--d-ink); }
.d-x { cursor: pointer; border: 0; background: none; font-size: 11px; color: var(--d-faint); padding: 0 2px; }
.d-x:hover { color: var(--d-ink); }
.d-add { display: flex; gap: 10px; padding-top: 14px; }
.d-add input { flex: 1; min-width: 0; border: 0; border-bottom: 1px solid var(--d-border); background: none; outline: none; font-family: 'Cormorant Garamond', serif; font-size: 17px; font-style: italic; padding: 6px 2px; color: var(--d-ink); }
.d-add input::placeholder { color: var(--d-muted); }
.d-add button { cursor: pointer; border: 1px solid var(--d-border); background: var(--d-on-bg); color: var(--d-on-fg); font-size: 9px; letter-spacing: 0.2em; padding: 0 14px; }
.d-font { cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; background: none; border: 0; border-bottom: 1px solid var(--d-hair); padding: 9px 2px; text-align: left; width: 100%; color: var(--d-ink); }
.d-font:hover { background: var(--d-hover); }
.d-font span:first-child { font-size: 17px; } .d-font span:last-child { font-size: 11px; }
.d-slider { position: relative; height: 24px; cursor: pointer; touch-action: none; }
.d-slider .track { position: absolute; top: 11px; left: 0; right: 0; height: 1px; background: var(--d-line); }
.d-slider .fill { position: absolute; top: 11px; left: 0; height: 1px; background: var(--d-ink); }
.d-slider .knob { position: absolute; right: -6px; top: -5px; width: 12px; height: 12px; border-radius: 50%; background: var(--d-ink); }
.d-slider.sq .track, .d-slider.sq .fill { height: 2px; } .d-slider.sq .knob { border-radius: 0; width: 10px; height: 10px; right: -5px; top: -4px; }
.d-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--d-hair); }
.d-row .name { font-family: 'Bodoni Moda', serif; font-size: 17px; color: var(--d-ink); }
.d-row .tier { font-size: 8px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--d-muted); margin-left: 10px; }
.d-row .band { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--d-muted); white-space: nowrap; }
.d-box { border: 1px solid var(--d-border); text-align: center; font-size: 9px; letter-spacing: 0.16em; padding: 9px 0; }
.d-wall { height: 170px; border: 1px solid var(--d-border); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; overflow: hidden; padding: 0 18px; }
.d-wall div { font-family: 'Bodoni Moda', serif; text-align: center; line-height: 1.25; }
.d-big { cursor: pointer; border: 1px solid var(--d-border); background: var(--d-on-bg); color: var(--d-on-fg); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; padding: 13px 0; width: 100%; }
.d-big.off { background: var(--d-bg); color: var(--d-ink); }
.d-onoff { display: flex; }
.d-onoff button { cursor: pointer; border: 1px solid var(--d-border); background: var(--d-bg); color: var(--d-ink); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; padding: 12px 26px; }
.d-onoff button + button { border-left: 0; }
.d-onoff button.on { background: var(--d-on-bg); color: var(--d-on-fg); }
.d-rec { display: flex; align-items: center; gap: 9px; padding: 10px 4px; border-bottom: 1px solid var(--d-hair); }
.d-rec.playing { background: var(--d-row-on); }
.d-rec .name { flex: 1; min-width: 0; font-family: 'Cormorant Garamond', serif; font-size: 16px; line-height: 1.25; color: var(--d-ink); }
.d-rec.off .name { color: var(--d-tab); }
.d-rec button { cursor: pointer; border: 0; background: none; padding: 0 1px; font-size: 11px; line-height: 1; color: var(--d-faint); }
.d-rec button:hover, .d-rec.playing .play { color: var(--d-ink); }
.d-rec .tick { width: 13px; font-size: 12px; color: var(--d-ink); }
.d-link { display: block; text-align: center; border: 1px solid var(--d-border); color: var(--d-ink); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; padding: 13px 0; }
.d-link:hover { background: var(--d-ink); color: var(--d-bg); }

.d-stage { position: relative; overflow: hidden; min-height: 0; background: linear-gradient(155deg, #5b6472 0%, #454d59 100%); }
.d-win { position: absolute; background: var(--d-win); border: 1px solid rgba(0,0,0,0.08); cursor: grab; touch-action: none; }
.d-win:active { cursor: grabbing; }
.d-win[data-win="0"] { left: 7%; top: 12%; width: 62%; box-shadow: 0 30px 55px rgba(0,0,0,0.30); }
.d-win[data-win="1"] { left: 19%; top: 34%; width: 48%; box-shadow: 0 34px 60px rgba(0,0,0,0.34); }
.d-win .bar > span:first-child { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.d-win .bar { height: 30px; border-bottom: 1px solid var(--d-win-line); display: flex; align-items: center; justify-content: space-between; padding: 0 0 0 14px; font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--d-win-text); }
.d-win .ctl { display: flex; } .d-win .ctl span { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 10px; }
.d-win .sheet { height: 156px; background-image: repeating-linear-gradient(to right, var(--d-win-grid) 0 1px, transparent 1px 25%), repeating-linear-gradient(to bottom, var(--d-win-grid) 0 1px, transparent 1px 39px); }
.d-win .lines { padding: 22px 24px 30px; display: flex; flex-direction: column; gap: 11px; }
.d-win .lines i { display: block; height: 8px; background: var(--d-win-fill); } .d-win .lines i.h { height: 12px; width: 46%; background: var(--d-win-head); }
.d-task { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; background: rgba(13,13,13,0.9); display: flex; align-items: center; justify-content: space-between; padding: 0 18px; z-index: 400; }
.d-task .icons { display: flex; gap: 12px; align-items: center; }
.d-task .ic { width: 18px; height: 18px; }
.d-task .s { display: flex; align-items: center; justify-content: center; background: #F4F1EA; font-family: 'Bodoni Moda', serif; font-size: 12px; color: #141414; }
.d-task .s.live { animation: som-tray-pulse 2.2s ease-in-out infinite; }
.d-task .bars { display: none; align-items: center; gap: 2px; height: 12px; margin-left: -5px; }
.d-task .bars.live { display: flex; }
.d-task .bars i { width: 2px; height: 12px; background: rgba(244,241,234,0.8); animation: som-bar 900ms ease-in-out infinite; }
.d-task .bars i:nth-child(2) { animation-delay: 150ms; } .d-task .bars i:nth-child(3) { animation-delay: 320ms; }
.d-task .clock { text-align: right; color: rgba(244,241,234,0.7); font-size: 9px; line-height: 1.35; }
.d-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 500; }
.d-overlay div { text-align: center; line-height: 1.12; color: #F4F1EA; text-shadow: 0 2px 26px rgba(0,0,0,0.45); }
.d-overlay div.card { padding: 26px 44px; margin: 0 50px; background: rgba(13,13,13,0.62); border: 1px solid rgba(244,241,234,0.25); backdrop-filter: blur(2px); }
.d-overlay div.plain { padding: 0 50px; }

@keyframes w-flash { 0% { opacity: 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes w-zoom-in { 0% { opacity: 0; transform: scale(0.72); } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.14); } }
@keyframes w-zoom-out { 0% { opacity: 0; transform: scale(1.3); } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(0.92); } }
@keyframes w-pan-left { 0% { opacity: 0; transform: translateX(70px); } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-70px); } }
@keyframes w-pan-right { 0% { opacity: 0; transform: translateX(-70px); } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(70px); } }
@keyframes w-bounce { 0% { opacity: 0; transform: translateY(-36px); } 18% { opacity: 1; transform: translateY(0); } 32% { transform: translateY(-18px); } 46% { transform: translateY(0); } 58% { transform: translateY(-7px); } 68% { transform: translateY(0); } 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes som-tray-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(244,241,234,0.55); } 55% { box-shadow: 0 0 0 6px rgba(244,241,234,0); } }
@keyframes som-bar { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  .d-overlay div { animation: none !important; }
  .d-task .s.live, .d-task .bars i { animation: none !important; }
}

.demo-noscript { max-width: 680px; margin: 0 auto; text-align: center; font-size: 15px; line-height: 1.65; color: var(--body); }

/* Narrow screens get the same laptop, scaled down as a whole (demo.js fit()),
   so the layout and proportions always match the app. */
