/* Events BI design system — single source of truth for visual tokens and components.
   Spec: docs/DESIGN_SYSTEM.md · Live reference: /styleguide
   Direction: minimalist, modern, clean. Light neutral surfaces, hairline borders,
   black primary actions, ONE restrained accent used sparingly. No gradients, no
   glows, no decorative ornament. */

:root {
  /* Surfaces */
  --bg: #FAFAF8;            /* page background */
  --panel: #FFFFFF;         /* cards, panels, inputs */
  --panel-2: #F5F5F3;       /* subtle wash: hovers, wells, column bodies */

  /* Lines */
  --line: #E8E9EA;          /* hairline borders, dividers */
  --line-strong: #D6D8DA;   /* input borders, interactive outlines */

  /* Text */
  --ink: #16181C;           /* primary text, primary buttons */
  --muted: #6B7280;         /* secondary text */
  --faint: #9AA1A9;         /* tertiary text, labels, page furniture */

  /* Accent — use sparingly (labels, active nav icon, small emphasis) */
  --accent: #B07E2E;

  /* Status — muted, never neon */
  --green: #1E7F5C;         /* done, approved, verified */
  --amber: #B07E2E;         /* in progress, proposed, provided */
  --red: #C2453A;           /* blocked, open risk, rejected */
  --blue: #3B7EA1;          /* backlog, informational */

  /* Geometry */
  --radius: 10px;           /* panels, cards */
  --radius-sm: 8px;         /* buttons, inputs, chips */

  /* Elevation — two levels only */
  --shadow-soft: 0 1px 2px rgba(22, 24, 28, .05);            /* resting cards */
  --shadow: 0 8px 28px rgba(22, 24, 28, .09);                /* modals, toasts */

  /* Type */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ── Base ─────────────────────────────────────────────────── */
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(176, 126, 46, .18); }
button, input, select, textarea { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Typography ───────────────────────────────────────────── */
.ds-title { font-size: 20px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.ds-subtitle { color: var(--muted); font-size: 12.5px; line-height: 1.55; margin: 0; }
.ds-label {
  color: var(--faint); font-size: 9.5px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase;
}
.ds-value { font-size: 30px; font-weight: 700; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.ds-meta { color: var(--faint); font-size: 10.5px; }
.ds-mono { font-family: var(--mono); }

/* ── Buttons ──────────────────────────────────────────────── */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  min-height: 34px; padding: 0 13px;
  color: var(--ink); background: var(--panel); cursor: pointer;
  font-weight: 600; font-size: 12px; text-decoration: none;
  transition: border-color .14s ease, background .14s ease;
  box-shadow: var(--shadow-soft);
}
.button:hover { border-color: var(--faint); background: var(--panel-2); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button.primary { border-color: var(--ink); background: var(--ink); color: #FFFFFF; }
.button.primary:hover { background: #2A2D33; border-color: #2A2D33; }
.button.small { min-height: 30px; padding: 0 10px; font-size: 11px; }
.button.ghost-icon { width: 34px; padding: 0; }
.button svg { width: 13px; height: 13px; }

/* ── Panels & cards ───────────────────────────────────────── */
.panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.panel-header {
  min-height: 46px; padding: 0 16px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.panel-header h3 { margin: 0; font-size: 12.5px; font-weight: 700; }
.panel-header span {
  color: var(--faint); font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .09em;
}
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  padding: 16px 18px;
}
.well {
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 16px 18px;
}

/* ── Status pills ─────────────────────────────────────────── */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line-strong); border-radius: 100px;
  color: var(--muted); background: var(--panel);
  font-size: 9px; font-weight: 700; padding: 3px 8px;
  text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
}
.status-pill::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status-pill.is-amber { color: var(--amber); border-color: rgba(176, 126, 46, .35); background: rgba(176, 126, 46, .06); }
.status-pill.is-green { color: var(--green); border-color: rgba(30, 127, 92, .32); background: rgba(30, 127, 92, .06); }
.status-pill.is-red   { color: var(--red);   border-color: rgba(194, 69, 58, .32);  background: rgba(194, 69, 58, .05); }
.status-pill.is-blue  { color: var(--blue);  border-color: rgba(59, 126, 161, .32); background: rgba(59, 126, 161, .05); }

/* ── Forms ────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; }
.field > span {
  color: var(--muted); font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
}
.input, input.ds, select.ds, textarea.ds {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink); padding: 10px 11px;
  font-family: var(--sans); font-size: 13px;
  transition: border-color .13s ease, box-shadow .13s ease;
}
.input:focus, input.ds:focus, select.ds:focus, textarea.ds:focus {
  outline: none; border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(22, 24, 28, .08);
}

/* ── Lists ────────────────────────────────────────────────── */
.list { display: grid; }
.list-row {
  padding: 13px 16px; border-bottom: 1px solid var(--line);
  display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 11px;
  align-items: start; transition: background .12s ease;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: var(--panel-2); }
.item-title { font-weight: 600; font-size: 12.5px; line-height: 1.45; }
.item-meta { color: var(--faint); font-size: 10px; margin-top: 4px; }
.item-description { color: var(--muted); font-size: 11.5px; line-height: 1.55; margin-top: 5px; }

/* ── Priority dots ────────────────────────────────────────── */
.priority-pin { width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; background: var(--faint); }
.priority-pin.critical { background: var(--red); }
.priority-pin.high { background: var(--amber); }
.priority-pin.medium { background: var(--blue); }

/* ── Report library ───────────────────────────────────────── */
.group-h { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 6px; }
.group-h b { font-size: 12.5px; }
.group-h span { color: var(--faint); font-size: 11px; }
.report-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.report-row + .report-row { border-top: 1px solid var(--line); }
.report-row .grow { flex: 1; min-width: 0; }
.report-row .name { font-weight: 600; font-size: 13.5px; }
.report-row .meta { color: var(--faint); font-size: 11.5px; margin-top: 2px; }

/* ── Wizard steps ─────────────────────────────────────────── */
.step-dots { display: flex; gap: 18px; }
.step-dots > span { font-size: 11.5px; font-weight: 700; color: var(--faint); display: flex; gap: 7px; align-items: center; }
.step-dots i { width: 19px; height: 19px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 700; }
.step-dots .done { color: var(--green); }
.step-dots .done i { background: var(--green); border: 1.5px solid var(--green); color: #FFFFFF; }
.step-dots .cur { color: var(--ink); }
.step-dots .cur i { border: 1.5px solid var(--ink); }

/* ── Upload dropzones ─────────────────────────────────────── */
.dropzone { border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 20px; text-align: center; color: var(--muted); font-size: 12.5px; transition: border .15s ease, background .15s ease; }
.dropzone.dragover { border: 1.5px dashed var(--ink); background: var(--panel-2); }
.dropzone.filled { border: 1.5px solid rgba(30, 127, 92, .4); background: rgba(30, 127, 92, .05); text-align: left; color: var(--ink); }
.dropzone .tick { width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #FFFFFF; display: grid; place-items: center; font-size: 13px; flex: 0 0 auto; }
.dropzone .fname { font-weight: 600; font-size: 12.5px; overflow-wrap: anywhere; }
.dropzone .fmeta { color: var(--faint); font-size: 11px; margin-top: 1px; }

/* ── Segmented control ────────────────────────────────────── */
.seg-control { display: flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg-control button { border: 0; background: var(--panel); color: var(--muted); font-size: 11.5px; font-weight: 700; padding: 8px 12px; cursor: pointer; }
.seg-control button.on { background: var(--ink); color: #FFFFFF; }

/* ── Evidence summary line ────────────────────────────────── */
.evidence-line { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; font-weight: 600; }
.evidence-line span::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--c, var(--faint)); }

/* ── Report cover preview (depicts the PDF's event theme) ── */
.report-cover-preview { display: block; background: #0A2144; border-radius: 10px; aspect-ratio: 16 / 9; padding: 7% 8%; color: #FFFFFF; position: relative; overflow: hidden; text-decoration: none; }
.report-cover-preview::after { content: ""; position: absolute; right: -18%; bottom: -30%; width: 60%; aspect-ratio: 1; border: 1px solid rgba(43, 168, 221, .27); border-radius: 50%; box-shadow: 0 0 0 26px rgba(43, 168, 221, .09); }
.report-cover-preview .ev { color: #7CC9EA; font-size: 11px; font-weight: 700; }
.report-cover-preview .sp { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin-top: 3px; }
.report-cover-preview .st { color: #2BA8DD; font-size: 9px; font-weight: 700; letter-spacing: .06em; margin-top: 4px; }
.report-cover-preview.is-image { padding: 0; background: var(--panel-2); border: 1px solid var(--line); }
.report-cover-preview.is-image::after { display: none; }
.report-cover-preview.is-image img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ── Disclosure drawers ───────────────────────────────────── */
.drawer { border: 1px solid var(--line); border-radius: 10px; }
.drawer > summary { cursor: pointer; padding: 11px 14px; font-size: 12.5px; font-weight: 600; display: flex; justify-content: space-between; list-style: none; }
.drawer > summary::-webkit-details-marker { display: none; }
.drawer > summary small { color: var(--faint); font-weight: 500; }
.drawer .drawer-body { border-top: 1px solid var(--line); padding: 12px 14px; display: grid; gap: 9px; max-height: 340px; overflow-y: auto; }

/* ── Decision bar ─────────────────────────────────────────── */
.decision-bar { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); background: var(--panel-2); padding: 13px 22px; border-radius: 0 0 var(--radius) var(--radius); flex-wrap: wrap; }

/* ── Feedback ─────────────────────────────────────────────── */
.toast {
  position: fixed; right: 22px; bottom: 22px; z-index: 80;
  background: var(--ink); color: #FFFFFF;
  border-radius: 9px; padding: 11px 15px; font-weight: 600; font-size: 12px;
  box-shadow: var(--shadow);
  opacity: 0; transform: translateY(10px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast[data-kind="error"] { background: var(--red); }
.empty { padding: 26px 16px; color: var(--faint); text-align: center; font-size: 11px; }

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

/* ── Insights (narratives) ────────────────────────────────── */
.insights { border-top: 1px solid var(--line); padding: 20px 22px; display: grid; gap: 14px; }
.insights-head { display: grid; gap: 4px; }
.insights-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .insights-list { grid-template-columns: 1fr; } }
.insight-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; background: var(--panel); }
.insight-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.insight-title { font-weight: 700; letter-spacing: .02em; text-transform: uppercase; }
.insight-body { min-height: 96px; resize: vertical; line-height: 1.45; }
.insight-counter { text-align: right; }
.insight-counter.is-over { color: var(--red); font-weight: 600; }
.insight-cites { opacity: .8; word-break: break-all; }
.insights-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── Event photographs ────────────────────────────────────── */
.photos { border-top: 1px solid var(--line); padding: 20px 22px; display: grid; gap: 14px; }
.photos-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .photos-grid { grid-template-columns: 1fr; } }
.photo-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: grid; gap: 8px; background: var(--panel); align-content: start; }
.photo-frame { background: var(--panel-2); border: 1px dashed var(--line); border-radius: 8px; height: 170px; width: 259px; max-width: 100%; display: grid; place-items: center; overflow: hidden; }
.photo-card.is-vertical .photo-frame { width: 119px; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-file { font-size: 12.5px; }

/* ── Review page: quieter technical details ─────────────── */
.drawer.tech > summary { color: var(--faint); }
.tech-body { max-height: none; gap: 12px; }
.tech-body .drawer { background: var(--panel); }
.insight-counter[hidden] { display: none; }
.photos-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.photos-actions input.ds { width: 260px; }
.photo-card .button { justify-self: start; }
