/*
  Rostra remodel base overrides.
  Linked after styles.css, this file re-skins the existing UI without changing
  the current render contract.
*/

@font-face {
  font-family: "Rostra Inter";
  src: url("./assets/fonts/Inter-opsz-wght.ttf") format("truetype");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Rostra Oswald";
  src: url("./assets/fonts/Oswald-wght.ttf") format("truetype");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --studio-bar-height: 54px;
  --rail-width: 188px;
  --content-max: 1640px;
  --font-sans: "Rostra Inter", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-display: "Rostra Inter", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-label: "Rostra Oswald", "Arial Narrow", "Bahnschrift SemiCondensed", "Avenir Next Condensed", sans-serif;
  --font-mono: "SF Mono", "Andale Mono", "Cascadia Mono", "Roboto Mono", ui-monospace, monospace;
  --font-numeric: var(--font-mono);

  --bg: #f3f6fa;
  --bg-grid: transparent;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --surface-3: #e9edf4;
  --surface-raised: #ffffff;
  --ink: #111827;
  --ink-soft: #334155;
  --ink-muted: #667085;
  --ink-subtle: #8a94a6;
  --line: #d8dee8;
  --line-strong: #b8c2d0;

  --nav: #101419;
  --nav-2: #171d25;
  --nav-3: #202733;
  --nav-ink: #f6f8fb;
  --nav-muted: #a5afbf;

  --accent: #188f7d;
  --accent-strong: #116f62;
  --accent-soft: #d9f3ef;
  --blue: #246bd1;
  --blue-soft: #dceafe;
  --amber: #b87613;
  --amber-soft: #fff0cc;
  --coral: #c83f3f;
  --coral-soft: #ffe1e1;
  --red: #c83f3f;
  --green: #168a53;
  --green-soft: #dcf7e8;
  --cyan: #0b93b6;
  --magenta: #9a4fd6;

  --monitor: #0a0d11;
  --monitor-2: #111722;
  --monitor-ink: #f7fbff;
  --focus-ring: #5aa8ff;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 22px 56px rgba(15, 23, 42, 0.12);
  --inset-highlight: inset 0 1px rgba(255, 255, 255, 0.72);
  --control-shadow: var(--inset-highlight), 0 1px 2px rgba(15, 23, 42, 0.08);
  --control-shadow-active: inset 0 1px 2px rgba(15, 23, 42, 0.16);
  --hardware-shadow: var(--control-shadow);
  --module-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0));
  --module-shadow: var(--inset-highlight), 0 18px 42px rgba(15, 23, 42, 0.08);
  --blue-glow: none;

  --analog-bg: var(--bg);
  --analog-bg-deep: #e2e8f0;
  --analog-panel: var(--surface);
  --analog-panel-2: var(--surface-2);
  --analog-panel-3: var(--surface-3);
  --analog-ink: var(--ink);
  --analog-cream: var(--ink);
  --analog-soft: var(--ink-soft);
  --analog-muted: var(--ink-muted);
  --analog-line: var(--line);
  --analog-line-strong: var(--line-strong);
  --analog-green: var(--green);
  --analog-green-deep: var(--green-soft);
  --analog-amber: var(--amber);
  --analog-red: var(--red);
  --analog-blue: var(--blue);
  --analog-black: var(--surface-2);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08090b;
  --bg-grid: transparent;
  --surface: #111318;
  --surface-2: #181b22;
  --surface-3: #222632;
  --surface-raised: #1c2029;
  --ink: #f4f7fb;
  --ink-soft: #c8d0dc;
  --ink-muted: #8993a3;
  --ink-subtle: #697586;
  --line: #2a2f3a;
  --line-strong: #3a4150;

  --nav: #0a0c10;
  --nav-2: #101319;
  --nav-3: #191d25;
  --nav-ink: #f7faff;
  --nav-muted: #8f9aac;

  --accent: #38d27d;
  --accent-strong: #5be49a;
  --accent-soft: #123423;
  --blue: #5aa8ff;
  --blue-soft: #102843;
  --amber: #ffbf4d;
  --amber-soft: #382713;
  --coral: #ff5d5d;
  --coral-soft: #361b1d;
  --red: #ff5d5d;
  --green: #38d27d;
  --green-soft: #103421;
  --cyan: #35d6ff;
  --magenta: #d36bff;

  --monitor: #07090d;
  --monitor-2: #0d1118;
  --monitor-ink: #f4f7fb;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-sm: 0 14px 34px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 24px 64px rgba(0, 0, 0, 0.34);
  --inset-highlight: inset 0 1px rgba(255, 255, 255, 0.075);
  --control-shadow: var(--inset-highlight), 0 1px 2px rgba(0, 0, 0, 0.28);
  --control-shadow-active: inset 0 1px 2px rgba(0, 0, 0, 0.48);
  --hardware-shadow: var(--control-shadow);
  --module-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0));
  --module-shadow: var(--inset-highlight), 0 18px 48px rgba(0, 0, 0, 0.22);
  --blue-glow: none;

  --analog-bg: var(--bg);
  --analog-bg-deep: #050609;
  --analog-panel: var(--surface);
  --analog-panel-2: var(--surface-2);
  --analog-panel-3: var(--surface-3);
  --analog-ink: var(--ink);
  --analog-cream: var(--ink);
  --analog-soft: var(--ink-soft);
  --analog-muted: var(--ink-muted);
  --analog-line: var(--line);
  --analog-line-strong: var(--line-strong);
  --analog-green: var(--green);
  --analog-green-deep: var(--green-soft);
  --analog-amber: var(--amber);
  --analog-red: var(--red);
  --analog-blue: var(--blue);
  --analog-black: var(--monitor);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fa;
  --bg-grid: transparent;
  --surface: #ffffff;
  --surface-2: #f5f7fb;
  --surface-3: #e9edf4;
  --surface-raised: #ffffff;
  --ink: #111827;
  --ink-soft: #334155;
  --ink-muted: #667085;
  --ink-subtle: #8a94a6;
  --line: #d8dee8;
  --line-strong: #b8c2d0;

  --nav: #f8fafc;
  --nav-2: #eef2f7;
  --nav-3: #e4eaf2;
  --nav-ink: #111827;
  --nav-muted: #667085;

  --accent: #188f7d;
  --accent-strong: #116f62;
  --accent-soft: #d9f3ef;
  --blue: #246bd1;
  --blue-soft: #dceafe;
  --amber: #b87613;
  --amber-soft: #fff0cc;
  --coral: #c83f3f;
  --coral-soft: #ffe1e1;
  --red: #c83f3f;
  --green: #168a53;
  --green-soft: #dcf7e8;
  --cyan: #0b93b6;
  --magenta: #9a4fd6;

  --monitor: #10141b;
  --monitor-2: #151b24;
  --monitor-ink: #f7fbff;
  --focus-ring: #246bd1;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 10px 28px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 22px 56px rgba(15, 23, 42, 0.12);
  --inset-highlight: inset 0 1px rgba(255, 255, 255, 0.72);
  --control-shadow: var(--inset-highlight), 0 1px 2px rgba(15, 23, 42, 0.08);
  --control-shadow-active: inset 0 1px 2px rgba(15, 23, 42, 0.16);
  --hardware-shadow: var(--control-shadow);
  --module-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0));
  --module-shadow: var(--inset-highlight), 0 18px 42px rgba(15, 23, 42, 0.08);
  --blue-glow: none;

  --analog-bg: var(--bg);
  --analog-bg-deep: #e2e8f0;
  --analog-panel: var(--surface);
  --analog-panel-2: var(--surface-2);
  --analog-panel-3: var(--surface-3);
  --analog-ink: var(--ink);
  --analog-cream: var(--ink);
  --analog-soft: var(--ink-soft);
  --analog-muted: var(--ink-muted);
  --analog-line: var(--line);
  --analog-line-strong: var(--line-strong);
  --analog-green: var(--green);
  --analog-green-deep: var(--green-soft);
  --analog-amber: var(--amber);
  --analog-red: var(--red);
  --analog-blue: var(--blue);
  --analog-black: #f8fafc;
}

body,
:root[data-theme="dark"] body {
  background: var(--bg);
  background-size: auto;
}

:root[data-theme="light"] body {
  background: var(--bg);
  background-size: auto;
  color: var(--ink);
}

body::before,
:root[data-theme="dark"] body::before {
  background: none;
}

:root[data-theme="light"] body::before {
  background: none;
}

h1,
h2,
h3,
.studio-label,
.brand-name,
.activity-title h1,
.section-heading h2,
.student-name,
.speaker-name,
.tf-speaker-name {
  letter-spacing: 0;
}

.studio-bar,
.console-chrome {
  min-height: var(--studio-bar-height);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--nav-2) 86%, transparent), var(--nav));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.studio-bar::after {
  opacity: 0;
}

.studio-signal {
  gap: 10px;
}

.tally-light {
  width: 8px;
  height: 8px;
  background: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 13%, transparent);
}

.studio-label {
  color: var(--nav-ink);
  font-size: 0.76rem;
}

.studio-mode,
.top-context,
.save-status,
.theme-toggle-switch,
.save-state-button,
.studio-bar .home-button,
.studio-bar .icon-button,
.top-icon-actions .icon-button {
  border-color: color-mix(in srgb, var(--line-strong) 50%, transparent);
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  color: var(--ink-soft);
  box-shadow: none;
}

.studio-mode {
  min-height: 32px;
  border-radius: 8px;
  padding: 4px 9px;
}

.top-context {
  min-height: 32px;
  padding: 2px;
}

.context-chip,
.top-context .count-pill,
.top-context .status-pill {
  min-height: 26px;
  border-color: transparent;
  background: transparent;
  color: var(--ink-muted);
}

.top-context strong {
  color: var(--ink);
}

.save-state-button,
.theme-toggle-switch {
  min-height: 36px;
}

.app-shell {
  grid-template-columns: var(--rail-width) minmax(0, 1fr);
}

.left-rail {
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface-2) 94%, var(--bg)));
  box-shadow: none;
}

:root[data-theme="light"] .left-rail {
  background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface-2) 94%, var(--bg)));
}

.brand-block {
  gap: 9px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 0.9rem;
  box-shadow: none;
}

.brand-name {
  font-size: 1rem;
}

.brand-subtitle {
  font-size: 0.68rem;
}

.activity-nav {
  gap: 7px;
}

.nav-button {
  min-height: 36px;
  gap: 8px;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
  padding: 6px 7px;
  color: var(--ink-muted);
  font-size: 0.82rem;
  box-shadow: none;
}

.nav-button::before {
  display: none;
}

.nav-icon {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
}

.nav-button:hover {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink);
}

.nav-button.active {
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  background: color-mix(in srgb, var(--blue) 9%, var(--surface));
  color: var(--ink);
  box-shadow: none;
}

.nav-button.active .nav-icon {
  border-color: color-mix(in srgb, var(--blue) 50%, var(--line));
  background: color-mix(in srgb, var(--blue) 16%, var(--surface));
  color: var(--blue);
}

.nav-button-wins.active .nav-icon {
  border-color: color-mix(in srgb, var(--green) 50%, var(--line));
  color: var(--green);
}

.nav-button-think-fast.active .nav-icon {
  border-color: color-mix(in srgb, var(--amber) 52%, var(--line));
  color: var(--amber);
}

.nav-button-never-met.active .nav-icon {
  border-color: color-mix(in srgb, var(--magenta) 48%, var(--line));
  color: var(--magenta);
}

.nav-section-break {
  margin-top: 14px;
}

.nav-section-break::after {
  left: 7px;
  right: 7px;
}

.workspace {
  width: min(var(--content-max), 100%);
  padding: clamp(18px, 2.1vw, 34px);
}

.content-grid {
  gap: clamp(18px, 1.8vw, 28px);
}

.top-bar,
.setup-strip,
.main-panel,
.side-panel,
.log-panel,
.library-toolbar,
.preflight-panel,
.report-panel,
.roster-import-panel,
.class-file-row,
.session-file-row,
.class-stat-card,
.new-session-card,
.speaker-card,
.timer-card,
.presence-card,
.filler-card,
.tf-program-monitor,
.tf-instrument,
.speaker-tracking-card,
.article-card,
.project-card,
.session-card,
.app-modal {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--module-gradient), var(--surface);
  box-shadow: var(--module-shadow);
}

.main-panel,
.side-panel,
.log-panel {
  padding: clamp(16px, 1.55vw, 26px);
}

.screen-active .main-panel,
.screen-active .side-panel {
  background: var(--module-gradient), var(--surface);
}

.activity-header {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom-color: var(--line);
}

.activity-title h1 {
  max-width: 28ch;
}

.activity-title .muted,
.muted,
.muted-count {
  color: var(--ink-muted);
}

.activity-title .muted,
.main-panel p,
.side-panel p,
.log-panel p,
.app-modal p {
  line-height: 1.5;
}

.activity-kicker,
.console-chip,
.count-pill,
.status-pill,
.shortcut {
  border-radius: 7px;
  border-color: var(--line);
  background: color-mix(in srgb, var(--surface-2) 80%, transparent);
  color: var(--ink-soft);
  box-shadow: none;
}

.activity-kicker {
  color: var(--blue);
  font-family: var(--font-label);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.action-cluster,
.command-cluster,
.prompt-dock,
.field-row.prompt-command-row,
.field-row.discussion-command-row {
  border-color: var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    var(--surface-2);
  box-shadow: var(--inset-highlight);
}

input,
textarea,
select {
  min-height: 40px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 10px 12px;
  line-height: 1.35;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

textarea {
  line-height: 1.45;
}

input:focus,
textarea:focus,
select:focus {
  border-color: color-mix(in srgb, var(--focus-ring) 70%, var(--line));
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 18%, transparent);
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.small-button,
.rating-button,
.filler-button,
.stepper-button,
.participation-toggle,
.presence-disclosure,
input[type="file"]::file-selector-button {
  border-radius: 8px;
  line-height: 1.2;
  box-shadow: none;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
input[type="file"]::file-selector-button {
  min-height: 42px;
  padding: 10px 14px;
}

.small-button,
.rating-button,
.filler-button,
.stepper-button,
.participation-toggle,
.presence-disclosure {
  line-height: 1.15;
}

.primary-button {
  border-color: color-mix(in srgb, var(--green) 58%, var(--line));
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 92%, #ffffff), var(--green));
  color: #07100b;
}

.primary-button:hover:not(:disabled) {
  background: linear-gradient(180deg, color-mix(in srgb, var(--green) 96%, #ffffff), color-mix(in srgb, var(--green) 86%, #000000));
}

.secondary-button {
  border-color: color-mix(in srgb, var(--blue) 34%, var(--line));
  background: color-mix(in srgb, var(--blue) 8%, var(--surface-raised));
  color: color-mix(in srgb, var(--blue) 82%, var(--ink));
}

.ghost-button,
.small-button,
.rating-button,
.participation-toggle,
input[type="file"]::file-selector-button {
  border-color: var(--line);
  background: var(--surface-raised);
  color: var(--ink-soft);
}

.danger-button {
  border-color: color-mix(in srgb, var(--red) 42%, var(--line));
  background: color-mix(in srgb, var(--red) 9%, var(--surface-raised));
  color: var(--red);
}

.secondary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled),
.small-button:hover:not(:disabled),
.rating-button:hover:not(:disabled),
.participation-toggle:hover:not(:disabled),
input[type="file"]::file-selector-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
  color: var(--ink);
}

.timer-card {
  border-color: color-mix(in srgb, var(--blue) 28%, var(--line));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--blue) 9%, transparent), transparent 48%),
    var(--monitor);
  color: var(--monitor-ink);
}

.timer-readout,
.filler-total span {
  font-variant-numeric: tabular-nums;
}

.timer-readout {
  color: var(--monitor-ink);
}

.timer-card .count-pill {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.055);
  color: color-mix(in srgb, var(--monitor-ink) 82%, transparent);
}

.timer-card .secondary-button,
.timer-card .ghost-button {
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.075);
  color: var(--monitor-ink);
}

.speaker-card::after {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--blue) 8%, transparent), transparent 48%),
    linear-gradient(180deg, transparent 0 calc(100% - 2px), color-mix(in srgb, var(--blue) 34%, transparent) calc(100% - 2px));
  opacity: 1;
}

.presence-card,
.filler-card,
.speaker-tracking-card,
.queue-block {
  background: var(--surface);
}

.presence-row,
.roster-row,
.queue-row,
.log-row,
.grid-row,
.next-three-row {
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 76%, transparent);
  box-shadow: none;
}

.rating-button.active,
.participation-toggle.active,
.small-button.active {
  border-color: color-mix(in srgb, var(--green) 44%, var(--line));
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
  color: color-mix(in srgb, var(--green) 80%, var(--ink));
}

.filler-hardware,
.filler-total {
  border-color: color-mix(in srgb, var(--amber) 28%, var(--line));
  background: color-mix(in srgb, var(--amber) 8%, var(--surface));
  box-shadow: none;
}

.stepper-button,
.filler-button {
  border-color: color-mix(in srgb, var(--amber) 34%, var(--line));
  background: color-mix(in srgb, var(--amber) 9%, var(--surface-raised));
  color: var(--ink);
}

.status-pill.available,
.status-available,
.roster-summary-meter.status-available {
  border-color: color-mix(in srgb, var(--green) 42%, var(--line));
  background: color-mix(in srgb, var(--green) 11%, var(--surface));
  color: color-mix(in srgb, var(--green) 78%, var(--ink));
}

.status-pill.late,
.status-late,
.roster-summary-meter.status-late {
  border-color: color-mix(in srgb, var(--amber) 46%, var(--line));
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
  color: color-mix(in srgb, var(--amber) 78%, var(--ink));
}

.status-pill.left,
.status-left,
.status-pill.absent,
.status-absent,
.roster-summary-meter.status-left,
.roster-summary-meter.status-absent {
  border-color: color-mix(in srgb, var(--red) 42%, var(--line));
  background: color-mix(in srgb, var(--red) 10%, var(--surface));
  color: color-mix(in srgb, var(--red) 82%, var(--ink));
}

.side-panel {
  position: sticky;
  top: calc(var(--studio-bar-height) + 18px);
  max-height: calc(100dvh - var(--studio-bar-height) - 36px);
  overflow: auto;
}

.roster-drawer > summary {
  border-radius: 8px;
}

.roster-summary-board {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.roster-operator-sheet {
  gap: 7px;
}

.roster-status-group,
.roster-status-group.status-available,
.roster-status-group.status-late,
.roster-status-group.status-left,
.roster-status-group.status-absent,
.roster-status-group.status-notSeen {
  border-color: transparent;
  background: transparent;
  color: var(--ink);
}

.roster-operator-sheet .roster-group-heading.table-header,
.roster-group-heading {
  border-color: var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
}

.roster-status-group.status-available .roster-group-heading {
  border-left: 3px solid var(--green);
}

.roster-status-group.status-late .roster-group-heading {
  border-left: 3px solid var(--amber);
}

.roster-status-group.status-left .roster-group-heading,
.roster-status-group.status-absent .roster-group-heading {
  border-left: 3px solid var(--red);
}

.roster-status-group.status-notSeen .roster-group-heading {
  border-left: 3px solid var(--line-strong);
}

.article-card-meta {
  min-width: 0;
  flex-wrap: wrap;
}

.article-card-meta > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-panel .roster-row {
  gap: 7px;
  padding: 8px;
}

.roster-signal-cell {
  gap: 5px;
}

.roster-signal-cell .count-pill {
  min-height: 21px;
  padding: 2px 6px;
  font-size: 0.68rem;
}

.roster-status-buttons {
  gap: 5px;
}

.roster-status-buttons .small-button {
  min-height: 28px;
  padding: 4px 6px;
  font-size: 0.7rem;
}

.screen-active .log-panel {
  margin-top: 16px;
  padding: 10px 12px;
}

.log-panel {
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  box-shadow: var(--inset-highlight);
}

.log-panel .section-heading {
  min-height: 30px;
  margin-bottom: 6px;
}

.log-panel .section-heading h2 {
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.log-panel .muted-count {
  font-size: 0.72rem;
}

.session-log {
  gap: 5px;
  max-height: 118px;
  overflow: auto;
}

.screen-active .session-log:not(.event-timeline) {
  max-height: none;
  overflow: visible;
}

.screen-active .session-log:has(.session-ticker[open]) {
  max-height: none;
}

.session-log .empty-state {
  min-height: 54px;
  padding: 8px;
}

.session-log .empty-state h2 {
  font-size: 0.9rem;
}

.session-log .empty-state p {
  display: none;
}

.log-row {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 30px;
  padding: 5px 8px;
  font-size: 0.78rem;
}

.log-row .muted {
  max-width: none;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  white-space: nowrap;
}

.session-ticker {
  display: grid;
  gap: 6px;
}

.session-ticker summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.session-ticker-expanded {
  display: grid;
  gap: 5px;
  max-height: none;
  overflow: visible;
}

.session-ticker[open] .session-ticker-collapsed {
  display: none;
}

.session-ticker[open],
.log-panel[open],
.log-panel.expanded,
.log-panel.is-expanded {
  padding: 14px;
}

.session-ticker[open] .session-ticker-expanded,
.log-panel[open] .session-log,
.log-panel.expanded .session-log,
.log-panel.is-expanded .session-log {
  max-height: none;
  overflow: visible;
}

.event-timeline.session-log {
  max-height: min(52dvh, 620px);
}

@media (min-width: 1180px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  }
}

@media (max-width: 980px) {
  :root {
    --rail-width: 100%;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .left-rail {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 10px 12px;
    overflow-x: auto;
  }

  .brand-block {
    flex: 0 0 auto;
  }

  .activity-nav {
    display: flex;
    min-width: max-content;
  }

  .nav-button {
    min-width: max-content;
  }

  .side-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 1320px) and (min-width: 981px) {
  .app-shell {
    grid-template-columns: var(--rail-width) minmax(0, 1fr);
  }

  .left-rail {
    position: sticky;
    top: var(--studio-bar-height);
    align-self: start;
    height: calc(100dvh - var(--studio-bar-height));
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 18px;
    padding: 18px 14px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    overflow: visible;
  }

  .activity-nav {
    display: grid;
    grid-template-columns: 1fr;
    width: auto;
    min-width: 0;
    overflow: visible;
  }

  .nav-button {
    justify-content: flex-start;
    min-width: 0;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .studio-bar {
    gap: 8px;
    padding: 7px 10px;
  }

  .studio-label,
  .brand-subtitle,
  .nav-label {
    display: none;
  }

  .workspace {
    padding: 14px;
  }

  .main-panel,
  .side-panel,
  .log-panel {
    padding: 14px;
  }

  .screen-active .log-panel {
    padding: 9px;
  }
}
