/* Themis: Matters list, Diary by matter, and the matter tab (6 Oct 2026). Loaded last. Uses the app tokens (--rd-*). */

/* ---------- the tab for the open matter, in place of "Router" ---------- */
.workspace-toolbar nav [data-view="route"].tab-matter{display:inline-flex;align-items:center;gap:8px;max-width:240px}
.workspace-toolbar nav [data-view="route"][hidden]{display:none!important}
.tab-matter-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tab-matter-flag{flex:none;padding:1px 7px;border-radius:999px;background:var(--rd-warm);color:var(--rd-warm-ink);font-size:11px;font-weight:650;letter-spacing:.01em}
@media(max-width:640px){.workspace-toolbar nav [data-view="route"].tab-matter{max-width:96px}.tab-matter-flag{display:none}}

/* ---------- Matters ---------- */
.mx-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 16px;margin-bottom:14px}
.mx-bar h2{margin:0;font-size:20px;font-weight:600;letter-spacing:-.015em;color:var(--rd-ink)}
.start-returning .mx-bar{justify-content:flex-end}
.mx-tools{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.mx-seg,.dy-seg{display:inline-flex;padding:3px;border-radius:999px;background:var(--rd-soft);border:1px solid var(--rd-line)}
.mx-seg button,.dy-seg button{min-height:30px;padding:0 13px;border:0;border-radius:999px;background:none;font:inherit;font-size:13px;font-weight:600;color:var(--rd-muted);cursor:pointer}
.mx-seg button[aria-pressed=true],.dy-seg button[aria-pressed=true]{background:var(--rd-surface);color:var(--rd-ink);box-shadow:0 1px 2px rgba(36,63,42,.12)}
.mx-seg button:focus-visible,.dy-seg button:focus-visible{outline:2px solid var(--rd-focus);outline-offset:1px}
.mx-search input{width:200px;height:36px;padding:0 12px;border:1px solid var(--rd-line);border-radius:999px;background:var(--rd-surface);font:inherit;font-size:14px;color:var(--rd-ink)}
.mx-search input:focus{outline:2px solid var(--rd-focus);outline-offset:1px}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.mx-list{display:grid;gap:10px;margin:0;padding:0;list-style:none}
.mx-card{position:relative;border:1px solid var(--rd-line);border-radius:16px;background:var(--rd-surface);transition:border-color .15s,box-shadow .15s}
.mx-card:hover{border-color:var(--rd-line-strong);box-shadow:0 10px 26px -18px rgba(36,63,42,.45)}
.mx-card.is-late{border-color:#e0a397}
.mx-card.is-late::before,.mx-card.is-soon::before{content:"";position:absolute;left:-1px;top:14px;bottom:14px;width:3px;border-radius:0 3px 3px 0;background:var(--rd-late)}
.mx-card.is-soon::before{background:#c98a2a}
.mx-open{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:4px 16px;width:100%;padding:16px 56px 16px 18px;border:0;border-radius:16px;background:none;color:inherit;text-align:left;font:inherit;cursor:pointer}
.mx-open:focus-visible{outline:2px solid var(--rd-focus);outline-offset:-2px}
.mx-mono{display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:var(--rd-soft);color:var(--rd-accent);font-size:14px;font-weight:700;letter-spacing:.02em}
.mx-body{display:flex;flex-direction:column;gap:2px;min-width:0}
.mx-name{font-size:16.5px;font-weight:600;letter-spacing:-.01em;color:var(--rd-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mx-meta{font-size:13.5px;color:var(--rd-text)}
.mx-at{font-size:13px;color:var(--rd-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mx-saved{font-size:12px;color:var(--rd-muted);opacity:.85}
.mx-due{display:flex;flex-direction:column;align-items:flex-end;gap:1px;text-align:right;max-width:220px}
.mx-due b{font-size:14px;font-weight:650;color:var(--rd-accent)}
.mx-due small{font-size:12.5px;color:var(--rd-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:220px}
.mx-due .mx-moredates,.mx-due .mx-nodate{color:var(--rd-muted)}
.is-late .mx-due b{color:var(--rd-late)}
.is-soon .mx-due b{color:var(--rd-warm-ink)}
.mx-go{display:grid;place-items:center;width:32px;height:32px;border-radius:50%;background:var(--rd-soft);color:var(--rd-accent);transition:background .15s,color .15s}
.mx-go svg{width:16px;height:16px}
.mx-card:hover .mx-go{background:var(--rd-accent);color:#fff}
html[data-theme=dark] .mx-card:hover .mx-go{background:var(--d-accent-fill);color:var(--d-on-accent)}
.mx-more{position:absolute;top:50%;right:12px;transform:translateY(-50%);display:grid;place-items:center;width:34px;height:34px;border:0;border-radius:50%;background:none;color:var(--rd-muted);cursor:pointer}
.mx-more:hover,.mx-more[aria-expanded=true]{background:var(--rd-soft);color:var(--rd-ink)}
.mx-more svg,.dy-icon svg{width:18px;height:18px;fill:currentColor}
.mx-menu,.mx-confirm{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;padding:0 18px 14px 76px}
.mx-menu .mh-tool{padding:6px 12px;border:1px solid var(--rd-line);border-radius:999px;background:var(--rd-surface);font-size:13px;font-weight:600;color:var(--rd-accent)}
.mx-menu .mx-del{color:var(--rd-late)}
.mx-confirm span{font-size:13.5px;color:var(--rd-ink)}
.mx-card.mx-editing{padding:16px 18px}
.mx-none{margin:6px 0 0;font-size:14px;color:var(--rd-muted)}
@media(max-width:640px){
 .mx-bar{flex-direction:column;align-items:stretch}
 .mx-tools{justify-content:space-between}
 .mx-search input{width:100%}.mx-search{flex:1}
 .mx-open{grid-template-columns:auto minmax(0,1fr);grid-template-areas:"mono body" "due due";padding:14px 48px 14px 14px;gap:10px 12px}
 .mx-mono{grid-area:mono;width:38px;height:38px;font-size:13px}
 .mx-body{grid-area:body}
 .mx-due{grid-area:due;flex-direction:row;flex-wrap:wrap;align-items:baseline;justify-content:flex-start;gap:2px 8px;max-width:none;text-align:left;padding:8px 10px;border-radius:10px;background:var(--rd-soft)}
 .mx-due small{max-width:100%}
 .mx-go{display:none}
 .mx-more{top:12px;right:8px;transform:none}
 .mx-menu,.mx-confirm{padding:0 14px 14px}
}

/* ---------- Diary ---------- */
.dy-title h1{margin:0;font-size:28px;font-weight:600;letter-spacing:-.025em;color:var(--rd-ink)}
.dy-title h1:focus{outline:none}
.dy-title .dy-summary{margin:0;font-size:17px;font-weight:600;color:var(--rd-ink)}
.dy-top{align-items:flex-end}
.dy-matter{margin-top:22px;border:1px solid var(--rd-line);border-radius:16px;background:var(--rd-surface);overflow:hidden;scroll-margin-top:calc(var(--mast-h,68px) + 60px)}
.dy-matter.is-late{border-color:#e0a397}
.dy-mhead{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 16px;padding:14px 16px 12px;border-bottom:1px solid var(--rd-line);background:var(--rd-soft)}
.dy-mhead h2{margin:0;font-size:16.5px;font-weight:600;letter-spacing:-.01em;color:var(--rd-ink)}
.dy-mhead p{margin:2px 0 0;font-size:13px;color:var(--rd-muted)}
.dy-mtools{display:flex;flex-wrap:wrap;gap:8px}
.dy-open-matter svg{order:2}
.dy-matter ol{list-style:none;margin:0;padding:0}
.dy-matter .dy-form{margin:0;border:0;border-bottom:1px solid var(--rd-line);border-radius:0}
.dy-loose .dy-mhead{background:var(--rd-warm)}
.dy-loose .dy-mhead h2,.dy-loose .dy-mhead p{color:var(--rd-warm-ink)}
.dy-flash{animation:dy-flash 1.6s ease}
@keyframes dy-flash{0%,40%{box-shadow:0 0 0 3px var(--rd-line-strong)}100%{box-shadow:none}}
/* one row: date, what is due, when, and two quiet controls */
.dy-item{grid-template-columns:auto minmax(0,1fr) auto auto;grid-template-areas:"date main when actions" "date menu menu menu";gap:2px 14px;padding:12px 14px}
.dy-actions{grid-area:actions;margin:0;gap:2px;flex-wrap:nowrap}
.dy-icon{display:grid;place-items:center;width:34px;height:34px;border:0;border-radius:50%;background:none;color:var(--rd-muted);cursor:pointer}
.dy-icon:hover,.dy-icon[aria-expanded=true]{background:var(--rd-soft);color:var(--rd-ink)}
.dy-done-btn svg{fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.dy-done-btn:hover{background:var(--rd-accent);color:#fff}
html[data-theme=dark] .dy-done-btn:hover{background:var(--d-accent-fill);color:var(--d-on-accent)}
.dy-menu{grid-area:menu;display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.dy-steplink{padding:0;border:0;background:none;font:inherit;color:var(--rd-accent);text-decoration:underline;text-underline-offset:2px;text-decoration-color:var(--rd-line-strong);cursor:pointer}
.dy-matter-chip{display:inline-flex;max-width:100%;margin-top:6px;padding:2px 10px;border:1px solid var(--rd-line);border-radius:999px;background:var(--rd-soft);font:inherit;font-size:12.5px;font-weight:600;color:var(--rd-accent);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}
.dy-matter-chip:hover{border-color:var(--rd-line-strong)}
.dy-link{grid-column:2/-1;display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px;font-size:13px;color:var(--rd-text)}
.dy-link select{height:34px;padding:0 10px;border:1px solid var(--rd-line);border-radius:999px;background:var(--rd-surface);font:inherit;font-size:13.5px;color:var(--rd-ink)}
.dy-form{grid-template-columns:1.4fr 2fr 1fr}
.dy-form-empty{display:block}
.dy-form-empty p{margin:0 0 12px;font-size:14px;line-height:1.55;color:var(--rd-text)}
.is-done{grid-template-columns:1fr auto;grid-template-areas:"main actions"}
.is-done .dy-actions{gap:8px}
@media(max-width:700px){
 .dy-top{flex-direction:column;align-items:stretch}
 .dy-tools{justify-content:space-between}
 .dy-item{grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"date main actions" "date when when" "date menu menu";padding:12px}
 .dy-when{font-size:12.5px}
 .dy-mhead{padding:12px}
 .dy-mtools{width:100%}
 .dy-mtools .dy-btn{flex:1;justify-content:center}
 .dy-form{grid-template-columns:1fr}
}

/* ---------- final polish (6 Oct 2026) ---------- */
/* the shortcut hint gives way once there is something in the search box */
.workspace-search:focus-within .key-hint,.workspace-search:has(input:not(:placeholder-shown)) .key-hint{display:none}
/* diary rows: the step is its own quiet line, no button padding */
.dy-steplink{display:block;min-height:0;margin-top:3px;font-size:13px;text-align:left;line-height:1.4}
.dy-matter-chip{min-height:0}
.dy-main .dy-sub{margin-top:2px}
/* the matter header carries one quiet way into the matter */
.dy-open-matter{display:inline-flex;align-items:center;gap:4px;min-height:0;padding:6px 2px;border:0;background:none;font:inherit;font-size:13.5px;font-weight:600;color:var(--rd-accent);cursor:pointer;white-space:nowrap}
.dy-open-matter svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s}
.dy-open-matter:hover svg{transform:translateX(2px)}
.dy-open-matter:focus-visible{outline:2px solid var(--rd-focus);outline-offset:2px;border-radius:6px}
.dy-mhead{flex-wrap:nowrap}
.dy-mhead>div{min-width:0}
@media(max-width:700px){.dy-mhead{align-items:flex-start}}
/* matters on phones: the next-date strip runs the full width of the card */
@media(max-width:640px){.mx-due{margin-right:-34px}}
.dy-link select{min-height:0;height:34px;padding:0 30px 0 12px}
/* search results sit on a solid surface so nothing shows through, and clearing lives in the box itself */
.workspace-search .search-results{background:var(--rd-surface)!important;-webkit-backdrop-filter:none;backdrop-filter:none}
html[data-theme=dark] .workspace-search .search-results{background:#1d1c1a!important}
@media(min-width:821px){.workspace-search .search-head button{display:none}}
/* on phones, the floating Ask Themis button never covers the last item of a list */
@media(max-width:820px){#diaryApp,.start-returning{padding-bottom:84px}}

/* ••• menus as dropdowns (6 Oct 2026): anchored to the button, listed vertically, closed by a click elsewhere or Escape. */
.dy-matter,.dy-group ol{overflow:visible}
.dy-mhead{border-radius:15px 15px 0 0}
.dy-matter .dy-item:last-child,.dy-group ol>li:last-child{border-radius:0 0 15px 15px}
.dy-group ol>li:first-child{border-radius:13px 13px 0 0}
.dy-actions{position:relative}
.ctx-menu{position:absolute;z-index:40;top:calc(100% + 6px);right:0;display:flex;flex-direction:column;min-width:200px;max-width:min(300px,calc(100vw - 32px));padding:6px;border:1px solid var(--rd-line);border-radius:12px;background:var(--rd-surface);box-shadow:0 10px 30px rgba(24,48,30,.14),0 2px 6px rgba(24,48,30,.06);text-align:left;animation:ctxIn .14s ease-out}
@keyframes ctxIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.ctx-menu{animation:none}}
.ctx-item{display:flex;align-items:center;gap:10px;width:100%;min-height:38px;padding:8px 10px;border:0;border-radius:8px;background:none;color:var(--rd-ink);font:inherit;font-size:14px;font-weight:500;text-align:left;cursor:pointer}
.ctx-item svg{flex:none;width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;color:var(--rd-muted)}
.ctx-item:hover,.ctx-item:focus-visible{background:var(--rd-soft);outline:none}
.ctx-item-danger,.ctx-item-danger svg{color:var(--rd-late)}
.ctx-item-danger{border-top:1px solid var(--rd-line);border-radius:0 0 8px 8px;margin-top:4px;padding-top:10px}
.ctx-confirm{gap:10px;padding:12px 12px 10px;min-width:240px}
.ctx-q{font-size:13.5px;line-height:1.45;color:var(--rd-ink);white-space:normal}
.ctx-row{display:flex;justify-content:flex-end;gap:8px}
.ctx-cancel,.ctx-danger{min-height:34px;padding:0 14px;border-radius:999px;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
.ctx-cancel{border:1px solid var(--rd-line);background:var(--rd-surface);color:var(--rd-ink)}
.ctx-danger{border:1px solid var(--rd-late);background:var(--rd-late);color:#fff}
.mx-ctx{top:calc(50% + 22px);right:12px}
@media(max-width:640px){.mx-ctx{top:50px;right:8px}}
html[data-theme=dark] .ctx-menu{box-shadow:0 12px 32px rgba(0,0,0,.45)}

/* Diary toolbar (6 Oct 2026): one height for every control; Add a date is a quiet pill; calendar export is an icon */
.dy-tools{gap:8px}
.dy-add{display:inline-flex;align-items:center;gap:7px;min-height:38px;padding:0 16px!important;border:1px solid var(--rd-accent,#31563b);border-radius:999px;background:var(--rd-accent,#31563b);color:#fff;font:inherit;font-size:13.5px!important;font-weight:600;cursor:pointer;box-shadow:none;transition:filter .15s}
.dy-add:hover{filter:brightness(1.08)}
.dy-add svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
.dy-add[aria-expanded=true]{background:var(--rd-surface);color:var(--rd-ink);border-color:var(--rd-line)}
.dy-cal{display:grid;place-items:center;width:38px;height:38px;padding:0;border:1px solid var(--rd-line);border-radius:50%;background:var(--rd-surface);color:var(--rd-ink);cursor:pointer;transition:background .15s,border-color .15s}
.dy-cal svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.dy-cal:hover,.dy-cal:focus-visible{background:var(--rd-soft);border-color:var(--rd-accent,#31563b)}
.dy-seg{min-height:38px;box-sizing:border-box;align-items:center}
html[data-theme=dark] .dy-add{background:var(--d-accent,#9fc08a);border-color:var(--d-accent,#9fc08a);color:#13210f}
html[data-theme=dark] .dy-add[aria-expanded=true]{background:var(--d-surface);color:var(--d-text);border-color:var(--d-line2)}
html[data-theme=dark] .ctx-danger{color:#2a0d08}
.madeby a{color:inherit;font-weight:600;text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}.madeby a:hover{color:var(--rd-ink)}
/* Matter cards without the initials badge (6 Oct 2026) */
.mx-open{grid-template-columns:minmax(0,1fr) auto auto}
@media(max-width:640px){.mx-open{grid-template-columns:minmax(0,1fr);grid-template-areas:"body" "due"}}

/* Confirmations beside the control (6 Oct 2026): no green pop-up */
.workspace-toast.th-toast-quiet{position:fixed!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important;border:0!important;box-shadow:none!important;animation:none!important}
.th-note{position:absolute;z-index:240;display:flex;align-items:flex-start;gap:7px;max-width:min(320px,calc(100vw - 24px));padding:7px 11px 7px 9px;border:1px solid var(--rd-line);border-radius:10px;background:var(--rd-surface);color:var(--rd-ink);font-size:12.5px;line-height:1.45;box-shadow:0 6px 20px rgba(24,48,30,.10);opacity:0;transform:translateY(-3px);transition:opacity .18s ease,transform .18s ease;pointer-events:auto}
.th-note.th-note-in{opacity:1;transform:none}
.th-note svg{flex:none;width:15px;height:15px;margin-top:1px;fill:none;stroke:var(--rd-muted);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.th-note-ok svg{stroke:var(--rd-accent)}
.th-note-free{position:fixed;top:84px;right:16px}
@media (prefers-reduced-motion:reduce){.th-note{transition:none}}
html[data-theme=dark] .th-note{box-shadow:0 8px 24px rgba(0,0,0,.45)}
/* The undo prompt stays (it has a button) but loses the green block */
.workspace-toast.th-undo-toast{background:var(--rd-surface)!important;color:var(--rd-ink)!important;border:1px solid var(--rd-line);box-shadow:0 8px 24px rgba(24,48,30,.12)!important;border-radius:14px!important;font-size:13px!important}
.workspace-toast.th-undo-toast button{color:var(--rd-accent)!important;border-color:var(--rd-line)!important}
/* Phone: the route no longer leaves an empty band above the footer */
@media(max-width:820px){body.rf-on .route-layout{padding-bottom:16px!important}}
/* Flag an issue sits on the same quiet line as the legal notice */
#detail .reader-end{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap}
#detail .reader-end>.disclaimer{flex:1 1 auto;min-width:0}
#detail .reader-end>.debt-flag{flex:none;margin-top:var(--flag-top,16px)}
#detail .reader-end{margin-top:18px;padding-top:14px;border-top:1px solid var(--rd-line)}
#detail .reader-end>.disclaimer{margin-top:0!important;padding-top:0!important;border-top:0!important}
#detail .reader-end>.debt-flag{--flag-top:2px;font-size:12px}

/* Matters header (6 Oct 2026): New matter and the filter sit beside "Your matters"; the header keeps search, theme and profile */
.mx-headrow{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.mx-headrow h1{margin:0!important}
.mx-headtools{display:flex;align-items:center;gap:8px}
.mx-headtools .mx-hbtn{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:40px;min-width:40px;margin:0;padding:0 12px;border:1px solid var(--rd-line);border-radius:999px;background:var(--rd-surface);color:var(--rd-ink);font:inherit;font-size:14px;font-weight:600;line-height:1;cursor:pointer;transition:background .15s,border-color .15s}
.mx-headtools .mx-hbtn svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.mx-headtools .mx-hbtn[data-mx-filters]{width:40px;padding:0}
.mx-headtools .mx-hbtn[aria-expanded=true]{background:var(--rd-soft);border-color:var(--rd-accent)}
.mx-headtools #newMatter.mx-hbtn{padding:0 16px;border-color:var(--rd-accent);background:var(--rd-accent);color:#fff}
.mx-headtools #newMatter.mx-hbtn:hover{background:var(--rd-accent-hover);border-color:var(--rd-accent-hover)}
html[data-theme=dark] .mx-headtools #newMatter.mx-hbtn{background:var(--d-accent-fill);border-color:var(--d-accent-fill);color:var(--d-on-accent)}
@media(max-width:640px){.mx-headtools #newMatter.mx-hbtn{width:40px;padding:0}.mx-headtools #newMatter span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}}
.mx-bar-open{margin:14px 0 4px}
.mx-bar-open .mx-tools{display:flex;flex-wrap:wrap;align-items:center;gap:8px;width:100%}
.mx-bar-open .mx-search{flex:1 1 200px}
.mx-bar-open .mx-search input{width:100%;box-sizing:border-box}
/* Phone header: the search icon is back to its outline style (7 Oct 2026); New matter is the green one again. */

/* Footer (6 Oct 2026): no credit line; it sits at the bottom of short pages instead of leaving a blank band below it */
body.themis-workspace{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column}
body.themis-workspace>#main,body.themis-workspace main#main{flex:1 0 auto;display:flex;flex-direction:column;width:100%}
body.themis-workspace #main>.footer{margin-top:auto!important}
body.themis-workspace .footer{padding-bottom:28px!important}
body.themis-workspace.rf-on .footer{padding-bottom:124px!important}

/* Matter cards (6 Oct 2026): a progress ring where the menu was; the menu sits beside the next date */
.mx-card{display:grid}
.mx-card>.mx-open{grid-area:1/1}
.mx-card>.mx-more{grid-area:1/1;position:static!important;transform:none!important;align-self:center;justify-self:end;margin-right:78px;z-index:1}
.mx-open{grid-template-columns:minmax(0,1fr) auto auto!important;padding-right:18px!important}
.mx-due{margin-right:46px}
.mx-ring{--p:0;flex:none;width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:conic-gradient(var(--rd-accent) calc(var(--p)*1%),color-mix(in srgb,var(--rd-accent) 16%,transparent) 0)}
.mx-ring>span[aria-hidden]{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:var(--rd-surface);font-size:11.5px;font-weight:700;letter-spacing:-.01em;color:var(--rd-ink)}
html[data-theme=dark] .mx-ring{background:conic-gradient(var(--d-accent) calc(var(--p)*1%),color-mix(in srgb,var(--d-accent) 18%,transparent) 0)}
.mx-card>.mx-ctx{top:calc(50% + 24px);right:78px}
@media(max-width:640px){
 .mx-open{grid-template-columns:minmax(0,1fr) auto!important;grid-template-areas:"body ring" "due due"!important;padding:14px 14px 14px 16px!important}
 .mx-ring{grid-area:ring;align-self:start;width:44px;height:44px}
 .mx-ring>span[aria-hidden]{width:35px;height:35px;font-size:11px}
 .mx-due{margin-right:0!important;padding-right:48px!important}
 .mx-card>.mx-more{align-self:end;margin:0 20px 19px 0}
 .mx-card>.mx-ctx{top:auto;bottom:6px;right:14px;transform:translateY(100%)}
}
/* In-button feedback (6 Oct 2026): no pop-ups at all */
.th-note{display:none!important}
.th-btn-done{transition:background-color .2s ease,color .2s ease}
.th-btn-done .th-btn-check{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;flex:none}
.th-btn-done{display:inline-flex;align-items:center;justify-content:center;gap:6px}
.th-undo-inline{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:10px 0 12px;padding:10px 12px 10px 14px;border:1px solid var(--rd-line);border-radius:12px;background:var(--rd-soft);color:var(--rd-ink);font-size:13px;line-height:1.45;animation:thFade .2s ease-out}
.th-undo-inline button{flex:none;min-height:32px;padding:0 14px;border:1px solid var(--rd-accent);border-radius:999px;background:var(--rd-surface);color:var(--rd-accent);font:inherit;font-size:13px;font-weight:600;cursor:pointer}
@keyframes thFade{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@media(max-width:640px){.mx-card>.mx-more{width:34px!important;height:34px!important;min-height:0!important;margin:0 20px 16px 0}}

/* Smooth transitions (6 Oct 2026): dialogs, screens, buttons. Reduced motion is respected. */
@keyframes thDlgIn{from{opacity:0;transform:translateY(10px) scale(.985)}to{opacity:1;transform:none}}
@keyframes thBackdropIn{from{opacity:0}to{opacity:1}}
@keyframes thView{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
body.themis-workspace dialog[open]{animation:thDlgIn .22s cubic-bezier(.2,.7,.2,1)}
body.themis-workspace dialog[open]::backdrop{animation:thBackdropIn .22s ease-out}
body.themis-workspace .start-screen .start-in{animation:thView .24s cubic-bezier(.2,.7,.2,1)}
body.themis-workspace #main>[id^=view_]:not([hidden]){animation:thView .22s cubic-bezier(.2,.7,.2,1)}
body.themis-workspace :is(button,.start-door,.mx-card,.dd-item summary,.start-option,.start-row){transition:background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .12s ease,opacity .16s ease}
body.themis-workspace :is(.start-primary,.route-store-primary,.mx-hbtn,.dn-save,.dy-add,.start-door,.start-option,.next-step,.rf-nav button,.ctx-item,.ctx-danger,.ctx-cancel):active{transform:scale(.98)}
@media (prefers-reduced-motion:reduce){body.themis-workspace dialog[open],body.themis-workspace dialog[open]::backdrop,body.themis-workspace .start-screen .start-in,body.themis-workspace #main>[id^=view_]:not([hidden]),.th-undo-inline{animation:none!important}body.themis-workspace :is(button,.start-door,.mx-card){transition:none!important}}

/* 6 Oct 2026 (v84): route header on phones shows Edit as an icon beside Save, like desktop; no More menu.
   The phone reader has no step number, Listen or Ask Themis row, the same as a question card. */
body.themis-workspace .rail-intro #routerMore{display:none!important}
@media(max-width:820px){
 body.themis-workspace .rail-intro .router-icons{display:flex!important;gap:8px}
 body.themis-workspace.rf-on .rail-intro #routerShowAll{display:none!important}
 body.themis-workspace .rail-intro .router-icon{width:40px;height:40px}
 body.themis-workspace .rail-intro .router-icon[data-tip]::after{display:none}
 html body.themis-workspace.rf-on.rf-reading #detail .detail-top{display:none!important}
 html body.themis-workspace.rf-on.rf-reading .route-focus{padding-bottom:0!important}
 html body.themis-workspace.rf-on.rf-reading #detail{margin-top:4px!important;background-image:none!important}
}

/* 6 Oct 2026 (v85): desktop puts New matter back in the top bar and shows All / Claiming / Defending under Your matters.
   Phones are unchanged: the + beside the heading, no filter. */
#newMatterTop{display:inline-flex;align-items:center;align-self:center;gap:6px;height:34px;margin:0;padding:0 14px;line-height:1;border:1px solid var(--rd-accent);border-radius:999px;background:var(--rd-accent);color:#fff;font:inherit;font-size:13.5px;font-weight:600;cursor:pointer;order:0;transition:background-color .18s,border-color .18s,transform .12s}
#newMatterTop svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
#newMatterTop:hover{background:var(--rd-accent-hover);border-color:var(--rd-accent-hover)}
#newMatterTop:active{transform:scale(.98)}
#newMatterTop:focus-visible{outline:2px solid var(--rd-focus);outline-offset:2px}
html[data-theme=dark] #newMatterTop{background:var(--d-accent-fill);border-color:var(--d-accent-fill);color:var(--d-on-accent)}
.start-returning .mx-bar-desk{justify-content:flex-start;margin:6px 0 18px}
@media(min-width:821px){.start-returning .mx-headtools{display:none!important}}
@media(max-width:820px){.mx-bar-desk{display:none!important}}

/* 6 Oct 2026: sign-in and plans (themis-account.js). Shown only when accounts are switched on. */
.ac-dialog .ac-lead{margin:4px 0 14px;font-size:14px;line-height:1.55;color:var(--rd-muted)}
.ac-dialog .ac-lead strong{color:var(--rd-ink)}
.ac-dialog .ac-loading{display:flex;align-items:center;gap:10px}
.ac-dialog .ac-error{margin:2px 0 0;font-size:13px;line-height:1.45;color:#a23b2a}
html[data-theme=dark] .ac-dialog .ac-error{color:#f0a493}
.ac-dialog .ac-actions-split{justify-content:space-between;align-items:center}
.ac-spin{display:inline-block;width:14px;height:14px;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:acSpin .8s linear infinite;vertical-align:-2px}
button .ac-spin{margin-right:6px}
@keyframes acSpin{to{transform:rotate(360deg)}}
.ac-plans{display:grid;gap:10px;margin:4px 0 12px;padding:0;border:0}
.ac-plan{display:flex;gap:12px;align-items:flex-start;padding:14px 16px;border:1px solid var(--rd-line);border-radius:14px;background:var(--rd-surface);cursor:pointer;transition:border-color .18s,background-color .18s}
.ac-plan:hover{border-color:#8fae70}
.ac-plan:has(input:checked){border-color:var(--rd-accent);background:var(--rd-soft)}
.ac-plan>input{margin:3px 0 0;accent-color:var(--rd-accent);width:17px;height:17px;flex:none}
.ac-plan-text{display:grid;gap:3px;min-width:0}
.ac-plan-text strong{font-size:15px;color:var(--rd-ink)}
.ac-plan-text b{font-size:14px;color:var(--rd-accent);font-weight:650}
.ac-plan-text small{font-size:12.5px;line-height:1.45;color:var(--rd-muted)}
.ac-seats{display:inline-flex;align-items:center;gap:6px;margin-top:6px;font-size:13px;color:var(--rd-ink)}
.ac-seats>span{margin-right:4px}
.ac-seats input{width:58px;height:34px;padding:0 6px;text-align:center;border:1px solid var(--rd-line);border-radius:10px;background:var(--rd-surface);color:var(--rd-ink);font:inherit;font-size:14px;-moz-appearance:textfield}
.ac-seats input::-webkit-outer-spin-button,.ac-seats input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.ac-step{width:34px;height:34px;border:1px solid var(--rd-line);border-radius:50%;background:var(--rd-surface);color:var(--rd-ink);font:inherit;font-size:17px;line-height:1;cursor:pointer}
.ac-step:hover{border-color:#8fae70}
.ac-current{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:14px 16px;margin:4px 0 12px;border:1px solid var(--rd-accent);border-radius:14px;background:var(--rd-soft)}
.ac-current strong{display:block;font-size:15px;color:var(--rd-ink)}
.ac-current span{display:block;margin-top:2px;font-size:13px;color:var(--rd-muted)}
html[data-theme=dark] .ac-plan,html[data-theme=dark] .ac-seats input,html[data-theme=dark] .ac-step{background:var(--d-surface);border-color:var(--d-line2)}
html[data-theme=dark] .ac-plan:has(input:checked),html[data-theme=dark] .ac-current{background:var(--d-surface2,var(--d-surface));border-color:var(--d-accent)}
@media(prefers-reduced-motion:reduce){.ac-spin{animation-duration:2.4s}}

/* 7 Oct 2026: Templates and Pleadings start straight with the two panes, which fill the window like the router's reader. */
html body #view_precedents>.wsx-head,html body #view_precedents>.wsx-head.prec-head,#precedentsTools{display:none!important}
@media(min-width:821px){html body #view_precedents .lib-layout{margin-top:17px!important}html body #view_precedents .lib-layout>*{max-height:var(--prec-h)}}

/* 7 Oct 2026, phones: New matter sits in the header between search and the theme switch;
   All / Claiming / Defending sits beside "Your matters" where the + was. Desktop unchanged. */
@media(max-width:820px){
 html body.themis-workspace .masthead .tools>#newMatterTop#newMatterTop{display:inline-grid!important;place-items:center;width:38px;height:38px;padding:0;gap:0;border-radius:50%}
 body.themis-workspace .masthead #newMatterTop svg{width:17px;height:17px}
 body.themis-workspace .masthead #newMatterTop span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
 .start-returning .mx-headrow{flex-wrap:wrap;row-gap:10px;column-gap:6px}
 .mx-seg-head{flex:none}
 .mx-seg-head{padding:2px}
 .mx-seg-head button{min-height:32px;padding:0 8px;font-size:12.5px}
}
@media(max-width:380px){body.themis-workspace .masthead #newMatterTop{width:34px;height:34px}.mx-seg-head button{padding:0 8px;font-size:12px}}
/* 7 Oct 2026: the phone header's round buttons are true circles (search and New matter were stretched into ovals). */
@media(max-width:820px){
 html body.themis-workspace .masthead #mSearchBtn,html body.themis-workspace .masthead .tools>#newMatterTop#newMatterTop{flex:none!important;box-sizing:border-box!important;width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;max-width:38px!important;max-height:38px!important;aspect-ratio:1/1;padding:0!important;border-radius:50%!important;align-self:center!important;line-height:1!important}
}
@media(max-width:380px){
 html body.themis-workspace .masthead #mSearchBtn,html body.themis-workspace .masthead .tools>#newMatterTop#newMatterTop{width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;max-width:34px!important;max-height:34px!important}
}

/* ===== 7 Oct 2026: matter cards, option 6 (tonal cards with a progress ring round the initials) ===== */
:root{--mc-tonal:#eef4e8;--mc-tonal-hover:#e6efde;--mc-badge:#dde9d1;--mc-late:#b3261e;--mc-late-soft:#fbe4df;--mc-warn:#8a5a10;--mc-warn-soft:#f8ebd2;--mc-chip-line:#cfdcc3}
html[data-theme=dark]{--mc-tonal:#232b21;--mc-tonal-hover:#28311f;--mc-badge:#2c3829;--mc-late:#ffb4a6;--mc-late-soft:#3a201b;--mc-warn:#f3d79f;--mc-warn-soft:#2e2716;--mc-chip-line:rgba(255,255,255,.14)}
.mc-list{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;margin:0;padding:0;list-style:none}
@media(min-width:821px){.mc-list{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}}
.mc-card{position:relative;display:flex;align-items:center;min-width:0;border-radius:20px;background:var(--mc-tonal);transition:background-color .16s ease,transform .12s ease}
.mc-card:hover{background:var(--mc-tonal-hover)}
.mc-open{flex:1;min-width:0;display:flex;align-items:center;gap:14px;padding:14px 4px 14px 14px;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer;border-radius:20px}
.mc-open:focus-visible{outline:2px solid var(--rd-focus);outline-offset:-2px}
.mc-card:active{transform:scale(.995)}
.mc-badge{position:relative;flex:none;width:48px;height:48px;display:grid;place-items:center;border-radius:50%;background:var(--mc-badge);color:var(--rd-accent);font-weight:700;font-size:14px;letter-spacing:.02em}
.mc-badge svg{position:absolute;inset:0;width:48px;height:48px;transform:rotate(-90deg)}
.mc-badge circle{fill:none;stroke-width:3}
.mc-badge .mc-track{stroke:transparent}
.mc-badge .mc-arc{stroke:currentColor;stroke-linecap:round}
.mc-card.is-late .mc-badge{background:var(--mc-late-soft);color:var(--mc-late)}
.mc-card.is-soon .mc-badge{background:var(--mc-warn-soft);color:var(--mc-warn)}
.mc-badge>span{position:relative}
.mc-main{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start}
.mc-name{max-width:100%;font-size:16px;font-weight:600;color:var(--rd-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mc-sup{max-width:100%;margin-top:1px;font-size:13.5px;color:var(--rd-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mc-chip{display:inline-flex;align-items:center;gap:6px;max-width:100%;margin-top:8px;height:28px;padding:0 10px;border-radius:8px;border:1px solid var(--mc-chip-line);font-size:12.5px;color:var(--rd-text)}
.mc-chip svg{width:15px;height:15px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.mc-chip-text{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mc-chip-text b{font-weight:650}
.mc-chip-more{flex:none;font-weight:650;opacity:.8}
.mc-chip.is-late{border-color:transparent;background:var(--mc-late-soft);color:var(--mc-late)}
.mc-chip.is-soon{border-color:transparent;background:var(--mc-warn-soft);color:var(--mc-warn)}
.mc-chip-none{color:var(--rd-muted)}
.mc-more{flex:none;align-self:center;display:grid;place-items:center;width:40px;height:40px;margin-right:6px;border:0;border-radius:50%;background:none;color:var(--rd-muted);cursor:pointer}
.mc-more:hover,.mc-more[aria-expanded=true]{background:var(--mc-badge);color:var(--rd-ink)}
.mc-more svg{width:20px;height:20px;fill:currentColor}
.mc-ctx{top:calc(100% - 8px);right:10px;z-index:30}
.mc-card.mc-editing{display:block;padding:16px 18px}
@media(max-width:640px){.mc-court{display:none}.mc-name{font-size:15.5px}.mc-open{gap:12px;padding:12px 2px 12px 12px}}
@media (prefers-reduced-motion:reduce){.mc-card,.mc-card:active{transition:none;transform:none}}

/* ===== 7 Oct 2026: Diary rows (option 1) and by-matter panels (option 10), in the matter cards' tonal style ===== */
.dy .dy-group ol{border:0;background:none;display:grid;gap:8px;overflow:visible}
.dy .dy-group h2{color:var(--rd-muted)}
.dy .dy-group.dy-late h2{color:var(--mc-late)}
.dy .dy-item.dy2{display:flex;align-items:center;gap:12px;grid-template-areas:none;padding:12px 6px 12px 12px;border:0!important;border-radius:18px!important;background:var(--mc-tonal);position:relative}
.dy .dy-item.dy2+.dy-item.dy2{border-top:0}
.dy2-badge{flex:none;width:46px;height:46px;border-radius:50%;display:grid;place-content:center;text-align:center;line-height:1;background:var(--mc-badge);color:var(--rd-accent)}
.dy2-badge b{font-size:16px;font-weight:700}
.dy2-badge i{font-style:normal;font-size:9.5px;font-weight:650;letter-spacing:.06em;text-transform:uppercase;margin-top:3px}
.dy2-badge svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.dy2.is-late .dy2-badge{background:var(--mc-late-soft);color:var(--mc-late)}
.dy2.is-soon .dy2-badge{background:var(--mc-warn-soft);color:var(--mc-warn)}
.dy2-main{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start}
.dy2-t{max-width:100%;font-size:15.5px;font-weight:600;color:var(--rd-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dy2-s{max-width:100%;font-size:13px;color:var(--rd-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dy2.is-late .dy2-when{color:var(--mc-late);font-weight:650}
.dy2.is-soon .dy2-when{color:var(--mc-warn);font-weight:650}
.dy .dy2-chip{margin-top:7px;height:24px;padding:0 9px;border-radius:8px;border:1px solid var(--mc-chip-line);background:none;font-size:12px;color:var(--rd-text);max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}
.dy .dy2-chip:hover{border-color:var(--rd-line-strong);color:var(--rd-ink)}
.dy .dy2-actions{display:flex;align-items:center;gap:2px;margin:0;flex:none;flex-wrap:nowrap}
.dy .dy2-actions .dy-icon{width:40px;height:40px}
.dy .dy2-actions .dy-icon:hover,.dy .dy2-actions .dy-icon[aria-expanded=true]{background:var(--mc-badge)}
.dy .dy2-tick:hover{color:var(--rd-accent)!important}
.dy .dy2-actions .dy-icon svg{width:20px;height:20px}
.dy .dy2-more svg{fill:currentColor;stroke:none}
.dy .dy2-actions .ctx-menu{top:calc(100% + 2px);right:0}
.dy .dy2-done{background:none!important;opacity:.6}
.dy .dy2-done .dy2-t{text-decoration:line-through;font-weight:500}
.dy .dy2-done .dy2-badge{width:36px;height:36px;margin:0 5px}
/* by matter */
.dy .dy-matter.dy2-panel{margin-top:12px;border:0;border-radius:22px;background:var(--mc-tonal);padding:4px 4px 6px;overflow:visible}
.dy2-mh{display:flex;align-items:center;gap:10px;padding:8px 6px 8px 14px}
.dy2-mname{flex:1;min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:1px;border:0;background:none;padding:2px 0;font:inherit;color:inherit;text-align:left;cursor:pointer}
.dy2-mname span{max-width:100%;font-size:16px;font-weight:650;color:var(--rd-ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dy2-mname small{max-width:100%;font-size:12.5px;color:var(--rd-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dy2-mname:hover span{text-decoration:underline;text-underline-offset:3px}
.dy2-mname:focus-visible,.dy2-fold:focus-visible{outline:2px solid var(--rd-focus);outline-offset:2px;border-radius:8px}
.dy2-cnt{flex:none;font-size:12px;font-weight:700;padding:3px 10px;border-radius:999px;background:var(--mc-badge);color:var(--rd-accent);white-space:nowrap}
.dy2-cnt.is-late{background:var(--mc-late-soft);color:var(--mc-late)}
.dy2-cnt.is-soon{background:var(--mc-warn-soft);color:var(--mc-warn)}
.dy2-fold{flex:none;width:38px;height:38px;display:grid;place-items:center;border:0;border-radius:50%;background:none;color:var(--rd-muted);cursor:pointer}
.dy2-fold:hover{background:var(--mc-badge);color:var(--rd-ink)}
.dy2-fold svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .18s ease}
.dy2-panel.is-folded .dy2-fold svg{transform:rotate(-90deg)}
.dy2-panel .dy2-rows{display:grid;grid-template-rows:1fr;transition:grid-template-rows .22s ease}
.dy2-panel.is-folded .dy2-rows{grid-template-rows:0fr}
.dy2-panel .dy2-rows>ol{min-height:0;overflow:hidden;display:grid;gap:4px;padding:0 4px}
.dy2-panel:not(.is-folded) .dy2-rows>ol{overflow:visible}
.dy .dy2-panel .dy-item.dy2{background:var(--rd-surface);border-radius:16px!important}
.dy .dy2-panel .dy-form{margin:0 4px 6px;border-radius:14px}
@media(max-width:640px){.dy .dy-item.dy2{gap:10px;padding:10px 2px 10px 10px}.dy2-badge{width:42px;height:42px}.dy .dy2-actions .dy-icon{width:36px;height:36px}.dy2-cnt{font-size:11.5px;padding:3px 8px}}
@media (prefers-reduced-motion:reduce){.dy2-panel .dy2-rows,.dy2-fold svg{transition:none}}
/* Diary: nothing wider than the phone; older unlinked dates keep their "Link to" choice on its own line */
#view_diary,#diaryApp{min-width:0;max-width:100%}
.dy .dy-top{flex-wrap:wrap;row-gap:12px}
.dy .dy-tools{flex-wrap:wrap;max-width:100%;row-gap:8px}
.dy .dy-matter.dy-loose{margin-top:12px;border:0;border-radius:22px;background:var(--mc-warn-soft);padding:4px 4px 6px}
.dy .dy-loose .dy-mhead{background:none;border:0;padding:10px 12px 8px}
.dy .dy-loose ol{display:grid;gap:4px}
.dy .dy-loose .dy-item.dy2{flex-wrap:wrap;background:var(--rd-surface);border-radius:16px!important}
.dy .dy-loose .dy-link{flex:1 0 100%;display:flex;align-items:center;gap:8px;padding:0 8px 2px 58px;min-width:0;font-size:13px;color:var(--rd-muted)}
.dy .dy-loose .dy-link select{flex:1;min-width:0;max-width:260px}
@media(max-width:640px){.dy .dy-loose .dy-link{padding-left:52px}}
/* #main is a flex column (footer at the foot): its sections must never grow wider than the page */
#main>*{min-width:0;max-width:100%}
#main>.view-panel{width:100%;box-sizing:border-box}
.dy .dy-group ol,.dy .dy2-rows>ol,.dy .dy-loose ol{grid-template-columns:minmax(0,1fr)}
.dy .dy-item.dy2{min-width:0}

/* ---------- Precedents: Pleadings | Rules (12 Oct 2026) ---------- */
.prec-mode{display:grid;grid-template-columns:1fr 1fr;gap:3px;margin:14px 14px 0;padding:3px;border-radius:11px;background:color-mix(in srgb,var(--w-accent,#2d6640) 8%,transparent)}
.prec-mode button{min-height:34px;border:0;border-radius:8px;background:transparent;font:inherit;font-size:13px;font-weight:500;color:var(--w-muted,#596e50);cursor:pointer}
.prec-mode button[aria-selected=true]{background:var(--rd-surface,#fff);color:var(--w-ink,#1f3a28);font-weight:600;box-shadow:0 1px 2px rgba(31,58,40,.12)}
.prec-mode button:focus-visible{outline:2px solid var(--w-accent,#2d6640);outline-offset:1px}
.prec-mode+.prec-find{margin-top:10px}
#view_precedents .rule-item{display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:baseline;column-gap:8px}
#view_precedents .rule-item .rule-no{font-variant-numeric:tabular-nums;font-size:12px;font-weight:600;color:var(--w-muted,#596e50)}
#view_precedents .rule-item .lib-item-title{min-width:0}
#view_precedents .rule-item .lib-item-sum{grid-column:2/4}
#view_precedents .rule-badge{min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:color-mix(in srgb,var(--w-accent,#2d6640) 12%,transparent);font-size:10.5px;font-weight:600;line-height:18px;text-align:center;color:var(--w-accent,#2d6640)}
#view_precedents .prec-scroll .lib-items .rule-grp{letter-spacing:.06em;text-transform:uppercase}
.prec-panel-foot .rule-div{display:inline-flex;align-items:center;gap:6px}
.prec-panel-foot .rule-div span{color:var(--w-faint,#8fa07f)}
.prec-panel-foot .rule-div select,.rule-div-pick select{font:inherit;font-size:12px;color:var(--w-ink,#1f3a28);background:var(--rd-surface,#fff);border:1px solid var(--rd-line,#d7e2cb);border-radius:8px;padding:3px 6px;max-width:150px}
.rule-h-no{display:block;margin-bottom:4px;font-size:12px;font-weight:600;letter-spacing:.04em;color:var(--w-muted,#596e50)}
#detail .rule-periods ol{display:grid;gap:8px}
#detail .rule-periods li{display:grid;grid-template-columns:minmax(74px,auto) minmax(0,1fr);column-gap:10px;row-gap:2px}
#detail .rule-periods li b{grid-row:span 2;font-variant-numeric:tabular-nums}
#detail .rule-periods li em{font-style:normal;font-weight:600;color:var(--w-ink,#1f3a28)}
#detail .rule-cite{margin:2px 0 6px;font-size:12.5px;color:var(--w-muted,#596e50)}
#detail .rule-points{margin:8px 0 4px;padding-left:18px;display:grid;gap:4px;font-size:13px}
#detail .rule-points b{margin-right:4px}
#detail .rule-div-pick{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:4px 0 14px;font-size:13px;color:var(--w-muted,#596e50)}
#detail .rule-div-pick select{max-width:200px;font-size:13px;padding:6px 8px}
#detail .rule-dirs h3{margin:16px 0 8px}
#detail .debt-source-card.is-unread{opacity:.82}
#detail .rule-empty{padding:12px 14px;border:1px dashed var(--rd-line,#d7e2cb);border-radius:12px}
#detail .step-rules{margin:0 0 16px}
#detail .step-rules h3{margin:0 0 8px}
#detail .step-rules-list{display:flex;flex-wrap:wrap;gap:6px}
#detail .step-rule{min-height:0!important;height:auto!important;line-height:1.35;display:inline-flex;align-items:baseline;gap:6px;max-width:100%;padding:6px 10px;border:1px solid var(--rd-line,#d7e2cb);border-radius:999px;background:var(--rd-surface,#fff);font:inherit;font-size:12.5px;color:var(--w-ink,#1f3a28);cursor:pointer;text-align:left}
#detail .step-rule b{font-weight:600;white-space:nowrap}
#detail .step-rule span{color:var(--w-muted,#596e50);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:220px}
#detail .step-rule:hover{border-color:var(--w-accent,#2d6640)}
#detail .step-rule:focus-visible{outline:2px solid var(--w-accent,#2d6640);outline-offset:1px}
html[data-theme=dark] .prec-mode{background:rgba(255,255,255,.06)}
html[data-theme=dark] .prec-mode button{color:var(--d-text3)}
html[data-theme=dark] .prec-mode button[aria-selected=true]{background:rgba(255,255,255,.12);color:var(--d-text,#eef2ea);box-shadow:none}
html[data-theme=dark] #view_precedents .rule-item .rule-no,html[data-theme=dark] .rule-h-no,html[data-theme=dark] #detail .rule-cite{color:var(--d-text3)}
html[data-theme=dark] .prec-panel-foot .rule-div select,html[data-theme=dark] .rule-div-pick select,html[data-theme=dark] #detail .step-rule{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.12);color:var(--d-text2,#d8e0d2)}
html[data-theme=dark] #detail .step-rule span{color:var(--d-text3)}
html[data-theme=dark] #detail .rule-periods li em{color:var(--d-text,#eef2ea)}
html[data-theme=dark] #detail .rule-empty{border-color:rgba(255,255,255,.14)}
@media (max-width:820px){.prec-mode{margin:12px 12px 0}.prec-panel-foot .rule-div{justify-content:flex-start}#detail .step-rule span{max-width:160px}}
#detail .detail-title-row:has(.rule-h-no){display:block;margin-top:20px}
#detail .detail-title-row .rule-h-no{margin-bottom:8px}
.prec-panel-foot .rule-div select{height:30px!important;min-height:0!important;padding:2px 6px!important}
#detail .rule-div-pick select{height:36px!important;min-height:0!important}
#detail .debt-source-card h3+.rule-cite{margin-top:-4px}
#detail .rule-dirs+.rule-dirs{margin-top:8px}

/* ---------- New matter: one question per screen, in the window (13 Oct 2026) ---------- */
.nm-dialog.nm-flow{width:min(480px,calc(100vw - 24px));max-height:min(760px,calc(100dvh - 24px));overflow:auto}
.nm-back{display:inline-grid;place-items:center;width:34px;height:34px;min-height:0!important;padding:0!important;margin:0 0 10px;border:0;border-radius:50%;background:color-mix(in srgb,var(--w-accent,#2d6640) 9%,transparent);color:var(--w-ink,#1f3a28);cursor:pointer}
.nm-back svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.nm-back:focus-visible{outline:2px solid var(--w-accent,#2d6640);outline-offset:2px}
.nm-flow #workspaceDialogTitle{outline:none}
.nm-lead{margin:2px 0 6px;font-size:14px;color:var(--w-muted,#596e50)}
.nm-doors.nm-hints .start-door small{display:block;font-size:12.5px;line-height:1.35;color:var(--w-muted,#596e50);font-weight:400}
.nm-doors .start-door-text{min-width:0}
.nm-doors .start-door.nm-door:not(:has(.start-door-icon)){padding:15px 16px}
.nm-doors .start-door.start-option-suggested{border-color:var(--w-accent,#2d6640);box-shadow:0 0 0 2px color-mix(in srgb,var(--w-accent,#2d6640) 22%,transparent)}
.nm-group h2{margin:16px 2px 4px;font-size:11px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--w-muted,#596e50)}
.nm-group .nm-doors{margin-top:6px}
.nm-filter{margin:6px 0 4px}
.nm-amount{margin-top:14px}
.nm-days{display:grid;gap:6px;margin:0 0 14px}
.nm-days strong{font-size:14px}
.nm-days input{max-width:140px}
.nm-flow .start-date{margin-top:14px}
.nm-flow .start-actions{display:grid;gap:8px}
.nm-flow .start-primary{width:100%}
/* the Matters page shows the same rows, in one calm column */
.start-step.nm-page .nm-doors,.start-step.nm-page .nm-group,.start-step.nm-page .nm-filter,.start-step.nm-page .nm-amount,.start-step.nm-page .start-date{max-width:560px}
.start-step.nm-page .nm-doors{margin-top:18px}
html[data-theme=dark] .nm-back{background:rgba(255,255,255,.08);color:var(--d-text,#eceae6)}
html[data-theme=dark] .nm-doors.nm-hints .start-door small,html[data-theme=dark] .nm-lead,html[data-theme=dark] .nm-group h2{color:var(--d-text3)}
.nm-doors .start-door.nm-door .start-door-text{flex:1 1 auto}
.nm-doors .start-door.nm-door>svg:last-child{margin-left:auto;flex:none}
.nm-about{margin:4px 0 2px;font-size:13.5px;color:var(--w-muted,#596e50)}
.nm-about b{color:var(--w-ink,#1f3a28);font-weight:600}
.nm-about .start-link{margin-left:4px}
.nm-flow .start-date label small{display:block;margin-top:2px}
.nm-flow #startServiceDate{width:100%;box-sizing:border-box}
html[data-theme=dark] .nm-about,html[data-theme=dark] .nm-about b{color:var(--d-text2,#d8e0d2)}
.start-date label.nm-days{display:grid!important;gap:6px;justify-items:start}
.start-date label.nm-days input{width:140px}
html[data-theme=dark] .nm-flow .start-date label strong,html[data-theme=dark] .nm-flow .nm-days strong,html[data-theme=dark] .nm-flow .start-deadline-card strong{color:var(--d-text,#eceae6)}
html[data-theme=dark] .nm-flow .start-date label small{color:var(--d-text3)}
#detail .rule-case-note{margin:6px 0 4px;padding:8px 10px;border-radius:10px;background:color-mix(in srgb,#8a5a10 10%,transparent);font-size:12.5px;line-height:1.45;color:var(--w-ink,#1f3a28)}
#detail .rule-outline ol{counter-reset:none}
#detail .rule-outline li{font-size:13.5px}
#detail .rule-outline li b{display:inline-block;min-width:74px;font-variant-numeric:tabular-nums}
html[data-theme=dark] #detail .rule-case-note{background:rgba(243,215,159,.1);color:var(--d-text2,#d8e0d2)}

/* Rules accordion rail (preview, 13 Oct 2026): a rule opens below itself to list its subrules. Same rows and greens as the rest of
   the rail; the reader on the right is the one every step uses. */
#view_precedents .rule-acc .rule-item.racc-head{grid-template-columns:38px minmax(0,1fr) auto 16px}
#view_precedents .rule-acc .racc-chev{width:14px;height:14px;align-self:center;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;color:var(--w-muted,#7d8a76);transition:transform .22s ease}
#view_precedents .rule-acc li.is-open>.racc-head .racc-chev{transform:rotate(90deg)}
#view_precedents .rule-acc .racc-head.is-in:not(.is-on) .lib-item-title{font-weight:600;color:#2e542f}
#view_precedents .rule-acc .racc-head:not(:has(.rule-badge)){grid-template-columns:38px minmax(0,1fr) 16px}
#view_precedents .racc-subs{display:grid;grid-template-rows:0fr;transition:grid-template-rows .26s ease}
#view_precedents li.is-open>.racc-subs{grid-template-rows:1fr}
#view_precedents .racc-subs>div{overflow:hidden;min-height:0}
#view_precedents .racc-subs ol{list-style:none;margin:2px 0 8px 22px;padding:0 0 0 12px;border-left:1px solid color-mix(in srgb,var(--w-accent,#2d6640) 22%,transparent)}
#view_precedents .racc-sub{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:8px;align-items:baseline;width:100%;padding:7px 10px;border:0;border-radius:8px;background:transparent;text-align:left;cursor:pointer;font:inherit;color:#3c5a40}
#view_precedents .racc-sub:hover{background:#f1f5ec}
#view_precedents .racc-sub.is-on{background:#eaf1e4}
#view_precedents .racc-sub b{min-width:58px;font-size:12px;font-weight:600;font-variant-numeric:tabular-nums;color:var(--w-muted,#596e50)}
#view_precedents .racc-sub span{font-size:12.5px;line-height:18px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#view_precedents .racc-sub.is-on span{font-weight:600;color:#2e542f}
#view_precedents .racc-sub i{grid-column:2;justify-self:start;margin-top:3px;font-style:normal;font-size:10.5px;font-weight:600;color:var(--w-accent,#2d6640)}
#detail .rule-sub-link{display:inline;padding:0;border:0;background:none;font:inherit;color:inherit;text-align:left;cursor:pointer}
#detail .rule-sub-link:hover{text-decoration:underline;text-underline-offset:3px}
html[data-theme=dark] #view_precedents .racc-sub{color:#eceae6}
html[data-theme=dark] #view_precedents .racc-sub:hover{background:#272624}
html[data-theme=dark] #view_precedents .racc-sub.is-on{background:#263124}
html[data-theme=dark] #view_precedents .racc-sub.is-on span,html[data-theme=dark] #view_precedents .rule-acc .racc-head.is-in:not(.is-on) .lib-item-title{color:#eceae6}
html[data-theme=dark] #view_precedents .racc-sub b{color:var(--d-text3,#a9a79f)}
html[data-theme=dark] #view_precedents .racc-sub i{color:#9cc79a}
html[data-theme=dark] #view_precedents .racc-subs ol{border-left-color:#3a3936}
@media (prefers-reduced-motion:reduce){#view_precedents .racc-subs,#view_precedents .rule-acc .racc-chev{transition:none}}

/* Rules reader (accordion preview): exact wording on top; case law and directives use the route Sources card scale. */
html body #detail div.rule-text.detail-summary{display:block;margin:14px 0 6px;padding:2px 0 2px 16px;border-left:2px solid color-mix(in srgb,var(--w-accent,#2d6640) 35%,transparent);font-size:14.5px!important;line-height:1.75!important;font-weight:400!important;letter-spacing:0!important;color:#314433!important;max-width:70ch}
#detail .rule-text p{margin:0 0 8px}
#detail .rule-text p:last-child{margin-bottom:0}
#detail .rule-text .rt-n{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:8px}
#detail .rule-text .rt-n b{font-weight:600;font-variant-numeric:tabular-nums;color:var(--w-muted,#596e50);font-family:inherit}
#detail .rule-text .rt-l1{margin-left:26px}
#detail .rule-text .rt-l2{margin-left:52px}
#detail .rule-text-src{display:flex;flex-wrap:wrap;gap:4px 14px;align-items:baseline;justify-content:space-between;margin:0 0 4px;padding-left:18px;font-size:11.5px;color:var(--w-muted,#6b7a60)}
#detail .rule-text-src .debt-source-link{font-size:12px}
#detail [data-reader-panel=cases] .debt-source-kind,#detail [data-reader-panel=directives] .debt-source-kind{margin-bottom:6px}
#detail [data-reader-panel=cases] .debt-source-card h3,#detail [data-reader-panel=directives] .debt-source-card h3{font-size:14px!important;font-weight:600!important;line-height:1.45!important;letter-spacing:0!important;margin:0 0 8px!important;padding:0!important;max-width:none}
#detail [data-reader-panel=cases] .debt-source-footer,#detail [data-reader-panel=directives] .debt-source-footer{margin-top:12px!important}
#detail [data-reader-panel=cases] .debt-source-card,#detail [data-reader-panel=directives] .debt-source-card{padding-bottom:22px}
#detail .rule-also{margin:26px 0 4px;font-size:10px;font-weight:550;letter-spacing:.06em;text-transform:uppercase;color:#6b7a60}
#detail .rule-dir .rule-points{margin:0;padding:0;list-style:none;display:grid;gap:6px;font-size:13px;line-height:1.65}
#detail .rule-dir .rule-points b{font-weight:600;margin-right:4px}
#detail .rule-dir-more{margin:18px 0 6px;font-size:13px}
#detail .rule-dir-more summary{cursor:pointer;font-weight:600;color:var(--w-ink,#1f3a28);padding:6px 0}
#detail .rule-dir-more ul{list-style:none;margin:6px 0 0;padding:0;display:grid;gap:8px}
#detail .rule-dir-more li{display:flex;justify-content:space-between;gap:12px;align-items:baseline}
#detail .rule-dir-more a{color:inherit;text-underline-offset:3px}
#detail .rule-dir-more small{flex:none;color:var(--w-muted,#6b7a60);font-size:11.5px}
#detail .rule-with dt .wsx-link{text-align:left}
#detail .detail-title-row .rule-h-no{text-transform:none}
html[data-theme=dark] body #detail div.rule-text.detail-summary{color:#eceae6!important;border-left-color:#4a5a44}
html[data-theme=dark] #detail .rule-text .rt-n b,html[data-theme=dark] #detail .rule-text-src,html[data-theme=dark] #detail .rule-dir-more small,html[data-theme=dark] #detail .rule-also{color:var(--d-text3,#a9a79f)}
html[data-theme=dark] #detail .rule-dir-more summary{color:#eceae6}
@media(max-width:820px){html body #detail div.rule-text.detail-summary{font-size:14px!important;line-height:1.7!important;padding-left:12px}#detail .rule-text .rt-l1{margin-left:16px}#detail .rule-text .rt-l2{margin-left:32px}#detail .rule-text-src{padding-left:14px}}
/* Rules reader (13 Oct 2026): the same blocks as a pleading. In the rule's wording, its own paragraph letters,
   (a) and (i), stand where the 01, 02 numbers stand elsewhere. */
body #detail .rule-words{list-style:none;padding:0;margin:0}
body.debt-focus #detail .rule-words li,body #detail .rule-words li{position:relative;padding:0 0 12px 40px;font-size:13.5px;line-height:1.75}
body.debt-focus #detail .rule-words li:before,body #detail .rule-words li:before{content:attr(data-n);counter-increment:none;position:absolute;left:0;top:1px;font-size:11.5px;font-weight:600;color:#84917c;font-variant-numeric:tabular-nums}
body #detail .rule-words li.rw-l1{margin-left:34px}
body #detail .rule-words li.rw-l2{margin-left:68px}
body #detail .rule-words li.rw-plain{padding-left:0}
body #detail .rule-wording .rule-words li{color:#3d4f3f}
body #detail .rule-limits .rule-ref{margin-left:4px;font-size:11.5px;color:#84917c;white-space:nowrap}
@media(max-width:820px){body #detail .rule-words li{padding-left:34px}body #detail .rule-words li.rw-l1{margin-left:18px}body #detail .rule-words li.rw-l2{margin-left:36px}}
html[data-theme=dark] body #detail .rule-wording .rule-words li{color:#eceae6}
html[data-theme=dark] body #detail .rule-words li:before,html[data-theme=dark] body #detail .rule-limits .rule-ref{color:#a9a79f}
body #detail [data-reader-panel] .rule-text-src{padding-left:0;margin:4px 0 0}
/* Rules reader, round 5 (13 Oct 2026): the rule number leads the title; back to the step; copy the wording; subrules as rows. */
body #detail .rule-title .rule-num{display:block;margin:0 0 4px;font-size:13px;font-weight:600;letter-spacing:.02em;color:#6b7a60;font-variant-numeric:tabular-nums}
body #detail .rule-back{display:inline-flex;align-items:center;gap:6px;margin:2px 0 10px;padding:6px 12px 6px 8px;border:1px solid rgba(80,110,70,.22);border-radius:999px;background:transparent;font:inherit;font-size:12.5px;font-weight:500;color:#3c5a40;cursor:pointer}
body #detail .rule-back:hover{background:#f1f5ec}
body #detail .rule-back svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
body #detail .rule-src-acts{display:inline-flex;align-items:baseline;gap:16px}
body #detail .rule-copy{padding:0;border:0;background:none;font:inherit;font-size:12px;color:#3c5a40;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
body #detail .rule-copy.is-done{text-decoration:none;font-weight:600}
body #detail .rule-subs ol{list-style:none;padding:0;margin:0;counter-reset:none}
body.debt-focus #detail .rule-subs li,body #detail .rule-subs li{padding:0;counter-increment:none}
body.debt-focus #detail .rule-subs li:before,body #detail .rule-subs li:before{content:none}
body #detail .rule-sub-row{display:grid;grid-template-columns:70px minmax(0,1fr) auto 16px;align-items:baseline;column-gap:10px;width:100%;padding:11px 8px;border:0;border-bottom:1px solid rgba(80,110,70,.12);border-radius:0;background:transparent;font:inherit;text-align:left;cursor:pointer;color:var(--text,#314433)}
body #detail .rule-subs li:last-child .rule-sub-row{border-bottom:0}
body #detail .rule-sub-row:hover{background:#f6f9f2}
body #detail .rule-sub-row b{font-size:12.5px;font-weight:600;color:#6b7a60;font-variant-numeric:tabular-nums}
body #detail .rule-sub-row span{font-size:13.5px;line-height:1.55}
body #detail .rule-sub-row i{font-style:normal;font-size:11px;font-weight:600;color:var(--w-accent,#2d6640);white-space:nowrap}
body #detail .rule-sub-row svg{width:14px;height:14px;align-self:center;fill:none;stroke:#84917c;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#view_precedents .racc-sub.is-match:not(.is-on){box-shadow:inset 0 0 0 1px rgba(45,102,64,.35)}
html[data-theme=dark] body #detail .rule-title .rule-num,html[data-theme=dark] body #detail .rule-sub-row b{color:#a9a79f}
html[data-theme=dark] body #detail :is(.rule-back,.rule-copy){color:#cfe3c9;border-color:#3a3936}
html[data-theme=dark] body #detail .rule-back:hover,html[data-theme=dark] body #detail .rule-sub-row:hover{background:#272624}
html[data-theme=dark] body #detail .rule-sub-row{color:#eceae6;border-bottom-color:#34332f}
html[data-theme=dark] body #detail .rule-sub-row i{color:#9cc79a}
@media(max-width:820px){body #detail .rule-sub-row{grid-template-columns:58px minmax(0,1fr) 14px}body #detail .rule-sub-row i{grid-column:2;grid-row:2;margin-top:2px}body #detail .rule-sub-row svg{grid-column:3;grid-row:1}}
html body #detail h2.detail-title-row.rule-title{display:block}
body #detail .rule-sub-row{grid-template-columns:70px minmax(0,1fr) 72px 16px}
body #detail .rule-sub-row i{justify-self:end}
@media(max-width:820px){body #detail .rule-sub-row{grid-template-columns:58px minmax(0,1fr) 14px}body #detail .rule-sub-row i{justify-self:start}}
html body #detail h2.rule-title .rule-num{padding-top:12px}
/* Precedents reader: as tall as its content, up to the pane height, so a short topic or tab leaves no gap above the navigation. */
@media(min-width:821px){html body #view_precedents .lib-layout>.journey-reader-shell{align-self:start;height:auto}html body #view_precedents .journey-reader-shell>#detail{height:auto;max-height:var(--prec-h)}}
@media(min-width:821px){html body #detail h2.detail-title-row.rule-title{padding-top:10px}}
