:root {
  color-scheme: dark;
  --bg: #0b1929;
  --surface: #112234;
  --raised: #172f42;
  --ink: #e9f3fb;
  --muted: #abc0d0;
  --line: #2b4659;
  --accent: #85dceb;
  --on-accent: #092733;
  --alert: #ffd59b;
  --alert-bg: #392e29;
  font: 16px/1.5 "Segoe UI", "Arial", sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #eff5f9;
  --surface: #fff;
  --raised: #e9f4f7;
  --ink: #152b42;
  --muted: #435c70;
  --line: #94aab9;
  --accent: #00677b;
  --on-accent: #fff;
  --alert: #723b06;
  --alert-bg: #fff1df;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-underline-offset: .2em; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 3.4vw, 3.25rem); letter-spacing: -.05em; font-weight: 650; line-height: 1.12; }
h2 { font-size: 1.3rem; line-height: 1.25; letter-spacing: -.017em; }
h3, .row-title { font-size: 1rem; font-weight: 650; line-height: 1.35; }
p + p { margin-top: .5rem; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea, .link-button {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: .45rem; padding: .55rem .85rem; min-height: 2.75rem;
}
button, .link-button { cursor: pointer; font-weight: 600; }
button:disabled { opacity: .65; cursor: wait; }
button:hover { background: var(--raised); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
input, select, textarea { display: block; width: 100%; }
input[type="checkbox"] { width: 1.25rem; min-height: 1.25rem; }
label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 600; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.primary:hover { background: var(--accent); filter: brightness(.92); }
.quiet { background: transparent; padding-inline: .7rem; }
.danger { color: var(--alert); background: var(--alert-bg); }
.skip { position: absolute; z-index: 3; left: 1rem; top: -4rem; background: var(--surface); padding: .5rem; }
.skip:focus { top: .5rem; }
.meta { color: var(--muted); font-size: .875rem; }
.meta-line { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; }
.pill {
  display: inline-block; padding: .16rem .6rem; width: fit-content; border: 1px solid var(--line);
  border-radius: 2rem; color: var(--accent); font-size: .82rem; font-weight: 650;
}
.warn { color: var(--alert); background: var(--alert-bg); border-color: currentColor; }
.brand {
  display: inline-flex; gap: .7rem; align-items: center; width: fit-content;
  color: var(--ink); text-decoration: none; font-size: 1.45rem; line-height: 1; letter-spacing: -.047em;
}
.brand b { font-weight: 690; color: var(--accent); }
.stack, .form-stack { display: grid; gap: .85rem; }
.stack > h2 { margin-top: .25rem; }
.login-layout { display: grid; place-items: center; min-height: 100vh; padding: 1.5rem; }
.login-panel { width: min(100%, 28rem); padding: clamp(1.25rem, 5vw, 2.25rem); background: var(--surface); border: 1px solid var(--line); border-radius: .8rem; }
.login-panel .meta { margin-top: .85rem; }
.login-panel h1 { margin: 1.5rem 0 1.35rem; font-size: 2.1rem; }
.office { min-height: 100vh; display: grid; grid-template-columns: 15rem 1fr; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 1.5rem 1rem; }
.sidebar .brand, .sidebar-caption { margin-left: .55rem; }
.sidebar-caption { margin-top: .5rem; }
.menu-toggle { display: none; }
.sidebar nav { display: grid; gap: .25rem; margin-top: 1.65rem; }
.nav-item {
  display: flex; align-items: center; min-height: 2.65rem; padding: .5rem .65rem;
  border: 1px solid transparent; border-radius: .4rem; text-decoration: none; color: var(--muted); font-size: .9rem;
}
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item[aria-current="page"] { color: var(--ink); border-color: var(--line); background: var(--raised); }
.workspace { min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; gap: .6rem; align-items: center;
  padding: .8rem clamp(1rem, 3vw, 2.75rem); border-bottom: 1px solid var(--line); background: var(--surface);
}
.topbar > div, .toolbar, .topbar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; }
#main { width: min(100%, 92rem); margin-inline: auto; padding: clamp(1rem, 3.5vw, 3.1rem); }
.page-title { display: grid; gap: .5rem; margin-bottom: 1.45rem; }
.hero { border-bottom: 1px solid var(--line); padding-bottom: 1.5rem; margin-bottom: 1.5rem; }
.hero .meta { font-size: .95rem; }
.split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; gap: 1.1rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: .7rem; padding: 1.12rem; min-width: 0; }
.panel > h2 { margin-bottom: .75rem; }
.panel + .panel { margin-top: 1rem; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .55rem; align-items: baseline; margin-bottom: .55rem; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { padding: .85rem 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.rows > li:first-child { border-top: 0; }
.rows > li:last-child { padding-bottom: .2rem; }
.rows > li > p { margin-top: .26rem; }
.metric-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .75rem; margin: 0; }
.metric-list > div { background: var(--raised); padding: .75rem; border-radius: .45rem; }
.metric-list dt { font-size: .83rem; color: var(--muted); }
.metric-list dd { margin: 0; color: var(--ink); font-size: 1.55rem; font-weight: 650; }
.finance-metrics { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.finance-metrics dd { overflow-wrap: anywhere; }
.budget-progress { width: 100%; height: .75rem; accent-color: var(--accent); margin-bottom: 1rem; }
.status-text { min-height: 1.5rem; color: var(--alert); margin-top: .65rem; }
.empty { color: var(--muted); padding: .35rem 0; }
.field-row { display: flex; align-items: center; gap: .6rem; }
.field-row input { flex: 0 0 auto; }
.button-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .9rem; }
.compact { width: min(100%, 42rem); }
.date-token { white-space: nowrap; }
.document-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.document-revision { border-top: 1px solid var(--line); padding-block: .9rem; }
.paper-file { padding: .8rem; border: 1px solid var(--line); border-radius: .45rem; overflow-wrap: anywhere; }
.paper-file details { margin-top: .5rem; }
.evidence { display: grid; grid-template-columns: minmax(4rem, 11rem) 1fr; gap: .45rem .8rem; }
.evidence dt { color: var(--muted); }
.evidence dd { margin: 0; }
.studio-downloads { margin-block: .75rem 1rem; }
.metric-row { display: grid; grid-template-columns: 3.2rem minmax(4rem, 24rem) auto; gap: .7rem; align-items: center; }
.metric-row meter { width: 100%; }
.reading-gaps { margin: 0; padding: .5rem .75rem .5rem 1.65rem; background: var(--alert-bg); color: var(--alert); }
.media-controls { margin-block: .7rem; }
.segment-row form { margin-top: .65rem; }
.timestamp { font-variant-numeric: tabular-nums; min-height: 2.15rem; }
#meeting-audio { width: min(100%, 38rem); }
#greeting-comparison > div { flex: 0 1 18rem; min-width: 0; }
#greeting-comparison audio { display: block; width: 100%; }
#voice-file { margin-top: 1rem; }
#voice-result p { margin-top: .6rem; }
.gift-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 1.15rem; }
.hero + .gift-card { margin-bottom: 1.1rem; }
.gift-emblem { width: clamp(3rem, 12vw, 6rem); height: auto; border-radius: .75rem; }
.hero + .gift-card .gift-emblem { animation: reveal-emblem .65s ease-out both; }
@keyframes reveal-emblem { from { opacity: 0; transform: scale(.9); } }
@media (prefers-reduced-motion: reduce) { .hero + .gift-card .gift-emblem { animation: none; } }
:root[data-motion="reduced"] .hero + .gift-card .gift-emblem { animation: none; }
:root[data-avatar="outline"] .gift-emblem, :root[data-avatar="outline"] .brand img { filter: grayscale(1) brightness(1.23); }
.gift-install { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.gift-install img { border-radius: .35rem; }
.gift-settings { margin-top: 1rem; }
.meeting-brief { margin-top: .75rem; }
.table-wrap { overflow-x: auto; }
.workflow-table { width: 100%; border-collapse: collapse; }
.workflow-table td, .workflow-table th { padding: .6rem .45rem; border-bottom: 1px solid var(--line); text-align: left; }
.workflow-table td:nth-child(2), .workflow-table td:nth-child(3), .workflow-table td:nth-child(4) { text-align: right; }
details > summary { cursor: pointer; width: fit-content; }
details > div { margin-top: .65rem; }
@media (max-width: 900px) {
  .office { grid-template-columns: 12.5rem 1fr; }
  .split { grid-template-columns: 1fr; }
}
@media (max-width: 660px) {
  .office { grid-template-columns: minmax(0, 1fr); }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); padding: .85rem .75rem .4rem; }
  .sidebar-caption, #current-role { display: none; }
  .sidebar { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .5rem; }
  .menu-toggle { display: block; }
  .sidebar nav { display: none; grid-column: 1 / -1; margin-top: .3rem; padding-bottom: .25rem; }
  .sidebar nav[data-expanded] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar .brand { margin-left: .25rem; }
  .topbar { padding: .55rem .75rem; }
}
