/* BCCL Brand Voice Agent - editorial / newsroom aesthetic */
:root {
  --ink: #111111;
  --ink-soft: #2a2a2a;
  --muted: #5c5c5c;
  --line: #d8d4cc;
  --paper: #f7f5f0;
  --card: #ffffff;
  --accent: #c45c26;
  --accent-soft: #f3e6dc;
  --ok: #1f6b4a;
  --warn: #8a5a00;
  --shadow: 0 1px 2px rgba(17,17,17,.04), 0 8px 24px rgba(17,17,17,.06);
  --radius: 10px;
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 10% -10%, #efe8df 0%, transparent 55%),
    radial-gradient(900px 360px at 100% 0%, #eddccf 0%, transparent 50%),
    var(--paper);
  line-height: 1.5;
  min-height: 100vh;
}

a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }

.app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 64px;
}

/* Header */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  display: flex;
  gap: 14px;
  align-items: center;
}
.mark {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.topbar h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.4vw, 1.65rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 0.82rem;
  color: var(--ink-soft);
  box-shadow: var(--shadow);
}
.mode-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.mode-pill.live .mode-dot { background: var(--ok); }
.mode-pill.demo .mode-dot { background: var(--accent); }

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 22px;
}
.step-chip {
  text-align: center;
  font-size: 0.72rem;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.55);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.step-chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.step-chip.done {
  background: var(--accent-soft);
  color: var(--ink-soft);
  border-color: #e2c8b4;
}

/* Panels */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}
.panel h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.panel .lede {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.93rem;
}
.hidden { display: none !important; }

/* Brand cards */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.brand-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  background: #fbfaf7;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  text-align: left;
}
.brand-card:hover {
  border-color: #b9b3a8;
  transform: translateY(-1px);
}
.brand-card.selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
  background: #fff;
}
.brand-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-family: var(--serif);
}
.brand-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.voice-card {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #fbfaf7;
  margin-bottom: 16px;
}
.voice-card h4 {
  margin: 0 0 10px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.voice-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
  font-size: 0.9rem;
}
.voice-meta dt {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 2px;
}
.voice-meta dd { margin: 0 0 8px; }
.sample-lines {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.sample-lines em {
  font-family: var(--serif);
  font-style: italic;
  display: block;
  margin: 4px 0;
}

label.field {
  display: block;
  margin-bottom: 14px;
}
label.field > span {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 6px;
}
input[type="text"], select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:focus, select:focus, textarea:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(17,17,17,.06);
}
textarea { min-height: 96px; resize: vertical; }
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* Actions */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}
.btn {
  appearance: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn:hover { opacity: .92; }
.btn:active { transform: translateY(1px); }
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.btn.secondary {
  background: transparent;
  color: var(--ink);
}
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
  font-weight: 500;
}
.hint {
  font-size: 0.82rem;
  color: var(--muted);
}

/* Options */
.options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.option {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  position: relative;
}
.option:hover { border-color: #b9b3a8; }
.option.selected {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink), var(--shadow);
}
.option-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
}
.badge {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.angle-tag {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.option h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.3;
}
.option .body {
  white-space: pre-wrap;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 0.84rem;
}
.meta-box {
  background: #fbfaf7;
  border-radius: 8px;
  padding: 10px;
  border: 1px solid #ece8e0;
}
.meta-box strong {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}
.risk { color: var(--warn); }

/* Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}
.chip {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--ink-soft);
}
.chip.on {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* Compare */
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.compare-col {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fbfaf7;
}
.compare-col.revised {
  background: #fff;
  border-color: var(--ink);
}
.compare-col h3 {
  margin: 0 0 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.compare-col .headline {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 8px 0;
  line-height: 1.3;
}
.compare-col .body {
  white-space: pre-wrap;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.export-box {
  background: #111;
  color: #f7f5f0;
  border-radius: 10px;
  padding: 16px;
  font-family: var(--mono);
  font-size: 0.82rem;
  white-space: pre-wrap;
  max-height: 320px;
  overflow: auto;
  margin-top: 12px;
}
.how-note {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfaf7;
  font-size: 0.9rem;
}
.how-note h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.05rem;
}

.footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 50;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(247,245,240,.3);
  border-top-color: var(--paper);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 820px) {
  .brand-grid, .compare, .row-2, .meta-row, .voice-meta {
    grid-template-columns: 1fr;
  }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .step-chip:nth-child(n+5) { display: none; }
}

/* ---- Case study page ---- */
.case-page .case-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.case-page .case-nav .btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
.case-hero .eyebrow {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-title {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.hero-lede { font-size: 1rem; color: var(--ink-soft); }
.disclaimer {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: #fbfaf7;
  border: 1px dashed var(--line);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.proof-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--ink-soft);
}
.proof-list li { margin-bottom: 8px; }
.input-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}
.guidelines-block .guide-list {
  margin: 0 0 14px;
  padding-left: 1.15rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.guidelines-block .guide-list li { margin-bottom: 6px; }
.cite-label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.footnotes {
  margin: 0 0 10px;
  padding-left: 1.2rem;
  font-size: 0.85rem;
}
.footnotes li { margin-bottom: 4px; }
.cite-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}
.brief-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
}
.brief-card h4 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 1.05rem;
}
.brief-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 12px;
  font-size: 0.88rem;
}
.brief-meta dt {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.brief-meta dd { margin: 2px 0 0; }
.brief-text {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.55;
}
.case-options .case-option {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #fff;
  margin-bottom: 12px;
}
.case-options .case-option.chosen {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink), var(--shadow);
}
.case-options .body {
  white-space: pre-wrap;
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 12px;
}
.case-options h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.3;
}
.chosen-pill {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
}
.feedback-quote {
  margin: 0;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  background: #fbfaf7;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--ink-soft);
}
.btn.secondary {
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
a.btn { text-decoration: none; }

.top-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.experiment-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid #e2c8b4;
  background: var(--accent-soft);
  border-radius: 10px;
}
.experiment-bar p {
  margin: 0;
  flex: 1;
  min-width: 200px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

@media (max-width: 820px) {
  .brief-meta { grid-template-columns: 1fr; }
}

/* Round + reject path */
.panel-head-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.panel-head-row h2 { margin: 0; }
.round-pill {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
}
.reject-panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fbfaf7;
}
.reject-panel h3 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 1.05rem;
}
.reject-panel textarea { min-height: 72px; }


.reject-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.reject-actions .btn.secondary {
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  min-height: 44px;
  cursor: pointer;
}
.reject-actions .btn.secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.reject-panel:not(.hidden) {
  border: 2px solid var(--ink);
  background: #fff;
  box-shadow: 0 8px 24px rgba(20, 18, 14, 0.06);
}
.reject-panel .field em {
  font-style: normal;
  color: var(--accent);
  font-weight: 600;
}
.reject-panel textarea {
  min-height: 96px;
  border: 1.5px solid var(--ink);
}
