:root {
  --bg: #f8f9fa;         /* Google surface grey */
  --card: #ffffff;
  --ink: #202124;        /* Google grey-900 */
  --muted: #5f6368;      /* Google grey-600 */
  --brand: #1a73e8;      /* Google product blue */
  --brand-dark: #1557b0;
  --border: #dadce0;     /* Google grey-300 */
  --ok: #188038;         /* Google green */
  --err: #d93025;        /* Google red */
  --warn: #e37400;       /* Google amber */
}

* { box-sizing: border-box; }

/* Consistent keyboard-focus ring across every interactive element. */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

body {
  margin: 0;
  font-family: "Rubik", "Heebo", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

a { color: var(--brand); }

/* Small, unobtrusive build stamp at the bottom of every page — lets Omri
   confirm at a glance which version is actually live after a deploy. */
.app-version {
  margin-top: 28px; padding-top: 14px;
  text-align: center; font-size: .78rem; color: var(--muted); opacity: .7;
  letter-spacing: .02em; font-variant-numeric: tabular-nums;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}
.wrap.wide { max-width: 1040px; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .10), 0 1px 3px 1px rgba(60, 64, 67, .06);
  margin-bottom: 20px;
}

h1 { font-size: 1.7rem; margin: 0 0 8px; }
h2 { font-size: 1.25rem; margin: 20px 0 10px; }
.muted { color: var(--muted); }

.event-image {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 16px;
}

label { display: block; font-weight: 500; margin: 14px 0 6px; }

input[type=text], input[type=email], input[type=date],
input[type=time], input[type=number], input[type=url], textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, .15);
}

textarea { min-height: 90px; resize: vertical; }

/* Form <select> (time picker, settings pickers) styled like text inputs.
   Excludes the reminder-editor template dropdown, which is a .btn-secondary pill. */
select:not(.btn-secondary) {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
select:not(.btn-secondary):focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 115, 232, .15);
}

/* Visually hidden without extending page width (a -9999px offset causes a huge
   horizontal scroll on RTL pages). */
.honeypot {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); border: 0;
}

button, .btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: 12px 20px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 2px 0 rgba(60, 64, 67, .30), 0 1px 3px 1px rgba(60, 64, 67, .15);
  transition: background-color .15s ease, box-shadow .15s ease, transform .05s ease;
}
button:hover, .btn:hover {
  background: var(--brand-dark);
  box-shadow: 0 1px 3px 0 rgba(60, 64, 67, .30), 0 4px 8px 3px rgba(60, 64, 67, .15);
}
button:active, .btn:active { transform: translateY(1px); }

.btn-secondary { background: #e8f0fe; color: var(--brand); box-shadow: none; }
.btn-secondary:hover { background: #d2e3fc; box-shadow: none; }
.btn-danger { background: #fee2e2; color: var(--err); }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 5px 10px; font-size: .85rem; }

td.actions { text-align: left; white-space: nowrap; }
td.actions form { display: inline; margin: 0; }

tr.row-link { cursor: pointer; }
tr.row-link:hover { background: rgba(26, 115, 232, .04); }

.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > div { flex: 1; min-width: 140px; }

.msg { padding: 12px 14px; border-radius: 10px; margin: 12px 0; }
.msg.error { background: #fce8e6; color: var(--err); border: 1px solid #f6c9c4; }
.msg.ok, .msg.success { background: #e6f4ea; color: var(--ok); border: 1px solid #b7dfc2; }
.msg.warning { background: #fef7e0; color: var(--warn); border: 1px solid #fde293; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 9px 8px; border-bottom: 1px solid var(--border); }
/* Long, unbreakable values (emails are dir="ltr") must wrap rather than force
   the table wider than a phone screen. Harmless on desktop. */
td[dir="ltr"] { overflow-wrap: anywhere; }
th { color: var(--muted); font-weight: 600; font-size: .9rem; }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover { background: rgba(26, 115, 232, .04); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; }
.badge.active { background: #e6f4ea; color: var(--ok); }
.badge.draft { background: #fef7e0; color: var(--warn); }
.badge.canceled { background: #fce8e6; color: var(--err); }
.badge--before { background: #e8f0fe; color: #1a56db; }
.badge--after { background: #fffbeb; color: #92400e; }
.nowrap { white-space: nowrap; }

.share-box, .url-box {
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 12px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: .9rem;
  word-break: break-all;
  white-space: pre-wrap;
}

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.topbar > div { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pill-link {
  display: inline-block; font-size: .9rem; font-weight: 500;
  padding: 8px 14px; border-radius: 999px; text-decoration: none;
  color: var(--brand); transition: background-color .15s ease;
}
.pill-link:hover { background: rgba(26, 115, 232, .08); }

.brand-card { padding: 0; overflow: hidden; }
.brand-bar { display: flex; height: 6px; }
.brand-bar > div { flex: 1; }
.brand-body { padding: 24px; }
.brand-logo { display: block; margin: 0 auto 18px; width: 88px; }

/* Tabbed navigation on the event page (Overview / Reminders / Analytics / Registrants). */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab-link {
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px 10px 0 0;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.tab-link:hover { background: #e8f0fe; color: var(--brand-dark); }
.tab-link.is-active {
  color: var(--brand-dark);
  background: transparent;
  border-bottom-color: var(--brand);
}
.tab-panel[hidden] { display: none; }

/* Visually group each reminder editor so the dense list is easier to scan. */
.reminder {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  background: #fbfcfe;
}
.ai-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.ai-controls .js-ai-panel { flex-basis: 100%; }

.editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  margin-bottom: 12px; padding: 8px; border-radius: 12px;
  background: #f1f6fe; border: 1px solid #d2e3fc;
}
/* Selects (size / font) styled as pills to match the toolbar buttons. */
.editor-toolbar select {
  width: auto; padding: 5px 10px; font-size: .85rem; font-weight: 600;
  border-radius: 10px; border: 0; background: #e8f0fe; color: var(--brand-dark);
  cursor: pointer;
}
/* Colour picker wrapped in a pill label. */
.tb-color {
  display: inline-flex; align-items: center; gap: 6px; margin: 0;
  padding: 3px 10px; font-size: .85rem; font-weight: 600;
  border-radius: 10px; background: #e8f0fe; color: var(--brand-dark); cursor: pointer;
}
.tb-color input[type=color] {
  width: 26px; height: 22px; padding: 0; border: 0; border-radius: 6px;
  background: none; cursor: pointer;
}
/* Thin divider between formatting and insert groups. */
.tb-sep { width: 1px; align-self: stretch; margin: 2px 4px; background: #d2e3fc; }

/* Button-builder dialog (text + emojis + link + colour). */
.btnbuilder {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center;
  background: rgba(16, 24, 40, .45); padding: 20px;
}
.btnbuilder.is-open { display: flex; }
.btnbuilder__card {
  background: #fff; border-radius: 16px; padding: 22px 24px;
  width: 100%; max-width: 420px; box-shadow: 0 20px 50px rgba(16, 24, 40, .3);
}
.btnbuilder__title { margin: 0 0 12px; font-size: 1.2rem; }
.btnbuilder__lab { display: block; font-weight: 600; margin: 12px 0 6px; }
.btnbuilder .bb-emojis { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bb-emoji {
  background: #f1f6fe; padding: 4px 8px; font-size: 1.1rem; border-radius: 8px;
  line-height: 1; cursor: pointer;
}
.bb-emoji:hover { background: #d2e3fc; }
.btnbuilder .bb-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.btnbuilder .bb-color {
  width: 42px; height: 30px; padding: 0; border: 1px solid var(--border);
  border-radius: 8px; background: none; cursor: pointer;
}
.bb-swatch {
  width: 26px; height: 26px; padding: 0; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); cursor: pointer;
}
.bb-swatch:hover { transform: scale(1.1); }
.btnbuilder__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* Roomy, comfortable sign-up description editor (not a cramped text box). */
.desc-edit {
  min-height: 200px;
  padding: 18px 20px;
  font-size: 1.05rem;
  line-height: 1.75;
  border-radius: 14px;
  background: #fbfcfe;
}
.desc-edit:focus { background: #fff; }

/* Live preview of the description exactly as registrants will see it (same
   .event-desc styling as the public register page). */
.desc-preview {
  background: linear-gradient(160deg, #eef2f9 0%, #e7ecf5 100%);
  border-radius: 14px;
  padding: 16px;
  margin: 10px 0 4px;
}
.desc-preview__label {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.desc-preview__body { background: #fff; border-radius: 10px; padding: 16px 18px; }
.html-advanced > summary {
  color: var(--muted);
  cursor: pointer;
  font-size: .9rem;
  margin-bottom: 6px;
  user-select: none;
}
.html-advanced[open] > summary { margin-bottom: 8px; }

/* ---- Block editor (static/reminder_blocks.js) ---- */
.blocks-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.block-palette {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px;
  padding: 8px; border-radius: 12px; background: #f1f6fe; border: 1px solid #d2e3fc;
}
.block-row {
  border: 1px solid var(--border); border-radius: 10px; background: #fff; overflow: hidden;
}
.block-row__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; background: #f6f8fc; border-bottom: 1px solid var(--border);
}
.block-row__type { font-weight: 600; font-size: .85rem; color: var(--brand-dark); }
.block-row__controls { display: flex; gap: 4px; }
.block-row__ctrl { padding: 2px 8px; min-width: 30px; }
.block-row__ctrl:disabled { opacity: .35; cursor: default; }
.block-text-edit {
  min-height: 60px; padding: 14px 16px; font-size: 1rem; line-height: 1.7;
  outline: none;
}
.block-text-edit:focus { background: #fbfcff; }
.block-fields-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding: 12px 14px; }
.block-field { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.block-field label { font-size: .8rem; color: var(--muted); }
.block-field input[type=color] { width: 44px; height: 30px; padding: 0; border: 0; cursor: pointer; }
.block-btn-preview, .block-timer-preview, .block-image-preview {
  flex-basis: 100%; padding: 10px 0;
}
.block-timer-preview {
  background: #e8f0fe; border-radius: 8px; padding: 8px 14px; font-weight: bold;
  color: var(--brand-dark); text-align: center; width: fit-content;
}
.block-image-preview { max-width: 100%; max-height: 180px; border-radius: 8px; display: block; }
.block-section-box {
  flex-basis: 100%; border: 1px solid #e0e0e0; border-radius: 12px; padding: 12px;
  background: #f8fafc;
}
.block-section-box .blocks-list { margin-bottom: 8px; }
.block-section-box .block-palette { margin-bottom: 8px; }
.block-raw-html { width: 100%; min-height: 90px; font-family: monospace; font-size: .85rem; }

/* "Edit event details" collapsible on the Overview tab. */
.edit-details > summary {
  cursor: pointer; user-select: none; font-weight: 600; color: var(--brand-dark);
  background: #e8f0fe; border-radius: 10px; padding: 10px 14px; display: inline-block;
}
.edit-details[open] > summary { margin-bottom: 4px; }

/* Utility classes (replace scattered inline styles). */
.field-hint { color: var(--muted); font-size: .9rem; margin-top: -2px; }
.form-inline-row { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.grow-ltr { flex: 1; text-align: left; }
/* A <select> inside .form-inline-row would otherwise inherit the global
   select{width:100%} rule as its flex-basis (flex-basis:auto resolves from
   width), claiming almost the whole row and squeezing a sibling .grow-ltr
   input down to nothing — pin it to its content width instead. */
.form-inline-row select { flex: 0 0 auto; width: auto; }
/* ---- Public registration page (conversion-oriented) ---- */
/* Roomy but not sprawling: wide enough that the description reads big and
   comfortable, still narrow enough to keep the form focused for conversion. */
.reg-card { max-width: 680px; margin-inline: auto; }
.reg-card .brand-body { padding: 40px 48px; }
/* Headline: smaller by default, with three admin-selectable sizes. */
.reg-title { text-align: center; margin: 6px 0 22px; line-height: 1.3; }
.reg-title--small { font-size: 1.25rem; }
.reg-title--medium { font-size: 1.55rem; }
.reg-title--large { font-size: 1.95rem; }
.event-desc {
  white-space: pre-line;      /* keep the admin's paragraph/line breaks */
  color: var(--ink);          /* high contrast, not muted grey */
  font-size: 1.2rem;
  line-height: 1.9;
  margin: 4px 0;
}
.reg-sep { border: 0; border-top: 1px solid var(--border); margin: 30px 0; }
/* Emphasized "when" callout — date/time/duration/online, so the details
   people scan for on a sign-up page jump out instead of blending into the
   description paragraph. */
.when-box {
  background: #f8fafc; border: 1px solid var(--border); border-inline-start: 4px solid var(--brand);
  border-radius: 12px; padding: 14px 18px; margin: 18px 0 8px;
  display: flex; flex-direction: column; gap: 8px;
}
.when-box__row { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 600; color: var(--ink); }
.when-box__icon { font-size: 1.2rem; }
.when-box--past { background: #f1f5f9; border-inline-start-color: #94a3b8; color: var(--muted); }
/* Phase banner above the sign-up form: live (happening now) / ended (waiting list). */
.phase-banner {
  border-radius: 12px; padding: 12px 16px; margin: 16px 0 4px;
  font-size: 1.05rem; font-weight: 600; line-height: 1.5;
}
.phase-banner--live { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.phase-banner--ended { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.reg-nudge { text-align: center; font-size: 1.2rem; font-weight: 600; margin: 0 0 16px; }
/* Gentle "did you mean gmail.com?" typo nudge under the email field. */
.email-suggest {
  margin: 6px 2px 0; font-size: .92rem; color: var(--muted);
}
.email-suggest__fix {
  border: 0; background: none; padding: 0; cursor: pointer;
  color: var(--brand); font: inherit; font-weight: 600;
  text-decoration: underline; direction: ltr; unicode-bidi: isolate;
}
.email-suggest__fix:hover { color: var(--brand-dark); }
.reg-form label { font-size: 1.02rem; }
.optin-row {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; margin: 18px 0 8px; font-weight: 500;
}
.optin-row input { width: auto; margin: 3px 0 0; flex: 0 0 auto; transform: scale(1.25); }
/* Attendance choice — a clear yes/no at the top of the form, kept visually
   distinct from the mailing-list opt-in checkbox below it. */
.attend-choice {
  border: 1px solid var(--border); border-inline-start: 4px solid var(--brand);
  border-radius: 12px; padding: 14px 16px; margin: 0 0 20px;
}
.attend-choice legend { font-weight: 700; font-size: 1.05rem; padding: 0 6px; color: var(--ink); }
.attend-opt {
  display: flex; align-items: flex-start; gap: 10px; cursor: pointer;
  padding: 8px 4px; font-weight: 500;
}
.attend-opt input { width: auto; margin: 3px 0 0; flex: 0 0 auto; transform: scale(1.25); }
.btn-cta {
  display: block; width: 100%; margin-top: 18px;
  padding: 16px 24px; font-size: 1.15rem; font-weight: 700;
  box-shadow: 0 6px 16px rgba(26, 115, 232, .3);
}
.reg-fineprint { text-align: center; font-size: .85rem; margin: 12px 0 0; }

@media (max-width: 560px) {
  .reg-card .brand-body { padding: 26px 20px; }
  .reg-title--large { font-size: 1.6rem; }
  .reg-title--medium { font-size: 1.4rem; }
  .reg-title--small { font-size: 1.2rem; }
  .event-desc { font-size: 1.1rem; line-height: 1.8; }
}

/* ---- Admin pages on mobile ---- */
@media (max-width: 560px) {
  .wrap { padding: 18px 14px 48px; }
  .card { padding: 18px 16px; }
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.15rem; }
  /* Wide data tables become their own horizontal scroll container, so a table
     that still can't shrink scrolls inside its card rather than pushing the
     whole page sideways. display:block on <table> keeps the internal table
     layout (thead/tbody/tr/td keep their table-* display) while turning the
     outer box into a scroll container. */
  table { display: block; overflow-x: auto; font-size: .92rem; }
  th, td { padding: 8px 6px; }
}

/* ---- Admin sign-up funnel ---- */
.funnel {
  display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap;
  margin: 14px 0 4px;
}
.funnel-stat {
  flex: 1; min-width: 120px; text-align: center;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 14px;
  padding: 18px 12px;
}
.funnel-num { font-size: 2.2rem; font-weight: 800; color: var(--brand-dark); line-height: 1; }
.funnel-label { margin-top: 8px; font-weight: 600; }
.funnel-sub { font-size: .85rem; margin-top: 2px; }
.funnel-arrow { align-self: center; color: var(--muted); font-size: 1.4rem; }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.center { text-align: center; }
.input-ltr { text-align: left; }
.inline-form { display: inline; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-weight: normal; cursor: pointer; }
.checkbox-row input { width: auto; margin: 0; }

/* ---- New-event AI assistant (chat) ---------------------------------------- */
.assistant { border-color: #d2e3fc; background: linear-gradient(180deg, #fbfcff, #fff); }
.assistant-head h2 { margin-top: 0; }
.assistant-log { display: flex; flex-direction: column; gap: 8px; max-height: 340px;
  overflow-y: auto; margin: 4px 0 12px; }
.assistant-log:empty { display: none; }
.assistant-msg { max-width: 85%; padding: 9px 13px; border-radius: 14px;
  white-space: pre-wrap; line-height: 1.5; }
.assistant-msg--user { align-self: flex-start; background: var(--brand); color: #fff;
  border-bottom-right-radius: 4px; }
.assistant-msg--model { align-self: flex-end; background: #e8f0fe; color: var(--ink);
  border-bottom-left-radius: 4px; }
.assistant-chips { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-end;
  margin-bottom: 4px; }
.assistant-chip { background: #fff; color: var(--brand-dark); border: 1px solid #d2e3fc;
  border-radius: 999px; padding: 4px 12px; font-size: .85rem; font-weight: 600; cursor: pointer; }
.assistant-chip:hover { background: #e8f0fe; }
.assistant-chip--all { background: var(--brand); color: #fff; border-color: var(--brand); }
.assistant-chip--all:hover { background: var(--brand-dark); }
.assistant-chip--done { background: #f0fdf4; color: var(--ok); border-color: #bbf7d0; }
.assistant-input textarea { margin-bottom: 8px; }
.assistant-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.assistant-controls .btn-sm { background: var(--brand); color: #fff; }
.assistant-ground { display: flex; align-items: center; gap: 6px; font-weight: normal;
  font-size: .9rem; cursor: pointer; margin: 0; }
.assistant-ground input { width: auto; margin: 0; }
/* brief highlight on an input the assistant just filled */
.field-filled { border-color: var(--ok) !important; box-shadow: 0 0 0 3px rgba(22,163,74,.15) !important; }

/* ---- Event-image guidance ------------------------------------------------- */
.img-guide { margin-top: 8px; }
.img-warn, .img-note { padding: 8px 12px; border-radius: 10px; margin: 8px 0; font-size: .9rem; }
.img-warn--bad { background: #fce8e6; color: var(--err); border: 1px solid #f6c9c4; }
.img-warn--warn { background: #fef7e0; color: var(--warn); border: 1px solid #fde293; }
.img-warn--ok { background: #e6f4ea; color: var(--ok); border: 1px solid #b7dfc2; }

/* ---- Daily send-cap forecast card (admin dashboard) -------------------- */
.forecast-card { margin-bottom: 16px; }
.forecast-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.forecast-title { font-size: 1rem; margin: 0 0 2px; }
.forecast-sub { margin: 0; font-size: .9rem; }
.meter { flex: 1; min-width: 160px; max-width: 320px; height: 10px; background: #e8eaed; border-radius: 999px; overflow: hidden; }
.meter-fill { height: 100%; background: var(--brand); border-radius: 999px; }
.meter-fill.near { background: var(--warn); }
.meter-fill.over { background: var(--err); }
.forecast-warn { margin: 12px 0 4px; }
.forecast-bars { display: flex; gap: 8px; align-items: flex-end; height: 110px; margin: 14px 0 6px; overflow-x: auto; }
.forecast-bar { flex: 1 0 44px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.forecast-bar .fill { width: 70%; min-height: 3px; background: var(--brand); border-radius: 5px 5px 0 0; }
.forecast-bar.near .fill { background: var(--warn); }
.forecast-bar.over .fill { background: var(--err); }
.forecast-bar.today .fill { outline: 2px dashed var(--muted); outline-offset: 1px; }
.forecast-bar .val { font-size: 11px; color: var(--ink); margin-bottom: 3px; }
.forecast-bar .lbl { font-size: 11px; color: var(--muted); margin-top: 5px; white-space: nowrap; }
.forecast-note { font-size: .8rem; margin: 4px 0 0; }

/* ---- Custom survey question widgets (public registration form) ---------- */
.custom-q { margin: 14px 0; }
.custom-q > label { display: block; font-weight: 600; margin-bottom: 6px; }
.custom-q .req { color: var(--err); }
.choice-group { display: flex; flex-direction: column; gap: 2px; }

/* Star rating */
.rating-input { display: flex; gap: 6px; direction: ltr; justify-content: flex-end; }
.rating-input .star {
  background: none; border: none; cursor: pointer; padding: 2px;
  font-size: 2rem; line-height: 1; color: #f5b301;
}
.rating-input .star.is-on { color: #f5b301; }

/* 0–10 scale / NPS */
.scale-input { display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; justify-content: flex-end; }
.scale-input .scale-btn {
  min-width: 40px; padding: 8px 0; cursor: pointer;
  border: 1px solid #dadce0; border-radius: 8px; background: #fff;
  font-weight: 600; color: var(--ink);
}
.scale-input .scale-btn.is-on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* One-word */
.one-word-input { max-width: 260px; }

/* Finger drawing */
.drawing-input { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.draw-canvas {
  width: 100%; max-width: 600px; height: auto; touch-action: none;
  border: 2px dashed #dadce0; border-radius: 12px; background: #fff; cursor: crosshair;
}
.draw-clear { align-self: flex-start; }

/* ---- Survey results dashboard ------------------------------------------- */
.sv-q { padding: 16px 0; border-bottom: 1px solid #eee; }
.sv-q:last-child { border-bottom: none; }
.sv-q-title { margin: 0 0 12px; font-size: 1.05rem; }
.sv-q-n { font-weight: 400; font-size: .85rem; }
.sv-bars { display: flex; flex-direction: column; gap: 8px; }
.sv-bar-row { display: flex; align-items: center; gap: 10px; }
.sv-bar-label { flex: 0 0 34%; text-align: right; font-size: .9rem; }
.sv-bar-track { flex: 1; height: 20px; background: #f1f3f4; border-radius: 6px; overflow: hidden; }
.sv-bar-fill { display: block; height: 100%; background: var(--brand); border-radius: 6px; min-width: 2px; }
.sv-bar-val { flex: 0 0 auto; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.sv-avg { font-size: 2rem; font-weight: 700; color: #f5b301; margin-bottom: 10px; }
.sv-avg span { font-size: .9rem; color: var(--muted); font-weight: 400; }
.sv-tiles { display: flex; gap: 12px; margin-bottom: 12px; }
.sv-tile { background: #f1f3f4; border-radius: 10px; padding: 10px 18px; text-align: center; }
.sv-tile b { display: block; font-size: 1.6rem; color: var(--brand); }
.sv-tile span { font-size: .78rem; color: var(--muted); }
.sv-scale { display: flex; align-items: flex-end; gap: 6px; height: 120px; direction: ltr; }
.sv-scale-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.sv-scale-fill { width: 70%; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.sv-scale-n { margin-top: 4px; font-size: .75rem; color: var(--muted); }
.sv-cloud { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; line-height: 1.35; padding: 6px 0; }
.sv-word { font-weight: 700; }
.sv-c0 { color: #1a73e8; } .sv-c1 { color: #d93025; } .sv-c2 { color: #188038; }
.sv-c3 { color: #e37400; } .sv-c4 { color: #9334e6; } .sv-c5 { color: #12a4af; }
.sv-gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.sv-gallery img { width: 150px; height: 100px; object-fit: contain; background: #fff;
  border: 1px solid #dadce0; border-radius: 8px; }
.sv-thumb { width: 56px; height: 38px; object-fit: contain; border: 1px solid #dadce0; border-radius: 4px; }
.sv-list { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 4px; }
.sv-list li { font-size: .92rem; }

/* ---- QR screen: timer, stopwatch, live counter -------------------------- */
.qr-live { margin-top: 18px; }
.qr-live-num { font-size: clamp(40px, 8vw, 92px); font-weight: 800; color: var(--brand); line-height: 1; }
.qr-live-lbl { display: block; font-size: clamp(14px, 2vw, 22px); color: var(--muted); }
.qr-timer { text-align: center; margin: 18px 0; }
.qr-timer-display {
  font-size: clamp(56px, 14vw, 160px); font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--ink); letter-spacing: 2px;
}
.qr-timer-display.is-done { color: var(--err); animation: qr-flash .6s step-start 6; }
@keyframes qr-flash { 50% { opacity: .15; } }
.qr-timer-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; justify-content: center; align-items: center; margin-top: 12px; }
.qr-mode-btn.is-on { background: var(--brand); color: #fff; border-color: var(--brand); }
.qr-toggle { font-size: .9rem; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.qr-toggle input { width: auto; }

/* ---- Live projected results screen (dark, big) -------------------------- */
.live-screen { color: #f8f9fa; }
.live-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 8px 4px 18px; border-bottom: 1px solid #3c4043; margin-bottom: 18px; }
.live-title { font-size: clamp(24px, 4vw, 48px); margin: 0; flex: 1; }
.live-count { font-size: clamp(18px, 3vw, 34px); font-weight: 700; color: #8ab4f8; }
.live-count span { font-size: 1.3em; }
.live-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.live-card { background: #202124; border: 1px solid #3c4043; border-radius: 14px; padding: 18px 20px; }
.live-card-title { margin: 0 0 14px; font-size: clamp(18px, 2vw, 26px); color: #f8f9fa; }
.live-big { font-size: clamp(36px, 6vw, 72px); font-weight: 800; color: #fdd663; margin-bottom: 10px; }
/* Reuse the dashboard chart classes but lighten text/tracks for the dark bg. */
.live-card .sv-bar-track { background: #3c4043; }
.live-card .sv-bar-label, .live-card .sv-bar-val { color: #e8eaed; }
.live-card .sv-tile { background: #303134; }
.live-card .sv-cloud .sv-word { text-shadow: 0 1px 2px rgba(0,0,0,.4); }
