/* Shared color tokens: ink, warm cream and one tangerine accent.
   Text colors were checked for WCAG AA against every surface they sit on. */
:root {
  color-scheme: light;
  --ink: #141414;              /* primary buttons, the featured card, active nav text */
  --ink-hover: #2B2B2B;
  --ink-text: #BDB5AE;         /* secondary text on ink, 9.1:1 */
  --accent: #E8622C;           /* tangerine: fills, focus rings, the highlighted series; never small text */
  --accent-hover: #D4541F;
  --accent-text: #B8471A;      /* tangerine text and links, 4.65:1 or better on every warm surface */
  --accent-50: #FDF1EA;
  --accent-200: #F7C3A8;
  --chart-main: #E8622C;
  --chart-soft: #F4DCCF;       /* other bars and hatching */
  --chart-neutral: #D9D2CB;    /* ranking bars except the leader */
  --bg: #FAF7F4;
  --surface: #FFFFFF;
  --surface-hover: #FCFAF8;
  --surface-subtle: #F4EFEA;
  --border: #ECE6E0;
  --border-strong: #DDD4CB;
  --input-border: #8C8178;     /* derived: #DDD4CB is 1.5:1, inputs need 3:1 */
  --text: #141414;
  --text-2: #6B625B;           /* 5.2:1 even on #F4EFEA */
  --disabled: #A89F97;         /* disabled only: 2.6:1 fails as placeholder text */
  /* Status colors are for outcomes only. Pill text uses a darker shade: the base shades fail AA on their tints. */
  --success: #1F8A4C; --success-tint: #E6F4EC; --success-text: #18733F;
  --warning: #C99A06; --warning-tint: #FBF3D6; --warning-text: #7A5C00;
  --error: #C93A3A; --error-tint: #FBE9E9; --error-text: #A82E2E;
  --radius-control: 10px;
  --radius-card: 16px;
  --radius-frame: 20px;
  --shadow-pop: 0 12px 32px rgba(20, 20, 20, .12), 0 2px 6px rgba(20, 20, 20, .06);
  font: 14px/20px Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--bg);
}
* { box-sizing: border-box }
body { margin: 0 }

/* Type: page 28, section 18, body and card titles 14, meta 13, pills 12, KPI 32. */
h1, h2, h3, p { margin: 0 }
h1 { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere }
h2 { font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -.01em }
h3 { font-size: 14px; line-height: 20px; font-weight: 500 }
a { color: var(--accent-text); text-underline-offset: .18em }
a:hover { color: var(--text) }
small, .hint, .meta, .subtitle { color: var(--text-2); font-size: 13px; line-height: 18px }
.subtitle { margin-top: 4px }
.eyebrow { color: var(--text-2); font-size: 13px; line-height: 18px; margin-bottom: 4px }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
blockquote { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere }

/* Controls: 38px tall, 10px radius. Pills are only for status tags, chips and avatar groups. */
.button, button, input, select, textarea { font: inherit }
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: var(--radius-control); font-size: 14px; font-weight: 500; white-space: nowrap; text-align: center; text-decoration: none; cursor: pointer; transition: background-color .12s, border-color .12s }
.primary, button { color: #FFFFFF; background: var(--ink); border-color: var(--ink) }
.primary:hover, button:hover:not(:disabled) { color: #FFFFFF; background: var(--ink-hover); border-color: var(--ink-hover) }
.secondary, button.secondary { color: var(--text); background: var(--surface); border-color: var(--border-strong) }
.secondary:hover, button.secondary:hover:not(:disabled) { color: var(--text); background: var(--surface-subtle); border-color: var(--border-strong) }
.button.small, button.small { height: 32px; padding: 0 10px; font-size: 13px }
.button.fit { width: fit-content }
button.text { height: auto; padding: 0; border: 0; background: transparent; color: var(--accent-text); text-decoration: underline }
button.text:hover:not(:disabled) { background: transparent; color: var(--text) }
button.danger, button.danger:hover:not(:disabled) { background: var(--error); border-color: var(--error) }
button.danger-outline { color: var(--error-text); background: var(--surface); border-color: var(--error) }
button.danger-outline:hover:not(:disabled) { color: var(--error-text); background: var(--error-tint); border-color: var(--error) }
.icon-button, button.icon-button { width: 36px; height: 36px; padding: 0; color: var(--text-2); background: transparent; border-color: transparent }
.icon-button:hover, button.icon-button:hover:not(:disabled) { color: var(--text); background: var(--surface-subtle); border-color: transparent }
button:disabled { opacity: .55; cursor: not-allowed }
:is(a, button, input, select, textarea, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }
label { display: grid; gap: 6px; font-weight: 500 }
input, select { width: 100%; min-width: 0; height: 38px; padding: 0 12px; color: var(--text); background: var(--surface); border: 1px solid var(--input-border); border-radius: var(--radius-control) }
select { width: auto; padding-right: 32px }
input::placeholder { color: var(--text-2) }
input[type=file] { height: auto; padding: 8px 12px }
textarea { width: 100%; padding: 10px 12px; color: var(--text); background: var(--surface); border: 1px solid var(--input-border); border-radius: var(--radius-control) }
kbd { font-family: inherit; font-size: 12px; line-height: 16px; font-weight: 500; padding: 1px 6px; color: var(--text-2); background: var(--surface-subtle); border: 1px solid var(--border); border-radius: 6px }

/* Surfaces */
.card, details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: 24px }
.card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px }
.card-head > .meta, .card-head > a { margin-left: auto }
.card-head > a { font-size: 13px; font-weight: 500 }
.card > h2 { margin-bottom: 4px }
.feedback, [role=alert] { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 12px 16px; color: var(--error-text); background: var(--error-tint); border-radius: var(--radius-control) }
.feedback p { flex: 1 1 200px }
[role=status] { color: var(--text-2) }
.notice { margin: 12px 0; font-size: 13px }
.notice.inline { margin: 0 }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap }
.badge i { width: 6px; height: 6px; border-radius: 50% }
.badge.live { background: var(--success-tint); color: var(--success-text) }
.badge.live i { background: var(--success) }
.badge.paused { background: var(--warning-tint); color: var(--warning-text) }
.badge.paused i { background: var(--warning) }
.badge.closed { background: var(--surface-subtle); color: var(--text-2) }
.badge.closed i { background: var(--disabled) }
.count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--surface-subtle); color: var(--text-2); font-size: 12px; font-weight: 500 }

.chips { display: flex; flex-wrap: wrap; gap: 6px }
.chip, button.chip { height: 32px; padding: 0 12px; gap: 6px; border-radius: 999px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border-strong); font-size: 13px }
.chip:hover, button.chip:hover:not(:disabled) { color: var(--text); background: var(--surface-subtle); border-color: var(--border-strong) }
.chip[aria-pressed=true], button.chip[aria-pressed=true]:hover { color: var(--text); background: var(--accent-50); border-color: var(--accent-200) }
.chip-count { color: var(--text-2); font-size: 12px }

.actions, .metadata, .form-footer, .pagination { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap }
.pagination { justify-content: space-between; margin-top: 16px }

.admin-tabs { display: flex; gap: 20px; flex-wrap: wrap; margin: 16px 0 }
.admin-tabs a { padding: 8px 0; text-decoration: none; color: var(--text-2) }
.admin-tabs a.active { color: var(--text); border-bottom: 2px solid var(--accent) }
.admin-table { margin-top: 20px; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card) }
.admin-table table { width: 100%; border-collapse: collapse; text-align: left }
.admin-table :is(td, th) { padding: 12px 16px; overflow-wrap: anywhere; vertical-align: top }
.admin-check { display: flex; align-items: center; gap: 10px }
.admin-check input { width: 18px; height: 18px; flex: none }

/* Tooltips: the icon button holds the definition as its description. */
.info { position: relative; display: inline-flex }
.info-button, button.info-button { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 999px; color: var(--text-2); background: transparent }
.info-button:hover, button.info-button:hover:not(:disabled) { color: var(--text); background: transparent }
.info [role=tooltip] { position: absolute; z-index: 30; bottom: calc(100% + 8px); left: -8px; width: max-content; max-width: 260px; padding: 8px 10px; color: #FFFFFF; background: var(--ink); border-radius: 8px; font-size: 12px; line-height: 16px; font-weight: 400; text-align: left; display: none; pointer-events: none }
.info:hover [role=tooltip], .info:focus-within [role=tooltip] { display: block }
/* Hidden tooltips take no space, so one near the edge cannot widen the page. */
.kpi > .info [role=tooltip], .card-head > .info:last-child [role=tooltip] { left: auto; right: -8px }

/* Accordion rows instead of native disclosure triangles. */
details { padding: 0; overflow: hidden }
summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 16px 0 20px; font-weight: 500; cursor: pointer; list-style: none }
summary::-webkit-details-marker { display: none }
summary:hover { background: var(--surface-hover) }
.accordion-meta { display: inline-flex; align-items: center; gap: 10px; color: var(--text-2) }
.accordion-meta svg { transition: transform .15s }
details[open] .accordion-meta svg { transform: rotate(180deg) }
details > :not(summary) { margin: 0 20px 20px }
.card details.accordion { margin: 16px 0 0; border-radius: var(--radius-control); border-color: var(--border) }
.card details.accordion summary { min-height: 44px }
details table { width: calc(100% - 40px); border-collapse: collapse; text-align: left }
details table + table { margin-top: 16px }
td, th { padding: 8px 4px; border-bottom: 1px solid var(--border) }
th { color: var(--text-2); font-size: 13px; font-weight: 500 }

/* Empty states and loading skeletons */
.empty { display: grid; justify-items: center; gap: 6px; padding: 48px 24px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card) }
.empty h2 { font-size: 14px; line-height: 20px; font-weight: 600; margin-top: 8px }
.empty p { max-width: 380px; color: var(--text-2) }
.empty .button, .empty button { margin-top: 12px }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 999px; color: var(--accent-text); background: var(--accent-50) }
.skeleton { display: block; border-radius: 6px; background: linear-gradient(90deg, var(--surface-subtle) 0%, #FBF8F5 50%, var(--surface-subtle) 100%); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite }
.skeleton.line { height: 12px; width: 60% }
.skeleton.line.short { width: 30% }
.skeleton.line.title { height: 28px; width: 40%; margin-bottom: 10px }
.skeleton.pill { width: 64px; height: 22px; border-radius: 999px }
.skeleton.block { height: 120px; border-radius: var(--radius-control) }
.skeleton.block.tall { height: 240px }
@keyframes shimmer { from { background-position: 100% 0 } to { background-position: -100% 0 } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none } * { transition: none !important } }

/* Screen tiles: ProtoBirdie stores screen names, not screenshots. */
.tile { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 36px; border-radius: 6px; color: var(--text-2); background: var(--surface-subtle); border: 1px solid var(--border) }
.tile.small { width: 32px; height: 24px; border-radius: 5px }

/* Shell */
.shell { display: flex; min-height: 100vh }
.skip { position: absolute; left: 8px; top: -100px; z-index: 50; padding: 8px 12px; background: var(--surface); border-radius: var(--radius-control) }
.skip:focus { top: 8px }
.sidebar { position: sticky; top: 0; flex: none; width: 248px; height: 100vh; display: flex; flex-direction: column; gap: 20px; padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--border) }
.brand-link { display: flex; align-items: center; height: 40px; padding: 0 8px; color: var(--text); text-decoration: none; border-radius: var(--radius-control) }
.brand-link:hover { color: var(--text) }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; letter-spacing: -.01em }
/* A white tile keeps the black bird and its cut-out wing legible on every surface, the ink panel included. */
.brand-mark { flex: none; width: 28px; height: 28px; padding: 2px; border-radius: 8px; background: #FFFFFF; border: 1px solid var(--border); object-fit: contain }
.nav-group { display: flex; flex-direction: column; gap: 2px }
.nav-title { padding: 0 12px 6px; color: var(--text-2); font-size: 13px; line-height: 18px }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px; border-radius: var(--radius-control); color: var(--text-2); font-weight: 500; text-decoration: none }
.nav-item:hover { color: var(--text); background: var(--surface-subtle) }
.nav-item[aria-current=page] { color: var(--ink); background: var(--accent-50) }
.nav-item[aria-current=page]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent) }
.sidebar-foot { margin-top: auto; display: grid; gap: 12px }
.side-card { display: grid; gap: 4px; padding: 14px; border-radius: 12px; background: var(--surface-subtle) }
.side-card-title { font-weight: 600 }
.side-card p:not(.side-card-title) { color: var(--text-2); font-size: 13px; line-height: 18px; margin-bottom: 8px }
.side-card .button { background: var(--surface) }
.user-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 4px 0 8px; border-top: 1px solid var(--border) }
.avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 999px; background: var(--surface-subtle); color: var(--ink); font-weight: 600; font-size: 13px }
.user-email { flex: 1; min-width: 0; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.user-error { position: absolute; bottom: calc(100% + 8px); left: 0; right: 0; font-size: 13px }

.content { flex: 1 1 0; width: 100%; min-width: 0; max-width: 1344px; margin: 0 auto; padding: 0 32px 48px }
.content:focus { outline: none }
main.standalone { max-width: 640px; margin: 10vh auto; padding: 0 16px }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; margin-bottom: 8px }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; font-size: 14px }
.crumbs li { display: inline-flex; align-items: center; min-width: 0 }
.crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--disabled) }
.crumbs a { color: var(--text-2); text-decoration: none }
.crumbs a:hover { color: var(--text); text-decoration: underline }
.crumbs [aria-current=page] { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px }
.crumbs.inline { margin-bottom: 16px }
.search-field { position: relative; display: flex; align-items: center; font-weight: 400 }
.search-field > svg { position: absolute; left: 12px; color: var(--text-2); pointer-events: none }
.search-field input { padding-left: 36px }
.top-search { width: 280px }
.top-search input { padding-right: 44px; background: var(--surface) }
.top-search kbd { position: absolute; right: 8px }

/* Menus */
.menu { position: relative; display: inline-flex }
.menu-panel { position: absolute; z-index: 40; top: calc(100% + 6px); min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-pop) }
.menu-panel.end { right: 0 }
.menu-panel.start { left: 0; top: auto; bottom: calc(100% + 6px) }
.menu-item, button.menu-item { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; height: 36px; padding: 0 10px; color: var(--text); background: transparent; border: 0; border-radius: 8px; font-size: 14px; font-weight: 400; text-decoration: none }
.menu-item:hover, button.menu-item:hover:not(:disabled) { color: var(--text); background: var(--surface-subtle) }
.menu-item svg:last-child:not(:first-child) { margin-left: auto; color: var(--text-2) }
.menu-note { padding: 6px 10px 8px; color: var(--text-2); font-size: 13px; overflow-wrap: anywhere }

/* Page header and toolbar */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px }
.toolbar .search-field { width: 320px }
.toolbar-end { margin-left: auto }

/* Tables: 56px rows with a stretched link, so the whole row is clickable. */
.table { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card) }
.table-head { min-height: 40px; padding: 0 20px; align-items: center; color: var(--text-2); font-size: 13px; background: var(--surface-subtle); border-bottom: 1px solid var(--border); border-radius: calc(var(--radius-card) - 1px) calc(var(--radius-card) - 1px) 0 0 }
.table-body { margin: 0; padding: 0; list-style: none }
.table-row { position: relative; min-height: 56px; padding: 10px 20px; align-items: center }
.table-row + .table-row { border-top: 1px solid var(--border) }
.table-row:last-child { border-radius: 0 0 calc(var(--radius-card) - 1px) calc(var(--radius-card) - 1px) }
.table-row:hover { background: var(--surface-hover) }
.row-link { color: var(--text); font-weight: 500; text-decoration: none }
.row-link::after { content: ""; position: absolute; inset: 0 }
.row-link:hover { color: var(--text) }
.row-link:focus-visible { outline: none }
.table-row:has(.row-link:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px }
.row-actions { position: relative; z-index: 1; justify-self: end }
.cell-main { display: flex; align-items: center; gap: 12px; min-width: 0 }
.cell-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere }
.num { text-align: right }
.study-grid { display: grid; grid-template-columns: minmax(0, 1fr) 120px 140px 40px; gap: 16px }
.visit-grid { display: grid; grid-template-columns: minmax(140px, 1fr) 120px minmax(0, 1.4fr) 72px 92px; gap: 16px }
.feedback-grid { display: grid; grid-template-columns: minmax(0, 1fr) 120px 180px; gap: 16px }

/* Study header and tabs */
.study-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px }
.study-title h1 { margin-bottom: 8px }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end }
.tabs { display: flex; gap: 24px; margin-bottom: 24px; border-bottom: 1px solid var(--border); overflow-x: auto }
.tabs a { display: inline-flex; align-items: center; gap: 6px; height: 44px; color: var(--text-2); font-weight: 500; text-decoration: none; white-space: nowrap; box-shadow: inset 0 -2px 0 transparent }
.tabs a:hover { color: var(--text) }
.tabs a.active { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent) }
.section-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 20px }
.section-bar > :first-child:not(.visually-hidden), .section-bar .visually-hidden + * { margin-right: auto }

/* Forms */
.form { display: grid; gap: 16px }
.form-footer { padding-top: 16px; border-top: 1px solid var(--border) }
.publish { max-width: 640px }

/* Sharing */
.sharing { display: grid; gap: 24px; max-width: 720px }
.sharing .card { display: grid; gap: 12px }
.copy-field { position: relative; display: flex; align-items: center }
.copy-field input { padding-right: 44px; background: var(--surface-subtle) }
.copy-field .icon-button { position: absolute; right: 1px; height: 36px }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px }
.setting-label { font-weight: 500 }
.switch, button.switch { position: relative; flex: none; width: 44px; height: 24px; padding: 0; border-radius: 999px; background: var(--border-strong); border: 0 }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 2px rgba(20, 20, 20, .2); transition: transform .15s }
.switch[aria-checked=true], button.switch[aria-checked=true]:hover:not(:disabled) { background: var(--ink) }
.switch:hover:not(:disabled) { background: #CFC5BB }
.switch[aria-checked=true]::after { transform: translateX(20px) }
.danger-zone { border-color: #F1CFCF }
.danger-zone h2 { color: var(--error-text) }

/* Sign-in and agent consent share the same two-panel layout. */
.auth { display: grid; grid-template-columns: 1.15fr 1fr; gap: 24px; align-items: stretch; max-width: 1120px; min-height: 100vh; padding: 32px; margin: 0 auto }
.auth-hero { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 48px; border-radius: var(--radius-frame); background: var(--ink); color: #FFFFFF }
.auth-hero .brand { margin-bottom: 24px }
.auth-hero .eyebrow, .auth-hero p { color: var(--ink-text) }
.auth form { align-self: center; gap: 16px }
.consent { width: 100%; min-width: 0 }
.consent-details { display: grid; gap: 8px; margin: 0; padding: 16px; background: var(--surface-subtle); border-radius: var(--radius-control) }
.consent-details > div { display: grid; grid-template-columns: 6em minmax(0, 1fr); gap: 12px }
.consent-details dt { color: var(--text-2) }
.consent-details dd { margin: 0; overflow-wrap: anywhere }
.consent-actions { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--border) }
.consent-actions button { height: auto; min-height: 38px; padding-block: 8px; white-space: normal }

/* Participant pages */
.narrow { display: grid; gap: 12px; max-width: 640px; margin: 10vh auto; padding: 40px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-frame) }
.narrow p:not(.eyebrow) { color: var(--text-2) }
.player { display: flex; flex-direction: column; height: 100dvh }
.player header { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--border) }
.player header span { margin-left: auto; color: var(--text-2); font-size: 13px }
.player iframe { width: 100%; flex: 1; border: 0; background: white }

/* Tablet */
@media (max-width: 1119px) {
  .sidebar { width: 72px; align-items: center; padding: 16px 8px }
  .sidebar .side-card { display: none }
  .sidebar :is(.brand-text, .nav-title, .nav-text, .user-email) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }
  .brand-link { justify-content: center; width: 44px; padding: 0 }
  .nav-group { align-items: center }
  .nav-item { justify-content: center; width: 44px; height: 40px; padding: 0 }
  .user-row { flex-direction: column; padding: 8px 0 0; border-top: 0 }
  .content { padding: 0 24px 40px }
  .visit-grid { grid-template-columns: minmax(120px, 1fr) 100px minmax(0, 1fr) 64px }
  .visit-grid > :last-child { display: none }
}

/* Mobile: the sidebar becomes a top row */
@media (max-width: 719px) {
  .shell { flex-direction: column }
  .sidebar { position: static; width: auto; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 16px; border-right: 0; border-bottom: 1px solid var(--border) }
  .nav-group { flex-direction: row; margin-left: auto }
  .sidebar-foot { margin: 0 }
  .user-row { flex-direction: row; padding: 0 }
  .menu-panel.start { top: calc(100% + 6px); bottom: auto; left: auto; right: 0 }
  .content { padding: 0 16px 32px }
  .topbar { flex-wrap: wrap; min-height: 56px; padding: 8px 0 }
  .top-search { width: 100% }
  .crumbs [aria-current=page] { max-width: 220px }
  .toolbar .search-field { width: 100% }
  .toolbar-end { margin-left: 0 }
  .study-header { flex-direction: column }
  .header-actions { justify-content: flex-start }
  .study-grid { grid-template-columns: minmax(0, 1fr) auto 36px }
  .study-grid > :nth-child(3) { display: none }
  .visit-grid { grid-template-columns: minmax(0, 1fr) 72px }
  .visit-grid > :nth-child(3), .visit-grid > :nth-child(4) { display: none }
  .feedback-grid { grid-template-columns: minmax(0, 1fr) auto }
  .feedback-grid > :nth-child(3) { display: none }
  .table-row, .table-head { padding-left: 16px; padding-right: 12px }
  .setting-row { align-items: flex-start }
  .auth { display: flex; flex-direction: column; padding: 16px }
  .auth-hero { padding: 32px 24px }
  .narrow { margin: 16px; padding: 24px }
}
