:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18263c;
  background: #f3f6fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --canvas: #f3f6fb;
  --paper: #fff;
  --navy: #172338;
  --navy-raised: #24324b;
  --ink: #18263c;
  --text: #33445d;
  --muted: #52647d;
  --subtle: #5e7089;
  --border: #dfe7f1;
  --control-border: #8496ad;
  --divider: #ebf0f6;
  --blue: #255bcc;
  --blue-strong: #1c4db4;
  --blue-soft: #eaf1ff;
  --shadow: 0 1px 2px rgb(23 35 56 / 5%);
  --sidebar-width: 244px;
  --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: var(--blue-strong); text-underline-offset: 3px; }
input, select, textarea { color: var(--ink); }
::placeholder { color: #697b94; opacity: 1; }
:focus-visible { outline: 3px solid #2e62cf; outline-offset: 3px; }
.sidebar :focus-visible { outline-color: #91b4ff; }
svg { display: block; flex-shrink: 0; }
h1, h2, h3, p { margin: 0; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: -1px;
  padding: 0;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.app-shell[aria-busy="true"], .entry-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  place-items: center;
  padding: 20px;
  background: radial-gradient(ellipse at top, #e6eeff 0, var(--canvas) 60%);
}

.app-shell[aria-busy="true"] > main, .entry-card {
  display: grid;
  width: min(100%, 460px);
  gap: 12px;
  padding: clamp(22px, 5vw, 33px);
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--paper);
  box-shadow: 0 12px 42px rgb(26 54 105 / 8%);
}

.entry-card h1, .app-shell[aria-busy="true"] h1 { color: var(--ink); font-size: clamp(24px, 4vw, 31px); font-weight: 750; letter-spacing: -.038em; line-height: 1.15; }
.entry-card p, .app-shell[aria-busy="true"] p { color: var(--muted); font-size: 13px; line-height: 1.55; }
.entry-card .brand-mark { margin-bottom: 4px; }
.entry-card > form { display: grid; gap: 12px; }
.entry-card form .form-grid { grid-template-columns: minmax(0, 1fr); }
.entry-card .button { justify-self: start; }
.entry-card .form-notice { margin-top: 1px; }

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  gap: 26px;
  overflow: auto;
  padding: 29px 15px 16px;
  background: var(--navy);
  color: #f7faff;
}

.brand {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 11px;
  margin: 0 8px 5px;
  color: inherit;
  text-align: left;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  width: 41px;
  height: 41px;
  flex: 0 0 41px;
  place-items: center;
  border: 1px solid #557be2;
  border-radius: 11px;
  background: #2e61ce;
  color: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 15%), 0 3px 8px rgb(6 15 36 / 20%);
  font-size: 17px;
  font-weight: 750;
}

.brand-mark svg { width: 22px; height: 22px; }
.brand-name, .brand-subtitle { display: block; }
.brand-name { font-size: 15px; font-weight: 725; letter-spacing: -.01em; line-height: 1.22; }
.brand-subtitle { margin-top: 4px; color: #a9b9d3; font-size: 11px; line-height: 1.35; }
.nav-label {
  margin: 0 10px 8px;
  color: #a9b9d3;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.4;
  text-transform: uppercase;
}

.nav-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.nav-list + .nav-label { margin-top: 24px; }
.nav-item {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #c4cfe2;
  font-size: 13.5px;
  font-weight: 580;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
}

.nav-item:hover { background: rgb(255 255 255 / 6%); color: #fff; }
.nav-item.is-active, .nav-item[aria-current="page"] {
  border-color: #3a578a;
  background: #263e67;
  color: #fff;
  font-weight: 660;
}

.nav-item.is-active::before, .nav-item[aria-current="page"]::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -2px;
  width: 3px;
  border-radius: 4px;
  background: #80a7ff;
  content: "";
}

.nav-icon, .nav-item > svg { width: 17px; height: 17px; flex: 0 0 17px; }
.nav-icon { display: grid; place-items: center; }
.nav-icon svg { width: 100%; height: 100%; }
.nav-item.is-active .nav-icon { color: #b6cbff; }
.sidebar-bottom { display: grid; gap: 15px; margin-top: auto; }
.demo-note {
  padding: 10px 11px;
  border: 1px solid #384863;
  border-radius: 8px;
  background: #1e2c44;
  color: #c4cfe2;
  font-size: 11.5px;
  line-height: 1.55;
}

.demo-note strong { color: #edf3ff; }
.identity {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 14px 3px 1px;
  border-top: 1px solid #384863;
}

.avatar {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid #45628e;
  border-radius: 50%;
  background: #314a77;
  color: #dce8ff;
  font-size: 11px;
  font-weight: 750;
}

.identity-copy { display: grid; min-width: 0; gap: 2px; }
.identity-copy > * { overflow: hidden; margin: 0; text-overflow: ellipsis; white-space: nowrap; }
.identity-copy strong { color: #f3f7ff; font-size: 12.5px; }
.identity-copy small, .identity-copy span { color: #afbed6; font-size: 11px; }
.identity .icon-button { margin-left: auto; border-color: transparent; background: transparent; color: #c4cfe2; }
.identity .icon-button:hover { background: var(--navy-raised); color: #fff; }

.main-shell { min-width: 0; }
.topbar {
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px clamp(22px, 3vw, 44px);
  border-bottom: 1px solid var(--border);
  background: var(--paper);
}

.crumb { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--subtle); font-size: 12.5px; }
.crumb strong, .crumb [aria-current] { color: var(--text); font-weight: 650; }
.crumb svg { width: 13px; height: 13px; }
.topbar .mobile-toggle { display: none; }
.top-actions, .heading-actions { display: flex; align-items: center; gap: 9px; }
.top-actions { justify-content: flex-end; }
.top-actions time, .top-actions > span { color: var(--muted); font-size: 12px; }
.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  text-decoration: none;
}

.icon-button:hover { border-color: #c4d4ee; background: #f2f6ff; color: var(--blue-strong); }
.icon-button svg { width: 17px; height: 17px; }
.main-content { max-width: 1720px; margin: 0 auto; padding: 33px clamp(22px, 3vw, 44px) 45px; }
.main-content > .alert { margin-bottom: 15px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-eyebrow {
  margin-bottom: 7px;
  color: var(--blue-strong);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.page-heading h1 { font-size: clamp(29px, 3.1vw, 43px); font-weight: 760; letter-spacing: -.045em; line-height: 1.09; }
.page-description { max-width: 60ch; margin-top: 9px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.heading-actions { flex-shrink: 0; flex-wrap: wrap; margin-bottom: 2px; }
.button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--paper);
  color: var(--text);
  font-size: 13px;
  font-weight: 660;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}

.button svg { width: 16px; height: 16px; }
.button:hover { border-color: #bccfec; background: #f7faff; color: var(--blue-strong); }
.button.primary { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgb(31 71 154 / 24%); }
.button.primary:hover { border-color: var(--blue-strong); background: var(--blue-strong); }
.button.secondary { border-color: #cdd9e9; }
.button.quiet { border-color: transparent; background: transparent; }
.button.danger { border-color: #f1d5da; background: #fff6f6; color: #a42339; }
.button.danger:hover { border-color: #e7b8c0; background: #ffecef; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 24px; }
.metric {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 116px;
  align-content: start;
  justify-items: start;
  gap: 3px;
  padding: 15px 14px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: left;
}

.metric:hover { border-color: #a8c0e8; background: #fbfcff; }
.metric-icon {
  position: absolute;
  top: 13px;
  right: 13px;
  display: inline-grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.metric-icon svg { width: 17px; height: 17px; }
.metric-icon.green { background: #e6f5ed; color: #146241; }
.metric-icon.violet { background: #f0ebff; color: #6444ad; }
.metric-icon.amber { background: #fff1d8; color: #89600a; }
.metric-icon.gray { background: #edf1f6; color: #52627a; }
.metric-icon.red { background: #fdebee; color: #9d2d43; }
.metric-label { padding-right: 39px; color: var(--muted); font-size: 12px; font-weight: 620; line-height: 1.35; }
.metric-value { color: var(--ink); font-size: 32px; font-variant-numeric: tabular-nums; font-weight: 750; letter-spacing: -.045em; line-height: 1.16; }
.metric-caption { color: var(--subtle); font-size: 11.5px; line-height: 1.4; }

.panel { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 19px 19px 14px; }
.panel-title { color: var(--ink); font-size: 18px; font-weight: 735; letter-spacing: -.022em; line-height: 1.27; }
.panel-caption { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.tabs { display: flex; gap: 18px; overflow-x: auto; border-bottom: 1px solid var(--divider); padding: 0 18px; }
.tab {
  position: relative;
  display: inline-flex;
  min-height: 41px;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 8px 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 620;
  white-space: nowrap;
}

.tab:hover, .tab.is-active, .tab[aria-selected="true"] { color: var(--blue-strong); }
.tab.is-active, .tab[aria-selected="true"] { border-bottom-color: var(--blue); font-weight: 710; }
.tab:focus-visible { outline-offset: -3px; }
.tab .badge { padding-right: 6px; padding-left: 6px; }
.toolbar, .toolbar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px; }
.toolbar { padding: 12px 18px; }
.search-field { position: relative; display: flex; min-width: min(245px, 100%); align-items: center; }
.search-field svg { position: absolute; left: 10px; width: 16px; height: 16px; color: var(--subtle); pointer-events: none; }
.search-field input { width: 100%; padding-left: 34px; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.search-field input, .filter-field select, select.filter-field, .filter-field input, input.filter-field,
.field input, .field select, .field textarea {
  min-height: 37px;
  padding: 7px 10px;
  border: 1px solid var(--control-border);
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
  line-height: 1.4;
}

.search-field input { padding-left: 34px; }
.field select, .filter-field select, select.filter-field { padding-right: 25px; }
.filter-field { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.filter-field select { min-width: 104px; }
.field input:hover, .field textarea:hover, .field select:hover, .filter-field select:hover, select.filter-field:hover, .search-field input:hover { border-color: #607ca3; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .search-field input:focus-visible { outline-offset: 1px; }
.field [aria-invalid="true"], .field [aria-invalid="true"]:hover { border-color: #ba3850; background: #fff7f8; }
.table-scroll { min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; }
.events-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 12.5px; text-align: left; }
.events-table th {
  padding: 10px 12px;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  background: #f5f8fd;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 730;
  letter-spacing: .04em;
  line-height: 1.4;
  text-transform: uppercase;
  white-space: nowrap;
}

.events-table td { padding: 12px; border-bottom: 1px solid var(--divider); color: var(--text); line-height: 1.38; vertical-align: middle; }
.events-table tr > :first-child { padding-left: 18px; }
.events-table tr > :last-child { padding-right: 18px; }
.events-table tbody tr:last-child td { border-bottom: 0; }
.events-table tbody tr:hover { background: #f8faff; }
.events-table tr[data-id], .events-table tr[data-event], .events-table tr[data-open-event] { cursor: pointer; }
.event-name { color: var(--ink); font-size: 13px; font-weight: 710; line-height: 1.4; }
button.event-name { display: block; padding: 0; border: 0; background: transparent; text-align: left; }
a.event-name { text-decoration: none; }
button.event-name:hover, a.event-name:hover { color: var(--blue-strong); text-decoration: underline; text-underline-offset: 3px; }
.event-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 11.5px; line-height: 1.42; }
.event-sub:empty { display: none; }
.date-cell { width: 110px; min-width: 92px; white-space: nowrap; }
.date-main { display: block; color: var(--ink); font-weight: 690; font-variant-numeric: tabular-nums; }
.date-sub { display: block; margin-top: 3px; color: var(--subtle); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.attendance { min-width: 82px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.attendance .date-sub { display: inline; margin: 0; }
.row-open { width: 29px; height: 29px; border-color: transparent; }
.row-open svg { width: 14px; height: 14px; }
.badge, .support-chip {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 5px;
  background: #eef2f7;
  color: #52627a;
  font-size: 10.5px;
  font-weight: 680;
  line-height: 1.15;
  vertical-align: middle;
}

.badge svg, .support-chip svg { width: 12px; height: 12px; }
.badge.blue, .support-chip.blue { background: #e9f0ff; color: #224eaa; }
.badge.green, .support-chip.green { background: #e5f5eb; color: #176243; }
.badge.amber, .support-chip.amber { background: #fff0d5; color: #775107; }
.badge.gray, .support-chip.gray { background: #edf1f6; color: #4c5f78; }
.badge.red, .support-chip.red { background: #fdebef; color: #a0233d; }
.badge.violet, .support-chip.violet { background: #f0ebff; color: #6343a5; }
.support-chip { margin: 2px 3px 2px 0; }
.table-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 11px 18px; border-top: 1px solid var(--divider); color: var(--muted); font-size: 11.5px; }
.empty-state { display: grid; min-height: 180px; align-content: center; justify-items: center; gap: 8px; padding: 22px; color: var(--muted); font-size: 13px; text-align: center; }
.empty-state strong, .empty-state h3 { color: var(--ink); font-size: 16px; font-weight: 710; }
.empty-state > svg { width: 28px; height: 28px; margin-bottom: 2px; color: #7295d9; }
.alert, .form-notice { padding: 10px 12px; border: 1px solid #d3e1fd; border-radius: 8px; background: #f1f6ff; color: #285193; font-size: 12.5px; line-height: 1.5; }
.alert.error, .form-notice.error, .alert[role="alert"], .form-notice[role="alert"] { border-color: #f2cbd2; background: #fff0f2; color: #8c2035; }
.alert.success { border-color: #bfe5cb; background: #eefbf2; color: #206144; }
.alert:empty, .form-notice:empty { display: none; }

.calendar-scroll { min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; }
.calendar-grid { display: grid; min-width: 570px; grid-template-columns: repeat(7, minmax(0, 1fr)); isolation: isolate; border-top: 1px solid var(--divider); border-left: 1px solid var(--divider); }
.calendar-grid:has(.calendar-day) { overflow: hidden; }
.calendar-grid > .calendar-weekday, .calendar-grid > .weekday { padding: 8px 6px; border-right: 1px solid var(--divider); border-bottom: 1px solid var(--divider); background: #f5f8fd; color: var(--muted); font-size: 11px; font-weight: 650; text-align: center; }
.calendar-day { display: flex; min-width: 0; min-height: 102px; flex-direction: column; gap: 4px; padding: 7px; border-right: 1px solid var(--divider); border-bottom: 1px solid var(--divider); color: var(--text); font-size: 12px; }
.calendar-day.is-outside, .calendar-day.outside, .calendar-day.muted { background: #f8fafd; color: var(--subtle); }
.calendar-day.is-today, .calendar-day.today { background: #f0f5ff; }
.calendar-date { display: inline-grid; align-self: start; min-width: 22px; min-height: 22px; place-items: center; border-radius: 6px; font-variant-numeric: tabular-nums; font-weight: 690; }
.calendar-day.is-today > .calendar-date { background: var(--blue); color: #fff; }
.calendar-event { width: 100%; overflow: hidden; padding: 5px 6px; border: 1px solid #d6e4ff; border-radius: 5px; background: #edf4ff; color: #244eaa; font-size: 11px; font-weight: 650; line-height: 1.35; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event:hover { background: #e0ebff; }
.calendar-event:is(.completed, .partial) { border-color: #cce6d8; background: #eaf6ef; color: #176243; }
.calendar-event:is(.cancelled, .postponed) { border-color: #f2dfbd; background: #fff4df; color: #775107; }
.month-title::first-letter { text-transform: uppercase; }
.inline-list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.stack { display: grid; align-content: start; gap: 12px; }
.breakdown { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }

.card-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgb(15 27 48 / 45%);
}

body:has(.card-backdrop) { overflow: hidden; }
.card-drawer {
  position: relative;
  display: flex;
  width: min(100%, 760px);
  height: 100%;
  min-height: 0;
  flex-direction: column;
  background: var(--paper);
  box-shadow: -12px 0 42px rgb(12 27 59 / 16%);
}

.drawer-kicker { margin-bottom: 4px; color: var(--blue-strong); font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.drawer-head {
  display: flex;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 13px;
  padding: 19px 21px;
  border-bottom: 1px solid var(--border);
}

.drawer-head > div { min-width: 0; }
.drawer-head h2 { font-size: clamp(22px, 3vw, 29px); font-weight: 750; letter-spacing: -.033em; line-height: 1.16; overflow-wrap: anywhere; }
.drawer-head p:not(.page-eyebrow) { margin-top: 5px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.drawer-content { min-height: 0; flex: 1 1 auto; overflow: auto; overscroll-behavior: contain; padding: 8px 21px 21px; }
.admin-form { display: flex; min-height: 0; flex: 1; flex-direction: column; }
.admin-form .form-notice { margin-top: 12px; }
.card-tabs { flex: 0 0 auto; gap: 15px; padding: 0 21px; }
.card-tab-content { min-width: 0; }
.card-tab-content > .alert, .card-tab-content > .form-notice { margin-top: 10px; }
.drawer-footer {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  padding: 12px 21px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: #fff;
}

.form-section { min-width: 0; margin: 0; padding: 17px 0; border: 0; border-bottom: 1px solid var(--divider); }
.form-section:last-child { border-bottom: 0; }
.form-section > h3, .form-section legend, .form-section summary { color: var(--ink); font-size: 15px; font-weight: 710; line-height: 1.4; }
.form-section summary { cursor: pointer; }
.form-section:not([open]):is(details) { padding-bottom: 15px; }
.drawer-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.subsection-title { color: var(--ink); font-size: 13px; font-weight: 720; line-height: 1.4; }
.card-optional > summary { width: fit-content; }
.support-request, .criteria-row {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f9fbff;
}

.support-request > header > h3 { color: var(--ink); font-size: 14px; line-height: 1.4; }
.support-request + .support-request { margin-top: 8px; }
.support-request > .form-grid, .criteria-row > .form-grid, .criteria-row > .detail-grid { margin: 0; }
.criteria-row > button { justify-self: start; }
.form-section [data-criteria] + button { margin-top: 9px; }
.drawer-footer > .form-notice { width: 100%; }
.history-meta { margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.section-desc { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.form-grid, .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 11px; }
.field, .detail-item { display: grid; min-width: 0; align-content: start; gap: 5px; }
.field { color: var(--text); font-size: 12.5px; font-weight: 640; line-height: 1.35; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; font-weight: 400; }
.field textarea { min-height: 74px; resize: vertical; }
.field small { color: var(--muted); font-size: 11.5px; font-weight: 400; line-height: 1.45; }
fieldset.field { padding: 8px 11px; border: 1px solid var(--border); border-radius: 7px; }
fieldset.field legend { padding: 0 4px; }
.span-2 { grid-column: 1 / -1; }
.detail-item dt, .detail-item > span:first-child { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.detail-item dd, .detail-item strong { margin: 0; color: var(--ink); font-size: 13px; font-weight: 630; line-height: 1.45; overflow-wrap: anywhere; }
.detail-item p { color: var(--text); font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.check-field { display: flex; min-height: 34px; align-items: center; gap: 7px; color: var(--text); font-size: 13px; line-height: 1.4; }
.check-field input { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: var(--blue); }
.history-list { display: grid; gap: 8px; padding-left: 19px; color: var(--text); font-size: 12.5px; line-height: 1.55; }
.history-list time, .history-list small { color: var(--muted); }

@media (max-width: 1180px) {
  :root { --sidebar-width: 209px; }
  .metric-label { min-height: 31px; }
  .topbar, .main-content { padding-right: 23px; padding-left: 23px; }
}

@media (max-width: 880px) {
  :root { --sidebar-width: 171px; }
  .sidebar { gap: 19px; padding-right: 9px; padding-left: 9px; }
  .brand { gap: 8px; margin-right: 4px; margin-left: 4px; }
  .brand-mark { width: 35px; height: 35px; flex-basis: 35px; }
  .brand-name { font-size: 13.5px; }
  .brand-subtitle { font-size: 10px; }
  .nav-item { gap: 7px; padding-right: 6px; padding-left: 7px; font-size: 12.5px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric { min-height: 91px; }
  .metric-label { min-height: 0; }
  .page-heading { align-items: flex-start; }
  .page-description { font-size: 13px; }
}

@media (max-width: 650px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); align-content: start; }
  .main-shell { display: contents; }
  .sidebar { position: relative; display: none; height: auto; grid-row: 2; gap: 10px; padding: 10px 11px; }
  .sidebar.is-open { display: flex; }
  .sidebar nav { display: grid; gap: 3px; }
  .brand { max-width: calc(100% - 76px); min-height: 33px; margin-bottom: 0; }
  .brand-mark { width: 32px; height: 32px; flex-basis: 32px; border-radius: 8px; }
  .brand-mark svg { width: 18px; height: 18px; }
  .brand-subtitle { margin-top: 2px; }
  .nav-label { display: none; }
  .nav-list { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-item { width: auto; min-height: 36px; flex-shrink: 0; padding-right: 8px; padding-left: 8px; white-space: nowrap; }
  .nav-item.is-active::before, .nav-item[aria-current="page"]::before { top: 8px; bottom: 8px; }
  .nav-icon, .nav-item > svg { width: 14px; height: 14px; flex-basis: 14px; }
  .sidebar-bottom { position: absolute; top: 10px; right: 11px; margin: 0; }
  .sidebar-bottom .demo-note, .sidebar-bottom .identity-copy { display: none; }
  .sidebar-bottom .identity { min-height: 33px; gap: 5px; padding: 0; border: 0; }
  .sidebar-bottom .avatar, .sidebar-bottom .icon-button { width: 30px; height: 30px; flex-basis: 30px; }
  .topbar { min-height: 48px; grid-row: 1; gap: 7px; padding: 6px 12px; }
  .topbar .mobile-toggle { display: inline-grid; width: 33px; height: 33px; }
  .mobile-toggle svg { width: 16px; height: 16px; }
  .crumb > span, .crumb > svg { display: none; }
  .top-actions { gap: 5px; }
  .top-actions time, .top-actions > span { display: none; }
  .top-actions > .badge { display: inline-flex; }
  .main-content { width: 100%; min-width: 0; grid-row: 3; padding: 20px 11px 24px; }
  .page-heading { flex-wrap: wrap; gap: 12px; margin-bottom: 15px; }
  .page-heading h1 { font-size: 30px; }
  .page-eyebrow { margin-bottom: 4px; }
  .page-description { margin-top: 6px; }
  .metrics { margin-bottom: 15px; }
  .metric { min-height: 96px; padding: 10px; }
  .metric-icon { top: 9px; right: 9px; width: 28px; height: 28px; }
  .metric-icon svg { width: 14px; height: 14px; }
  .metric-label { padding-right: 27px; font-size: 11px; }
  .metric-value { font-size: 27px; }
  .metric-caption { font-size: 10.5px; }
  .panel-heading { padding: 13px 12px 8px; }
  .panel-title { font-size: 16px; }
  .tabs { gap: 13px; padding: 0 11px; }
  .tab { min-height: 37px; }
  .toolbar { padding: 9px 10px; }
  .search-field { width: 100%; }
  .filters { width: 100%; }
  .filter-field select { min-width: 0; max-width: 100%; }
  .table-footer { padding: 10px 12px; }
  .events-table:has(.empty-state) { min-width: 100%; }
  .events-table:has(.empty-state) thead { display: none; }
  .calendar-day { min-height: 70px; padding: 3px; }
  .calendar-event { padding: 3px; font-size: 10px; }
  .drawer-head { padding: 13px 12px; }
  .card-tabs { gap: 12px; padding-right: 12px; padding-left: 12px; }
  .drawer-content { padding: 5px 12px 13px; }
  .drawer-footer { justify-content: flex-start; padding-right: 12px; padding-left: 12px; }
}

@media (max-width: 380px) {
  .form-grid, .detail-grid, .breakdown { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: no-preference) {
  .button, .icon-button, .nav-item, .tab { transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease; }
}

.intake-shell {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  justify-items: center;
  align-items: start;
  padding: clamp(10px, 4vw, 32px);
  background: radial-gradient(ellipse at top, #e6eeff 0, var(--canvas) 60%);
}

.intake-status { align-self: center; }
.intake-mount { width: min(100%, 840px); }
.intake-card {
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--paper);
  box-shadow: 0 12px 42px rgb(26 54 105 / 8%);
}
.intake-heading { align-items: center; justify-content: flex-start; }
.intake-heading h1 { font-size: clamp(22px, 4vw, 30px); letter-spacing: -.035em; line-height: 1.16; }
.intake-card .drawer-content { overflow: visible; }
.intake-card [aria-invalid="true"] { border-color: #ad3547; }
.intake-card .drawer-footer {
  position: sticky;
  bottom: 0;
  z-index: 1;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 -4px 11px rgb(23 35 56 / 4%);
}

@media (max-width: 560px) {
  .intake-card .drawer-footer .primary { width: 100%; }
}
