:root, :root[data-theme="light"] {
  --accent: #b8894f;
  --accent-foreground: #20150d;
  --atelier-line: #d9c4a5;
  --background: #fbf6ed;
  --border: #d5bea0;
  --border-strong: #9a7a55;
  --button-secondary: #efe1cc;
  --button-secondary-hover: #e4cfb0;
  --classroom-marker-teacher: #f4c542;
  --danger: #9f2f2a;
  --danger-surface: #f8ded8;
  --focus: #9c6b2f;
  --foreground: #241a14;
  --muted-foreground: #665747;
  --nav-foreground: #fff7e8;
  --nav-muted: #d6be9c;
  --nav-surface: #1d130d;
  --nav-surface-active: #332116;
  --panel-shadow: rgba(77, 52, 31, 0.14);
  --primary: #5b3324;
  --primary-foreground: #fff6e8;
  --success: #4f6f3b;
  --success-surface: #e4eed8;
  --surface: #fffaf2;
  --surface-raised: #f3e7d6;
  --surface-tinted: #ead7bb;
  --warning: #81560f;
  --warning-surface: #f7e8c7;
}

:root[data-theme="dark"] {
  --accent: #d6aa64;
  --accent-foreground: #201408;
  --atelier-line: #65513a;
  --background: #17120d;
  --border: #5b4731;
  --border-strong: #8d704d;
  --button-secondary: #322418;
  --button-secondary-hover: #442f1f;
  --classroom-marker-teacher: #f4c542;
  --danger: #e98780;
  --danger-surface: #3c1713;
  --focus: #f1c982;
  --foreground: #fff4e4;
  --muted-foreground: #d3bfa3;
  --nav-foreground: #fff8ec;
  --nav-muted: #c2aa8a;
  --nav-surface: #120d09;
  --nav-surface-active: #2b1d13;
  --panel-shadow: rgba(0, 0, 0, 0.42);
  --primary: #f7e7ce;
  --primary-foreground: #26180e;
  --success: #9eb873;
  --success-surface: #182915;
  --surface: #211911;
  --surface-raised: #2c2117;
  --surface-tinted: #372716;
  --warning: #e8bf63;
  --warning-surface: #34250d;
}

:root[data-theme="tafel"] {
  --accent: #dfc58d;
  --accent-foreground: #1c1408;
  --atelier-line: #59715e;
  --background: #101814;
  --border: #405846;
  --border-strong: #78916f;
  --button-secondary: #243529;
  --button-secondary-hover: #304637;
  --classroom-marker-teacher: #f4c542;
  --danger: #eda096;
  --danger-surface: #3d1914;
  --focus: #dfc58d;
  --foreground: #f8ecd9;
  --muted-foreground: #c5d0b9;
  --nav-foreground: #fff5e4;
  --nav-muted: #c7b993;
  --nav-surface: #07110d;
  --nav-surface-active: #162a20;
  --panel-shadow: rgba(0, 0, 0, 0.38);
  --primary: #f7e7ce;
  --primary-foreground: #112016;
  --success: #94c27c;
  --success-surface: #102d1d;
  --surface: #16231b;
  --surface-raised: #203229;
  --surface-tinted: #223a2a;
  --warning: #e8c56d;
  --warning-surface: #37280d;
}
:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

/* Design tokens (docs/ux-redesign-plan.md §5.1). Color tokens are emitted per theme by
   scripts/build-platform.ts; these are the non-color primitives shared across every theme.
   Breakpoint reference (custom properties can't be used inside @media, so they are documented
   here for the hand-authored media queries): sm 480px · md 640px · lg 900px · xl 1200px. */
:root {
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  --font-sans:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --shadow-sm: 0 1px 2px color-mix(in srgb, var(--panel-shadow) 70%, transparent);
  --shadow-md: 0 6px 16px var(--panel-shadow);
  --shadow-lg: 0 18px 48px var(--panel-shadow);

  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;

  --z-base: 0;
  --z-sticky: 100;
  --z-drawer: 200;
  --z-dialog: 300;
  --z-toast: 400;

  --container-max: 1200px;
  --touch-target: 44px;
}

:root[data-theme="dark"],
:root[data-theme="tafel"] {
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--background) 96%, var(--primary)),
      color-mix(in srgb, var(--background) 88%, var(--accent))
    ),
    var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  line-height: 1.25;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    115deg,
    color-mix(in srgb, var(--primary) 7%, transparent),
    transparent 34% 68%,
    color-mix(in srgb, var(--accent) 8%, transparent)
  );
  content: "";
  pointer-events: none;
}

a {
  color: inherit;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(230px, 280px) 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 24px;
  /* Pin the sidebar to the viewport so the collapse toggle at the bottom stays visible; the nav
     region scrolls internally when there are more items than fit. */
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  border-right: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border-strong));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 42%),
    var(--nav-surface);
  color: var(--nav-foreground);
  padding: 20px;
  box-shadow: 18px 0 42px color-mix(in srgb, var(--panel-shadow) 85%, transparent);
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--atelier-line) 24%, var(--nav-muted));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--atelier-line) 10%, transparent), transparent),
    color-mix(in srgb, var(--nav-surface-active) 46%, transparent);
  padding: 12px;
}

.brand-mark {
  display: block;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 10px;
  box-shadow:
    0 14px 28px color-mix(in srgb, var(--primary) 24%, transparent),
    0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent),
    0 0 0 4px color-mix(in srgb, var(--accent) 9%, transparent);
}

.brand strong {
  display: block;
  color: var(--nav-foreground);
  font-size: 18px;
  line-height: 1.12;
}

.brand span:last-child,
.eyebrow,
.panel p {
  color: var(--muted-foreground);
}

.brand span:last-child {
  color: var(--nav-muted);
  font-size: 13px;
  font-weight: 700;
}

nav {
  display: grid;
  gap: 6px;
}

nav a,
.theme-picker,
.logout-button,
.form-panel button,
.inline-form button,
.row-actions button,
.row-actions a,
.primary-link {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  text-decoration: none;
}

nav a {
  position: relative;
  color: var(--nav-muted);
  font-weight: 800;
}

nav a.disabled {
  opacity: 0.56;
}

nav a.disabled:hover {
  border-color: transparent;
  background: transparent;
  color: var(--nav-muted);
}

nav a:hover,
nav a.active,
.theme-picker:focus-within,
.logout-button:hover {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--border-strong));
  background: var(--nav-surface-active);
  color: var(--nav-foreground);
}

nav a.active {
  box-shadow:
    inset 3px 0 0 var(--accent),
    0 10px 22px color-mix(in srgb, black 16%, transparent);
  color: var(--nav-foreground);
  font-weight: 800;
}

.theme-picker {
  margin-top: auto;
  display: grid;
  gap: 6px;
  background: color-mix(in srgb, var(--nav-surface-active) 86%, transparent);
  color: var(--nav-foreground);
}

.theme-picker-label {
  color: var(--nav-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.theme-picker select {
  width: 100%;
  min-height: 36px;
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border));
  border-radius: 8px;
  background:
    linear-gradient(45deg, transparent 50%, var(--nav-foreground) 50%),
    linear-gradient(135deg, var(--nav-foreground) 50%, transparent 50%),
    color-mix(in srgb, var(--nav-surface) 62%, var(--nav-surface-active));
  background-position:
    calc(100% - 16px) 15px,
    calc(100% - 11px) 15px,
    0 0;
  background-repeat: no-repeat;
  background-size:
    5px 5px,
    5px 5px,
    auto;
  color: var(--nav-foreground);
  font: inherit;
  font-weight: 800;
  padding: 0 34px 0 10px;
}

.theme-picker select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent);
  outline: none;
}

.theme-picker-current {
  color: var(--nav-muted);
  font-size: 12px;
  font-weight: 800;
}

.logout-button {
  border-color: color-mix(in srgb, var(--border) 70%, var(--primary));
  background: var(--button-secondary);
  color: var(--foreground);
  cursor: pointer;
  font-weight: 700;
}

.logout-button:hover {
  background: var(--button-secondary-hover);
}

.content {
  position: relative;
  overflow: hidden;
  padding: clamp(18px, 3vw, 34px);
  background:
    radial-gradient(
      circle at 18% 8%,
      color-mix(in srgb, var(--accent) 8%, transparent),
      transparent 34%
    ),
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 18%, transparent), transparent 260px);
}

.content::before {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--surface) 42%, transparent),
    transparent 220px
  );
  content: "";
  pointer-events: none;
}

.content > * {
  position: relative;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
  border: 1px solid color-mix(in srgb, var(--border) 72%, var(--atelier-line));
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--surface) 92%, transparent), transparent),
    linear-gradient(135deg, color-mix(in srgb, var(--atelier-line) 14%, transparent), transparent),
    var(--surface);
  padding: 18px;
  box-shadow:
    0 18px 34px color-mix(in srgb, var(--panel-shadow) 78%, transparent),
    inset 0 1px 0 color-mix(in srgb, var(--surface-raised) 76%, transparent);
}

.topbar::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 10px;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    color-mix(in srgb, var(--accent) 52%, transparent),
    transparent
  );
  content: "";
  pointer-events: none;
}

.topbar h1 {
  margin: 0;
  max-width: 18ch;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.22;
  text-wrap: balance;
}

.topbar-subtitle {
  margin: 6px 0 0;
  color: var(--muted-foreground);
}

.topbar::after {
  position: absolute;
  top: 10px;
  bottom: 10px;
  right: 10px;
  width: 5px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--accent) 80%, var(--primary))),
    var(--primary);
  content: "";
  pointer-events: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  margin-left: auto;
  padding-right: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  border-radius: 999px;
  background: var(--surface-tinted);
  color: var(--foreground);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 10px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--surface) 42%, transparent);
}

.status-pill::before {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: currentColor;
  content: "";
  opacity: 0.55;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title-row h2 {
  margin: 0;
}

.live-status {
  white-space: nowrap;
}

.live-status.connected {
  border-color: color-mix(in srgb, var(--success) 44%, var(--border));
  background: var(--success-surface);
  color: var(--foreground);
}

.live-status.disconnected {
  border-color: color-mix(in srgb, var(--danger) 44%, var(--border));
  background: var(--danger-surface);
  color: var(--foreground);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-link {
  position: relative;
  isolation: isolate;
  width: fit-content;
  border-color: color-mix(in srgb, var(--primary) 78%, var(--accent));
  background:
    linear-gradient(180deg, color-mix(in srgb, white 12%, transparent), transparent), var(--primary);
  color: var(--primary-foreground);
  font-weight: 700;
  box-shadow: 0 12px 22px color-mix(in srgb, var(--primary) 22%, transparent);
}

.primary-link::after {
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: 6px;
  background: linear-gradient(180deg, color-mix(in srgb, white 12%, transparent), transparent);
  content: "";
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.dashboard-grid.two {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.stack {
  display: grid;
  gap: 16px;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 86%, var(--primary));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, white 4%, transparent), transparent 44%),
    var(--surface);
  padding: 18px;
  box-shadow:
    0 16px 34px var(--panel-shadow),
    0 1px 0 color-mix(in srgb, var(--primary) 10%, transparent) inset;
}

.panel h2 {
  margin: 0 0 8px;
  font-size: 17px;
  letter-spacing: 0;
}

.panel p {
  margin: 0;
}

.hero-panel {
  min-height: 148px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--primary) 13%, transparent),
      color-mix(in srgb, var(--accent) 9%, transparent)
    ),
    var(--surface);
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}

.form-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.form-panel label {
  display: grid;
  gap: 6px;
  color: color-mix(in srgb, var(--foreground) 74%, transparent);
  font-size: 14px;
  font-weight: 700;
}

.form-panel input,
.form-panel select,
.compact-label select,
.inline-form input {
  min-height: 40px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, var(--border-strong));
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--foreground);
  font: inherit;
  padding: 0 10px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.form-panel input:focus,
.form-panel select:focus,
.compact-label select:focus,
.inline-form input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 16%, transparent);
}

.file-input-control {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, var(--border-strong));
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--foreground);
  padding: 5px;
}

.file-input-control input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.file-input-control:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 16%, transparent);
}

.file-input-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  background: var(--button-secondary);
  color: var(--foreground);
  font-weight: 800;
  padding: 8px 10px;
}

.file-input-name {
  min-width: 0;
  overflow: hidden;
  color: var(--muted-foreground);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-panel select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--foreground) 50%),
    linear-gradient(135deg, var(--foreground) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 17px,
    calc(100% - 11px) 17px;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  padding-right: 34px;
}

.form-panel button,
.inline-form button,
.row-actions button,
.row-actions a {
  position: relative;
  width: fit-content;
  border-color: color-mix(in srgb, var(--primary) 62%, var(--border));
  background:
    linear-gradient(180deg, color-mix(in srgb, white 10%, transparent), transparent), var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
  font-weight: 800;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.form-panel button:hover,
.inline-form button:hover,
.row-actions button:hover,
.row-actions a:hover,
.primary-link:hover {
  box-shadow: 0 14px 26px color-mix(in srgb, var(--primary) 22%, transparent);
  transform: translateY(-1px);
}

.form-panel button:disabled,
.inline-form button:disabled,
.row-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
}

.form-panel button:disabled:hover,
.inline-form button:disabled:hover,
.row-actions button:disabled:hover {
  box-shadow: none;
}

.upload-status {
  width: fit-content;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.upload-feedback {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 82%, var(--primary));
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 62%),
    var(--surface-tinted);
  color: var(--foreground);
  padding: 10px 12px;
}

.upload-feedback > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.upload-feedback strong {
  font-size: 14px;
  line-height: 1.25;
}

.upload-feedback span:not(.status-pill) {
  min-width: 0;
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-feedback-success {
  border-color: color-mix(in srgb, var(--success) 42%, var(--border));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--success) 13%, transparent), transparent 64%),
    var(--success-surface);
}

.upload-feedback-error {
  border-color: color-mix(in srgb, var(--danger) 46%, var(--border));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--danger) 11%, transparent), transparent 64%),
    var(--danger-surface);
}

.upload-feedback-bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent) 82%, var(--primary)),
    transparent
  );
  animation: upload-feedback-sweep 1.2s ease-in-out infinite;
}

@keyframes upload-feedback-sweep {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.inline-edit-form {
  display: grid;
  width: min(520px, 100%);
  gap: 8px;
}

.inline-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 8px;
}

.inline-edit-grid label,
.inline-edit-form label {
  display: grid;
  gap: 5px;
  color: color-mix(in srgb, var(--foreground) 74%, transparent);
  font-size: 13px;
  font-weight: 800;
}

.inline-edit-actions {
  display: flex;
  gap: 8px;
}

.inline-edit-actions .secondary {
  border-color: color-mix(in srgb, var(--border-strong) 48%, var(--border));
  background: var(--button-secondary);
  color: var(--foreground);
}

.inline-edit-actions .secondary:hover,
.chat-edit-form button:hover,
.subtle-action:hover {
  background: var(--button-secondary-hover);
}

.row-actions button,
.row-actions a {
  min-height: 34px;
  padding: 7px 10px;
}

.row-actions .danger {
  background: var(--danger);
  color: var(--primary-foreground);
}

.compact-label {
  display: grid;
  min-width: min(260px, 100%);
  gap: 6px;
  color: color-mix(in srgb, var(--foreground) 74%, transparent);
  font-size: 14px;
  font-weight: 800;
}

.compact-label select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--foreground) 50%),
    linear-gradient(135deg, var(--foreground) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 17px,
    calc(100% - 11px) 17px;
  background-repeat: no-repeat;
  background-size: 5px 5px;
  padding-right: 34px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
  border: 0;
  padding: 0;
}

.filter-bar legend {
  width: 100%;
  color: color-mix(in srgb, var(--foreground) 72%, transparent);
  font-size: 13px;
  font-weight: 800;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.form-panel .checkbox-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.checkbox-line input {
  min-height: auto;
}

.table-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.table-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 88%, var(--primary));
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary) 3%, transparent), transparent 46%),
    var(--surface-raised);
  padding: 12px;
  box-shadow: 0 1px 0 color-mix(in srgb, white 24%, transparent) inset;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.table-row::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--atelier-line) 54%, transparent);
  content: "";
  pointer-events: none;
}

.table-row div:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.table-row strong,
.table-row span {
  min-width: 0;
  overflow-wrap: break-word;
}

.table-row span {
  color: var(--muted-foreground);
  font-size: 14px;
}

.link-row {
  color: inherit;
  text-decoration: none;
}

.link-row:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--primary));
  box-shadow:
    0 12px 24px var(--panel-shadow),
    inset 3px 0 0 var(--accent);
  transform: translateY(-1px);
}

.row-actions {
  display: flex;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px dashed color-mix(in srgb, var(--border) 72%, var(--primary));
  border-radius: 8px;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--surface-tinted) 78%, transparent),
      color-mix(in srgb, var(--accent) 7%, transparent)
    ),
    var(--surface-raised);
  padding: 18px;
  text-align: center;
}

.empty-state p {
  color: var(--muted-foreground);
}

.empty-state > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
}

.info-card {
  display: grid;
  align-content: space-between;
  min-height: 112px;
  gap: 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, transparent), transparent 42%),
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 7%, transparent), transparent),
    var(--surface);
}

.info-card:hover {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
  box-shadow:
    0 18px 34px var(--panel-shadow),
    inset 0 1px 0 color-mix(in srgb, var(--accent) 18%, transparent);
}

.info-card-label {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.info-card strong {
  max-width: 18rem;
  color: var(--foreground);
  font-size: 24px;
  font-weight: 900;
  line-height: 1.24;
}

.workspace-cockpit {
  display: grid;
  gap: 18px;
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--primary) 10%, transparent),
      transparent 35% 70%,
      color-mix(in srgb, var(--accent) 10%, transparent)
    ),
    var(--surface);
}

.workspace-cockpit-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.workspace-cockpit-header h2 {
  margin-bottom: 6px;
  font-size: 21px;
  line-height: 1.24;
}

.workspace-cockpit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 78%, var(--primary));
  border-radius: 8px;
  background: color-mix(in srgb, var(--atelier-line) 45%, var(--border));
}

.cockpit-lane {
  display: grid;
  align-content: space-between;
  gap: 14px;
  min-height: 178px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-raised) 80%, transparent), transparent),
    var(--surface-tinted);
  padding: 14px;
}

.cockpit-lane-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cockpit-lane-title h3 {
  margin: 0;
  font-size: 15px;
}

.cockpit-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: 999px;
  background:
    linear-gradient(180deg, color-mix(in srgb, white 10%, transparent), transparent),
    color-mix(in srgb, var(--primary) 14%, var(--surface));
  color: var(--primary);
}

.cockpit-lane-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cockpit-lane-body strong {
  color: var(--foreground);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.cockpit-lane-body span,
.cockpit-lane-body small {
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.cockpit-lane-body small {
  color: color-mix(in srgb, var(--muted-foreground) 84%, var(--accent));
}

.cockpit-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 34px;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  border-radius: 8px;
  background: var(--button-secondary);
  color: var(--foreground);
  font-size: 13px;
  font-weight: 900;
  padding: 7px 10px;
  text-decoration: none;
}

.cockpit-link:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--primary));
  background: var(--button-secondary-hover);
}

.cockpit-link.disabled {
  color: var(--muted-foreground);
  opacity: 0.78;
}

.calendar-overview {
  display: grid;
  gap: 16px;
}

.calendar-month-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.calendar-month-controls button {
  display: inline-grid;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  border-radius: 8px;
  background: var(--button-secondary);
  color: var(--foreground);
  cursor: pointer;
  font-weight: 900;
}

.calendar-month-controls button:hover {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--primary));
  background: var(--button-secondary-hover);
}

.calendar-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.calendar-month-grid {
  overflow: hidden;
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--border) 82%, var(--primary));
  border-radius: 8px;
  background: color-mix(in srgb, var(--atelier-line) 42%, var(--border));
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.calendar-weekday,
.calendar-day {
  min-width: 0;
  background: var(--surface-raised);
}

.calendar-weekday {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 900;
  padding: 8px;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  border-left: 1px solid color-mix(in srgb, var(--atelier-line) 48%, var(--border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface-tinted) 30%, transparent), transparent),
    var(--surface-raised);
  padding: 8px;
  vertical-align: top;
}

.calendar-day.outside {
  color: var(--muted-foreground);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 58%, transparent), transparent),
    color-mix(in srgb, var(--surface-raised) 64%, var(--surface));
}

.calendar-day.today {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 58%, var(--primary));
}

.calendar-day-content {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 108px;
  min-width: 0;
}

.calendar-day-number {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  color: var(--foreground);
  font-weight: 900;
}

.calendar-day.today .calendar-day-number {
  background: var(--primary);
  color: var(--primary-foreground);
}

.calendar-day-events {
  display: grid;
  gap: 4px;
}

.calendar-event-chip,
.calendar-more-events {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: 999px;
  background: var(--surface-tinted);
  color: var(--foreground);
  font-size: 11px;
  font-weight: 900;
  padding: 3px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-more-events {
  color: var(--muted-foreground);
}

.calendar-agenda {
  display: grid;
  gap: 8px;
}

.calendar-agenda h3 {
  margin: 0;
}

.calendar-agenda-row {
  align-items: flex-start;
}

.empty-state strong {
  font-size: 15px;
}

.empty-state p {
  max-width: 38rem;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
}

.file-row-main {
  display: grid;
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 4px;
}

.file-name {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row .row-actions {
  grid-column: 2;
  align-self: end;
  justify-content: flex-end;
}

.file-list-heading {
  align-items: center;
  margin-bottom: 12px;
}

.file-filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.32fr);
  gap: 10px;
  margin: 0 0 12px;
  border: 1px solid color-mix(in srgb, var(--border) 74%, var(--primary));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 58%),
    var(--surface-tinted);
  padding: 10px;
}

.file-filter-bar legend {
  grid-column: 1 / -1;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.file-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--border) 82%, var(--border-strong));
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--muted-foreground);
  padding: 0 10px;
}

.file-search input {
  width: 100%;
  min-height: 40px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font: inherit;
  outline: 0;
}

.file-search:focus-within {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 16%, transparent);
}

.file-kind-filter {
  min-width: 0;
}

.file-section-select {
  min-width: min(220px, 100%);
}

.clear-file-filter {
  margin-top: 12px;
}

.live-materials {
  display: grid;
  gap: 14px;
}

.live-upload-panel {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 76%, var(--accent));
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent 68%),
    var(--surface-tinted);
  padding: 12px;
}

.live-upload-panel > div {
  display: grid;
  gap: 3px;
}

.live-upload-panel strong {
  color: var(--foreground);
}

.live-upload-panel
  span:not(.file-input-control, .file-input-button, .file-input-name, .status-pill) {
  color: var(--muted-foreground);
  font-size: 14px;
}

.live-upload-panel .upload-feedback {
  grid-column: 1 / -1;
}

.live-file-picker {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, var(--primary));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 58%),
    var(--surface-tinted);
  padding: 12px;
}

.material-picker-hint {
  color: var(--muted-foreground);
  font-size: 13px;
}

.material-preview {
  display: grid;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--border) 74%, var(--primary));
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 12px;
}

.material-preview span {
  color: var(--muted-foreground);
  font-size: 14px;
}

.live-participant-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, var(--primary));
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary) 8%, transparent), transparent),
    var(--surface-tinted);
  padding: 10px 12px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface-raised) 62%, transparent);
}

.participant-circles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.participant-circle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--border-strong) 72%, var(--border));
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--foreground);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.participant-circle:hover {
  transform: translateY(-1px);
}

.participant-circle.online {
  border-color: var(--success);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 13%, transparent);
}

.participant-circle.offline {
  opacity: 0.62;
}

.participant-circle.following {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--primary));
  background: var(--primary);
  color: var(--primary-foreground);
}

.live-follow-label {
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.live-marker-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.live-marker-control input[type="color"] {
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--border) 72%, var(--primary));
  border-radius: 999px;
  background: var(--surface-raised);
  cursor: pointer;
  padding: 3px;
}

.copy-box {
  display: grid;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--primary));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent),
    var(--surface-tinted);
  padding: 10px;
}

.copy-box span {
  color: color-mix(in srgb, var(--foreground) 76%, transparent);
  font-size: 13px;
  font-weight: 800;
}

.copy-box code {
  overflow-wrap: anywhere;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-raised) 84%, var(--nav-surface));
  padding: 8px;
}

.copy-box button {
  width: fit-content;
}

.copy-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.copy-feedback {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: transparent;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
}

.copy-feedback.copied {
  border-color: color-mix(in srgb, var(--success) 42%, var(--border));
  background: var(--success-surface);
  color: var(--foreground);
}

.copy-feedback.error {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--border));
  background: var(--danger-surface);
  color: var(--foreground);
}

.chat-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.chat-list p,
.chat-message {
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--primary));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--primary) 5%, transparent), transparent),
    var(--surface-tinted);
  padding: 10px 12px;
}

.chat-message:hover {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
}

.chat-message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chat-message-content {
  display: grid;
  flex: 1;
  gap: 4px;
  min-width: 0;
}

.chat-message p {
  background: transparent;
  padding: 0;
}

.chat-edited-label {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 800;
}

.chat-edit-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
}

.chat-edit-form button {
  min-height: 38px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 8px;
  background: var(--button-secondary);
  color: var(--foreground);
  cursor: pointer;
}

/* Live classroom focus layout (docs/ux-redesign-plan.md §13 Phase 6): the PDF dominates the main
   column; participants + chat sit in a fixed rail so the basics (view/change PDF, audio,
   classmates, messages) stay reachable without scrolling. */
.live-room-header {
  padding: 14px 18px;
}

.live-room {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-rows: 1fr auto;
  gap: 16px;
  align-items: stretch;
}

.live-room-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* First-run live-classroom help banner: a calm, accented card with plain-language tips. */
.live-help {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}

.live-help-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.live-help-head h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: var(--text-md);
}

.live-help p {
  margin: 0;
  color: var(--foreground);
}

.live-help-tips {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted-foreground);
}

.live-help-dismiss {
  display: inline-flex;
  padding: 4px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}

.live-help-dismiss:hover {
  background: color-mix(in srgb, var(--foreground) 8%, transparent);
}

.live-help-confirm {
  align-self: flex-start;
  margin-top: 2px;
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

.live-help-reopen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-raised);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  cursor: pointer;
}

.live-help-reopen:hover {
  color: var(--foreground);
  border-color: var(--border-strong);
}

.live-room-pickers {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.live-room-pickers .live-file-picker {
  flex: 1 1 220px;
  margin: 0;
}

/* Keep the picker row to compact dropdowns; the chosen file already shows in the stage/audio
   headers, so the preview card and hint are redundant here. */
.live-room-pickers .material-picker-hint,
.live-room-pickers .material-preview,
.live-room-pickers .empty-state {
  display: none;
}

.live-room-pickers > .live-status {
  margin-bottom: 4px;
}

.live-room-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.live-room-chat {
  display: flex;
  flex: 1;
  min-height: 260px;
}

.live-room-chat > .panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.live-room-chat .chat-list {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
}

.live-room-tools {
  grid-column: 1 / -1;
}

.live-room-tools > summary {
  cursor: pointer;
  padding: var(--space-2) 0;
  color: var(--muted-foreground);
  font-weight: var(--weight-semibold);
  list-style-position: inside;
}

.live-room-tools[open] > summary {
  margin-bottom: var(--space-3);
}

.live-pdf-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-foreground);
  font-weight: var(--weight-semibold);
}

.live-room {
  min-height: calc(100vh - 210px);
}

.live-material-stage {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) minmax(260px, 1fr);
  gap: 14px;
  margin: 16px 0;
}

.live-preview {
  display: grid;
  gap: 12px;
  min-height: 360px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--primary));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--primary) 6%, transparent), transparent 46%),
    var(--surface-raised);
  padding: 12px;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 56%, transparent);
}

.live-preview.compact {
  min-height: auto;
}

.live-preview h3 {
  margin: 0;
}

.live-preview audio {
  width: 100%;
}

.live-pdf-viewer {
  display: grid;
  gap: 10px;
}

.live-pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--border) 70%, var(--primary));
  background: var(--surface-tinted);
  padding: 8px;
}

.live-pdf-toolbar button {
  min-width: 92px;
}

.live-pdf-canvas-wrap {
  position: relative;
  display: grid;
  place-items: center;
  overflow: auto;
  height: clamp(420px, 68vh, 720px);
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--primary));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 86%, transparent), transparent),
    color-mix(in srgb, var(--surface) 82%, var(--surface-tinted));
  padding: 12px;
  scrollbar-color: color-mix(in srgb, var(--primary) 58%, var(--border)) transparent;
}

.live-pdf-canvas-stack {
  display: grid;
  max-width: 100%;
  place-items: center;
  position: relative;
}

.live-pdf-canvas-stack canvas {
  grid-area: 1 / 1;
}

.live-pdf-canvas-stack canvas:not(.live-annotation-canvas) {
  position: relative;
  z-index: 1;
}

.live-pdf-canvas-wrap canvas {
  max-width: 100%;
  border-radius: 4px;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--foreground) 14%, transparent);
}

.live-pdf-canvas-wrap canvas.hidden {
  display: none;
}

.live-annotation-canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  box-shadow: none;
  cursor: crosshair;
  pointer-events: auto;
  touch-action: none;
}

.pdf-render-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--primary);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.live-audio-player,
.live-audio-controls {
  display: grid;
  gap: 12px;
}

.live-audio-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 112px;
  min-height: 42px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
  font-weight: 800;
}

.live-audio-controls label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
}

.live-audio-controls input[type="range"] {
  width: 100%;
}

.live-audio-controls select {
  min-height: 42px;
}

/* Focus-layout overrides — placed after the base live rules so specificity stays ascending. In the
   focus layout the PDF preview fills the main column and the audio collapses to a thin bar. */
.live-room-main .live-material-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  flex: 1;
  min-height: 0;
}

.live-room-main .live-preview {
  min-height: 0;
}

.live-room-main .live-preview:not(.compact) {
  flex: 1;
}

/* A large but bounded canvas so the page overflows and stays scroll-synced between participants. */
.live-room-main .live-preview:not(.compact) .live-pdf-canvas-wrap {
  height: clamp(380px, 60vh, 680px);
}

.live-room-main .live-audio-player {
  grid-template-columns: 1fr;
}

.live-room-main .live-audio-controls {
  grid-auto-flow: column;
  grid-template-columns: auto 1fr auto;
  align-items: end;
}

.subtle-action {
  min-height: 32px;
  border: 1px solid color-mix(in srgb, var(--border) 72%, var(--primary));
  border-radius: 8px;
  background: var(--button-secondary);
  color: var(--foreground);
  padding: 7px 9px;
  cursor: pointer;
}

.subtle-action.danger {
  background: var(--danger);
  color: var(--primary-foreground);
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.session-title-editor {
  width: min(520px, 100%);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 16px;
  }

  .sidebar {
    position: relative;
    gap: 14px;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
  }

  .brand {
    gap: 10px;
    padding: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: 16px;
  }

  nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  nav a {
    min-height: 42px;
    padding: 8px 10px;
  }

  .theme-picker {
    margin-top: 4px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
    padding: 16px;
  }

  .topbar h1 {
    max-width: 15ch;
    font-size: 25px;
    line-height: 1.2;
  }

  .info-card strong,
  .workspace-cockpit-header h2 {
    font-size: 21px;
  }

  .topbar-actions,
  .live-participant-strip,
  .workspace-cockpit-header,
  .hero-panel,
  .table-row {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace-cockpit-grid {
    grid-template-columns: 1fr;
  }

  .calendar-overview-layout {
    grid-template-columns: 1fr;
  }

  /* Mobile: keep all seven columns visible by shrinking the cells instead of forcing a
     horizontal scroll. Event chips collapse to compact dots so days stay legible. */
  .calendar-weekday {
    padding: 6px 2px;
    font-size: 10px;
  }

  .calendar-day {
    padding: 4px 3px;
  }

  .calendar-day-content {
    min-height: 52px;
    gap: 4px;
  }

  .calendar-day-number {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }

  .calendar-day-events {
    flex-direction: row;
    flex-wrap: wrap;
    display: flex;
    gap: 3px;
  }

  .calendar-event-chip {
    width: 7px;
    height: 7px;
    padding: 0;
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary) 70%, var(--accent));
    color: transparent;
    font-size: 0;
  }

  .calendar-more-events {
    padding: 1px 5px;
    font-size: 10px;
  }

  .file-filter-bar {
    grid-template-columns: 1fr;
  }

  .cockpit-lane {
    min-height: auto;
  }

  .live-material-stage {
    grid-template-columns: 1fr;
  }

  /* On phones the focus grid stacks: PDF, then participants + chat, then the tools drawer. */
  .live-room {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    min-height: 0;
  }

  .live-room-main .live-preview:not(.compact) .live-pdf-canvas-wrap {
    height: clamp(320px, 56vh, 520px);
    min-height: 0;
  }

  .live-room-chat {
    min-height: 320px;
  }

  .live-room-main .live-audio-controls {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
  }

  .live-upload-panel {
    grid-template-columns: 1fr;
  }

  .live-pdf-canvas-wrap {
    height: clamp(320px, 62vh, 520px);
  }

  .row-actions {
    justify-content: flex-start;
  }

  .file-row {
    grid-template-columns: 1fr;
  }

  .file-row-main,
  .file-section-select,
  .file-row .row-actions {
    grid-column: auto;
  }

  .file-row .row-actions {
    justify-content: flex-start;
  }

  .file-name,
  .file-meta,
  .upload-feedback span:not(.status-pill) {
    white-space: normal;
  }

  .upload-feedback {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-link,
  .logout-button,
  .form-panel button,
  .inline-form button {
    justify-content: center;
    width: 100%;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

  .inline-edit-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   UI primitive library — frontend/src/ui/* (docs/ux-redesign-plan.md §5.2)
   ========================================================================== */

.ui-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    opacity var(--transition-fast);
}

.ui-button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.ui-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.ui-button--sm {
  min-height: 36px;
  padding: var(--space-1) var(--space-3);
}

.ui-button--primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
}

.ui-button--primary:not(:disabled):hover {
  background: color-mix(in srgb, var(--primary) 88%, var(--foreground));
}

.ui-button--secondary {
  border-color: var(--border);
  background: var(--button-secondary);
  color: var(--foreground);
}

.ui-button--secondary:not(:disabled):hover {
  background: var(--button-secondary-hover);
}

.ui-button--ghost {
  background: transparent;
  color: var(--foreground);
}

.ui-button--ghost:not(:disabled):hover {
  background: var(--surface-tinted);
}

.ui-button--danger {
  border-color: var(--danger);
  background: var(--danger);
  color: var(--primary-foreground);
}

.ui-button--danger:not(:disabled):hover {
  background: color-mix(in srgb, var(--danger) 85%, black);
}

.ui-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  border-radius: var(--radius-pill);
  animation: ui-spin 0.7s linear infinite;
}

@keyframes ui-spin {
  to {
    transform: rotate(360deg);
  }
}

.ui-avatar {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--surface-tinted);
  color: var(--foreground);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  object-fit: cover;
}

.ui-avatar--sm {
  width: 28px;
  height: 28px;
  font-size: var(--text-xs);
}

.ui-avatar--md {
  width: 40px;
  height: 40px;
  font-size: var(--text-sm);
}

.ui-avatar--lg {
  width: 64px;
  height: 64px;
  font-size: var(--text-lg);
}

/* In the live participant strip the avatar fills its round follow button; the initials fallback
   stays transparent so the button's online/following state colors still read through. */
.participant-circle-avatar {
  width: 100%;
  height: 100%;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
}

.ui-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  background: var(--surface-tinted);
  color: var(--muted-foreground);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.ui-badge--info {
  background: var(--surface-tinted);
  color: var(--foreground);
}

.ui-badge--success {
  background: var(--success-surface);
  color: var(--success);
}

.ui-badge--warning {
  background: var(--warning-surface);
  color: var(--warning);
}

.ui-badge--danger {
  background: var(--danger-surface);
  color: var(--danger);
}

.ui-skeleton {
  display: block;
  min-height: 0.75rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--surface-tinted),
    color-mix(in srgb, var(--surface-tinted) 55%, var(--surface)),
    var(--surface-tinted)
  );
  background-size: 200% 100%;
  animation: ui-skeleton-shimmer 1.4s ease-in-out infinite;
}

@keyframes ui-skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.ui-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.ui-field__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.ui-field__hint {
  margin: 0;
  color: var(--muted-foreground);
  font-size: var(--text-xs);
}

.ui-field__error {
  margin: 0;
  color: var(--danger);
  font-size: var(--text-xs);
}

.ui-empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.ui-empty-state__icon {
  display: inline-flex;
  color: var(--muted-foreground);
}

.ui-empty-state__title {
  margin: 0;
  font-weight: var(--weight-semibold);
}

.ui-empty-state__description {
  margin: 0;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

.ui-toast-viewport {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(360px, calc(100vw - 2 * var(--space-4)));
  /* The viewport and toast bodies are click-through so a toast never blocks the controls beneath
     it; only the dismiss button is interactive. */
  pointer-events: none;
}

.ui-toast {
  pointer-events: none;
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.ui-toast--success {
  border-left: 4px solid var(--success);
}

.ui-toast--error {
  border-left: 4px solid var(--danger);
}

.ui-toast--info {
  border-left: 4px solid var(--accent);
}

.ui-toast__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.ui-toast__title {
  font-weight: var(--weight-semibold);
}

.ui-toast__message {
  color: var(--muted-foreground);
  font-size: var(--text-sm);
}

.ui-toast__dismiss {
  pointer-events: auto;
  padding: 0 var(--space-1);
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  font-size: var(--text-lg);
  line-height: 1;
  cursor: pointer;
}

.ui-toast__dismiss:hover {
  color: var(--foreground);
}

@media (prefers-reduced-motion: reduce) {
  /* The universal reset is the standard reduced-motion pattern: `!important` is load-bearing here
     because component rules (e.g. `.ui-spinner`, `.ui-skeleton`) have higher specificity and would
     otherwise keep animating. This also collapses the skeleton shimmer to a static state. */
  *,
  *::before,
  *::after {
    /* biome-ignore lint/complexity/noImportantStyles: must override component animations under reduced motion */
    animation-duration: 0.01ms !important;
    /* biome-ignore lint/complexity/noImportantStyles: must override component animations under reduced motion */
    animation-iteration-count: 1 !important;
    /* biome-ignore lint/complexity/noImportantStyles: must override component transitions under reduced motion */
    transition-duration: 0.01ms !important;
    /* biome-ignore lint/complexity/noImportantStyles: must override smooth scrolling under reduced motion */
    scroll-behavior: auto !important;
  }

  /* Keep the loading spinner turning as a (gentler) motion cue — it conveys "working", so a frozen
     spinner would read as a hang. Needs `!important` to win against the universal reset above. */
  .ui-spinner {
    /* biome-ignore lint/complexity/noImportantStyles: keep the loading spinner animating as a cue */
    animation-duration: 1.6s !important;
    /* biome-ignore lint/complexity/noImportantStyles: keep the loading spinner animating as a cue */
    animation-iteration-count: infinite !important;
  }
}

/* Dropdown menu + user menu (frontend/src/ui/Menu.tsx) */
.ui-menu {
  position: relative;
  display: inline-flex;
}

.ui-menu__trigger {
  display: inline-flex;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  cursor: pointer;
}

.ui-menu__trigger:hover {
  border-color: var(--border);
}

.ui-menu__trigger:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.ui-menu__panel {
  position: absolute;
  top: calc(100% + var(--space-2));
  z-index: var(--z-dialog);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 240px;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.ui-menu__panel--end {
  right: 0;
}

.ui-menu__panel--start {
  left: 0;
}

.user-menu__header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.user-menu__identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.user-menu__identity strong {
  font-weight: var(--weight-semibold);
}

.user-menu__identity span {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  text-overflow: ellipsis;
}

.user-menu__field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.user-menu__field select {
  min-height: 40px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--foreground);
}

.user-menu__logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--foreground);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

.user-menu__logout:hover {
  border-color: var(--danger);
  background: var(--danger-surface);
  color: var(--danger);
}

/* Mobile bottom navigation + "More" sheet (frontend/src/main.tsx BottomNav).
   Hidden on desktop, where the sidebar is the navigation. */
.bottom-nav {
  display: none;
}

.sheet-layer {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sheet-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  background: color-mix(in srgb, black 45%, transparent);
  cursor: pointer;
}

.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-3) calc(var(--space-3) + env(safe-area-inset-bottom));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.sheet__item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--foreground);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.sheet__item.active,
.sheet__item:hover {
  background: var(--surface-tinted);
}

@media (max-width: 899px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .content {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .bottom-nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: var(--z-sticky);
    display: flex;
    justify-content: space-around;
    padding: var(--space-1) var(--space-1) calc(var(--space-1) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--surface);
  }

  .bottom-nav__item {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-height: var(--touch-target);
    padding: var(--space-1);
    border: none;
    background: transparent;
    color: var(--muted-foreground);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    text-decoration: none;
    cursor: pointer;
  }

  .bottom-nav__item.active {
    color: var(--accent);
  }

  .bottom-nav__item:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: -2px;
  }
}

/* Collapsible desktop sidebar (frontend/src/main.tsx) */
.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  min-height: var(--touch-target);
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--nav-muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.sidebar-toggle:hover {
  border-color: color-mix(in srgb, var(--accent) 44%, var(--border-strong));
  background: var(--nav-surface-active);
  color: var(--nav-foreground);
}

.sidebar-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.app-shell[data-sidebar="collapsed"] {
  grid-template-columns: 76px 1fr;
}

.app-shell[data-sidebar="collapsed"] .sidebar {
  padding: 20px 12px;
}

.app-shell[data-sidebar="collapsed"] .brand {
  justify-content: center;
  padding: 10px;
}

.app-shell[data-sidebar="collapsed"] .brand > div,
.app-shell[data-sidebar="collapsed"] .nav-label {
  display: none;
}

.app-shell[data-sidebar="collapsed"] nav a,
.app-shell[data-sidebar="collapsed"] .sidebar-toggle {
  justify-content: center;
}

@media (max-width: 899px) {
  .app-shell[data-sidebar="collapsed"] {
    grid-template-columns: 1fr;
  }
}

/* Profile page + user-menu link (frontend/src/main.tsx) */
.profile-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.profile-avatar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.member-identity {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.onboarding-guide {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.onboarding-steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 1 1 140px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
  background: var(--surface);
}

.onboarding-step.active {
  border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
  color: var(--foreground);
  background: var(--surface-tinted);
}

.onboarding-step.done {
  color: var(--foreground);
}

.onboarding-step-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: var(--radius-pill);
  background: var(--surface-tinted);
  color: var(--muted-foreground);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.onboarding-step.active .onboarding-step-marker {
  background: var(--primary);
  color: var(--primary-foreground, #fff);
}

.onboarding-step.done .onboarding-step-marker {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface-tinted));
  color: var(--primary);
}

.onboarding-hint {
  margin: 0;
  color: var(--muted-foreground);
}

.onboarding-optional {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--surface-tinted);
  color: var(--foreground);
  font-size: var(--text-sm);
}

.dashboard-advanced > summary {
  cursor: pointer;
  padding: var(--space-2) 0;
  color: var(--muted-foreground);
  font-weight: var(--weight-semibold);
  list-style-position: inside;
}

.dashboard-advanced[open] > summary {
  margin-bottom: var(--space-3);
}

.member-identity > div {
  display: flex;
  flex-direction: column;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.profile-identity-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.profile-identity-text h2 {
  margin: 0;
}

.profile-identity-text p {
  margin: 0;
  color: var(--muted-foreground);
}

.profile-form,
.profile-settings {
  display: grid;
  gap: var(--space-3);
  max-width: 360px;
}

.profile-form input {
  min-height: 40px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--foreground);
}

.profile-settings select,
.user-menu__field select {
  min-height: 40px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--foreground);
}

.user-menu__link {
  display: block;
  min-height: var(--touch-target);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  color: var(--foreground);
  font-weight: var(--weight-medium);
  text-decoration: none;
}

.user-menu__link:hover {
  background: var(--surface-tinted);
}

/* Desktop sidebar (shown only ≥900px): the nav list takes the remaining height and scrolls on its
   own, keeping the brand pinned at the top and the collapse toggle pinned at the bottom regardless
   of viewport height or item count. Placed after the base `nav` rules so specificity stays
   ascending (avoids noDescendingSpecificity). */
@media (min-width: 900px) {
  .sidebar > nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
}
