/* ============================================================
   Arissa — Reputation Intelligence
   Every value here comes from the brand guidelines. Where the
   guidelines specify something (palette, type scale, 5px button
   radius, no italics, no off-brand text colours), that wins over
   any UI convention.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
  /* Primary palette */
  --cyan:  #34BDEB;   /* primary accent, links, icons, highlights */
  --ink:   #000000;   /* backgrounds, headlines, body text */
  --paper: #FFFFFF;   /* backgrounds, cards, reversed text */

  /* Secondary palette — infographics and backgrounds only */
  --deep:  #103547;   /* dark cyan-blue */
  --steel: #277CA5;   /* dark neon blue */
  --sky:   #B8F5FF;   /* light sky blue */
  --ice:   #EEF4F9;   /* very pale ice blue */

  /* Type scale from the guidelines: 54 / 36 / 28 / 15 */
  --h1: 54px;
  --h2: 36px;
  --h3: 28px;
  --body: 15px;

  --radius: 5px;       /* button corner radius, applied throughout */
  --gutter: 24px;
  --shell: 1440px;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--body);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  font-weight: 400;
}

/* The guidelines forbid italics anywhere. Enforce it rather than
   relying on everyone remembering. */
i, em, cite, address, dfn, var { font-style: normal; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ink);
}
h1 { font-size: clamp(34px, 5vw, var(--h1)); }
h2 { font-size: clamp(26px, 3.4vw, var(--h2)); }
h3 { font-size: clamp(20px, 2.4vw, var(--h3)); font-weight: 700; }
p  { margin: 0 0 1em; }

a { color: var(--cyan); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

/* ---------- Shell ---------- */
.shell { max-width: var(--shell); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header: black bar, reversed logo, cyan CTA ---------- */
.masthead { background: var(--ink); position: sticky; top: 0; z-index: 40; }
.masthead-inner {
  display: flex; align-items: center; gap: 32px;
  min-height: 72px; padding: 12px var(--gutter);
  max-width: var(--shell); margin: 0 auto;
}
/* Clear space equal to the triangle height, per the logo rules. */
.brand { display: block; padding: 14px 0; margin-right: 8px; flex: none; }
.brand img { height: 30px; width: auto; display: block; }

.nav { display: flex; align-items: center; gap: 28px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  color: var(--paper); font-size: 14px; font-weight: 600;
  padding: 6px 0; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--cyan); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--cyan); border-bottom-color: var(--cyan); }
.nav .who { color: var(--sky); font-size: 13px; font-weight: 500; }

.nav-toggle {
  display: none; margin-left: auto; background: none; border: 0;
  color: var(--paper); font-size: 22px; cursor: pointer; padding: 8px;
}

/* ---------- Buttons ----------
   Guideline rule: filled buttons carry white text; a white button
   carries cyan text. Black text never sits on a coloured button. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 700;
  padding: 11px 22px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none; line-height: 1.2;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: var(--cyan); color: var(--paper); }
.btn-primary:hover { background: var(--steel); color: var(--paper); }

.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: var(--deep); }

.btn-light { background: var(--paper); color: var(--cyan); border-color: var(--ice); }
.btn-light:hover { border-color: var(--cyan); }

.btn-quiet {
  background: transparent; color: var(--ink);
  border-color: var(--ink); font-weight: 600;
}
.btn-quiet:hover { background: var(--ink); color: var(--paper); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* On a black surface, buttons flip to cyan-on-white or white-on-cyan. */
.on-dark .btn-light { border-color: transparent; }

/* ---------- Page furniture ---------- */
.page { padding: 40px 0 64px; }

.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--cyan); margin-bottom: 10px;
}
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px; margin-bottom: 32px; }
.page-head > div:first-child { flex: 1 1 380px; }
.lede { font-size: 17px; font-weight: 500; max-width: 62ch; margin: 12px 0 0; }
.meta { font-size: 13px; font-weight: 500; }

.rule { height: 1px; background: var(--ink); border: 0; margin: 32px 0; opacity: .12; }
.section-title { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }

/* ---------- Stat strip ---------- */
.stat-strip {
  display: flex; flex-wrap: wrap; gap: 0;
  background: var(--ink); border-radius: var(--radius); overflow: hidden;
}
.stat {
  flex: 1 1 160px; padding: 20px 24px;
  border-right: 1px solid rgba(255,255,255,.14);
}
.stat:last-child { border-right: 0; }
.stat-value { font-size: var(--h3); font-weight: 800; color: var(--paper); line-height: 1.1; }
.stat-value.accent { color: var(--cyan); }
.stat-label {
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--sky); margin-top: 6px;
}

/* ---------- Filters ---------- */
.filters { background: var(--ice); border-radius: var(--radius); padding: 22px 24px; margin: 28px 0 36px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; align-items: end; }
.field label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; margin-bottom: 6px;
}
.field select, .field input {
  width: 100%; font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--ice); border-radius: var(--radius);
  padding: 10px 12px; appearance: none;
}
.field select:hover, .field input:hover { border-color: var(--cyan); }
.filters .field select, .filters .field input { border-color: var(--paper); }
.field-actions { display: flex; gap: 10px; align-items: center; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

.card {
  background: var(--paper); border: 1px solid var(--ice);
  border-radius: var(--radius); padding: 22px;
  position: relative; transition: border-color .15s ease;
  display: flex; flex-direction: column;
}
/* A two-line property name must not push one card's figures out of line with
   its neighbours', so everything below the title is bottom-anchored. */
.card > .beam { margin-top: auto; }
.card:hover { border-color: var(--cyan); }
.card.on-ice { background: var(--ice); border-color: var(--ice); }
.card.on-dark { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.card.on-dark h2, .card.on-dark h3 { color: var(--paper); }
.card.on-dark .meta { color: var(--sky); }

.card-title { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--cyan); text-decoration: none; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cover-link { position: absolute; inset: 0; border-radius: var(--radius); }

/* ---------- Signature: the sentiment beam ----------
   Zero sits dead centre. Cyan extends right for a property gaining
   ground, black extends left for one losing it. The palette has no
   red, and it doesn't need one — cyan reads as the brand's positive
   and black as its weight. Legible across a grid at a glance. */
.beam {
  position: relative; height: 10px; background: var(--ice);
  border-radius: var(--radius); overflow: hidden; margin: 18px 0 12px;
}
.beam::after {
  content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px;
  width: 2px; background: var(--paper);
}
.beam-fill { position: absolute; top: 0; bottom: 0; }
.beam-fill.pos { left: 50%; background: var(--cyan); }
.beam-fill.neg { right: 50%; background: var(--ink); }
.beam-scale {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
}

/* ---------- Big numbers ---------- */
.figure { display: flex; align-items: baseline; gap: 10px; }
.figure-value { font-size: var(--h3); font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.figure-unit { font-size: 13px; font-weight: 600; }

.delta { font-size: 13px; font-weight: 700; white-space: nowrap; }
.delta.up { color: var(--cyan); }
.delta.down { color: var(--ink); }
.delta.flat { color: var(--ink); font-weight: 500; }

/* ---------- KPI tiles ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.kpi { background: var(--ice); border-radius: var(--radius); padding: 20px; }
.kpi.lead { background: var(--ink); }
.kpi.lead .kpi-label { color: var(--sky); }
.kpi.lead .kpi-value { color: var(--paper); }
.kpi.lead .kpi-note { color: var(--sky); }
.kpi-label {
  font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; margin-bottom: 10px;
}
.kpi-value { font-size: var(--h3); font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.kpi-note { font-size: 12px; font-weight: 500; margin-top: 8px; }

/* ---------- Tags ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 10px; border-radius: var(--radius); white-space: nowrap;
}
.tag-cyan  { background: var(--cyan); color: var(--paper); }
.tag-ink   { background: var(--ink);  color: var(--paper); }
.tag-sky   { background: var(--sky);  color: var(--ink); }
.tag-ice   { background: var(--ice);  color: var(--ink); }
.tag-alert { background: var(--ink);  color: var(--cyan); }
.tag-line  { background: transparent; color: var(--ink); border: 1px solid var(--ice); }

/* ---------- Bullets: tick marks, never plain dots ---------- */
.ticks { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.ticks li { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; }
.tick {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; margin-top: 2px;
  background: var(--ink);
}
.ticks li:nth-child(even) .tick { background: var(--cyan); }
.tick svg { width: 11px; height: 11px; }

/* ---------- Trend bars ---------- */
.bars { display: flex; align-items: flex-end; gap: 8px; flex: 1; min-height: 140px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar {
  background: var(--cyan); border-radius: var(--radius) var(--radius) 0 0;
  min-height: 3px; transition: background-color .15s ease;
}
.bar-col:hover .bar { background: var(--ink); }
.bar-axis { display: flex; gap: 8px; margin-top: 8px; }
.bar-label { flex: 1; text-align: center; font-size: 11px; font-weight: 600; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--ice); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data thead th {
  background: var(--ice); text-align: left; padding: 14px 16px;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  white-space: nowrap;
}
table.data td { padding: 14px 16px; border-top: 1px solid var(--ice); vertical-align: middle; }
table.data tbody tr:hover { background: var(--ice); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.is-self { background: var(--sky); font-weight: 700; }
.cell-text { max-width: 420px; }
.nowrap { white-space: nowrap; }
code { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-size: 13px; font-weight: 600; }

/* ---------- Accordion: hairline rules, small cyan toggle ---------- */
.faq { border-top: 1px solid var(--ice); }
.faq details { border-bottom: 1px solid var(--ice); }
.faq summary {
  list-style: none; cursor: pointer; padding: 16px 0;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-weight: 700; font-size: 15px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--cyan); color: var(--cyan);
  display: grid; place-items: center; font-size: 14px; font-weight: 700; line-height: 1;
}
.faq details[open] summary::after { content: "–"; background: var(--cyan); color: var(--paper); border-color: var(--cyan); }
.faq .faq-body { padding: 0 0 18px; font-weight: 500; }

/* ---------- Empty state: an invitation ---------- */
.empty {
  background: var(--ice); border-radius: var(--radius);
  padding: 56px 24px; text-align: center;
}
.empty h3 { margin-bottom: 8px; }
.empty p { max-width: 46ch; margin: 0 auto 20px; font-weight: 500; }

/* ---------- Flash ---------- */
.flash {
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 24px;
  font-weight: 600; display: flex; gap: 12px; align-items: center;
  justify-content: space-between;
  transition: opacity .25s ease, transform .25s ease;
}
.flash-gone { opacity: 0; transform: translateY(-6px); }
.flash-close {
  flex: none; background: none; border: 0; cursor: pointer;
  font-size: 22px; line-height: 1; padding: 0 2px; color: inherit;
  opacity: .8;
}
.flash-close:hover { opacity: 1; }
.flash-success { background: var(--cyan); color: var(--paper); }
.flash-danger, .flash-warning { background: var(--ink); color: var(--paper); }
.flash-danger strong, .flash-warning strong { color: var(--cyan); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--ice); margin-top: 64px; padding: 28px 0;
  font-size: 13px; font-weight: 500;
}
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.footer img { height: 22px; width: auto; display: block; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; width: 100%; flex-direction: column; align-items: flex-start;
    gap: 4px; padding: 12px 0 18px; margin-left: 0;
  }
  .masthead-inner { flex-wrap: wrap; }
  .masthead.open .nav { display: flex; }
  .nav a { width: 100%; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.12); }
  .stat { flex-basis: 50%; border-right: 0; }
  .page { padding: 28px 0 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

@media print {
  .masthead, .filters, .btn { display: none; }
  .card, .kpi { border: 1px solid var(--ink); }
}

/* ============================================================
   Components for the response engine and configuration modules.
   Same tokens, same rules — a button here is the same object as
   a button on the intelligence pages.
   ============================================================ */

/* ---------- Auth: centred card on white ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--paper);
  border: 1px solid var(--ice); border-radius: var(--radius); padding: 36px;
}
.auth-mark { display: block; margin: 0 auto 28px; }
.auth-mark img { height: 34px; width: auto; display: block; margin: 0 auto; }
.auth-card h1 { font-size: var(--h3); margin-bottom: 6px; }
.auth-card .sub { font-weight: 500; margin-bottom: 24px; }
.auth-foot { margin: 20px 0 0; text-align: center; font-weight: 500; font-size: 14px; }
.auth-foot + .auth-foot { margin-top: 8px; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 18px; }
.form-row label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; margin-bottom: 6px;
}
.input, .textarea, .select {
  width: 100%; font-family: inherit; font-size: 14px; font-weight: 500; color: var(--ink);
  background: var(--paper); border: 1px solid var(--ice);
  border-radius: var(--radius); padding: 11px 13px; appearance: none;
}
.select { background: var(--paper); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.55; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--cyan); }
.input:disabled, .textarea:disabled { background: var(--ice); }
.input[readonly] { background: var(--ice); }
.hint { font-size: 12px; font-weight: 500; margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 12px; align-items: center; margin-top: 26px; }

/* ---------- Toolbar above a working table ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  background: var(--ice); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 20px;
}
.toolbar .select, .toolbar .input { width: auto; min-width: 200px; background: var(--paper); border-color: var(--paper); }
.toolbar-spacer { margin-left: auto; }

/* ---------- Working table: sticky head, sticky action column ---------- */
.worktable-shell {
  border: 1px solid var(--ice); border-radius: var(--radius);
  overflow: auto; max-height: calc(100vh - 300px);
}
table.work { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.work thead th {
  position: sticky; top: 0; z-index: 10;
  background: var(--ink); color: var(--paper); text-align: left;
  padding: 12px 14px; font-size: 11px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; white-space: nowrap;
}
table.work thead th:last-child { right: 0; z-index: 20; }
table.work td {
  padding: 12px 14px; border-bottom: 1px solid var(--ice);
  vertical-align: top; background: var(--paper);
}
table.work tbody tr:hover td { background: var(--ice); }
table.work td:last-child {
  position: sticky; right: 0; z-index: 8; min-width: 130px;
  box-shadow: -6px 0 12px -8px rgba(0, 0, 0, .35);
}
table.work tbody tr:hover td:last-child { background: var(--ice); }
/* Auto-approved rows: sky tint, not a warning colour — nothing is wrong here. */
table.work tbody tr.auto-approved td,
table.work tbody tr.auto-approved:hover td { background: var(--sky); }
.col-hidden { display: none; }
.cell-review { min-width: 260px; max-width: 420px; }
.cell-response { min-width: 300px; max-width: 460px; }
.cell-wide { min-width: 320px; }
.cell-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.legend { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.legend-swatch { width: 14px; height: 14px; border-radius: 3px; background: var(--sky); flex: none; }

/* ---------- Toast ---------- */
.toast-stack { position: fixed; top: 88px; right: 24px; z-index: 1200; display: grid; gap: 10px; }
.toast-note {
  border-radius: var(--radius); padding: 13px 18px; font-weight: 600; font-size: 14px;
  min-width: 260px; max-width: 380px; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .45);
}
.toast-note.info { background: var(--cyan); color: var(--paper); }
.toast-note.ok { background: var(--ink); color: var(--cyan); }
.toast-note.bad { background: var(--ink); color: var(--paper); }

/* ---------- Blocking overlay with a cyan spinner ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 2000; display: none;
  place-items: center; background: rgba(0, 0, 0, .78);
}
.overlay.show { display: grid; }
.overlay-inner { text-align: center; color: var(--paper); }
.spinner {
  width: 46px; height: 46px; margin: 0 auto 18px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .25); border-top-color: var(--cyan);
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.overlay-text { font-weight: 700; font-size: 17px; }

/* ---------- Tooltip on a disabled control ---------- */
.hint-wrap { position: relative; display: inline-flex; }
.hint-wrap[data-hint]:hover::after {
  content: attr(data-hint); position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%); background: var(--ink); color: var(--paper);
  font-size: 12px; font-weight: 600; padding: 7px 11px; border-radius: var(--radius);
  white-space: nowrap; z-index: 30;
}

/* ---------- Prompt editor ---------- */
.editor-shell { border: 1px solid var(--ice); border-radius: var(--radius); overflow: hidden; }
.editor-shell .ql-toolbar.ql-snow {
  border: 0; border-bottom: 1px solid var(--ice); background: var(--ice);
  font-family: 'Montserrat', sans-serif;
}
.editor-shell .ql-container.ql-snow { border: 0; }
.editor-shell .ql-editor {
  min-height: 340px; font-family: 'Montserrat', sans-serif;
  font-size: var(--body); line-height: 1.65; color: var(--ink);
}
.editor-shell .ql-editor.ql-blank::before { color: var(--ink); opacity: .45; font-style: normal; }
.editor-shell .ql-snow .ql-stroke { stroke: var(--ink); }
.editor-shell .ql-snow .ql-fill { fill: var(--ink); }
.editor-shell .ql-snow .ql-active .ql-stroke { stroke: var(--cyan); }
.editor-shell .ql-snow .ql-active .ql-fill { fill: var(--cyan); }
.editor-shell .ql-snow button:hover .ql-stroke { stroke: var(--cyan); }

@media (max-width: 860px) {
  .worktable-shell { max-height: none; }
  table.work td:last-child, table.work thead th:last-child { position: static; box-shadow: none; }
  .toast-stack { top: 80px; right: 12px; left: 12px; }
  .toast-note { min-width: 0; max-width: none; }
}