/* ==========================================================================
   Applications Portal — "Clear" design system
   Deep teal + teal + sun + sand + coral on warm white. Flat surfaces,
   one obvious action per screen, large tap targets.

   Source colours: #264653 deep teal · #2A9D8F teal · #E9C46A sun · #F4A261 sand · #E76F51 coral
   See STYLING_GUIDE.txt for the full rationale.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --font-display: 'Outfit', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-heading: var(--font-display);

  --ink: #1A2F38;
  --ink-soft: #3B535E;
  --muted: #667A83;

  --primary: #264653;
  --primary-deep: #1B343E;
  --primary-soft: #E5EEF0;
  --primary-tint: #C3D5DA;

  --accent: #E9C46A;
  --accent-hover: #E2B64B;
  --accent-deep: #7A5A12;
  --accent-soft: #FBF3DC;

  --slate: #2A9D8F;
  --sand: #F4A261;
  --sand-soft: #FDEEE1;
  --violet: #2A9D8F;
  --violet-soft: #DFF2EF;

  --success: #1E7D71;
  --success-soft: #DFF2EF;
  --success-line: #B3DFD8;
  --warning: #A4561A;
  --warning-soft: #FDEEE1;
  --warning-line: #F7CBA6;
  --danger: #C4502F;
  --danger-deep: #A23F24;
  --danger-soft: #FCE9E3;
  --danger-line: #F4C3B5;
  --coral: #E76F51;
  --coral-soft: #FCE5DE;
  --on-dark: #D9E6E9;
  --on-dark-muted: #A9C1C7;

  --bg: #FBF8F3;
  --surface: #FFFFFF;
  --surface-warm: #FCFAF6;
  --surface-muted: #F3EEE6;
  --line: #ECE4D8;
  --line-strong: #DACDBB;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 6px 20px -6px rgba(15, 23, 42, .14), 0 2px 6px -2px rgba(15, 23, 42, .06);
  --shadow-lg: 0 24px 48px -16px rgba(15, 23, 42, .22), 0 8px 16px -8px rgba(15, 23, 42, .08);

  --max-width: 1160px;
  --header-h: 68px;
  --bottom-nav-h: 84px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
main { flex: 1; }

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
ul[class], ol[class], nav ul, footer ul, .dropdown ul { list-style: none; }

a { color: var(--primary); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--primary-deep); text-decoration: underline; text-underline-offset: 3px; }
a.btn:hover, a.card:hover, .brand:hover, .main-nav a:hover, .bottom-nav a:hover,
.site-footer a:hover, .dropdown a:hover, .side-nav a:hover, .tab-links a:hover,
.list-row:hover, .pagination a:hover, .app-card:hover, a.stat-card:hover,
.icon-btn:hover, .chip:hover { text-decoration: none; }

:focus-visible { outline: 3px solid var(--slate); outline-offset: 2px; border-radius: 6px; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 4vw, 3.1rem); }
h2 { font-size: clamp(1.6rem, 2.8vw, 2.25rem); margin-bottom: .75rem; }
h3 { font-size: 1.2rem; font-weight: 600; letter-spacing: -0.01em; margin-bottom: .5rem; }
h4 { font-size: 1.02rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin-bottom: .75rem; }
p:last-child { margin-bottom: 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', monospace;
  font-size: .86em;
  background: var(--surface-muted);
  padding: .12em .4em;
  border-radius: 6px;
}
hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

::selection { background: var(--accent-soft); color: var(--ink); }

/* ---------- Utilities ---------- */
.hidden, [hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.container { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 780px; }
.container-mid { max-width: 960px; }

.muted { color: var(--muted); }
.soft { color: var(--ink-soft); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.strong { font-weight: 700; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-accent { color: var(--accent-deep); }
.block { display: block; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .9em; }

.stack > * + * { margin-top: 1rem; }
.stack-sm > * + * { margin-top: .5rem; }
.stack-lg > * + * { margin-top: 1.75rem; }
.row { display: flex; align-items: center; gap: .75rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.row-wrap { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.row-end { display: flex; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2.5rem; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

.icon { width: 1.25rem; height: 1.25rem; flex-shrink: 0; }
.icon-sm { width: 1rem; height: 1rem; flex-shrink: 0; }
.icon-lg { width: 1.6rem; height: 1.6rem; flex-shrink: 0; }

/* ---------- Header and navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease;
}
.site-header.scrolled { box-shadow: 0 4px 18px -8px rgba(15, 23, 42, .16); }
.site-header .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  position: relative;
}
.site-header-wide .container { max-width: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--surface);
  flex-shrink: 0;
}
.brand em { font-style: normal; color: var(--primary); }
.brand-tag {
  font-family: var(--font-body);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.main-nav { display: flex; align-items: center; gap: .25rem; }
.main-nav a, .main-nav .link-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .75rem;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.main-nav a:hover, .main-nav a.active, .main-nav a[aria-current="page"] {
  background: var(--primary-soft);
  color: var(--primary-deep);
}
.main-nav .link-btn:hover, .main-nav a.nav-logout:hover { background: var(--danger-soft); color: var(--danger-deep); }
.main-nav .btn { margin-left: .35rem; color: #fff; }
.main-nav .btn-accent { color: var(--primary-deep); }
.main-nav .btn:hover { color: #fff; background: var(--primary-deep); }
.main-nav .btn-accent:hover { color: var(--primary-deep); background: var(--accent-hover); }
.main-nav .nav-mobile-only { display: none; }
.nav-sep { width: 1px; height: 24px; background: var(--line); margin: 0 .35rem; }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  transition: background .15s ease;
}
.nav-toggle:hover { background: var(--primary-soft); }
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .2s var(--ease), opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile bottom navigation (signed-in learners and employees) */
.bottom-nav { display: none; }

/* User menu (avatar dropdown) */
.user-menu { position: relative; }
.avatar-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: 3px 8px 3px 3px;
  border-radius: var(--radius-pill);
  transition: background .15s ease;
}
.avatar-btn:hover { background: var(--primary-soft); }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  background: var(--surface);
}
.avatar-lg { width: 44px; height: 44px; }

.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + .6rem);
  width: 270px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 60;
}
.dropdown-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.dropdown-head strong { display: block; font-size: .92rem; }
.dropdown-head span { display: block; font-size: .8rem; color: var(--muted); }
.dropdown ul { padding: .4rem; }
.dropdown ul + ul { border-top: 1px solid var(--line); }
.dropdown a, .dropdown button.dropdown-item {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  padding: .6rem .7rem;
  border-radius: 8px;
  font-size: .92rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-align: left;
}
.dropdown a:hover, .dropdown a.active { background: var(--primary-soft); color: var(--primary-deep); }
.dropdown a.active { font-weight: 700; }
.dropdown a.danger { color: var(--danger); font-weight: 600; }
.dropdown a.danger:hover { background: var(--danger-soft); color: var(--danger-deep); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 46px;
  padding: .75rem 1.4rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: .98rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.btn:hover { background: var(--primary-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"], .btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { width: 1.1rem; height: 1.1rem; flex-shrink: 0; }

.btn-small { min-height: 38px; padding: .5rem 1rem; font-size: .88rem; }
.btn-tiny { min-height: 32px; padding: .35rem .75rem; font-size: .82rem; border-radius: 8px; }
.btn-accent { background: var(--accent); color: var(--primary-deep); }
.btn-accent:hover { background: var(--accent-hover); color: var(--primary-deep); }
.btn-outline { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.btn-outline:hover { background: var(--primary-soft); color: var(--primary-deep); box-shadow: inset 0 0 0 1.5px var(--primary); }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: var(--primary-soft); color: var(--primary-deep); }
.btn-ghost-light { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .55); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 0 0 0 1.5px #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-deep); color: #fff; }
.btn-danger-outline { background: var(--surface); color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger-line); }
.btn-danger-outline:hover { background: var(--danger-soft); color: var(--danger-deep); box-shadow: inset 0 0 0 1.5px var(--danger); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #17665C; color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn .arrow { transition: transform .15s var(--ease); }
.btn:hover .arrow, .card-go:hover .arrow, a.card:hover .arrow { transform: translateX(4px); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary-deep); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger-deep); }
.icon-btn svg { width: 1.15rem; height: 1.15rem; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}
.link-btn:hover { color: var(--primary-deep); text-decoration: underline; text-underline-offset: 3px; }
.link-danger { color: var(--danger); }
.link-danger:hover { color: var(--danger-deep); }

/* ---------- Flash messages ---------- */
.flash-area { padding-top: 1rem; }
.flash-area .container > * + * { margin-top: .6rem; }
.flash {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .85rem 1rem .85rem 2.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: .95rem;
  font-weight: 500;
  transition: opacity .3s ease, transform .3s ease;
}
.flash::before {
  content: "";
  position: absolute;
  left: .85rem;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: currentColor;
}
.flash > span { flex: 1; }
.flash-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: inherit;
  opacity: .7;
  flex-shrink: 0;
}
.flash-close:hover { opacity: 1; background: rgba(15, 23, 42, .06); }
.flash-close svg { width: 1rem; height: 1rem; }
.flash-success { background: var(--success-soft); border-color: var(--success-line); border-left-color: var(--success); color: var(--success); }
.flash-error, .flash-danger { background: var(--danger-soft); border-color: var(--danger-line); border-left-color: var(--danger); color: var(--danger-deep); }
.flash-warning { background: var(--warning-soft); border-color: var(--warning-line); border-left-color: var(--warning); color: var(--warning); }
.flash.is-leaving { opacity: 0; transform: translateY(-6px); }

/* Inline notice / callout (same language as flash, used inside pages) */
.notice {
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
  color: var(--ink-soft);
  font-size: .93rem;
}
.notice > svg { width: 1.2rem; height: 1.2rem; flex-shrink: 0; margin-top: .15rem; color: var(--primary); }
.notice strong { color: var(--ink); }
.notice-accent { background: var(--accent-soft); border-color: var(--sand); border-left-color: var(--accent); }
.notice-accent > svg { color: var(--accent-deep); }
.notice-success { background: var(--success-soft); border-color: var(--success-line); border-left-color: var(--success); }
.notice-success > svg { color: var(--success); }
.notice-warning { background: var(--warning-soft); border-color: var(--warning-line); border-left-color: var(--warning); }
.notice-warning > svg { color: var(--warning); }
.notice-danger { background: var(--danger-soft); border-color: var(--danger-line); border-left-color: var(--danger); }
.notice-danger > svg { color: var(--danger); }

/* ---------- Eyebrows, highlights, bubbles, badges ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .32rem .8rem;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }

.label {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}

.scribble {
  color: var(--primary);
  background: linear-gradient(transparent 62%, var(--accent) 62%);
  padding: 0 .08em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.bubble {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-soft);
  color: var(--primary);
}
.bubble svg { width: 24px; height: 24px; }
.bubble-sm { width: 40px; height: 40px; border-radius: 11px; }
.bubble-sm svg { width: 20px; height: 20px; }
.bubble-ochre { background: var(--accent-soft); color: var(--accent-deep); }
.bubble-coral { background: var(--coral-soft); color: var(--coral); }
.bubble-sage { background: var(--success-soft); color: var(--success); }
.bubble-danger { background: var(--danger-soft); color: var(--danger); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .22rem .65rem;
  border-radius: var(--radius-pill);
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  background: var(--surface-muted);
  color: var(--ink-soft);
}
.badge::before { content: none; }
.badge-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-pending, .badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-failed, .badge-danger { background: var(--danger-soft); color: var(--danger-deep); }
.badge-admin, .badge-primary { background: var(--primary-soft); color: var(--primary-deep); }
.badge-solid { background: var(--primary); color: #fff; }
.badge-accent { background: var(--accent-soft); color: var(--accent-deep); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-user { background: var(--surface-muted); color: var(--ink-soft); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .4rem .85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: .86rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.chip:hover { border-color: var(--primary); color: var(--primary-deep); }
.chip.active, .chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

.check-list li, .tick-list li {
  position: relative;
  padding-left: 1.9rem;
  margin-bottom: .6rem;
  color: var(--ink-soft);
}
.check-list li::before, .tick-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .2rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--success-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E7D71' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 62% no-repeat;
}
.dot-list li { position: relative; padding-left: 1.1rem; margin-bottom: .45rem; color: var(--ink-soft); }
.dot-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-hover);
}

/* ---------- Cards and grids ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  color: inherit;
}
a.card { transition: border-color .15s ease, box-shadow .15s ease; }
a.card:hover { border-color: var(--primary); box-shadow: var(--shadow); color: inherit; }
.card-flush { padding: 0; overflow: hidden; }
.card-tight { padding: 1.1rem 1.25rem; }
.card-warm { background: var(--bg); }
.card-tint { background: var(--primary-soft); border-color: var(--primary-tint); }
.card-accent { background: var(--accent-soft); border-color: var(--sand); }
.card-danger { border-color: var(--danger-line); }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.card-head h2, .card-head h3 { font-size: 1.08rem; margin: 0; letter-spacing: -0.01em; }
.card-head p { margin: .15rem 0 0; font-size: .86rem; color: var(--muted); }
.card-body { padding: 1.5rem; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .75rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--surface-warm);
}
.card-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.card-title svg { width: 1.2rem; height: 1.2rem; color: var(--primary); }
.card-go {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-top: auto;
  padding-top: 1rem;
  font-weight: 700;
  font-size: .92rem;
  color: var(--primary);
}
.card-go .arrow { transition: transform .15s var(--ease); }

/* Stat tiles (KPIs) */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.stat-card {
  display: block;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  color: inherit;
}
a.stat-card { transition: box-shadow .15s ease, border-color .15s ease; }
a.stat-card:hover { box-shadow: var(--shadow); color: inherit; }
.stat-grid > .stat-card:nth-child(4n+2) { border-top-color: var(--success); }
.stat-grid > .stat-card:nth-child(4n+3) { border-top-color: var(--accent); }
.stat-grid > .stat-card:nth-child(4n+4) { border-top-color: var(--coral); }
.stat-label {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
}
.stat-value {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-top: .35rem;
  color: var(--ink);
}
.stat-value-sm { font-size: 1.6rem; }
.stat-meta { font-size: .84rem; color: var(--muted); margin-top: .25rem; }
.stat-card .bubble { position: absolute; top: 1.1rem; right: 1.1rem; }

/* Key/value list */
.kv { display: grid; grid-template-columns: minmax(130px, 38%) 1fr; gap: .1rem 1rem; }
.kv dt {
  padding: .65rem 0;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.kv dd {
  padding: .6rem 0;
  font-size: .95rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  word-break: break-word;
}
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem 1.5rem; }
.kv-grid dt { font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.kv-grid dd { font-size: .96rem; color: var(--ink); margin-top: .15rem; word-break: break-word; }

/* List rows (admin lists, application rows) */
.list { display: flex; flex-direction: column; gap: .6rem; }
.list-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
}
a.list-row { transition: border-color .15s ease, box-shadow .15s ease; }
a.list-row:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); color: inherit; }
.list-row-main { flex: 1; min-width: 0; }
.list-row-main strong { display: block; font-weight: 600; }
.list-row-main span { display: block; font-size: .86rem; color: var(--muted); }
.list-row-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; flex-wrap: wrap; }

.divided > * + * { border-top: 1px solid var(--line); }

/* Empty states */
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state .bubble { width: 64px; height: 64px; border-radius: 18px; margin-bottom: 1rem; }
.empty-state .bubble svg { width: 28px; height: 28px; }
.empty-state h2, .empty-state h3 { font-size: 1.2rem; margin-bottom: .35rem; }
.empty-state p { color: var(--muted); max-width: 32rem; margin: 0 auto 1.25rem; }

/* ---------- Forms and fields ---------- */
.field { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.1rem; }
.field:last-child { margin-bottom: 0; }
.field label, .field-label { font-weight: 600; font-size: .9rem; color: var(--ink); }
.field label .req, .req { color: var(--danger); }
.field-hint { font-size: .82rem; color: var(--muted); margin: 0; }
.field-error { font-size: .82rem; color: var(--danger); font-weight: 600; margin: 0; }

.input,
.field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.field select,
.field textarea,
.control {
  width: 100%;
  min-height: 46px;
  padding: .7rem .9rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: .97rem;
  line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea, textarea.control { min-height: 110px; resize: vertical; }
.field select, select.control {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.4rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667A83' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .8rem center;
  background-size: 1rem;
}
.input:hover, .control:hover,
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--slate); }
.input:focus, .control:focus,
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(42, 157, 143, .25);
}
.field input:disabled, .field select:disabled, .field textarea:disabled, .control:disabled,
.field input[readonly], .control[readonly] { background: var(--bg); color: var(--muted); cursor: not-allowed; }
.control-sm { min-height: 38px; padding: .45rem .75rem; font-size: .9rem; }

.is-valid, .field .is-valid { border-color: var(--success) !important; }
.is-invalid, .field .is-invalid { border-color: var(--danger) !important; }

.input-icon { position: relative; }
.input-icon > svg {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.1rem;
  height: 1.1rem;
  color: var(--muted);
  pointer-events: none;
}
.input-icon > .control, .input-icon > input { padding-left: 2.6rem !important; }
.input-action { position: relative; }
.input-action > .control, .input-action > input { padding-right: 3rem !important; }
.input-action > button {
  position: absolute;
  right: .35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.input-action > button:hover { color: var(--primary); background: var(--primary-soft); }
.input-action > button svg { width: 1.1rem; height: 1.1rem; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1.25rem; }
.form-grid .span-all, .form-grid-3 .span-all { grid-column: 1 / -1; }
.form-section + .form-section { margin-top: 1.75rem; padding-top: 1.75rem; border-top: 1px solid var(--line); }
.form-section-title {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.form-actions { display: flex; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.form-page {
  width: 100%;
  max-width: 440px;
  margin: 2.5rem auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 2.25rem 2rem;
}
.form-page-wide { max-width: 640px; }
.form-page h1 { font-size: 1.9rem; margin-bottom: .4rem; }
.form-page .bubble { margin-bottom: 1.1rem; }
.form-sub { color: var(--muted); margin-bottom: 1.6rem; }
.form-footer-link { text-align: center; margin-top: 1.4rem; font-size: .93rem; color: var(--muted); }
.form-footer-link a { font-weight: 700; }

.checkbox-label, .consent-label {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  font-size: .92rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.checkbox-label input, .consent-label input,
input[type="checkbox"], input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-top: .15rem;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* Option cards (radio/checkbox tiles) */
.option-card {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  min-height: 48px;
  padding: .9rem 1rem;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.option-card:hover { border-color: var(--slate); }
.option-card:has(input:checked), .option-card.is-active { border-color: var(--primary); background: var(--primary-soft); }
.option-card strong { display: block; font-size: .95rem; }
.option-card span { display: block; font-size: .84rem; color: var(--muted); }

/* File drop zone */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: 1.75rem 1rem;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-warm);
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.is-dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone svg { width: 2rem; height: 2rem; color: var(--slate); }
.dropzone strong { color: var(--primary); }
.dropzone input[type="file"] { display: none; }

input[type="file"].control, .field input[type="file"] {
  width: 100%;
  padding: .55rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-warm);
  font-size: .9rem;
  color: var(--muted);
}
input[type="file"]::file-selector-button {
  margin-right: .8rem;
  padding: .45rem .9rem;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--primary-deep); }

/* Password strength / requirement list */
.req-list { display: flex; flex-direction: column; gap: .3rem; margin-top: .5rem; }
.req-item { display: flex; align-items: center; gap: .5rem; font-size: .8rem; color: var(--muted); transition: color .15s ease; }
.req-item .req-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); flex-shrink: 0; transition: background .15s ease; }
.req-item.is-met { color: var(--success); }
.req-item.is-met .req-dot { background: var(--success); }
.strength-track { height: 6px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; margin-top: .5rem; }
.strength-fill { height: 100%; width: 0; border-radius: inherit; background: var(--danger); transition: width .3s var(--ease), background .3s ease; }

/* ---------- Tables ---------- */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: .93rem;
}
th, td { padding: .85rem 1.1rem; text-align: left; vertical-align: middle; }
td { border-top: 1px solid var(--line); color: var(--ink-soft); }
th {
  background: var(--bg);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}
tbody tr { transition: background .15s ease; }
tbody tr:hover { background: var(--surface-warm); }
td strong { color: var(--ink); font-weight: 600; }
.table-scroll { width: 100%; overflow-x: auto; border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.table-scroll > table { min-width: 640px; }
.card > .table-scroll > table, .card > table { border: 0; border-radius: 0; }
.cell-actions { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.cell-sub { display: block; font-size: .82rem; color: var(--muted); }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.25rem; }
.pagination-info { font-size: .88rem; color: var(--muted); }
.pagination-links { display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.pagination-links a, .pagination-links span {
  min-width: 38px;
  height: 38px;
  padding: 0 .7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-soft);
}
.pagination-links a:hover { border-color: var(--primary); color: var(--primary-deep); }
.pagination-links .current { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination-links .disabled { opacity: .45; }
.pagination-links .gap { border: 0; background: none; }

/* ---------- Progress ---------- */
.progress-bar-track { height: 10px; border-radius: var(--radius-pill); background: var(--line); overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: inherit; background: var(--primary); transition: width .8s var(--ease), background .3s ease; }
.progress-bar-fill.is-complete { background: var(--success); }
.progress-bar-track.thin { height: 6px; }

.progress-ring {
  --p: 0;
  position: relative;
  width: 124px;
  height: 124px;
  border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--p) * 1%), var(--line) 0);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.progress-ring::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: var(--surface);
}
.progress-ring > div { position: relative; text-align: center; line-height: 1.1; }
.progress-ring strong { display: block; font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; }
.progress-ring span { font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* Step tracker (application status timeline) */
.steps-track { display: flex; align-items: flex-start; gap: 0; }
.steps-track .st-step { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; }
.steps-track .st-step::before {
  content: "";
  position: absolute;
  top: 15px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: var(--line);
  z-index: 0;
}
.steps-track .st-step:first-child::before { display: none; }
.steps-track .st-step.done::before, .steps-track .st-step.current::before { background: var(--primary); }
.st-dot {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 2px solid var(--line-strong);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}
.st-dot svg { width: 15px; height: 15px; }
.st-step.done .st-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.st-step.current .st-dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.st-step.failed .st-dot { background: var(--danger); border-color: var(--danger); color: #fff; }
.st-label { margin-top: .5rem; font-size: .78rem; font-weight: 600; color: var(--muted); line-height: 1.3; padding: 0 .25rem; }
.st-step.done .st-label, .st-step.current .st-label { color: var(--ink); }

/* ---------- FAQ accordions ---------- */
.faq-list { display: flex; flex-direction: column; gap: .6rem; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color .15s ease;
}
.faq-item[open] { border-color: var(--primary-tint); }
.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  font-weight: 600;
  color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1;
  color: var(--primary);
  transition: transform .2s var(--ease);
  flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-body { padding: 0 1.2rem 1.1rem; color: var(--ink-soft); font-size: .95rem; }

/* Generic accordion (driven by data-accordion-target in main.js) */
.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
}
.accordion-trigger [data-accordion-icon], .chev { transition: transform .2s var(--ease); }
.accordion-trigger[aria-expanded="true"] [data-accordion-icon], .is-open > .chev, [aria-expanded="true"] > .chev { transform: rotate(180deg); }

/* ---------- Tabs ---------- */
.tab-links { display: flex; gap: .4rem; flex-wrap: wrap; }
.tab-links a, .tab-links button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-pill);
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.tab-links a:hover, .tab-links button:hover { border-color: var(--primary); color: var(--primary-deep); }
.tab-links .active, .tab-links [aria-selected="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
.tab-links .active:hover, .tab-links [aria-selected="true"]:hover { color: #fff; }
.tab-links .count {
  font-size: .74rem;
  padding: 0 .45rem;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary-deep);
}
.tab-links .active .count { background: rgba(255, 255, 255, .2); color: #fff; }

/* ---------- Modals ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(27, 52, 62, .55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  overflow-y: auto;
}
.modal-panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
}
.modal-panel-lg { max-width: 760px; }
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.modal-head h2, .modal-head h3 { font-size: 1.2rem; margin: 0; }
.modal-head p { margin: .2rem 0 0; font-size: .88rem; color: var(--muted); }
.modal-body { padding: 1.5rem; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: .75rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--line);
  background: var(--surface-warm);
}
body.modal-open { overflow: hidden; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 120;
  display: flex;
  align-items: center;
  gap: .75rem;
  max-width: 360px;
  padding: .9rem 1.1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--success);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: .92rem;
  font-weight: 500;
  color: var(--ink);
  transition: opacity .3s ease, transform .3s ease;
}
.toast.toast-error { border-left-color: var(--danger); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); }

/* ---------- Page structure ---------- */
.page { padding-top: 2rem; padding-bottom: 4rem; }
.page-head { margin-bottom: 1.75rem; }
.page-head .eyebrow { margin-bottom: .75rem; }
.page-title { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: .5rem; }
.page-title-sm { font-size: clamp(1.7rem, 3vw, 2.2rem); margin-bottom: .35rem; }
.page-lead { color: var(--muted); font-size: 1.05rem; max-width: 40rem; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.page-head-row .page-head { margin-bottom: 0; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: .45rem;
  flex-wrap: wrap;
  font-size: .86rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1rem;
}
.back-link:hover { color: var(--primary); text-decoration: none; }
.back-link svg { width: 1rem; height: 1rem; }

.section { padding: 5rem 0; }
.section-tight { padding: 3.5rem 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-title { max-width: 40rem; margin: 0 auto 2.75rem; text-align: center; }
.section-title p { color: var(--muted); font-size: 1.05rem; }
.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2.25rem 0 1rem;
}
.section-label h2 { font-size: 1.35rem; margin: 0; }
.section-label:first-child { margin-top: 0; }

.toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.toolbar .input-icon { flex: 1; min-width: 220px; }
.toolbar select.control { width: auto; min-width: 160px; }

/* Two-column page with aside */
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
.with-aside-left { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.sticky-aside { position: sticky; top: calc(var(--header-h) + 1.25rem); }

/* Prose (long-form text) */
.prose { color: var(--ink-soft); font-size: 1rem; line-height: 1.75; }
.prose > * + * { margin-top: 1rem; }
.prose h2 { font-size: 1.35rem; margin-top: 2rem; color: var(--ink); }
.prose h3 { font-size: 1.12rem; margin-top: 1.5rem; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: .4rem; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: 12px; }
.prose blockquote { border-left: 4px solid var(--accent); padding: .5rem 1rem; background: var(--accent-soft); border-radius: 0 10px 10px 0; color: var(--ink); }
.prose p { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--primary);
  color: var(--on-dark-muted);
  padding: 3.5rem 0 0;
  margin-top: 4rem;
  font-size: .93rem;
}
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; padding-bottom: 2.5rem; }
.site-footer .brand { color: #fff; margin-bottom: .9rem; }
.site-footer .brand em { color: var(--accent); }
.site-footer .brand-mark { border-color: rgba(255, 255, 255, .15); }
.site-footer p { max-width: 22rem; }
.site-footer h4 {
  font-family: var(--font-body);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 1rem;
}
.site-footer ul li + li { margin-top: .55rem; }
.site-footer a { color: var(--on-dark); }
.site-footer a:hover { color: #fff; }
.footer-social { display: flex; gap: .5rem; margin-top: 1.1rem; }
.footer-social a {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .08);
  transition: background .15s ease;
}
.footer-social a:hover { background: rgba(255, 255, 255, .16); }
.footer-social svg { width: 18px; height: 18px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem 0;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .85rem;
}

/* ---------- Scroll reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   Page sections are appended below this line.
   ========================================================================== */

/* ---------- Bottom navigation (signed-in, under 980px) ---------- */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  padding: 0 .75rem calc(.75rem + env(safe-area-inset-bottom));
}
.bottom-nav-inner {
  max-width: 520px;
  margin: 0 auto;
  height: 64px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 0 .25rem;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.bottom-nav-inner.cols-4 { grid-template-columns: repeat(4, 1fr); }
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  height: 52px;
  margin: 0 .2rem;
  border-radius: 12px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  transition: background .15s ease, color .15s ease;
}
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { background: var(--primary-soft); color: var(--primary); }
.bottom-nav a.bottom-nav-fab {
  width: 54px;
  height: 54px;
  margin: -1.6rem auto 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--primary-deep);
  box-shadow: 0 0 0 4px var(--surface), var(--shadow);
}
.bottom-nav a.bottom-nav-fab:hover { background: var(--accent-hover); }
.bottom-nav a.bottom-nav-fab svg { width: 24px; height: 24px; }

/* ---------- Admin layout ---------- */
.admin-layout { display: flex; align-items: stretch; flex: 1; width: 100%; }
.admin-sidebar {
  width: 236px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 1.5rem .9rem;
}
.side-nav {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.side-nav::before {
  content: "Admin";
  display: block;
  padding: 0 .75rem .6rem;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.side-nav a {
  display: block;
  padding: .6rem .75rem;
  border-radius: 8px;
  font-size: .93rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background .15s ease, color .15s ease;
}
.side-nav a:hover { background: var(--bg); color: var(--primary-deep); }
.side-nav a.active { background: var(--primary-soft); color: var(--primary-deep); box-shadow: inset 3px 0 0 var(--primary); }
.admin-content { flex: 1; min-width: 0; padding: 2rem 2.25rem 4rem; }
.admin-content > .flash-area { padding-top: 0; margin-bottom: 1.25rem; }
.admin-content > .flash-area .container { padding: 0; max-width: none; }
.admin-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.admin-toolbar h1 { font-size: clamp(1.6rem, 2.6vw, 2rem); margin-bottom: .2rem; }
.admin-toolbar p { color: var(--muted); margin: 0; }
.admin-section-title { font-size: 1.15rem; margin: 2rem 0 .9rem; }

/* ---------- Responsive: core components ---------- */
@media (max-width: 1100px) {
  .main-nav-user a { padding: .5rem .55rem; font-size: .9rem; }
}
@media (max-width: 980px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .with-aside, .with-aside-left { grid-template-columns: 1fr; }
  .sticky-aside { position: static; }

  /* Visitors: hamburger dropdown */
  .nav-toggle { display: inline-flex; }
  .main-nav:not(.main-nav-user):not(.main-nav-static) {
    display: none;
    position: absolute;
    top: calc(100% + .5rem);
    left: 1rem;
    right: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: .15rem;
    padding: .6rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
  }
  .main-nav.open { display: flex !important; }
  .main-nav:not(.main-nav-user) a { padding: .75rem .9rem; }
  .main-nav:not(.main-nav-user) .btn { margin: .4rem 0 0; }
  .main-nav .nav-mobile-only { display: flex; }
  .main-nav .nav-sep { width: auto; height: 1px; margin: .35rem 0; }

  /* Signed in: avatar menu + bottom nav */
  .main-nav-user { display: none; }
  .bottom-nav { display: block; }
  body.has-bottom-nav { padding-bottom: var(--bottom-nav-h); }
  body.has-bottom-nav .toast { bottom: calc(var(--bottom-nav-h) + .5rem); }
}
@media (max-width: 860px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { width: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: .75rem 1rem; }
  .side-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: .3rem; }
  .side-nav::before { display: none; }
  .side-nav a { padding: .45rem .75rem; font-size: .86rem; background: var(--bg); }
  .side-nav a.active { box-shadow: none; background: var(--primary); color: #fff; }
  .admin-content { padding: 1.5rem 1.25rem 3rem; }
  .admin-content table { display: block; overflow-x: auto; }
  .form-grid, .form-grid-3, .grid-2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { border-bottom: 0; padding-bottom: 0; }
  .admin-user { display: none; }
}
@media (max-width: 760px) {
  :root { --header-h: 62px; }
  .brand { font-size: 1.05rem; }
  .brand-mark { width: 32px; height: 32px; }
}
@media (max-width: 560px) {
  .container { padding: 0 1rem; }
  .section { padding: 3.5rem 0; }
  .page { padding-top: 1.5rem; padding-bottom: 3rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 1.7rem; }
  .card { padding: 1.2rem; }
  .card-head, .card-body, .card-foot { padding-left: 1.2rem; padding-right: 1.2rem; }
  .form-page { padding: 1.75rem 1.25rem; margin: 1.25rem auto; }
  .list-row { flex-wrap: wrap; }
  .list-row-actions { width: 100%; }
  .modal-body, .modal-head, .modal-foot { padding-left: 1.2rem; padding-right: 1.2rem; }
  .toast { left: 1rem; right: 1rem; max-width: none; }
  .brand-tag { display: none; }
  .steps-track .st-label { font-size: .68rem; }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- Print ---------- */
@page { margin: 10mm; }
@media print {
  .site-header, .site-footer, .flash-area, .bottom-nav, .admin-sidebar, .no-print { display: none !important; }
  body { background: #fff; }
  .card, table { box-shadow: none; }
  .admin-content { padding: 0; }
}

/* ==========================================================================
   Page sections
   ========================================================================== */

/* ---------- Homepage ---------- */
.hero { background: linear-gradient(180deg, var(--sand-soft) 0%, var(--bg) 100%); padding: 4rem 0 5rem; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 3.5rem; align-items: center; }
.hero .eyebrow { background: var(--surface); box-shadow: inset 0 0 0 1px var(--primary-tint); }
.hero h1 { margin-bottom: 1.1rem; }
.hero-lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 34rem; margin-bottom: 1.75rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero-parents { margin-top: 1rem; font-size: .92rem; color: var(--muted); }
.hero-trust { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 2rem; }
.hero-trust li {
  display: flex;
  flex-direction: column;
  padding: .7rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 108px;
}
.hero-trust strong { font-family: var(--font-display); font-size: 1.45rem; line-height: 1.1; color: var(--primary); }
.hero-trust span { font-size: .78rem; color: var(--muted); }
.hero-art { position: relative; }
.hero-frame {
  aspect-ratio: 1 / 0.82;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  background: linear-gradient(160deg, var(--primary-soft), var(--accent-soft));
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.hero-frame img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }
.float-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .7rem 1rem .7rem .7rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: .82rem;
  line-height: 1.3;
}
.float-chip strong { display: block; font-size: .9rem; color: var(--ink); }
.float-chip span:not(.bubble) { color: var(--muted); }
.float-chip.one { top: 1.25rem; left: -1.25rem; }
.float-chip.two { bottom: 1.25rem; right: -1.25rem; }

.info-band { background: var(--accent-soft); border-top: 1px solid var(--sand); border-bottom: 1px solid var(--sand); padding: 1.25rem 0; text-align: center; }
.info-band p { max-width: 52rem; margin: 0 auto; color: var(--ink-soft); font-size: .98rem; }
.info-band strong { color: var(--ink); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; counter-reset: step; }
.step {
  counter-increment: step;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.step::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.step:nth-child(3n+2)::before { background: var(--accent); color: var(--primary-deep); }
.step:nth-child(3n+3)::before { background: var(--slate); }
.step p { color: var(--ink-soft); font-size: .95rem; }
.step.step-note { counter-increment: none; background: var(--accent-soft); border-color: var(--sand); display: flex; gap: 1rem; align-items: flex-start; }
.step.step-note::before { content: none; }

.pricing-wrap {
  max-width: 940px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pricing-features-col { padding: 2.5rem; }
.pricing-features-col h3 { font-size: 1.4rem; margin-bottom: .3rem; }
.pricing-features-col .muted { margin-bottom: 1.5rem; }
.pricing-card {
  padding: 2.5rem;
  background: var(--bg);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .4rem;
}
.price {
  font-family: var(--font-display);
  font-size: 3.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--ink);
  margin: .25rem 0 0;
}
.price span { font-size: 1.1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.pricing-card .btn { margin-top: 1.25rem; }
.secure-note { margin-top: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.secure-note li { position: relative; padding-left: 1.2rem; font-size: .8rem; color: var(--muted); }
.secure-note li::before { content: "!"; position: absolute; left: 0; top: 0; font-weight: 800; color: var(--accent-deep); }

.cta-band {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 3rem;
  border-radius: 24px;
  background: var(--primary-deep);
  color: var(--on-dark);
}
.cta-band::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(233, 196, 106, .14);
  pointer-events: none;
}
.cta-band h2 { color: #fff; margin-bottom: .5rem; }
.cta-band .scribble { background: none; color: var(--accent); padding: 0; }
.cta-band p { max-width: 34rem; }
.cta-actions { position: relative; z-index: 1; display: flex; gap: .75rem; flex-wrap: wrap; flex-shrink: 0; }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-art { max-width: 560px; width: 100%; margin: 0 auto; }
  .float-chip.one { left: .75rem; }
  .float-chip.two { right: .75rem; }
  .steps { grid-template-columns: 1fr 1fr; }
  .pricing-wrap { grid-template-columns: 1fr; }
  .pricing-card { border-left: 0; border-top: 1px solid var(--line); }
  .cta-band { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .hero { padding: 2.5rem 0 3.5rem; }
  .hero-actions .btn { width: 100%; }
  .hero-trust li { flex: 1; min-width: 0; }
  .float-chip { font-size: .74rem; padding: .5rem .7rem .5rem .5rem; }
  .float-chip .bubble-sm { width: 32px; height: 32px; }
  .steps { grid-template-columns: 1fr; }
  .pricing-features-col, .pricing-card { padding: 1.6rem; }
  .cta-band { padding: 2rem 1.5rem; }
  .cta-actions, .cta-actions .btn { width: 100%; }
}

/* ---------- Auth pages (split screen) ---------- */
.auth-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - var(--header-h)); }
.auth-art {
  position: relative;
  overflow: hidden;
  background: var(--primary) center / cover no-repeat;
  display: flex;
  align-items: flex-end;
  padding: 3rem;
}
.auth-art > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center 35%; padding: 2rem 2rem 9rem; }
.auth-art { background: radial-gradient(circle at 50% 35%, var(--slate) 0%, var(--primary) 60%); }
.auth-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(27, 52, 62, .92) 0%, rgba(27, 52, 62, .45) 45%, rgba(27, 52, 62, .05) 100%);
}
.auth-quote { position: relative; z-index: 1; max-width: 30rem; color: #fff; }
.auth-quote blockquote {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 1.9rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: .9rem;
}
.auth-quote p { color: var(--on-dark); font-size: .92rem; }
.auth-quote .scribble { color: #fff; background: linear-gradient(transparent 62%, rgba(233, 196, 106, .65) 62%); }
.auth-panel { background: var(--surface); display: flex; align-items: center; justify-content: center; padding: 3rem 1.5rem; }
.auth-panel .form-page { border: 0; box-shadow: none; margin: 0; padding: 0; }
.auth-panel .eyebrow { margin-bottom: .9rem; }
.form-divider { display: flex; align-items: center; gap: .75rem; margin: 1.4rem 0; font-size: .82rem; color: var(--muted); }
.form-divider::before, .form-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.label-row a { font-size: .84rem; font-weight: 600; }
.pw-toggle .eye-closed, .pw-toggle[aria-pressed="true"] .eye-open { display: none; }
.pw-toggle[aria-pressed="true"] .eye-closed { display: block; }
.req-box { margin-top: .6rem; padding: .75rem .9rem; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); }
.req-box > p { font-size: .8rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .35rem; }
.match-msg { font-size: .82rem; font-weight: 600; margin-top: .35rem; }
.match-msg.ok { color: var(--success); }
.match-msg.bad { color: var(--danger); }
.help-links { margin-top: 1.25rem; text-align: center; font-size: .86rem; color: var(--muted); }
.help-links p + p { margin-top: .3rem; }
.help-links a { font-weight: 600; }

@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; min-height: 0; }
  .auth-art { min-height: 200px; padding: 1.5rem; }
  .auth-quote blockquote { font-size: 1.2rem; margin-bottom: .3rem; }
  .auth-panel { padding: 2.25rem 1rem 3rem; }
}

/* ---------- Content pages (about, contact, legal) ---------- */
.about-team { max-width: 980px; margin: 0 auto; }
.about-team .card-title { margin-bottom: .6rem; }
.belief {
  padding: 2rem;
  border-radius: var(--radius);
  background: var(--accent-soft);
  border: 1px solid var(--sand);
  border-left: 4px solid var(--accent);
}
.belief-quote {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: .5rem 0 .75rem;
}
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 1.5rem; align-items: start; }
.contact-option {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-style: normal;
}
.contact-option h2 { font-size: 1.05rem; margin-bottom: .2rem; }
.contact-option p { font-size: .9rem; color: var(--muted); margin-bottom: .35rem; }
.contact-option a { font-weight: 700; word-break: break-all; }

.legal-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 2rem; max-width: 1040px; margin: 0 auto; align-items: start; }
.legal-nav { position: sticky; top: calc(var(--header-h) + 1.25rem); display: flex; flex-direction: column; gap: .15rem; }
.legal-nav a { padding: .5rem .75rem; border-radius: 8px; font-size: .9rem; font-weight: 600; color: var(--ink-soft); }
.legal-nav a:hover, .legal-nav a.active { background: var(--primary-soft); color: var(--primary-deep); text-decoration: none; }
.prose.card { padding: 2.5rem; }
.prose.card h2 { font-size: 1.25rem; }
.prose.card h2:first-child { margin-top: 0; }
.legal-updated { font-size: .88rem; color: var(--muted); }
mark.todo { background: var(--danger-soft); color: var(--danger-deep); padding: 0 .2em; border-radius: 4px; }

@media (max-width: 860px) {
  .contact-grid, .legal-layout { grid-template-columns: 1fr; }
  .legal-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .legal-nav a { background: var(--surface); border: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .prose.card { padding: 1.4rem; }
  .belief { padding: 1.4rem; }
}

/* ---------- Institutions directory ---------- */
.inst-stats { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.inst-stats li {
  display: flex;
  flex-direction: column;
  padding: .7rem 1.1rem;
  min-width: 112px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.inst-stats strong { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; color: var(--ink); }
.inst-stats span { font-size: .78rem; color: var(--muted); }
.inst-stats .is-open strong { color: var(--success); }
.inst-stats .is-uni strong { color: var(--primary); }
.inst-stats .is-tvet strong { color: var(--violet); }
.inst-stats .is-bursary strong { color: var(--accent-deep); }

.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 1.5rem; padding: 1.1rem 1.25rem; }
.filter-search { flex: 1 1 260px; }
.filter-group { display: flex; flex-direction: column; gap: .4rem; }
.chip-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.type-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.type-dot.uni { background: var(--primary); }
.type-dot.tvet { background: var(--violet); }
.type-dot.bursary { background: var(--accent-hover); }
.chip.active .type-dot { background: #fff; }

.inst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 1.25rem; }
.inst-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.inst-card:hover { box-shadow: var(--shadow); }
.inst-card.inst-tvet { border-top-color: var(--violet); }
.inst-card.inst-bursary { border-top-color: var(--accent); }
.inst-card.closed { background: var(--surface-warm); }
.inst-card.closed .inst-head h2, .inst-card.closed .inst-logo { opacity: .7; }
.inst-head { display: flex; align-items: flex-start; gap: .9rem; }
.inst-head h2 { font-size: 1.08rem; margin: .35rem 0 .15rem; letter-spacing: -0.01em; }
.inst-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.inst-logo img { width: 100%; height: 100%; object-fit: contain; padding: .3rem; }
.inst-logo span { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--primary); }
.type-tag {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .15rem .55rem;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary-deep);
}
.inst-tvet .type-tag { background: var(--violet-soft); color: var(--violet); }
.inst-bursary .type-tag { background: var(--accent-soft); color: var(--accent-deep); }
.inst-meta { display: flex; align-items: center; gap: .3rem; font-size: .84rem; color: var(--muted); margin: 0; }
.inst-details { display: flex; flex-direction: column; gap: .45rem; padding-top: .9rem; border-top: 1px solid var(--line); }
.inst-details li { display: flex; align-items: flex-start; gap: .5rem; font-size: .86rem; color: var(--ink-soft); line-height: 1.45; }
.inst-details li svg { margin-top: .15rem; color: var(--slate); }
.inst-details strong { color: var(--ink); font-weight: 600; }
.inst-details li.text-danger, .inst-details li.text-danger svg { color: var(--danger); }
.inst-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; }
.inst-actions .btn { flex: 1; }

@media (max-width: 560px) {
  .inst-stats li { flex: 1 1 calc(33% - .75rem); min-width: 0; padding: .6rem .8rem; }
  .filter-group { width: 100%; }
}

/* ---------- Product / checkout (eBook) ---------- */
.product-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 2rem; align-items: start; }
.purchase-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 1.75rem; }
.purchase-card .price { font-size: 2.8rem; }
.check-list-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.trust-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: 1.25rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }
.trust-row li { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; font-size: .74rem; color: var(--muted); line-height: 1.3; }
.trust-row svg { width: 1.2rem; height: 1.2rem; color: var(--slate); }
.trust-row strong { display: block; color: var(--ink); }
.success-hero { text-align: center; max-width: 560px; margin: 1.5rem auto; }
.success-hero .bubble { width: 72px; height: 72px; border-radius: 50%; margin-bottom: 1.1rem; }
.success-hero .bubble svg { width: 32px; height: 32px; }

@media (max-width: 980px) {
  .product-layout { grid-template-columns: 1fr; }
  .product-layout > aside { order: -1; }
}
@media (max-width: 560px) {
  .check-list-2 { grid-template-columns: 1fr; }
}

/* ---------- Status / confirmation pages ---------- */
.status-page { max-width: 560px; margin: 1.5rem auto; text-align: center; }
.status-page > .card { text-align: left; }
.status-page h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); margin-bottom: .4rem; }
.status-icon { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 1.1rem; display: flex; }
.status-icon svg { width: 32px; height: 32px; }
.status-page .eyebrow { display: inline-flex; }
.status-email { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; color: var(--primary); word-break: break-all; margin: .2rem 0 1.25rem; }
.numbered-steps { counter-reset: ns; display: flex; flex-direction: column; gap: .9rem; }
.numbered-steps li { counter-increment: ns; position: relative; padding-left: 2.6rem; min-height: 1.9rem; }
.numbered-steps li::before {
  content: counter(ns);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .9rem;
}
.numbered-steps strong { display: block; font-size: .95rem; color: var(--ink); }
.numbered-steps span { display: block; font-size: .88rem; color: var(--muted); }

/* ---------- Banking details ---------- */
.bank-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.25rem; align-items: stretch; }
.fee-card { display: flex; flex-direction: column; justify-content: center; }
.modal-close-corner { position: absolute; top: .75rem; right: .75rem; }
@media (max-width: 860px) { .bank-grid { grid-template-columns: 1fr; } }

/* ---------- Long forms: progress, step pills, numbered sections, document uploads ---------- */
.form-shell { max-width: 860px; margin: 0 auto; }
.form-progress {
  position: sticky;
  top: calc(var(--header-h) + .75rem);
  z-index: 20;
  margin-bottom: 1.5rem;
  padding: 1rem 1.15rem;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.form-progress-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; font-size: .84rem; font-weight: 600; color: var(--ink-soft); }
.form-progress-top strong { font-family: var(--font-display); color: var(--primary); }
.form-progress-top strong.is-complete { color: var(--success); }
.step-pills { display: flex; gap: .4rem; overflow-x: auto; margin-top: .85rem; scrollbar-width: none; }
.step-pills::-webkit-scrollbar { display: none; }
.step-pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .38rem .8rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.step-pill:hover { border-color: var(--primary); color: var(--primary-deep); text-decoration: none; }
.step-pill .step-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex-shrink: 0; }
.step-pill.is-complete { background: var(--success-soft); border-color: var(--success-line); color: var(--success); }
.step-pill.is-complete .step-dot {
  width: 12px;
  height: 12px;
  background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 70% no-repeat;
}
.step-pill.is-current { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); color: var(--primary-deep); }

.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.25rem; scroll-margin-top: calc(var(--header-h) + 9rem); }
.form-card-head { display: flex; align-items: center; gap: .9rem; padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--line); }
.form-card-head h2 { font-size: 1.1rem; margin: 0; letter-spacing: -0.01em; }
.form-card-head p { font-size: .86rem; color: var(--muted); margin: .1rem 0 0; }
.form-card-num {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
}
.form-card:nth-of-type(4n+2) .form-card-num { background: var(--accent); color: var(--primary-deep); }
.form-card:nth-of-type(4n+3) .form-card-num { background: var(--slate); }
.form-card:nth-of-type(4n+4) .form-card-num { background: var(--violet); }
.form-card-body { padding: 1.5rem; }
.radio-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.radio-row .option-card { min-height: 0; padding: .6rem .9rem; align-items: center; font-size: .92rem; }
.declaration-text { padding: 1rem 1.15rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-soft); font-size: .92rem; margin-bottom: 1rem; }
.form-submit { margin-top: .5rem; }
.form-submit-note { text-align: center; font-size: .84rem; color: var(--muted); margin-top: .75rem; }

.doc-list { display: grid; gap: 1rem; }
.doc-card { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; background: var(--surface); }
.doc-card-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.doc-card-head strong { font-size: .95rem; }
.doc-status { font-size: .8rem; color: var(--muted); }
.doc-status.is-selected { color: var(--success); font-weight: 600; }
.doc-dropzone { position: relative; display: block; cursor: pointer; border: 2px dashed var(--line-strong); border-radius: 12px; background: var(--surface-warm); transition: border-color .15s ease, background .15s ease; }
.doc-dropzone:hover, .doc-dropzone.is-active { border-color: var(--primary); background: var(--primary-soft); }
.doc-dropzone input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.doc-placeholder { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1.5rem 1rem; text-align: center; font-size: .88rem; color: var(--muted); pointer-events: none; }
.doc-placeholder svg { width: 1.8rem; height: 1.8rem; color: var(--slate); }
.doc-placeholder strong { color: var(--primary); }
.doc-preview { display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; pointer-events: none; }
.doc-preview.hidden { display: none !important; }
.doc-thumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--danger-soft); color: var(--danger); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.doc-thumb svg { width: 1.3rem; height: 1.3rem; }
.doc-filename { font-weight: 600; font-size: .9rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 0; }
.doc-filesize { font-size: .8rem; color: var(--muted); margin: 0; }
.doc-preview > svg { width: 1.2rem; height: 1.2rem; color: var(--success); margin-left: auto; flex-shrink: 0; }
.doc-error { font-size: .82rem; font-weight: 600; color: var(--danger); margin: .5rem 0 0; }

@media (max-width: 560px) {
  .form-card-head, .form-card-body { padding-left: 1.1rem; padding-right: 1.1rem; }
  .form-progress { top: calc(var(--header-h) + .4rem); }
}

/* ---------- Choice tiles (institution type, etc.) ---------- */
.type-select-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.type-select {
  display: flex;
  align-items: center;
  gap: .9rem;
  width: 100%;
  padding: 1rem 1.1rem;
  text-align: left;
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.type-select:hover { border-color: var(--slate); }
.type-select strong { display: block; font-size: 1rem; color: var(--ink); }
.type-select .grow > span { display: block; font-size: .85rem; color: var(--muted); }
.type-select.is-active { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); }
.type-check {
  display: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
}
.type-check svg { width: 14px; height: 14px; }
.type-select.is-active .type-check { display: inline-flex; }
.fee-figure { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--primary); line-height: 1.1; margin: 0; }
@media (max-width: 560px) { .type-select-grid { grid-template-columns: 1fr; } }

/* ---------- Blog ---------- */
.search-row { display: flex; gap: .6rem; max-width: 560px; margin-top: 1.25rem; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; }
.post-grid-featured { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.post-card:hover { border-color: var(--primary); box-shadow: var(--shadow); color: inherit; text-decoration: none; }
.post-cover { aspect-ratio: 16 / 9; background: var(--primary-soft); overflow: hidden; border-bottom: 1px solid var(--line); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-cover-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--slate); }
.post-body { display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem 1.2rem 1.25rem; flex: 1; }
.post-body h3 { font-size: 1.05rem; margin: 0; line-height: 1.3; }
.post-excerpt { font-size: .9rem; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.post-meta { font-size: .8rem; color: var(--muted); margin: auto 0 0; }

.article { max-width: 760px; margin: 0 auto; }
.article-title { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-bottom: 1rem; }
.article-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .88rem; color: var(--muted); margin-bottom: 1.5rem; }
.article-cover { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 20px; border: 1px solid var(--line); margin-bottom: 2rem; }
.article-body { font-size: 1.06rem; line-height: 1.8; color: var(--ink-soft); }
.article-body > * + * { margin-top: 1.1rem; }
.article-body h1, .article-body h2 { font-size: 1.55rem; margin-top: 2rem; color: var(--ink); }
.article-body h3 { font-size: 1.2rem; margin-top: 1.6rem; color: var(--ink); }
.article-body ul, .article-body ol { padding-left: 1.5rem; }
.article-body li + li { margin-top: .35rem; }
.article-body a { text-decoration: underline; text-underline-offset: 3px; }
.article-body strong { color: var(--ink); }
.article-body img { border-radius: 12px; border: 1px solid var(--line); }
.article-body blockquote { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: .75rem 1.1rem; border-radius: 0 10px 10px 0; color: var(--ink); }
.article-body pre { background: var(--primary-deep); color: var(--on-dark); padding: 1.1rem; border-radius: 12px; overflow-x: auto; font-size: .88rem; }
.article-body pre code { background: none; padding: 0; color: inherit; }
.article-foot { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.article-related { max-width: 1000px; margin: 3rem auto 0; }
@media (max-width: 560px) { .search-row { flex-direction: column; } }

/* ---------- Learner dashboard & application cards ---------- */
.dash-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 2rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--primary-soft) 0%, var(--surface) 70%);
}
.dash-hero h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); margin: .2rem 0 .3rem; }
.dash-hero .muted { margin-bottom: 0; }
.dash-stats { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1.1rem; }
.dash-stats li {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  padding: .45rem .9rem;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
}
.dash-stats strong { font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); }
.dash-stats span { font-size: .82rem; color: var(--muted); font-weight: 600; }
.dash-stats .is-good strong { color: var(--success); }
.dash-stats .is-warn strong { color: var(--warning); }
.dash-stats-cards li { border-radius: 12px; padding: .7rem 1.1rem; flex-direction: column; gap: 0; min-width: 100px; }
.dash-stats-cards strong { font-size: 1.6rem; }

.nudge-card { display: flex; align-items: center; gap: 1.25rem; border-color: var(--sand); background: var(--accent-soft); }
.nudge-card h2 { font-size: 1.1rem; margin-bottom: .2rem; }
a.nudge-card:hover { border-color: var(--accent-hover); }
.progress-ring-sm { width: 72px; height: 72px; }
.progress-ring-sm::before { inset: 8px; }
.progress-ring-sm strong { font-size: 1.05rem; }
.nudge-card .progress-ring { background: conic-gradient(var(--accent-deep) calc(var(--p) * 1%), var(--sand) 0); }
.nudge-card .progress-ring::before { background: var(--accent-soft); }

.deadline-strip {
  display: flex;
  align-items: center;
  gap: .9rem;
  margin-top: 1.1rem;
  padding: .85rem 1rem;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.deadline-strip > svg { color: var(--slate); }
.deadline-strip.is-urgent { background: var(--danger-soft); border-color: var(--danger-line); }
.deadline-strip.is-urgent > svg, .deadline-strip.is-urgent .deadline-count strong { color: var(--danger); }
.deadline-count { text-align: center; line-height: 1.1; }
.deadline-count strong { display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--primary); }
.deadline-count span { font-size: .72rem; color: var(--muted); font-weight: 600; }

.quick-actions { display: flex; flex-direction: column; gap: .75rem; }
.quick-action { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.15rem; }
.quick-action > div { flex: 1; }
.quick-action strong { display: block; color: var(--ink); }
.quick-action div span { display: block; font-size: .86rem; color: var(--muted); }
.quick-action > .arrow { color: var(--primary); font-weight: 700; transition: transform .15s var(--ease); }

.app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.app-card { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.app-card-head { display: flex; align-items: flex-start; gap: .85rem; }
.app-card-head h3 { font-size: 1rem; margin: 0 0 .25rem; }
.app-card-head .inst-logo, .app-acc-head .inst-logo { width: 46px; height: 46px; }
.app-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding-top: .9rem; border-top: 1px solid var(--line); margin-top: auto; }
.course-list { display: flex; flex-direction: column; gap: .4rem; }
.course-list li { display: flex; align-items: center; gap: .6rem; font-size: .9rem; color: var(--ink-soft); }
.course-list li > span {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: .75rem;
  font-weight: 700;
}
.course-list li + li > span { background: var(--accent-soft); color: var(--accent-deep); }
.pay-state { display: inline-flex; align-items: center; gap: .35rem; font-size: .84rem; font-weight: 600; }
.pay-state.is-paid { color: var(--success); }
.pay-state.is-pending { color: var(--warning); }

.app-acc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.app-acc-head { display: flex; align-items: center; gap: .9rem; width: 100%; padding: 1rem 1.15rem; text-align: left; transition: background .15s ease; }
.app-acc-head:hover { background: var(--surface-warm); }
.app-acc-head[aria-expanded="true"] { border-bottom: 1px solid var(--line); }
.app-acc-title { display: block; font-size: 1rem; margin-bottom: .35rem; color: var(--ink); }
.app-acc-head .chev { color: var(--muted); }
.app-acc-body { display: flex; flex-direction: column; gap: 1.1rem; padding: 1.15rem; background: var(--surface-warm); }
.badge svg { width: .85rem; height: .85rem; }

@media (max-width: 560px) {
  .dash-hero { padding: 1.4rem; }
  .dash-hero .btn { width: 100%; }
  .app-grid { grid-template-columns: 1fr; }
  .nudge-card { gap: .9rem; }
}

/* ---------- Application detail ---------- */
.detail-shell { max-width: 900px; margin: 0 auto; }
.detail-head { display: flex; align-items: flex-start; gap: 1rem; flex-wrap: wrap; padding: 1.5rem; border-bottom: 1px solid var(--line); }
.detail-head h2 { font-size: 1.3rem; margin: 0 0 .2rem; }
.inst-logo-lg { width: 64px; height: 64px; border-radius: 14px; }
.kv-grid > div { min-width: 0; }
.credentials { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; padding: .75rem 1rem; margin-top: .35rem; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid var(--sand); }
.status-guide { display: grid; grid-template-columns: auto 1fr; gap: .7rem 1rem; align-items: center; }
.status-guide dd { font-size: .9rem; color: var(--ink-soft); }
@media (max-width: 560px) {
  .detail-head { padding: 1.2rem; }
  .detail-head .btn { width: 100%; }
  .status-guide { grid-template-columns: 1fr; gap: .3rem; }
  .status-guide dd { margin-bottom: .6rem; }
}

/* ---------- Chat widget placement (component styles live in components/chat.html) ---------- */
@media (max-width: 980px) {
  body.has-bottom-nav #chat-fab { bottom: calc(var(--bottom-nav-h) + .25rem); }
  body.has-bottom-nav #chat-panel { bottom: calc(var(--bottom-nav-h) + 5rem); }
}
@media (max-width: 480px) {
  body.has-bottom-nav #chat-panel { bottom: 0; }
}

/* ---------- New application: tiles, entries, people picker, payment summary ---------- */
.type-select-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.type-select-stacked { position: relative; flex-direction: column; align-items: flex-start; gap: .6rem; }
.type-select-stacked .type-check { position: absolute; top: .75rem; right: .75rem; }
.type-select:disabled { opacity: .55; cursor: not-allowed; background: var(--bg); }
.type-select:disabled:hover { border-color: var(--line-strong); }

.entry-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.entry-card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .7rem 1rem; background: var(--bg); border-bottom: 1px solid var(--line); }
.entry-card-head strong { font-size: .93rem; }
.entry-card-body { padding: 1rem; }
.entry-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  font-size: .76rem;
  font-weight: 700;
}
.btn-tiny svg { width: .9rem; height: .9rem; }
.remove-entry-btn:hover { background: var(--danger-soft); color: var(--danger-deep); }

.person-picker {
  display: flex;
  align-items: center;
  gap: .9rem;
  width: 100%;
  padding: .85rem 1rem;
  text-align: left;
  border: 1.5px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color .15s ease, background .15s ease;
}
.person-picker:hover { border-color: var(--primary); background: var(--primary-soft); }
.person-picker strong, .person-option strong { display: block; color: var(--ink); font-size: .95rem; }
.person-picker .grow > span, .person-option .grow > span { display: block; font-size: .83rem; color: var(--muted); }
.person-picker > svg { color: var(--muted); }
.person-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
  object-fit: cover;
}
.person-avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-avatar.is-initial { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; font-size: .9rem; }
.person-list { display: flex; flex-direction: column; gap: .35rem; max-height: 55vh; overflow-y: auto; }
.person-option { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .7rem .8rem; text-align: left; border: 1px solid transparent; border-radius: 12px; transition: background .15s ease, border-color .15s ease; }
.person-option:hover { background: var(--bg); border-color: var(--line); }
.person-option.is-selected { background: var(--primary-soft); border-color: var(--primary-tint); }

.total-panel { padding: 1.25rem; border-radius: 14px; background: var(--primary); color: var(--on-dark); text-align: center; }
.total-panel .label { color: var(--on-dark-muted); }
.total-panel .price { color: #fff; font-size: 2.4rem; }
.total-panel p { margin-bottom: .2rem; }
.total-panel .strong { color: var(--accent); }
.summary-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.summary-row { display: flex; align-items: flex-start; gap: .7rem; padding: .75rem 1rem; }
.summary-row + .summary-row { border-top: 1px solid var(--line); }
.summary-row .entry-num { margin-top: .1rem; background: var(--primary-soft); color: var(--primary); }

@media (max-width: 760px) { .type-select-grid-3 { grid-template-columns: 1fr; } .type-select-stacked { flex-direction: row; align-items: center; } .type-select-stacked .badge { margin-left: auto; } .type-select-stacked .type-check { position: static; } }
.readonly-value { display: flex; align-items: center; gap: .5rem; min-height: 46px; padding: .7rem .9rem; border-radius: var(--radius-sm); background: var(--bg); border: 1.5px solid var(--line); color: var(--ink-soft); }

/* ---------- Account / settings ---------- */
.account-wrap { max-width: 980px; margin: 0 auto; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.danger-zone { border-color: var(--danger-line); }
.inline-form { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .4rem; }
.inline-form .control { flex: 1; min-width: 160px; }
@media (max-width: 860px) { .account-grid { grid-template-columns: 1fr; } }
.ebook-title-card { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.ebook-title-card h2 { font-size: 1.3rem; margin: .15rem 0 0; }
.subsection { margin-top: .5rem; padding: 1.1rem 1.2rem .2rem; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.doc-list-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.save-bar {
  position: sticky;
  bottom: 1rem;
  z-index: 15;
  padding: .75rem;
  background: rgba(255, 255, 255, .94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
body.has-bottom-nav .save-bar { bottom: calc(1rem); }
@media (max-width: 980px) { body.has-bottom-nav .save-bar { bottom: calc(var(--bottom-nav-h) + .25rem); } }
@media (max-width: 760px) { .doc-list-2 { grid-template-columns: 1fr; } }

/* ---------- Responsive tables: stack rows into cards on phones ---------- */
@media (max-width: 760px) {
  .table-scroll > table.responsive-table { min-width: 0; border: 0; background: none; }
  .responsive-table thead { display: none; }
  .responsive-table, .responsive-table tbody, .responsive-table tr, .responsive-table td { display: block; width: 100%; }
  .responsive-table tr { margin-bottom: .75rem; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
  .responsive-table td { border: 0; padding: .25rem 0; text-align: left !important; }
  .responsive-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .responsive-table td.right .btn, .responsive-table td .cell-actions { margin-top: .5rem; justify-content: flex-start; }
  .admin-content table.responsive-table { display: block; overflow: visible; }
}

/* ---------- Employee: earnings & profile ---------- */
.payout-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem;
  border-radius: 20px;
  background: var(--primary);
  color: var(--on-dark);
}
.payout-hero .label { color: var(--on-dark-muted); }
.payout-amount { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; color: #fff; line-height: 1.1; margin: .1rem 0 .2rem; }
.profile-hero { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; padding: 1.5rem; border-radius: 20px; border: 1px solid var(--line); background: linear-gradient(135deg, var(--primary-soft) 0%, var(--surface) 70%); }
.profile-hero h2 { font-size: 1.4rem; margin: 0; }
.avatar-edit { position: relative; flex-shrink: 0; }
.avatar-xl { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--surface); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; }
.avatar-xl.is-initial { background: var(--primary); color: #fff; font-family: var(--font-display); font-size: 2rem; font-weight: 700; }
.avatar-edit-btn {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--primary-deep);
  border: 2px solid var(--surface);
  cursor: pointer;
}
.avatar-edit-btn:hover { background: var(--accent-hover); }
.avatar-edit-btn:focus-within { outline: 3px solid var(--slate); outline-offset: 2px; }

/* ---------- Case file views (employee & admin) ---------- */
.card-head h2 svg { display: inline-block; vertical-align: -2px; margin-right: .35rem; color: var(--primary); }
.doc-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 1.5rem; }
.doc-row .bubble-sm { width: 34px; height: 34px; border-radius: 9px; }
.doc-row .bubble-sm svg { width: 17px; height: 17px; }
.note-list { display: flex; flex-direction: column; gap: .6rem; }
.note-item { padding: .75rem .9rem; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line); border-left: 3px solid var(--accent); }
.note-item p { margin-bottom: .2rem; font-size: .93rem; color: var(--ink); white-space: pre-wrap; }
.copy-btn { width: 30px; height: 30px; }
.copy-btn svg { width: .95rem; height: .95rem; }
@media (max-width: 560px) { .doc-row { padding: .7rem 1.2rem; } }

/* ---------- Admin dashboard tiles ---------- */
.admin-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.admin-tile { display: flex; flex-direction: column; gap: .5rem; }
.admin-tile h3 { margin: .4rem 0 0; font-size: 1.08rem; }
.admin-tile p { font-size: .9rem; color: var(--muted); margin: 0; }
.admin-tile-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.admin-tile-count { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; line-height: 1; color: var(--ink); text-align: right; }
.admin-tile-count small { display: block; font-family: var(--font-body); font-size: .72rem; font-weight: 600; color: var(--muted); margin-top: .2rem; }
.cell-form { display: flex; align-items: center; gap: .4rem; min-width: 210px; }
.cell-form .control { flex: 1; min-width: 0; }
.toolbar.card { margin-bottom: 1.25rem; }
.filter-panel { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.filter-row { display: flex; align-items: flex-end; gap: .75rem; flex-wrap: wrap; }
.filter-row .field { margin-bottom: 0; }
.filter-row .field label { font-size: .8rem; }
.bulk-action { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.avatar-sm { width: 32px; height: 32px; font-size: .8rem; }
@media (max-width: 560px) { .bulk-action { align-items: stretch; } .filter-row .field { flex: 1 1 40%; } }
.star-toggle.is-on { color: var(--accent-hover); }
.star-toggle.is-on svg { fill: currentColor; }
.badge-button { border: 0; cursor: pointer; transition: box-shadow .15s ease; }
.badge-button:hover { box-shadow: inset 0 0 0 1.5px currentColor; }
.toolbar.card select.control { width: auto; }

/* ---------- Toggle switch ---------- */
.switch { position: relative; display: inline-flex; align-items: center; gap: .65rem; cursor: pointer; font-weight: 600; font-size: .93rem; color: var(--ink); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.switch-track { position: relative; width: 44px; height: 26px; border-radius: var(--radius-pill); background: var(--line-strong); transition: background .15s ease; flex-shrink: 0; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--slate); outline-offset: 2px; }
.admin-form { max-width: 900px; }

/* ---------- Rich text editor (Quill snow theme, loaded per page) ---------- */
.rich-editor { border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); transition: border-color .15s ease, box-shadow .15s ease; }
.rich-editor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(42, 157, 143, .25); }
.rich-editor .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--line); background: var(--bg); padding: 8px 10px; font-family: var(--font-body); }
.rich-editor .ql-container.ql-snow { border: 0; font-family: var(--font-body); font-size: .97rem; }
.rich-editor .ql-editor { min-height: 240px; padding: 1rem; color: var(--ink-soft); line-height: 1.7; }
.rich-editor .ql-editor h1, .rich-editor .ql-editor h2, .rich-editor .ql-editor h3 { font-family: var(--font-display); color: var(--ink); }
.rich-editor .ql-editor.ql-blank::before { color: var(--muted); font-style: normal; }
.rich-editor .ql-snow .ql-stroke { stroke: var(--ink-soft); }
.rich-editor .ql-snow .ql-fill { fill: var(--ink-soft); }
.rich-editor .ql-snow.ql-toolbar button:hover .ql-stroke, .rich-editor .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--primary); }
.rich-editor .ql-snow.ql-toolbar button:hover .ql-fill, .rich-editor .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--primary); }
.split-panels { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1.25rem; align-items: start; }
@media (max-width: 1100px) { .split-panels { grid-template-columns: 1fr; } }
.rich-editor-tall .ql-editor { min-height: 360px; }
.cover-thumb { width: 64px; height: 36px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); flex-shrink: 0; }
.cover-thumb-empty { display: inline-flex; align-items: center; justify-content: center; background: var(--bg); color: var(--muted); }
.cover-preview { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
@media (max-width: 980px) { .auth-art > img { padding: 1rem 1rem 4.5rem; } }
.admin-tile .badge { align-self: flex-start; }
