@import url('screen-layout-generated.css');

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ============================ Public display ============================ */
.display-body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
html, body.display-body { height: 100%; }

/* The screen renders as a true fixed-ratio box (set via --arw / --arh),
   scaled to fit the viewport and letterboxed in black. On a screen physically
   mounted at that ratio it fills the display exactly. */
.screen-root {
  display: flex;
  flex-direction: column;
  width: min(100vw, calc(100vh * var(--arw, 16) / var(--arh, 9)));
  height: min(100vh, calc(100vw * var(--arh, 9) / var(--arw, 16)));
  border: 6px solid;
  overflow: hidden;
  background: var(--screen-bg, #111);
  color: var(--screen-text, #fff);
  font-family: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
  --hyst-title-width: 90%;
}

/* Poll chart theme: background, poll title, and donut legend colours.
   Bar mode keeps option text on the bars — contrast is handled per fill colour. */
.screen-root.screen-theme-default,
.screen-root.screen-theme-dark {
  --screen-bg: #111;
  --screen-text: #fff;
  --screen-option-text: #e8eaed;
  --screen-divider: rgba(255, 255, 255, 0.14);
  --screen-credit-text: #e2e8f0;
  --screen-scan-text: #e2e8f0;
  --screen-votes-text: #b0bcc9;
  --screen-qr-bg: transparent;
  --screen-qr-shadow: 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 20px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.28);
  --screen-qr-dark: #111111;
  --screen-qr-light: #ffffff;
}
.screen-root.screen-theme-light {
  --screen-bg: #fff;
  --screen-text: #0f172a;
  --screen-option-text: #334155;
  --screen-divider: rgba(15, 23, 42, 0.12);
  --screen-credit-text: #475569;
  --screen-scan-text: #334155;
  --screen-votes-text: #64748b;
  --screen-qr-bg: transparent;
  --screen-qr-shadow: 0 1px 0 rgba(255, 255, 255, 1), 0 5px 16px rgba(15, 23, 42, 0.14), 0 2px 5px rgba(15, 23, 42, 0.08);
  --screen-qr-dark: #0f172a;
  --screen-qr-light: #ffffff;
}
.screen-root.screen-theme-pastel {
  --screen-bg: #f3e8ff;
  --screen-text: #1e1b4b;
  --screen-option-text: #4338ca;
  --screen-divider: rgba(67, 56, 202, 0.18);
  --screen-credit-text: #5b4b8a;
  --screen-scan-text: #4338ca;
  --screen-votes-text: #6d28d9;
  --screen-qr-bg: transparent;
  --screen-qr-shadow: 0 1px 0 rgba(255, 255, 255, 0.92), 0 6px 18px rgba(91, 33, 182, 0.34), 0 2px 5px rgba(91, 33, 182, 0.18);
  --screen-qr-dark: #5b21b6;
  --screen-qr-light: #faf5ff;
}
.screen-question { color: var(--screen-text, #fff); }
/* Donut legend only — bar mode hides .screen-options and uses in-bar contrast. */
.screen-root:not(.screen-bar-inline) .screen-option { color: var(--screen-option-text, #e8eaed); }
/* Scan + vote count on themed backgrounds (portrait bar footer, landscape bar, square donut). */
.screen-bar-scan,
.screen-landscape.screen-bar-inline .screen-qr-heading,
.screen-square:not(.screen-bar-inline) .screen-qr-heading {
  color: var(--screen-scan-text, #e2e8f0);
}
.screen-votes-footer,
.screen-landscape.screen-bar-inline .screen-votes,
.screen-square:not(.screen-bar-inline) .screen-votes {
  color: var(--screen-votes-text, #b0bcc9);
}
.screen-theme-light .screen-empty,
.screen-theme-pastel .screen-empty { color: var(--screen-text); opacity: 0.65; }

.screen-title-bar {
  flex-shrink: 0;
  padding-block: 1rem;
  padding-inline: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}
.screen-title-bar h1 {
  display: inline-block;
  width: fit-content;
  max-width: var(--hyst-title-width);
  margin: 0;
  box-sizing: border-box;
  text-align: center;
  font-size: clamp(0.85rem, 2.8vmin, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  hyphens: auto;
}
/* Homepage featured embeds: brand colour strip only, no title text. */
.screen-title-bar-compact {
  padding: 0;
  min-height: clamp(0.55rem, 2.2vmin, 0.95rem);
}
.screen-title-bar-challenge h1 {
  font-size: clamp(0.85rem, 2.8vmin, 2.35rem);
  letter-spacing: 0.05em;
}

/* Bar charts (kiosk reference): rule under screen title when title bar is white. */
.screen-root.screen-bar-inline:not(.screen-compact) {
  --screen-title-rule: var(--screen-divider);
}
.screen-root.screen-theme-light.screen-bar-inline:not(.screen-compact),
.screen-root.screen-theme-pastel.screen-bar-inline:not(.screen-compact) {
  --screen-title-rule: rgba(15, 23, 42, 0.24);
}
.screen-root.screen-bar-inline:not(.screen-compact) .screen-title-bar-white {
  flex-direction: column;
  align-items: center;
  padding-block: clamp(0.85rem, 2.5vmin, 1.35rem) 0;
  padding-inline: 0;
}
.screen-root.screen-bar-inline:not(.screen-compact) .screen-title-bar-white h1 {
  border-bottom: 1px solid var(--screen-title-rule);
  padding-bottom: clamp(0.55rem, 1.8vmin, 0.85rem);
}
.screen-bar-inline .screen-question {
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.01em;
}
.screen-bar-inline .screen-bar-lbl {
  font-weight: 600;
}
.screen-bar-inline .screen-bar-pct {
  font-weight: 700;
}

/* Bar charts: poll question centred in gap between screen title and first bar. */
.screen-bar-inline {
  --hyst-question-gap-min: clamp(4rem, 20vmin, 8.5rem);
}
.screen-portrait.screen-bar-inline {
  --hyst-question-gap-min: clamp(5.5rem, 28vmin, 11rem);
}

/* LOCKED — 9:16 bar chart pt gap: poll title centred in 48% of content area. */
.screen-ratio-9-16.screen-bar-inline .screen-body {
  flex: 1 1 0;
  min-height: 0;
}
.screen-ratio-9-16.screen-bar-inline .screen-zone-question {
  flex: 0 0 var(--hyst-pt-gap);
  min-height: var(--hyst-pt-gap);
}

.screen-landscape.screen-bar-inline {
  --hyst-question-gap-min: clamp(3.75rem, 17vmin, 7.5rem);
}

.screen-bar-inline .screen-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  gap: 0;
}
.screen-bar-inline .screen-zone-question {
  flex: 1 1 auto;
  min-height: var(--hyst-question-gap-min, clamp(4rem, 20vmin, 8.5rem));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.5rem;
  margin: 0;
  border-bottom: none;
}
.screen-bar-inline .screen-zone-chart {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-top: 0;
}
.screen-bar-inline .screen-chart-wrap {
  height: auto;
}
.screen-bar-inline .screen-bar-rows {
  height: auto;
  flex: 0 0 auto;
}
.screen-bar-inline .screen-penalty-mid {
  flex-shrink: 0;
}
.screen-bar-inline .screen-zone-bottom {
  flex-shrink: 0;
}
/* Challenge penalty: between chart and QR — theme via --screen-votes-text. */
.screen-penalty {
  flex-shrink: 0;
  margin: 0;
  text-align: center;
  font-size: clamp(0.85rem, 1.55vw, 1.08rem);
  line-height: 1.4;
  font-weight: 400;
  color: var(--screen-votes-text, #b0bcc9);
  background: none;
  border: none;
  padding: clamp(0.3rem, 1vmin, 0.55rem) 0.75rem;
}
.screen-penalty-label { font-weight: 700; }
/* Bar charts: full-width row between chart and QR/footer. */
.screen-penalty-mid { display: none; }
.screen-bar-inline .screen-penalty-mid { display: block; }
.screen-bar-inline .screen-penalty-legend { display: none !important; }
/* Donut / non-bar: left-aligned with chart labels (not in the QR panel). */
.screen-penalty-legend { display: none; }
.screen-challenge:not(.screen-bar-inline) .screen-penalty-legend { display: block; }

/* ==========================================================================
   LOCKED — 16:9 bar chart layout (.screen-ratio-16-9.screen-bar-inline)
   Values: config/screen-layout-params.json → screen-layout-generated.css
   ========================================================================== */
.screen-ratio-16-9.screen-bar-inline .screen-body {
  flex: 1 1 0;
  min-height: 0;
}
.screen-ratio-16-9.screen-bar-inline .screen-zone-question {
  flex: 0 0 var(--hyst-pt-gap);
  min-height: var(--hyst-pt-gap);
}
.screen-ratio-16-9.screen-bar-inline .screen-zone-bottom {
  margin-top: auto;
}
.screen-ratio-16-9.screen-bar-inline .screen-bar-rows {
  width: var(--hyst-bar-rows-width, 100%);
  padding: 0 0.35rem;
}
.screen-ratio-16-9.screen-challenge.screen-bar-inline .screen-penalty-mid {
  margin-top: var(--hyst-16x9-chart-penalty-gap);
}

.screen-portrait.screen-bar-inline.screen-challenge .screen-zone-chart {
  flex: 0 0 auto;
}
.screen-portrait.screen-bar-inline.screen-challenge .screen-zone-question {
  padding: 0 0.5rem;
}
.screen-compact.screen-challenge .screen-penalty-legend { display: none !important; }
.screen-compact.screen-challenge .screen-penalty-mid {
  display: block !important;
}
/* Homepage 9:16 donut — penalty below labels, smaller type. */
.screen-compact.screen-portrait.screen-challenge:not(.screen-bar-inline) .screen-penalty-mid {
  display: none !important;
}
.screen-compact.screen-portrait.screen-challenge:not(.screen-bar-inline) .screen-penalty-legend {
  display: block !important;
  order: 2;
  flex: 0 0 auto;
  text-align: left;
  padding: 0.15rem 0.35rem 0;
  font-size: clamp(0.52rem, 2.1vw, 0.68rem);
  line-height: 1.25;
}
.screen-compact.screen-portrait.screen-challenge:not(.screen-bar-inline) .screen-zone-bottom {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.2rem;
  padding: 0 0.35rem 0.3rem;
  min-height: 0;
}
.screen-compact.screen-portrait.screen-challenge:not(.screen-bar-inline) .screen-options {
  order: 1;
  flex: 0 0 auto;
  justify-content: flex-start;
  gap: clamp(0.2rem, 1vmin, 0.35rem);
  padding: 0;
}
.screen-compact.screen-portrait.screen-challenge:not(.screen-bar-inline) .screen-option {
  font-size: clamp(0.58rem, 2.2vw, 0.75rem);
}
.screen-compact.screen-portrait:not(.screen-bar-inline) .screen-zone-question {
  flex: 0 0 20%;
}
.screen-compact.screen-portrait:not(.screen-bar-inline) .screen-zone-chart {
  flex: 1 1 auto;
  min-height: 0;
}
.screen-compact.screen-portrait:not(.screen-bar-inline) .screen-body {
  gap: 0.25rem;
  padding: 0.35rem 0.45rem 0.35rem;
}
/* Homepage 9:16 bar — smaller penalty between chart and bottom. */
.screen-compact.screen-portrait.screen-challenge.screen-bar-inline .screen-penalty-mid {
  font-size: clamp(0.52rem, 2vw, 0.66rem);
  line-height: 1.25;
  padding: 0.15rem 0.45rem 0.1rem;
}
.screen-compact.screen-challenge .screen-title-bar-challenge {
  min-height: auto;
  padding-block: clamp(0.35rem, 1.2vmin, 0.65rem);
  padding-inline: 0;
}
.screen-compact.screen-challenge .screen-title-bar-challenge h1 {
  font-size: clamp(0.75rem, 2.8vw, 1.15rem);
}
/* Homepage featured embeds: poll chart only — no QR, scan line, votes, or credit. */
.screen-compact .screen-qr-panel,
.screen-compact .screen-bar-subtext,
.screen-compact .screen-footer {
  display: none !important;
}
.screen-compact.screen-landscape.screen-bar-inline .screen-zone-bottom {
  display: none !important;
}
.screen-compact.screen-portrait.screen-bar-inline .screen-body {
  padding-bottom: 0.35rem;
}
.screen-compact.screen-square:not(.screen-bar-inline) .screen-zone-bottom {
  justify-content: center;
}
.screen-compact.screen-landscape:not(.screen-bar-inline) .screen-body {
  grid-template-columns: 0.85fr 1fr;
  grid-template-areas:
    "title title"
    "chart keys";
}

/* Three zones: title (top), chart (middle), options + QR (bottom). */
.screen-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem 1rem;
  gap: 0.6rem;
}
.screen-zone { min-height: 0; min-width: 0; }

.screen-zone-question { display: flex; align-items: center; justify-content: center; text-align: center; }
.screen-question { margin: 0; font-weight: 800; line-height: 1.15; }

.screen-zone-chart { position: relative; display: flex; align-items: center; justify-content: center; }
.screen-chart-wrap { position: relative; width: 100%; height: 100%; }
.screen-chart-wrap canvas { display: block; }

.screen-zone-bottom { display: flex; gap: 1rem; }

.screen-options {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.45rem;
}
.screen-option { display: flex; align-items: center; gap: 0.5rem; font-size: clamp(0.8rem, 1.7vw, 1.15rem); }
.screen-option .sw { width: 0.9em; height: 0.9em; border-radius: 3px; flex-shrink: 0; }
.screen-option .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen-option .pct { font-weight: 800; flex-shrink: 0; }

.screen-qr-panel {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.25rem;
  background: transparent;
  color: inherit;
  border: none;
  border-radius: 0;
  box-shadow: none;
}
.screen-qr-heading { margin: 0; font-size: clamp(0.8rem, 1.5vw, 1rem); font-weight: 700; text-align: center; }
.screen-root:not(.screen-bar-inline) .screen-qr-panel .screen-qr-heading {
  color: var(--screen-scan-text, #e2e8f0);
}
.screen-root:not(.screen-bar-inline) .screen-qr-panel .screen-votes {
  color: var(--screen-votes-text, #b0bcc9);
}
.screen-qr-box,
.screen-qr-footer {
  flex: 0 0 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}
/* Donut / side-panel layouts: QR cell may grow within its column. */
.screen-root:not(.screen-bar-inline) .screen-qr-box {
  flex: 1;
}
/* All rendered QR codes: themed modules + embossed drop shadow, no box frame. */
.screen-qr-glyph,
.screen-qr-box canvas,
.screen-qr-box img,
.screen-qr-box table,
.screen-qr-footer canvas,
.screen-qr-footer img,
.screen-qr-footer table {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border: none;
  border-radius: 8px;
  box-shadow: var(--screen-qr-shadow, none);
}
.screen-votes { margin: 0; font-size: clamp(0.75rem, 1.3vw, 0.95rem); color: var(--screen-votes-text, #555); text-align: center; }

/* Portrait (9:16, 3:4): clean vertical thirds. Values from screen-layout-generated.css */
.screen-portrait:not(.screen-bar-inline) .screen-zone-question { flex: 0 0 var(--hyst-question-zone, 30%); }
.screen-portrait:not(.screen-bar-inline) .screen-zone-chart    { flex: 1 1 var(--hyst-chart-zone, 53.5%); }
.screen-portrait:not(.screen-bar-inline) .screen-zone-bottom   { flex: 0 0 var(--hyst-bottom-zone, 16.5%); flex-direction: row; }
.screen-portrait:not(.screen-bar-inline) .screen-question { font-size: var(--hyst-poll-question-font, clamp(1.3rem, 5vw, 2.6rem)); }
.screen-portrait .screen-qr-panel { aspect-ratio: 1 / 1; height: 100%; }

/* Landscape (16:9, 4:3): title full width; chart, keys, and QR each get
   their own column. Numeric values from screen-layout-generated.css. */
.screen-landscape .screen-body {
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "title title title"
    "chart keys  qr";
  column-gap: 0.75rem;
  row-gap: 1.25rem;
}
.screen-landscape:not(.screen-bar-inline):not(.screen-square) .screen-body {
  grid-template-columns: var(--hyst-grid-columns, 0.85fr 1fr auto);
}
.screen-landscape .screen-zone-question { grid-area: title; align-items: center; padding-top: 0.25rem; }
.screen-landscape:not(.screen-bar-inline):not(.screen-square) .screen-zone-question,
.screen-landscape:not(.screen-bar-inline):not(.screen-square) .screen-zone-chart,
.screen-landscape:not(.screen-bar-inline):not(.screen-square) .screen-options {
  margin-top: var(--hyst-donut-content-offset, 25px);
}
.screen-landscape .screen-zone-chart    { grid-area: chart; }
.screen-landscape:not(.screen-bar-inline):not(.screen-square) .screen-chart-wrap {
  width: var(--hyst-donut-size, 80%);
  height: var(--hyst-donut-size, 80%);
  margin: auto;
}
.screen-landscape .screen-zone-bottom   { display: contents; }
.screen-landscape .screen-options {
  grid-area: keys;
  flex: 1 1 auto;
  justify-content: flex-start;
  gap: 0.85rem;
  padding-left: 1.25rem;
  padding-right: 0.5rem;
  padding-top: var(--hyst-legend-padding-top, 10%);
}
.screen-landscape:not(.screen-bar-inline):not(.screen-square) .screen-option {
  font-size: var(--hyst-option-label-font, clamp(1.2rem, 2.6vw, 2.05rem));
  align-items: flex-start;
}
.screen-landscape .screen-option { font-size: clamp(1.2rem, 2.6vw, 2.05rem); align-items: flex-start; }
.screen-landscape .screen-option .lbl { flex: 0 1 auto; white-space: normal; overflow: visible; text-overflow: clip; }
.screen-landscape .screen-option .pct { margin-left: 1.25rem; }
.screen-landscape:not(.screen-bar-inline):not(.screen-square) .screen-question {
  font-size: var(--hyst-poll-question-font, clamp(1.8rem, 5vw, 4.5rem));
}
.screen-landscape .screen-question { font-size: clamp(1.8rem, 5vw, 4.5rem); }
/* Donut challenge: penalty left-aligned with labels, vertically level with scan line. */
.screen-landscape.screen-challenge:not(.screen-bar-inline) .screen-penalty-legend {
  grid-area: keys;
  align-self: end;
  justify-self: start;
  text-align: left;
  padding: 0 0.5rem 0 1.25rem;
  margin-bottom: var(--hyst-donut-scan-stack, calc(clamp(100px, 16vmin, 180px) + 1.25rem));
  width: 100%;
  box-sizing: border-box;
}
.screen-landscape .screen-qr-panel { grid-area: qr; flex: 0 0 auto; align-self: end; justify-self: end; }
.screen-landscape:not(.screen-bar-inline):not(.screen-square) .screen-qr-box {
  flex: 0 0 auto;
  width: var(--hyst-qr-size, clamp(100px, 16vmin, 180px));
  height: var(--hyst-qr-size, clamp(100px, 16vmin, 180px));
}
.screen-landscape .screen-qr-box { flex: 0 0 auto; width: clamp(100px, 16vmin, 180px); height: clamp(100px, 16vmin, 180px); }

/* Square 1:1 donut: title → centred donut → legend + QR in lower third. */
.screen-square:not(.screen-bar-inline) .screen-body {
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.65rem 0.45rem;
  gap: 0.35rem;
}
.screen-square:not(.screen-bar-inline) .screen-zone-question {
  flex: 0 0 var(--hyst-question-zone, 18%);
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.25rem 0.5rem 0;
}
.screen-square:not(.screen-bar-inline) .screen-question {
  font-size: var(--hyst-poll-question-font, clamp(1.35rem, 5.2vw, 2.85rem));
  text-align: center;
}
.screen-square:not(.screen-bar-inline) .screen-zone-chart {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.screen-square:not(.screen-bar-inline) .screen-chart-wrap {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: auto;
  aspect-ratio: 1 / 1;
}
.screen-square:not(.screen-bar-inline) .screen-zone-bottom {
  display: flex;
  flex: 0 0 var(--hyst-bottom-zone, 24%);
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.65rem 1rem;
  padding: 0.15rem 0.5rem 0.35rem;
  min-height: 0;
}
.screen-square:not(.screen-bar-inline) .screen-options {
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
  gap: clamp(0.35rem, 1.5vmin, 0.65rem);
  padding: 0;
}
.screen-square:not(.screen-bar-inline) .screen-option {
  font-size: var(--hyst-option-label-font, clamp(0.75rem, 2vw, 1.05rem));
  align-items: center;
}
.screen-square:not(.screen-bar-inline) .screen-option .pct { margin-left: 0.65rem; }
.screen-square:not(.screen-bar-inline) .screen-qr-panel {
  flex: 0 1 auto;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 0.65rem 0.85rem;
  max-width: none;
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
}
.screen-square:not(.screen-bar-inline) .screen-qr-heading {
  margin: 0;
  font-size: clamp(0.72rem, 1.4vw, 0.92rem);
  font-weight: 600;
  white-space: nowrap;
}
.screen-square:not(.screen-bar-inline) .screen-qr-box {
  width: var(--hyst-qr-size, clamp(52px, 11vmin, 84px));
  height: var(--hyst-qr-size, clamp(52px, 11vmin, 84px));
  min-width: var(--hyst-qr-size, clamp(52px, 11vmin, 84px));
  min-height: var(--hyst-qr-size, clamp(52px, 11vmin, 84px));
  flex: 0 0 auto;
}
.screen-square:not(.screen-bar-inline) .screen-votes {
  margin: 0;
  font-size: clamp(0.68rem, 1.2vw, 0.85rem);
  white-space: nowrap;
}

/* Bar chart: shared pill bars (all ratios). Portrait 9:16 / 3:4 gets the full
   reference layout; landscape bar layout is interim until designed separately. */
.screen-bar-inline .screen-options { display: none; }
.screen-bar-inline .screen-chart-wrap { width: 100%; height: 100%; margin: 0; }

/* Portrait bar (9:16, 3:4): reference layout — footer QR, vertical stack. */
.screen-portrait.screen-bar-inline .screen-zone-bottom { display: none !important; }
.screen-portrait.screen-bar-inline .screen-zone-question {
  text-align: center;
}
.screen-portrait.screen-bar-inline .screen-question {
  text-align: center;
  width: 100%;
  font-size: var(--hyst-poll-question-font, clamp(1.45rem, 5.4vw, 3.1rem));
  font-weight: 500;
}
.screen-portrait.screen-bar-inline .screen-zone-chart { flex: 0 0 auto; }
.screen-portrait.screen-bar-inline .screen-body { padding-bottom: 0.2rem; }
.screen-portrait.screen-bar-inline .screen-footer {
  margin-top: -0.45rem;
  padding: 0.15rem 0.5rem 0.3rem;
}
.screen-portrait.screen-bar-inline .screen-bar-subtext {
  padding: 0.1rem 0.75rem 0.2rem;
  margin-bottom: 0.6rem;
}
.screen-portrait.screen-bar-inline .screen-credit {
  margin-top: 0.2rem;
}

/* Landscape bar: vertical stack — full-width chart, centred scan row. */
.screen-landscape.screen-bar-inline .screen-body {
  display: flex;
  flex-direction: column;
  grid-template-columns: unset;
  grid-template-rows: unset;
  grid-template-areas: unset;
  align-items: stretch;
  padding: 0.45rem 0.65rem 0.55rem;
  gap: 0;
}
.screen-landscape.screen-bar-inline .screen-zone-question {
  grid-area: unset;
  width: 100%;
}
.screen-landscape.screen-bar-inline .screen-zone-chart {
  grid-area: unset;
  width: 100%;
}
.screen-landscape.screen-bar-inline .screen-chart-wrap {
  width: 100%;
  height: auto;
  margin: 0;
}
.screen-landscape.screen-bar-inline .screen-zone-bottom {
  display: flex;
  grid-area: unset;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  width: 100%;
  margin-bottom: 0.75rem;
  padding-bottom: 0.25rem;
}
.screen-landscape.screen-bar-inline .screen-question {
  text-align: center;
  width: 100%;
  font-weight: 500;
}
.screen-landscape.screen-bar-inline .screen-zone-chart {
  width: 100%;
}
.screen-landscape.screen-bar-inline .screen-bar-rows {
  gap: clamp(0.9rem, 2.8vmin, 1.55rem);
  padding: 0;
  width: var(--hyst-bar-rows-width, 96%);
  margin: 0 auto;
}
.screen-landscape.screen-bar-inline .screen-bar-track {
  height: clamp(2.85rem, 7.5vmin, 4.5rem);
}
.screen-landscape.screen-bar-inline .screen-bar-lbl,
.screen-landscape.screen-bar-inline .screen-bar-pct {
  font-size: clamp(0.95rem, 2.4vw, 1.55rem);
}
.screen-landscape.screen-bar-inline .screen-qr-panel {
  flex: 0 0 auto;
  width: auto;
  max-width: 100%;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  align-self: center;
  grid-area: unset;
  justify-self: unset;
  gap: 0.5rem 0.75rem;
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
}
.screen-landscape.screen-bar-inline .screen-qr-heading {
  margin: 0;
  font-size: clamp(0.85rem, 1.65vw, 1.15rem);
  font-weight: 500;
  white-space: nowrap;
}
.screen-landscape.screen-bar-inline .screen-qr-box {
  width: var(--hyst-qr-size-landscape-bar, clamp(72px, 12vmin, 104px));
  height: var(--hyst-qr-size-landscape-bar, clamp(72px, 12vmin, 104px));
  min-width: var(--hyst-qr-size-landscape-bar, clamp(72px, 12vmin, 104px));
  min-height: var(--hyst-qr-size-landscape-bar, clamp(72px, 12vmin, 104px));
  flex: 0 0 auto;
}
.screen-landscape.screen-bar-inline .screen-votes {
  margin: 0;
  font-size: clamp(0.78rem, 1.35vw, 0.98rem);
  white-space: nowrap;
}

.screen-bar-rows {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.65rem, 2vmin, 1.25rem);
  width: 100%;
  height: 100%;
  padding: 0.25rem 0.35rem;
}
.screen-bar-row { width: 100%; }
.screen-bar-track {
  position: relative;
  height: clamp(2.25rem, 5.5vmin, 3.75rem);
  border-radius: 10px;
  background: var(--bar-bg, #3a424d);
  overflow: hidden;
}
.screen-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--bar-fill, #888);
  border-radius: 10px 0 0 10px;
  min-width: 3px;
  z-index: 1;
}
.screen-bar-lbl {
  position: absolute;
  left: clamp(0.75rem, 2vw, 1.35rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  font-size: clamp(0.85rem, 2.2vw, 1.45rem);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 55%;
}
.screen-bar-pct {
  position: absolute;
  right: clamp(0.75rem, 2vw, 1.35rem);
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  color: #1a1a1a;
  font-weight: 800;
  font-size: clamp(0.85rem, 2.2vw, 1.45rem);
}

/* Footer subtext: scan line + QR + vote count (portrait bar mode only). */
.screen-bar-subtext {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.5rem 0.75rem;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  padding: 0.25rem 0.75rem 0.15rem;
}
.screen-bar-scan {
  font-size: clamp(0.75rem, 1.4vw, 0.95rem);
  font-weight: 500;
}
.screen-votes-footer {
  margin: 0;
  font-size: clamp(0.7rem, 1.2vw, 0.88rem);
}
.screen-qr-footer {
  width: clamp(72px, 12vmin, 100px);
  height: clamp(72px, 12vmin, 100px);
  flex-shrink: 0;
}

/* Admin preview: themed QR stubs (all layouts). */
body.preview-mode .screen-qr-stub.screen-qr-footer,
body.preview-mode .screen-qr-stub .screen-qr-box {
  width: 2.25rem;
  height: 2.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  background: var(--screen-qr-light, #faf5ff);
  border: none;
  border-radius: 8px;
  box-shadow: var(--screen-qr-shadow, none);
  position: relative;
  flex-shrink: 0;
}
body.preview-mode .screen-qr-stub.screen-qr-footer::after,
body.preview-mode .screen-qr-stub .screen-qr-box::after {
  content: 'QR';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.5rem;
  font-weight: 700;
  color: var(--screen-qr-dark, #444);
  letter-spacing: 0.03em;
  border-radius: 8px;
}
body.preview-mode .screen-square:not(.screen-bar-inline) .screen-qr-stub .screen-qr-box,
body.preview-mode .screen-landscape.screen-bar-inline .screen-qr-stub .screen-qr-box {
  width: clamp(1.75rem, 10vmin, 2.25rem);
  height: clamp(1.75rem, 10vmin, 2.25rem);
  min-width: 1.75rem;
  min-height: 1.75rem;
}
body.preview-mode .screen-bar-lbl,
body.preview-mode .screen-bar-pct { font-size: clamp(0.65rem, 1.8vw, 1rem); }
body.preview-mode .screen-bar-track {
  height: clamp(1.65rem, 4.2vmin, 2.35rem);
  border-radius: 10px;
}
body.preview-mode .screen-bar-fill { border-radius: 10px 0 0 10px; }
body.preview-mode .screen-bar-rows { gap: clamp(0.4rem, 1.4vmin, 0.75rem); }

/* Admin live-preview iframe: fill the frame; QR is a tiny stub (real QR on displays). */
body.preview-mode { overflow: hidden; }
body.preview-mode .screen-root {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-width: 4px;
}
body.preview-mode .screen-credit,
body.preview-mode #hyst-counter { display: none; }
body.preview-mode .screen-footer { padding: 0.15rem 0.25rem; min-height: 0; }
body.preview-mode .screen-landscape .screen-body {
  grid-template-columns: 1fr auto;
  row-gap: 0.5rem;
  padding-bottom: 0.25rem;
}
body.preview-mode .screen-landscape.screen-bar-inline .screen-body {
  display: flex;
  flex-direction: column;
  grid-template-columns: unset;
  grid-template-areas: unset;
}
body.preview-mode .screen-square:not(.screen-bar-inline) .screen-body {
  display: flex;
  flex-direction: column;
  grid-template-columns: unset;
  grid-template-areas: unset;
}
body.preview-mode .screen-square:not(.screen-bar-inline) .screen-question {
  font-size: clamp(1rem, 3.8vw, 1.75rem);
}
body.preview-mode .screen-square:not(.screen-bar-inline) .screen-option {
  font-size: clamp(0.55rem, 1.6vw, 0.85rem);
}
body.preview-mode .screen-square:not(.screen-bar-inline) .screen-qr-stub {
  flex-direction: row;
  align-items: center;
  gap: 0.35rem 0.5rem;
  background: transparent;
  padding: 0;
}
body.preview-mode .screen-square:not(.screen-bar-inline) .screen-qr-stub .screen-qr-heading,
body.preview-mode .screen-square:not(.screen-bar-inline) .screen-qr-stub .screen-votes,
body.preview-mode .screen-square:not(.screen-bar-inline) .screen-qr-stub #hyst-votes {
  display: block !important;
  font-size: clamp(0.5rem, 1.3vw, 0.7rem);
}
body.preview-mode .screen-landscape:not(.screen-bar-inline) .screen-body {
  grid-template-columns: var(--hyst-grid-columns, 0.7fr 1.2fr auto);
}
body.preview-mode .screen-ratio-16-9.screen-challenge:not(.screen-bar-inline) .screen-penalty-legend,
body.preview-mode .screen-landscape.screen-challenge:not(.screen-bar-inline) .screen-penalty-legend {
  max-width: 92%;
}
body.preview-mode .screen-landscape .screen-options {
  padding-top: var(--hyst-legend-padding-top, 4%);
  gap: 0.45rem;
}
body.preview-mode .screen-landscape:not(.screen-bar-inline) .screen-option {
  font-size: var(--hyst-option-label-font, clamp(0.7rem, 2vw, 1.15rem));
}
body.preview-mode .screen-landscape:not(.screen-bar-inline) .screen-question {
  font-size: var(--hyst-poll-question-font, clamp(0.95rem, 3.2vw, 1.85rem));
}
/* Admin preview iframe: smaller penalty so it does not overlap the legend. */
body.preview-mode .screen-challenge .screen-penalty-mid,
body.preview-mode .screen-challenge .screen-penalty-legend {
  font-size: clamp(0.5rem, 1.35vw, 0.72rem);
  line-height: 1.25;
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
}
body.preview-mode .screen-portrait .screen-question { font-size: clamp(0.95rem, 3.5vw, 1.65rem); }
body.preview-mode .screen-bar-inline {
  --hyst-question-gap-min: clamp(1.75rem, 14vmin, 3.75rem);
}
body.preview-mode .screen-portrait.screen-bar-inline {
  --hyst-question-gap-min: clamp(2rem, 18vmin, 4.25rem);
}
body.preview-mode .screen-ratio-9-16.screen-bar-inline .screen-body {
  flex: 1 1 0;
  min-height: 0;
}
body.preview-mode .screen-ratio-9-16.screen-bar-inline .screen-zone-question {
  flex: 0 0 var(--hyst-pt-gap);
  min-height: var(--hyst-pt-gap);
}
body.preview-mode .screen-ratio-16-9.screen-bar-inline .screen-body {
  flex: 1 1 0;
  min-height: 0;
}
body.preview-mode .screen-ratio-16-9.screen-bar-inline .screen-zone-question {
  flex: 0 0 var(--hyst-pt-gap);
  min-height: var(--hyst-pt-gap);
}
body.preview-mode .screen-portrait.screen-bar-inline .screen-question {
  font-size: clamp(1.05rem, 4.2vw, 1.9rem);
  text-align: center;
}
body.preview-mode .screen-landscape.screen-bar-inline .screen-body {
  display: flex;
  flex-direction: column;
  grid-template-columns: unset;
  grid-template-rows: unset;
  grid-template-areas: unset;
  overflow: hidden;
  min-height: 0;
  flex: 1 1 0;
  padding: 0.2rem 0.45rem 0.3rem;
  gap: 0;
}
body.preview-mode .screen-landscape.screen-bar-inline .screen-chart-wrap {
  width: 100%;
  height: auto;
  margin: 0;
}
body.preview-mode .screen-ratio-16-9.screen-bar-inline .screen-bar-rows {
  width: var(--hyst-bar-rows-width, 100%);
  padding: 0 0.15rem;
}
}
body.preview-mode .screen-landscape.screen-bar-inline .screen-bar-rows {
  gap: clamp(0.2rem, 0.9vmin, 0.45rem);
  width: 96%;
}
body.preview-mode .screen-landscape.screen-bar-inline .screen-bar-track {
  height: clamp(1.1rem, 3.2vmin, 1.65rem);
}
body.preview-mode .screen-ratio-16-9.screen-challenge.screen-bar-inline .screen-penalty-mid {
  font-size: clamp(0.62rem, 1.5vw, 0.82rem);
  padding: 0.12rem 0.5rem;
}
body.preview-mode .screen-landscape.screen-bar-inline .screen-zone-bottom {
  margin-bottom: 0.15rem;
  padding-bottom: 0;
}
body.preview-mode .screen-title-bar {
  padding-block: 0.4rem;
  padding-inline: 0;
  font-size: clamp(0.62rem, 1.8vw, 0.85rem);
}
body.preview-mode .screen-landscape.screen-bar-inline .screen-question {
  font-size: clamp(0.72rem, 2.4vw, 1.15rem);
  line-height: 1.15;
}
body.preview-mode .screen-body {
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}
body.preview-mode .screen-landscape.screen-bar-inline .screen-qr-stub {
  flex-direction: row;
  align-items: center;
  gap: 0.35rem 0.5rem;
}
body.preview-mode .screen-landscape.screen-bar-inline .screen-qr-stub .screen-qr-heading,
body.preview-mode .screen-landscape.screen-bar-inline .screen-qr-stub .screen-votes,
body.preview-mode .screen-landscape.screen-bar-inline .screen-qr-stub #hyst-votes {
  display: block !important;
  font-size: clamp(0.55rem, 1.4vw, 0.75rem);
}
/* QR stub panel wrapper — transparent; glyph styling is unified above. */
body.preview-mode .screen-qr-stub {
  background: transparent;
  padding: 0;
  gap: 0;
  align-self: end;
  justify-self: end;
}
body.preview-mode .screen-qr-stub .screen-qr-heading,
body.preview-mode .screen-qr-stub .screen-votes,
body.preview-mode .screen-qr-stub #hyst-votes { display: none !important; }

.screen-footer { flex-shrink: 0; text-align: center; padding: 0.35rem 0.5rem 0.5rem; }
.screen-footer #hyst-counter { display: block; font-size: 0.85rem; opacity: 0.6; }
.screen-credit {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--screen-credit-text, #e2e8f0);
  opacity: 0.58;
}
.screen-credit a { color: inherit; text-decoration: none; }
.screen-empty { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; opacity: 0.7; }

/* Physical display standby (off-hours — not an error page) */
.display-standby { background: #0a0e12; }
.screen-standby-root { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.screen-standby-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem 1rem;
  gap: 0.65rem;
}
.screen-standby-icon {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 0.35rem;
  position: relative;
}
.screen-standby-icon::after {
  content: '';
  position: absolute;
  inset: 0.85rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  animation: standby-pulse 2.4s ease-in-out infinite;
}
@keyframes standby-pulse {
  0%, 100% { transform: scale(1); opacity: 0.55; }
  50% { transform: scale(1.08); opacity: 1; }
}
.screen-standby-headline {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #e8eaed;
  letter-spacing: -0.02em;
}
.screen-standby-message {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  color: #9fb0bf;
  max-width: 28rem;
  line-height: 1.45;
}
.screen-standby-detail {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: #6b7d8c;
  max-width: 32rem;
}
.screen-standby-countdown {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #7ec8f0;
  font-variant-numeric: tabular-nums;
}
.screen-standby-footer { opacity: 0.45; }

/* ============================ Admin ============================ */
.admin-root { min-height: 100vh; background: #0f1419; color: #e8eaed; }
.admin-root.center, .center { display: flex; align-items: center; justify-content: center; min-height: 100vh; }

.site-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 0;
}
.site-brand:hover { opacity: 0.9; }
.site-brand-logo {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
.page-title-row-center {
  justify-content: center;
  text-align: center;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}
.page-title-row-center .page-title-body { align-items: center; }
.page-title-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.page-title-body h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.25;
}
.page-back {
  font-size: 0.85rem;
  margin-bottom: 0.1rem;
}
.page-subtitle {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}
.page-subtitle p { margin: 0; }

.admin-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #2a3540;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.admin-header .page-title-body h1 { font-size: 1.35rem; }
.admin-main { max-width: 960px; margin: 0 auto; padding: 1.5rem; }

.card {
  background: #1a222c;
  border: 1px solid #2a3540;
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.card h2 { margin-top: 0; }
.login-card { width: min(400px, 90vw); }
.home-card { text-align: center; color: #e8eaed; }
.home-card h1 { margin-bottom: 0.25rem; }

.label { display: block; font-size: 0.85rem; margin-bottom: 0.35rem; opacity: 0.85; }
.input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid #3a4a5a;
  background: #0f1419;
  color: #fff;
  margin-bottom: 0.75rem;
}
.input.color { height: 48px; padding: 4px; }
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0.35rem 0 0.65rem;
  font-size: 0.85rem;
  font-weight: normal;
  line-height: 1.4;
  opacity: 0.85;
  cursor: pointer;
}
.checkbox input[type="checkbox"] { margin-top: 0.15rem; flex-shrink: 0; width: auto; }
.field-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  margin-left: 0.35rem;
  border-radius: 999px;
  background: #243240;
  color: #91a9b7;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
}
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 20;
  min-width: 220px;
  max-width: min(320px, 80vw);
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.35;
  white-space: normal;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
[data-tip]:hover::after,
[data-tip]:focus-visible::after { opacity: 1; }

.btn {
  display: inline-block;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  background: #91a9b7;
  color: #0b1a24;
  text-decoration: none;
}
.btn-secondary { background: transparent; border: 1px solid #91a9b7; color: #91a9b7; }
.btn-danger { background: #8b3a3a; color: #fff; }

/* Action feedback: press + working/busy state. */
.btn:active { transform: translateY(1px); }
.btn.is-busy { opacity: 0.6; cursor: progress; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Editor: settings on the left, sticky live preview on the right. */
.edit-top { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 1024px) {
  .edit-top { grid-template-columns: minmax(0, 1fr) minmax(320px, 460px); }
  .screen-preview-card { position: sticky; top: 1rem; }
}
.screen-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: min(70vh, 560px);
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  min-height: 180px;
}
.screen-preview iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Lifecycle status badges. */
.status { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.15rem 0.55rem; border-radius: 999px; }
.status-draft     { background: #2a2f37; color: #9fb0bf; }
.status-scheduled { background: #3a2f12; color: #f0c674; }
.status-live      { background: #13351f; color: #5fd08a; }
.status-ended     { background: #3a1f1f; color: #f59b9b; }
.status-onair     { background: #0e2a3a; color: #6cc6ff; }

.link { color: #91a9b7; text-decoration: none; }
.muted { opacity: 0.75; }
.small { font-size: 0.8rem; opacity: 0.7; }
.small a { color: #e2e8f0; text-decoration: underline; }
.small a:hover { color: #ffffff; }
.breakall { word-break: break-all; }
.error-text { color: #f88; margin-bottom: 0.75rem; }

.row { display: flex; align-items: center; }
.row.gap { gap: 0.5rem; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.row.wrap, .wrap { flex-wrap: wrap; }
.grow { flex: 1 1 200px; }

.grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.75rem; }
.grid.grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { .grid, .grid.grid-2 { grid-template-columns: 1fr; } }

.settings-readonly-list {
  display: grid;
  gap: 0.55rem 1rem;
  margin: 1rem 0 0;
  font-size: 0.88rem;
}
.settings-readonly-list > div {
  display: grid;
  grid-template-columns: minmax(7rem, 9rem) 1fr;
  gap: 0.5rem 0.75rem;
  align-items: baseline;
}
.settings-readonly-list dt {
  margin: 0;
  font-weight: 600;
  opacity: 0.75;
}
.settings-readonly-list dd { margin: 0; }

.form-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.75rem;
}
.form-actions-row form { margin: 0; }

.screen-polls-card .poll-add-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
  margin: 0.75rem 0 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #2a3540;
}
.screen-polls-card .poll-add-field {
  flex: 1 1 240px;
  min-width: 0;
}
.poll-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.poll-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid #2a3540;
}
.poll-list-item:last-child { border-bottom: none; }
.poll-list-title {
  flex: 1 1 220px;
  min-width: 0;
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.35;
}
.poll-list-title a {
  color: #c8d9e8;
  text-decoration: none;
  font-weight: 400;
}
.poll-list-title a:hover { color: #fff; text-decoration: underline; }
.poll-list-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.35rem 0.45rem;
}
.poll-control .label {
  margin-bottom: 0.15rem;
  font-size: 0.72rem;
}
.input-compact {
  width: auto;
  min-width: 5.5rem;
  padding: 0.3rem 0.45rem;
  font-size: 0.82rem;
  margin-bottom: 0;
}

.poll-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
  padding: 0.75rem 0;
  border-bottom: 1px solid #2a3540;
}
.poll-row:last-child { border-bottom: none; }

.flash { padding: 0.65rem 0.9rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.9rem; }
.flash-success { background: #1f3a2a; border: 1px solid #2f5c40; color: #b6f0c8; }
.flash-error { background: #3a1f1f; border: 1px solid #5c2f2f; color: #f0b6b6; }
.flash-info { background: #1f2c3a; border: 1px solid #2f455c; color: #b6d4f0; }
.bespoke-security-notice { margin: 0.75rem 0; }
.screen-share-codes-card .bespoke-regenerate-key { margin-top: 1rem; }

.search-bar { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 1rem; }
.search-bar .input { margin-bottom: 0; max-width: 420px; }

.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0 0; }
.chip { font-size: 0.72rem; padding: 0.15rem 0.5rem; border-radius: 999px; background: #243240; border: 1px solid #34465a; color: #b9cfe0; }
.chip-super { background: #3a2f1f; border-color: #5c4a2f; color: #f0d8b6; }

.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid #243240; vertical-align: middle; }
.admin-table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: #8aa0b3; }
.admin-actions { align-items: center; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.input-sm { padding: 0.3rem 0.5rem; font-size: 0.8rem; margin-bottom: 0; width: 160px; }
.status { font-size: 0.78rem; font-weight: 600; }
.status-active { color: #7fdca0; }
.status-suspended { color: #f0a6a6; }

/* ============================ Homepage / public ============================ */
.home-body {
  min-height: 100vh;
  background: #0b0f14;
  color: #e8eaed;
  overflow: auto;
  font-size: 1rem;
  line-height: 1.6;
}
.home-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.75rem 1.5rem 1.35rem;
  max-width: 1120px;
  margin: 0 auto;
  border-bottom: 1px solid #1d2a36;
}
.home-header h1 { margin: 0; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.2; letter-spacing: -0.02em; }
.home-header-branded {
  align-items: center;
  padding-top: 1.15rem;
  padding-bottom: 1.15rem;
}
.home-header-branded .page-title-body h1 { font-size: clamp(1.2rem, 2.5vw, 1.65rem); }
.home-tagline {
  margin: 0.5rem 0 0;
  max-width: 34rem;
  font-size: 0.975rem;
  line-height: 1.5;
  color: #9eb0c0;
}
.home-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  flex-shrink: 0;
  padding-top: 0.35rem;
  font-size: 0.9375rem;
}
.home-main { max-width: 1120px; margin: 0 auto; padding: 2rem 1.5rem 3.5rem; }
.center-text { text-align: center; }
.public-empty-state { text-align: center; max-width: 420px; margin: 2rem auto 0; }
.public-empty-state h1 { margin: 0 0 0.5rem; font-size: clamp(1.35rem, 3vw, 1.6rem); }
.public-empty-state p { margin: 0 0 1.25rem; color: #9eb0c0; line-height: 1.55; }

.home-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}
@media (max-width: 960px) {
  .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-screen { max-width: 320px; margin-inline: auto; }
}
.home-screen { margin: 0; display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.home-screen-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.home-screen-link:hover .home-frame { border-color: #4a6a8a; }
.home-screen-link:focus-visible {
  outline: 2px solid #7eb8e8;
  outline-offset: 3px;
}
.home-frame { width: 100%; aspect-ratio: 9 / 16; background: #000; border-radius: 10px; overflow: hidden; border: 1px solid #222; }
.home-frame iframe { width: 100%; height: 100%; border: 0; display: block; pointer-events: none; }
.home-screens-hint {
  margin: 1.25rem 0 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #91a9b7;
}
.copy-group { display: flex; gap: 0.4rem; }

.code-row { display: flex; gap: 0.5rem; align-items: flex-start; margin-bottom: 0.75rem; }
.code-row .code-box { flex: 1; margin-bottom: 0; }
.code-row .btn { white-space: nowrap; flex-shrink: 0; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px; cursor: pointer;
  background: #1a222c; border: 1px solid #34465a; color: #cfe0ee;
}
.icon-btn:hover { background: #243240; }
.icon-btn.copied { border-color: #2f5c40; color: #b6f0c8; }

/* Tooltip */
[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #000; color: #fff; padding: 0.3rem 0.5rem; border-radius: 6px;
  font-size: 0.72rem; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity 0.12s;
}
[data-tooltip]:hover::after, [data-tooltip].copied::after { opacity: 1; }

.prose { max-width: 42rem; line-height: 1.65; font-size: 1rem; color: #b7c6d4; }
.prose p { margin: 0 0 1.1rem; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: #e2eaf2; font-weight: 600; }
.prose .about-uses {
  margin: 0 0 1.1rem;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.65rem;
  color: #b7c6d4;
  line-height: 1.55;
  font-size: 1rem;
}
.prose .about-uses li { padding-left: 0.15rem; }
.prose .about-uses strong { color: #d4e0ea; }

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 2rem 2.5rem;
  align-items: start;
}
@media (max-width: 820px) {
  .about-layout { grid-template-columns: 1fr; gap: 2rem; }
  .about-carousel { max-width: 28rem; margin-inline: auto; width: 100%; }
}

.about-carousel {
  padding: 0;
  overflow: hidden;
  min-height: 280px;
  display: flex;
  align-items: stretch;
}
.about-carousel-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 280px;
  padding: 1.5rem;
  background: repeating-linear-gradient(
    -45deg,
    #121820,
    #121820 10px,
    #161e28 10px,
    #161e28 20px
  );
  border: 2px dashed #34465a;
  border-radius: inherit;
  text-align: center;
}
.about-carousel-placeholder-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 8px;
  background: #1a222c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b7488' stroke-width='1.5'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='8.5' cy='10' r='1.5'/%3E%3Cpath d='M21 16l-5.5-5.5L5 21'/%3E%3C/svg%3E") center / 2rem no-repeat;
}
.about-carousel-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0a0e12;
}
.about-carousel-track {
  position: relative;
  width: 100%;
  height: 100%;
}
.about-carousel-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.about-carousel-slide.is-active {
  opacity: 1;
}

.showcase-admin-grid {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.85rem;
}
.showcase-admin-item {
  margin: 0;
  padding: 0;
  border: 1px solid #2a3540;
  border-radius: 8px;
  overflow: hidden;
  background: #0f1419;
}
.showcase-admin-item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.showcase-admin-remove {
  padding: 0.45rem 0.5rem;
  margin: 0;
  text-align: center;
}
.showcase-admin-remove .btn { width: 100%; }

.home-plan-row-action {
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}
.home-plan-row-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}
.subscription-plans-panel h3 { margin: 0 0 1rem; font-size: 1.05rem; }
.subscription-checkout-card { padding: 1.5rem 1.35rem; }
.subscription-plans-panel .home-plan-row { font-size: 0.975rem; padding: 0.65rem 0; }
.subscription-plans-panel .home-plan-row strong { font-size: 1.05rem; }

/* ============================ Embed (other sizes) page ============================ */
.embed-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 2rem 2.5rem;
  align-items: start;
}
@media (max-width: 820px) { .embed-layout { grid-template-columns: 1fr; gap: 1.75rem; } }
.embed-controls h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #9eb0c0;
  margin: 1.5rem 0 0.65rem;
}
.embed-controls h2:first-child { margin-top: 0; }
.embed-controls .label { font-size: 0.875rem; }
.ratio-buttons { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.ratio-btn {
  padding: 0.4rem 0.7rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem;
  background: #1a222c; border: 1px solid #34465a; color: #cfe0ee;
}
.ratio-btn.active { background: #91a9b7; color: #0b1a24; border-color: #91a9b7; font-weight: 600; }
.code-box { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8rem; resize: vertical; }
.poll-list { list-style: none; padding: 0; margin: 0; }
.poll-list li { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid #243240; }
.poll-num { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }
.embed-preview h2 {
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #9eb0c0;
  margin: 0 0 0.65rem;
}
.embed-frame { background: #000; border-radius: 10px; overflow: hidden; margin: 0 auto; border: 1px solid #222; max-width: 100%; }
.embed-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ============================ Paying-user portal ============================ */
.account-root {
  background: #0b0f14;
  color: #e8eaed;
  min-height: 100vh;
  font-size: 1rem;
  line-height: 1.6;
}
.account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: #0b0f14;
  border-bottom: 1px solid #1d2a36;
}
.account-bar-brand { display: flex; align-items: center; flex-shrink: 0; }
.account-nav-primary { margin-left: auto; }
.account-main .page-title-row { margin-bottom: 1.25rem; }
.account-main .page-title-body h1 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); line-height: 1.25; }
.account-nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.account-nav a { color: #91a9b7; text-decoration: none; font-size: 0.9375rem; }
.account-nav a:hover { color: #fff; }
.account-who { color: #6f8298; font-size: 0.8125rem; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-main { max-width: 1120px; margin: 0 auto; padding: 2rem 1.5rem 3.5rem; }
.account-main > .card.narrow:first-child,
.account-main > .card.narrow:only-child { margin-top: 0; }
.account-main .card.narrow {
  max-width: 440px;
  margin-inline: auto;
  padding: 1.75rem 1.5rem;
}
.account-main .card.narrow > h1 {
  margin: 0 0 1rem;
  font-size: clamp(1.3rem, 3vw, 1.55rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.account-main .card.narrow .label { font-size: 0.875rem; margin-bottom: 0.4rem; }
.account-main .card.narrow p { margin: 0 0 1rem; line-height: 1.55; color: #b7c6d4; }
.account-main .card.narrow .btn { margin-top: 0.35rem; margin-right: 0.5rem; }
.account-main .card.narrow .small.muted { margin-top: 0.25rem; line-height: 1.5; font-size: 0.875rem; color: #8aa0b3; }
.about-carousel-placeholder code {
  font-size: 0.8rem;
  color: #b6d4f0;
  word-break: break-all;
}
.account-subscribe-wrap { max-width: 520px; margin: 0 auto; }
.account-subscribe-wrap .page-title-row { margin-bottom: 1.25rem; }
.account-foot {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2.5rem;
  border-top: 1px solid #1d2a36;
  text-align: center;
  color: #7a8f9f;
  font-size: 0.875rem;
  line-height: 1.5;
}
.account-grid { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; align-items: start; }
@media (max-width: 800px) { .account-grid { grid-template-columns: 1fr; } }

.narrow { max-width: 520px; margin: 0 auto 1rem; }
.inline { display: inline; }
.btn-ghost { background: transparent; border: 1px solid #34465a; color: #cfe0ee; }
.btn-ghost:hover { border-color: #5b7488; color: #fff; }

.notice { border-left: 4px solid #f0c674; }
.notice h3 { margin-top: 0; }

.list-head { display: flex; align-items: center; justify-content: space-between; margin: 1.25rem 0 0.5rem; }
.list-head h2 { margin: 0; font-size: 1rem; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid #243240; vertical-align: middle; }
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: #8aa0b3; }
.row-actions { display: flex; gap: 0.4rem; justify-content: flex-end; }

.plan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
@media (max-width: 560px) { .plan-grid { grid-template-columns: 1fr; } }
.plan { text-align: center; }
.plan-price { font-size: 1.6rem; font-weight: 800; margin: 0.25rem 0; }
.plan-price .muted { font-size: 0.9rem; font-weight: 400; }

textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.78rem; resize: vertical; width: 100%; }
#payment-element { margin: 1rem 0; }

/* ============================ Homepage info / subscription band ============================ */
.btn-pill { background: #16364a; padding: 0.35rem 0.85rem; border-radius: 999px; border: 1px solid #2f5a73; }
.home-info {
  margin: 3rem 0 0;
  padding: 2.25rem 0 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2.5rem 3rem;
  align-items: start;
  border-top: 1px solid #1d2a36;
}
@media (max-width: 820px) { .home-info { grid-template-columns: 1fr; gap: 2rem; } }
.home-info-col h2 {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  margin: 0 0 1rem;
  line-height: 1.3;
  color: #f1f6fa;
  letter-spacing: -0.01em;
}
.home-info-col p { color: #b7c6d4; line-height: 1.65; margin: 0; font-size: 1rem; }
.home-info-cta { margin: 1.35rem 0 0; font-size: 0.975rem; }
.home-features { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; font-size: 0.975rem; }
.home-features li { color: #c7d5e1; padding-left: 1.5rem; position: relative; line-height: 1.55; }
.home-features li::before { content: "✓"; position: absolute; left: 0; color: #5fd08a; font-weight: 700; }
.home-features li strong { color: #e2eaf2; font-weight: 600; }
.home-plans h3 { margin: 0 0 0.75rem; }
.home-plan-row { display: flex; justify-content: space-between; align-items: baseline; padding: 0.5rem 0; border-bottom: 1px solid #243240; }
.home-plan-row strong { font-size: 1.15rem; }
.home-plan-row .muted { font-size: 0.85rem; font-weight: 400; }
.expiry-note {
  background: #14202b;
  border: 1px solid #2a3a48;
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  color: #cdd9e4;
  margin: 0.9rem 0;
  line-height: 1.5;
  font-size: 0.9rem;
}
.home-plan-cta { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.6rem; }

/* Admin / account screen form sections */
.form-sections { display: flex; flex-direction: column; gap: 1.35rem; }
.form-section {
  padding: 0 0 1.15rem;
  border-bottom: 1px solid #243240;
}
.form-section:last-child { border-bottom: none; padding-bottom: 0; }
.form-section-title { margin: 0 0 0.35rem; font-size: 1rem; color: #e8eaed; }
.form-section-lead { margin: 0 0 0.85rem; }
.is-hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.challenge-fields .label strong { font-weight: 800; }

/* Schedule picker */
.schedule-tz-select { max-width: 100%; }
.schedule-tz-hint { margin: 0.35rem 0 1rem; }
.schedule-mode-cards {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0;
  border: none;
}
.schedule-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #2a3a48;
  border-radius: 10px;
  background: #121820;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.schedule-mode-card:has(input:checked) {
  border-color: #3d7ea6;
  background: #152432;
}
.schedule-mode-card input { margin-top: 0.2rem; accent-color: #5eb3e8; }
.schedule-mode-card-body { display: flex; flex-direction: column; gap: 0.15rem; }
.schedule-mode-card-body strong { color: #e8eaed; font-weight: 600; }
.schedule-day-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.schedule-day-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.6rem;
  padding: 0.45rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #2a3a48;
  background: #121820;
  font-size: 0.82rem;
  font-weight: 600;
  color: #9fb0bf;
  transition: all 0.15s;
}
.schedule-day-pill input { position: absolute; opacity: 0; pointer-events: none; }
.schedule-day-pill:has(input:checked) span {
  border-color: #3d7ea6;
  background: #1a3344;
  color: #e8f4fc;
}
.schedule-weekly-panel { margin-bottom: 0.85rem; }
.schedule-weekly-preview {
  margin: 0.65rem 0 0;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: #152432;
  border: 1px solid #2a4558;
  color: #b8d4e8;
}
.schedule-campaign-details {
  margin-top: 0.5rem;
  border: 1px solid #243240;
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
  background: #0f1419;
}
.schedule-campaign-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #cdd9e4;
  list-style: none;
}
.schedule-campaign-details summary::-webkit-details-marker { display: none; }
.schedule-campaign-details[open] summary { margin-bottom: 0.65rem; }
.status-between { background: #2a2835; color: #b8a8e8; }

/* Holding screen — black + drifting logo (burn-in safe) */
.display-standby-logo { background: #000; }
.holding-screen {
  position: fixed;
  inset: 0;
  background: #000;
  overflow: hidden;
}
.holding-logo-float {
  position: absolute;
  width: min(28vmin, 400px);
  height: auto;
  transform: translate(-50%, -50%);
  transition: left 2.8s ease-in-out, top 2.8s ease-in-out;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.holding-screen-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem 1.25rem 1.35rem;
  text-align: center;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
  pointer-events: none;
}
.holding-screen-message {
  margin: 0;
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  color: rgba(255, 255, 255, 0.45);
}
.holding-screen-countdown {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(126, 200, 240, 0.7);
  font-variant-numeric: tabular-nums;
}
.holding-screen-preview-tag {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.35);
}
.screen-standby-fallback {
  min-height: 100vh;
  min-height: 100dvh;
  background: #0a0e12;
  border: none;
}
.holding-logo-preview {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  margin: 0.5rem 0 0.85rem;
  padding: 0.75rem;
  border-radius: 10px;
  background: #121820;
  border: 1px solid #2a3a48;
}
.holding-logo-preview-on-dark { background: #000; }
.holding-logo-preview img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}
.holding-logo-preview-muted { opacity: 0.85; }
.form-divider {
  border: none;
  border-top: 1px solid #243240;
  margin: 1.35rem 0;
}

/* ============================ Mobile / tablet (laptop layout is default) ============================ */
@media (max-width: 960px) {
  .home-header,
  .home-main {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  /* Public header + nav */
  .home-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
    padding: 1rem 1rem 0.75rem;
  }
  .home-tagline { font-size: 0.95rem; }
  .home-nav {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding-top: 0;
    width: 100%;
  }
  .home-nav .link,
  .home-nav .btn-pill {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.45rem 0.75rem;
  }
  .home-header {
    padding: 1.25rem 1rem 1rem;
  }
  .home-main {
    padding: 1.5rem 1rem 2.5rem;
  }

  .home-screens-hint { font-size: 0.9rem; margin-top: 1rem; }
  .home-info {
    margin-top: 2.25rem;
    padding-top: 1.75rem;
    gap: 1.75rem;
  }
  .home-info-col h2 { font-size: 1.2rem; }
  .prose { font-size: 0.975rem; }
  .home-plan-cta .btn {
    flex: 1 1 calc(50% - 0.3rem);
    text-align: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* About + embed pages */
  .prose { max-width: none; font-size: 1rem; }
  .about-layout { gap: 1.25rem; }
  .embed-layout { gap: 1rem; }
  .code-row {
    flex-direction: column;
    align-items: stretch;
  }
  .code-row .btn {
    width: 100%;
    min-height: 44px;
  }

  /* Forms — 16px inputs avoid iOS zoom-on-focus */
  .input,
  .input.code-box,
  textarea.input,
  select.input {
    font-size: 16px;
  }
  .card {
    padding: 1rem;
  }
  .narrow {
    max-width: none;
    margin-inline: 0;
  }

  /* Account portal */
  .account-bar {
    justify-content: space-between;
    padding: 0.65rem 1rem;
  }
  .account-nav {
    flex-wrap: wrap;
    gap: 0.55rem 0.85rem;
  }
  .account-nav .btn,
  .account-nav .btn-ghost {
    min-height: 44px;
  }
  .account-who {
    flex: 1 1 100%;
    max-width: none;
  }
  .account-main,
  .account-foot {
    padding-inline: 1rem;
  }
  .list-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }
  .list-head .btn { align-self: flex-start; }
  .table {
    width: 100%;
    font-size: 0.85rem;
  }
  .table th,
  .table td {
    padding: 0.5rem 0.4rem;
  }
  .row-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  /* Admin (usable on phone if needed) */
  .admin-header {
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
  }
  .admin-main {
    padding: 1rem;
  }
  .admin-table {
    width: 100%;
    font-size: 0.85rem;
  }
  .admin-table th,
  .admin-table td {
    padding: 0.5rem 0.4rem;
  }
}

/* Horizontal scroll wrapper for wide tables on small screens */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.scroll-x .table,
.scroll-x .admin-table {
  min-width: 520px;
}

@media (max-width: 520px) {
  .home-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .home-screen {
    max-width: none;
    margin-inline: 0;
  }
  .home-plan-cta {
    flex-direction: column;
  }
  .home-plan-cta .btn {
    flex: 1 1 auto;
    width: 100%;
  }
  .plan-grid {
    grid-template-columns: 1fr;
  }
}
