:root {
  color-scheme: light;
  --bg: #004f76;
  --panel: #ffffff;
  --ink: #1c3545;
  --muted: #5d7483;
  --line: #dbe6ed;
  --blue: #2863b4;
  --green: #18794e;
  --red: #be3946;
  --amber: #916518;
  --accent: #004f76;
  --sidebar: #004f76;
  --accent-hover: #003c5b;
  --tint: #eef5f9;
  --on-brand: #f7fbff;
  --brand-line: #ffffff30;
  --hearing: #7951ad;
  --shadow: none;
}

* { letter-spacing: 0; }
body { display: block; font-family: "Segoe UI", Arial, sans-serif; font-size: 14px; line-height: 1.5; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; background: var(--accent); border-radius: 6px; padding: 9px 14px; min-height: 40px; font-weight: 600; transition: background .15s, border-color .15s; }
button:hover { background: var(--accent-hover); filter: none; }
button:disabled { opacity: .45; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #6aa9d1; outline-offset: 3px; }
input:focus, select:focus, textarea:focus { outline: 2px solid #b8d8e9; outline-offset: 1px; border-color: var(--accent); }
button svg, a svg, .section-icon svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.8; }
.icon-button { width: 40px; height: 40px; padding: 0; flex-shrink: 0; }
.primary-button { background: var(--accent); }
.secondary-button { background: #fff; border-color: var(--line); color: var(--ink); }
.secondary-button:hover { background: var(--tint); border-color: #abc8d9; }
.danger-button { background: #fff; border-color: #ecd4d8; color: var(--red); }
.danger-button:hover { background: #fff0f1; border-color: var(--red); }
.hearing-button { background: var(--hearing); }
.hearing-button:hover { background: #664394; }
.task-button { background: var(--green); }
.task-button:hover { background: #12633f; }

.admin-shell { grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { display: grid; grid-template-rows: minmax(min-content, 1fr) auto auto; align-self: start; background: var(--sidebar); color: var(--on-brand); gap: 4px; border: 0; border-right: 1px solid var(--brand-line); padding: 12px 14px 8px; height: auto; min-height: 100dvh; }
.sidebar-content { display: flex; flex-direction: column; gap: 6px; }
.brand { display: grid; justify-items: center; gap: 5px; padding: 0 4px 6px; border: 0; text-align: center; }
.brand .brand-mark { display: block; position: relative; width: 68px; height: 54px; overflow: hidden; margin: 0; }
.brand-mark img { position: absolute; width: 230px; height: auto; max-width: none; left: -81px; top: -159px; }
.brand strong { font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--on-brand); }
.brand div > span { color: #d4e6ef; font-size: 10px; margin-top: 2px; }
.nav-caption { color: #c0dbe9; font-size: 10px; font-weight: 600; margin: 0; padding: 0 12px 4px; }
.side-nav { gap: 3px; }
.nav-item { min-height: 36px; padding: 7px 10px; background: transparent; color: #d8e8f0; font-weight: 500; border: 0; }
.nav-item svg { width: 19px; height: 19px; margin-right: 4px; }
.nav-item:hover { background: #ffffff14; color: #fff; }
.nav-item.active { background: #f7fbff; color: var(--accent); font-weight: 650; box-shadow: inset 3px 0 #9ac8df; }
.quick-links { gap: 3px; padding-top: 8px; border: 0; }
.quick-link { display: flex; gap: 8px; color: #d8e8f0; background: transparent; min-height: 34px; padding: 6px 10px; font-size: 12px; font-weight: 500; }
.quick-link:hover { background: #ffffff14; color: #fff; }
.portal-icon { display: block; width: 24px; height: 24px; flex: 0 0 24px; object-fit: contain; border-radius: 4px; }
.quick-link svg:last-child { margin-left: auto; width: 14px; height: 14px; color: #c0dbe9; }
.sidebar-profile { display: flex; align-items: center; gap: 8px; padding: 10px 5px 0; margin-top: 0; border-top: 1px solid var(--brand-line); }
.profile-avatar { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 50%; background: #ffffff20; color: #f7fbff; font-size: 11px; font-weight: 700; }
.sidebar-profile strong { font-size: 11px; display: block; font-weight: 600; }
.sidebar-profile div > span { display: block; color: #c0dbe9; font-size: 10px; margin-top: 3px; overflow-wrap: anywhere; }
.main-panel { padding: 0 32px 36px; gap: 24px; align-content: start; color: var(--on-brand); }
.workspace-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; color: #d4e6ef; border-bottom: 1px solid var(--brand-line); font-size: 12px; }
.workspace-bar > span { display: flex; gap: 9px; align-items: center; }
.workspace-bar svg { width: 16px; height: 16px; }
.workspace-bar time { text-align: right; }
.topbar { padding-top: 3px; }
.topbar .eyebrow { color: #c0dbe9; }
.topbar-actions > .primary-button { background: #f7fbff; color: var(--accent); border-color: #f7fbff; }
.topbar-actions > .primary-button:hover { background: #dcecf5; border-color: #dcecf5; }
.topbar h1 { font-family: inherit; font-size: 27px; line-height: 1.25; font-weight: 650; }
.eyebrow { margin: 0 0 5px; font-size: 11px; font-weight: 500; text-transform: none; }
.topbar-actions { flex-wrap: nowrap; }
.server-chip { font-size: 12px; margin-top: 15px; }
.view { min-width: 0; }
.view.active { animation: reveal .15s ease-out; }
@keyframes reveal { from { opacity: .7; } to { opacity: 1; } }

.metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metrics article { position: relative; color: var(--ink); background: #f7fbfd; border: 1px solid #dbe6ed; border-top: 3px solid var(--blue); border-radius: 6px; padding: 18px 20px; min-height: 133px; }
.metrics article > span { display: block; font-size: 12px; padding-right: 32px; }
.metrics strong { font-size: 31px; line-height: 1.2; font-weight: 650; margin-top: 9px; font-variant-numeric: tabular-nums; }
.metrics small { display: block; font-size: 11px; color: var(--muted); margin-top: 7px; }
.metrics .metric-icon { position: absolute; top: 17px; right: 18px; width: 21px; height: 21px; color: var(--blue); stroke-width: 1.6; }
.metrics .metric-done { border-top-color: var(--green); }
.metric-done .metric-icon { color: var(--green); }
.metrics .metric-week { border-top-color: var(--hearing); }
.metric-week .metric-icon { color: var(--hearing); }
.metrics .metric-today { border-top-color: var(--amber); }
.metric-today .metric-icon { color: var(--amber); }

.dashboard-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 0 24px; border-bottom: 1px solid var(--brand-line); margin-bottom: 24px; }
.dashboard-intro .eyebrow { color: #c0dbe9; }
.signature { font-family: "Segoe Script", "Lucida Handwriting", cursive; font-size: 25px; line-height: 1.45; font-weight: 600; margin: 0; color: var(--on-brand); }
.agenda-caption { display: flex; align-items: center; gap: 8px; color: #d4e6ef; font-size: 12px; }
.agenda-caption svg { width: 17px; height: 17px; color: #f7fbff; }
.dashboard-grid, .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.panel { color: var(--ink); padding: 22px; border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.panel h2 { font-size: 17px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.panel-heading { padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.section-icon { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; background: var(--tint); color: var(--accent); border-radius: 6px; }
.stack { margin-top: 8px; gap: 0; }
.stack-item { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 15px 0; overflow-wrap: anywhere; }
.stack-item:last-child { border-bottom: 0; }
.stack-item strong { font-weight: 600; margin-bottom: 0; }
.muted { font-size: 12px; }
.event-link { display: flex; justify-content: flex-start; align-items: flex-start; gap: 12px; font-weight: 400; }
.event-link.notification, .event-link.hearing, .event-link.task { border-left: 0; }
.event-link:hover { background: var(--tint); }
.event-symbol { display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; border-radius: 6px; color: var(--blue); background: #eef4fc; margin-top: 2px; }
.event-symbol svg { width: 17px; height: 17px; }
.hearing .event-symbol { color: var(--hearing); background: #f4effa; }
.task .event-symbol { color: var(--green); background: #edf6f0; }
.event-copy { min-width: 0; display: grid; gap: 4px; }
.event-copy > strong { font-size: 13px; }
.event-copy .event-case { font-size: 12px; }
.event-notes { white-space: pre-wrap; }
.event-arrow { width: 15px; height: 15px; color: #7e9bad; margin-left: auto; flex-shrink: 0; align-self: center; }
.empty-state { display: flex; align-items: center; gap: 14px; padding: 32px 4px; color: var(--muted); min-height: 112px; }
.empty-state svg { width: 28px; height: 28px; color: #7799af; flex-shrink: 0; stroke-width: 1.3; }
.empty-state strong { color: #496a80; font-size: 13px; font-weight: 500; }
.activity-item { display: flex; align-items: flex-start; gap: 13px; }
.activity-item > svg { width: 16px; height: 16px; color: #7799af; margin-top: 3px; flex-shrink: 0; }
.activity-item strong { font-size: 11px; color: var(--muted); font-weight: 500; margin-top: 3px; }
.activity-item .activity-text { font-size: 13px; color: var(--ink); }

.workspace { grid-template-columns: minmax(0, 1.25fr) minmax(330px, 1fr); gap: 24px; scroll-margin-top: 18px; }
.search-field { position: relative; display: flex; align-items: center; width: min(290px, 55%); }
.search-field > svg { position: absolute; left: 11px; width: 16px; height: 16px; color: #7799af; pointer-events: none; }
.search-field input { padding-left: 35px; min-width: 0; }
#search { min-width: 0; }
input, select, textarea { border-color: #cbdce7; border-radius: 5px; padding: 9px 11px; font-weight: 400; }
input::placeholder, textarea::placeholder { color: #6c8596; font-size: 12px; }
textarea { line-height: 1.6; }
label { color: #496779; font-size: 12px; font-weight: 600; }
.table-wrap { margin-top: 8px; }
th, td { padding: 15px 10px; font-size: 12px; }
th { font-weight: 500; font-size: 10px; background: var(--tint); padding-top: 11px; padding-bottom: 11px; text-transform: none; }
th:first-child, td:first-child { width: 34%; }
th:nth-child(2), td:nth-child(2) { width: 26%; }
th:nth-child(3), td:nth-child(3) { width: 23%; }
th:nth-child(4), td:nth-child(4) { width: 17%; }
td strong { font-weight: 600; }
td .muted { font-size: 11px; margin-top: 4px; }
tbody tr:hover { background: var(--tint); }
tr.selected { background: #e6f1f8; box-shadow: inset 3px 0 var(--accent); }
tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.badge { gap: 5px; border-radius: 4px; padding: 4px 7px; font-size: 10px; line-height: 1.4; font-weight: 600; background: #edf3fa; color: #28568c; }
.badge.done { background: #edf6ef; color: var(--green); }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.detail-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.detail-form label:has(textarea), .detail-form > button { grid-column: 1 / -1; }
.empty-detail { display: grid; place-items: center; gap: 12px; padding: 50px 10px; border: 0; }
.empty-detail svg { width: 40px; height: 40px; color: #90acbd; stroke-width: 1.2; }
.empty-detail strong { font-size: 13px; font-weight: 500; }
.split { gap: 14px; }
.case-records-panel { margin-top: 24px; padding-top: 20px; }
.record-actions button { flex: 1 1 100px; padding: 9px; font-size: 12px; }
.record-card { border-color: var(--line); border-left: 3px solid var(--blue); border-radius: 6px; padding: 16px; margin-top: 14px; background: #fff; box-shadow: none; }
.record-card.hearing { border-left-color: var(--hearing); }
.record-card.task { border-left-color: var(--green); }
.record-card.completed { background: #f7faf8; }
.record-head { display: flex !important; align-items: flex-start; justify-content: space-between; gap: 10px; }
.record-head strong { font-size: 14px !important; overflow-wrap: anywhere; display: block; margin-top: 4px; }
.record-head p { margin: 5px 0 0; font-weight: 400 !important; }
.record-type { color: var(--blue); font-size: 10px; font-weight: 600; text-transform: none; }
.hearing .record-type { color: var(--hearing); }
.task .record-type { color: var(--green); }
.record-card-actions { border-color: var(--line); }
.record-card-actions button { font-size: 11px; min-height: 34px; padding: 7px 9px; font-weight: 600 !important; }
.record-card-actions .delete-record { margin-left: auto; width: 34px; padding: 0; }
.record-notes { min-height: 82px; border-color: #cbdce7; }

.month-calendar { gap: 18px; margin-top: 0; }
.calendar-nav { gap: 6px; flex-wrap: nowrap; }
.calendar-nav .icon-button { padding: 0; min-height: 40px; }
.calendar-legend { font-size: 11px; font-weight: 400; gap: 18px; }
.dot { width: 7px; height: 7px; }
.dot.served, .event-pill.served { background: var(--blue); }
.dot.due, .event-pill.due { background: var(--red); }
.dot.hearing, .event-pill.hearing { background: var(--hearing); }
.calendar-workspace { grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; }
.calendar-board { gap: 0; }
.calendar-weekdays, .calendar-grid { gap: 4px; }
.calendar-weekdays { padding: 10px 0; }
.calendar-weekdays span { font-size: 10px; font-weight: 500; text-transform: none; }
.calendar-day { width: 100%; min-height: 62px; min-width: 0; background: #f8fbfd; border-color: #dce7ef; padding: 7px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; border-radius: 4px; }
.calendar-day:hover { background: var(--tint); border-color: #7ca8c0; box-shadow: none; }
.calendar-day.selected { background: #e6f1f8; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.calendar-day.muted-day { background: #f0f4f7; color: #6f899a; }
.calendar-day.today { background: #fff9e8; border-color: #cfaf5c; }
.calendar-day.today.selected { box-shadow: inset 0 0 0 1px var(--accent); border-color: var(--accent); }
.day-number { height: 25px; width: 25px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.calendar-day.today .day-number { background: #f2d788; color: #594618; font-weight: 700; }
.day-markers { gap: 3px; }
.event-pill { justify-content: center; min-width: 17px; height: 17px; padding: 1px 4px; border-radius: 3px; font-size: 9px; line-height: 15px; font-weight: 500; }
.calendar-day-detail { padding: 6px 0 0 22px; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: transparent; top: 24px; max-height: calc(100vh - 48px); }
.calendar-day-detail { scroll-margin-top: 16px; }
.day-detail-heading { padding-bottom: 18px; margin-bottom: 6px; }
.day-detail-heading strong { font-size: 17px; font-weight: 600; }
.calendar-empty-detail { padding: 22px 0; font-size: 12px; background: transparent; border: 0; }
.calendar-accordions { gap: 10px; }
.calendar-accordion { border-left-width: 3px; border-left-color: var(--blue); border-radius: 5px; }
.calendar-accordion.due { border-left-color: var(--red); }
.calendar-accordion.hearing { border-left-color: var(--hearing); }
.calendar-accordion summary { gap: 8px; padding: 12px 10px; font-size: 12px; font-weight: 600; }
.calendar-accordion summary::before { font-size: 14px; margin-right: 0; width: 10px; }
.calendar-accordion summary strong { min-width: 22px; color: var(--muted); background: var(--tint); border-radius: 4px; font-size: 10px; padding: 2px 5px; }
.calendar-empty-row { font-size: 11px; }
.calendar-event { background: #f5f9fc; border: 0; font-size: 12px; overflow-wrap: anywhere; border-radius: 4px; font-weight: 400; }
.calendar-event:hover { background: #e6f1f8; }
.calendar-event span { color: var(--blue); font-size: 10px; font-weight: 500; text-transform: none; }
.calendar-event.due span { color: var(--red); }
.calendar-event.hearing span { color: var(--hearing); }
.calendar-event strong { font-size: 12px; font-weight: 600; }
.calendar-event em { font-size: 11px; }

.task-list { margin-top: 10px; gap: 0; }
.task-row { gap: 16px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 18px 0; background: transparent; }
.task-row > div { border-left: 3px solid var(--green); padding-left: 12px; min-width: 0; overflow-wrap: anywhere; }
.task-row strong { font-weight: 600; font-size: 13px; }
.task-row .muted { margin-top: 4px; }
.task-row button { flex-shrink: 0; font-size: 12px; }
.task-row.completed { background: transparent; opacity: 1; }
.task-row.completed > div { border-color: #96aaa0; }
#task-filter { width: 180px; font-size: 12px; }
.admin-status { margin-top: 18px; gap: 0 22px; }
.admin-status > div { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 0; background: transparent; }
.admin-status span { font-size: 11px; font-weight: 400; text-transform: none; }
.admin-status strong { font-size: 14px; font-weight: 600; }
.command-grid { gap: 0; margin-top: 10px; }
.command-grid code { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 13px 0; font-size: 12px; background: transparent; }

dialog { border: 1px solid var(--line); width: min(600px, calc(100vw - 32px)); color: var(--ink); background: #fff; box-shadow: 0 24px 80px #002d4a50; max-height: calc(100dvh - 32px); }
dialog::backdrop { background: #002d4a99; backdrop-filter: blur(3px); }
dialog h2 { font-size: 19px; font-weight: 600; }
.dialog-heading { gap: 12px; padding-bottom: 18px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.dialog-heading button { background: var(--tint); color: var(--muted); }
#create-form, #hearing-form, #case-form, #task-form { gap: 16px; padding: 24px; margin: 0; }
menu { padding: 18px 0 0; margin: 4px 0 0; border-top: 1px solid var(--line); }
menu button:first-child { background: #fff; color: var(--muted); border-color: var(--line); }
.create-pdf-panel { padding: 16px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.create-pdf-panel strong { font-size: 13px; }
.create-pdf-tools { grid-template-columns: minmax(0, 1fr) 110px; }
input[type=file] { font-size: 11px; padding: 8px; }
.pdf-review:empty { display: none; }
.suggestion-card { padding: 12px; background: #edf6f1; border: 0; border-left: 3px solid var(--green); border-radius: 0; overflow-wrap: anywhere; }
.suggestion-card p { margin: 4px 0 0; }
.preview-dialog { width: min(1180px, calc(100vw - 28px)); }
.preview-dialog > .dialog-heading { padding: 14px 20px; margin: 0; }
.pdf-preview-toolbar { padding: 12px 20px; }
.pdf-preview-toolbar strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.pdf-preview-toolbar a { text-decoration: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 5px; font-size: 12px; flex-shrink: 0; }
.pdf-pages, .pdf-preview-card.large .pdf-pages { padding: 24px; gap: 18px; background: #e9f0f5; max-height: 72dvh; }
.pdf-page img { box-shadow: 0 2px 10px #23353620; }
#pdf-preview-frame-large { min-height: 0; }

@media (min-width: 1600px) {
  .main-panel { padding-right: 48px; padding-left: 48px; }
  .workspace { grid-template-columns: minmax(0, 1.5fr) minmax(400px, 1fr); }
  .calendar-workspace { grid-template-columns: minmax(0, 1fr) 340px; }
  .calendar-day { aspect-ratio: auto; min-height: 96px; }
}
@media (max-width: 1200px) {
  .admin-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .main-panel { padding-left: 24px; padding-right: 24px; }
  .brand { padding-left: 3px; padding-right: 0; gap: 8px; }
  .brand strong { font-size: 18px; }
  .workspace { grid-template-columns: 1fr; }
  .calendar-workspace { grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; }
  .calendar-day-detail { padding-left: 16px; }
  .calendar-day { min-height: 60px; }
  .metrics article { padding: 16px 14px; }
  .metrics .metric-icon { right: 12px; }
}
@media (min-width: 981px) and (max-height: 600px) {
  .sidebar { padding-block: 6px; }
  .sidebar-content { gap: 4px; }
  .brand { display: flex; align-items: center; gap: 6px; padding: 0; text-align: left; }
  .brand .brand-mark { flex: 0 0 48px; height: 40px; }
  .brand-mark img { width: 165px; left: -58px; top: -113px; }
  .brand strong { font-size: 14px; }
  .nav-caption { padding-bottom: 2px; }
  .nav-item { min-height: 32px; padding-block: 5px; }
  .quick-links { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 4px; }
  .quick-links .nav-caption { grid-column: 1 / -1; }
  .quick-link { min-height: 32px; padding: 4px 6px; gap: 4px; }
  .quick-link .portal-icon { width: 18px; height: 18px; flex-basis: 18px; }
  .sidebar-profile { padding-top: 4px; }
}
@media (min-width: 981px) and (max-height: 420px) {
  .side-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-item { padding-inline: 5px; font-size: 12px; }
  .nav-item svg { width: 16px; height: 16px; margin-right: 0; }
}
@media (min-width: 981px) and (max-height: 340px) {
  .sidebar { position: static; }
}
@media (max-width: 980px) {
  .admin-shell { grid-template-columns: 1fr; }
  .sidebar { display: flex; grid-template-rows: none; position: static; padding: 16px 22px; gap: 12px; min-height: 0; }
  .sidebar-content { display: contents; }
  .brand { display: flex; justify-content: flex-start; padding: 0; text-align: left; }
  .brand .brand-mark { width: 64px; height: 52px; flex: 0 0 64px; }
  .brand-mark img { width: 220px; left: -78px; top: -152px; }
  .sidebar-content > .nav-caption, .sidebar-profile { display: none; }
  .side-nav { gap: 5px; }
  .nav-item { flex: 1 0 auto; justify-content: center; font-size: 12px; padding: 10px 12px; min-height: 42px; }
  .nav-item svg { margin: 0; width: 17px; height: 17px; }
  .quick-links { margin: 0; padding: 0; }
  .quick-links .nav-caption { display: none; }
  .quick-link { padding: 3px 10px; min-height: 28px; }
  .main-panel { gap: 20px; }
  .calendar-day { min-height: 65px; }
  .calendar-workspace { grid-template-columns: minmax(0, 1fr) 260px; }
}
@media (max-width: 700px) {
  .main-panel { padding: 0 16px 28px; gap: 18px; }
  .workspace-bar { min-height: 50px; font-size: 10px; gap: 10px; }
  .workspace-bar > span { gap: 5px; }
  .workspace-bar time { max-width: 46%; }
  .topbar { display: flex; }
  .topbar h1 { font-size: 24px; }
  .topbar-actions { gap: 5px; }
  .topbar-actions > .primary-button { width: auto; font-size: 12px; padding: 8px 10px; }
  .topbar-actions .icon-button { width: 34px; height: 38px; min-height: 38px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metrics article { min-height: 122px; padding: 14px; }
  .metrics article > span { font-size: 11px; padding-right: 25px; }
  .metrics .metric-icon { width: 17px; height: 17px; right: 12px; top: 14px; }
  .metrics strong { font-size: 27px; }
  .metrics small { font-size: 10px; }
  .dashboard-intro { display: grid; gap: 12px; padding-bottom: 18px; margin-bottom: 18px; }
  .signature { font-size: 22px; }
  .dashboard-grid, .settings-grid { grid-template-columns: 1fr; gap: 18px; }
  .panel { padding: 18px; }
  .panel h2 { font-size: 16px; }
  .panel-heading { display: flex; }
  .calendar-workspace { grid-template-columns: 1fr; gap: 18px; }
  .calendar-day-detail { position: static; max-height: none; border-left: 0; border-top: 1px solid var(--line); padding: 18px 0 0; }
  .calendar-top { display: flex; align-items: flex-start; }
  .calendar-nav { display: flex; width: auto; }
  .calendar-nav .icon-button { width: 32px; height: 36px; min-height: 36px; }
  .calendar-nav button { padding: 7px 9px; width: auto; min-height: 36px; font-size: 11px; }
  .calendar-legend { gap: 9px 13px; font-size: 10px; }
  .calendar-day { min-height: 58px; padding: 4px; aspect-ratio: auto; }
  .day-number { width: 21px; height: 21px; font-size: 11px; }
  .day-markers { gap: 2px; }
  .event-pill { min-width: 13px; height: 14px; font-size: 8px; padding: 0 3px; line-height: 14px; }
  .calendar-grid, .calendar-weekdays { gap: 3px; }
  .table-panel > .panel-heading { flex-wrap: wrap; gap: 12px; }
  .search-field { width: 100%; }
  table { min-width: 490px; }
  .task-row { gap: 10px; }
  .task-row button { padding: 8px; font-size: 10px; }
  .pdf-preview-toolbar { display: flex; }
  .pdf-pages, .pdf-preview-card.large .pdf-pages { padding: 12px; }
  .split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .sidebar { padding: 16px 14px 12px; }
  .side-nav { gap: 2px; }
  .nav-item { flex: 1 0 0; padding: 8px 4px; gap: 4px; flex-direction: column; font-size: 10px; min-height: 53px; }
  .nav-item svg { width: 18px; height: 18px; }
  .brand div > span { font-size: 10px; }
  .topbar-actions .icon-button { width: 30px; }
  .topbar h1 { font-size: 22px; }
  .detail-form { grid-template-columns: 1fr; }
  .calendar-top h2 { font-size: 15px; }
  .calendar-nav { gap: 3px; }
  .calendar-nav .icon-button { width: 28px; }
  #create-form, #hearing-form, #case-form, #task-form { padding: 20px; }
  .split, .create-pdf-tools { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
