/* College Data Tool, Pedroso Consulting.
   Structure follows Control Panel's dashboard (top bar, header strip with one sentence,
   two columns on desktop, inset lists, cards, pill buttons, quiet secondary buttons).
   Tokens come from pedroso-consulting.com (src/styles/globals.css).
   Colour rules: ocean blue is the only interactive colour. One success tone, one error tone.
   Gold is decoration only (the short rule on the sign-in card). */

:root {
  color-scheme: light;
  --color-bg: oklch(0.972 0.013 84);
  --color-bg-sunken: oklch(0.946 0.016 80);
  --color-surface: oklch(0.993 0.007 85);
  --color-surface-2: oklch(0.962 0.012 82);
  --color-ink: oklch(0.27 0.021 56);
  --color-ink-soft: oklch(0.38 0.02 55);
  --color-muted: oklch(0.458 0.018 58);
  --color-line: oklch(0.885 0.012 80);
  --color-line-strong: oklch(0.82 0.014 78);
  --color-primary: oklch(0.47 0.085 237);
  --color-primary-hover: oklch(0.41 0.082 237);
  --color-primary-ink: oklch(0.42 0.082 237);
  --color-primary-soft: oklch(0.935 0.03 237);
  --color-primary-soft-edge: oklch(0.88 0.04 237);
  --color-on-primary: oklch(0.99 0.006 85);
  --color-gold: oklch(0.755 0.092 74);
  --color-terracotta: oklch(0.58 0.105 46);
  --color-error-text: oklch(0.52 0.12 42);
  --color-error-soft: oklch(0.95 0.025 46);
  /* The one success tone: a quiet green that clears AA as text on the canvas. */
  --color-success: oklch(0.5 0.09 150);
  --color-success-soft: oklch(0.95 0.03 150);

  --font-display: "Lora", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --text-xs: 0.8125rem;
  --text-sm: 0.9375rem;
  --text-base: 1.0625rem;
  --text-lg: 1.1875rem;
  --text-xl: 1.375rem;
  --text-2xl: clamp(1.5rem, 1.1rem + 1.6vw, 2rem);

  --radius-sm: 0.625rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(58, 44, 28, 0.05), 0 1px 3px rgba(58, 44, 28, 0.06);
  --shadow-md: 0 10px 28px -14px rgba(58, 44, 28, 0.22);
  --ring: 0 0 0 3px var(--color-bg), 0 0 0 5.5px var(--color-primary);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --dur-fast: 160ms;
  --dur: 220ms;
  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2rem);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--color-primary-ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--color-ink);
  text-wrap: balance;
}
p { text-wrap: pretty; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--radius-sm); }

.skip-link {
  position: fixed; top: 12px; left: 12px; z-index: 300;
  padding: 10px 20px; border-radius: var(--radius-pill);
  background: var(--color-primary); color: var(--color-on-primary); font-weight: 700; text-decoration: none;
}
.skip-link:not(:focus-visible) { clip-path: inset(50%); width: 1px; height: 1px; padding: 0; overflow: hidden; white-space: nowrap; }

/* ---------- Top bar ---------- */
.bar-top {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 12px 20px;
  padding: 12px var(--gutter);
  background: color-mix(in oklch, var(--color-bg) 92%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-line);
}
.brand { display: flex; flex-direction: column; gap: 0; min-width: 0; text-decoration: none; color: var(--color-ink); border-radius: var(--radius-sm); }
.brand-firm { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 500; line-height: 1.2; }
.brand-product { font-size: var(--text-xs); color: var(--color-muted); font-weight: 700; line-height: 1.3; }
.bar-account { display: flex; align-items: center; gap: 12px; min-width: 0; }
.identity { font-size: var(--text-sm); color: var(--color-ink-soft); text-align: right; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }
.identity .role { display: block; font-size: var(--text-xs); color: var(--color-muted); }

/* ---------- Notice ---------- */
.notice {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 200;
  transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px);
  padding: 12px 20px; border-radius: var(--radius-pill);
  background: var(--color-ink); color: var(--color-on-primary);
  font-size: var(--text-sm); box-shadow: var(--shadow-md);
}
.notice.is-error { background: var(--color-error-soft); color: var(--color-error-text); border: 1px solid var(--color-terracotta); }
.notice:empty { display: none; }

/* ---------- Buttons: pill primary, pill secondary, quiet ---------- */
.btn-primary, .btn-secondary, .btn-quiet {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: var(--radius-pill);
  font-weight: 700; font-size: var(--text-sm); line-height: 1.2; text-decoration: none;
  cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.btn-primary { border: 0; background: var(--color-primary); color: var(--color-on-primary); box-shadow: var(--shadow-sm); }
.btn-secondary { border: 1px solid var(--color-primary-soft-edge); background: var(--color-surface); color: var(--color-primary-ink); }
.btn-quiet { border: 1px solid var(--color-line-strong); background: transparent; color: var(--color-ink-soft); font-weight: 400; }
.btn-small { min-height: 44px; padding: 0 16px; }
.btn-block { width: 100%; }
.btn-primary:active, .btn-secondary:active, .btn-quiet:active { transform: scale(0.97); }
.btn-primary:disabled, .btn-secondary:disabled, .btn-quiet:disabled { opacity: 0.55; cursor: default; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:not(:disabled):hover { background: var(--color-primary-hover); }
  .btn-secondary:not(:disabled):hover { background: var(--color-primary-soft); }
  .btn-quiet:not(:disabled):hover { border-color: var(--color-muted); color: var(--color-ink); }
}
.link-quiet { font-size: var(--text-sm); }

/* ---------- Fields ---------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: var(--text-sm); font-weight: 700; color: var(--color-ink-soft); min-width: 0; }
.field-hint { font-weight: 400; color: var(--color-muted); font-size: var(--text-xs); margin-top: -4px; }
input:not([type="checkbox"]), select {
  width: 100%; min-height: 46px; padding: 10px 14px;
  border: 1px solid var(--color-line-strong); border-radius: var(--radius-sm);
  background: var(--color-surface); color: var(--color-ink); font-weight: 400; font-size: var(--text-base);
  transition: border-color var(--dur-fast) var(--ease-out);
}
select {
  appearance: none; padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--color-muted) 50%), linear-gradient(135deg, var(--color-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 52%, calc(100% - 15px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
input:focus-visible, select:focus-visible { border-color: var(--color-primary); box-shadow: 0 0 0 3px var(--color-primary-soft); border-radius: var(--radius-sm); }
input[readonly] { background: var(--color-surface-2); }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Sign-in and invite ---------- */
.gate { min-height: calc(100dvh - 72px); display: grid; place-items: center; padding: 32px var(--gutter) 64px; }
body:has(.gate:not([hidden])) .bar-top { display: none; }
body:has(.gate:not([hidden])) .gate { min-height: 100dvh; }
.gate-card {
  width: min(100%, 26rem);
  padding: clamp(28px, 6vw, 40px);
  background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.gate-firm { display: flex; align-items: center; gap: 10px; font-size: var(--text-sm); font-weight: 700; color: var(--color-ink-soft); }
.gate-firm::before { content: ""; width: 1.5rem; height: 2px; border-radius: 2px; background: var(--color-gold); }
.gate-title { margin-top: 10px; font-size: var(--text-2xl); }
.gate-lede { margin: 8px 0 24px; color: var(--color-ink-soft); font-size: var(--text-base); line-height: 1.5; }
.gate-foot { margin-top: 20px; font-size: var(--text-sm); color: var(--color-muted); }

/* ---------- Workspace frame: sidebar on desktop, pill row on phones ---------- */
.workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px var(--gutter) 96px; max-width: 80rem; margin: 0 auto; }
.nav {
  display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  padding: 4px; margin: 0 calc(-1 * var(--gutter)); padding-inline: var(--gutter);
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border-radius: var(--radius-pill); font-size: var(--text-sm); color: var(--color-ink-soft); text-decoration: none;
  border: 1px solid transparent;
}
.nav a[aria-current="page"] { background: var(--color-surface); border-color: var(--color-line); color: var(--color-ink); font-weight: 700; box-shadow: var(--shadow-sm); }
@media (hover: hover) and (pointer: fine) { .nav a:not([aria-current="page"]):hover { color: var(--color-primary-ink); } }
@media (min-width: 900px) {
  .workspace { grid-template-columns: 200px minmax(0, 1fr); gap: 32px; padding-top: 24px; }
  .nav { flex-direction: column; position: sticky; top: 88px; align-self: start; margin: 0; padding: 0; overflow: visible; }
  .nav a { border-radius: var(--radius-md); }
}

/* ---------- View header strip ---------- */
.view-head { display: flex; flex-direction: column; gap: 6px; padding: 12px 2px 4px; }
.view-head h2 { font-size: var(--text-2xl); }
.view-sentence { font-size: var(--text-base); color: var(--color-ink-soft); max-width: 60ch; font-variant-numeric: tabular-nums; }
.view-sentence:empty { display: none; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 20px; }
.col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (min-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
  .layout-team { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
}

/* ---------- Cards and inset lists ---------- */
.card {
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
  padding: clamp(18px, 3vw, 24px);
  background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.card-head h3 { font-size: var(--text-xl); }
.note { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.55; }
.status-line { font-size: var(--text-sm); color: var(--color-ink-soft); }
.status-line:empty { display: none; }

.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 2px 12px; }
.group-head h3 { font-size: var(--text-lg); }
.group-head .count { font-size: var(--text-xs); color: var(--color-muted); }

.list-inset {
  list-style: none; padding: 0;
  background: var(--color-surface); border: 1px solid var(--color-line); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.list-inset > .row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px;
  min-height: 64px; padding: 14px 20px; width: 100%;
  border: 0; background: none; text-align: left; color: inherit; text-decoration: none; font: inherit;
}
.list-inset > .row + .row { border-top: 1px solid var(--color-line); }
.list-inset > button.row, .list-inset > a.row { cursor: pointer; transition: background-color var(--dur-fast) var(--ease-out); }
.list-inset > button.row:focus-visible, .list-inset > a.row:focus-visible { box-shadow: inset 0 0 0 3px var(--color-primary); border-radius: 0; }
.list-inset > .row[aria-current="true"] { background: var(--color-primary-soft); }
@media (hover: hover) and (pointer: fine) {
  .list-inset > button.row:hover, .list-inset > a.row:hover { background: var(--color-surface-2); }
  .list-inset > .row[aria-current="true"]:hover { background: var(--color-primary-soft); }
}
.row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-title { font-weight: 700; font-size: var(--text-base); line-height: 1.35; overflow-wrap: anywhere; }
button.row .row-title, a.row .row-title { color: var(--color-primary-ink); }
.row-sub { font-size: var(--text-sm); color: var(--color-muted); line-height: 1.4; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.row-error { grid-column: 1 / -1; font-size: var(--text-sm); color: var(--color-error-text); overflow-wrap: anywhere; }
.empty { padding: 20px; font-size: var(--text-sm); color: var(--color-muted); }

/* Status: the word carries the meaning, the dot only helps scanning. */
.status { font-family: var(--font-body); letter-spacing: 0; vertical-align: middle; display: inline-flex; align-items: center; gap: 7px; font-size: var(--text-sm); font-weight: 700; color: var(--color-ink-soft); white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--color-line-strong); }
.status.is-done, .status.is-active { color: var(--color-success); }
.status.is-done::before, .status.is-active::before { background: var(--color-success); }
.status.is-failed { color: var(--color-error-text); }
.status.is-failed::before { background: var(--color-error-text); }
.status.is-running::before { background: transparent; box-shadow: inset 0 0 0 2px var(--color-ink-soft); animation: pulse 1.2s var(--ease-out) infinite alternate; }
.status.is-disabled { color: var(--color-muted); font-weight: 400; }
.status.is-disabled::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--color-muted); }
.status.is-inactive { font-weight: 400; }
@keyframes pulse { to { opacity: 0.35; } }

/* ---------- Overview ---------- */
.latest { display: flex; flex-direction: column; gap: 16px; }
.latest-name { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.25; overflow-wrap: anywhere; }
.latest-facts { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 0; font-size: var(--text-sm); color: var(--color-ink-soft); font-variant-numeric: tabular-nums; }
.latest-facts div { display: flex; gap: 6px; }
.latest-facts dt { color: var(--color-muted); }
.latest-facts dd { margin: 0; font-weight: 700; }
.file-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.file-actions:empty { display: none; }
.file-actions .btn-primary, .file-actions .btn-secondary { flex: 1 1 12rem; }
.pull-form { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.pull-form .field { flex: 1 1 14rem; }
.pull-form .btn-primary { flex: 0 0 auto; }

.sharing-head label { cursor: pointer; }
.switch {
  appearance: none; flex: none; position: relative; width: 52px; height: 32px; margin: 0;
  border-radius: var(--radius-pill); background: var(--color-line-strong); cursor: pointer;
  transition: background-color var(--dur) var(--ease-out);
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--color-surface); box-shadow: 0 1px 3px rgba(58, 44, 28, 0.3);
  transition: transform var(--dur) var(--ease-out);
}
.switch:checked { background: var(--color-primary); }
.switch:checked::after { transform: translateX(20px); }
.switch:disabled { opacity: 0.55; cursor: default; }
.switch:focus-visible { border-radius: var(--radius-pill); }
.sharing-state { font-weight: 700; color: var(--color-ink); }

/* ---------- Pull log ---------- */
.pull-list { margin-top: 20px; }
.detail { margin-top: 20px; }
.detail:focus { outline: none; }
.detail:focus-visible { box-shadow: var(--ring); border-radius: var(--radius-lg); }
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.detail-title-block { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.detail-title-block h3 { font-size: var(--text-xl); overflow-wrap: anywhere; }
.detail-data { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.detail-meta-line { font-size: var(--text-sm); color: var(--color-ink-soft); }
.detail-meta-line:first-child { font-weight: 700; color: var(--color-ink); }
.detail-empty { font-size: var(--text-sm); color: var(--color-muted); }
.detail-empty.is-error { color: var(--color-error-text); }

/* The table scrolls inside its own frame so the page never scrolls sideways. */
.table-frame {
  margin-top: 8px; max-height: 70vh; overflow: auto; overscroll-behavior-x: contain;
  border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--color-surface);
}
.table-frame:focus-visible { border-radius: var(--radius-md); }
.data-table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--color-line); max-width: 22rem; overflow-wrap: anywhere; }
.data-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--color-bg-sunken); color: var(--color-ink); font-weight: 700; white-space: nowrap; max-width: none;
}
.data-table tbody th, .data-table thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--color-surface); font-weight: 700; min-width: 12rem; box-shadow: 1px 0 0 var(--color-line); }
.data-table thead th:first-child { z-index: 3; background: var(--color-bg-sunken); }
.data-table td.is-number { text-align: right; }
.data-table tbody tr:last-child > * { border-bottom: 0; }
.data-table tbody tr:nth-child(even) td { background: color-mix(in oklch, var(--color-surface-2) 55%, var(--color-surface)); }
.table-caption { font-size: var(--text-xs); color: var(--color-muted); margin-top: 6px; }

/* ---------- Perkins Core Indicators (Hartnell layout) ----------
   The four cell fills are the report's own colours, kept exact so the screen matches the Word file. */
.perkins { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.pk-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: thin; padding: 2px; }
.pk-tab {
  flex: none; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill);
  border: 1px solid var(--color-line-strong); background: var(--color-surface); color: var(--color-ink-soft);
  font-size: var(--text-sm); cursor: pointer; white-space: nowrap;
}
.pk-tab[aria-selected="true"] { background: var(--color-primary); border-color: var(--color-primary); color: var(--color-on-primary); font-weight: 700; }
.pk-tab.is-failed { color: var(--color-error-text); border-color: var(--color-terracotta); }
.pk-tab.is-failed[aria-selected="true"] { background: var(--color-error-soft); color: var(--color-error-text); }
@media (hover: hover) and (pointer: fine) { .pk-tab:not([aria-selected="true"]):hover { border-color: var(--color-primary); color: var(--color-primary-ink); } }
.pk-panel { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pk-title, .pk-lmi h4 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-lg); line-height: 1.25; }
.perkins-frame { max-height: none; }
.perkins-grid { border-collapse: collapse; width: max-content; min-width: 100%; font-size: var(--text-xs); font-variant-numeric: tabular-nums; color: #000; background: #fff; }
.perkins-grid th, .perkins-grid td { border: 1px solid #a6a6a6; padding: 5px 6px; text-align: center; vertical-align: middle; font-weight: 400; }
.perkins-grid .pk-label { text-align: left; min-width: 19rem; position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 1px 0 0 #a6a6a6; }
.perkins-grid .pk-year { font-weight: 700; min-width: 3.4rem; }
.perkins-grid .pk-split { border-left: 2px solid #595959; }
.perkins-grid .pk-band th { background: #d9d9d9; font-weight: 700; font-size: var(--text-sm); padding: 7px 6px; }
.perkins-grid .pk-goal td, .perkins-grid .pk-goal th { font-weight: 700; }
.perkins-grid sup { font-size: 0.7em; line-height: 0; margin-left: 1px; }
.tone-exceeding { background: #196b24; color: #fff; }
.tone-meeting { background: #8ed973; }
.tone-below { background: #f2aa84; }
.tone-gap { background: #c04f15; color: #fff; }
.perkins-grid td.tone-none { font-size: var(--text-sm); color: #404040; }
.perkins-grid td.tone-na { color: #404040; }
.lmi-grid .pk-label { min-width: 22rem; }
.lmi-grid .pk-year { min-width: 5.5rem; }
.pk-notes { display: flex; flex-direction: column; gap: 8px; font-size: var(--text-xs); color: var(--color-ink-soft); }
.pk-legend { list-style: none; padding: 0; display: grid; gap: 4px; }
.pk-legend li { display: flex; align-items: center; gap: 10px; }
.pk-swatch { flex: none; width: 1.75rem; height: 1rem; border: 1px solid #a6a6a6; }
.pk-footnotes { padding-left: 1.2rem; display: grid; gap: 2px; }
.pk-footnote { font-size: var(--text-xs); color: var(--color-ink-soft); }
.pk-source { font-size: var(--text-xs); color: var(--color-muted); font-style: italic; }
.pk-lmi { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--color-line); }

/* ---------- Pull steps and the raw data sheet, both collapsible ---------- */
.steps-log, .sheet-toggle { border: 1px solid var(--color-line); border-radius: var(--radius-md); background: var(--color-surface); margin-top: 8px; }
.steps-log > summary, .sheet-toggle > summary {
  min-height: 44px; display: flex; align-items: center; padding: 8px 16px; cursor: pointer;
  font-size: var(--text-sm); font-weight: 700; color: var(--color-ink-soft); border-radius: var(--radius-md);
}
.sheet-toggle[open] { padding: 0 12px 12px; }
.sheet-toggle[open] > summary { margin: 0 -12px 4px; }
.steps-list { list-style: none; padding: 0 16px 12px; max-height: 24rem; overflow: auto; }
.step { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 4px 12px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--color-line); font-size: var(--text-sm); }
.step-time { color: var(--color-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.step-badge { font-size: var(--text-xs); font-weight: 700; padding: 1px 8px; border-radius: var(--radius-pill); border: 1px solid var(--color-line-strong); color: var(--color-ink-soft); text-align: center; min-width: 4.25rem; }
.step-badge.is-ok { color: var(--color-success); background: var(--color-success-soft); border-color: transparent; }
.step-badge.is-cached { color: var(--color-primary-ink); background: var(--color-primary-soft); border-color: transparent; }
.step-badge.is-failed { color: var(--color-error-text); background: var(--color-error-soft); border-color: var(--color-terracotta); }
.step-text { display: flex; flex-direction: column; min-width: 0; }
.step-name { overflow-wrap: anywhere; }
.step-detail { font-size: var(--text-xs); color: var(--color-muted); overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .perkins-grid .pk-label { min-width: 11rem; max-width: 12rem; white-space: normal; }
  .lmi-grid .pk-label { min-width: 12rem; }
  .step { grid-template-columns: auto minmax(0, 1fr); }
  .step-time { grid-column: 1 / -1; }
}

/* ---------- Team ---------- */
.team-list > .row { grid-template-columns: minmax(0, 1fr) auto; }
.member-controls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.member-controls select { width: auto; min-width: 9rem; min-height: 44px; padding-block: 6px; font-size: var(--text-sm); }
.member-protected { grid-column: 1 / -1; font-size: var(--text-xs); color: var(--color-muted); }
.role-tag { font-size: var(--text-xs); color: var(--color-muted); font-weight: 700; }
.invite-result { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: var(--radius-md); background: var(--color-primary-soft); border: 1px solid var(--color-primary-soft-edge); }
.copy-row { display: flex; gap: 8px; min-width: 0; }
.copy-row input { flex: 1; min-width: 0; font-size: var(--text-sm); }
.copy-row button { flex: none; }

/* ---------- Activity ---------- */
.activity-list > .row { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
.activity-time { font-size: var(--text-xs); color: var(--color-muted); white-space: nowrap; font-variant-numeric: tabular-nums; padding-top: 3px; }

/* ---------- Phones ---------- */
@media (max-width: 600px) {
  .bar-top { padding-block: 10px; }
  .identity .name { display: none; }
  .list-inset > .row { padding: 14px 16px; }
  .pull-list > .row { grid-template-columns: minmax(0, 1fr); }
  .pull-list .row-side { flex-direction: row; align-items: center; gap: 12px; justify-content: flex-start; text-align: left; }
  .activity-list > .row, .team-list > .row { grid-template-columns: minmax(0, 1fr); }
  .team-list .row-side { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px 12px; text-align: left; }
  .member-controls select { flex: 1 1 8rem; }
  .activity-time { order: -1; padding-top: 0; }
  .pull-form .btn-primary { width: 100%; }
  .copy-row { flex-direction: column; }
  .data-table tbody th, .data-table thead th:first-child { min-width: 8rem; max-width: 9.5rem; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (prefers-contrast: more) {
  .note, .row-sub { color: var(--color-ink-soft); }
  .btn-quiet { border-color: var(--color-ink-soft); }
}
