/* =====================================================================
   NM PED — Graduation Planning & Pathway Platform (Prototype)
   Shared foundation stylesheet.
   Brand values taken from web.ped.nm.gov (Divi theme, Nov 2026).
   ===================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
  /* PED brand */
  --ped-teal:        #225c61;
  --ped-teal-hover:  #227677;
  --ped-teal-dark:   #173f43;
  --ped-red:         #c74c44;   /* headings */
  --ped-red-dark:    #a7362e;
  --ped-btn-red:     #bd2015;
  --ped-btn-red-hov: #ad170a;
  --ped-gold:        #edc872;
  --ped-cream:       #fff4c4;
  --ped-cream-soft:  #fff9e3;
  --ped-orange:      #f4784e;
  --ped-gold-hover:  #ffe4a6;

  /* Ink & surfaces */
  --ink:          #2e3138;
  --ink-2:        #555963;
  --ink-3:        #767a84;
  --line:         #e2e0d8;
  --line-strong:  #cfcabb;
  --surface:      #ffffff;
  --surface-2:    #f5f5f5;
  --surface-3:    #faf8f1;
  --page-bg:      #f6f4ee;

  /* Chart palette — validated (adjacent pairs, light surface). Fixed order, never cycled. */
  --series-1: #008c99;  /* teal   */
  --series-2: #e0603a;  /* orange */
  --series-3: #3366c2;  /* blue   */
  --series-4: #b98600;  /* gold   */
  --series-5: #9b4fb0;  /* purple */
  --series-6: #3f8f2f;  /* green  */
  /* Sequential (magnitude) — single teal hue, light → dark */
  --seq-1: #7fbfc5; --seq-2: #4fa2aa; --seq-3: #26868f; --seq-4: #1b6870; --seq-5: #124a50;

  /* Status — reserved, always paired with icon + label */
  --ok:        #2f7d3a;  --ok-bg:     #e6f2e7;
  --watch:     #8a5a00;  --watch-bg:  #fdf1d6;
  --risk:      #b4470f;  --risk-bg:   #fde7dc;
  --critical:  #b42318;  --critical-bg: #fbe3e1;
  --info:      #225c61;  --info-bg:   #e3f0f0;

  /* Type */
  --font-head: 'Barlow Condensed', Helvetica, Arial, sans-serif;
  --font-body: 'Barlow', Helvetica, Arial, sans-serif;

  /* Shape & space */
  --radius:    0.4rem;
  --radius-lg: 0.75rem;
  --shadow-1:  0 1px 2px rgba(46,49,56,.06), 0 1px 3px rgba(46,49,56,.08);
  --shadow-2:  0 4px 14px rgba(46,49,56,.10);
  --sidebar-w: 264px;
  --header-h:  72px;
  --gutter:    24px;
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  overflow-x: hidden;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--page-bg);
}
img, svg { display: block; max-width: 100%; }
a { color: var(--ped-teal); text-underline-offset: 2px; }
a:hover { color: var(--ped-teal-hover); }
::selection { background: var(--ped-cream); color: var(--ink); }
:focus-visible { outline: 3px solid var(--ped-gold); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: .005em;
}
h1 { font-size: 2.25rem; color: var(--ped-red); }
h2 { font-size: 1.75rem; color: var(--ped-red); }
h3 { font-size: 1.35rem; color: var(--ink); }
h4 { font-size: 1.125rem; color: var(--ink); }
p  { margin: 0 0 1em; }
small, .small { font-size: .875rem; }
.muted { color: var(--ink-3); }
.eyebrow {
  font-family: var(--font-head); text-transform: uppercase; letter-spacing: .08em;
  font-size: .85rem; font-weight: 600; color: var(--ped-teal); margin: 0 0 .25rem;
}
.num { font-variant-numeric: tabular-nums; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.skip-link { position:absolute; left:-999px; top:8px; z-index:100; background:var(--ped-teal); color:#fff; padding:8px 14px; border-radius:var(--radius); }
.skip-link:focus { left:8px; color:#fff; }

/* ---------- 3. App shell ---------- */
.demo-banner {
  background: var(--ped-teal-dark); color: var(--ped-cream);
  font-size: .8125rem; text-align: center; padding: 4px 16px; letter-spacing: .02em;
}
.demo-banner strong { color: var(--ped-gold); font-weight: 600; }

.app-header {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 4px solid var(--ped-gold);
  display: flex; align-items: center; gap: 16px;
  padding: 0 var(--gutter);
  overflow: hidden;
}
.app-header::after { /* PED "bend" stripes, top-right */
  content: ""; position: absolute; right: 0; top: 0; height: 100%; width: 150px;
  background: url("../images/bend-corner.svg") right top / auto 100% no-repeat;
  pointer-events: none; opacity: .95;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { width: 50px; height: 50px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-text .agency { font-family: var(--font-head); font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ped-teal); font-weight: 600; }
.brand-text .product { font-family: var(--font-head); font-size: 1.4rem; color: var(--ped-red); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-tools { margin-left: auto; margin-right: 130px; display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  display: inline-grid; place-items: center; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ped-teal); }
.app-header .icon-btn, .app-header .brand img { flex: none; }
.icon-btn .dot { position:absolute; top:6px; right:7px; width:9px; height:9px; border-radius:50%; background: var(--ped-btn-red); border:2px solid #fff; }
.menu-toggle { display: none; }

.role-switch { display: flex; flex-direction: column; gap: 2px; }
.role-switch label { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; }
.role-switch select {
  font: inherit; font-size: .9rem; font-weight: 600; color: var(--ped-teal);
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 4px 28px 4px 10px; background: var(--ped-cream-soft); cursor: pointer;
}
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip .who { line-height: 1.15; }
.user-chip .who b { display: block; font-size: .9rem; }
.user-chip .who span { font-size: .78rem; color: var(--ink-3); }

.app-body { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--header-h) - 26px); }

.sidebar {
  background: var(--ped-teal); color: #e9f1f1;
  padding: 18px 0 32px; position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.sidebar .scope {
  margin: 0 16px 14px; padding: 10px 12px; border-radius: var(--radius);
  background: rgba(255,255,255,.08); font-size: .82rem; line-height: 1.3;
}
.sidebar .scope b { display:block; color: var(--ped-cream); font-size: .9rem; }
.nav-section { margin-top: 14px; }
.nav-section h6 {
  margin: 0 0 4px; padding: 0 20px; font-family: var(--font-head); font-weight: 600;
  font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ped-gold);
}
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 20px 8px 17px;
  color: #e9f1f1; text-decoration: none; font-size: .95rem; border-left: 3px solid transparent;
}
.nav-link svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link[aria-current="page"] { background: var(--ped-teal-dark); border-left-color: var(--ped-gold); color: var(--ped-cream); font-weight: 600; }
.nav-link .soon { margin-left: auto; font-size: .65rem; text-transform: uppercase; letter-spacing: .06em; opacity: .55; }

.scrim { display: none; }
.main { padding: 24px var(--gutter) 64px; min-width: 0; }
.main-inner { max-width: 1320px; margin: 0 auto; }

.crumbs { font-size: .85rem; color: var(--ink-3); margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ped-teal); text-decoration: underline; }
.crumbs span[aria-hidden] { opacity: .5; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.page-head .lede { margin: 4px 0 0; color: var(--ink-2); max-width: 70ch; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.app-footer { border-top: 1px solid var(--line); margin-top: 48px; padding-top: 16px; font-size: .8rem; color: var(--ink-3); display:flex; flex-wrap:wrap; gap: 6px 18px; }

/* ---------- 4. Layout utilities ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.stack > * + * { margin-top: 20px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.mt-0{margin-top:0}.mt-1{margin-top:8px}.mt-2{margin-top:16px}.mt-3{margin-top:24px}.mt-4{margin-top:36px}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:8px}.mb-2{margin-bottom:16px}

/* ---------- 5. Components ---------- */

/* Card */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1); padding: 20px; min-width: 0;
}
.card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.card-head h3 { margin: 0; }
.card-head .sub { font-size: .85rem; color: var(--ink-3); margin-top: 2px; }
.card-head .tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card.flush { padding: 0; }
.card.flush > .card-head { padding: 18px 20px 0; }
.card.accent { border-top: 4px solid var(--ped-teal); }
.card.cream { background: var(--ped-cream-soft); border-color: #f1e3a8; }
a.card { display:block; text-decoration:none; color:inherit; transition: box-shadow .15s, transform .15s; }
a.card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); color: inherit; }

/* KPI / stat tile */
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow-1); }
.kpi .label { font-size: .85rem; color: var(--ink-2); font-weight: 500; }
.kpi .value { font-family: var(--font-head); font-size: 2.4rem; font-weight: 600; color: var(--ink); line-height: 1.05; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .value small { font-size: 1.1rem; color: var(--ink-3); font-weight: 500; }
.kpi .delta { font-size: .82rem; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); }
.kpi .delta.up   { color: var(--ok); }
.kpi .delta.down { color: var(--critical); }
.kpi .context { font-size: .78rem; color: var(--ink-3); }
.kpi.hero { background: var(--ped-teal); border-color: var(--ped-teal); color: #fff; }
.kpi.hero .label, .kpi.hero .context { color: #d3e6e6; }
.kpi.hero .value { color: var(--ped-cream); }
.kpi.hero .delta, .kpi.hero .delta.up, .kpi.hero .delta.down { color: var(--ped-gold); }

/* Buttons — PED: no border, 0.4rem radius, bold Barlow */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 700 .95rem/1 var(--font-body); padding: 11px 18px; border-radius: var(--radius);
  border: 0; cursor: pointer; text-decoration: none; transition: background-color .3s, color .3s, box-shadow .3s;
  background: var(--ped-teal); color: #fff; white-space: nowrap;
}
.btn:hover { background: var(--ped-teal-hover); color: #fff; }
.btn svg { width: 16px; height: 16px; }
.btn.red { background: var(--ped-btn-red); box-shadow: inset -2rem -2rem 3rem -1rem var(--ped-red); }
.btn.red:hover { background: var(--ped-btn-red-hov); }
.btn.ghost { background: transparent; color: var(--ped-teal); box-shadow: inset 0 0 0 1.5px var(--ped-teal); }
.btn.ghost:hover { background: var(--info-bg); }
.btn.light { background: #fff; color: var(--ped-red); }
.btn.light:hover { background: var(--ped-red); color: #fff; }
.btn.gold { background: var(--ped-gold); color: var(--ink); }
.btn.gold:hover { background: var(--ped-gold-hover); }
.btn.sm { padding: 7px 12px; font-size: .85rem; }
.btn.link { background: none; color: var(--ped-teal); padding: 0; text-decoration: underline; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Badges & pills */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; line-height: 1.6; background: var(--surface-2); color: var(--ink-2); white-space: nowrap;
}
.badge.teal  { background: var(--info-bg); color: var(--ped-teal); }
.badge.cream { background: var(--ped-cream); color: #6b5300; }
.badge.red   { background: #fbe7e5; color: var(--ped-red-dark); }
.badge.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }

/* Status (reserved colors, icon + label) */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 7px; border-radius: 999px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.status svg { width: 14px; height: 14px; }
.status.ok       { background: var(--ok-bg); color: var(--ok); }
.status.watch    { background: var(--watch-bg); color: var(--watch); }
.status.risk     { background: var(--risk-bg); color: var(--risk); }
.status.critical { background: var(--critical-bg); color: var(--critical); }
.status.info     { background: var(--info-bg); color: var(--info); }
.status.neutral  { background: var(--surface-2); color: var(--ink-2); }

/* Progress */
.progress { height: 10px; background: #ebe8df; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: var(--ped-teal); }
.progress.ok > span { background: var(--ok); }
.progress.watch > span { background: #c48a12; }
.progress.risk > span { background: var(--risk); }
.progress.lg { height: 14px; }
.progress-row { display: grid; grid-template-columns: minmax(120px, 1fr) 2fr auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.progress-row:last-child { border-bottom: 0; }
.progress-row .val { font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 64px; text-align: right; }

/* Alerts / callouts */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius); border-left: 4px solid; font-size: .93rem; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert b { display: block; }
.alert.info     { background: var(--info-bg); border-color: var(--ped-teal); }
.alert.ok       { background: var(--ok-bg); border-color: var(--ok); }
.alert.watch    { background: var(--watch-bg); border-color: #c48a12; }
.alert.risk     { background: var(--risk-bg); border-color: var(--risk); }
.alert.critical { background: var(--critical-bg); border-color: var(--critical); }
.alert.info svg { color: var(--ped-teal); } .alert.ok svg { color: var(--ok); } .alert.watch svg { color: var(--watch); }
.alert.risk svg { color: var(--risk); } .alert.critical svg { color: var(--critical); }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.list > li:last-child { border-bottom: 0; }
.list .meta { font-size: .82rem; color: var(--ink-3); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.card .table-wrap { border: 0; border-radius: 0; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data th {
  background: var(--surface-3); font-family: var(--font-head); font-weight: 600; font-size: .9rem;
  letter-spacing: .03em; color: var(--ink-2); text-transform: uppercase; white-space: nowrap; position: sticky; top: 0;
}
table.data th[data-sort] { cursor: pointer; user-select: none; }
table.data th[data-sort]:hover { color: var(--ped-teal); }
table.data th .arrow { opacity: .4; margin-left: 4px; font-size: .75em; }
table.data th[aria-sort] .arrow { opacity: 1; color: var(--ped-teal); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody tr:hover { background: #fbfaf5; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data a { font-weight: 600; text-decoration: none; }
table.data a:hover { text-decoration: underline; }

/* Toolbar / filters (one row above content) */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: .8rem; color: var(--ink-3); }
.input, .select, textarea.input {
  font: inherit; font-size: .95rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 8px 12px; min-height: 40px;
}
.input:focus, .select:focus { border-color: var(--ped-teal); outline: 2px solid rgba(34,92,97,.25); outline-offset: 0; }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); }
.search .input { padding-left: 36px; min-width: 240px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: .93rem; }
.check input { width: 18px; height: 18px; accent-color: var(--ped-teal); }

/* Segmented control / tabs */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button, .tabs a {
  font: 600 .95rem var(--font-body); background: none; border: 0; padding: 10px 16px; color: var(--ink-2);
  cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; text-decoration: none; white-space: nowrap;
}
.tabs [aria-selected="true"] { color: var(--ped-teal); border-bottom-color: var(--ped-red); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius); padding: 3px; }
.seg button { font: 600 .85rem var(--font-body); border: 0; background: none; padding: 6px 12px; border-radius: 5px; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ped-teal); box-shadow: var(--shadow-1); }

/* Avatar */
.avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; flex: none; background: var(--ped-cream); color: var(--ped-teal); border: 2px solid var(--ped-gold); }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3rem; }

/* Stepper (workflows: applications, approvals) */
.stepper { display: flex; list-style: none; margin: 0; padding: 0; counter-reset: s; }
.stepper li { flex: 1; position: relative; text-align: center; font-size: .82rem; color: var(--ink-3); padding-top: 34px; }
.stepper li::before {
  counter-increment: s; content: counter(s); position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--surface); border: 2px solid var(--line-strong); color: var(--ink-3); z-index: 1;
}
.stepper li::after { content: ""; position: absolute; top: 12px; left: -50%; width: 100%; height: 2px; background: var(--line-strong); }
.stepper li:first-child::after { display: none; }
.stepper li.done { color: var(--ink-2); }
.stepper li.done::before { content: "✓"; background: var(--ped-teal); border-color: var(--ped-teal); color: #fff; }
.stepper li.done::after, .stepper li.current::after { background: var(--ped-teal); }
.stepper li.current { color: var(--ink); font-weight: 600; }
.stepper li.current::before { border-color: var(--ped-red); color: var(--ped-red); background: var(--ped-cream); }

/* Timeline (activity, audit) */
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 16px 14px; font-size: .92rem; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--ped-teal); }
.timeline .when { font-size: .78rem; color: var(--ink-3); }

/* Empty state / coming soon */
.empty { text-align: center; padding: 48px 24px; }
.empty .art { width: 90px; margin: 0 auto 12px; }

/* Definition grid (profile facts) */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 20px; margin: 0; }
.facts dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.facts dd { margin: 2px 0 0; font-weight: 600; }

/* ---------- 6. Charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { overflow: visible; }
.chart .axis text, .chart .tick { font-size: 13px; fill: var(--ink-3); font-family: var(--font-body); }
.chart .grid-line { stroke: #ebe8df; stroke-width: 1; }
.chart .baseline { stroke: var(--line-strong); stroke-width: 1; }
.chart .label { font-size: 14px; fill: var(--ink-2); font-family: var(--font-body); }
.chart .value-label { font-size: 14px; fill: var(--ink); font-weight: 600; font-family: var(--font-body); }
.chart .hit { fill: transparent; cursor: default; }
.chart .crosshair { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; background: var(--ink); color: #fff;
  font-size: .8rem; padding: 7px 10px; border-radius: 6px; box-shadow: var(--shadow-2); white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .1s;
}
.chart-tip.show { opacity: 1; }
.chart-tip .k { display: flex; align-items: center; gap: 6px; }
.chart-tip .sw { width: 10px; height: 10px; border-radius: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--ink-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- 7. Landing / role picker ---------- */
.landing-hero {
  position: relative; overflow: hidden; background: var(--ped-teal); color: #fff;
  border-radius: var(--radius-lg); padding: 40px 44px; margin-bottom: 28px;
}
.landing-hero::after {
  content: ""; position: absolute; right: -10px; top: -10px; bottom: -10px; width: 140px;
  background: url("../images/bend.svg") right center / auto 115% no-repeat;
}
.landing-hero h1 { color: var(--ped-cream); font-size: 2.8rem; max-width: 24ch; position: relative; z-index: 1; }
.landing-hero p { color: #d8e8e8; max-width: 60ch; font-size: 1.1rem; position: relative; z-index: 1; }
.role-card { display: flex; gap: 14px; align-items: flex-start; }
.role-card .ico { width: 44px; height: 44px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--ped-cream); color: var(--ped-teal); }
.role-card .ico svg { width: 22px; height: 22px; }
.role-card h3 { margin: 0 0 2px; color: var(--ped-teal); }
.role-card p { margin: 0; font-size: .9rem; color: var(--ink-2); }
.role-card .persona { font-size: .8rem; color: var(--ink-3); margin-top: 6px; }

/* Swatches (style guide) */
.swatch { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.swatch .chip { height: 64px; }
.swatch .meta { padding: 8px 10px; font-size: .8rem; line-height: 1.3; }
.swatch .meta b { display: block; font-size: .85rem; }

/* ---------- 8. Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .span-3 { grid-column: span 2; }
}
@media (max-width: 900px) {
  :root { --gutter: 16px; --header-h: 64px; }
  .app-body { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: inline-grid; }
  .sidebar {
    position: fixed; z-index: 50; left: 0; top: 0; height: 100vh; width: min(300px, 86vw);
    transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-2);
  }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 45; display: none; }
  .scrim.show { display: block; }
  .header-tools { margin-right: 60px; }
  .app-header::after { width: 80px; }
  .user-chip .who, .brand-text .agency { display: none; }
  .brand img { width: 40px; height: 40px; }
  .brand-text .product { font-size: 1.1rem; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  h1 { font-size: 1.9rem; }
  .role-switch label { display: none; }
  .role-switch select { max-width: 130px; }
  .user-chip, .header-tools .icon-btn.bell { display: none; }
  .header-tools { margin-right: 40px; }
  .app-header::after { width: 50px; }
  .brand-text .product { font-size: 1rem; white-space: normal; }
  .landing-hero { padding: 28px 22px; }
  .landing-hero h1 { font-size: 2rem; }
  .landing-hero::after { width: 60px; opacity: .6; }
  .progress-row { grid-template-columns: 1fr auto; }
  .progress-row .progress { grid-column: 1 / -1; grid-row: 2; }
  .search .input { min-width: 0; width: 100%; }
  .toolbar .search { flex: 1 1 100%; }
  .lang-toggle { padding: 6px 9px; font-size: .8rem; }
  .lang-toggle svg { display: none; }
  .header-tools { gap: 8px; }
}
@media print {
  .sidebar, .app-header, .demo-banner, .scrim { display: none !important; }
  .app-body { display: block; }
  body { background: #fff; }
}

[hidden] { display: none !important; }
