:root {
  --ink: #132337;
  --muted: #4b5c6e;
  --accent: #09657b;
  --accent-deep: #064b5d;
  --accent-pale: #e7f2f5;
  --night: #122335;
  --night-line: #34495c;
  --night-text: #eaf3f9;
  --night-muted: #a9bdcc;
  --border: #d6e0e8;
  --surface: #ffffff;
  --canvas: #f3f6f9;
  --warning: #805100;
  --warning-bg: #fff4d8;
  --error: #9c2735;
  --error-bg: #fff0ef;
  --good: #24644d;
  --good-bg: #eaf5ee;
  --radius: 12px;
  font: 16px/1.5 "Segoe UI", "Arial", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }
a { color: var(--accent-deep); text-underline-offset: .2em; }
a:hover { color: var(--accent); }
button, input, select { font: inherit; }
button, .button, .nav-link { cursor: pointer; }
button:disabled, [aria-disabled="true"] { cursor: default; opacity: .58; }
:focus-visible { outline: 3px solid #208298; outline-offset: 3px; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 20; padding: 10px 16px; background: var(--surface); transform: translateY(-180%); }
.skip:focus { transform: none; }
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.shell.menu-collapsed { grid-template-columns: minmax(0, 1fr); }
.shell.menu-collapsed .sidebar { display: none; }
.sidebar { display: flex; flex-direction: column; min-width: 0; padding: 24px 16px 16px; color: var(--night-text); background: var(--night); }
.wordmark { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.wordmark:hover { color: inherit; }
.sidebar .wordmark { padding: 0 7px 25px; }
.wordmark strong, .wordmark small { display: block; }
.wordmark strong { letter-spacing: .14em; font-size: .99rem; }
.wordmark small { color: var(--night-muted); font-size: .78rem; }
.mark { display: block; flex: 0 0 auto; width: 42px; height: 50px; object-fit: contain; }
.nav-group { padding: 13px 10px 6px; color: var(--night-muted); font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.nav-link { display: flex; align-items: center; min-height: 44px; margin: 2px 0; padding: 7px 11px; gap: 9px; color: var(--night-text); text-decoration: none; border: 1px solid transparent; border-radius: 8px; font-size: .89rem; }
.nav-link:hover { color: var(--night-text); background: #1d3448; }
.nav-link[aria-current="page"] { color: #fff; font-weight: 650; background: #244659; border-color: #3a6176; }
.nav-link[aria-current="page"]::before { content: ""; height: 14px; width: 3px; background: #84d9e3; border-radius: 2px; }
.workspace { min-width: 0; }
.quick-nav { display: none; }
.topbar { min-height: 64px; display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px clamp(16px, 3vw, 44px); border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar-label { margin-right: auto; font-weight: 650; }
.session { display: flex; align-items: center; gap: 12px; font-size: .88rem; min-width: 0; }
.session span { overflow-wrap: anywhere; }
.menu-toggle { flex: 0 0 auto; }
.content { max-width: 1440px; margin: 0 auto; padding: clamp(18px, 3vw, 46px); }
.content:focus { outline: none; }
.page-header { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.page-header p { margin: 5px 0 0; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(1.63rem, 3.2vw, 2.45rem); line-height: 1.13; letter-spacing: -.025em; }
h2 { margin: 0 0 14px; font-size: 1.23rem; line-height: 1.28; }
h3 { margin: 0 0 6px; font-size: 1rem; }
p { margin: 0 0 12px; }
.muted, small { color: var(--muted); }
small { font-size: .82rem; }
.stack { display: grid; gap: 14px; }
.flow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.grow { flex: 1; }
.primary, .secondary, .button { display: inline-flex; min-height: 44px; justify-content: center; align-items: center; border: 1px solid transparent; border-radius: 8px; padding: 8px 13px; font-size: .91rem; line-height: 1.3; font-weight: 650; text-decoration: none; }
.primary { background: var(--accent); color: #fff; }
.primary:hover { color: #fff; background: var(--accent-deep); }
.secondary, .button { background: var(--surface); color: var(--ink); border-color: #b6c8d6; }
.secondary:hover, .button:hover { color: var(--accent-deep); border-color: var(--accent); background: var(--accent-pale); }
.compact { padding-inline: 8px; min-width: 44px; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(14px, 2vw, 23px); }
.surface-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 310px), 1fr)); gap: 16px; margin: 16px 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 156px), 1fr)); gap: 10px; margin-bottom: 16px; }
.kpi { min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px; }
.kpi strong { display: block; margin-top: 5px; font-size: 1.8rem; font-variant-numeric: tabular-nums; line-height: 1.12; }
.kpi span { display: block; color: var(--muted); font-size: .83rem; }
.list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.list > li { padding: 10px 0; border-top: 1px solid var(--border); min-width: 0; }
.list > li:last-child { padding-bottom: 0; }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list p { margin: 6px 0 0; }
.source-title, .case-number { font-weight: 650; }
.pill { display: inline-block; max-width: 100%; padding: 3px 8px; border: 1px solid transparent; border-radius: 6px; font-size: .77rem; line-height: 1.4; font-weight: 650; background: #edf2f6; color: #32485b; overflow-wrap: anywhere; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warning-bg); color: var(--warning); }
.pill.error { background: var(--error-bg); color: var(--error); }
.notice { padding: 10px 12px; margin: 0; border-radius: 7px; color: var(--accent-deep); background: var(--accent-pale); }
.notice.error { color: var(--error); background: var(--error-bg); }
.notice.warn { color: var(--warning); background: var(--warning-bg); }
.empty { padding: 16px 0; color: var(--muted); }
.filters { align-items: end; margin-bottom: 16px; }
.filters label { flex: 0 1 235px; }
.filters label:first-child { flex: 1 1 255px; }
label { display: grid; gap: 5px; color: var(--ink); font-size: .88rem; font-weight: 600; min-width: 0; }
input, select { min-height: 44px; width: 100%; min-width: 0; background: var(--surface); border: 1px solid #aebfcd; border-radius: 8px; padding: 8px 10px; color: var(--ink); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .91rem; }
th, td { padding: 10px 9px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--muted); font-size: .8rem; background: var(--canvas); }
th:first-child, td:first-child { padding-left: 10px; }
tr:last-child td { border-bottom: 0; }
.paginator { justify-content: flex-end; margin-top: 12px; }
.paginator span { margin-right: auto; }
.meta { display: grid; grid-template-columns: minmax(100px, 165px) minmax(0, 1fr); gap: 6px 10px; margin: 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.time { font-variant-numeric: tabular-nums; }
.calendar-shell { display: grid; gap: 14px; }
.calendar-action[aria-current="page"] { color: var(--accent-deep); background: var(--accent-pale); border-color: var(--accent); }
.calendar-date-picker { margin-bottom: 12px; }
.calendar-date-picker summary { min-height: 44px; margin: 0; padding: 9px 0; color: var(--accent-deep); font-weight: 650; }
.month-head { justify-content: space-between; }
.month-head h2 { margin: 0; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.weekday { color: var(--muted); font-size: .75rem; text-align: center; }
.day { display: flex; flex-direction: column; justify-content: space-between; min-height: 65px; min-width: 0; padding: 6px; text-align: left; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--ink); }
.day:hover, .day[aria-pressed="true"] { background: var(--accent-pale); border-color: var(--accent); }
.day[aria-current="date"] span:first-child { font-weight: 750; color: var(--accent-deep); }
.day .day-count { color: var(--accent-deep); font-weight: 650; font-size: .73rem; }
.hearing-actions { margin-top: 6px; }
.hearing-actions a { display: inline-flex; min-height: 44px; align-items: center; }
.hearing-actions [role="status"]:empty { display: none; }
.event-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.log { border-left: 2px solid var(--border); padding-left: 13px; }
.log li { padding: 9px 0; }
.log-entry-text { margin-top: 4px; overflow-wrap: anywhere; }
.chart { display: grid; gap: 11px; }
.chart-row { display: grid; gap: 5px; }
.chart-row > div:first-child { display: flex; justify-content: space-between; gap: 10px; font-size: .83rem; }
.chart-track { display: block; min-height: 8px; border-radius: 5px; background: #edf2f6; overflow: hidden; }
.chart-fill { display: block; min-height: 8px; background: var(--accent); }
.access, .boot { display: grid; min-height: 100vh; place-items: center; padding: 20px; }
.access-box { width: min(100%, 410px); padding: clamp(20px, 5vw, 34px); border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.access-wordmark { margin-bottom: 22px; }
.access-wordmark small { color: var(--muted); }
.access h1 { font-size: 1.65rem; margin-bottom: 20px; }
.architecture { display: grid; gap: 8px; margin: 0; padding-left: 22px; }
@media (max-width: 860px) {
  :root { --mobile-bar: calc(107px + env(safe-area-inset-top, 0px)); }
  html { scroll-padding-top: var(--mobile-bar); }
  .shell { display: block; }
  .sidebar {
    display: none;
    position: fixed;
    z-index: 9;
    inset: var(--mobile-bar) 0 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px max(16px, env(safe-area-inset-right, 0px))
      max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  }
  .shell.menu-open .sidebar { display: flex; }
  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: 44px 44px;
    position: sticky;
    top: 0;
    z-index: 10;
    height: var(--mobile-bar);
    gap: 6px 8px;
    padding: calc(6px + env(safe-area-inset-top, 0px))
      max(12px, env(safe-area-inset-right, 0px)) 6px max(12px, env(safe-area-inset-left, 0px));
  }
  .topbar-label { display: none; }
  .topbar .session { justify-content: flex-end; white-space: nowrap; gap: 6px; }
  #session-name { overflow: hidden; text-overflow: ellipsis; }
  .quick-nav { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .quick-nav .button { padding-inline: 5px; }
  .calendar-today { display: none; }
  .quick-nav [aria-current="page"] { color: var(--accent-deep); background: var(--accent-pale); border-color: var(--accent); }
  .content {
    padding-right: max(clamp(18px, 3vw, 46px), env(safe-area-inset-right, 0px));
    padding-bottom: max(clamp(18px, 3vw, 46px), env(safe-area-inset-bottom, 0px));
    padding-left: max(clamp(18px, 3vw, 46px), env(safe-area-inset-left, 0px));
  }
}
@media (max-width: 560px) {
  .calendar-grid { gap: 3px; }
  .day { min-height: 47px; font-size: .81rem; padding: 4px; }
  .day .day-count { font-size: .66rem; }
  .meta { grid-template-columns: minmax(70px, 105px) minmax(0, 1fr); }
  .filters label { flex: 1 0 100%; }
  .filters label:first-child { flex: 1 0 100%; }
  .table-wrap { overflow: visible; }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; min-width: 0; }
  table.responsive thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.responsive tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  table.responsive tr:last-child { border-bottom: 0; }
  table.responsive td { display: grid; grid-template-columns: minmax(75px, 32%) minmax(0, 1fr); gap: 8px; border: 0; padding: 3px 0; }
  table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }


.panel-actions { margin-top: 12px; }
.chart meter { width: 100%; height: 12px; accent-color: var(--accent); }
.chart meter::-webkit-meter-bar { background: #edf2f6; border: 0; border-radius: 6px; height: 8px; }
.chart meter::-webkit-meter-optimum-value { background: var(--accent); }
.chart meter::-moz-meter-bar { background: var(--accent); }
.choice { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.choice input { min-height: 20px; width: 20px; height: 20px; accent-color: var(--accent); }
summary { cursor: pointer; width: fit-content; margin-bottom: 8px; }


.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 12px; }
textarea { min-height: 100px; width: 100%; resize: vertical; font: inherit; background: var(--surface); color: var(--ink); border: 1px solid #aebfcd; border-radius: 8px; padding: 8px 10px; }
.workflow-fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 0; min-width: 0; }
.workflow-fieldset legend { padding: 0 6px; font-size: .88rem; font-weight: 650; }
.workflow-fieldset button { justify-self: start; }
.workflow-result { margin-top: 14px; padding: 12px 0 0; border-top: 1px solid var(--border); }
.workflow-result .error { margin-block: 4px; }

.nav-section + .nav-section { border-top: 1px solid var(--night-line); margin-top: 8px; padding-top: 8px; }
.nav-group { width: 100%; min-height: 44px; margin-bottom: 3px; border-radius: 6px; }
.nav-group::marker { color: #82c8bc; }
.nav-group:hover { color: #fff; background: #1d3448; }
.nav-section[open] > .nav-group { color: #c6e8e3; }
.day.has-hearing:not([aria-pressed="true"]) { border-color: #9ec7bf; background: #eaf5f2; color: #103f38; }
.conflict-note { margin-bottom: 6px; width: fit-content; padding: 3px 8px; border-radius: 6px; background: #fff0d9; color: #603909; font-weight: 650; font-size: .82rem; }
.remember:not([hidden]) { display: flex; align-items: center; gap: 8px; }
.remember input { width: auto; margin: 0; }
.install-access { margin-top: 12px; }
.timeline { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline li { position: relative; display: grid; gap: 3px; margin-left: 6px; padding: 0 0 14px 16px; border-left: 2px solid var(--border); }
.timeline li::before { position: absolute; top: .36rem; left: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); content: ""; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li p, .next-hearing p { margin: 0; }
.timeline strong, .file-row strong { overflow-wrap: anywhere; }
.next-hearing { padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; }
.next-hearing.is-scheduled { border-color: #97c6d0; border-left: 4px solid var(--accent); background: var(--accent-pale); }
.next-hearing.is-scheduled .hearing-slot strong { font-size: 1.14rem; }
.hearing-slot { display: grid; gap: 4px; }
.other-hearings { margin-top: 16px; }
.file-row { display: grid; gap: 6px; }
.file-preview summary { display: list-item; min-height: 44px; margin: 0; padding: 10px 12px; border: 1px solid #b6c8d6; border-radius: 8px; color: var(--ink); font-size: .91rem; font-weight: 650; }
.file-preview summary:hover, .file-preview[open] summary { border-color: var(--accent); background: var(--accent-pale); }
.file-preview-body { margin-top: 8px; }
.file-preview-text { max-height: 24rem; overflow: auto; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--canvas); }
.file-preview-text, .ai-draft { white-space: pre-wrap; overflow-wrap: anywhere; }
.file-error { color: var(--error); }
.file-analysis h4 { margin: 0 0 4px; }
.file-analysis .file-consent { align-items: flex-start; font-weight: 400; }
.file-analysis .file-consent input { flex: 0 0 auto; }
.file-upload { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.file-upload input[type="file"] { max-width: 30rem; }
@media (max-width: 700px) { .nav-link, .nav-group { min-height: 44px; } .session { gap: 6px; } }

.meeting-audio-player { width: 100%; }
