/* ==========================================================================
   Complere command-center stylesheet
   --------------------------------------------------------------------------
   Original visual system inspired by the look and feel of a modern public
   university brand (deep purple on white, generous whitespace, clean sans
   typography, a top nav shell and a structured footer), reworked for a dense
   authenticated admin surface rather than a marketing site. No third-party
   assets, fonts-as-files, logos, or wordmarks are used; every value here is
   original. All colors were contrast-checked to meet WCAG AA.
   ========================================================================== */

/* ==========================================================================
   1. Design tokens
   ========================================================================== */
:root {
  /* --- Brand purple ramp (primary identity color, original hexes) --------- */
  --purple-50:  #f2edfb;   /* tint backgrounds, chips */
  --purple-100: #e6def5;   /* idle nav text on the purple bar */
  --purple-200: #d3c4ef;   /* soft borders on tinted surfaces */
  --purple-300: #b49fe0;
  --purple-400: #8f6fd0;
  --purple-500: #6d4bc4;
  --purple-600: #573a9e;   /* primary action / brand */
  --purple-700: #45307d;   /* header bar, strong brand, links */
  --purple-800: #33245c;
  --purple-900: #241a42;

  /* --- Accent gold (restrained: brand mark ring + active underline) ------- */
  --gold-400: #e0b969;     /* accent on the purple bar */
  --gold-600: #8a6414;     /* gold as text on white (AA) */

  /* --- Neutral gray ramp (charcoal ink to near-white surfaces) ------------ */
  --white:    #ffffff;
  --gray-50:  #f7f6fb;     /* app background (tinted toward brand hue) */
  --gray-100: #f0eff5;     /* alt surface, table zebra */
  --gray-200: #e4e3ec;     /* hairline borders */
  --gray-300: #cfced8;     /* stronger borders */
  --gray-400: #9a99a6;     /* disabled, faint */
  --gray-500: #6b6a77;     /* tertiary text */
  --gray-600: #54525f;     /* secondary / muted text (AA on white and bg) */
  --gray-700: #3c3b47;
  --gray-800: #2c2d38;     /* headings */
  --gray-900: #1c1c24;     /* body ink */

  /* --- Semantic status colors (ink meets AA on its paired tint) ----------- */
  --success:     #0f6b3e;  --success-bg: #e3f4ea;  --success-solid: #147a48;
  --warning:     #8a5a10;  --warning-bg: #fbf0dc;
  --error:       #a63125;  --error-bg:   #fbe3e0;
  --info:        #26548f;  --info-bg:    #e7effb;

  /* --- Semantic role tokens (what the UI consumes) ------------------------ */
  --bg:           var(--gray-50);
  --surface:      var(--white);
  --surface-2:    var(--gray-100);
  --brand:        var(--purple-600);
  --brand-strong: var(--purple-700);
  --brand-tint:   var(--purple-50);
  --on-brand:     var(--white);
  --ink:          var(--gray-900);
  --ink-2:        var(--gray-600);
  --ink-3:        var(--gray-500);
  --line:         var(--gray-200);
  --line-strong:  var(--gray-300);

  /* --- Typography --------------------------------------------------------- */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --fs-display: 2.25rem;   /* 36px hero numbers / auth title */
  --fs-h1:      1.75rem;   /* 28px page title */
  --fs-h2:      1.375rem;  /* 22px section */
  --fs-h3:      1.125rem;  /* 18px card / subsection */
  --fs-body:    0.9375rem; /* 15px body */
  --fs-sm:      0.8125rem; /* 13px secondary */
  --fs-xs:      0.6875rem; /* 11px eyebrows, chips */

  --lh-tight:   1.2;
  --lh-heading: 1.25;
  --lh-body:    1.55;

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;
  --fw-black:    800;

  --ls-tight: -0.02em;   /* headings */
  --ls-wide:   0.05em;   /* eyebrows, table headers */

  /* --- Spacing scale (8pt rhythm) ----------------------------------------- */
  --space-1: 0.25rem;   /* 4  */
  --space-2: 0.5rem;    /* 8  */
  --space-3: 0.75rem;   /* 12 */
  --space-4: 1rem;      /* 16 */
  --space-5: 1.5rem;    /* 24 */
  --space-6: 2rem;      /* 32 */
  --space-7: 3rem;      /* 48 */
  --space-8: 4rem;      /* 64 */

  /* --- Radii -------------------------------------------------------------- */
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   16px;
  --radius-pill: 999px;

  /* --- Elevation ---------------------------------------------------------- */
  --shadow-sm:   0 1px 2px rgba(28, 26, 66, .06);
  --shadow:      0 1px 2px rgba(28, 26, 66, .06), 0 6px 20px rgba(28, 26, 66, .07);
  --shadow-lg:   0 10px 34px rgba(28, 26, 66, .12);
  --focus-ring:  0 0 0 3px rgba(87, 58, 158, .32);

  /* --- Motion ------------------------------------------------------------- */
  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-1: 120ms;
  --dur-2: 180ms;
  --dur-3: 260ms;

  /* --- Layout ------------------------------------------------------------- */
  --content-max:    1140px;
  --content-narrow: 780px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --header-h: 60px;

  /* --- Z-index scale ------------------------------------------------------ */
  --z-sticky:   100;
  --z-dropdown: 200;
  --z-modal:    400;
  --z-toast:    600;
}

/* ==========================================================================
   2. Base / reset
   ========================================================================== */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  line-height: var(--lh-heading);
  color: var(--gray-800);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); }
h2 { font-size: var(--fs-h2); font-weight: var(--fw-bold); letter-spacing: var(--ls-tight); }
h3 { font-size: var(--fs-h3); font-weight: var(--fw-semibold); }

p { margin: 0; }
a { color: inherit; text-decoration: none; }

.muted { color: var(--ink-2); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Keyboard skip link: hidden until focused */
.skip-link {
  position: absolute; top: 0; left: 0; z-index: var(--z-toast);
  transform: translateY(-120%);
  background: var(--surface); color: var(--brand-strong);
  font-weight: var(--fw-semibold); font-size: var(--fs-sm);
  padding: var(--space-2) var(--space-4);
  border-radius: 0 0 var(--radius-sm) 0;
  box-shadow: var(--shadow);
  transition: transform var(--dur-2) var(--ease-out);
}
.skip-link:focus { transform: translateY(0); outline: none; box-shadow: var(--focus-ring), var(--shadow); }

/* Shared visible focus treatment */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ==========================================================================
   3. Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-5);
  font-family: inherit;
  font-size: var(--fs-body);
  font-weight: var(--fw-semibold);
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out),
              transform var(--dur-1) var(--ease-out);
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-strong); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-primary:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn-primary:disabled { background: var(--purple-300); cursor: default; transform: none; box-shadow: none; }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--gray-800);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-strong); background: var(--brand-tint); }
.btn-ghost:active { transform: translateY(1px); }

.btn-sm { min-height: 32px; padding: var(--space-1) var(--space-3); font-size: var(--fs-sm); }

/* ==========================================================================
   4. Brand mark
   ========================================================================== */
.brand { display: inline-flex; align-items: center; gap: var(--space-3); }
.brand-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  background: linear-gradient(150deg, var(--purple-500) 0%, var(--purple-700) 100%);
  box-shadow: inset 0 0 0 1.5px var(--gold-400);
  color: #fff; font-weight: var(--fw-black); font-size: 18px;
}
.brand-mark.small { width: 30px; height: 30px; font-size: 16px; }
.brand-name {
  font-size: 1.1875rem; font-weight: var(--fw-bold);
  letter-spacing: var(--ls-tight); color: var(--gray-800);
}

/* ==========================================================================
   5. App shell: header, nav, footer
   ========================================================================== */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: var(--brand-strong);
  color: var(--on-brand);
  box-shadow: 0 1px 0 rgba(0, 0, 0, .12);
}
/* thin brand accent line under the bar */
.topbar::after {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, var(--purple-500), var(--gold-400) 70%, var(--purple-500));
  opacity: .85;
}
.topbar-inner {
  display: flex; align-items: center; gap: var(--space-4);
  flex-wrap: wrap;
  max-width: var(--content-max); margin: 0 auto;
  padding: var(--space-3) var(--gutter);
  min-height: var(--header-h);
}
.topbar .brand-name { color: #fff; }
.topbar .brand-mark { box-shadow: inset 0 0 0 1.5px rgba(224, 185, 105, .9); }

.topnav { display: flex; align-items: center; gap: 2px; }
.topnav a {
  position: relative;
  display: inline-flex; align-items: center;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--purple-100);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  white-space: nowrap;
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.topnav a:hover { background: rgba(255, 255, 255, .10); color: #fff; }
.topnav a.active { color: #fff; background: rgba(255, 255, 255, .12); }
/* gold underline grows in on the active item */
.topnav a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 2px;
  background: var(--gold-400); border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform var(--dur-2) var(--ease-out);
}
.topnav a.active::after { transform: scaleX(1); }
.topnav a:hover::after { transform: scaleX(1); background: rgba(255, 255, 255, .5); }
.topnav a.active:hover::after { background: var(--gold-400); }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }

/* Notification bell slot: styled generically so a merged notifications
   feature (bell + unread badge) inherits the look with no extra CSS. */
.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .06);
  color: #fff; cursor: pointer;
  transition: background var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.icon-btn:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); }
.icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .4); }
.icon-btn svg { width: 19px; height: 19px; }
.badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  background: var(--gold-400); color: var(--purple-900);
  font-size: 11px; font-weight: var(--fw-bold); line-height: 1;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 0 2px var(--brand-strong);
}

.user-chip {
  max-width: 200px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: #ece8f7; font-size: var(--fs-sm);
}
.topbar-actions .btn-ghost {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .28);
  color: #fff;
}
.topbar-actions .btn-ghost:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .5); color: #fff; }

/* Content region */
.content {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: var(--space-6) var(--gutter) var(--space-8);
  flex: 1 0 auto;
}
.content:focus { outline: none; }
.content-narrow { max-width: var(--content-narrow); }

.page-head { margin-bottom: var(--space-5); }
.page-head h1 { margin-bottom: var(--space-1); }
.page-head .muted { max-width: 68ch; }

/* Footer */
.site-footer {
  flex-shrink: 0;
  background: var(--white);
  border-top: 1px solid var(--line);
  margin-top: var(--space-7);
}
.footer-inner {
  max-width: var(--content-max); margin: 0 auto;
  padding: var(--space-6) var(--gutter);
  display: grid; gap: var(--space-5);
  grid-template-columns: 1.4fr 1fr;
  align-items: start;
}
.footer-brand { display: flex; align-items: center; gap: var(--space-3); }
.footer-name { font-weight: var(--fw-bold); color: var(--gray-800); }
.footer-tag { color: var(--ink-2); font-size: var(--fs-sm); }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); align-content: start; }
.footer-links a {
  color: var(--ink-2); font-size: var(--fs-sm); font-weight: var(--fw-medium);
  transition: color var(--dur-2) var(--ease-out);
}
.footer-links a:hover { color: var(--brand-strong); }
.footer-legal {
  grid-column: 1 / -1;
  padding-top: var(--space-4); border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: var(--fs-sm);
}

/* ==========================================================================
   6. Auth (login) surface
   ========================================================================== */
.auth-shell {
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: var(--space-5);
  background:
    radial-gradient(900px 520px at 15% -10%, var(--purple-100) 0%, transparent 55%),
    radial-gradient(800px 500px at 110% 10%, var(--purple-50) 0%, transparent 50%),
    var(--bg);
}
.auth-shell:focus { outline: none; }
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-6);
  animation: rise var(--dur-3) var(--ease-out) both;
}
.auth-card .brand { margin-bottom: var(--space-3); }
.auth-tagline { color: var(--ink-2); margin: 0 0 var(--space-5); }
.auth-form { display: flex; flex-direction: column; }
.auth-form label {
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--gray-700); margin-top: var(--space-4); margin-bottom: var(--space-1);
}
.auth-form input {
  padding: var(--space-3);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-family: inherit; font-size: var(--fs-body); color: var(--ink);
  background: var(--surface);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.auth-form input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
.auth-form .btn { margin-top: var(--space-5); width: 100%; }
.auth-foot { text-align: center; color: var(--ink-3); font-size: var(--fs-sm); margin-top: var(--space-5); }
.alert {
  background: var(--error-bg); color: var(--error);
  border: 1px solid #f2c4bf; border-radius: var(--radius-sm);
  padding: var(--space-3); font-size: var(--fs-sm); margin-bottom: var(--space-2);
}
.auth-intro { color: var(--ink-2); font-size: var(--fs-sm); margin: 0 0 var(--space-4); }
.auth-hint { font-size: var(--fs-xs); color: var(--ink-3); margin-top: var(--space-1); }
.auth-hint-block { margin: var(--space-4) 0 0; line-height: 1.5; }
.auth-hint-block a { color: var(--brand-strong); font-weight: var(--fw-medium); }
.auth-alt {
  text-align: center; font-size: var(--fs-sm); margin-top: var(--space-4);
}
.auth-alt a { color: var(--brand-strong); font-weight: var(--fw-medium); }
.auth-alt a:hover { text-decoration: underline; }
.auth-alt span { color: var(--gray-400); margin: 0 var(--space-2); }
.auth-form input[readonly] { background: var(--gray-50); color: var(--ink-2); cursor: default; }

/* ==========================================================================
   7. Dashboard cards
   ========================================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: var(--space-4);
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  transition: transform var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out);
}
.card.obligation:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--purple-200); }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3); }
.card-title { margin: 0 0 var(--space-4); font-size: var(--fs-h3); line-height: var(--lh-heading); }

.chip {
  display: inline-flex; align-items: center;
  font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: var(--ls-wide);
  text-transform: uppercase; padding: 4px 10px; border-radius: var(--radius-pill);
  white-space: nowrap;
}
.chip-cat     { background: var(--purple-50); color: var(--purple-700); }
.chip-ok      { background: var(--success-bg); color: var(--success); }
.chip-soon    { background: var(--warning-bg); color: var(--warning); }
.chip-overdue { background: var(--error-bg);   color: var(--error); }
/* Reminder / delivery lifecycle chips (Epic 5). */
.chip-pending { background: var(--info-bg);    color: var(--info); }
.chip-failed  { background: var(--error-bg);   color: var(--error); }
.chip-muted   { background: var(--surface-2);  color: var(--gray-700); }

.meta { margin: 0; display: grid; gap: var(--space-2); }
.meta > div { display: flex; justify-content: space-between; gap: var(--space-3); }
.meta dt { color: var(--ink-2); font-size: var(--fs-sm); margin: 0; }
.meta dd {
  margin: 0; font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  text-align: right; font-variant-numeric: tabular-nums;
}

.obligation-actions {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--line);
}
.obligation-actions .src-link { font-size: var(--fs-sm); color: var(--brand-strong); font-weight: var(--fw-medium); }
.obligation-actions .src-link:hover { text-decoration: underline; }

/* ==========================================================================
   8. Ask Campus AI call-to-action panel
   ========================================================================== */
.ai-cta {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-5);
  margin-top: var(--space-6); padding: var(--space-5) var(--space-6);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 200px at 100% 0%, rgba(224, 185, 105, .22), transparent 60%),
    linear-gradient(120deg, var(--purple-700) 0%, var(--purple-500) 100%);
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.ai-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ai-cta h2 { color: #fff; margin-bottom: var(--space-1); }
.ai-cta p { margin: 0; color: rgba(255, 255, 255, .88); }
.ai-cta-go { font-weight: var(--fw-bold); font-size: var(--fs-h3); white-space: nowrap; }

/* ==========================================================================
   9. Ask page (form + answer surface)
   ========================================================================== */
.ask-form {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}
.ask-form textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: var(--space-3); font-family: inherit; font-size: var(--fs-body); color: var(--ink);
  resize: vertical; background: var(--surface);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.ask-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
.ask-actions {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
  margin-top: var(--space-4); flex-wrap: wrap;
}
.examples { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.example {
  background: var(--purple-50); color: var(--purple-700);
  border: 1px solid var(--purple-100); border-radius: var(--radius-pill);
  padding: var(--space-1) var(--space-3);
  font-family: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  cursor: pointer;
  transition: background var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out);
}
.example:hover { background: var(--purple-100); border-color: var(--purple-200); }
.example:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.status {
  margin-top: var(--space-4); padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm); background: var(--info-bg); color: var(--info);
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
}
.status-warn { background: var(--warning-bg); color: var(--warning); }

.answer {
  margin-top: var(--space-4);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: var(--space-6);
  animation: rise var(--dur-3) var(--ease-out) both;
}
.answer-heading {
  margin: 0 0 var(--space-2); font-size: var(--fs-xs); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: var(--ls-wide); color: var(--brand-strong);
}
.answer-main { margin: 0 0 var(--space-4); font-size: var(--fs-h3); line-height: 1.45; color: var(--ink); }
.answer-details {
  display: grid; gap: var(--space-3);
  border-top: 1px solid var(--line); padding-top: var(--space-4);
}
.answer-row { display: flex; gap: var(--space-4); }
.answer-label { min-width: 168px; color: var(--ink-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.answer-value { font-size: var(--fs-body); }

/* Source citations: visually distinct from generated answer text */
.citations {
  margin-top: var(--space-4);
  background: var(--purple-50);
  border: 1px solid var(--purple-100);
  border-radius: var(--radius-sm);
  padding: var(--space-4) var(--space-4) var(--space-4) var(--space-5);
}
.citations h3 {
  margin: 0 0 var(--space-2); font-size: var(--fs-xs); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: var(--ls-wide); color: var(--purple-700);
}
.citations ul { margin: 0; padding-left: var(--space-4); display: grid; gap: var(--space-2); }
.cite-title { font-weight: var(--fw-semibold); }
.cite-date { color: var(--ink-2); font-size: var(--fs-sm); }
.cite-url { color: var(--brand-strong); font-size: var(--fs-xs); word-break: break-all; }
.citations.note { color: var(--gray-700); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
a.cite-title { color: var(--brand-strong); }
a.cite-title:hover { text-decoration: underline; }

.btn-cal { min-height: 28px; margin-left: var(--space-3); padding: 2px 10px; font-size: var(--fs-sm); }
.answer-disclaimer { margin-top: var(--space-4); color: var(--ink-2); font-size: var(--fs-sm); font-style: italic; }

.disclaimer {
  margin-top: var(--space-5); color: var(--ink-2); font-size: var(--fs-sm);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-2); border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

/* ==========================================================================
   10. Admin: sources + obligations (forms and tables)
   ========================================================================== */
.source-form { margin-bottom: var(--space-2); }
.source-form .source-fields { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--space-3); }
.source-form input, .source-form select {
  padding: var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-family: inherit; font-size: var(--fs-sm); color: var(--ink); background: var(--surface);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.source-form input:focus, .source-form select:focus {
  outline: none; border-color: var(--brand); box-shadow: var(--focus-ring);
}

/* The list is the horizontal-scroll boundary at every width, so a wide table
   (or an opened inline edit form) scrolls inside the section instead of
   pushing the page into real horizontal overflow. */
.sources-list { margin-top: var(--space-5); overflow-x: auto; }
.sources-table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  font-variant-numeric: tabular-nums;
}
.sources-table th, .sources-table td {
  text-align: left; padding: var(--space-3) var(--space-4);
  font-size: var(--fs-sm); border-bottom: 1px solid var(--line); vertical-align: top;
}
.sources-table th {
  background: var(--purple-50); color: var(--purple-700);
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
  text-transform: uppercase; letter-spacing: var(--ls-wide);
}
.sources-table tbody tr { transition: background var(--dur-2) var(--ease-out); }
.sources-table tbody tr:hover { background: var(--gray-50); }
.sources-table tr:last-child td { border-bottom: none; }
.src-url { font-size: var(--fs-xs); word-break: break-all; margin-top: 2px; }
.src-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.src-actions form { margin: 0; }

/* Obligations admin form: auto-fit so date/select tracks wrap instead of
   forcing the row past the viewport at mid widths (they cannot shrink below
   their intrinsic control width under a fixed repeat(3, 1fr)). */
.source-form .source-fields.obligation-fields { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field-label { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--gray-700); }

.row-edit { margin: 0; }
.row-edit > summary { list-style: none; cursor: pointer; display: inline-flex; }
.row-edit > summary::-webkit-details-marker { display: none; }
.edit-form {
  display: grid; gap: var(--space-2); margin-top: var(--space-2); padding: var(--space-3);
  background: var(--gray-50); border: 1px solid var(--line); border-radius: var(--radius-sm);
  min-width: 220px;
}
/* Guard the closed state: an explicit display on this descendant otherwise
   escapes the native closed-details collapse in Chromium and lays the form
   out off-canvas, widening the table beyond the viewport. */
.row-edit:not([open]) .edit-form { display: none; }
.edit-form input {
  padding: var(--space-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-family: inherit; font-size: var(--fs-sm); color: var(--ink); background: var(--surface);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.edit-form input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }

/* ==========================================================================
   11. Motion: entrance keyframes (resting state stays visible)
   ========================================================================== */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* Subtle, single staggered entrance on the dashboard card grid only. The
   resting state is fully visible, so nothing is gated on the animation. */
.cards .card { animation: rise var(--dur-3) var(--ease-out) both; }
.cards .card:nth-child(2) { animation-delay: 40ms; }
.cards .card:nth-child(3) { animation-delay: 80ms; }
.cards .card:nth-child(4) { animation-delay: 120ms; }
.cards .card:nth-child(5) { animation-delay: 160ms; }
.cards .card:nth-child(n+6) { animation-delay: 200ms; }

/* ==========================================================================
   12. Responsive
   ========================================================================== */
@media (max-width: 768px) {
  .topbar-inner { gap: var(--space-3); }
  .topnav {
    order: 3; flex-basis: 100%;
    overflow-x: auto; padding-bottom: 2px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .footer-inner { grid-template-columns: 1fr; }
  .answer-row { flex-direction: column; gap: var(--space-1); }
  .answer-label { min-width: 0; }
}

@media (max-width: 620px) {
  .ai-cta { flex-direction: column; align-items: flex-start; }
  .source-form .source-fields, .obligation-fields { grid-template-columns: 1fr; }
  .sources-table { display: block; overflow-x: auto; white-space: nowrap; }
  .ask-actions { align-items: stretch; }
  .ask-actions .btn-primary { width: 100%; }
}

@media (max-width: 420px) {
  .user-chip { max-width: 120px; }
}

/* ==========================================================================
   13. Reduced motion: disable all non-essential motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .topnav a::after { transition: none; }
  .btn-primary:hover, .card.obligation:hover, .ai-cta:hover { transform: none; }
}

/* ==========================================================================
   14. Notification engine (Epic 5): active bell, reminder ladder,
       notification center, delivery-history helpers
   ========================================================================== */

/* Active state for the topbar bell when on the notification center. */
.icon-btn.active,
.icon-btn.active:hover {
  background: rgba(255, 255, 255, .20);
  border-color: rgba(255, 255, 255, .5);
}

/* Reminder ladder: a disclosure of the scheduled rungs on an obligation. */
.reminder-ladder {
  margin-top: var(--space-4);
  border-top: 1px solid var(--line);
  padding-top: var(--space-3);
}
.reminder-ladder > summary {
  cursor: pointer; list-style: none;
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--brand-strong);
  padding: 2px 4px; border-radius: var(--radius-sm);
}
.reminder-ladder > summary::-webkit-details-marker { display: none; }
.reminder-ladder > summary::before {
  content: ""; width: 0; height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform var(--dur-2) var(--ease-out);
}
.reminder-ladder[open] > summary::before { transform: rotate(90deg); }
.reminder-ladder > summary:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.ladder-list {
  list-style: none; margin: var(--space-3) 0 0; padding: 0;
  display: grid; gap: var(--space-2);
}
.ladder-list li {
  display: flex; align-items: center; gap: var(--space-3);
  font-size: var(--fs-sm);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-2); border-radius: var(--radius-sm);
}
.ladder-when { color: var(--ink-2); min-width: 104px; font-variant-numeric: tabular-nums; }
.ladder-rung { flex: 1; color: var(--ink); font-weight: var(--fw-medium); }

/* Compact per-obligation delivery-history drill-down (obligations table). */
.delivery-mini { margin-top: var(--space-3); font-size: var(--fs-sm); }

/* Notification center: unread rows carry a left accent, a tint, and a bolder
   title so the eye lands on them first. */
.notification-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.notification-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.notification-item.unread {
  border-left: 3px solid var(--brand);
  background: var(--brand-tint);
}
.notification-item.unread .notification-title { font-weight: var(--fw-bold); }
.notification-main { min-width: 0; }
.notification-title { margin: 0 0 var(--space-1); font-size: var(--fs-body); line-height: var(--lh-heading); }
.notification-meta { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-2); font-size: var(--fs-sm); }
.notification-actions { flex-shrink: 0; }
.notification-actions form { margin: 0; }

@media (max-width: 640px) {
  .notification-item { flex-direction: column; gap: var(--space-3); }
  .ladder-list li { flex-wrap: wrap; }
  .ladder-when { min-width: 0; }
}

/* ==========================================================================
   15. Leadership oversight (Story #71) + onboarding polish (#36/#37/#38)
   ========================================================================== */

/* --- 15.1 Summary strip: four scannable stat tiles that double as no-JS
   risk filters. The active filter (or "all") is outlined. ------------------ */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.stat-tile {
  position: relative;
  display: flex; flex-direction: column; gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: inherit;
  transition: transform var(--dur-2) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out);
}
a.stat-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
a.stat-tile:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.stat-tile.is-total { border-left-color: var(--brand); }
.stat-tile.is-green { border-left-color: var(--success-solid); }
.stat-tile.is-amber { border-left-color: var(--warning); }
.stat-tile.is-red   { border-left-color: var(--error); }
.stat-tile.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand), var(--shadow-sm);
}
.stat-figure {
  font-size: var(--fs-display); font-weight: var(--fw-black); line-height: 1;
  letter-spacing: var(--ls-tight); font-variant-numeric: tabular-nums;
  color: var(--gray-900);
}
.stat-label {
  display: flex; align-items: center; gap: var(--space-2);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--gray-800);
}
.stat-sub { font-size: var(--fs-xs); color: var(--ink-3); }
.stat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot-green { background: var(--success-solid); }
.dot-amber { background: var(--warning); }
.dot-red   { background: var(--error); }

/* Subtle staggered entrance mirrors the dashboard card grid. */
.stat-strip .stat-tile { animation: rise var(--dur-3) var(--ease-out) both; }
.stat-strip .stat-tile:nth-child(2) { animation-delay: 40ms; }
.stat-strip .stat-tile:nth-child(3) { animation-delay: 80ms; }
.stat-strip .stat-tile:nth-child(4) { animation-delay: 120ms; }

/* --- 15.2 Filter + sort toolbar --------------------------------------------- */
.toolbar {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
}
.toolbar-fields {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-4);
}
.toolbar select, .toolbar input {
  padding: var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-family: inherit; font-size: var(--fs-sm); color: var(--ink); background: var(--surface);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.toolbar select:focus, .toolbar input:focus {
  outline: none; border-color: var(--brand); box-shadow: var(--focus-ring);
}
.toolbar-actions {
  display: flex; align-items: center; gap: var(--space-3);
  margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--line);
}

/* --- 15.3 Section head above a table --------------------------------------- */
.table-head {
  display: flex; align-items: baseline; gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.table-head h2 { font-size: var(--fs-h3); }
.table-count {
  font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: var(--ls-wide);
  text-transform: uppercase; color: var(--ink-3);
}

/* --- 15.4 Roster table specifics ------------------------------------------- */
.leadership-table td, .leadership-table th { vertical-align: middle; }
.leadership-table th.lt-num, .leadership-table td.lt-num { text-align: right; }
.lt-name { font-weight: var(--fw-semibold); color: var(--brand-strong); }
.lt-name:hover { text-decoration: underline; }
.lt-sub { color: var(--ink-2); font-size: var(--fs-xs); margin-top: 2px; }
.lt-num { font-variant-numeric: tabular-nums; }
.lt-done { color: var(--ink-2); }
.lt-date { font-variant-numeric: tabular-nums; white-space: nowrap; }
.lt-go { width: 1%; text-align: right; }
.row-go {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border-radius: var(--radius-sm); color: var(--ink-3);
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.row-go svg { width: 16px; height: 16px; }
.row-go:hover { background: var(--brand-tint); color: var(--brand-strong); }
.row-go:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* --- 15.5 Tenure-pipeline timeline ----------------------------------------- */
.tenure-timeline { display: inline-flex; align-items: center; gap: 3px; }
.tl-seg {
  width: 18px; height: 8px; border-radius: 3px;
  background: var(--gray-200); display: inline-block; flex-shrink: 0;
}
.tl-seg.tl-done { background: var(--purple-300); }
.tl-seg.tl-current { background: var(--brand); box-shadow: 0 0 0 2px var(--brand-tint); }
.tenure-timeline.is-tenured .tl-seg { background: var(--success-solid); }
.tl-label {
  margin-left: var(--space-2); font-size: var(--fs-xs); font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide); color: var(--ink-2); font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tenure-timeline.is-tenured .tl-label { color: var(--success); text-transform: uppercase; }
.tenure-timeline.tl-lg .tl-seg { width: 34px; height: 12px; border-radius: 4px; }
.tenure-timeline.tl-lg .tl-label { font-size: var(--fs-sm); }

/* --- 15.6 Status pill (risk flag: color + icon + label) -------------------- */
.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: var(--fw-bold);
  letter-spacing: var(--ls-wide); text-transform: uppercase; white-space: nowrap;
}
.status-pill svg { width: 13px; height: 13px; }
.pill-green { background: var(--success-bg); color: var(--success); }
.pill-amber { background: var(--warning-bg); color: var(--warning); }
.pill-red   { background: var(--error-bg);   color: var(--error); }

/* --- 15.7 Count badges (overdue / at-risk) --------------------------------- */
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums;
}
.count-overdue { background: var(--error-bg);   color: var(--error); }
.count-atrisk  { background: var(--warning-bg); color: var(--warning); }
.count-zero { color: var(--gray-400); background: transparent; }

/* --- 15.8 Faculty drill-down: person header + obligation groups ------------ */
.back-link { margin-bottom: var(--space-4); }
.person-header {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: var(--space-5);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-6);
  animation: rise var(--dur-3) var(--ease-out) both;
}
.person-id { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; }
.person-name { font-size: var(--fs-h1); }
.person-role { color: var(--ink-2); font-size: var(--fs-body); }
.person-stage { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin-top: var(--space-1); }
.stage-caption { font-size: var(--fs-sm); color: var(--ink-2); font-weight: var(--fw-medium); }
.person-stats { display: flex; gap: var(--space-6); margin: 0; }
.pstat { display: flex; flex-direction: column-reverse; gap: 2px; text-align: right; }
.pstat-num { margin: 0; font-size: var(--fs-h2); font-weight: var(--fw-black); font-variant-numeric: tabular-nums; color: var(--gray-900); }
.pstat-label { font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: var(--ls-wide); text-transform: uppercase; color: var(--ink-3); }
.pstat-overdue .pstat-num { color: var(--error); }
.pstat-atrisk .pstat-num { color: var(--warning); }

.oblig-group { margin-top: var(--space-6); }
.oblig-group:first-of-type { margin-top: var(--space-2); }
.oblig-group-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.oblig-group-head h2 { font-size: var(--fs-h3); }
.group-count {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: var(--fw-bold);
  font-variant-numeric: tabular-nums;
}
.group-red { background: var(--error-bg); color: var(--error); }
.group-amber { background: var(--warning-bg); color: var(--warning); }
.group-neutral { background: var(--surface-2); color: var(--gray-700); }
.oblig-title { font-weight: var(--fw-semibold); }

/* --- 15.9 Onboarding + settings: form cards, hints, flashes ---------------- */
.form-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: var(--space-5) var(--space-6) var(--space-6);
  margin-bottom: var(--space-6);
}
.settings-card { max-width: 640px; }
.form-card-head { margin-bottom: var(--space-5); padding-bottom: var(--space-4); border-bottom: 1px solid var(--line); }
.form-card-head h2 { font-size: var(--fs-h3); margin-bottom: var(--space-1); }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
.settings-fields { display: grid; gap: var(--space-4); }
.form-card .field { display: flex; flex-direction: column; gap: var(--space-1); }
.form-card .field-label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--gray-700); }
.req { color: var(--error); font-weight: var(--fw-bold); }
.field-hint { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.4; }
.form-card input, .form-card select {
  padding: var(--space-3); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-family: inherit; font-size: var(--fs-body); color: var(--ink); background: var(--surface);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.form-card input:focus, .form-card select:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
.form-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  flex-wrap: wrap; margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--line);
}

/* Read-only identity block on the profile page. */
.identity-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-4); margin: 0; }
.identity-grid dt { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--gray-700); text-transform: uppercase; letter-spacing: var(--ls-wide); margin-bottom: var(--space-1); }
.identity-grid dd { margin: 0; font-size: var(--fs-body); color: var(--ink); word-break: break-word; }

.flash {
  display: flex; align-items: flex-start; gap: var(--space-2);
  padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-weight: var(--fw-medium);
  margin-bottom: var(--space-4); border: 1px solid transparent;
}
.flash svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 1px; }
.flash-success { background: var(--success-bg); color: var(--success); border-color: #bfe3cd; }
.flash-error   { background: var(--error-bg);   color: var(--error);   border-color: #f2c4bf; }

.chip-track { background: var(--info-bg); color: var(--info); }
.directory-table .dir-name { font-weight: var(--fw-semibold); color: var(--gray-800); }

/* --- 15.10 Empty state + 403 state panel ----------------------------------- */
.empty-state {
  text-align: center; padding: var(--space-7) var(--space-5);
  background: var(--surface); border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
}
.empty-state .empty-icon { color: var(--purple-300); margin-bottom: var(--space-3); }
.empty-state h2 { font-size: var(--fs-h3); margin-bottom: var(--space-1); }
.empty-state .muted { max-width: 46ch; margin: 0 auto; }
.empty-state .btn { margin-top: var(--space-4); }

.state-panel {
  max-width: 520px; margin: var(--space-6) auto; text-align: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  padding: var(--space-7) var(--space-6);
  animation: rise var(--dur-3) var(--ease-out) both;
}
.state-icon {
  display: grid; place-items: center; width: 60px; height: 60px;
  margin: 0 auto var(--space-4); border-radius: 50%;
  background: var(--brand-tint); color: var(--brand-strong);
}
.state-panel h1 { margin-bottom: var(--space-2); }
.state-message { color: var(--ink); font-size: var(--fs-body); margin-bottom: var(--space-3); }
.state-panel .muted { max-width: 44ch; margin: 0 auto; }
.state-actions { margin-top: var(--space-5); }

/* --- 15.11 Responsive ------------------------------------------------------ */
@media (max-width: 900px) {
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .person-header { flex-direction: column; }
  .person-stats { width: 100%; justify-content: space-between; gap: var(--space-4); }
  .pstat { text-align: left; }
  .toolbar-actions { flex-wrap: wrap; }
  .toolbar-actions .btn { flex: 1; }
}
@media (max-width: 560px) {
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .form-card-foot { flex-direction: column; align-items: stretch; }
  .form-card-foot .btn { width: 100%; }
}

/* ==========================================================================
   16. Epic A trust surface: pilot/BETA banner, legal-page prose,
       report-an-issue feedback widget (Stories #80, #81, #82)
   ========================================================================== */

/* --- 16.1 Pilot/BETA banner ------------------------------------------------
   A light, on-brand strip above the sticky topbar (normal flow, so it scrolls
   away and never fights the sticky header). Prominent via a solid pill and a
   gold accent, tasteful via a tinted background. Dismissible for the browser
   session; the no-flash root flag hides it before first paint. */
.pilot-banner {
  background: var(--brand-tint);
  border-bottom: 1px solid var(--purple-200);
  box-shadow: inset 0 3px 0 var(--gold-400);
}
.pilot-dismissed .pilot-banner { display: none; }
.pilot-banner-inner {
  max-width: var(--content-max); margin: 0 auto;
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--gutter);
}
.pilot-tag {
  flex-shrink: 0;
  display: inline-flex; align-items: center;
  background: var(--brand); color: var(--on-brand);
  font-size: var(--fs-xs); font-weight: var(--fw-black); letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--radius-sm);
}
.pilot-text {
  flex: 1; min-width: 0;
  color: var(--gray-700); font-size: var(--fs-sm); line-height: 1.4;
}
.pilot-link {
  color: var(--brand-strong); font-weight: var(--fw-semibold);
  text-decoration: underline; text-underline-offset: 2px;
}
.pilot-link:hover { color: var(--purple-800); }
.pilot-dismiss {
  flex-shrink: 0;
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--gray-600); cursor: pointer;
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.pilot-dismiss svg { width: 16px; height: 16px; }
.pilot-dismiss:hover { background: rgba(87, 58, 158, .10); color: var(--brand-strong); }
.pilot-dismiss:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* --- 16.2 Legal pages (Terms, Privacy): readable prose in a narrow column -- */
.legal-doc { max-width: 68ch; }
.legal-draft {
  display: flex; align-items: flex-start; gap: var(--space-2);
  margin-bottom: var(--space-5);
  padding: var(--space-3) var(--space-4);
  background: var(--warning-bg); color: var(--warning);
  border: 1px solid #eecf97; border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
}
.legal-draft svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.legal-meta { color: var(--ink-3); font-size: var(--fs-sm); margin-bottom: var(--space-6); }
.legal-doc h2 {
  font-size: var(--fs-h3); margin-top: var(--space-6); margin-bottom: var(--space-2);
  padding-top: var(--space-4); border-top: 1px solid var(--line);
}
.legal-doc h2:first-of-type { border-top: none; padding-top: 0; margin-top: var(--space-5); }
.legal-doc p { margin-bottom: var(--space-3); color: var(--ink); line-height: var(--lh-body); }
.legal-doc ul { margin: 0 0 var(--space-3); padding-left: var(--space-5); display: grid; gap: var(--space-2); }
.legal-doc li { line-height: var(--lh-body); }
.legal-doc a { color: var(--brand-strong); font-weight: var(--fw-medium); text-decoration: underline; text-underline-offset: 2px; }
.legal-doc a:hover { color: var(--purple-800); }

/* Login legal links under the auth card. */
.auth-legal {
  display: flex; align-items: center; justify-content: center; gap: var(--space-3);
  margin-top: var(--space-3); font-size: var(--fs-sm);
}
.auth-legal a { color: var(--ink-2); font-weight: var(--fw-medium); }
.auth-legal a:hover { color: var(--brand-strong); text-decoration: underline; }
.auth-legal span { color: var(--gray-400); }

/* --- 16.3 Report-an-issue feedback widget ---------------------------------- */
.feedback-widget {
  position: fixed; right: var(--space-5); bottom: var(--space-5);
  z-index: var(--z-dropdown);
  display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-3);
}
.feedback-toggle {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 40px; padding: var(--space-2) var(--space-4);
  border: 1px solid var(--brand-strong); border-radius: var(--radius-pill);
  background: var(--brand); color: var(--on-brand);
  font-family: inherit; font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  cursor: pointer; box-shadow: var(--shadow);
  transition: background var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out),
              box-shadow var(--dur-2) var(--ease-out);
}
.feedback-toggle svg { width: 17px; height: 17px; }
.feedback-toggle:hover { background: var(--brand-strong); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.feedback-toggle:active { transform: translateY(0); }
.feedback-toggle:focus-visible { outline: none; box-shadow: var(--focus-ring), var(--shadow); }

.feedback-panel {
  width: min(340px, calc(100vw - 2 * var(--space-5)));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: var(--space-5);
  animation: rise var(--dur-2) var(--ease-out) both;
}
.feedback-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.feedback-panel-head h2 { font-size: var(--fs-h3); }
.feedback-close {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px; padding: 0;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--gray-600); cursor: pointer;
  transition: background var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.feedback-close svg { width: 16px; height: 16px; }
.feedback-close:hover { background: var(--surface-2); color: var(--ink); }
.feedback-close:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.feedback-form { display: flex; flex-direction: column; }
.feedback-form label {
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  color: var(--gray-700); margin-bottom: var(--space-1);
}
.feedback-form label:not(:first-child) { margin-top: var(--space-4); }
.feedback-form select,
.feedback-form textarea {
  padding: var(--space-3);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-family: inherit; font-size: var(--fs-body); color: var(--ink);
  background: var(--surface);
  transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.feedback-form textarea { resize: vertical; }
.feedback-form select:focus,
.feedback-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus-ring); }
.feedback-actions { margin-top: var(--space-4); }
.feedback-actions .btn { width: 100%; }
.feedback-status {
  margin-top: var(--space-3); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); font-size: var(--fs-sm); font-weight: var(--fw-medium);
}
.feedback-status-success { background: var(--success-bg); color: var(--success); }
.feedback-status-error { background: var(--error-bg); color: var(--error); }

@media (max-width: 560px) {
  .pilot-banner-inner { align-items: flex-start; }
  .feedback-widget { right: var(--space-4); bottom: var(--space-4); }
}
