@font-face {font-family:Figtree; font-style:normal; font-weight:300 900; font-display:swap; src:url("/figtree-latin-ext.woff2") format("woff2"); unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face {font-family:Figtree; font-style:normal; font-weight:300 900; font-display:swap; src:url("/figtree-latin.woff2") format("woff2"); unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
:root {
  color-scheme:dark; --page:#161616; --side:#1b1b1a; --surface:#212120; --hover:#292928;
  --ink:#edebe6; --text:#c8c6c0; --muted:#a39f97; --line:#323130; --border:#464543;
  --accent:#ede8dc; --marked:#2c2b28; --error:#ee9a90;
  background:var(--page); color:var(--ink); font:400 15px/1.55 Figtree,system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;
}
* {box-sizing:border-box}
body,h1,h2,h3,p,ul,ol,blockquote {margin:0}
button,a,summary,input,textarea {font:inherit; color:inherit}
button {cursor:pointer; border:0; background:none; padding:0; text-align:inherit}
button:disabled {cursor:default}
button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,textarea:focus-visible {outline:2px solid var(--accent); outline-offset:2px}
[hidden] {display:none!important}
.sr-only,.skip:not(:focus) {position:absolute!important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap}
main[tabindex="-1"]:focus,.workflow-page h2[tabindex="-1"]:focus,#record-title:focus,#directory-title:focus {outline:none}
.document-update {padding:10px 12px; margin-bottom:12px; border-left:2px solid currentColor; background:var(--surface)}
.skip:focus {position:fixed; z-index:4; background:var(--accent); color:var(--page); padding:8px}
.workspace {display:grid; height:100vh; height:100dvh; grid-template-columns:264px minmax(0,1fr)}
.sidebar {display:flex; flex-direction:column; background:var(--side); padding:20px 14px; border-right:1px solid var(--line); gap:22px; min-height:0}
#history-toggle,#close-menu,#menu-scrim {display:none}
#desktop-menu svg,#history-toggle svg,#close-menu svg,.message-composer button svg {width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round}
#sidebar-content {display:flex; flex-direction:column; gap:22px; flex:1; min-height:0}
.sidebar nav :is(a,button) {text-decoration:none;width:100%; display:block; padding:6px 8px; border-radius:6px; text-align:left; overflow:hidden; white-space:nowrap; text-overflow:ellipsis}
.sidebar .menu :is(a,button) {display:flex; align-items:center; gap:9px}
.menu-icon {flex:none; width:15px; height:15px; fill:none; stroke:var(--muted); stroke-width:1.55; stroke-linecap:round; stroke-linejoin:round}
.menu [aria-current=page] .menu-icon {stroke:var(--ink)}
.sidebar nav :is(a,button):hover,.src:hover {background:var(--hover); color:var(--ink)}
.sidebar nav :is(a,button)[aria-current=page] {background:var(--hover); box-shadow:inset 2px 0 var(--accent)}
.sidebar h2 {padding:0 8px; font-size:13px; font-weight:500; color:var(--muted); margin-bottom:5px}
.history-group {overflow-y:auto; min-height:0}
#history button {font-size:14px; line-height:1.4; color:var(--text); white-space:normal}
.history-title {display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden}
#history small {display:block; padding:5px 8px}
.history-state,small,.side-foot {font-size:13px; color:var(--muted)}
.history-all {display:inline-block; margin:5px 8px; padding-block:4px; color:var(--muted); font-size:13px; text-underline-offset:3px}
.history-all:hover,.history-all[aria-current=page] {color:var(--ink)}
.history-state {display:block}
.side-foot {display:grid; gap:4px; margin:auto 8px 0; padding-top:12px; border-top:1px solid var(--line)}
main {min-width:0; min-height:0; position:relative; overflow:auto; padding:56px clamp(16px,4.16vw,48px) 64px; overflow-wrap:anywhere; scrollbar-gutter:stable; scroll-padding-block:16px}
main > :not(canvas) {position:relative}
#backdrop {position:absolute; top:0; left:0; width:100%; height:300px; image-rendering:pixelated; opacity:.12; pointer-events:none}
main:has(#compose:not([hidden])) #backdrop {opacity:.055}
main:has(#directory:not([hidden])) #backdrop {height:132px; opacity:.05}
#compose {width:min(100%,680px); margin:clamp(20px,12vh,144px) auto 0}
#compose h1 {font-size:clamp(24px,3vw,34px); font-weight:550; letter-spacing:-.035em; text-align:center; line-height:1.2; margin:0 0 16px}
.home-tiles {display:flex; justify-content:center; gap:4px; margin:0 auto clamp(48px,8vh,84px)}
.home-tile {text-decoration:none; width:88px; display:flex; flex-direction:column; align-items:center; gap:8px; padding:4px 0; border-radius:10px}
.app-icon {display:grid; place-items:center; position:relative; isolation:isolate; width:48px; height:48px; border-radius:12px; color:#f1f1f1; background:#282828; border:1px solid #676767}
.app-icon::before {content:""; position:absolute; inset:0; z-index:-1; border-radius:inherit; background:radial-gradient(circle,#9a9a9a .72px,transparent .9px) 0 0/4px 4px,radial-gradient(circle,#777 .72px,transparent .9px) 2px 2px/4px 4px; mask-image:linear-gradient(145deg,#000 5%,transparent 72%)}
.app-icon svg {width:29px; height:29px; fill:currentColor}
.icon-badge {position:absolute; top:-5px; right:-6px; min-width:19px; height:19px; padding:0 4px; border-radius:12px; background:#e8e8e8; color:#151515; box-shadow:0 0 0 2px var(--page); text-align:center; font:600 12px/19px Figtree,system-ui,sans-serif; font-variant-numeric:tabular-nums}
.tile-title {color:var(--text); font-size:13px; line-height:1.35; white-space:nowrap}
.home-tile:hover .app-icon,.home-tile:focus-visible .app-icon {filter:brightness(1.12)}
.home-tile:hover .tile-title,.home-tile:focus-visible .tile-title {color:var(--ink)}
.composer,.questionbox {background:var(--surface); border-radius:14px; border:1px solid var(--border); width:min(100%,680px); margin-inline:auto}
.composer:focus-within {border-color:var(--accent)}
textarea {display:block; color:var(--ink); background:none; border:0; border-radius:14px; padding:16px 18px 6px; resize:vertical; min-height:76px; max-height:46vh; width:100%; line-height:1.55}
textarea:focus-visible {outline:none}
textarea::placeholder,input::placeholder {color:var(--muted); opacity:1}
.actions,.batch-actions {display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap}
.actions {padding:4px 12px 12px 18px}
.primary,.secondary {font-weight:600; border-radius:8px; padding:7px 16px; line-height:1.45}
.primary {background:var(--accent); color:var(--page)}
.primary:disabled {background:var(--hover); color:var(--muted)}
.secondary {background:var(--hover); border:1px solid var(--border); color:var(--ink); padding:3px 10px; font-size:14px; font-weight:500}
.secondary:hover:not(:disabled) {border-color:var(--muted)}
.form-hint {font-size:14px; color:var(--muted); max-width:68ch; margin-bottom:10px}
.form-hint button {font-size:inherit}
#followup-form h2 {margin-bottom:4px}
.stage-note {text-align:center; font-size:13px; color:var(--muted)}
.directory {width:min(100%,800px); margin:0 auto}
.directory h1,#record-title {font-size:clamp(25px,3vw,34px); font-weight:550; letter-spacing:-.03em; line-height:1.2}
.directory h1 {margin:0 0 24px}
.back-link {display:inline-block; min-height:24px; margin-bottom:16px; font-size:14px; color:var(--text); text-underline-offset:3px}
.directory-row {display:grid; gap:4px; padding:15px 3px; border-top:1px solid var(--border); text-decoration:none; color:var(--text)}
.directory-row:hover,.directory-row:focus-visible {background:var(--hover)}
#record-filters {display:flex; align-items:center; flex-wrap:wrap; gap:12px 24px; justify-content:space-between; margin:0 0 15px}
.archive-filter {display:flex; flex-wrap:wrap; gap:10px}
.archive-filter a {font-size:14px; padding:5px 2px; color:var(--muted); text-decoration:none; border-bottom:2px solid transparent}
.archive-filter a[aria-current=page] {border-color:var(--ink); color:var(--ink)}
.record-search {position:relative; isolation:isolate; display:flex; align-items:center; width:12.5rem; max-width:100%; min-height:40px; border-radius:24px; color:var(--muted)}
.record-search svg {position:absolute; left:13px; width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; pointer-events:none}
#record-search {width:100%; min-width:0; min-height:40px; padding:7px 14px 7px 37px; border:0; border-radius:inherit; background:transparent; color:var(--ink); font-size:14px; outline:none}
.record-search:focus-within {color:var(--ink)}

.directory .empty {margin-bottom:12px}
#case-head {margin:0 0 20px; padding-bottom:14px; border-bottom:1px solid var(--border)}
.record-context,.record-tools {display:flex; align-items:center; flex-wrap:wrap; gap:6px 16px}
.record-context {margin-bottom:8px; color:var(--muted); font-size:13px}
.record-context .back-link {margin:0; color:var(--text); padding-block:4px}
#record-title {max-width:38ch; text-wrap:balance}
.record-tools {margin-top:12px}
.record-tools .secondary {text-decoration:none; padding:5px 10px}
#case-head:has(#record-nav:not([hidden])) {padding-bottom:0}
#record-nav {margin-top:12px}
#case {width:min(100%,880px); margin-inline:auto}
#case-actions {display:flex; gap:16px; justify-content:center; flex-wrap:wrap; margin:0 0 16px}
.text-button {display:inline-block; min-height:24px; font-size:14px; color:var(--text); text-decoration:underline; text-underline-offset:3px}
.turn + .turn {border-top:1px solid var(--border); margin-top:36px; padding-top:28px}
.questionbox {border-color:var(--line); color:var(--text); padding:14px 18px}
.questionbox h2 {font-size:13px; color:var(--muted); font-weight:500; margin-bottom:4px}
.questionbox p,.approved {white-space:pre-wrap}
article,.clarifications,#followup-form {margin-top:30px}
article > p,article > ul,article > ol,article h2,article h3 {max-width:75ch}
article h2,article h3,#followup-form h2,.clarifications h2,#docbody h2 {font-size:17px; line-height:1.35; font-weight:600; margin-bottom:10px}
article h2:not(:first-child),article h3:not(:first-child) {margin-top:22px}
article p,article ol,article ul {margin-bottom:10px; color:var(--text)}
article ul,article ol {padding-left:24px}
article li + li {margin-top:5px}
strong {color:var(--ink); font-weight:600}
.tbl {overflow-x:auto; margin:12px 0}
.bank-comparison table {table-layout:fixed; min-width:600px}
.bank-comparison th:first-child {width:21%}
.bank-comparison th:nth-child(2) {width:38%}
table {border-collapse:collapse; width:100%; font-size:14px}
th,td {border-bottom:1px solid var(--line); padding:8px; text-align:left; vertical-align:top}
th {color:var(--muted); font-weight:500}
.cite {font-size:.8em; color:var(--accent); text-decoration:underline; vertical-align:super; line-height:1}
.claim {color:inherit; text-decoration:underline dotted #aaa59a; text-underline-offset:.2em}
.claim:hover,.claim[aria-expanded=true] {color:var(--ink); background:var(--marked); text-decoration-style:solid}
.sources {border-block:1px solid var(--line); margin-top:18px}
summary {cursor:pointer; padding:9px 0; font-size:14px; color:var(--text)}
.src {display:block; width:100%; border-top:1px solid var(--line); padding:8px 2px; font-size:14px; overflow-wrap:anywhere}
.clarifications > p {font-size:14px; color:var(--muted); max-width:68ch; margin:10px 0}
.answer-list {list-style:none; border-top:1px solid var(--line); padding:0}
.answer-row {display:grid; grid-template-columns:28px minmax(0,1fr); border-bottom:1px solid var(--line); padding:10px 8px}
.answer-row::before {content:"-"; color:var(--muted)}
.answer-row label {display:block; max-width:70ch}
.row-controls {display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin-top:8px; max-width:560px}
.row-controls input {flex:1 1 175px; min-width:0; padding:7px 13px; font-size:14px}
.approved {font-size:14px; color:var(--text)}
.batch-actions {justify-content:flex-start; padding-top:20px}
#followup-form {border-top:1px solid var(--line); padding-top:24px}
#followup-form .composer {margin-inline:auto}
#followup-error,#error,.failed {color:var(--error)}
#error,#followup-error {width:min(100%,880px); margin:12px auto}
.work-panel {margin-top:18px; height:206px; position:relative; overflow:hidden; border:1px solid var(--line); border-radius:14px}
.wave {background-image:radial-gradient(var(--accent) 1px,transparent 1.3px); background-size:4px 4px; mask-image:linear-gradient(90deg,transparent 0%,#0008 42%,black 55%,transparent 100%); width:55%; height:100%; animation:sweep 3.5s linear infinite; opacity:.34}
@keyframes sweep {from{transform:translateX(-100%)}to{transform:translateX(185%)}}
.stage {text-align:center; margin:25px auto 0; font-size:20px; font-weight:500}
.stage-bar {height:8px; width:216px; margin:12px auto; overflow:hidden}
.stage-bar .wave {opacity:.8}
.failed,#progress:not(.sr-only):not(:empty) {padding:12px 0}
:is(#docbody,#source-body) section + section {margin-top:20px; padding-top:16px; border-top:1px solid var(--border)}
:is(#docbody,#source-body) h3 {font-size:15px; line-height:1.45; font-weight:600; margin-bottom:8px}
:is(#docbody,#source-body) blockquote {margin:10px 0; padding:4px 0 4px 14px; border-left:2px solid var(--accent); white-space:pre-wrap}
:is(#docbody,#source-body) a {display:block; font-size:14px; padding:3px 0; text-underline-offset:3px}
:is(#docbody,#source-body) details {margin-block:12px; border-top:1px solid var(--line)}
:is(#docbody,#source-body) pre {max-width:72ch; white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; line-height:1.75; color:var(--text)}
:is(#docbody,#source-body) mark {background:var(--accent); color:var(--page)}
@media (max-width:1023px) {
  .workspace {grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr)}
  .sidebar {display:contents}
  #history-toggle,#close-menu {display:grid; place-items:center; width:44px; height:44px; border-radius:50%; color:var(--ink)}
  #history-toggle {position:fixed; z-index:3; top:max(6px,env(safe-area-inset-top)); left:max(8px,env(safe-area-inset-left))}
  #history-toggle[aria-expanded=true] {visibility:hidden}
  #sidebar-content {
    position:fixed; inset:0 auto 0 0; z-index:6; width:min(304px,calc(100% - 52px)); overflow:auto;
    padding:max(6px,env(safe-area-inset-top)) 14px max(20px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));
    gap:14px; background:var(--side); border-right:1px solid var(--border);
    visibility:hidden; transform:translateX(-100%); transition:transform 210ms cubic-bezier(.2,.8,.2,1),visibility 0s 210ms;
  }
  #sidebar-content.expanded {visibility:visible; transform:none; transition-delay:0s}
  #close-menu {flex:none; margin-left:-4px}
  #menu-scrim {display:block; pointer-events:none; position:fixed; inset:0; z-index:5; background:rgb(0 0 0 / 44%); opacity:0; visibility:hidden; transition:opacity 180ms,visibility 0s 180ms}
  .sidebar:has(.expanded) #menu-scrim {pointer-events:auto; opacity:1; visibility:visible; transition-delay:0s}
  .history-group {min-height:84px}
  .sidebar nav :is(a,button) {min-height:40px}
  main:has(#compose[hidden]) {padding-top:calc(max(6px,env(safe-area-inset-top)) + 58px); scroll-padding-top:56px}
}
@media (max-width:767px) {
  main {padding:28px 16px 44px; scrollbar-gutter:auto}
  #compose {margin-top:clamp(20px,7vh,56px)}
  #compose h1 {margin-bottom:14px}
  .home-tiles {gap:0; margin-bottom:clamp(36px,7vh,56px)}
  #history button,.case-question summary {min-height:38px}
  .answer-row {grid-template-columns:18px minmax(0,1fr); padding-inline:2px}
  .composer .actions {display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; gap:12px}
  .composer .actions small {align-self:center}
  .composer .primary {min-height:44px}
  .work-panel {height:150px}
}
@media (prefers-reduced-motion:reduce) {.wave {animation:none; margin:auto}}
.comparison {margin:18px 0; border-block:1px solid var(--line)}
.comparison > summary {color:var(--ink); font-size:17px; font-weight:600}
.comparison > p,.comparison > ul,.comparison > ol {max-width:75ch}
.group-error:not(:empty) {margin-top:12px; color:var(--error)}
main.reading {padding-top:36px}
.reading #backdrop {left:auto; right:0; width:46%; height:132px}
.reading .questionbox {width:100%}
.reading #case-actions {justify-content:flex-start; margin-bottom:10px}
.clipped {display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden}
.wave {animation-delay:-1.25s}

.case-nav {display:flex; flex-wrap:wrap; gap:18px}
.case-nav button {padding:7px 2px; color:var(--muted); font-weight:550; border-bottom:2px solid transparent}
.case-nav button:hover,.case-nav button[aria-current=page] {color:var(--ink)}
.case-nav button[aria-current=page] {border-color:var(--accent)}
#case-status {color:var(--muted); font-size:13px}
.workflow-page {max-width:750px}
.workflow-page h2 {font-size:22px; line-height:1.3; font-weight:600}
.workflow-page h3,.reminder-group h3 {font-size:15px; line-height:1.4; font-weight:600}
.case-question {color:var(--muted)}
.case-question:empty {display:none}
.case-question:has(details[open]) {flex-basis:100%}
.case-question p {max-width:72ch; padding-block:4px 8px; white-space:pre-line; color:var(--text)}
.case-question summary {width:fit-content; padding:4px 0; text-decoration:underline; text-underline-offset:3px}
.blocked,.task-row .blocked {font-size:13px; font-weight:500; color:var(--ink)}
.workflow-form {display:grid; gap:8px; background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:16px; margin-block:16px}
.workflow-form label {font-size:14px; color:var(--text); font-weight:600}
.workflow-form input,.workflow-form textarea {min-width:0; max-width:100%; padding:8px 12px}
.row-controls input,.workflow-form :is(input,textarea) {color:var(--ink); background:linear-gradient(145deg,#292928,#20201f 70%); border:1px solid var(--border); border-radius:12px}
.row-controls input:focus-visible,.workflow-form :is(input,textarea):focus-visible {border-color:var(--muted); outline:1px solid var(--muted); outline-offset:0}
.workflow-form input[type=date] {width:fit-content; min-height:38px}

.form-actions,.row-buttons {display:flex; gap:8px 14px; flex-wrap:wrap; align-items:center}
.form-actions {margin-top:6px}
#task-list {margin:10px 0 14px}
.task-group + .task-group,.reminder-group + .reminder-group {margin-top:18px}
.task-group h3,.reminder-group h3 {margin-bottom:5px}
.task-group ul,.reminder-group ul,#timeline-list {margin:0; padding:0; list-style:none}
.task-row {display:grid; grid-template-columns:minmax(0,1fr); gap:3px; align-items:start; padding:14px 2px; border-top:1px solid var(--line)}
.task-row strong,.task-row small {grid-column:1}
.task-row .row-buttons {grid-column:1; margin-top:5px; justify-content:flex-start}
.task-row:focus {outline:1px solid var(--muted); outline-offset:2px}
.task-row time,.task-row small,.reminder-row time,#timeline-list time {color:var(--muted); font-size:13px}
.task-row time.due-attention {color:var(--ink); font-weight:600}
.case-lifecycle {border-top:1px solid var(--border); margin-top:28px; padding-top:16px}
.case-lifecycle p,#edit-conflict p {font-size:14px; color:var(--text); margin-bottom:8px}
#edit-conflict {padding:12px; border:1px solid var(--muted); border-radius:8px}
#workflow-feedback:not(:empty) {margin:12px 0; color:var(--text); font-size:14px}
#timeline-note,#timeline-undated {margin-block:8px; color:var(--text); font-size:14px}
#timeline-note > summary,#timeline-undated > summary {width:fit-content; cursor:pointer; padding-block:4px; text-underline-offset:3px}
#timeline-note > summary:hover,#timeline-undated > summary:hover {text-decoration:underline}
#timeline-undated ul {list-style:none; padding-left:18px}
#timeline-list {margin:24px 0 0 6px}
.timeline-day {position:relative; border-left:1px solid var(--border); padding:0 0 24px 24px}
.timeline-day:last-child {padding-bottom:0}
.timeline-day.is-future {border-left-style:dashed}
.timeline-day > h3 {display:flex; align-items:baseline; gap:9px; margin-bottom:9px}
.timeline-day > h3::before,.timeline-entries > li::before {content:""; position:absolute; box-sizing:border-box; border-radius:50%; background:var(--page)}
.timeline-day > h3::before {width:11px; height:11px; border:2px solid var(--muted); top:4px; left:-6px}
.timeline-day.is-today > h3::before {background:var(--accent); border-color:var(--accent); outline:3px solid var(--page)}
#timeline-list .timeline-day h3 time {font-size:15px; color:var(--text); font-weight:550}
.timeline-today-label {font-size:16px; color:var(--ink)}
.timeline-entries {list-style:none; padding:0}
.timeline-entries > li {position:relative; display:grid; justify-items:start; gap:3px; padding:5px 0 13px}
.timeline-entries > li::before {width:5px; height:5px; top:13px; left:-27px; background:var(--muted)}
.timeline-entries > .timeline-task::before {background:var(--page); border:1px solid var(--muted)}
.timeline-task-link {min-height:24px; font-weight:550; text-align:left; text-decoration:underline; text-decoration-color:var(--border); text-underline-offset:3px}
.timeline-task-link:hover {text-decoration-color:currentColor}
.timeline-empty,.timeline-meta {color:var(--muted); font-size:13px}
#timeline-list li > p {white-space:pre-line}
#timeline-list .timeline-detail {color:var(--text); font-size:14px; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden}
#timeline-list .text-button {margin-top:3px}
.answer-change {padding:12px 16px; border:1px solid var(--border); border-radius:12px; background:var(--surface); margin-bottom:18px}
.historical-answer {margin-block:12px 20px; color:var(--text)}
.historical-answer > summary {cursor:pointer; padding:6px 0; text-decoration:underline; text-underline-offset:3px}
.historical-answer article {margin-top:14px}
.turn > .answer-change {margin-top:14px}
.answer-change p {margin:4px 0 8px}
.capture-task {margin:0 0 12px}
#home-reminders {position:fixed; inset:auto; margin:0; width:min(340px,calc(100vw - 24px)); max-height:min(420px,80dvh);
  padding:0; color:var(--ink); background:var(--surface); border:1px solid var(--border); border-radius:14px;
  box-shadow:0 12px 36px #0006; overflow:hidden}
#home-reminders:popover-open {display:flex; flex-direction:column}
#home-reminders header {display:flex; align-items:center; justify-content:space-between; padding:7px 10px 7px 16px; border-bottom:1px solid var(--line)}
#home-reminders h2 {font-size:16px; font-weight:600}
#home-reminders header button {width:34px; height:34px; text-align:center; font-size:22px; color:var(--muted); border-radius:8px}
#home-reminders header button:hover,.reminder-row:hover {background:var(--hover); color:var(--ink)}
.notification-items {padding:8px; overflow:auto; overscroll-behavior:contain}
.notification-items .empty,.notification-items .failed {padding:8px}
.notification-items h3 {padding:4px 8px; font-size:12px; color:var(--muted)}
.notification-items .reminder-group + .reminder-group,#urgent-list:not(:empty) + #reminders-list:not(:empty) {margin-top:8px}
.empty {color:var(--muted); font-size:14px}
.reminder-row {display:grid; gap:4px; width:100%; padding:8px; border-radius:8px; overflow-wrap:anywhere}
.reminder-row:focus-visible {outline-offset:-2px}
.reminder-description {display:grid; gap:2px; min-width:0}
.reminder-description strong,.reminder-description span,.reminder-description small {display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden}
.reminder-description strong {font-size:14px; font-weight:550; line-height:1.35}
.reminder-description .blocked {font-size:13px}
.reminder-description small {-webkit-line-clamp:1}
.reminder-row time {font-variant-numeric:tabular-nums}
.reminder-row time.overdue {color:var(--error)}
@media (max-width:767px) {
  main.reading {padding-top:18px}
  .record-tools {gap:6px 12px}
  .record-tools .text-button,#case-actions .text-button,.answer-change button {min-height:32px}
  .record-search {width:100%}
  #record-search {font-size:16px}
  #record-filters {gap:8px 16px}
  .case-nav button,.task-row button,#timeline-list button,.form-actions button,.case-lifecycle button,#add-task {min-height:38px}
  .workflow-form {padding:12px}
}
#updates-status {font-size:13px; color:var(--muted); margin:0 0 8px}
#updates-status:empty {display:none}
#updates-status.error {color:var(--error)}
#updates-list,#inbox-list,#answer-history {list-style:none; margin:0; padding:0}
.inbox-filters {display:flex; gap:16px; margin:4px 0 16px}
.inbox-filters a {padding:5px 0; color:var(--muted); text-decoration:none; border-bottom:2px solid transparent}
.inbox-filters [aria-current=page] {color:var(--ink); border-color:currentColor}
#inbox a.update-row {text-decoration:none}
#answer-history .is-unread strong::before {content:""; display:inline-block; width:6px; height:6px; margin-right:6px; border-radius:50%; vertical-align:middle; background:var(--ink)}
#more-answers {margin-top:12px}
.update-row {display:grid; grid-template-columns:minmax(0,1fr) auto; gap:1px 20px; align-items:baseline; width:100%; padding:9px 0; border-top:1px solid var(--line); font-size:14px; line-height:1.4}
.update-row:hover {background:var(--hover)}
#updates-list > li + li {margin-top:16px}
#updates-list .source-link {display:inline-block; padding-block:5px}
.update-row strong {font-size:15px; font-weight:600}
#updates-list .update-row {padding:14px 0 2px; gap:5px 20px}
#updates-list .update-reason {max-width:68ch; line-height:1.55}
#updates-list .update-row small {margin-top:2px}
.update-row small,.update-reason {grid-column:1}
.update-reason {color:var(--text)}
.update-row time {grid-column:2; grid-row:1; font-size:13px; color:var(--muted); white-space:nowrap}
#updates-toggle,#inbox-toggle {display:block; padding:8px 0; border-top:1px solid var(--line); width:100%}
#plan-procedure:not(:empty),#plan-reviews:not(:empty) {margin-bottom:12px}
.plan-notice {background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:14px 16px 4px}
.resolved-procedure {border-block:1px solid var(--line)}
.resolved-procedure > summary {padding-block:10px; font-size:14px; font-weight:550; color:var(--text)}
.resolved-procedure[open] {border-bottom:0}
.change-lead {font-size:13px; color:var(--muted); margin-top:1px}
.change-list {list-style:none; margin:10px 0 0; padding:0}
.change-item {display:grid; grid-template-columns:minmax(0,1fr); gap:5px; padding:11px 0 12px; border-top:1px solid var(--line)}
.change-item > strong {line-height:1.4}
.change-reason {font-size:14px; color:var(--text); max-width:68ch}
.plan-diff {display:grid; gap:3px; margin:0; font-size:14px}
.plan-diff div {display:grid; grid-template-columns:64px minmax(0,1fr); column-gap:10px; align-items:baseline}
.plan-diff dt {font-size:13px; color:var(--muted)}
.plan-diff dd {margin:0; color:var(--text)}
.plan-diff del,.plan-diff .arrow {color:var(--muted)}
.plan-diff ins {text-decoration:none; color:var(--ink); background:var(--marked); border-radius:2px; padding:0 .2em; box-decoration-break:clone; -webkit-box-decoration-break:clone}
.source-link {max-width:100%; text-align:left}
.change-item .row-buttons {margin-top:3px}
#procedure-toggle {display:block; margin:0 0 10px}
#timeline-list .plan-diff {margin:6px 0 4px}
#timeline-list .change-reason {white-space:normal}
#timeline-list li > small {display:block}
#read-update {margin-bottom:10px}
#tracking-status:not(:empty) {display:flex; flex-wrap:wrap; align-items:center; gap:8px 14px; margin-bottom:14px}
#tracking-status p {flex:1 1 100%; font-size:14px; color:var(--text)}
@media (max-width:767px) {
  .update-row {grid-template-columns:minmax(0,1fr); min-height:38px}
  .update-row time {grid-column:1; grid-row:auto}
  .plan-notice {padding:12px 12px 2px}
  .change-item button,#procedure-toggle,#updates-toggle,#tracking-status button {min-height:38px}
}
#reminder-count {display:inline-block; margin-left:4px; padding:0 6px; border-radius:5px; background:var(--marked); color:var(--accent); font-size:13px; font-variant-numeric:tabular-nums}
.glyphs {position:absolute; pointer-events:none}
#corner-bell {position:fixed; z-index:2; top:9px; right:22px; display:grid; place-items:center;
  width:44px; height:44px; border-radius:7px; color:var(--text); background:transparent}
#corner-bell:hover {color:var(--ink)}
#corner-bell:focus-visible {outline:none}
#corner-bell:focus-visible::after {content:""; position:absolute; width:20px; bottom:7px; border-bottom:2px solid currentColor}
#corner-bell svg {width:20px; height:20px; fill:currentColor}
#corner-bell .icon-badge {font-size:10px; height:16px; min-width:16px; line-height:16px; top:3px; right:1px}
body:has(#compose:not([hidden])) #corner-bell {display:none}
.reminder-row.unread strong::before {content:""; display:inline-block; background:var(--accent); width:6px; height:6px; border-radius:50%; vertical-align:middle; margin-right:6px}
@media (min-width:1024px) {
  main:has(#compose[hidden]) {padding-top:68px; scroll-padding-top:56px}
}
@media (max-width:1023px) {
  #corner-bell {top:max(6px,env(safe-area-inset-top)); right:max(8px,env(safe-area-inset-right))}
}

.change-details {margin:0}
.change-details summary { padding-block:4px; cursor: pointer; width: fit-content; font-size: .9rem; text-decoration: underline; text-underline-offset: .18em; }
.change-details[open] summary { margin-bottom: .55rem; }
.change-details small { display: block; margin-top: .55rem; }


/* A single monochrome material for panels and interactive surfaces. */
:root {
  --glass-dots:radial-gradient(circle at 1px 1px,rgb(238 235 223 / 10%) .65px,transparent .9px) 0 0/4px 4px;
  --glass-surface:linear-gradient(110deg,transparent 0%,rgb(36 36 35 / 90%) 48%,#232322 100%),var(--glass-dots),linear-gradient(155deg,#383836,#242423);
  --glass-hover:linear-gradient(110deg,transparent,rgb(47 47 45 / 94%) 58%),var(--glass-dots),linear-gradient(145deg,#42423f,#2e2e2d);
}
#home-reminders,#source-dialog {
  color:var(--ink); background:var(--glass-surface); border:1px solid #52514d;
  box-shadow:inset 0 1px 0 rgb(255 255 255 / 9%),0 12px 40px rgb(0 0 0 / 35%);
}
.secondary,.primary:not(.message-composer button):not(:disabled) {
  box-shadow:inset 0 1px 0 rgb(255 255 255 / 10%); transition:background-color .15s,border-color .15s;
}
.secondary {background:var(--glass-surface)}
.primary:not(.message-composer button):not(:disabled) {
  background:linear-gradient(115deg,transparent,#ddd9cf 80%),radial-gradient(circle at 1px 1px,#c6c1b6 .65px,transparent .9px) 0 0/4px 4px,#f0ede4;
}
.secondary:is(:hover,:focus-visible):not(:disabled) {background:var(--glass-hover); border-color:#77756f}
.sidebar nav :is(a,button)[aria-current=page],
.sidebar nav :is(a,button):is(:hover,:focus-visible),
:is(.directory-row,.update-row,.reminder-row,.src,.text-button,.case-nav button,.archive-filter a,.inbox-filters a):is(:hover,:focus-visible),
:is(#history-toggle,#close-menu,#home-reminders header button,#source-dialog header button):is(:hover,:focus-visible) {
  background:var(--glass-hover); color:var(--ink); border-radius:6px;
}
#corner-bell {color:#797873}
#corner-bell:has(#corner-count:not([hidden])),#corner-bell:is(:hover,:focus-visible) {color:var(--ink)}
#source-dialog {
  position:fixed; inset:0 0 0 auto; margin:0; width:min(440px,calc(100% - 18px)); max-width:100%;
  height:100%; height:100dvh; max-height:100dvh; padding:0; border-radius:16px 0 0 16px; overflow:hidden;
}
#source-dialog[open] {display:flex; flex-direction:column}
#source-dialog::backdrop {background:rgb(0 0 0 / 32%)}
#source-dialog header {display:flex; flex:none; align-items:center; justify-content:space-between; padding:max(12px,env(safe-area-inset-top)) 12px 12px 22px; border-bottom:1px solid var(--border)}
#source-heading {font-size:19px; line-height:1.3}
#source-dialog header button {display:grid; place-items:center; width:44px; height:44px; border-radius:9px}
#close-source svg {width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.65; stroke-linecap:round}
#source-body {overflow:auto; overscroll-behavior:contain; padding:20px 22px max(28px,env(safe-area-inset-bottom)); overflow-wrap:anywhere}
#source-body h3 {font-size:17px}
@media (prefers-reduced-motion:no-preference) {
  #source-dialog[open] {animation:open-source 170ms cubic-bezier(.2,.8,.2,1)}
  @keyframes open-source {from {transform:translateX(6px); opacity:.72} to {transform:none; opacity:1}}
}
/* A fine stipple catches light at the rim, leaving the writing surface quiet. */
.composer,.record-search {
  position:relative; isolation:isolate; border:1px solid #535250;
  background:linear-gradient(145deg,#30302e,#20201f 64%);
  box-shadow:inset 0 1px 0 rgb(255 255 255 / 5%),0 6px 20px rgb(0 0 0 / 12%);
  transition:border-color 150ms,box-shadow 150ms;
}
.composer::before,.record-search::before {
  content:""; position:absolute; z-index:-1; inset:0; border-radius:inherit; pointer-events:none;
  background:radial-gradient(circle,#aaa 0.65px,transparent 0.9px) 0 0/4px 4px;
  mask-image:linear-gradient(158deg,#000,transparent 32%); opacity:.16;
}
.composer:focus-within,.record-search:focus-within {border-color:#a29f98; box-shadow:inset 0 1px 0 rgb(255 255 255 / 12%),0 8px 24px rgb(0 0 0 / 16%)}
@media (prefers-reduced-motion:no-preference) {
  #backdrop {mask-image:linear-gradient(115deg,#000 5%,rgb(0 0 0 / 35%) 38%,#000 72%); mask-size:205% 100%; animation:raster-light 27s ease-in-out infinite alternate}
  @keyframes raster-light {from {mask-position:0% 50%} to {mask-position:100% 50%}}
  .app-icon,.primary {transition:transform 130ms ease-out,background-color 160ms,border-color 160ms}
  .home-tile:active .app-icon,.primary:active:not(:disabled) {transform:scale(.94)}
  #home-reminders:popover-open {animation:open-reminders 150ms ease-out}
  @keyframes open-reminders {from {opacity:0; transform:translateY(-3px)} to {opacity:1; transform:none}}
}
@media (prefers-reduced-motion:reduce) {
  #sidebar-content,#menu-scrim,.composer {transition:none}
}
.message-composer {
  display:grid; grid-template-columns:minmax(0,1fr) 44px; align-items:end;
  padding:3px 4px 3px 0; border-radius:26px;
}
.message-composer textarea {
  align-self:center; font-size:16px; line-height:22px; padding:11px 6px 11px 18px; border-radius:0;
  min-height:44px; max-height:clamp(44px,calc((100dvh - var(--keyboard-inset,0px)) * .34),160px); resize:none;
}
.message-composer .actions {display:contents}
.message-composer button {display:grid; place-items:center; width:44px; height:44px; padding:0; border-radius:50%; background:transparent}
.message-composer button::before {content:""; grid-area:1/1; width:34px; height:34px; border-radius:50%; background:var(--accent)}
.message-composer button:disabled::before {background:#393938}
.message-composer button svg {display:block; grid-area:1/1; z-index:1; width:20px; height:20px; stroke-width:2}
.message-composer button[aria-busy=true] svg {visibility:hidden}
.message-composer button[aria-busy=true]::after {content:""; grid-area:1/1; z-index:1; width:4px; height:4px; border-radius:50%; background:currentColor; box-shadow:-6px 0 currentColor,6px 0 currentColor}
#submit-label {position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap}
@media (min-width:768px) {
  #compose:has(.is-docked)::after,#followup-slot:has(.is-docked)::after {content:""; display:block; height:52px}
  .message-composer.is-docked {
    position:fixed; z-index:2; margin:0;
    left:var(--composer-left); width:var(--composer-width);
    bottom:calc(var(--keyboard-inset,0px) + max(44px,env(safe-area-inset-bottom)));
  }
  main:has(#form.is-docked):has(#compose:not([hidden])),main:has(#case:not([hidden]) #consultation:not([hidden]) #followup-form:not([hidden]) .is-docked) {padding-bottom:calc(var(--composer-height,52px) + 72px); scroll-padding-bottom:calc(var(--composer-height,52px) + 60px)}
}
@media (max-width:767px) {
  :root {--composer-gap:max(22px,calc(env(safe-area-inset-bottom) + 8px))}
  main:has(#compose:not([hidden])) {
    display:flex; flex-direction:column; margin-bottom:var(--keyboard-inset,0px);
    padding-top:calc(max(6px,env(safe-area-inset-top)) + 50px);
    padding-bottom:calc(var(--composer-height,52px) + 16px + var(--composer-gap));
  }
  main:has(#compose:not([hidden])) #error:empty {margin:0}
  main:has(#compose:not([hidden])) #backdrop {height:clamp(240px,55dvh,460px)}
  main:has(#case:not([hidden]) #consultation:not([hidden]) #followup-form:not([hidden])) {padding-bottom:calc(var(--composer-height,52px) + var(--composer-gap) + var(--keyboard-inset,0px) + 20px); scroll-padding-bottom:calc(var(--composer-height,52px) + var(--composer-gap) + var(--keyboard-inset,0px))}
  #compose {display:flex; flex:1 0 auto; flex-direction:column; margin:0 auto}
  #compose .home-tiles {flex:1; align-items:center; margin:12px auto 24px}
  #compose h1 {margin:0; font-size:clamp(24px,6vw,32px)}
  .message-composer {
    position:fixed; z-index:2; left:max(12px,env(safe-area-inset-left)); right:max(12px,env(safe-area-inset-right));
    bottom:calc(var(--keyboard-inset,0px) + var(--composer-gap)); width:auto; max-width:620px;
  }
}

#followup-slot {width:min(100%,680px)}
#desktop-menu {display:none}
@media (min-width:1024px) {
  #desktop-menu {display:grid; place-items:center; align-self:flex-end; width:40px; height:40px; flex:none; margin:-10px -2px -14px 0; color:var(--muted); border-radius:10px}
  #desktop-menu:hover,#desktop-menu:focus-visible {color:var(--ink); background:var(--glass-hover)}
  .workspace.menu-collapsed {grid-template-columns:minmax(0,1fr)}
  .menu-collapsed .sidebar {display:contents}
  .menu-collapsed #sidebar-content {display:none}
  .menu-collapsed #desktop-menu {position:fixed; z-index:3; top:7px; left:12px; margin:0}
}

/* The name of a case is edited in place of its title: the title or the pencil opens the field. */
.case-title {--title-line:calc(clamp(25px,3vw,34px)*1.2); display:flex; align-items:flex-start; gap:6px}
.case-title #record-title {min-width:0; overflow-wrap:anywhere}
.case-title.editable #record-title {cursor:pointer; border-radius:6px}
@media (hover:hover) {
  .case-title.editable #record-title:hover {background:var(--hover); box-shadow:0 0 0 4px var(--hover)}
}
#edit-case-name {display:grid; place-items:center; flex:none; width:36px; height:36px; margin-top:calc((var(--title-line) - 36px)/2); color:var(--muted); border-radius:8px}
#edit-case-name:hover:not(:disabled),#edit-case-name:focus-visible {color:var(--ink); background:var(--glass-hover)}
#edit-case-name:disabled {opacity:.45}
#edit-case-name svg {width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round}
.case-title-form {display:grid; gap:8px; justify-items:start}
.case-title-form .form-actions {margin-top:0}
#case-name {width:100%; max-width:38ch; min-width:0; padding:3px 8px; color:var(--ink); background:var(--surface); border:1px solid var(--border); border-radius:8px; font-size:clamp(25px,3vw,34px); font-weight:550; letter-spacing:-.03em; line-height:1.2}
#case-name[aria-invalid=true] {border-color:var(--error)}
#case-name:read-only {color:var(--muted)}
#case-name-error {max-width:68ch; color:var(--error); font-size:14px}
#case-name-error:empty {display:none}
@media (max-width:767px) {
  #edit-case-name {width:40px; height:40px; margin-top:calc((var(--title-line) - 40px)/2)}
}

/* The list of cases. A row is a mark button, a link to the card and an archive action side
   by side; on a phone the action moves under the link. */
.archive-filter {align-items:center}
#flagged-records {display:inline-flex; align-items:center; gap:6px; min-height:32px; padding:4px 11px; font-size:14px; color:var(--muted); border:1px solid var(--border); border-radius:999px}
#flagged-records:is(:hover,:focus-visible) {color:var(--ink); border-color:var(--muted); background:var(--glass-hover)}
#flagged-records[aria-pressed=true] {color:var(--ink); border-color:var(--ink); background:var(--marked)}
#flagged-records svg,.case-flag svg {width:18px; height:18px; flex:none; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round}
#flagged-records[aria-pressed=true] svg,.case-flag[aria-pressed=true] svg {fill:currentColor}
#record-status {flex-basis:100%; margin:0; font-size:14px; color:var(--text)}
#record-status:empty {display:none}
#record-status:focus {outline:none}
#record-status.problem {color:var(--error)}
.case-rows {margin:0; padding:0; list-style:none}
.case-row {display:grid; grid-template-columns:40px minmax(0,1fr) auto; grid-template-areas:"flag link actions" ". meta actions" ". confirm confirm"; align-items:start; column-gap:6px; border-top:1px solid var(--border)}
.case-row .directory-row {grid-area:link; min-width:0; padding:14px 6px 0; border-top:0; overflow-wrap:anywhere}
.case-flag {grid-area:flag; display:grid; place-items:center; width:40px; height:40px; margin-top:7px; color:var(--muted); border-radius:8px}
.case-flag:is(:hover,:focus-visible) {color:var(--ink); background:var(--hover)}
.case-flag[aria-pressed=true] {color:var(--accent)}
.case-next {font-size:15px}
.case-next-label,.case-next.none,.case-row small,.case-unsaved {color:var(--muted)}
.case-due {font-size:14px}
.case-due.today {color:var(--ink); font-weight:600}
.case-due.overdue {color:var(--error)}
.case-row small {font-size:13px}
.case-meta {grid-area:meta; padding:2px 6px 14px}
.case-row .directory-row strong {color:var(--ink); font-size:17px; line-height:1.35; font-weight:600; letter-spacing:-.012em}
.case-row:has(.directory-row:is(:hover,:focus-visible)) {background:var(--glass-hover); border-radius:8px}
.case-row .directory-row:is(:hover,:focus-visible) {background:transparent}
.case-flag:is(:hover,:focus-visible),#flagged-records[aria-pressed=true] {background:var(--glass-hover)}
.case-actions {grid-area:actions; display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:6px 12px; min-height:40px; margin-top:7px; font-size:14px}
.case-actions .secondary {min-height:32px}
.case-actions [aria-disabled=true] {color:var(--muted); cursor:default}
.case-confirm {grid-area:confirm; max-width:62ch; margin:0 0 14px; padding:12px 14px; font-size:14px; background:var(--surface); border:1px solid var(--border); border-radius:10px}
.case-confirm .form-actions {margin-top:10px}
@media (max-width:767px) {
  .case-row {grid-template-columns:minmax(0,1fr) auto; grid-template-areas:"link flag" "meta actions" "confirm confirm"; padding-block:8px; align-items:start}
  .case-flag {width:44px; height:44px; margin-top:5px}
  .case-row .directory-row {padding:6px 2px 0}
  .case-row .directory-row strong {font-size:16px}
  .case-row .case-flag {justify-self:end; margin:0}
  .case-meta {align-self:center; padding:6px 2px}
  .case-actions:has(.case-unsaved) {grid-column:1/-1; grid-row:auto}
  .case-confirm {margin:8px 0 0}
  .case-actions {justify-content:flex-end; min-height:0; margin:3px 0 0}
  .case-actions .secondary,.case-confirm button,#flagged-records {min-height:40px}
}

#provider-setting {display:grid; gap:4px}
#provider-setting[hidden] {display:none}
#consult-provider {width:100%; min-height:40px; padding:6px 9px; color:var(--ink); background:var(--glass-surface); border:1px solid var(--border); border-radius:8px; font:inherit}
