/* ============================================================
   Secret Codes — brand kit theme
   Drop-in replacement for Bootstrap's default look.
   Version: 0.1  —  https://secretcodes.dev
   ============================================================ */

/* 1. Fonts ---------------------------------------------------- */
/* Self-hosted from static/vendor/fonts/. Variable-font woff2 files cover
   the full 400..700 weight axis in a single file per style. Latin subset
   only — add latin-ext or vietnamese later if a respondent needs them.
   Licensed under SIL OFL 1.1; see OFL.txt next to each font. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../vendor/fonts/fraunces/fraunces-normal-var.5d2835174326.woff2") format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 400 700;
  font-display: swap;
  src: url("../vendor/fonts/fraunces/fraunces-italic-var.be1b7d1cec18.woff2") format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../vendor/fonts/inter/inter-var.65850a373e25.woff2") format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../vendor/fonts/jetbrains-mono/jetbrains-mono-var.570751c5f8b4.woff2") format('woff2');
}

/* 2. Design tokens -------------------------------------------- */
:root {
  /* Ink & paper */
  --sc-ink:        #0E1730;   /* deep navy ink — "battleship night" */
  --sc-ink-soft:   #1B2747;
  --sc-paper:      #F2ECDD;   /* cream paper, like old ciphers */
  --sc-paper-warm: #E8DFC6;
  --sc-rule:       rgba(14, 23, 48, 0.16);

  /* Signal colors — reserved for "found" moments (CTAs, active, success) */
  --sc-signal:     #D84C2F;   /* maritime signal red */
  --sc-gold:       #C79A3A;   /* decoded-message gold */
  --sc-teal:       #2E6E6A;   /* deep water */
  --sc-lilac:      #8A7AB8;   /* synth / softer nod */

  /* Semantic roles */
  --sc-bg:         var(--sc-paper);
  --sc-fg:         var(--sc-ink);
  --sc-muted:      rgba(14, 23, 48, 0.6);
  --sc-accent:     var(--sc-signal);
  --sc-accent-2:   var(--sc-gold);

  /* Type */
  --sc-font-display: 'Fraunces', ui-serif, Georgia, 'Times New Roman', serif;
  --sc-font-body:    'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --sc-font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Bootstrap variable overrides (if you're still on Bootstrap) */
  --bs-body-font-family: var(--sc-font-body);
  --bs-body-bg:          var(--sc-bg);
  --bs-body-color:       var(--sc-fg);
  --bs-primary:          var(--sc-ink);
  --bs-primary-rgb:      14, 23, 48;
  --bs-link-color:       var(--sc-ink);
  --bs-link-hover-color: var(--sc-signal);
  --bs-border-color:     var(--sc-rule);
}

/* Dark mode — add class="sc-dark" to <html> or <body>,
   or it kicks in automatically via prefers-color-scheme below. */
.sc-dark {
  --sc-bg:      var(--sc-ink);
  --sc-fg:      var(--sc-paper);
  --sc-muted:   rgba(242, 236, 221, 0.82);
  --sc-rule:    rgba(242, 236, 221, 0.18);
  --sc-accent:  #F0A06B;   /* warmer on dark */
  --sc-accent-2: #E8C464;

  --bs-secondary-color:   var(--sc-muted);
  --bs-secondary-bg:      var(--sc-ink-soft);
  --bs-tertiary-bg:       var(--sc-ink-soft);
  --bs-emphasis-color:    var(--sc-paper);
}
@media (prefers-color-scheme: dark) {
  :root:not(.sc-light) {
    --sc-bg:      var(--sc-ink);
    --sc-fg:      var(--sc-paper);
    --sc-muted:   rgba(242, 236, 221, 0.82);
    --sc-rule:    rgba(242, 236, 221, 0.18);
    --sc-accent:  #F0A06B;
    --sc-accent-2: #E8C464;

    --bs-secondary-color:   var(--sc-muted);
    --bs-secondary-bg:      var(--sc-ink-soft);
    --bs-tertiary-bg:       var(--sc-ink-soft);
    --bs-emphasis-color:    var(--sc-paper);
  }
}

/* Bootstrap 5.2 sets --bs-card-bg: #fff directly on the .card selector,
   which beats anything we set at :root scope. Override at the same
   selector level so dark mode actually applies to cards. */
.sc-dark .card,
.sc-dark .list-group-item {
  --bs-card-bg:           var(--sc-ink-soft);
  --bs-card-color:        var(--sc-paper);
  --bs-card-border-color: var(--sc-rule);
  --bs-card-cap-bg:       var(--sc-ink-soft);
  --bs-card-cap-color:    var(--sc-paper);
  background-color:       var(--sc-ink-soft);
  color:                  var(--sc-paper);
  border-color:           var(--sc-rule);
}
@media (prefers-color-scheme: dark) {
  :root:not(.sc-light) .card,
  :root:not(.sc-light) .list-group-item {
    --bs-card-bg:           var(--sc-ink-soft);
    --bs-card-color:        var(--sc-paper);
    --bs-card-border-color: var(--sc-rule);
    --bs-card-cap-bg:       var(--sc-ink-soft);
    --bs-card-cap-color:    var(--sc-paper);
    background-color:       var(--sc-ink-soft);
    color:                  var(--sc-paper);
    border-color:           var(--sc-rule);
  }
}

/* Bootstrap styles clickable "action" list items with a muted secondary color,
   which reads as inactive and clashes with plain lists (e.g. surveys, which are
   static <div>s). Use the full theme text color so clickable lists (content
   planner boards/campaigns) look as crisp and active as the static ones. */
.list-group {
  --bs-list-group-action-color:        var(--sc-fg);
  --bs-list-group-action-hover-color:  var(--sc-fg);
  --bs-list-group-action-active-color: var(--sc-fg);
}

/* 3. Base --------------------------------------------------- */
html, body {
  background: var(--sc-bg);
  color: var(--sc-fg);
  font-family: var(--sc-font-body);
  font-feature-settings: "ss01", "cv11";
  line-height: 1.55;
  transition: background .3s ease, color .3s ease;
}

/* Headings use the display serif */
h1, h2, h3, .sc-display {
  font-family: var(--sc-font-display);
  font-weight: 500;
  letter-spacing: -0.015em;
  font-optical-sizing: auto;
}
h1 { font-size: clamp(40px, 6vw, 72px); line-height: 1.02; }
h2 { font-size: clamp(28px, 3.5vw, 40px); }
h3 { font-size: clamp(22px, 2.5vw, 28px); }

h4, h5, h6 {
  font-family: var(--sc-font-body);
  font-weight: 600;
  letter-spacing: -0.005em;
}

/* Italic accent — use this for the "personal" voice */
.sc-italic,
em.sc-accent,
.sc-display em {
  font-family: var(--sc-font-display);
  font-style: italic;
  color: var(--sc-accent);
  font-weight: 500;
}

/* Mono — for code, labels, coordinates, signals */
code, kbd, samp, pre, .sc-mono {
  font-family: var(--sc-font-mono);
}
.sc-eyebrow,
.sc-label {
  font-family: var(--sc-font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sc-muted);
}

/* Links */
a { color: var(--sc-fg); text-decoration-color: var(--sc-rule); text-underline-offset: 3px; }
a:hover { color: var(--sc-accent); text-decoration-color: currentColor; }

/* 4. Buttons ------------------------------------------------ */
.sc-btn,
.btn-secret {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sc-font-mono);
  font-size: 12px; letter-spacing: 0.06em;
  padding: 10px 16px;
  border-radius: 3px;
  border: 1px solid var(--sc-fg);
  background: var(--sc-fg);
  color: var(--sc-bg);
  text-decoration: none;
  cursor: pointer;
  transition: transform .1s ease, background .2s ease;
}
.sc-btn:hover { transform: translateY(-1px); }
.sc-btn:hover, .sc-btn:focus { color: var(--sc-bg); }

.sc-btn--ghost {
  background: transparent; color: var(--sc-fg);
}
.sc-btn--ghost:hover, .sc-btn--ghost:focus { color: var(--sc-fg); background: transparent; }

.sc-btn--accent {
  background: var(--sc-accent);
  border-color: var(--sc-accent);
  color: var(--sc-paper);
}
.sc-btn--accent:hover, .sc-btn--accent:focus { color: var(--sc-paper); }

/* Bootstrap button remap — derive from --sc-fg/--sc-bg so the
   button auto-flips with light/dark mode and never blends into
   the page background. */
.btn-primary {
  --bs-btn-bg:                 var(--sc-fg);
  --bs-btn-color:              var(--sc-bg);
  --bs-btn-border-color:       var(--sc-fg);
  --bs-btn-hover-bg:           var(--sc-accent);
  --bs-btn-hover-border-color: var(--sc-accent);
  --bs-btn-hover-color:        var(--sc-paper);
  --bs-btn-active-bg:          var(--sc-accent);
  --bs-btn-active-border-color: var(--sc-accent);
  --bs-btn-active-color:       var(--sc-paper);
  --bs-btn-disabled-bg:        var(--sc-fg);
  --bs-btn-disabled-border-color: var(--sc-fg);
  --bs-btn-disabled-color:     var(--sc-bg);
}

/* .btn-outline-light is intentionally NOT in this group: it's only used
   on the dark navbar, where Bootstrap's default (white-on-dark) is correct.
   Overriding it to var(--sc-fg) makes it black-on-black in light mode. */
.btn-outline-primary,
.btn-outline-secondary {
  --bs-btn-color:              var(--sc-fg);
  --bs-btn-border-color:       var(--sc-fg);
  --bs-btn-bg:                 transparent;
  --bs-btn-hover-bg:           var(--sc-fg);
  --bs-btn-hover-border-color: var(--sc-fg);
  --bs-btn-hover-color:        var(--sc-bg);
  --bs-btn-active-bg:          var(--sc-fg);
  --bs-btn-active-border-color: var(--sc-fg);
  --bs-btn-active-color:       var(--sc-bg);
  --bs-btn-disabled-color:     var(--sc-muted);
  --bs-btn-disabled-border-color: var(--sc-rule);
}

/* Outline-secondary keeps a softer look but still clearly visible:
   muted border, foreground text. */
.btn-outline-secondary {
  --bs-btn-color:        var(--sc-fg);
  --bs-btn-border-color: var(--sc-muted);
}

/* 5. Cards & surfaces --------------------------------------- */
.sc-card {
  border: 1px solid var(--sc-rule);
  border-radius: 6px;
  padding: 24px;
  background: color-mix(in oklab, var(--sc-bg) 98%, var(--sc-fg) 2%);
}

/* Hero / lede / prose patterns */
.sc-hero { --bs-gutter-x: 3rem; }
.sc-hero h1 { line-height: 1.02; }
.sc-lede { max-width: 44ch; font-size: 1.05rem; }
.sc-prose { max-width: 64ch; }
.sc-prose-lead { font-size: 1.05rem; }
.sc-h-tight { line-height: 1.05; }
.sc-h-sub { font-size: 1.5rem; }
.sc-mono-sm { font-size: 0.95em; }

/* Navbar brand wrapping the wordmark */
.sc-brand-link { color: var(--sc-paper); }
.sc-brand-svg  { display: block; }
.sc-opsz-display { font-variation-settings: 'opsz' 144; }

/* Footer block — paper text on ink */
.sc-footer { background: var(--sc-ink); color: var(--sc-paper); }
.sc-footer a { color: var(--sc-paper); }
.sc-footer .sc-mono { letter-spacing: 0.06em; }
.sc-footer__morse {
  max-width: 360px; width: 100%; height: auto;
  display: block; margin-bottom: 14px;
}
.sc-footer__socials {
  list-style: none; padding: 0; margin: 0 0 0.5rem;
  display: flex; flex-wrap: wrap; gap: 1rem;
}
.sc-footer__socials a { font-size: 1.1rem; }
.sc-footer__by { color: rgba(242, 236, 221, 0.6); letter-spacing: 0.06em; }

/* Numbered prefix used inside .sc-eyebrow ("01" Personal infrastructure) */
.sc-num { color: var(--sc-accent); margin-right: 10px; }

/* Card-as-link tile pattern (3-up grid below the hero) */
.sc-tile {
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 10px;
  text-decoration: none;
}
.sc-tile:hover, .sc-tile:focus { color: inherit; }
.sc-tile-title { font-size: 1.375rem; margin-bottom: 0; }
.sc-tile-body  { font-size: 0.875rem; margin-bottom: 0; }
.sc-tile .sc-arrow { margin-top: auto; }

/* Accent "open →" indicator */
.sc-arrow {
  font-family: var(--sc-font-mono);
  color: var(--sc-accent);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

/* In-page anchor that clears the fixed-ish navbar */
.sc-anchor { scroll-margin-top: 80px; }

/* Coords strip — signal-flag baseline (COORD · SIGNAL · STATUS · OWNER) */
.sc-coords {
  display: flex; flex-wrap: wrap; gap: 0;
  border-top: 1px solid var(--sc-rule);
  border-bottom: 1px solid var(--sc-rule);
  padding: 14px 0;
  font-family: var(--sc-font-mono);
  font-size: 12px; letter-spacing: 0.06em;
  color: var(--sc-muted);
}
.sc-coords > span { flex: 1 1 50%; min-width: 0; padding: 4px 0; }
.sc-coords b { color: var(--sc-fg); font-weight: 500; margin-right: 8px; }
@media (min-width: 768px) {
  .sc-coords > span { flex: 1; }
}

/* 6. Utilities ---------------------------------------------- */
.sc-muted   { color: var(--sc-muted); }
.sc-accent  { color: var(--sc-accent); }
.sc-rule    { border-color: var(--sc-rule); }
.sc-bg-ink    { background: var(--sc-ink);    color: var(--sc-paper); }
.sc-bg-paper  { background: var(--sc-paper);  color: var(--sc-ink); }
.sc-bg-signal { background: var(--sc-signal); color: var(--sc-paper); }
.sc-bg-teal   { background: var(--sc-teal);   color: var(--sc-paper); }

/* Respondent-view "Edit" affordance — visible only to owner/collaborator */
.respondent-edit-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: #6c757d;
  text-decoration: none;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.respondent-edit-link:hover,
.respondent-edit-link:focus {
  color: #534AB7;
  border-color: #cfcae8;
  background: #f4f3fa;
  text-decoration: none;
}

/* Inline SVG icons (replaces Font Awesome kit). Match the in-text */
/* sizing/baseline behaviour FA's <i> + svg-inline--fa CSS used to give. */
.sc-icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  overflow: visible;
}

/* Browse-text view — read-only overview of all open-text responses.
   Each card is a contained box; editing happens in triage, not here. */
.text-responses-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid #E8E6DC;
  font-size: 13px;
  flex-wrap: wrap;
}
.text-responses-strip .crumb { color: #8A8983; }
.text-responses-strip .crumb-current {
  color: #1F1E1B;
  font-weight: 500;
}
.text-responses-strip-sep { color: #8A8983; }
.text-responses-summary {
  margin-left: auto;
  font-size: 12px;
  color: #5C5B57;
}
.text-responses-empty {
  padding: 24px;
  background: #F5F4ED;
  border-radius: 6px;
  text-align: center;
}

/* Section per question — sits inside a soft frame to visually group its cards. */
.text-responses-section {
  margin: 28px 0;
  padding: 14px 10px 6px;
  background: #FAF8F1;
  border: 1px solid #E8E6DC;
  border-radius: 10px;
}
.text-responses-question {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #E8E6DC;
  flex-wrap: wrap;
}
.text-responses-question-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.text-responses-q-num {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 12px;
  color: #8A8983;
  flex-shrink: 0;
}
.text-responses-q-text {
  font-family: Fraunces, Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
  margin: 0;
  color: #1F1E1B;
}
.text-responses-question-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.text-responses-q-count {
  font-size: 12px;
  color: #8A8983;
}
.text-responses-untriaged {
  color: #b06b00;
  font-weight: 500;
}
.text-responses-q-empty {
  font-size: 13px;
  color: #8A8983;
  padding: 4px 0 14px;
  margin: 0;
}

/* Card per response — a single contained box, generous whitespace, calm. */
.text-responses-card {
  background: #fff;
  border: 1px solid #E8E6DC;
  border-radius: 8px;
  margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(14, 23, 48, 0.04);
  scroll-margin-top: 16px;
  overflow: hidden;
}
.text-responses-card:last-child { margin-bottom: 4px; }
.text-responses-card-body { padding: 12px 14px 10px; }
.text-responses-card .response-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 11px;
  color: #8A8983;
  flex-wrap: wrap;
}
.text-responses-card .meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #F0EFE7;
  color: #5C5B57;
}
.text-responses-callout {
  font-family: Fraunces, Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.55;
  color: #1F1E1B;
  padding: 0 0 0 10px;
  border-left: 3px solid #534AB7;
  margin-bottom: 10px;
}
.text-responses-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.text-responses-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 12px;
  background: #EEEDFE;
  color: #3C3489;
  font-size: 12px;
  font-weight: 500;
}
.text-responses-tag-empty {
  background: transparent;
  color: #B7B6AF;
  font-style: italic;
  border: 1px dashed #DAD8CD;
  font-weight: 400;
}
.text-responses-triage-cta { white-space: nowrap; }

/* Question-scope banner — surfaces on Browse-text and Triage when a
   ?question=<id> filter is active. */
.triage-scope-banner {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: #EEEDFE;
  border-left: 3px solid #534AB7;
  border-radius: 6px;
  flex-wrap: wrap;
}
.triage-scope-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #534AB7;
}
.triage-scope-q {
  font-family: Fraunces, Georgia, "Iowan Old Style", "Times New Roman", serif;
  font-size: 15px;
  font-weight: 500;
  color: #3C3489;
  flex: 1;
  min-width: 0;
}
.triage-scope-unscope {
  font-size: 12px;
  color: #534AB7;
  text-decoration: none;
  white-space: nowrap;
}
.triage-scope-unscope:hover { text-decoration: underline; }

/* QR customizer — live preview pane on the slug generator page. */
.sc-qr-preview {
  padding: 16px;
  border: 1px dashed #DAD8CD;
  border-radius: 6px;
  text-align: center;
}
.sc-qr-preview__label {
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  margin-bottom: 8px;
  opacity: 0.7;
}
.sc-qr-preview img {
  display: block;
  max-width: 320px;
  width: 100%;
  margin: 0 auto;
  image-rendering: pixelated;
}

/* QR customizer — color fields pair a swatch with a hex text box. Flex the
   field row so the swatch and the text box sit side by side, with the label
   on its own line above them. */
.mb-3:has(> .sc-color-swatch) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.mb-3:has(> .sc-color-swatch) > .form-label {
  flex: 0 0 100%;
  margin-bottom: 0.25rem;
}
.sc-color-swatch {
  flex: 0 0 3rem;
  width: 3rem;
  padding: 0.25rem;
}
.sc-color-hex {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  text-transform: lowercase;
}

/* Channel toggle chips (btn-check group). The checked state inverts to a
   solid foreground fill so the selection is unmistakable in both light and
   dark mode — Bootstrap's btn-outline-primary uses the near-black ink colour,
   which is invisible on a dark surface. */
.sc-chip {
  color: var(--sc-fg);
  background-color: transparent;
  border: 1px solid var(--sc-rule);
}
.sc-chip:hover {
  border-color: var(--sc-fg);
}
.btn-check:checked + .sc-chip {
  color: var(--sc-bg);
  background-color: var(--sc-fg);
  border-color: var(--sc-fg);
}
.btn-check:focus-visible + .sc-chip {
  outline: 2px solid var(--sc-accent);
  outline-offset: 1px;
}

/* "Today" marker in the schedule grid — uses the theme accent so it stays
   legible in dark mode (Bootstrap text-primary resolves to dark ink). */
.sc-today {
  color: var(--sc-accent);
  font-weight: 700;
}

/* Status as a dot+pill toggle group (mirrors the surveys status UI). The pill
   surface stays theme-aware; each status carries its own dot colour, dimmed
   until selected, with a matching ring when checked. */
.sc-status-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sc-status-group .sc-status-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 12px;
  border: 1px solid var(--sc-rule);
  border-radius: 999px;
  background-color: transparent;
  color: var(--sc-fg);
  cursor: pointer;
  white-space: nowrap;
}
.sc-status-group .sc-status-btn:hover {
  border-color: var(--sc-fg);
}
.sc-status-group .sc-status-btn .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--sc-dot, var(--sc-muted));
  opacity: 0.45;
}
.sc-status-group .btn-check:checked + .sc-status-btn {
  border-color: var(--sc-dot);
  box-shadow: 0 0 0 2px var(--sc-dot);
}
.sc-status-group .btn-check:checked + .sc-status-btn .dot {
  opacity: 1;
}
.sc-status-group .btn-check:focus-visible + .sc-status-btn {
  outline: 2px solid var(--sc-accent);
  outline-offset: 1px;
}
/* Read-only status pill — the display counterpart of the toggle group above.
   Same per-status dot colour, shown anywhere a post's status is displayed
   (detail page, list rows) so the status looks identical everywhere. */
.sc-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--sc-dot, var(--sc-rule));
  color: var(--sc-fg);
  background-color: transparent;
  white-space: nowrap;
}
.sc-status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--sc-dot, var(--sc-muted));
}
/* Standalone status dot for compact contexts (the schedule grid), colour-coded
   by the same per-status palette. Pair with .sc-st-<status> and a title tooltip. */
.sc-status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--sc-dot, var(--sc-muted));
  vertical-align: middle;
}
/* Asset thumbnail — small square preview for image/video assets in the
   library and on post detail. */
.sc-asset-thumb {
  height: 48px;
  width: 48px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--sc-rule);
  background-color: var(--sc-ink-soft, transparent);
}

/* Selectable asset card in the post form's thumbnail picker. The checkbox is
   visually hidden; the card highlights when its box is checked. */
.sc-asset-pick {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 92px;
  padding: 6px;
  border: 1px solid var(--sc-rule);
  border-radius: 6px;
  cursor: pointer;
}
.sc-asset-pick:hover {
  border-color: var(--sc-fg);
}
.sc-asset-pick:has(input:checked) {
  border-color: var(--sc-fg);
  box-shadow: 0 0 0 2px var(--sc-fg);
}
/* Selection checkbox, shown in the card's top-left corner. */
.sc-asset-check {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

/* Tagify (hashtag chip input) themed to match the app's form controls and
   dark mode. Tagify exposes these as CSS custom properties. */
.tagify {
  --tags-border-color: var(--bs-border-color);
  --tag-bg: var(--sc-fg);
  --tag-hover: var(--sc-fg);
  --tag-text-color: var(--sc-bg);
  --tag-remove-btn-color: var(--sc-bg);
  --input-color: var(--bs-body-color);
  --placeholder-color: var(--sc-muted);
  background-color: var(--bs-body-bg);
}
.tagify__input {
  color: var(--bs-body-color);
}

.sc-st-drafting  { --sc-dot: #b06b00; }
.sc-st-ready     { --sc-dot: #0c6dd6; }
.sc-st-uploaded  { --sc-dot: #0d9488; }
.sc-st-scheduled { --sc-dot: #6d28d9; }
.sc-st-published { --sc-dot: #1d9e75; }
.sc-st-archived  { --sc-dot: #6c757d; }
.sc-st-cancelled { --sc-dot: #a32d2d; }

/* Bootstrap's warning yellow (#ffc107) as *text* is nearly invisible on the
   light paper background. Use a higher-contrast amber per theme. (Badges keep
   their yellow background + dark text, which is unaffected.) */
:root {
  --sc-warn: #8a5a00;
}
.sc-dark {
  --sc-warn: #e8c464;
}
@media (prefers-color-scheme: dark) {
  :root:not(.sc-light) {
    --sc-warn: #e8c464;
  }
}
.text-warning {
  color: var(--sc-warn) !important;
}

/* Schedule calendar: cells from adjacent months. A theme-neutral grey tint
   de-emphasizes them without dropping text to an unreadable muted colour
   (Bootstrap's bg-body-tertiary + text-muted was illegible in dark mode). */
.sc-cal-outside {
  background-color: rgba(128, 128, 128, 0.12);
}
.sc-cal-outside .sc-cal-daynum {
  opacity: 0.65;
}

/* Tell the browser which scheme native controls should use, so the
   date / datetime picker indicator (the little calendar icon) and form
   controls render with legible contrast in dark mode. Mirrors the
   light/dark resolution used for the CSS variables above. */
.sc-dark { color-scheme: dark; }
.sc-light { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not(.sc-light) { color-scheme: dark; }
}

/* Bootstrap nav-tabs default to near-black link text and a white active
   tab, both of which vanish on a dark surface. Re-tint inactive tabs to the
   muted foreground and give the active tab a dark surface. */
.sc-dark .nav-tabs,
.sc-dark .nav-tabs .nav-link {
  --bs-nav-tabs-link-active-color: var(--sc-paper);
  --bs-nav-tabs-link-active-bg: var(--sc-ink-soft);
  --bs-nav-tabs-link-active-border-color: var(--sc-rule);
  --bs-nav-tabs-border-color: var(--sc-rule);
}
.sc-dark .nav-tabs .nav-link {
  color: var(--sc-muted);
}
.sc-dark .nav-tabs .nav-link:hover,
.sc-dark .nav-tabs .nav-link:focus {
  color: var(--sc-paper);
  border-color: var(--sc-rule);
}
@media (prefers-color-scheme: dark) {
  :root:not(.sc-light) .nav-tabs,
  :root:not(.sc-light) .nav-tabs .nav-link {
    --bs-nav-tabs-link-active-color: var(--sc-paper);
    --bs-nav-tabs-link-active-bg: var(--sc-ink-soft);
    --bs-nav-tabs-link-active-border-color: var(--sc-rule);
    --bs-nav-tabs-border-color: var(--sc-rule);
  }
  :root:not(.sc-light) .nav-tabs .nav-link {
    color: var(--sc-muted);
  }
  :root:not(.sc-light) .nav-tabs .nav-link:hover,
  :root:not(.sc-light) .nav-tabs .nav-link:focus {
    color: var(--sc-paper);
    border-color: var(--sc-rule);
  }
}

/* Expenses dashboard: give each Chart.js canvas a sized, responsive box.
   Chart.js fills its parent when maintainAspectRatio is off. */
.sc-chart-box {
  position: relative;
  height: 300px;
}

/* ============================================================
   Surveys
   Survey UI moved out of per-template <style> blocks. Surveys force light
   mode (surveys/_force_light.html), so these use the light palette. The
   question-type and status colours are kept distinguishable but pulled into
   the brand hue family (gold / lilac / teal / navy / signal), replacing the
   old purple/blue/green set.
   ============================================================ */
:root {
  /* Question-type accents (bg / fg / border), brand hues */
  --sc-q-rating-bg: #F0E6CC; --sc-q-rating-fg: #6B5214; --sc-q-rating-bd: #E0CFA0; /* gold */
  --sc-q-multi-bg:  #E8E3F1; --sc-q-multi-fg:  #493C6E; --sc-q-multi-bd:  #CFC6E2; /* lilac */
  --sc-q-nps-bg:    #D9EAE8; --sc-q-nps-fg:    #1C4744; --sc-q-nps-bd:    #B4D4D0; /* teal */
  --sc-q-text-bg:   #DEE2EB; --sc-q-text-fg:   #26324F; --sc-q-text-bd:   #C2CAD9; /* navy */
  --sc-q-yesno-bg:  #F5DFD8; --sc-q-yesno-fg:  #8A2D18; --sc-q-yesno-bd:  #E6C3B7; /* signal */

  /* Status accents: teal = good, gold = pending, signal = ended, neutral */
  --sc-st-ok-bg:      #DCEDE9; --sc-st-ok-fg:      #1C4744; --sc-st-ok-bd:      #B4D4D0;
  --sc-st-warn-bg:    #F0E6CC; --sc-st-warn-fg:    #6B5214; --sc-st-warn-bd:    #E0CFA0;
  --sc-st-bad-bg:     #F5DFD8; --sc-st-bad-fg:     #8A2D18; --sc-st-bad-bd:     #E6C3B7;
  --sc-st-neutral-bg: #ECEAE0; --sc-st-neutral-fg: rgba(14, 23, 48, 0.62); --sc-st-neutral-bd: var(--sc-rule);
  --sc-st-info-bg:    #DEE2EB; --sc-st-info-fg:    #26324F; --sc-st-info-bd:    #C2CAD9;
}

.type-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 500; line-height: 1.4; white-space: nowrap;
}
.type-pill .icon { font-size: 12px; line-height: 1; }
.type-pill.rating       { background: var(--sc-q-rating-bg); color: var(--sc-q-rating-fg); }
.type-pill.multi_select { background: var(--sc-q-multi-bg);  color: var(--sc-q-multi-fg); }
.type-pill.nps          { background: var(--sc-q-nps-bg);    color: var(--sc-q-nps-fg); }
.type-pill.open_text    { background: var(--sc-q-text-bg);   color: var(--sc-q-text-fg); }
.type-pill.yes_no       { background: var(--sc-q-yesno-bg);  color: var(--sc-q-yesno-fg); }

.nudge {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 6px; font-size: 13px;
  background: var(--sc-st-info-bg); color: var(--sc-st-info-fg);
}
.nudge .nudge-icon { font-size: 16px; line-height: 1; }
.nudge a { color: inherit; font-weight: 500; }
.nudge .spacer { flex: 1; }

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--sc-st-neutral-bg); color: var(--sc-st-neutral-fg);
  border: 1px solid var(--sc-st-neutral-bd);
}
.status-pill .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 0 2px rgba(242, 236, 221, 0.6);
}
.status-pill.status-published { color: var(--sc-st-ok-fg);   background: var(--sc-st-ok-bg);   border-color: var(--sc-st-ok-bd); }
.status-pill.status-draft     { color: var(--sc-st-warn-fg); background: var(--sc-st-warn-bg); border-color: var(--sc-st-warn-bd); }
.status-pill.status-closed    { color: var(--sc-st-bad-fg);  background: var(--sc-st-bad-bg);  border-color: var(--sc-st-bad-bd); }

.status-btn-group .status-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; padding: 4px 12px;
  border: 1px solid var(--sc-rule); background: var(--sc-surf); color: var(--sc-muted);
}
.status-btn-group .status-btn .dot {
  width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: 0.4;
}
.status-btn-group .btn-check:checked + .status-btn .dot { opacity: 1; }
.status-btn-group .btn-check:checked + .status-btn.status-published { background: var(--sc-st-ok-bg);   color: var(--sc-st-ok-fg);   border-color: var(--sc-st-ok-bd); }
.status-btn-group .btn-check:checked + .status-btn.status-draft     { background: var(--sc-st-warn-bg); color: var(--sc-st-warn-fg); border-color: var(--sc-st-warn-bd); }
.status-btn-group .btn-check:checked + .status-btn.status-closed    { background: var(--sc-st-bad-bg);  color: var(--sc-st-bad-fg);  border-color: var(--sc-st-bad-bd); }

.type-pill-btn-group { display: flex; flex-wrap: wrap; gap: 6px; }
.type-pill-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 500; border: 1px solid;
  cursor: pointer; line-height: 1.3; opacity: 0.8;
  transition: opacity 0.15s, box-shadow 0.15s;
}
.type-pill-btn:hover { opacity: 1; }
.type-pill-btn .icon { font-size: 13px; line-height: 1; }

/* Doubled selectors out-specify Bootstrap's .btn rules that load after this. */
.type-pill-btn-group .type-pill-btn-rating       { background: var(--sc-q-rating-bg); color: var(--sc-q-rating-fg); border-color: var(--sc-q-rating-bd); }
.type-pill-btn-group .type-pill-btn-multi_select { background: var(--sc-q-multi-bg);  color: var(--sc-q-multi-fg);  border-color: var(--sc-q-multi-bd); }
.type-pill-btn-group .type-pill-btn-nps          { background: var(--sc-q-nps-bg);    color: var(--sc-q-nps-fg);    border-color: var(--sc-q-nps-bd); }
.type-pill-btn-group .type-pill-btn-open_text    { background: var(--sc-q-text-bg);   color: var(--sc-q-text-fg);   border-color: var(--sc-q-text-bd); }
.type-pill-btn-group .type-pill-btn-yes_no       { background: var(--sc-q-yesno-bg);  color: var(--sc-q-yesno-fg);  border-color: var(--sc-q-yesno-bd); }

.type-pill-btn-group .btn-check:checked + .type-pill-btn {
  opacity: 1; box-shadow: 0 0 0 2px currentColor;
}

.pillgroup .pillgroup-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; padding: 4px 12px;
  border: 1px solid var(--sc-rule); background: var(--sc-surf); color: var(--sc-muted);
  border-radius: 999px; cursor: pointer;
}
.pillgroup .pillgroup-btn .dot {
  width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: 0.4;
}
.pillgroup .btn-check:checked + .pillgroup-btn .dot { opacity: 1; }
.pillgroup .btn-check:checked + .pillgroup-btn.priority-low    { background: var(--sc-st-neutral-bg); color: var(--sc-st-neutral-fg); border-color: var(--sc-st-neutral-bd); }
.pillgroup .btn-check:checked + .pillgroup-btn.priority-medium { background: var(--sc-st-warn-bg);    color: var(--sc-st-warn-fg);    border-color: var(--sc-st-warn-bd); }
.pillgroup .btn-check:checked + .pillgroup-btn.priority-high   { background: var(--sc-st-bad-bg);     color: var(--sc-st-bad-fg);     border-color: var(--sc-st-bad-bd); }
.pillgroup .btn-check:checked + .pillgroup-btn.theme-status-open        { background: var(--sc-st-neutral-bg); color: var(--sc-st-neutral-fg); border-color: var(--sc-st-neutral-bd); }
.pillgroup .btn-check:checked + .pillgroup-btn.theme-status-in_progress { background: var(--sc-st-info-bg);    color: var(--sc-st-info-fg);    border-color: var(--sc-st-info-bd); }
.pillgroup .btn-check:checked + .pillgroup-btn.theme-status-resolved    { background: var(--sc-st-ok-bg);      color: var(--sc-st-ok-fg);      border-color: var(--sc-st-ok-bd); }

/* Survey surfaces (card / inset / bar track), theme-aware */
:root { --sc-surf: #F5F4ED; --sc-track: #E8E6DC; }

/* Dark variants: pill/status tints + surfaces. Provided for both the explicit
   .sc-dark toggle and auto (prefers-color-scheme) so surveys adapt once the
   force-light shim is removed. */
.sc-dark {
  --sc-surf: var(--sc-ink-soft); --sc-track: #2A3552;
  --sc-q-rating-bg: #38300F; --sc-q-rating-fg: #E5C892; --sc-q-rating-bd: #5A4D26;
  --sc-q-multi-bg:  #2C2745; --sc-q-multi-fg:  #C6BBE2; --sc-q-multi-bd:  #453E68;
  --sc-q-nps-bg:    #14322D; --sc-q-nps-fg:    #8FC9BF; --sc-q-nps-bd:    #285049;
  --sc-q-text-bg:   #1D2A46; --sc-q-text-fg:   #AAB7D2; --sc-q-text-bd:   #34415F;
  --sc-q-yesno-bg:  #391D14; --sc-q-yesno-fg:  #E9A892; --sc-q-yesno-bd:  #5A3427;
  --sc-st-ok-bg:      #14322D; --sc-st-ok-fg:      #8FC9BF; --sc-st-ok-bd:      #285049;
  --sc-st-warn-bg:    #38300F; --sc-st-warn-fg:    #E5C892; --sc-st-warn-bd:    #5A4D26;
  --sc-st-bad-bg:     #391D14; --sc-st-bad-fg:     #E9A892; --sc-st-bad-bd:     #5A3427;
  --sc-st-neutral-bg: #1B2747; --sc-st-neutral-fg: rgba(242, 236, 221, 0.62); --sc-st-neutral-bd: var(--sc-rule);
  --sc-st-info-bg:    #1D2A46; --sc-st-info-fg:    #AAB7D2; --sc-st-info-bd:    #34415F;
}
@media (prefers-color-scheme: dark) {
  :root:not(.sc-light) {
    --sc-surf: var(--sc-ink-soft); --sc-track: #2A3552;
    --sc-q-rating-bg: #38300F; --sc-q-rating-fg: #E5C892; --sc-q-rating-bd: #5A4D26;
    --sc-q-multi-bg:  #2C2745; --sc-q-multi-fg:  #C6BBE2; --sc-q-multi-bd:  #453E68;
    --sc-q-nps-bg:    #14322D; --sc-q-nps-fg:    #8FC9BF; --sc-q-nps-bd:    #285049;
    --sc-q-text-bg:   #1D2A46; --sc-q-text-fg:   #AAB7D2; --sc-q-text-bd:   #34415F;
    --sc-q-yesno-bg:  #391D14; --sc-q-yesno-fg:  #E9A892; --sc-q-yesno-bd:  #5A3427;
    --sc-st-ok-bg:      #14322D; --sc-st-ok-fg:      #8FC9BF; --sc-st-ok-bd:      #285049;
    --sc-st-warn-bg:    #38300F; --sc-st-warn-fg:    #E5C892; --sc-st-warn-bd:    #5A4D26;
    --sc-st-bad-bg:     #391D14; --sc-st-bad-fg:     #E9A892; --sc-st-bad-bd:     #5A3427;
    --sc-st-neutral-bg: #1B2747; --sc-st-neutral-fg: rgba(242, 236, 221, 0.62); --sc-st-neutral-bd: var(--sc-rule);
    --sc-st-info-bg:    #1D2A46; --sc-st-info-fg:    #AAB7D2; --sc-st-info-bd:    #34415F;
  }
}

/* Results: distribution bars + stat cards (was results.html inline <style>) */
.bar-row { margin-bottom: 0.6rem; font-size: 0.9rem; }
.bar-head { display: flex; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.2rem; color: var(--sc-muted); }
.bar-head .bar-text { word-break: break-word; }
.bar-head .bar-count { color: var(--sc-muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.bar-track { background: var(--sc-track); border-radius: 0.25rem; height: 0.75rem; overflow: hidden; }
.bar-fill { height: 100%; background: var(--sc-accent); transition: width 0.2s; }
.split-track { display: flex; height: 1.5rem; border-radius: 0.25rem; overflow: hidden; background: var(--sc-track); }
.split-seg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.85rem; font-weight: 600; transition: width 0.2s; min-width: 0; }
.split-seg.role-yes, .split-seg.role-promoter { background: var(--sc-teal); }
.split-seg.role-no, .split-seg.role-detractor { background: var(--sc-signal); }
.split-seg.role-passive { background: var(--sc-gold); }
.split-legend { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 0.4rem; font-size: 0.85rem; color: var(--sc-muted); }
.split-legend .legend-swatch { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 2px; margin-right: 0.35rem; vertical-align: middle; }
.stat-card { padding: 1rem; background: var(--sc-surf); border-radius: 0.5rem; text-align: center; }
.stat-card .stat-num { font-size: 1.75rem; font-weight: 600; color: var(--sc-fg); }
.stat-card .stat-label { font-size: 0.85rem; color: var(--sc-muted); }

/* Triage */
.triage-strip { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; margin-bottom: 16px; border-bottom: 1px solid var(--sc-rule); font-size: 13px; }
.triage-strip .crumb { color: var(--sc-muted); }
.triage-strip .crumb-current { color: var(--sc-fg); font-weight: 500; }
.triage-strip .side-peek { margin-left: auto; font-size: 12px; color: var(--sc-accent); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.triage-strip .side-peek:hover { text-decoration: underline; }
.progress-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.progress-track { flex: 1; height: 6px; background: var(--sc-track); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--sc-teal); border-radius: 3px; transition: width 0.2s; }
.progress-text { font-size: 12px; color: var(--sc-muted); white-space: nowrap; }
.progress-text strong { color: var(--sc-fg); font-weight: 500; }
.triage-question { margin: 4px 0 14px; padding: 10px 14px 12px; background: var(--sc-surf); border: 1px solid var(--sc-rule); border-left: 3px solid var(--sc-accent); border-radius: 6px; }
.triage-question-label { display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sc-accent); margin-bottom: 4px; }
.triage-question-text { font-family: var(--sc-font-display); font-size: 16px; font-weight: 500; line-height: 1.35; color: var(--sc-fg); margin: 0; }
.response-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 11px; color: var(--sc-muted); flex-wrap: wrap; }
.meta-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; background: var(--sc-track); }
.triage-callout { font-family: var(--sc-font-display); font-size: 17px; line-height: 1.6; padding: 16px 18px; background: var(--sc-surf); border-radius: 6px; border-left: 3px solid var(--sc-accent); margin-bottom: 16px; }
.theme-chip { display: inline-flex; align-items: center; gap: 0.4rem; border: 1px solid var(--sc-rule); border-radius: 6px; padding: 6px 10px; margin: 0.2rem 0.25rem 0.2rem 0; cursor: pointer; user-select: none; font-size: 13px; background: var(--sc-surf); color: var(--sc-fg); }
.theme-chip:hover { border-color: var(--sc-muted); }
.theme-chip input { display: none; }
.theme-chip .count { color: var(--sc-muted); font-size: 11px; }
.theme-chip.checked { background: var(--sc-q-multi-bg); border-color: var(--sc-q-multi-bd); color: var(--sc-q-multi-fg); }
.theme-chip.checked .count { color: var(--sc-q-multi-fg); }
.theme-chip.checked .kbd { background: var(--sc-q-multi-bd); color: var(--sc-q-multi-fg); }
.new-theme-chip { display: inline-flex; align-items: center; border: 1px dashed var(--sc-muted); border-radius: 6px; padding: 6px 10px; margin: 0.2rem 0; font-size: 13px; color: var(--sc-muted); }
.new-theme-chip input { border: none; outline: none; background: transparent; min-width: 8rem; color: var(--sc-fg); }
.quick-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; padding: 12px 0; margin: 4px 0; border-top: 1px solid var(--sc-rule); border-bottom: 1px solid var(--sc-rule); }
.kbd { font-family: var(--sc-font-mono); font-size: 10px; background: var(--sc-track); border-radius: 3px; padding: 1px 5px; color: var(--sc-muted); }
.kbd-light { background: rgba(255, 255, 255, 0.25); color: #fff; }

/* Builder (question rows / drag handles) */
.question-row.removed { display: none; }
.drag-handle { cursor: grab; font-size: 1.4rem; line-height: 1; padding: 0.4rem 0.5rem; color: var(--sc-muted); user-select: none; }
.drag-handle:hover { color: var(--sc-fg); }
.question-row.sortable-ghost { opacity: 0.45; }
.question-row.sortable-chosen .drag-handle { cursor: grabbing; }

/* Actions (AI action items) */
.ai-card.resolved { opacity: 0.65; }
.ai-card.resolved .ai-name { text-decoration: line-through; }
.resolve-checkbox { display: inline-flex; cursor: pointer; margin: 0; padding: 0; user-select: none; }
.resolve-checkbox input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.resolve-box { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 2px solid var(--sc-rule); border-radius: 4px; background: var(--sc-surf); transition: background 0.15s, border-color 0.15s; color: transparent; font-size: 14px; font-weight: 700; line-height: 1; }
.resolve-checkbox:hover .resolve-box { border-color: var(--sc-teal); }
.resolve-checkbox input:checked ~ .resolve-box { background: var(--sc-teal); border-color: var(--sc-teal); color: #fff; }
.resolve-checkbox input:focus-visible ~ .resolve-box { outline: 2px solid var(--sc-accent); outline-offset: 2px; }
.rep-quote { font-family: var(--sc-font-display); font-size: 0.95rem; color: var(--sc-fg); border-left: 3px solid var(--sc-gold); padding: 0.4rem 0.75rem; background: var(--sc-q-rating-bg); margin-top: 0.5rem; }
.stat-pill { padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.85rem; background: var(--sc-track); color: var(--sc-fg); }

/* Theme detail (response quotes) */
.response-quote { font-family: var(--sc-font-display); font-size: 1.05rem; line-height: 1.55; white-space: pre-wrap; }
.response-card.is-rep { border-left: 4px solid var(--sc-gold); background: var(--sc-q-rating-bg); }
.star-btn.starred { color: var(--sc-gold); }

/* Respond (NPS / yes-no / star fields, survey description) */
.nps-rating-field { display: flex; flex-wrap: wrap; gap: 6px; }
.nps-rating-field .form-check { display: inline-block; padding: 0; margin: 0; min-height: auto; }
.nps-rating-field .form-check-input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.nps-rating-field .form-check-label { display: inline-flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; border-radius: 6px; border: 1px solid var(--sc-rule); background: var(--sc-surf); color: var(--sc-fg); cursor: pointer; font-weight: 500; font-size: 0.95rem; transition: background 0.12s, color 0.12s, border-color 0.12s; margin: 0; }
.nps-rating-field .form-check-label:hover { border-color: var(--sc-accent); color: var(--sc-accent); }
.nps-rating-field .form-check-input:checked + .form-check-label { background: var(--sc-accent); color: #fff; border-color: var(--sc-accent); }
.nps-anchors { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--sc-muted); margin-top: 4px; }
.yesno-btn-group { gap: 8px; }
.yesno-btn-group .yesno-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; padding: 10px 24px; border: 1.5px solid; border-radius: 8px; cursor: pointer; transition: background 0.15s, color 0.15s, transform 0.1s, box-shadow 0.15s; }
.yesno-btn-group .yesno-btn.yesno-yes { background: var(--sc-st-ok-bg); color: var(--sc-teal); border-color: var(--sc-st-ok-bd); }
.yesno-btn-group .yesno-btn.yesno-no  { background: var(--sc-st-bad-bg); color: var(--sc-signal); border-color: var(--sc-st-bad-bd); }
.yesno-btn-group .yesno-btn:hover { transform: translateY(-1px); }
.yesno-btn-group .btn-check:checked + .yesno-btn.yesno-yes { background: var(--sc-teal); color: #fff; border-color: var(--sc-teal); box-shadow: 0 4px 14px rgba(46, 110, 106, 0.35); }
.yesno-btn-group .btn-check:checked + .yesno-btn.yesno-no { background: var(--sc-signal); color: #fff; border-color: var(--sc-signal); box-shadow: 0 4px 14px rgba(216, 76, 47, 0.35); }
.star-rating-field .form-check { display: inline-block; margin: 0 2px 0 0; padding: 0; min-height: auto; }
.star-rating-field .form-check-input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.star-rating-field .form-check-label { cursor: pointer; width: 2.4rem; height: 2.4rem; display: inline-flex; align-items: center; justify-content: center; color: var(--sc-track); font-size: 0; transition: color 0.12s; margin: 0; padding: 0; user-select: none; }
.star-rating-field .form-check-label::before { content: "★"; font-size: 1.9rem; line-height: 1; }
.star-rating-field .form-check-label:hover { color: var(--sc-gold); }
.star-rating-field .form-check.filled .form-check-label,
.star-rating-field .form-check.preview-filled .form-check-label { color: var(--sc-gold); }
.star-rating-field .form-check-input:focus-visible + .form-check-label { outline: 2px solid var(--sc-accent); outline-offset: 2px; border-radius: 4px; }
.star-rating-field .invalid-feedback { font-size: 0.85rem; }
.survey-description { position: relative; border-left: 4px solid var(--sc-accent); background: var(--sc-q-multi-bg); padding: 0.875rem 1rem 0.875rem 2.5rem; border-radius: 0 8px 8px 0; color: var(--sc-fg); line-height: 1.5; }
.survey-description::before { content: ""; position: absolute; left: 0.875rem; top: 1.05rem; width: 1rem; height: 1rem; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' fill='%23D84C2F'%3E%3Cpath d='M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z'/%3E%3C/svg%3E") center/contain no-repeat; }
.survey-description > :last-child { margin-bottom: 0; }
.survey-description a { color: var(--sc-accent); text-decoration: underline; }

/* Survey subnav pills: Bootstrap colours nav-links with --bs-primary (navy),
   which is unreadable on the dark page. Make them theme-aware. */
.survey-subnav .nav-link { color: var(--sc-muted); }
.survey-subnav .nav-link:hover,
.survey-subnav .nav-link:focus { color: var(--sc-fg); }
.survey-subnav .nav-link.active { color: var(--sc-bg); background-color: var(--sc-fg); }

/* ============================================================
   Availability week grid
   Responsive 2/4-col layout, plus the day-status colours remapped from
   Bootstrap's defaults (green / red / cyan / amber) to the brand palette.
   Scoped to .day-grid so success/danger elsewhere (e.g. expenses balances)
   keep their own meaning; the status cards/badges inside inherit these.
   ============================================================ */
.day-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
  --bs-success-rgb: 46, 110, 106;  /* teal, wide open */
  --bs-warning-rgb: 199, 154, 58;  /* gold, tight */
  --bs-danger-rgb:  216, 76, 47;   /* signal, unlikely */
  --bs-info-rgb:    138, 122, 184; /* lilac, off-hours */
}
@media (min-width: 768px) {
  .day-grid { grid-template-columns: repeat(4, 1fr); }
}
