/* Vistapane live demo: a pretend admin on the left drives a pretend lobby TV on the right.
   Same tokens as the site. Everything here is sample content. */

.demo-section { padding-top: clamp(40px, 5vw, 64px); }
.demo-notice { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--ink-muted); font-size: 15px; margin-bottom: 22px; }
.example-note-inline {
  display: inline-block; padding: 2px 10px; border-radius: 999px; border: 1px dashed var(--line-strong);
  color: var(--ink-muted); font: 600 11.5px/1.5 var(--font-sans); letter-spacing: .04em; text-transform: uppercase;
}

.demo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
@media (max-width: 980px) { .demo { grid-template-columns: minmax(0, 1fr); } .d-stage { order: -1; } }

/* ------------------------------------------------------------ the admin */
.d-admin { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden; min-width: 0; }
.d-admin-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-sunken); }
.d-dots { display: inline-flex; gap: 6px; }
.d-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); opacity: .5; }
.d-url { font-size: 12.5px; color: var(--ink-muted); background: var(--surface-raised); border: 1px solid var(--line); padding: 3px 10px; border-radius: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-admin-body { display: grid; grid-template-columns: 172px minmax(0, 1fr); min-height: 460px; }
@media (max-width: 560px) { .d-admin-body { grid-template-columns: minmax(0, 1fr); } }

.d-tabs { display: grid; align-content: start; gap: 2px; padding: 12px 8px; background: var(--midnight); }
.d-tabs button {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--chrome-ink, #C9D6E3); font: 500 14px/1.2 var(--font-sans); text-align: left; cursor: pointer; transition: background-color .15s, color .15s;
}
.d-tabs button svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.d-tabs button:hover { background: #ffffff12; color: #fff; }
.d-tabs button[aria-selected="true"] { background: #ffffff1a; color: #fff; box-shadow: inset 3px 0 0 var(--sky); }
.d-tabs button:focus-visible { box-shadow: 0 0 0 2px var(--midnight), 0 0 0 4px var(--sky); }
@media (max-width: 560px) {
  .d-tabs { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding: 8px; }
  .d-tabs button[aria-selected="true"] { box-shadow: inset 0 -3px 0 var(--sky); }
}

.d-panel { padding: 20px 22px 24px; display: grid; gap: 14px; align-content: start; min-width: 0; }
.d-panel[hidden] { display: none; }
.d-panel h3 { font-size: 19px; }
.d-help { color: var(--ink-muted); font-size: 14.5px; line-height: 1.5; }
.d-choice { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.d-choice legend { font: 600 12.5px/1 var(--font-sans); color: var(--ink-muted); margin-bottom: 8px; }
.d-choice label { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); cursor: pointer; transition: border-color .15s, background-color .15s; }
.d-choice label:hover { border-color: var(--line-strong); }
.d-choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.d-choice input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.d-choice span { display: grid; gap: 1px; font-size: 14.5px; }
.d-choice small { color: var(--ink-muted); font-size: 12.5px; }
.d-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.d-actions { margin-top: 4px; }
.d-switch { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; }
.d-switch input { accent-color: var(--accent); width: 16px; height: 16px; }
.d-field { display: grid; gap: 6px; font: 600 12.5px/1.2 var(--font-sans); color: var(--ink-muted); }
.d-field select, .d-field input {
  height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  background: var(--surface-raised); color: var(--ink); font: 500 15px/1 var(--font-sans);
}
.d-field input:focus, .d-field select:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus-ring); }
.d-pin { width: 9ch; letter-spacing: .3em; font-family: var(--font-mono) !important; font-size: 20px !important; }
.d-error { color: var(--busy); font-size: 14px; }

.d-btn {
  min-height: 38px; padding: 0 14px; border-radius: var(--radius-md); border: 1px solid var(--line-strong);
  background: var(--surface-raised); color: var(--ink); font: 600 14px/1 var(--font-sans); cursor: pointer;
  transition: transform .15s var(--ease), background-color .15s, opacity .15s;
}
.d-btn:hover:not(:disabled) { transform: translateY(-1px); }
.d-btn:disabled { opacity: .45; cursor: default; }
.d-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.d-danger { background: #B91C1C; border-color: #B91C1C; color: #fff; }

.d-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.d-presets button, .d-seg button {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-raised);
  color: var(--ink); font: 600 13px/1.2 var(--font-sans); cursor: pointer;
}
.d-presets button.on { background: var(--ink); color: var(--surface-raised); border-color: var(--ink); }
.d-seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 999px; background: var(--surface-sunken); justify-self: start; }
.d-seg button { border-color: transparent; background: transparent; color: var(--ink-muted); }
.d-seg button.on { background: var(--surface-raised); color: var(--ink); box-shadow: var(--shadow-sm); }

/* room sign tablet */
.d-tablet { justify-self: center; width: min(100%, 340px); padding: 12px; border-radius: 22px; background: #0B1220; box-shadow: var(--shadow-md); }
.d-sign {
  display: grid; gap: 6px; padding: 18px; border-radius: 12px; background: #15803D; color: #fff; transition: background-color .4s ease;
}
.d-sign.busy { background: #B42318; }
.ds-name { font: 600 13px/1.3 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.ds-state { font: 600 30px/1.1 var(--font-display); letter-spacing: -0.02em; }
.ds-next { font-size: 14px; opacity: .9; }
.ds-actions { display: flex; gap: 8px; margin-top: 8px; }
.ds-actions button { padding: 9px 14px; border-radius: 10px; border: 0; background: #ffffff26; color: #fff; font: 600 14px/1 var(--font-sans); cursor: pointer; }
.ds-actions button:hover { background: #ffffff3a; }
.ds-actions button[hidden] { display: none; }

/* ------------------------------------------------------------ the screen */
.d-stage { position: sticky; top: 92px; display: grid; gap: 16px; min-width: 0; }
@media (max-width: 980px) { .d-stage { position: static; } }
.d-tv-wrap { margin: 0; display: grid; justify-items: center; gap: 0; }
.d-tv { width: 100%; padding: 10px 10px 12px; border-radius: 14px; background: #060D18; box-shadow: 0 30px 60px -20px #0B254566, 0 0 0 1px #ffffff14 inset; }
.d-screen {
  position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: 4px; overflow: hidden;
  container-type: size; background: #0E2A4C; color: #F3F7FA; font-family: var(--font-sans);
}
.d-stand { width: 22%; height: 14px; background: linear-gradient(#0B1626, #060D18); border-radius: 0 0 8px 8px; }
.d-status {
  margin-top: 14px; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: center;
  padding: 7px 14px; border-radius: 999px; background: var(--surface-raised); border: 1px solid var(--line); font-size: 14px; color: var(--ink-muted);
}
.d-status b { color: var(--ink); font-weight: 600; }
.d-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.d-status.is-alert .dot { background: #B91C1C; }
.d-status.is-off .dot { background: var(--line-strong); }

.d-layer { position: absolute; inset: 0; }
.d-layer[hidden] { display: none; }
.d-content .d-slide {
  position: absolute; inset: 0; padding: 8cqh 7cqh; display: flex; flex-direction: column; justify-content: flex-end; gap: 2.4cqh;
  opacity: 0; transition: opacity .7s ease;
}
.d-content .d-slide.on { opacity: 1; }
.d-slide > * { transform: translateY(2cqh); opacity: 0; transition: transform .8s var(--ease), opacity .6s ease; }
.d-slide.on > * { transform: none; opacity: 1; }
.d-slide.on > :nth-child(2) { transition-delay: .08s; }
.d-slide.on > :nth-child(3) { transition-delay: .16s; }
.d-tag { font: 600 3.4cqh/1 var(--font-sans); letter-spacing: .12em; text-transform: uppercase; color: var(--sunrise); }
.d-head { font: 600 10cqh/1.03 var(--font-display); letter-spacing: -0.03em; max-width: 90%; }
.d-sub { font: 400 4.4cqh/1.35 var(--font-sans); color: #C9D6E3; max-width: 85%; }
.d-big { font: 300 30cqh/.9 var(--font-display); letter-spacing: -0.04em; color: var(--sunrise); font-variant-numeric: tabular-nums; }
.d-bg-a { background: radial-gradient(120% 90% at 85% 110%, #FFC85733, transparent 55%), linear-gradient(160deg, #1B4677, #0E2A4C 70%); }
.d-bg-b { background: radial-gradient(90% 80% at 10% 0%, #8DE0FF26, transparent 60%), linear-gradient(200deg, #13315C, #0A1F3B); }
.d-bg-c { background: #0B2545; }
.d-bg-d { background: linear-gradient(160deg, #17704A, #0F3A2B); }
.d-menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6cqh; font: 500 4.8cqh/1.25 var(--font-sans); }
.d-menu li { display: flex; justify-content: space-between; gap: 4cqh; border-bottom: 1px solid #ffffff26; padding-bottom: 1.4cqh; max-width: 80%; }
.d-menu b { font-weight: 600; color: #fff; }
.d-menu span { color: #C9D6E3; font-variant-numeric: tabular-nums; }

/* the layout: main zone, sidebar, ticker */
.d-layout { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 30%; grid-template-rows: 1fr 11%; }
.d-layout .d-main { position: relative; padding: 7cqh 6cqh; display: flex; flex-direction: column; justify-content: flex-end; gap: 2cqh; }
.d-layout .d-side { background: #0A1F3B; border-left: 1px solid #ffffff14; padding: 6cqh 4.5cqh; display: flex; flex-direction: column; gap: 2cqh; }
.d-clock { font: 300 12cqh/1 var(--font-display); letter-spacing: -0.035em; font-variant-numeric: tabular-nums; }
.d-date { font: 500 3.8cqh/1.2 var(--font-sans); color: #A9BCD0; }
.d-temp { margin-top: auto; font: 500 8cqh/1 var(--font-display); }
.d-cond { font: 400 3.8cqh/1.2 var(--font-sans); color: #A9BCD0; }
.d-ticker { grid-column: 1 / -1; display: flex; align-items: center; overflow: hidden; background: #051222; white-space: nowrap; font: 500 4.4cqh/1 var(--font-sans); }
.d-ticker .lbl { position: relative; z-index: 1; flex: none; height: 100%; display: flex; align-items: center; padding: 0 3cqh; background: var(--sky); color: var(--midnight); font-weight: 700; font-size: 3.4cqh; letter-spacing: .06em; text-transform: uppercase; }
.d-ticker .trk { display: inline-flex; gap: 8cqh; padding-left: 4cqh; animation: d-tick 26s linear infinite; }
@keyframes d-tick { to { transform: translateX(-50%); } }

/* push, share, off, alert, identify */
.d-push { display: flex; flex-direction: column; justify-content: flex-end; gap: 2.4cqh; padding: 8cqh 7cqh; animation: d-in .5s var(--ease); }
.d-push .d-pushed { position: absolute; top: 4cqh; right: 4cqh; padding: 1cqh 2.4cqh; border-radius: 99px; background: #ffffff1f; font: 600 3cqh/1.4 var(--font-sans); letter-spacing: .04em; }
.d-share { display: grid; place-items: center; background: #0B1220; animation: d-in .5s var(--ease); }
.d-laptop { width: 92%; height: 88%; border-radius: 1.2cqh; overflow: hidden; background: #F3F6F9; color: #0B2545; display: grid; grid-template-rows: auto 1fr; }
.d-laptop-bar { display: flex; align-items: center; gap: 1cqh; padding: 1.4cqh 2cqh; background: #E2E8EE; font: 500 2.8cqh/1 var(--font-sans); color: #4A5D73; }
.d-laptop-bar i { width: 1.6cqh; height: 1.6cqh; border-radius: 50%; background: #B8C4D0; }
.d-laptop-bar span { margin-left: 1.5cqh; }
.d-laptop-slide { display: flex; flex-direction: column; justify-content: center; gap: 2cqh; padding: 6cqh 8cqh; }
.dl-kicker { font: 600 3cqh/1 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: #0A6A9E; }
.dl-title { font: 600 9cqh/1.05 var(--font-display); letter-spacing: -0.03em; }
.dl-list { font: 400 4cqh/1.4 var(--font-sans); color: #4A5D73; }
.d-screen.video .d-laptop-slide { background: linear-gradient(135deg, #13315C, #1F4E85); color: #fff; }
.d-screen.video .dl-kicker { color: #8DE0FF; } .d-screen.video .dl-list { color: #C9D6E3; }
.d-off { background: #000; display: grid; place-items: end start; padding: 4cqh; }
.d-off span { font: 500 3cqh/1 var(--font-sans); color: #ffffff33; }
.d-alert {
  --lvl: #B91C1C; background: var(--lvl); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 3.5cqh; padding: 0 7%; transition: background-color .4s ease; animation: d-in .35s ease;
}
.d-alert[data-level="warning"] { --lvl: #C2410C; }
.d-alert[data-level="info"] { --lvl: #1D4ED8; }
.d-alert[data-level="success"] { --lvl: #15803D; }
.d-alert .kind { font: 700 4.4cqh/1 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.d-alert .big { font: 700 13cqh/1 var(--font-display); letter-spacing: -0.02em; }
.d-alert .msg { font: 500 5.4cqh/1.3 var(--font-sans); max-width: 85%; }
.d-alert.banner { top: auto; height: 26%; flex-direction: row; justify-content: flex-start; gap: 3cqh; text-align: left; padding: 0 4cqh; }
.d-alert.banner .kind { display: none; }
.d-alert.banner .big { font-size: 7cqh; flex: none; }
.d-alert.banner .msg { font-size: 4cqh; max-width: none; }
.d-identify {
  position: absolute; inset: 0; display: grid; place-items: center; background: #0A6A9Ee6; color: #fff;
  font: 600 14cqh/1 var(--font-display); letter-spacing: -0.03em; animation: d-in .3s ease;
}
.d-identify[hidden] { display: none; }
.d-pin-corner { position: absolute; right: 2.6cqh; top: 2.6cqh; padding: 1cqh 2.2cqh; border-radius: 1.4cqh; background: #0B2545cc; color: #C9D6E3; font: 500 3cqh/1.3 var(--font-sans); }
.d-pin-corner b { color: #fff; letter-spacing: .25em; margin-left: .6cqh; font-size: 3.6cqh; }
.d-pin-corner[hidden] { display: none; }
.d-progress { position: absolute; left: 0; right: 0; bottom: 0; height: .8cqh; background: #ffffff12; }
.d-progress i { display: block; height: 100%; width: 0; background: var(--sky); }
@keyframes d-in { from { opacity: 0; } to { opacity: 1; } }

/* activity log */
.d-log { background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; }
.d-log-title { font: 600 12px/1.3 var(--font-sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); margin-bottom: 8px; }
.d-log ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 168px; overflow-y: auto; }
.d-log li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; font-size: 14px; line-height: 1.45; }
.d-log li .mono { color: var(--ink-muted); font-size: 12px; padding-top: 2px; }
.d-log li.new { animation: d-in .4s ease; }

@media (prefers-reduced-motion: reduce) {
  .d-content .d-slide, .d-slide > *, .d-push, .d-share, .d-alert, .d-identify, .d-log li.new { transition: none; animation: none; }
  .d-ticker .trk { animation: none; }
}

/* keep each layer's own stacking inside it, and order the layers */
.d-content { isolation: isolate; z-index: 0; }
.d-push { z-index: 2; } .d-share { z-index: 3; } .d-off { z-index: 4; } .d-alert { z-index: 5; }
.d-pin-corner { z-index: 6; } .d-identify { z-index: 7; } .d-progress { z-index: 6; }
