/* =========================================================================
   GuestSense AI — A!thera Partners design system
   Calm, precise, editorial, restrained. Accent discipline: A! Blue is the
   single brand accent; Blue Deep for interactive text (contrast on white).
   ========================================================================= */

:root {
  --athera-blue:#5FB8D6; --athera-blue-deep:#2A8FB0; --athera-charcoal:#374151; --athera-charcoal-light:#4B5563;
  --athera-grey:#6B7280; --athera-grey-light:#9CA3AF; --athera-navy:#0F172A; --athera-navy-mid:#1E2B42;
  --athera-white:#FFFFFF; --athera-off-white:#F8F7F4; --athera-surface:#F1EEE8;
  --athera-amber:#C8955A; --athera-steel:#8AA5BE; --athera-mist:#D4DFE8;
  --athera-line:rgba(55,65,81,0.12); --athera-line-light:rgba(55,65,81,0.06);
  --athera-display:'Cormorant Garamond',Georgia,serif; --athera-sans:'DM Sans',system-ui,Arial,sans-serif; --athera-mono:'DM Mono',Consolas,monospace;
}

/* --- reset --------------------------------------------------------------- */

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--athera-off-white);
  color: var(--athera-charcoal);
  font-family: var(--athera-sans);
  font-size: 16px;
  line-height: 1.68;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--athera-blue-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: rgba(95,184,214,0.25); }

/* Visible, consistent keyboard focus ring (Blue Deep, 2px, 2px offset).
   Buttons with .btn set their own matching ring above; this covers links and
   the bare <button> controls (tabs, priority rows, filters, rail links). */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
.tab:focus-visible,
.pl-row:focus-visible,
.pl-filter:focus-visible,
.rail-link:focus-visible {
  outline: 2px solid var(--athera-blue-deep);
  outline-offset: 2px;
  border-radius: 2px;
}

/* --- type scale --------------------------------------------------------- */

.display-lg, .display-md, .display-sm {
  font-family: var(--athera-display);
  font-weight: 300;
  color: var(--athera-charcoal);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0;
}
.display-lg { font-size: 48px; }
.display-md { font-size: 34px; }
.display-sm { font-size: 25px; }

@media (max-width: 768px) {
  .display-lg { font-size: 36px; }
  .display-md { font-size: 28px; }
}

.lead {
  font-size: 18px;
  line-height: 1.7;
  font-weight: 300;
  color: var(--athera-charcoal-light);
  max-width: 60ch;
}

.body { font-size: 16px; line-height: 1.68; color: var(--athera-charcoal); }
.muted { color: var(--athera-grey); }
.small { font-size: 13px; }

/* Eyebrow LABEL — DM Sans 500, uppercase, wide tracking */
.eyebrow {
  font-family: var(--athera-sans);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 10px;
  color: var(--athera-blue-deep);
  margin: 0;
}
.eyebrow.grey { color: var(--athera-grey); }

/* DM Mono for IDs, confidence, metadata */
.mono { font-family: var(--athera-mono); font-weight: 300; font-size: 12px; letter-spacing: 0; }
.meta { font-family: var(--athera-mono); font-size: 12px; color: var(--athera-grey); }

/* Thin blue rule under section intros */
.rule { width: 48px; height: 1px; background: var(--athera-blue); border: none; margin: 18px 0; }

/* Section number + eyebrow header block */
.section-head { margin-bottom: 28px; }
.section-head .section-no { font-family: var(--athera-mono); font-size: 12px; color: var(--athera-grey); margin-right: 10px; }
.section-head h2 { margin: 14px 0 0; }

/* --- app bar ------------------------------------------------------------ */

.app-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 48px;
  background: var(--athera-off-white);
  border-bottom: 1px solid var(--athera-line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.athera-wordmark {
  font-family: var(--athera-display);
  font-size: 24px;
  font-weight: 300;
  color: var(--athera-charcoal);
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.wm-partners {
  font-family: var(--athera-sans);
  font-size: 0.5em;
  font-weight: 400;
  color: var(--athera-grey);
  letter-spacing: 0.08em;
  margin-left: 4px;
  vertical-align: super;
}

.app-bar .divider { width: 1px; height: 22px; background: var(--athera-line); flex: none; }
.app-bar .toolname { font-size: 13.5px; color: var(--athera-charcoal); white-space: nowrap; }
.app-bar .bar-spacer { flex: 1; }

@media (max-width: 768px) {
  .app-bar { padding: 12px 24px; gap: 12px; flex-wrap: wrap; }
  .app-bar .toolname { font-size: 12px; }
}

/* --- stepper ------------------------------------------------------------ */

.stepper { display: flex; align-items: center; gap: 22px; list-style: none; margin: 0; padding: 0; }
.stepper .step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--athera-sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--athera-grey-light);
  font-weight: 400;
  padding-bottom: 3px;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}
.stepper .step .step-no {
  font-family: var(--athera-mono);
  font-size: 11px;
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--athera-line);
  border-radius: 50%;
  color: var(--athera-grey-light);
}
.stepper .step.active { color: var(--athera-charcoal); border-bottom-color: var(--athera-blue); font-weight: 500; }
.stepper .step.active .step-no { border-color: var(--athera-blue); color: var(--athera-blue-deep); }
.stepper .step.done { color: var(--athera-grey); }
.stepper .step.done .step-no { background: var(--athera-blue); border-color: var(--athera-blue); color: var(--athera-navy); }

@media (max-width: 1120px) {
  .stepper .step span.step-label { display: none; }
  .stepper { gap: 10px; }
}
@media (max-width: 768px) {
  .stepper { width: 100%; order: 3; justify-content: flex-start; gap: 8px; }
}

/* --- layout ------------------------------------------------------------- */

#view { flex: 1; }

.page { max-width: 1200px; margin: 0 auto; padding: 56px 48px; width: 100%; }
.page-narrow { max-width: 820px; }

.stack > * + * { margin-top: 16px; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 900px) {
  .page { padding: 40px 24px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* --- cards -------------------------------------------------------------- */

.card {
  background: var(--athera-white);
  border: 1px solid var(--athera-line);
  border-radius: 4px;
  padding: 28px;
}
.card.pad-lg { padding: 32px; }
.card.pad-sm { padding: 20px; }
.card + .card { margin-top: 24px; }
.card h3 { font-family: var(--athera-display); font-weight: 300; font-size: 22px; margin: 0 0 4px; }

.card-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }

/* --- buttons ------------------------------------------------------------ */

.btn {
  font-family: var(--athera-sans);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 22px;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--athera-blue-deep); outline-offset: 2px; }

.btn-primary { background: var(--athera-blue); color: var(--athera-navy); border-color: var(--athera-blue); }
.btn-primary:hover { background: var(--athera-blue-deep); border-color: var(--athera-blue-deep); color: var(--athera-white); }

.btn-secondary { background: transparent; color: var(--athera-charcoal); border-color: var(--athera-line); }
.btn-secondary:hover { border-color: var(--athera-charcoal); }

.btn[disabled], .btn.is-disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.btn-sm { padding: 8px 14px; font-size: 11px; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* --- form controls ------------------------------------------------------ */

.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.field > label {
  font-family: var(--athera-sans);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 10px;
  color: var(--athera-grey);
}
.field .hint { font-size: 12.5px; color: var(--athera-grey); margin: 0; line-height: 1.5; }
.field .req { color: var(--athera-amber); margin-left: 3px; }

select, input[type="text"], input[type="date"], textarea {
  font-family: var(--athera-sans);
  font-size: 15px;
  font-weight: 300;
  color: var(--athera-charcoal);
  background: var(--athera-white);
  border: 1px solid var(--athera-line);
  border-radius: 3px;
  padding: 11px 13px;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
select:focus, input:focus, textarea:focus {
  outline: none;
  border-color: var(--athera-blue-deep);
  box-shadow: 0 0 0 3px rgba(42,143,176,0.12);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }
select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236B7280' stroke-width='1.2' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px; }

.field.invalid select, .field.invalid input, .field.invalid textarea { border-color: var(--athera-amber); }
.field .err { font-size: 12px; color: var(--athera-amber); margin: 0; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 600px) { .field-row { grid-template-columns: 1fr; } }

/* --- status / priority / risk labels ------------------------------------ */
/* Meaning carried in the text first, colour second. 2px left rule. */

.label {
  display: inline-flex;
  align-items: center;
  font-family: var(--athera-sans);
  font-weight: 500;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 3px 9px 3px 8px;
  border-left: 2px solid var(--athera-grey);
  color: var(--athera-grey);
  background: rgba(107,114,128,0.06);
  line-height: 1.4;
  white-space: nowrap;
}
.label.high   { border-left-color: var(--athera-amber); color: #9A6B30; background: rgba(200,149,90,0.10); }
.label.medium { border-left-color: var(--athera-steel); color: #56708A; background: rgba(138,165,190,0.12); }
.label.low    { border-left-color: var(--athera-grey);  color: var(--athera-grey); background: rgba(107,114,128,0.06); }
.label.approved, .label.positive { border-left-color: var(--athera-blue-deep); color: var(--athera-blue-deep); background: rgba(42,143,176,0.08); }

/* Preference provenance */
.label.confirmed { border-left-color: var(--athera-blue-deep); color: var(--athera-blue-deep); background: rgba(42,143,176,0.07); }
.label.inferred  { border-left-color: var(--athera-grey); color: var(--athera-grey); background: rgba(107,114,128,0.05); }

/* Department / neutral chip */
.label.dept { border-left-color: var(--athera-steel); color: var(--athera-charcoal-light); background: rgba(138,165,190,0.10); }
.label.plain { border-left-color: var(--athera-line); color: var(--athera-charcoal-light); background: transparent; }

/* Privacy note labels */
.label.privacy { border-left-color: var(--athera-amber); color: #9A6B30; background: rgba(200,149,90,0.08); }

.label-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* --- approval lock tag -------------------------------------------------- */

.approval-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--athera-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--athera-amber);
  border: 1px solid rgba(200,149,90,0.4);
  border-radius: 2px;
  padding: 3px 8px;
  background: rgba(200,149,90,0.06);
  white-space: nowrap;
}
.approval-tag svg { display: block; }

/* --- panels ------------------------------------------------------------- */

.panel {
  border: 1px solid var(--athera-line);
  border-left: 2px solid var(--athera-steel);
  background: var(--athera-white);
  border-radius: 3px;
  padding: 18px 20px;
}
.panel.warn { border-left-color: var(--athera-amber); background: rgba(200,149,90,0.04); }
.panel.info { border-left-color: var(--athera-blue); }
.panel h4 { margin: 0 0 8px; font-family: var(--athera-sans); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--athera-grey); }
.panel ul { margin: 6px 0 0; padding-left: 18px; }
.panel li { font-size: 14px; margin: 4px 0; color: var(--athera-charcoal-light); }

/* --- privacy note ------------------------------------------------------- */

.privacy-note {
  border-left: 2px solid var(--athera-amber);
  background: rgba(200,149,90,0.05);
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--athera-charcoal-light);
  line-height: 1.55;
  border-radius: 0 3px 3px 0;
}

/* --- empty state -------------------------------------------------------- */

.empty-state {
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--athera-line);
  border-radius: 4px;
  background: var(--athera-white);
}
.empty-state h3 { font-family: var(--athera-display); font-weight: 300; font-size: 24px; margin: 0 0 8px; }
.empty-state p { color: var(--athera-grey); max-width: 46ch; margin: 0 auto; }

/* --- spinner ------------------------------------------------------------ */

.spinner {
  width: 22px; height: 22px;
  border: 2px solid var(--athera-line);
  border-top-color: var(--athera-blue-deep);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-row { display: flex; align-items: center; gap: 12px; color: var(--athera-grey); font-size: 14px; padding: 40px 0; justify-content: center; }

/* --- toast -------------------------------------------------------------- */

#toast-host {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--athera-navy);
  color: var(--athera-white);
  font-size: 13.5px;
  padding: 12px 20px;
  border-radius: 3px;
  border-left: 2px solid var(--athera-blue);
  max-width: 90vw;
  box-shadow: 0 6px 24px rgba(15,23,42,0.18);
  animation: toast-in 0.2s ease;
}
.toast.warn { border-left-color: var(--athera-amber); }
.toast.error { border-left-color: var(--athera-amber); }
.toast.success { border-left-color: var(--athera-blue); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* --- hero (home) -------------------------------------------------------- */

.hero {
  background: var(--athera-navy);
  color: var(--athera-white);
}
.hero-inner { max-width: 1200px; margin: 0 auto; padding: 80px 48px; }
.hero .athera-wordmark { color: var(--athera-white); }
.hero .wm-partners { color: var(--athera-mist); }
.hero .rule { background: var(--athera-blue); margin: 26px 0 22px; }
.hero h1 { font-family: var(--athera-display); font-weight: 300; font-size: 46px; line-height: 1.12; margin: 0 0 22px; color: var(--athera-white); max-width: 18ch; letter-spacing: -0.01em; }
.hero .lead { color: var(--athera-mist); max-width: 62ch; font-size: 18px; }
.hero .eyebrow { color: var(--athera-blue); }

@media (max-width: 768px) {
  .hero-inner { padding: 56px 24px; }
  .hero h1 { font-size: 34px; }
}

/* --- how-it-works steps ------------------------------------------------- */

.how-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; border-top: 1px solid var(--athera-line); }
.how-step { padding: 24px 22px 24px 0; border-right: 1px solid var(--athera-line); }
.how-step:last-child { border-right: none; padding-right: 0; }
.how-step .how-no { font-family: var(--athera-mono); font-size: 12px; color: var(--athera-blue-deep); }
.how-step h4 { font-family: var(--athera-display); font-weight: 400; font-size: 19px; margin: 10px 0 6px; color: var(--athera-charcoal); }
.how-step p { font-size: 13.5px; color: var(--athera-grey); margin: 0; line-height: 1.55; }
@media (max-width: 900px) { .how-row { grid-template-columns: 1fr 1fr; } .how-step { border-right: none; border-bottom: 1px solid var(--athera-line); padding-right: 22px; } }
@media (max-width: 520px) { .how-row { grid-template-columns: 1fr; } }

/* --- responsible-AI note ------------------------------------------------ */

.ai-note {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--athera-grey);
  border-left: 2px solid var(--athera-blue);
  padding: 8px 0 8px 14px;
  margin-top: 28px;
}

.demo-hint { font-size: 12.5px; color: var(--athera-grey); margin: 12px 0 0; max-width: 62ch; line-height: 1.55; }

/* --- tabs (data library) ------------------------------------------------ */

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--athera-line); margin-bottom: 26px; }
.tab {
  font-family: var(--athera-sans);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--athera-grey);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 16px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.tab:hover { color: var(--athera-charcoal); }
.tab.active { color: var(--athera-charcoal); border-bottom-color: var(--athera-blue); font-weight: 500; }
.tab .tab-count { font-family: var(--athera-mono); font-size: 11px; color: var(--athera-grey-light); margin-left: 6px; }

/* --- definition lists for grouped guest fields -------------------------- */

.dl { display: grid; grid-template-columns: minmax(150px, 200px) 1fr; gap: 0; }
.dl > dt { font-family: var(--athera-sans); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--athera-grey); padding: 9px 16px 9px 0; border-bottom: 1px solid var(--athera-line-light); }
.dl > dd { margin: 0; padding: 9px 0; border-bottom: 1px solid var(--athera-line-light); font-size: 14.5px; color: var(--athera-charcoal); }
.dl > dt:last-of-type, .dl > dd:last-of-type { border-bottom: none; }
@media (max-width: 600px) { .dl { grid-template-columns: 1fr; } .dl > dt { padding-bottom: 2px; border-bottom: none; } .dl > dd { padding-top: 2px; } }

/* --- guest list (data library) ------------------------------------------ */

.guest-block + .guest-block { margin-top: 20px; }
.guest-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.guest-head .guest-name { font-family: var(--athera-display); font-weight: 400; font-size: 21px; color: var(--athera-charcoal); }
.guest-head .guest-id { font-family: var(--athera-mono); font-size: 12px; color: var(--athera-grey); }
.guest-sub { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0 18px; }

.pref-list { list-style: none; margin: 0; padding: 0; }
.pref-list li { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--athera-line-light); }
.pref-list li:last-child { border-bottom: none; }
.pref-list .pref-detail { font-size: 14.5px; color: var(--athera-charcoal); }
.pref-list .pref-conf { font-family: var(--athera-mono); font-size: 11px; color: var(--athera-grey); margin-left: auto; white-space: nowrap; }

.sub-head { font-family: var(--athera-sans); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--athera-grey); margin: 18px 0 8px; }

.uploaded-flag { }

/* --- counts strip ------------------------------------------------------- */

.counts { display: flex; gap: 28px; flex-wrap: wrap; margin: 8px 0 4px; }
.count-item { }
.count-item .count-n { font-family: var(--athera-display); font-weight: 300; font-size: 32px; color: var(--athera-charcoal); line-height: 1; }
.count-item .count-l { font-family: var(--athera-sans); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--athera-grey); margin-top: 6px; }

/* --- footer ------------------------------------------------------------- */

.app-footer {
  border-top: 1px solid var(--athera-line);
  margin-top: 64px;
}
.app-footer .footer-inner { max-width: 1200px; margin: 0 auto; padding: 28px 48px 44px; color: var(--athera-grey); font-size: 12.5px; line-height: 1.7; }
.app-footer .footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.app-footer .footer-line { display: block; }
.app-footer .footer-line.muted2 { color: var(--athera-grey-light); }
.emblem {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; background: var(--athera-navy);
  border-radius: 5px; color: var(--athera-blue);
  font-family: var(--athera-display); font-size: 13px; font-weight: 500;
  flex: none;
}
@media (max-width: 768px) { .app-footer .footer-inner { padding: 24px; } }

/* --- file input --------------------------------------------------------- */

.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-name { font-family: var(--athera-mono); font-size: 12px; color: var(--athera-grey); margin-left: 4px; }

/* --- utilities ---------------------------------------------------------- */

.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; } .mt-48 { margin-top: 48px; }
.mb-0 { margin-bottom: 0; }
.divider-h { height: 1px; background: var(--athera-line); border: none; margin: 24px 0; }

/* =========================================================================
   RESULTS SCREEN (Session 4)
   ========================================================================= */

/* --- scope recap + stat chips ------------------------------------------- */

.scope-recap { align-items: center; }
.scope-recap .scope-gen { margin-left: auto; }
@media (max-width: 700px) { .scope-recap .scope-gen { margin-left: 0; width: 100%; } }

.stat-chips { display: flex; flex-wrap: wrap; gap: 14px; }
.stat-chip {
  border: 1px solid var(--athera-line);
  border-left: 2px solid var(--athera-grey);
  border-radius: 3px;
  padding: 12px 18px 12px 16px;
  background: var(--athera-white);
  min-width: 92px;
}
.stat-chip.is-high { border-left-color: var(--athera-amber); }
.stat-chip.is-medium { border-left-color: var(--athera-steel); }
.stat-chip.is-approved { border-left-color: var(--athera-blue-deep); }
.stat-chip .stat-n { display: block; font-family: var(--athera-display); font-weight: 300; font-size: 28px; line-height: 1; color: var(--athera-charcoal); }
.stat-chip .stat-l { display: block; font-family: var(--athera-sans); font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--athera-grey); margin-top: 7px; }

/* --- priority list ------------------------------------------------------ */

.priority-list { padding: 22px 24px; }
.pl-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.pl-controls { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.pl-filters { display: inline-flex; gap: 2px; border: 1px solid var(--athera-line); border-radius: 3px; overflow: hidden; }
.pl-filter {
  font-family: var(--athera-sans); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--athera-grey); background: transparent; border: none; padding: 7px 14px; cursor: pointer; transition: all 0.2s ease;
}
.pl-filter:hover { color: var(--athera-charcoal); }
.pl-filter.active { background: var(--athera-blue); color: var(--athera-navy); }
.pl-toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--athera-charcoal-light); cursor: pointer; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 500; }
.pl-toggle input { width: auto; margin: 0; accent-color: var(--athera-blue-deep); }

.pl-rows { display: flex; flex-direction: column; }
.pl-row {
  display: grid;
  grid-template-columns: 116px 1fr 110px 96px;
  align-items: center; gap: 16px;
  width: 100%; text-align: left;
  background: transparent; border: none; border-top: 1px solid var(--athera-line-light);
  padding: 13px 4px; cursor: pointer; transition: background 0.15s ease;
}
.pl-row:first-child { border-top: none; }
.pl-row:hover { background: var(--athera-off-white); }
.pl-row .pl-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pl-row .pl-name { font-family: var(--athera-sans); font-size: 14.5px; font-weight: 500; color: var(--athera-charcoal); }
.pl-row .pl-reason { font-size: 12.5px; color: var(--athera-grey); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-row .pl-arr { color: var(--athera-grey); }
.pl-row .pl-risk { justify-self: end; }
.pl-empty { padding: 20px 4px; color: var(--athera-grey); font-size: 13.5px; }
@media (max-width: 760px) {
  .pl-row { grid-template-columns: 1fr auto; grid-template-areas: "pri risk" "main main" "arr arr"; gap: 6px 12px; }
  .pl-row .pl-pri { grid-area: pri; } .pl-row .pl-risk { grid-area: risk; }
  .pl-row .pl-main { grid-area: main; } .pl-row .pl-reason { white-space: normal; }
  .pl-row .pl-arr { grid-area: arr; }
}

/* --- results grid + rail ------------------------------------------------ */

.results-grid { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }
.results-main { min-width: 0; }
.rail-sticky { position: sticky; top: 84px; }
.rail-eyebrow { }
@media (max-width: 1000px) {
  .results-grid { grid-template-columns: 1fr; }
  .rail-sticky { position: static; }
}

/* rail panels */
.rail-panel { padding: 18px 20px; }
.rail-panel + .rail-panel { margin-top: 16px; }
.rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.rail-title { font-family: var(--athera-sans); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--athera-grey); }
.rail-count { color: var(--athera-grey-light); }
.rail-empty { font-size: 13px; color: var(--athera-grey); margin: 0; line-height: 1.55; }
.rail-item { padding: 12px 0; border-top: 1px solid var(--athera-line-light); }
.rail-item:first-child { border-top: none; padding-top: 0; }
.rail-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.rail-item-name { font-family: var(--athera-sans); font-weight: 500; font-size: 14px; color: var(--athera-charcoal); }
.rail-reasons, .rail-opps, .rail-gaps { margin: 4px 0 0; padding-left: 16px; }
.rail-reasons li, .rail-gaps li { font-size: 12.5px; color: var(--athera-charcoal-light); margin: 3px 0; line-height: 1.5; }
.rail-opps { list-style: none; padding-left: 0; }
.rail-opps li { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; margin: 6px 0; color: var(--athera-charcoal-light); }
.rail-opp { line-height: 1.5; }
.rail-link {
  font-family: var(--athera-sans); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--athera-blue-deep); background: none; border: none; padding: 4px 0 0; cursor: pointer;
}
.rail-link:hover { text-decoration: underline; }

/* --- Guest 360 card ----------------------------------------------------- */

.g360 { scroll-margin-top: 84px; }
.g360 + .g360 { margin-top: 24px; }
.g360-flash { animation: g360-flash 1.4s ease; }
@keyframes g360-flash {
  0% { box-shadow: 0 0 0 2px var(--athera-blue); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.g360-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.g360-id-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.g360-id-row .guest-name { font-family: var(--athera-display); font-weight: 400; font-size: 24px; color: var(--athera-charcoal); }
.g360-id-row .guest-id { color: var(--athera-grey); }
.g360-head-labels { justify-content: flex-end; }
@media (max-width: 600px) { .g360-head-labels { justify-content: flex-start; } }

.g360-why { margin-top: 14px; font-size: 13.5px; color: var(--athera-charcoal-light); line-height: 1.55; }
.rec-why-label, .rec-sources-label, .rec-override-label, .rec-draft-label, .rec-edit-label {
  font-family: var(--athera-sans); font-weight: 500; font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--athera-grey);
}
.g360-why .rec-why-label { margin-right: 8px; }

.g360-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--athera-line-light); }
.g360-section-label { font-family: var(--athera-sans); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--athera-charcoal-light); margin-bottom: 12px; }
.g360-stay-dl { margin: 0; }

.g360-issue { display: flex; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--athera-line-light); }
.g360-issue:last-child { border-bottom: none; }
.g360-issue-text { font-size: 14px; color: var(--athera-charcoal); }

.g360-risk { }
.g360-reasons { margin: 0; padding-left: 16px; }
.g360-reasons li { font-size: 13.5px; color: var(--athera-charcoal-light); margin: 4px 0; line-height: 1.55; }

.g360-opps { list-style: none; margin: 0; padding: 0; }
.g360-opps li { display: flex; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--athera-line-light); }
.g360-opps li:last-child { border-bottom: none; }
.g360-opp-detail { font-size: 14px; color: var(--athera-charcoal); line-height: 1.5; }

/* --- recommendation cards ----------------------------------------------- */

.rec-stack { display: flex; flex-direction: column; gap: 16px; }
.rec-card {
  background: var(--athera-off-white);
  border: 1px solid var(--athera-line);
  border-left: 2px solid var(--athera-steel);
  border-radius: 3px;
  scroll-margin-top: 84px;
}
.rec-card.is-rejected { opacity: 0.62; border-left-color: var(--athera-grey); }
.rec-card.is-rejected .rec-title, .rec-card.is-rejected .rec-desc { text-decoration: line-through; color: var(--athera-grey); }
.rec-flash { animation: g360-flash 1.4s ease; }

.rec-head { align-items: flex-start; }
.rec-title { font-family: var(--athera-display); font-weight: 400; font-size: 19px; margin: 0; color: var(--athera-charcoal); }
.rec-meta { margin-top: 10px; }
.rec-conf { color: var(--athera-grey); align-self: center; }
.rec-desc { color: var(--athera-charcoal); }
.rec-why { font-size: 13.5px; color: var(--athera-charcoal-light); line-height: 1.55; margin: 0 0 8px; }
.rec-why .rec-why-label { margin-right: 8px; }

.rec-sources { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }

.rec-draft {
  margin-top: 14px; padding: 14px 16px;
  background: var(--athera-white); border: 1px solid var(--athera-line);
  border-left: 2px solid var(--athera-amber); border-radius: 0 3px 3px 0;
}
.rec-draft-label { display: inline-flex; align-items: center; gap: 6px; color: var(--athera-amber); }
.rec-draft-body { margin: 8px 0 0; font-size: 14px; line-height: 1.6; color: var(--athera-charcoal); font-style: italic; }

.rec-edit, .rec-assign { margin-top: 14px; padding: 14px 16px; background: var(--athera-white); border: 1px solid var(--athera-line); border-radius: 3px; }
.rec-edit-label { display: block; margin-bottom: 8px; }
.rec-edit-input { width: 100%; }
.rec-edit-hint { margin: 8px 0 0; font-size: 12px; color: var(--athera-grey); }
.rec-assign-select { max-width: 260px; }

.rec-override { margin-top: 14px; font-size: 13px; color: var(--athera-charcoal-light); line-height: 1.55; border-left: 2px solid var(--athera-line); padding: 4px 0 4px 12px; }
.rec-override-label { display: block; margin-bottom: 3px; }

.rec-approval {
  margin-top: 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 16px; border: 1px solid rgba(200,149,90,0.4); background: rgba(200,149,90,0.05); border-radius: 3px;
}
.rec-approval.is-approved { border-color: rgba(42,143,176,0.4); background: rgba(42,143,176,0.05); }
.rec-approval .btn svg { display: block; }
.rec-approval-note { font-size: 12.5px; color: var(--athera-charcoal-light); line-height: 1.5; }

.rec-controls { margin-top: 16px; }
.rec-controls .btn.is-blocked { opacity: 0.5; }

/* --- results footer ----------------------------------------------------- */

.results-footer { background: var(--athera-white); }
.decision-summary { font-size: 14px; color: var(--athera-charcoal-light); }
.decision-summary .ds-count { font-size: 14px; color: var(--athera-charcoal); margin-right: 4px; }
@media (max-width: 700px) {
  .results-footer .btn-row.between { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* --- brief / export screen (Screen 5) ----------------------------------- */

.page-brief { max-width: 880px; }

.brief-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.brief-toolbar-hint { font-size: 11.5px; color: var(--athera-grey); }

.brief-nav { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }

/* The brief document itself — editorial, print-ready */
.brief-doc {
  background: var(--athera-white);
  border: 1px solid var(--athera-line);
  border-radius: 4px;
  padding: 48px 56px 52px;
}

.brief-title-block { margin-bottom: 8px; }
.brief-title {
  font-family: var(--athera-display);
  font-weight: 300;
  font-size: 40px;
  line-height: 1.1;
  color: var(--athera-charcoal);
  margin: 10px 0 0;
}
.brief-scope { color: var(--athera-charcoal-light); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.brief-scope-sep { color: var(--athera-grey-light); }
.brief-gen { color: var(--athera-grey); font-size: 11.5px; margin-top: 8px; }

.brief-section { margin-top: 40px; }
.brief-sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--athera-line); }
.brief-sec-head .section-no { color: var(--athera-grey); }

.brief-summary { font-size: 16px; line-height: 1.7; color: var(--athera-charcoal); max-width: 64ch; margin: 0; }
.brief-empty { font-size: 14px; color: var(--athera-grey); margin: 0; font-style: italic; }
.brief-sub { font-family: var(--athera-sans); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--athera-grey); margin: 0 0 8px; }

.brief-bullets { margin: 6px 0 0; padding-left: 18px; }
.brief-bullets li { font-size: 14px; line-height: 1.55; color: var(--athera-charcoal-light); margin: 5px 0; }

/* Priority guests */
.brief-pg-list { display: flex; flex-direction: column; }
.brief-pg-row { display: flex; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--athera-line-light); }
.brief-pg-row:last-child { border-bottom: none; }
.brief-pg-pri { flex: none; width: 130px; }
.brief-pg-main { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.brief-pg-name { font-size: 15px; color: var(--athera-charcoal); }
.brief-pg-headline { font-size: 13.5px; color: var(--athera-grey); line-height: 1.5; }
.brief-pg-arr { flex: none; color: var(--athera-grey); }

/* Department action checklist */
.brief-dept + .brief-dept { margin-top: 24px; }
.brief-dept-name { font-family: var(--athera-display); font-weight: 400; font-size: 19px; color: var(--athera-charcoal); margin: 0 0 10px; }

.brief-check { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--athera-line-light); }
.brief-check:last-child { border-bottom: none; }
.brief-check-box { flex: none; width: 15px; height: 15px; margin-top: 3px; border: 1px solid var(--athera-grey-light); border-radius: 2px; background: var(--athera-white); }
.brief-check-body { flex: 1; }
.brief-check-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.brief-check-name { color: var(--athera-charcoal); font-size: 12.5px; }
.brief-check-title { font-size: 15px; color: var(--athera-charcoal); font-weight: 400; }
.brief-check-text { font-size: 14.5px; line-height: 1.6; color: var(--athera-charcoal-light); margin: 6px 0 0; }
.brief-check-why { font-size: 13px; color: var(--athera-grey); margin: 6px 0 0; line-height: 1.5; }
.brief-why-k { font-family: var(--athera-sans); font-weight: 500; text-transform: uppercase; letter-spacing: 0.1em; font-size: 9.5px; color: var(--athera-grey); margin-right: 4px; }
.brief-check-meta { font-size: 11px; color: var(--athera-grey); margin: 5px 0 0; }
.brief-check-override { font-size: 11px; color: var(--athera-amber); margin: 4px 0 0; }

/* Watchlist / upsell items */
.brief-watch-list { display: flex; flex-direction: column; gap: 14px; }
.brief-watch-item { padding-bottom: 12px; border-bottom: 1px solid var(--athera-line-light); }
.brief-watch-item:last-child { border-bottom: none; padding-bottom: 0; }
.brief-watch-head { display: flex; align-items: center; gap: 12px; }
.brief-watch-name { font-size: 15px; color: var(--athera-charcoal); }

/* Pending approval — clearly separated */
.brief-pending { border: 1px solid rgba(200,149,90,0.35); border-left: 2px solid var(--athera-amber); background: rgba(200,149,90,0.04); border-radius: 3px; padding: 20px 24px 24px; }
.brief-pending .brief-sec-head { border-bottom-color: rgba(200,149,90,0.3); }
.brief-pending-note { font-size: 13px; color: #9A6B30; margin: 0 0 16px; font-weight: 500; }
.brief-pending-list { display: flex; flex-direction: column; gap: 14px; }
.brief-pending-item { padding-bottom: 12px; border-bottom: 1px solid rgba(200,149,90,0.18); }
.brief-pending-item:last-child { border-bottom: none; padding-bottom: 0; }
.brief-pending-head { display: flex; align-items: center; gap: 12px; }
.brief-pending-name { font-size: 15px; color: var(--athera-charcoal); }
.brief-pending-action { font-size: 14.5px; color: var(--athera-charcoal-light); margin: 8px 0 0; line-height: 1.6; }

.brief-sources { color: var(--athera-charcoal-light); font-size: 12px; line-height: 1.7; margin: 0; }

/* Print-only chrome inside the document (shown only when printing) */
.print-only { display: none; }
.brief-print-head { align-items: center; justify-content: space-between; margin-bottom: 28px; padding-bottom: 16px; border-bottom: 1px solid var(--athera-line); }
.brief-print-tool { color: var(--athera-grey); font-size: 11px; }
.brief-print-foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--athera-line); color: var(--athera-grey); font-size: 11px; }
.brief-print-foot span { display: block; }

@media (max-width: 700px) {
  .brief-doc { padding: 32px 24px 36px; }
  .brief-title { font-size: 32px; }
  .brief-pg-row { flex-wrap: wrap; }
  .brief-pg-pri { width: auto; }
  .brief-toolbar { flex-direction: column; align-items: flex-start; }
}

/* --- print stylesheet (Download as PDF path) ---------------------------- */

@media print {
  @page { margin: 18mm 16mm; }

  body { background: var(--athera-white); }

  /* Hide all app chrome — bar, stepper, footer, toast, controls */
  .app-bar,
  .app-footer,
  #toast-host,
  .stepper,
  .no-print,
  .brief-toolbar,
  .brief-nav,
  .section-head.no-print {
    display: none !important;
  }

  #view { margin: 0; }
  .page, .page-brief { max-width: none; padding: 0; margin: 0; }

  /* The brief becomes the whole page — strip card chrome */
  .brief-doc {
    border: none;
    border-radius: 0;
    padding: 0;
    background: var(--athera-white);
  }

  /* Reveal the print-only wordmark and confidentiality line */
  .print-only { display: block; }
  .brief-print-head { display: flex; }

  .brief-title { font-size: 30pt; }
  .brief-section { margin-top: 26px; page-break-inside: avoid; }
  .brief-sec-head { page-break-after: avoid; }
  .brief-dept, .brief-check, .brief-pg-row, .brief-watch-item, .brief-pending-item { page-break-inside: avoid; }
  .brief-pending { background: transparent; }

  /* Keep label and rule colours legible in print */
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  a[href]:after { content: ""; }
}

/* === Session 7: optional LLM enrichment ================================== */

/* "Drafted with AI" transparency label — quiet, mono, steel-indigo. Carries
   its meaning in the text; colour is secondary and muted. */
.label.ai {
  border-left-color: var(--athera-steel);
  color: #56708A;
  background: rgba(138,165,190,0.10);
  font-family: var(--athera-mono);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Guest 360 narrative summary */
.g360-summary {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}
.g360-summary-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--athera-charcoal);
  flex: 1 1 320px;
}

/* Setup: "Use AI to refine wording" toggle */
.ai-toggle-field { margin-top: 8px; }
.ai-toggle {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 14px 16px;
  border: 1px solid var(--athera-line);
  border-radius: 4px;
  background: var(--athera-off-white);
}
.ai-toggle input[type="checkbox"] { margin-top: 3px; flex: 0 0 auto; }
.ai-toggle-text { display: flex; flex-direction: column; gap: 3px; }
.ai-toggle-title {
  font-family: var(--athera-sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--athera-charcoal);
}
.ai-toggle-sub {
  font-size: 12.5px;
  color: var(--athera-grey);
  line-height: 1.5;
}
.ai-toggle-note { margin-top: 8px; }
