/* Themis: 29 September redesign (themis-redesign.js, start-screen.js). Loaded last.
   Four sections share one grid (a 760px reading column), one type scale (13 / 15 / 17 / 22 / 34),
   one accent, and the Themis figure as a quiet mark in empty states and page headers. */
:root{--rd-ink:#243f2a;--rd-text:#3d5536;--rd-muted:#596e50;--rd-accent:#4f6b3f;--rd-accent-hover:#3f5a31;--rd-line:#d7e2cb;--rd-line-strong:#9fbb86;--rd-surface:#fff;--rd-soft:#eef5e6;--rd-warm:#fbeed7;--rd-warm-ink:#7a4b10;--rd-late:#a3311f;--rd-late-soft:#fbe9e5;--rd-focus:#4f6b3f;--th-line:#9fbb86}
html[data-theme=dark]{--rd-ink:var(--d-text);--rd-text:var(--d-text2);--rd-muted:var(--d-text3);--rd-accent:var(--d-accent);--rd-accent-hover:var(--d-accent-strong);--rd-line:var(--d-line2);--rd-line-strong:var(--d-accent-line);--rd-surface:var(--d-surface);--rd-soft:var(--d-accent-soft);--rd-warm:#3d2f18;--rd-warm-ink:#f3d79f;--rd-late:#ffb4a6;--rd-late-soft:#36201c;--rd-focus:var(--d-accent);--th-line:#556a4e}

/* The Themis figure inside the app: line only, never animated, never louder than the text */
.themis-workspace .th-art{display:block;width:100%;height:auto;overflow:visible;fill:none;stroke:var(--th-line);stroke-width:var(--th-w,3);stroke-linecap:round;stroke-linejoin:round}
.themis-workspace .th-art path{animation:none!important;stroke-dasharray:none!important}

/* Shared focus ring */
.themis-workspace :is(.start-screen,.dy,.page-doc,.router-more,.prec-suggest,.reader-navigation,#newMatter,.footer) :is(button,input,select,a):focus-visible,#newMatter:focus-visible{outline:2px solid var(--rd-focus);outline-offset:2px}

/* ---------- Top bar: New matter sits just left of the light/dark switch ---------- */
.masthead .tools{display:flex;align-items:center;gap:10px}
.masthead .tools #newMatter{order:0}
.masthead #newMatter{height:34px;padding:0 14px;border-color:var(--rd-accent);background:var(--rd-accent);color:#fff}
.masthead #newMatter:hover{background:var(--rd-accent-hover);border-color:var(--rd-accent-hover)}
html[data-theme=dark] .masthead #newMatter{background:var(--d-accent-fill);border-color:var(--d-accent-fill);color:var(--d-on-accent)}
@media(max-width:820px){
 body.themis-workspace .masthead .tools{display:flex!important;gap:8px}
 body.themis-workspace .masthead .tools>:not(#newMatter):not(.theme-toggle){display:none!important}
 .masthead #newMatter{width:34px;height:34px;padding:0}
}

/* ---------- Tabs: section name appears once, in the tab ---------- */
body.themis-workspace .matter-context{display:none!important}
#view_diary>.wsx-head,#view_diary #diaryBody{display:none!important}
#view_precedents>.wsx-head>div:first-child{display:none!important}
#view_precedents>.wsx-head{justify-content:flex-end;padding-top:22px}
@media(max-width:820px){#view_precedents>.wsx-head{padding-top:14px}}

/* ---------- Matters page (start-screen.js) ---------- */
body.start-open #main>.view-panel{display:none!important}
body.start-open .start-screen{display:block}
.start-in{position:relative;max-width:760px;padding:48px 0 72px}
.start-screen h1{font-size:clamp(28px,3.4vw,38px);letter-spacing:-.03em;line-height:1.1}
.start-lead{font-size:16.5px;max-width:540px;color:var(--rd-text)}
.mh-watermark{position:absolute;top:30px;right:-300px;width:210px;opacity:.55;pointer-events:none;--th-w:2}
@media(max-width:1360px){.mh-watermark{display:none}}
.start-doors{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:28px}
.start-door{grid-column:auto;display:grid;grid-template-columns:auto 1fr auto;align-items:start;gap:14px;min-height:0;padding:18px 18px 18px 16px;background:var(--rd-surface);border-color:var(--rd-line)}
.start-door-icon{display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:var(--rd-soft);color:var(--rd-accent)}
.start-door-icon svg{margin:0!important;width:19px;height:19px}
.start-door-text{min-width:0}
.start-door>svg{margin-top:9px;color:var(--rd-muted);transition:transform .2s}
.start-door:hover>svg{transform:translateX(2px);color:var(--rd-accent)}
.start-door-urgent{border-color:var(--rd-line-strong);background:linear-gradient(180deg,var(--rd-surface),var(--rd-soft))}
.start-door-urgent .start-door-icon{background:var(--rd-warm);color:var(--rd-warm-ink)}
.start-tag{margin-bottom:6px}
.start-door:focus-visible{outline:2px solid var(--rd-focus);outline-offset:2px}
.start-more-ways{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin:18px 0 0;font-size:14px;color:var(--rd-muted)}
.start-more-ways>span[aria-hidden]{color:var(--rd-line-strong)}
.start-kbd kbd{display:inline-block;min-width:22px;padding:0 6px;border:1px solid var(--rd-line);border-bottom-width:2px;border-radius:5px;background:var(--rd-surface);font:600 12px/1.6 inherit;text-align:center;color:var(--rd-ink)}
@media(max-width:820px){.start-kbd{display:none!important}.start-doors{grid-template-columns:1fr}.start-in{padding:24px 0 56px}}

/* Step screens */
.start-step .start-eyebrow{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin-top:10px}
.start-count{font-size:12px;letter-spacing:.04em;text-transform:none;font-weight:600;color:var(--rd-muted)}
.start-progress{height:3px;margin:8px 0 22px;border-radius:3px;background:var(--rd-line);overflow:hidden}
.start-progress i{display:block;height:100%;background:var(--rd-accent);border-radius:3px;transition:width .3s ease}
.start-back{display:inline-flex;align-items:center;gap:4px;margin-left:-4px;padding:6px 8px 6px 4px;border-radius:8px}
.start-back:hover{background:var(--rd-soft)}
.start-back svg{width:16px;height:16px}
.start-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:22px}
.start-grid-courts{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:640px){.start-grid,.start-grid-courts{grid-template-columns:1fr}}
.start-option{align-items:flex-start;padding:14px 16px;font-size:15px;transition:border-color .15s,box-shadow .15s}
.start-option>svg{margin-top:2px;color:var(--rd-muted)}
.start-option:hover{border-color:#8fae70}
.start-option:focus-visible{outline:2px solid var(--rd-focus);outline-offset:2px}
.start-suggest{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin-top:20px;font-size:13.5px;color:var(--rd-muted)}
.start-chip{display:inline-flex;align-items:center;gap:6px;padding:7px 12px 7px 14px;border:1px dashed var(--rd-line-strong);border-radius:999px;background:transparent;color:var(--rd-accent);font:inherit;font-size:14px;font-weight:600;cursor:pointer}
.start-chip svg{width:14px!important;height:14px!important}
.start-chip:hover{border-style:solid;background:var(--rd-soft)}
.start-filter{position:relative;max-width:none;margin-top:18px}
.start-filter svg{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--rd-muted)}
.start-filter input{width:100%;height:46px;padding:0 14px 0 42px;border:1px solid var(--rd-line);border-radius:12px;background:var(--rd-surface);font:inherit;font-size:15px;color:var(--rd-ink)}
.start-filter input::placeholder{color:#7d8f73}
.start-group{margin-top:26px}
.start-group h2{margin:0;font-size:12px;font-weight:650;letter-spacing:.08em;text-transform:uppercase;color:var(--rd-muted)}
.start-group .start-grid{margin-top:10px}
.start-share{display:inline-flex;align-items:center;gap:8px;margin-top:12px;padding:7px 12px;border:1px solid var(--rd-line-strong);border-radius:999px;background:var(--rd-surface);color:var(--rd-accent);font:inherit;font-size:13.5px;font-weight:600;cursor:pointer}
.start-share svg{width:15px!important;height:15px!important}
.start-deadline-card strong{display:block}
.start-deadline:empty{display:none}

/* Your matters */
.mh-matters{margin-top:44px;padding-top:28px;border-top:1px solid var(--rd-line)}
.start-returning .mh-matters{margin-top:26px;padding-top:0;border-top:0}
.start-returning .start-new{margin-top:40px;padding-top:26px;border-top:1px solid var(--rd-line)}
.start-new h2,.mh-head h2{margin:0;font-size:20px;font-weight:600;letter-spacing:-.015em;color:var(--rd-ink)}
.start-new .start-doors{margin-top:14px}
.start-returning .start-door small{display:none}
.mh-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 16px}
.mh-stat{margin:0;font-size:13.5px;color:var(--rd-muted)}
.mh-list{list-style:none;margin:14px 0 0;padding:0;display:grid;gap:10px}
.mh-card{position:relative;border:1px solid var(--rd-line);border-radius:14px;background:var(--rd-surface);transition:border-color .15s,box-shadow .15s}
.mh-card:hover{border-color:#8fae70;box-shadow:0 8px 24px -16px #24462166}
.mh-card.mh-late{border-color:#e0a397;box-shadow:inset 3px 0 0 var(--rd-late)}
.mh-card.mh-soon{box-shadow:inset 3px 0 0 #c98a2a}
.mh-open{display:grid;grid-template-columns:1fr auto;gap:2px 16px;width:100%;padding:16px 18px 44px;border:0;border-radius:14px;background:none;color:inherit;text-align:left;font:inherit;cursor:pointer}
.mh-open:focus-visible{outline:2px solid var(--rd-focus);outline-offset:-2px}
.mh-name{grid-column:1;font-size:16.5px;font-weight:600;color:var(--rd-ink);overflow-wrap:anywhere}
.mh-meta,.mh-phase{grid-column:1;font-size:13.5px;color:var(--rd-muted)}
.mh-next{grid-column:1;margin-top:8px;font-size:14px;color:var(--rd-text)}
.mh-next b{color:var(--rd-ink)}
.mh-late .mh-next b{color:var(--rd-late)}
.mh-next-none{color:var(--rd-muted);font-style:italic}
.mh-go{grid-column:2;grid-row:1/span 2;align-self:center;display:inline-flex;align-items:center;gap:4px;padding:8px 12px 8px 14px;border-radius:999px;background:var(--rd-soft);color:var(--rd-accent);font-size:14px;font-weight:600}
.mh-go svg{width:15px!important;height:15px!important}
.mh-card:hover .mh-go{background:var(--rd-accent);color:#fff}
html[data-theme=dark] .mh-card:hover .mh-go{background:var(--d-accent-fill);color:var(--d-on-accent)}
.mh-tools{position:absolute;left:18px;bottom:10px;display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;font-size:13px}
.mh-tool{padding:4px 2px;border:0;background:none;color:var(--rd-muted);font:inherit;font-size:13px;font-weight:500;cursor:pointer;text-decoration:underline;text-decoration-color:transparent;text-underline-offset:3px}
.mh-tool:hover{color:var(--rd-accent);text-decoration-color:currentColor}
.mh-confirm{color:var(--rd-ink);font-weight:600}
.mh-danger{padding:5px 12px;border:0;border-radius:8px;background:var(--rd-late);color:#fff;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
html[data-theme=dark] .mh-danger{color:#1d1c1a}
.mh-editing{padding:16px 18px}
.mh-rename label{display:block;font-size:13px;font-weight:600;color:var(--rd-muted)}
.mh-rename div{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin-top:6px}
.mh-rename input{flex:1 1 240px;height:42px;padding:0 12px;border:1px solid var(--rd-line-strong);border-radius:10px;background:var(--rd-surface);font:inherit;font-size:15px;color:var(--rd-ink)}
.mh-rename .start-primary{padding:10px 16px}
.mh-quiet{margin:14px 0 0;font-size:13px;color:var(--rd-muted)}
.mh-quiet .start-link{font-size:13px}
.mh-empty{display:flex;align-items:center;gap:22px;margin-top:14px;padding:22px 24px;border:1px dashed var(--rd-line);border-radius:16px}
.mh-empty-art{flex:none;width:84px;--th-w:3.4}
.mh-empty strong{font-size:16px;color:var(--rd-ink)}
.mh-empty p{margin:6px 0 0;max-width:500px;font-size:14px;line-height:1.55;color:var(--rd-text)}
.mh-empty p.mh-quiet{font-size:13px;color:var(--rd-muted)}
@media(max-width:560px){.mh-empty{flex-direction:column;align-items:flex-start;gap:12px}.mh-empty-art{width:64px}.mh-open{grid-template-columns:1fr}.mh-go{grid-column:1;grid-row:auto;justify-self:start;margin-top:10px}}
.mh-loose{margin-top:18px;padding:14px 16px;border:1px solid #e3b870;border-radius:12px;background:#fffaf0}
.mh-loose h3{margin:0 0 6px;font-size:12px;font-weight:650;letter-spacing:.08em;text-transform:uppercase;color:#7a4b10}
.mh-loose ul{list-style:none;margin:0 0 8px;padding:0;display:grid;gap:6px;font-size:14px}
.mh-loose li{display:flex;gap:12px}
.mh-loose b{flex:none;min-width:110px;color:#7a4b10}
.mh-loose li.late b{color:#a3311f}
html[data-theme=dark] .mh-loose{background:#2f2616;border-color:#8a6526}
html[data-theme=dark] :is(.mh-loose h3,.mh-loose b){color:#f3d79f}
html[data-theme=dark] .mh-loose li.late b{color:#ffb4a6}

/* ---------- Router header: the matter, one line of facts, Save, More ---------- */
body.themis-workspace .rail-intro{display:flex!important;flex-wrap:nowrap!important;align-items:center!important;gap:8px!important;position:relative}
.rail-intro .rail-matter{flex:1 1 auto;min-width:0;margin:0!important;padding:0!important}
.rail-intro .context-label,.rail-intro>span,.rail-intro #expandRoute,.rail-intro #revealDebtRoute,.rail-intro #downloadDebtMap,.rail-intro #switchSide,.rail-intro .switch-side,.rail-intro #changeMatter{display:none!important}
.rail-intro #matterHeading{margin:0!important;font-size:22px!important;line-height:1.2!important;font-weight:600!important;letter-spacing:-.02em!important;color:var(--rd-ink)!important;overflow-wrap:anywhere}
.rail-intro #matterSubtitle{margin:4px 0 0!important;font-size:13.5px!important;line-height:1.4!important;color:var(--rd-muted)!important}
.rail-intro #saveRoute{flex:none;align-self:center!important;margin:0!important;height:34px;min-height:34px}
.rail-intro .router-more{align-self:center}
.router-more{position:relative;flex:none}
.rail-intro .router-more-btn{display:inline-flex;align-items:center;gap:6px;height:34px;padding:0 12px;border:1px solid var(--rd-line);border-radius:999px;background:var(--rd-surface);color:var(--rd-text);font:inherit;font-size:13.5px;font-weight:600;cursor:pointer}
.router-more-btn svg{width:16px;height:16px;fill:currentColor;stroke:none}
.rail-intro .router-more-btn:hover,.rail-intro .router-more-btn[aria-expanded=true]{border-color:#8fae70;color:var(--rd-accent)}
.router-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:60;min-width:250px;padding:6px;border:1px solid var(--rd-line);border-radius:12px;background:var(--rd-surface);box-shadow:0 18px 48px -18px #1b33224d}
.router-menu[hidden]{display:none}
.router-menu button{display:block;width:100%;padding:10px 12px;border:0;border-radius:8px;background:none;color:var(--rd-ink);font:inherit;font-size:14px;text-align:left;cursor:pointer}
.router-menu button:hover,.router-menu button:focus-visible{background:var(--rd-soft);outline:none}
html[data-theme=dark] .router-menu{background:var(--d-raised);box-shadow:var(--d-shadow)}
@media(max-width:560px){.router-more-btn span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}.router-more-btn{width:34px;padding:0;justify-content:center}.rail-intro #matterHeading{font-size:20px!important}}
/* Case details open only when asked for, from More */
body.themis-workspace:not(.config-open) #configuration{display:none!important}

/* ---------- Reader: Continue stays in view; only the text above it scrolls ---------- */
body.themis-workspace #detail.has-nav{flex-direction:column;overflow:hidden!important;padding-bottom:0!important}
@media(min-width:821px){body.themis-workspace #detail.has-nav{display:flex}}
@media(max-width:820px){body.themis-workspace.detail-open #themisDock{display:none!important}}
#detail>.detail-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;margin:0 -30px;padding:0 30px 24px;scrollbar-width:thin;scrollbar-color:#ceddc0 transparent}
#detail>.reader-navigation{position:static!important;flex:none;margin:0 -30px!important;padding:12px 30px!important;background:var(--rd-surface)!important;backdrop-filter:none!important;border-top:1px solid var(--rd-line)!important;border-radius:0 0 15px 15px;z-index:2}
#detail>.reader-navigation>span{display:block!important;flex:1;min-width:0;font-size:13px!important;line-height:1.4;color:var(--rd-muted)!important;max-width:none!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#detail>.reader-navigation .next-step{flex:none;max-width:60%;min-height:40px;font-size:14px!important;font-weight:600;padding:9px 16px!important;background:var(--rd-accent)!important;border-color:var(--rd-accent)!important;color:#fff!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[data-theme=dark] #detail>.reader-navigation .next-step{background:var(--d-accent-fill)!important;border-color:var(--d-accent-fill)!important;color:var(--d-on-accent)!important}
#detail .detail-scroll .reader-tabs{top:0}
@media(min-width:821px){body.themis-workspace #detail.has-nav{padding-bottom:0!important}}
@media(max-width:820px){
 body.themis-workspace.detail-open #detail.has-nav{display:flex!important}
 #detail>.detail-scroll{margin:0 -24px;padding:0 24px 20px}
 #detail>.reader-navigation{margin:0 -24px!important;padding:12px 24px calc(12px + env(safe-area-inset-bottom))!important;border-radius:0 0 17px 17px}
 #detail>.reader-navigation>span{display:none!important}
 #detail>.reader-navigation .next-step{max-width:none;flex:1}
}
/* One action in the reader header */
.reader-meta #readerReview{display:none!important}
.review-note{margin:0 0 16px!important;padding:10px 12px;border-radius:10px;background:var(--rd-soft);font-size:13.5px!important;line-height:1.55!important;color:var(--rd-text)!important}
.review-note strong{color:var(--rd-ink)}

/* ---------- Footer: one line, always ---------- */
body.themis-workspace .footer{flex-wrap:wrap;row-gap:8px;align-items:center}
body.themis-workspace .footer .madeby{display:block;flex:0 1 auto;max-width:100%;min-width:0;white-space:nowrap!important;overflow:hidden;text-overflow:ellipsis;font-size:clamp(10.5px,1.25vw,13px)!important;line-height:1.5}
@media(max-width:820px){body.themis-workspace .footer .madeby{width:100%;flex-basis:100%}}

/* ---------- Standalone pages: About, FAQs, Disclaimer, Privacy, Terms ---------- */
.page-view{max-width:760px;margin:0 auto;padding:0 0 64px}
#view_diary.wsx-view{max-width:760px;margin:0 auto}
.themis-workspace :is(.page-mark,.mh-empty-art,.dy-empty-art,.prec-mark) .th-art{overflow:hidden}
.page-doc{position:relative;padding-top:40px}
.page-mark{display:block;width:52px;margin:0 0 14px;--th-w:5;--th-line:var(--rd-line-strong)}
.page-doc h1{margin:0;font-size:clamp(28px,3.2vw,36px);line-height:1.12;font-weight:600;letter-spacing:-.03em;color:var(--rd-ink);outline:none}
.page-body{margin-top:14px;font-size:15.5px;line-height:1.7;color:var(--rd-text)}
.page-body .page-lead{font-size:17.5px;line-height:1.6;color:var(--rd-ink)}
.page-body h2{margin:30px 0 6px;font-size:17px;font-weight:600;letter-spacing:-.01em;color:var(--rd-ink)}
.page-body h3,.page-body h4{margin:22px 0 4px;font-size:15.5px;color:var(--rd-ink)}
.page-body p,.page-body li{max-width:66ch;margin:0 0 10px;color:var(--rd-text)}
.page-body ul,.page-body ol{padding-left:20px}
.page-body a,.page-link{color:var(--rd-accent);font-weight:600;text-decoration:underline;text-decoration-color:var(--rd-line-strong);text-underline-offset:3px}
.page-link{padding:0;border:0;background:none;font:inherit;cursor:pointer}
.page-more{display:flex;flex-wrap:wrap;gap:8px;margin-top:40px;padding-top:22px;border-top:1px solid var(--rd-line)}
.page-more button{padding:8px 14px;border:1px solid var(--rd-line);border-radius:999px;background:var(--rd-surface);color:var(--rd-accent);font:inherit;font-size:14px;font-weight:600;cursor:pointer}
.page-more button:hover{border-color:#8fae70}
@media(max-width:820px){.page-doc{padding-top:22px}}

/* ---------- Diary ---------- */
.dy{padding:26px 0 8px}
.dy-top{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 20px}
.dy-summary{margin:0;font-size:17px;font-weight:600;letter-spacing:-.01em;color:var(--rd-ink)}
.dy-summary:empty{display:none}
.dy-tools{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.dy-add{display:inline-flex;align-items:center;gap:8px;padding:10px 16px!important;font-size:14.5px!important}
.dy-add svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.dy-btn{display:inline-flex;align-items:center;gap:6px;min-height:34px;padding:0 12px;border:1px solid var(--rd-line);border-radius:999px;background:var(--rd-surface);color:var(--rd-accent);font:inherit;font-size:13.5px;font-weight:600;cursor:pointer;white-space:nowrap}
.dy-btn:hover{border-color:#8fae70}
.dy-btn svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.dy-done:hover{background:var(--rd-accent);border-color:var(--rd-accent);color:#fff}
html[data-theme=dark] .dy-done:hover{background:var(--d-accent-fill);color:var(--d-on-accent)}
.dy-danger{border-color:var(--rd-late);color:var(--rd-late)}
.dy-form{display:grid;grid-template-columns:2fr 1fr 1.4fr;gap:12px 14px;margin-top:18px;padding:18px;border:1px solid var(--rd-line-strong);border-radius:14px;background:var(--rd-soft)}
.dy-form label{display:block;margin-bottom:5px;font-size:13px;font-weight:600;color:var(--rd-text)}
.dy-form :is(input,select){width:100%;height:42px;padding:0 12px;border:1px solid var(--rd-line);border-radius:10px;background:var(--rd-surface);font:inherit;font-size:15px;color:var(--rd-ink);box-sizing:border-box}
.dy-form-actions{grid-column:1/-1;display:flex;align-items:center;gap:16px}
.dy-form-actions .start-primary{padding:10px 20px}
.dy-tip{grid-column:1/-1;margin:0;font-size:13px;line-height:1.5;color:var(--rd-muted)}
@media(max-width:700px){.dy-form{grid-template-columns:1fr}}
.dy-group{margin-top:26px}
.dy-group h2{display:flex;align-items:center;gap:8px;margin:0 0 8px;font-size:12px;font-weight:650;letter-spacing:.08em;text-transform:uppercase;color:var(--rd-muted)}
.dy-group h2 span{padding:1px 8px;border-radius:999px;background:var(--rd-soft);font-size:11.5px;letter-spacing:0;color:var(--rd-accent)}
.dy-late h2{color:var(--rd-late)}
.dy-late h2 span{background:var(--rd-late-soft);color:var(--rd-late)}
.dy-group ol{list-style:none;margin:0;padding:0;border:1px solid var(--rd-line);border-radius:14px;background:var(--rd-surface);overflow:hidden}
.dy-item{display:grid;grid-template-columns:auto 1fr auto;grid-template-areas:"date main when" "date actions actions";align-items:center;gap:4px 16px;padding:14px 16px}
.dy-item+.dy-item{border-top:1px solid var(--rd-line)}
.dy-date{grid-area:date;align-self:start;display:grid;place-items:center;width:48px;height:52px;border-radius:10px;background:var(--rd-soft);color:var(--rd-accent);line-height:1}
.dy-date b{font-size:20px;font-weight:650}
.dy-date span{font-size:11.5px;font-weight:600;text-transform:uppercase;letter-spacing:.04em}
.is-late .dy-date{background:var(--rd-late-soft);color:var(--rd-late)}
.is-soon .dy-date{background:var(--rd-warm);color:var(--rd-warm-ink)}
.dy-main{grid-area:main;min-width:0}
.dy-main strong{display:block;font-size:15.5px;font-weight:600;color:var(--rd-ink)}
.dy-sub{display:block;margin-top:2px;font-size:13px;color:var(--rd-muted)}
.dy-when{grid-area:when;font-size:13.5px;font-weight:600;color:var(--rd-accent);white-space:nowrap}
.is-late .dy-when{color:var(--rd-late)}
.is-soon .dy-when{color:var(--rd-warm-ink)}
.dy-actions{grid-area:actions;display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
.is-done{grid-template-columns:1fr;grid-template-areas:"main" "actions"}
.is-done .dy-main strong{color:var(--rd-muted);text-decoration:line-through;text-decoration-color:var(--rd-line-strong)}
.dy-toggle{display:inline-flex;align-items:center;gap:8px;padding:0;border:0;background:none;font:inherit;letter-spacing:inherit;text-transform:inherit;color:inherit;cursor:pointer}
.dy-toggle::before{content:"";width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg);transition:transform .2s}
.dy-toggle[aria-expanded=true]::before{transform:rotate(45deg)}
.dy-empty{display:flex;align-items:center;gap:24px;margin-top:22px;padding:26px 28px;border:1px dashed var(--rd-line);border-radius:16px}
.dy-empty-art{flex:none;width:92px;--th-w:3.4}
.dy-empty strong{font-size:17px;color:var(--rd-ink)}
.dy-empty p{margin:6px 0 0;max-width:520px;font-size:14.5px;line-height:1.55;color:var(--rd-text)}
@media(max-width:560px){.dy-empty{flex-direction:column;align-items:flex-start}.dy-empty-art{width:68px}.dy-item{grid-template-areas:"date main" "date when" "actions actions";grid-template-columns:auto 1fr}.dy-when{white-space:normal}}
.dy-note{margin:26px 0 0;font-size:12.5px;line-height:1.5;color:var(--rd-muted)}

/* ---------- Precedents: start from the step you are on ---------- */
.prec-suggest{margin:4px 0 18px}
.prec-suggest[hidden]{display:none}
.prec-suggest-in{display:flex;align-items:center;gap:16px;padding:14px 18px;border:1px solid var(--rd-line-strong);border-radius:14px;background:var(--rd-soft)}
.prec-mark{flex:none;width:36px;--th-w:5}
.prec-suggest-label{display:block;font-size:13.5px;font-weight:600;color:var(--rd-text)}
.prec-suggest-list{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.prec-suggest .start-chip{border-style:solid;background:var(--rd-surface)}
@media(max-width:560px){.prec-mark{display:none}}

/* ---------- Dark mode fills ---------- */
html[data-theme=dark] :is(.start-door,.mh-card,.dy-group ol,.page-more button,.dy-btn,.start-share,.router-more-btn,.start-filter input,.dy-form :is(input,select),.mh-rename input){background:var(--d-surface)}
html[data-theme=dark] .start-door-urgent{background:linear-gradient(180deg,var(--d-surface),var(--d-accent-soft))}
html[data-theme=dark] .start-filter input::placeholder{color:var(--d-text3)}
html[data-theme=dark] :is(.mh-card:hover,.start-option:hover,.start-door:hover){border-color:var(--d-accent-line)}
html[data-theme=dark] #detail>.detail-scroll{scrollbar-color:#3c4e36 transparent}
html[data-theme=dark] .page-mark{--th-line:var(--d-accent-line)}

@media(prefers-reduced-motion:reduce){.start-progress i,.start-door>svg,.dy-toggle::before,.mh-card{transition:none}}
/* Returning users: the most urgent matter carries the one primary action; new-matter doors go compact */
.start-returning .mh-list>li:first-child .mh-go{background:var(--rd-accent);color:#fff}
html[data-theme=dark] .start-returning .mh-list>li:first-child .mh-go{background:var(--d-accent-fill);color:var(--d-on-accent)}
.start-returning .start-door{align-items:center;padding:14px 16px}
.start-returning .start-door>svg{margin-top:0}
.start-returning .start-door .start-tag{margin-bottom:4px}
/* Precedents: quiet text still meets 4.5:1 */
html:not([data-theme=dark]) #view_precedents :is(.prec-panel-foot,.prec-panel-foot span,.prec-cats button,.prec-switch button span){color:#596e50!important}
html:not([data-theme=dark]) #view_precedents .prec-cats button[aria-selected=true],html:not([data-theme=dark]) #view_precedents .prec-cats button.active{color:#243f2a!important}
/* Narrow phones: the top bar keeps every control on screen */
@media(max-width:380px){
 body.themis-workspace .masthead .wrap{gap:8px!important;padding-left:14px!important;padding-right:14px!important}
 body.themis-workspace .workspace-brand{font-size:22px!important}
 body.themis-workspace .workspace-brand img{width:21px;height:26px}
 body.themis-workspace .masthead .tools{gap:6px}
}
@media(max-width:820px){.start-more-ways>span[aria-hidden]{display:none}.start-more-ways{flex-direction:column;align-items:flex-start;gap:10px}}
/* Diary tab count */
.workspace-toolbar .tab-count{display:inline-grid;place-items:center;min-width:18px;height:18px;margin-left:6px;padding:0 5px;border-radius:999px;background:var(--rd-accent);color:#fff;font-size:11px;font-weight:700;line-height:1;vertical-align:1px}
.workspace-toolbar .tab-count.late{background:#a3311f}
html[data-theme=dark] .workspace-toolbar .tab-count{background:var(--d-accent-fill);color:var(--d-on-accent)}
html[data-theme=dark] .workspace-toolbar .tab-count.late{background:#e69688;color:#1d1c1a}
/* Phones: the floating Ask Themis button never hides the end of a page */
@media(max-width:820px){.page-view,#view_diary{padding-bottom:96px!important}}

/* ================= Round 2 polish (30 Sep) ================= */
/* Route header: two matching pill buttons with room to breathe */
body.themis-workspace .route-heading{top:var(--mast-h,68px)!important;background:var(--rd-page,#f3f6ef)!important;border-bottom:1px solid var(--rd-line);padding-top:16px!important;padding-bottom:16px!important;z-index:6!important;overflow:visible!important}
@media(max-width:820px){body.themis-workspace .route-heading::before{content:"";position:absolute;top:0;bottom:-1px;left:-32px;right:-32px;background:var(--rd-page,#f3f6ef);border-bottom:1px solid var(--rd-line);z-index:-1;pointer-events:none}}
body.themis-workspace .rail-intro .router-more-btn span{font-size:14px!important;font-weight:600!important}
html[data-theme=dark]{--rd-page:#161513}
body.themis-workspace .rail-intro{gap:10px!important;align-items:center!important;padding:0!important;border:0!important;margin:0!important}
body.themis-workspace .rail-intro #matterHeading{font-size:21px!important;line-height:1.25!important}
body.themis-workspace .rail-intro #matterSubtitle{margin-top:3px!important}
body.themis-workspace .rail-intro :is(#saveRoute,.router-more-btn){display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:7px!important;height:38px!important;min-height:38px!important;width:auto!important;margin:0!important;padding:0 16px!important;border:1px solid var(--rd-line)!important;border-radius:999px!important;background:var(--rd-surface)!important;color:var(--rd-accent)!important;font:inherit!important;font-size:14px!important;font-weight:600!important;line-height:1!important;box-shadow:0 1px 2px rgba(36,63,42,.06)!important;transition:border-color .15s,background .15s,box-shadow .15s!important;cursor:pointer}
body.themis-workspace .rail-intro :is(#saveRoute,.router-more-btn) svg{width:16px!important;height:16px!important;margin:0!important;flex:none}
body.themis-workspace .rail-intro #saveRoute svg{fill:none!important;stroke:currentColor!important;stroke-width:1.8!important}
body.themis-workspace .rail-intro .router-more-btn svg{fill:currentColor!important;stroke:none!important}
body.themis-workspace .rail-intro :is(#saveRoute,.router-more-btn):hover,body.themis-workspace .rail-intro .router-more-btn[aria-expanded=true]{border-color:#8fae70!important;background:var(--rd-soft)!important}
body.themis-workspace .rail-intro :is(#saveRoute,.router-more-btn):focus-visible{outline:2px solid var(--rd-focus)!important;outline-offset:2px!important}
body.themis-workspace .rail-intro .router-more{display:flex;align-self:center}
.router-menu{top:calc(100% + 8px);min-width:240px;padding:6px;border-radius:14px}
.router-menu button{padding:10px 12px;font-size:14px;line-height:1.3}
.router-menu button+button{margin-top:1px}
@media(max-width:560px){
 body.themis-workspace .rail-intro #routerMore .router-more-btn{width:38px!important;padding:0!important}
 body.themis-workspace .rail-intro #saveRoute{padding:0 14px!important}
 body.themis-workspace .rail-intro #matterHeading{font-size:19px!important}
 .router-menu{right:0;min-width:min(260px,calc(100vw - 40px))}
}

/* Top bar: one tidy row. Desktop: brand, search, then New matter, theme and account together. */
body.themis-workspace .masthead .wrap{gap:24px!important}
body.themis-workspace .masthead .tools{margin-left:auto!important;gap:10px!important}
body.themis-workspace .masthead .profile{margin-left:0!important;padding-left:16px;position:relative}
body.themis-workspace .masthead .profile::before{content:"";position:absolute;left:0;top:50%;width:1px;height:22px;transform:translateY(-50%);background:var(--rd-line)}
body.themis-workspace .profile-btn{display:grid!important;place-items:center!important;width:36px!important;height:36px!important;padding:0!important;border:1px solid #cfdcc3!important;border-radius:50%!important;background:linear-gradient(150deg,#f7faf2,#e3ecd8)!important;color:#3f5a31!important;box-shadow:inset 0 1px 0 #fff,0 1px 2px rgba(36,63,42,.08)!important;overflow:hidden;transition:box-shadow .15s,border-color .15s}
body.themis-workspace .profile-btn:hover,body.themis-workspace .profile-btn[aria-expanded=true]{border-color:#8fae70!important;box-shadow:0 0 0 3px rgba(79,107,63,.14)!important}
body.themis-workspace .profile-btn svg{width:18px!important;height:18px!important}
body.themis-workspace .profile-btn img{width:100%;height:100%;object-fit:cover}
body.themis-workspace .profile-btn>span{font-size:13px;font-weight:700;letter-spacing:.02em}
html[data-theme=dark] body.themis-workspace .profile-btn{background:linear-gradient(150deg,#2a2c27,#1f211d)!important;border-color:var(--d-line2)!important;color:var(--d-accent)!important;box-shadow:none!important}
html[data-theme=dark] body.themis-workspace .profile::before{background:var(--d-line2)}
@media(max-width:820px){
 body.themis-workspace .masthead .wrap{flex-wrap:nowrap!important;gap:8px!important;padding:12px 18px!important;min-height:64px!important}
 body.themis-workspace .masthead .workspace-brand{margin-right:auto!important;order:0}
 body.themis-workspace .masthead .m-search-btn{order:1;margin:0!important}
 body.themis-workspace .masthead .tools{order:2;margin:0!important;gap:8px!important}
 body.themis-workspace .masthead .profile{order:3;padding-left:0;margin:0!important}
 body.themis-workspace .masthead .profile::before{display:none}
 body.themis-workspace .masthead .m-search-btn{display:grid!important;place-items:center;width:38px!important;height:38px!important;border:1px solid var(--rd-line)!important;border-radius:50%!important;background:var(--rd-surface)!important;color:var(--rd-accent)!important;box-shadow:0 1px 2px rgba(36,63,42,.06)}
 body.themis-workspace .masthead .m-search-btn svg{width:18px!important;height:18px!important;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
 body.themis-workspace .masthead .m-search-btn:hover{background:var(--rd-soft)!important}
 .masthead #newMatter{width:38px!important;height:38px!important}
 body.themis-workspace .profile-btn{width:38px!important;height:38px!important}
}
@media(max-width:380px){body.themis-workspace .masthead .wrap{gap:6px!important;padding:12px 12px!important}.masthead #newMatter,body.themis-workspace .masthead .m-search-btn,body.themis-workspace .profile-btn{width:34px!important;height:34px!important}}

/* Footer: compact, one line of credit, no empty space */
body.themis-workspace .footer{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;align-items:center!important;justify-content:space-between!important;gap:10px 24px!important;min-height:0!important;height:auto!important;padding:22px 0 26px!important}
body.themis-workspace .footer .footer-primary{flex:0 1 auto!important;min-height:0!important;height:auto!important;margin:0!important;padding:0!important}
body.themis-workspace .footer .footer-links{display:flex!important;flex-wrap:wrap;gap:6px 18px!important}
body.themis-workspace .footer .madeby{margin:0!important;flex:0 1 auto}
@media(max-width:820px){
 body.themis-workspace .footer{flex-direction:column!important;align-items:flex-start!important;gap:12px!important;padding:20px 0 84px!important}
 body.themis-workspace .footer .footer-links{gap:2px 18px!important}
 body.themis-workspace .footer .footer-links button{min-height:36px!important;padding:0!important}
 body.themis-workspace .footer .madeby{font-size:12px!important}
}

/* Movement: views rise in, a thin line shows work in progress */
@keyframes th-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
.th-enter{animation:th-rise .32s cubic-bezier(.2,.7,.2,1) both}
.th-progress{position:fixed;left:0;top:var(--mast-h,68px);z-index:120;height:2px;width:0;background:linear-gradient(90deg,#b59a64,#4f6b3f);opacity:0;pointer-events:none;transition:width .35s cubic-bezier(.2,.7,.2,1),opacity .3s}
.th-progress.on{opacity:1}
html[data-theme=dark] .th-progress{background:linear-gradient(90deg,#d9b96e,#aacb9f)}
/* Skeleton blocks for anything that loads from the server */
.th-skel{display:block;height:12px;margin:10px 0;border-radius:6px;background:linear-gradient(90deg,var(--rd-soft) 0%,#f8fbf4 50%,var(--rd-soft) 100%);background-size:200% 100%;animation:th-shimmer 1.2s linear infinite}
html[data-theme=dark] .th-skel{background:linear-gradient(90deg,#22241f 0%,#2c2f29 50%,#22241f 100%);background-size:200% 100%}
@keyframes th-shimmer{to{background-position:-200% 0}}
@media(prefers-reduced-motion:reduce){.th-enter{animation:none}.th-skel{animation:none}.th-progress{transition:none}}
body.themis-workspace .rail-intro :is(#saveRoute,.router-more-btn) span{font-size:13.5px!important;font-weight:600!important;letter-spacing:0!important;color:inherit!important}
body.themis-workspace .router-menu button{font-size:14px!important;font-weight:500!important;color:var(--rd-ink)!important;min-height:40px}
html body.themis-workspace .rail-intro>#saveRoute.rail-save,html body.themis-workspace .rail-intro>#saveRoute{margin:0!important;align-self:center!important}
html body.themis-workspace .rail-intro>#saveRoute.rail-save{height:38px!important;min-height:38px!important;padding:0 16px!important;gap:7px!important;border:1px solid var(--rd-line)!important;border-radius:999px!important;background:var(--rd-surface)!important;color:var(--rd-accent)!important;font-size:13.5px!important;font-weight:600!important}
html body.themis-workspace .rail-intro>#saveRoute.rail-save:hover{border-color:#8fae70!important;background:var(--rd-soft)!important}
@media(max-width:560px){html body.themis-workspace .rail-intro>#saveRoute.rail-save{padding:0 14px!important}}
html body.themis-workspace .rail-intro>#saveRoute.rail-save span{font-size:13.5px!important;padding-top:0!important}
@media(max-width:820px){body.themis-workspace .footer .madeby{text-align:left!important;align-self:flex-start!important;width:auto!important;flex-basis:auto!important;max-width:100%}}
/* Served papers: a longer list, so two columns on wide screens with a quiet tag where Themis counts the deadline */
.start-grid-docs .start-option{min-height:74px}
.start-doc-tag{display:inline-flex;align-items:center;gap:4px;margin-top:8px;padding:2px 8px;border-radius:999px;background:var(--rd-warm);color:var(--rd-warm-ink);font-size:11.5px;font-weight:650;white-space:nowrap}
.start-doc-tag svg{width:12px!important;height:12px!important}
/* Route header, desktop: Show all steps and Edit as icons beside Save; phones keep the More menu */
.router-icons{display:flex;gap:6px;align-items:center;flex:none}
.router-icon{position:relative;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-accent);cursor:pointer;box-shadow:0 1px 2px rgba(36,63,42,.06);transition:border-color .15s,background .15s}
.router-icon svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.router-icon:hover{border-color:#8fae70;background:var(--rd-soft)}
.router-icon[aria-pressed=true]{background:var(--rd-accent);border-color:var(--rd-accent);color:#fff}
html[data-theme=dark] .router-icon[aria-pressed=true]{background:var(--d-accent-fill);border-color:var(--d-accent-fill);color:var(--d-on-accent)}
.router-icon:focus-visible{outline:2px solid var(--rd-focus);outline-offset:2px}
.router-icon[data-tip]::after{content:attr(data-tip);position:absolute;top:calc(100% + 8px);left:50%;transform:translateX(-50%) translateY(-2px);padding:5px 9px;border-radius:7px;background:#243f2a;color:#fff;font-size:12px;font-weight:600;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .12s,transform .12s;z-index:70}
.router-icon:hover::after,.router-icon:focus-visible::after{opacity:1;transform:translateX(-50%)}
html[data-theme=dark] .router-icon[data-tip]::after{background:#eceae6;color:#161513}
@media(min-width:821px){body.themis-workspace .rail-intro #routerMore{display:none!important}}
@media(max-width:820px){.router-icons{display:none!important}}
/* Last step: the route map */
.reader-navigation .reader-map{display:inline-flex;align-items:center;gap:6px;flex:none;min-height:40px;padding:0 14px;border:1px solid var(--rd-line);border-radius:999px;background:var(--rd-surface);color:var(--rd-accent);font:inherit;font-size:13.5px;font-weight:600;cursor:pointer}
.reader-navigation .reader-map svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
body.themis-workspace .rail-intro .router-icon{width:38px!important;height:38px!important;min-height:38px!important;padding:0!important;margin:0!important;border:1px solid var(--rd-line)!important;border-radius:50%!important;background:var(--rd-surface)!important;color:var(--rd-accent)!important;box-shadow:0 1px 2px rgba(36,63,42,.06)!important}
body.themis-workspace .rail-intro .router-icon:hover{border-color:#8fae70!important;background:var(--rd-soft)!important}
body.themis-workspace .rail-intro .router-icon svg{width:17px!important;height:17px!important;fill:none!important;stroke:currentColor!important;stroke-width:1.9!important}
body.themis-workspace .rail-intro .router-icon[aria-expanded=true]{background:var(--rd-accent)!important;border-color:var(--rd-accent)!important;color:#fff!important}
html[data-theme=dark] body.themis-workspace .rail-intro .router-icon[aria-expanded=true]{background:var(--d-accent-fill)!important;color:var(--d-on-accent)!important}
/* Served papers: grouped rows with one line saying what Themis gives back, and a search for the long tail */
.start-doc-search{margin-top:18px}
.start-doc-group{margin-top:24px}
.start-doc-group h2{margin:0 0 8px;font-size:12px;font-weight:650;letter-spacing:.08em;text-transform:uppercase;color:var(--rd-muted)}
.start-rows{display:grid;border:1px solid var(--rd-line);border-radius:14px;background:var(--rd-surface);overflow:hidden}
.start-doc-results .start-rows,.start-step>.start-rows{margin-top:18px}
.start-row{display:flex;align-items:center;gap:14px;width:100%;padding:14px 16px;border:0;border-radius:0;background:none;color:var(--rd-ink);font:inherit;text-align:left;cursor:pointer;transition:background .12s}
.start-row+.start-row{border-top:1px solid var(--rd-line)}
.start-row:hover{background:var(--rd-soft)}
.start-row:focus-visible{outline:2px solid var(--rd-focus);outline-offset:-2px}
.start-row-text{flex:1;min-width:0}
.start-row-text strong{display:block;font-size:15.5px;font-weight:600;color:var(--rd-ink)}
.start-row-text small{display:block;margin-top:2px;font-size:13.5px;line-height:1.45;color:var(--rd-muted)}
.start-row-text em{display:inline-block;margin-top:6px;padding:2px 8px;border-radius:999px;background:var(--rd-soft);color:var(--rd-accent);font-size:12px;font-style:normal;font-weight:600}
.start-row>svg{flex:none;color:var(--rd-muted)}
.start-row:hover>svg{color:var(--rd-accent)}
html[data-theme=dark] .start-rows{background:var(--d-surface)}
html[data-theme=dark] .start-row:hover{background:var(--d-hover)}
.start-row:hover .start-row-text em{background:var(--rd-surface)}

/* ---------- UX review 30 Sep: the map and the walk ---------- */
/* No sideways panning on phones: the strip behind the sticky route header stays inside the page. */
@media(max-width:820px){html,body.themis-workspace{overflow-x:clip}}
/* Content scrolled to or focused never hides under the sticky header (WCAG 2.4.11). */
html{scroll-padding-top:calc(var(--mast-h,64px) + 96px)}
/* The "Next" line under the route title */
.themis-workspace .walk-next{display:flex;align-items:center;gap:8px;max-width:100%;margin:8px 0 0;padding:6px 12px 6px 6px;min-height:32px;border:1px solid var(--rd-line);border-radius:999px;background:var(--rd-soft);color:var(--rd-ink);font:inherit;font-size:13px;line-height:1.3;text-align:left;cursor:pointer}
.themis-workspace .walk-next:hover{border-color:var(--rd-line-strong)}
.themis-workspace .walk-next:focus-visible{outline:2px solid var(--rd-focus);outline-offset:2px}
.themis-workspace .walk-next-k{flex-shrink:0;padding:2px 8px;border-radius:999px;background:var(--rd-accent);color:#fff;font-size:11px;font-weight:600;letter-spacing:.02em}
html[data-theme=dark] .themis-workspace .walk-next-k{color:#161d14}
.themis-workspace .walk-next-t{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.themis-workspace .walk-next svg{flex-shrink:0;width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.themis-workspace .walk-next.walk-next-quiet{background:transparent}
.themis-workspace .walk-next.walk-next-quiet .walk-next-k{background:var(--rd-muted)}
.themis-workspace .rail-matter{min-width:0}
/* Where the route goes next, shown for a moment after the sheet closes or the header line is used */
@keyframes walkHere{0%{box-shadow:0 0 0 0 rgba(79,107,63,.45)}70%{box-shadow:0 0 0 10px rgba(79,107,63,0)}100%{box-shadow:0 0 0 0 rgba(79,107,63,0)}}
#rail .walk-here,#rail .walk-here>.stage-hit{animation:walkHere 1.4s ease-out 1;border-radius:14px}
/* Reader footer: the words say what comes next, at a readable size */
.themis-workspace .reader-navigation>span{font-size:12px!important;line-height:1.4!important;color:var(--rd-text)!important}
.themis-workspace .reader-navigation .next-step:disabled{opacity:.5;cursor:not-allowed}
/* A question as its own page inside the phone sheet */
#detail.walk-asking .detail-scroll>*:not(.walk-q):not(.detail-top){display:none!important}
#detail.walk-asking .detail-top .copy-link,#detail.walk-asking .detail-top [data-copy-link]{display:none}
.walk-q{padding:4px 2px 12px;color:var(--rd-ink)}
.walk-q-kicker{margin:0 0 8px;font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--rd-muted)}
.walk-q h2{margin:0 0 10px;font-size:24px;line-height:1.25;font-weight:600;color:var(--rd-ink);outline:none}
.walk-q-why{margin:0 0 18px;font-size:15px;line-height:1.6;color:var(--rd-text)}
.walk-q-hint{margin:0 0 8px;font-size:13px;color:var(--rd-muted)}
.walk-q-options{border:0;margin:0;padding:0;display:grid;gap:10px}
.walk-q-option{display:flex;gap:12px;align-items:flex-start;padding:14px;min-height:48px;border:1px solid var(--rd-line);border-radius:14px;background:var(--rd-surface);cursor:pointer}
.walk-q-option:has(input:checked){border-color:var(--rd-accent);box-shadow:inset 0 0 0 1px var(--rd-accent);background:var(--rd-soft)}
.walk-q-option input{flex-shrink:0;width:20px;height:20px;margin:1px 0 0;accent-color:var(--rd-accent)}
.walk-q-option input:focus-visible{outline:2px solid var(--rd-focus);outline-offset:3px}
.walk-q-option strong{display:block;font-size:15px;font-weight:600;line-height:1.35}
.walk-q-option small{display:block;margin-top:4px;font-size:13px;line-height:1.5;color:var(--rd-text)}
.walk-q-usual{display:inline-block!important;margin:0 0 0 6px!important;padding:1px 7px;border-radius:999px;background:var(--rd-soft);color:var(--rd-accent)!important;font-size:11px!important;font-weight:600;vertical-align:1px}
.walk-q-help{display:flex;flex-wrap:wrap;gap:4px 16px;margin:14px 0 0}
.walk-q-link{min-height:44px;padding:0;border:0;background:none;font:inherit;font-size:14px;color:var(--rd-accent);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.walk-q-legal{margin:10px 0 0;font-size:12px;line-height:1.5;color:var(--rd-muted)}
.walk-end h2{font-size:22px}
/* The answer just saved, with a way to change it */
.walk-saved{display:flex;align-items:center;gap:10px;margin:0 0 16px;padding:10px 12px;border:1px solid var(--rd-line-strong);border-radius:12px;background:var(--rd-soft);font-size:13px;line-height:1.45;color:var(--rd-ink)}
.walk-saved-mark{flex-shrink:0;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--rd-accent);color:#fff;font-size:12px;font-weight:700}
html[data-theme=dark] .walk-saved-mark{color:#161d14}
.walk-saved>span:nth-child(2){flex:1;min-width:0}
.walk-saved strong{display:block;font-weight:600}
.walk-saved button{flex-shrink:0;min-height:36px;padding:0 4px;border:0;background:none;font:inherit;font-size:13px;color:var(--rd-accent);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
/* On a phone with the sheet closed, the step last read looks read, not active */
@media(max-width:820px){body.debt-focus:not(.detail-open) .route-main #rail .debt-phase>ol>.step.selected:not(.decision),body.debt-focus:not(.detail-open) .route-main #rail .step.selected:not(.decision) .stage-hit{background:transparent!important;box-shadow:none!important;border-color:transparent!important}
 body.debt-focus:not(.detail-open) .route-main #rail .step.selected:not(.decision) .step-no{background:#e4eddc!important;border-color:#8ea883!important;color:transparent!important}
 body.debt-focus:not(.detail-open) .route-main #rail .step.selected:not(.decision) .step-no:after{content:'\2713';position:absolute;inset:0;display:grid;place-items:center;color:#42663d;font-size:12px;font-weight:700}
 html[data-theme=dark] body.debt-focus:not(.detail-open) .route-main #rail .step.selected:not(.decision) .step-no{background:#2a2a27!important}}
/* Checkpoint help: "Not sure?" and the usual answer */
body.debt-focus .debt-choice-likely{min-height:36px;padding:6px 14px;border:1px solid var(--rd-line-strong);border-radius:999px;background:var(--rd-surface);font:inherit;font-size:12px;color:var(--rd-accent);cursor:pointer}
body.debt-focus .debt-choice-likely:hover{background:var(--rd-soft)}
body.debt-focus .debt-recheck{background:var(--rd-warm)!important;color:var(--rd-warm-ink)!important}
/* Start screen: a date that cannot be right is refused in words */
.start-screen .start-warn{margin:8px 0 0;padding:8px 12px;border-left:3px solid var(--rd-warm-ink);background:var(--rd-warm);color:var(--rd-warm-ink);font-size:14px;line-height:1.5;max-width:560px}
.start-screen .start-warn[hidden]{display:none}
/* Undo on a change that cleared answers */
.workspace-toast.th-undo-toast{display:flex;align-items:center;gap:14px}
.workspace-toast.th-undo-toast button{flex-shrink:0;min-height:36px;padding:0 14px;border:1px solid currentColor;border-radius:999px;background:transparent;color:inherit;font:inherit;font-size:13px;font-weight:600;cursor:pointer}
/* Desktop routes: the reader carries Ask Themis, so the floating button does not sit on the Continue strip */
@media(min-width:821px){body.themis-workspace:has(#view_route:not([hidden])) #themisDock:has(#themisActivity[hidden]){display:none}}
/* Small links in the reader header reach the 24px minimum target (WCAG 2.5.8) */
.themis-workspace #detail .detail-top a,.themis-workspace #detail .detail-top button,.themis-workspace #detail .reader-meta a,.themis-workspace #detail .reader-meta button{min-height:24px}
/* The Next line takes its own row under the title and actions */
body.themis-workspace .rail-intro{flex-wrap:wrap!important}
body.themis-workspace .rail-intro>#walkNext{order:99;flex:0 1 auto;margin-top:2px}
@media(max-width:820px){body.themis-workspace .rail-intro>#walkNext{flex:1 1 100%}}
/* Phones: the footer says in words what the button will do */
@media(max-width:820px){#detail>.reader-navigation{flex-wrap:wrap;row-gap:6px}#detail>.reader-navigation>span{display:block!important;order:-1;flex:1 1 100%;font-size:12px!important;line-height:1.35!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}
/* The sheet's close button meets 3:1 against its background (WCAG 1.4.11) */
.themis-workspace #detail .close-detail{color:var(--rd-accent)!important}
.start-screen .start-count{white-space:nowrap;flex-shrink:0}
/* Guest panel: join the early testers */
.profile-menu .profile-join{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:8px 0 0;padding:10px 12px;min-height:40px;border-radius:10px;background:var(--rd-soft);color:var(--rd-accent);font-size:13.5px;font-weight:600;text-decoration:none}
.profile-menu .profile-join:hover{background:var(--rd-line)}
.profile-menu .profile-join:focus-visible{outline:2px solid var(--rd-focus);outline-offset:2px}
.profile-menu .profile-tester{margin:8px 0 0;padding:8px 12px;border-radius:10px;background:var(--rd-soft);color:var(--rd-text);font-size:12.5px}

/* ======================================================================
   Router rethink, 30 Sep: one thing at a time on phones (themis-focus.js)
   ====================================================================== */
#routeFocus[hidden]{display:none!important}
body.rf-on #rail,body.rf-on #phaseNav,body.rf-on #revealDebtRoute{display:none!important}
body.rf-on:not(.detail-open) #themisDock:has(#themisActivity[hidden]){display:none!important}
#walkNext{display:none!important}
/* Header: one quiet row, not sticky, so the page is the content */
html body.themis-workspace.rf-on .route-heading,html body.themis-workspace.rf-map .route-heading{position:static!important;padding-top:14px!important;padding-bottom:14px!important}
html body.themis-workspace.rf-on .route-heading::before,html body.themis-workspace.rf-map .route-heading::before{display:none}
html body.themis-workspace.rf-on .rail-intro,html body.themis-workspace.rf-map .rail-intro{display:flex!important;flex-wrap:nowrap!important;align-items:center!important;gap:8px!important;grid-template-columns:none!important}
html body.themis-workspace.rf-on .rail-intro>.rail-matter,html body.themis-workspace.rf-map .rail-intro>.rail-matter{flex:1 1 auto!important;min-width:0!important;grid-column:auto!important}
html body.themis-workspace.rf-on .rail-intro #matterHeading,html body.themis-workspace.rf-map .rail-intro #matterHeading{font-size:20px!important}
html body.themis-workspace.rf-on .rail-intro #matterSubtitle,html body.themis-workspace.rf-map .rail-intro #matterSubtitle{font-size:13px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html body.themis-workspace.rf-on .rail-intro>#saveRoute.rail-save,html body.themis-workspace.rf-map .rail-intro>#saveRoute.rail-save{grid-column:auto!important;grid-row:auto!important;margin:0!important;flex:none}
html body.themis-workspace.rf-on .rail-intro>.router-more,html body.themis-workspace.rf-map .rail-intro>.router-more{flex:none;grid-column:auto!important;grid-row:auto!important}

.route-focus{max-width:560px;margin:4px auto 0;padding:0 0 32px;color:var(--rd-ink)}
.route-focus button{font:inherit}
/* Where you are */
.rf-where{margin:4px 2px 18px}
.rf-where p{display:flex;flex-direction:column;gap:3px;margin:0 0 10px}
.rf-where span{font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--rd-muted)}
.rf-where strong{font-size:16px;font-weight:600;line-height:1.3;color:var(--rd-ink)}
.rf-bar{display:flex;gap:4px}
.rf-bar i{flex:1;height:4px;border-radius:4px;background:var(--rd-line)}
.rf-bar i.is-done{background:var(--rd-accent)}
.rf-bar i.is-now{background:linear-gradient(90deg,var(--rd-accent) 50%,var(--rd-line-strong) 50%)}
.rf-later li[hidden]{display:none}
.rf-more{min-height:40px}
/* The answer just saved */
.rf-saved{display:flex;align-items:center;gap:10px;margin:0 0 12px;padding:10px 12px;border-radius:12px;background:var(--rd-soft);font-size:15px;line-height:1.35}
.rf-saved-mark{flex:none;display:grid;place-items:center;width:22px;height:22px;border-radius:50%;background:var(--rd-accent);color:#fff}
html[data-theme=dark] .rf-saved-mark{color:#161d14}
.rf-saved-mark svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.rf-saved>span:nth-child(2){flex:1;min-width:0}
.rf-saved small{display:block;font-size:13.5px;color:var(--rd-muted)}
.rf-saved button,.rf-row button[data-rf-change]{flex:none;min-height:40px;padding:0 6px;border:0;background:none;font-size:15px;color:var(--rd-accent);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
/* Now: the one thing to do */
.rf-now{padding:22px 20px;border:1px solid var(--rd-line);border-radius:18px;background:var(--rd-surface);box-shadow:0 1px 2px rgba(30,50,30,.04)}
.rf-kicker{margin:0 0 8px;font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--rd-accent)}
.rf-now h2{margin:0;font-size:22px;line-height:1.3;font-weight:600;letter-spacing:-.01em;color:var(--rd-ink);outline:none}
.rf-why{margin:10px 0 0;font-size:15px;line-height:1.55;color:var(--rd-text)}
.rf-hint{margin:10px 0 0;font-size:13.5px;color:var(--rd-muted)}
.rf-options{display:grid;gap:8px;margin:18px 0 0;padding:0;border:0}
.rf-options .rf-hint{margin:0 0 2px}
.rf-opt{display:flex;gap:12px;align-items:flex-start;min-height:52px;padding:14px;border:1px solid var(--rd-line);border-radius:12px;background:var(--rd-surface);cursor:pointer;transition:border-color .15s,background .15s}
.rf-opt:hover{border-color:var(--rd-line-strong)}
.rf-opt:has(input:checked){border-color:var(--rd-accent);background:var(--rd-soft);box-shadow:inset 0 0 0 1px var(--rd-accent)}
.rf-opt input{flex:none;width:20px;height:20px;margin:1px 0 0;accent-color:var(--rd-accent)}
.rf-opt input:focus-visible{outline:2px solid var(--rd-focus);outline-offset:3px}
.rf-opt strong{display:block;font-size:15px;font-weight:600;line-height:1.35;color:var(--rd-ink)}
.rf-opt small{display:block;margin-top:3px;font-size:13.5px;line-height:1.45;color:var(--rd-text)}
.rf-primary{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:50px;margin-top:18px;padding:0 18px;border:0;border-radius:14px;background:var(--rd-accent);color:#fff;font-size:16px;font-weight:600;cursor:pointer}
html[data-theme=dark] .rf-primary{color:#161d14}
@media(hover:hover){.rf-primary:not(:disabled):hover{background:var(--rd-accent-hover)}html[data-theme=dark] .rf-primary:not(:disabled):hover{background:#bcd9b1}}
.rf-primary:disabled{opacity:.45;cursor:not-allowed}
.rf-primary svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.rf-primary:focus-visible,.rf-link:focus-visible,.rf-row button:focus-visible,.rf-done summary:focus-visible,.rf-back:focus-visible,.rf-saved button:focus-visible{outline:2px solid var(--rd-focus);outline-offset:2px}
.rf-help{display:flex;flex-wrap:wrap;gap:0 18px;margin-top:8px}
.rf-link{min-height:44px;padding:0;border:0;background:none;font-size:15px;color:var(--rd-accent);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
/* Done so far: one quiet disclosure */
.rf-done{margin-top:14px;border-radius:14px;background:var(--rd-surface);border:1px solid var(--rd-line)}
.rf-done summary{display:flex;align-items:center;gap:10px;min-height:52px;padding:0 18px;font-size:15px;font-weight:600;color:var(--rd-ink);cursor:pointer;list-style:none}
.rf-done summary::-webkit-details-marker{display:none}
.rf-done summary::after{content:"";margin-left:auto;width:8px;height:8px;border-right:1.6px solid var(--rd-muted);border-bottom:1.6px solid var(--rd-muted);transform:rotate(45deg) translateY(-2px);transition:transform .2s}
.rf-done[open] summary::after{transform:rotate(225deg) translateY(-2px)}
.rf-count{min-width:24px;padding:1px 8px;border-radius:999px;background:var(--rd-soft);font-size:12px;font-weight:600;color:var(--rd-accent);text-align:center}
.rf-done ol{list-style:none;margin:0;padding:0 18px 10px}
.rf-ph{padding:14px 0 4px;font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--rd-muted)}
.rf-row{display:flex;align-items:center;gap:10px;border-top:1px solid var(--rd-line)}
.rf-ph+.rf-row{border-top:0}
.rf-row>button[data-rf-open]{display:flex;align-items:center;gap:10px;flex:1;min-height:46px;padding:6px 0;border:0;background:none;text-align:left;font-size:15px;line-height:1.35;color:var(--rd-text);cursor:pointer}
.rf-tick{flex:none;display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:var(--rd-soft);color:var(--rd-accent)}
.rf-tick svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.rf-ans>span{flex:1;min-width:0;padding:8px 0 8px 30px;font-size:15px;line-height:1.35;color:var(--rd-ink)}
.rf-ans small{display:block;font-size:13.5px;color:var(--rd-muted)}
.rf-tag{display:inline-block;margin-left:8px;padding:1px 7px;border-radius:999px;background:var(--rd-warm);color:var(--rd-warm-ink);font-size:11px;font-weight:600;vertical-align:1px}
/* Coming up: text, not cards */
.rf-later{margin-top:26px;padding:0 2px}
.rf-later h3{margin:0 0 6px;font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--rd-muted)}
.rf-later ol{list-style:none;margin:0;padding:0}
.rf-later li{display:flex;align-items:baseline;gap:14px;padding:11px 0;border-top:1px solid var(--rd-line);font-size:15px;line-height:1.35;color:var(--rd-text)}
.rf-later li:first-child{border-top:0}
.rf-num{flex:none;width:20px;font-size:12px;font-variant-numeric:tabular-nums;color:var(--rd-muted)}
.rf-foot{margin:10px 2px 0}
.rf-legal{margin:6px 2px 0;font-size:13.5px;line-height:1.5;color:var(--rd-muted)}
.rf-back{display:inline-flex;align-items:center;gap:6px;min-height:44px;margin:4px 0 8px;padding:0 4px;border:0;background:none;font:inherit;font-size:15px;font-weight:600;color:var(--rd-accent);cursor:pointer}
.rf-back[hidden]{display:none}
.rf-back svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
@media(min-width:821px){.rf-back{display:none!important}}

/* The step sheet on phones: one header row, calmer type, secondary sections folded */
@media(max-width:820px){
 body.debt-focus #detail .detail-top{display:flex;align-items:center;gap:6px}
 body.debt-focus #detail .detail-top .eyebrow-group{flex:1;min-width:0}
 body.debt-focus #detail .rf-tools{display:flex!important;gap:4px;margin:0!important;padding:0!important;border:0!important}
 body.debt-focus #detail .rf-tools button{width:40px;height:40px;min-height:40px!important;padding:0!important;display:grid!important;place-items:center;border-radius:50%!important;border:1px solid var(--rd-line)!important;background:var(--rd-surface)!important}
 body.debt-focus #detail .rf-tools button>span:not(.tg-mark){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
 body.debt-focus #detail .rf-tools .tg-mark{width:20px!important;height:22px!important;flex-basis:auto!important;background:none!important}
 body.debt-focus #detail .rf-tools .tg-mark img{width:16px!important;height:20px!important}
 body.debt-focus #detail .rf-tools svg{width:18px;height:18px}
 body.debt-focus #detail .reader-meta{display:none!important}
 body.debt-focus #detail h2.detail-title-row,body.debt-focus #detail .detail-title-row{font-size:24px!important;line-height:1.25!important;margin-top:8px!important}
 body.debt-focus #detail .detail-summary{font-size:15.5px!important;line-height:1.55!important;color:var(--rd-text)!important}
 body.debt-focus #detail .debt-reader-check{display:none!important}
 body.debt-focus #detail .rf-fold{margin:0;border-top:1px solid var(--rd-line)}
 body.debt-focus #detail .rf-fold summary{display:flex;align-items:center;min-height:52px;font-size:15px;font-weight:600;color:var(--rd-ink);cursor:pointer;list-style:none}
 body.debt-focus #detail .rf-fold summary::-webkit-details-marker{display:none}
 body.debt-focus #detail .rf-fold summary::after{content:"";margin-left:auto;width:8px;height:8px;border-right:1.6px solid var(--rd-muted);border-bottom:1.6px solid var(--rd-muted);transform:rotate(45deg) translateY(-2px)}
 body.debt-focus #detail .rf-fold[open] summary::after{transform:rotate(225deg) translateY(-2px)}
 body.debt-focus #detail .rf-fold[open]{padding-bottom:14px}
 body.debt-focus #detail .debt-file-output{margin-top:6px}
}

/* ======================================================================
   Step view and route view on phones (themis-focus.js, 30 Sep mock-ups)
   ====================================================================== */
#rfNav[hidden],#rfSlim[hidden],#rfSheet[hidden],#rfLeads[hidden]{display:none!important}
@media(min-width:821px){#rfNav,#rfSlim,#rfSheet,#rfLeads{display:none!important}}
body.rf-on .route-layout{padding-bottom:128px}
/* The switch */
.rf-switch{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;margin:2px 0 4px;padding:4px;border-radius:12px;background:var(--rd-soft);border:1px solid var(--rd-line)}
.rf-switch button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:40px;border:0;border-radius:9px;background:transparent;font:inherit;font-size:14.5px;font-weight:500;color:var(--rd-text);cursor:pointer}
.rf-switch button[aria-pressed=true]{background:var(--rd-surface);color:var(--rd-ink);font-weight:600;box-shadow:0 1px 2px rgba(30,50,30,.14)}
.rf-switch svg,.rf-secondary svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.rf-switch button:focus-visible,.rf-track button:focus-visible,.rf-stage-count:focus-visible,.rf-nav button:focus-visible,.rf-slim:focus-visible,.rf-sp-head:focus-visible,.rf-sp-item button:focus-visible,.rf-sheet button:focus-visible,.rf-secondary:focus-visible{outline:2px solid var(--rd-focus);outline-offset:2px}
/* The stage, across the page */
.rf-stage{margin:14px 2px 12px}
.rf-stage-top{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:32px}
.rf-stage-top>span{font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--rd-muted);min-width:0}
.rf-stage-count{flex:none;display:inline-flex;align-items:center;gap:4px;min-height:32px;padding:0 6px 0 10px;border:1px solid var(--rd-line);border-radius:999px;background:var(--rd-surface);font:inherit;font-size:13px;font-weight:600;color:var(--rd-text);cursor:pointer}
.rf-stage-count svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.rf-track{list-style:none;margin:10px 0 0;padding:0;display:flex;align-items:center}
.rf-track li{flex:1 1 0;display:flex;align-items:center;min-width:0}
.rf-track li:first-child{flex:0 0 auto}
.rf-track li:not(:first-child)::before{content:"";flex:1;height:2px;margin:0 3px;background:var(--rd-line)}
.rf-track li.is-done::before,.rf-track li.is-here::before{background:var(--rd-accent)}
.rf-track button{flex:none;position:relative;display:grid;place-items:center;width:30px;height:30px;padding:0;border:0;background:none;cursor:pointer;color:var(--rd-muted);font:inherit}
.rf-track button::after{content:"";position:absolute;inset:-7px}
.rf-track button:disabled{cursor:default}
.rf-track .is-s button::before{content:"";position:absolute;inset:3px;border-radius:50%;border:1.5px solid var(--rd-line-strong);background:var(--rd-surface)}
.rf-track .is-q button::before{content:"";position:absolute;inset:8px;border-radius:3px;transform:rotate(45deg);border:1.5px solid var(--rd-line-strong);background:var(--rd-surface)}
.rf-track button>*{position:relative}
.rf-track button span{font-size:10px;font-weight:600;color:var(--rd-muted)}
.rf-track .is-done button::before{background:var(--rd-accent);border-color:var(--rd-accent)}
.rf-track .is-done button{color:#fff}
html[data-theme=dark] .rf-track .is-done button{color:#161d14}
.rf-track button svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.rf-track .is-here button::before{border-width:2.5px;border-color:var(--rd-accent);background:var(--rd-surface);inset:0}
.rf-track .is-here.is-q button::before{inset:5px}
.rf-track .is-here button span{font-size:11px;font-weight:700;color:var(--rd-ink)}
.rf-track .is-later button::before{border-style:dashed;opacity:.7}
.rf-track .is-more{flex:0 0 26px}
.rf-track .is-more span{display:block;width:12px;height:2px;margin-left:4px;background:repeating-linear-gradient(90deg,var(--rd-line-strong) 0 3px,transparent 3px 6px)}
.rf-track .is-more::before{display:none}
/* Cards (questions, pause, end) share the calm card */
.rf-card{padding:22px 20px;border:1px solid var(--rd-line);border-radius:18px;background:var(--rd-surface);box-shadow:0 1px 2px rgba(30,50,30,.04)}
.rf-card h2{margin:0;font-size:22px;line-height:1.3;font-weight:600;letter-spacing:-.01em;color:var(--rd-ink);outline:none}
.rf-card .rf-legal{margin-top:10px}
.rf-step-kicker{margin:4px 2px 0}
.rf-kicker .rf-tag{margin-left:8px;letter-spacing:0;text-transform:none}
.rf-saved button{flex:none}
.rf-secondary{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:48px;margin-top:10px;border:1px solid var(--rd-accent);border-radius:14px;background:var(--rd-surface);font:inherit;font-size:15px;font-weight:600;color:var(--rd-accent);cursor:pointer}
/* The step itself, in the page (no pop-up) */
@media(max-width:820px){
 html body.rf-on.rf-reading #detail{display:block!important;position:static!important;inset:auto!important;width:auto!important;height:auto!important;max-height:none!important;margin:6px 16px 0!important;padding:0!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;transform:none!important;overflow:visible!important;opacity:1!important;visibility:visible!important;z-index:auto!important}
 html body.rf-on.rf-reading #detail>.detail-scroll{overflow:visible!important;margin:0!important;padding:0!important;max-height:none!important}
 html body.rf-on #detail>.reader-navigation,html body.rf-on #detail .close-detail{display:none!important}
 html body.rf-on:not(.rf-reading) #detail{display:none!important}
 html body.rf-on.rf-reading #detail .detail-top{justify-content:flex-end;min-height:0;margin:0 0 -30px;position:relative;z-index:1}
 html body.rf-on.rf-reading #detail .detail-title-row{margin-top:0!important;padding-right:92px}
 html body.rf-on .scrim{display:none!important}
 html body.rf-on .route-main{padding-bottom:0}
}
/* Where this leads */
.rf-leads{margin:18px 16px 0;padding:16px;border:1px solid var(--rd-line);border-radius:16px;background:var(--rd-surface)}
.rf-leads h3{margin:0 0 10px;font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--rd-muted)}
.rf-lead{display:flex;align-items:flex-start;gap:12px;padding:8px 0}
.rf-lead+.rf-lead{border-top:1px solid var(--rd-line)}
.rf-lead-mark{flex:none;display:grid;place-items:center;width:28px;height:28px;border-radius:50%;border:1.5px solid var(--rd-line-strong);font-size:10px;font-weight:600;color:var(--rd-muted)}
.rf-lead-stage{border-radius:8px}
.rf-lead>span:last-child{display:flex;flex-direction:column;gap:2px;font-size:15px;font-weight:600;line-height:1.35;color:var(--rd-ink)}
.rf-lead small{font-size:13px;font-weight:400;color:var(--rd-muted)}
.rf-dia{display:block;width:11px;height:11px;border-radius:2px;transform:rotate(45deg);border:1.5px solid currentColor}
/* The footer: where Next goes, always in words */
.rf-nav{position:fixed;left:0;right:0;bottom:0;z-index:70;background:var(--rd-surface);border-top:1px solid var(--rd-line);box-shadow:0 -6px 20px rgba(30,50,30,.06)}
.rf-nav-in{max-width:560px;margin:0 auto;padding:10px 16px calc(14px + env(safe-area-inset-bottom))}
.rf-nav-next{display:block;margin:0 0 8px;font-size:13px;line-height:1.35;color:var(--rd-muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rf-nav-row{display:flex;gap:10px}
.rf-nav .rf-primary{margin:0;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rf-back-btn{flex:none;display:grid;place-items:center;width:50px;height:50px;border:1px solid var(--rd-line);border-radius:14px;background:var(--rd-surface);color:var(--rd-text);cursor:pointer}
.rf-back-btn:disabled{opacity:.4;cursor:default}
.rf-back-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
/* Deep in a step: the slim bar keeps the stage in view */
.rf-slim{position:fixed;left:0;right:0;top:var(--mast-h,64px);z-index:65;display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:8px 16px;border:0;border-bottom:1px solid var(--rd-line);background:var(--rd-soft);text-align:left;font:inherit;color:var(--rd-ink);cursor:pointer;box-shadow:0 4px 14px rgba(30,50,30,.06)}
.rf-slim-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.rf-slim small{font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--rd-muted)}
.rf-slim strong{font-size:14.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rf-slim-dots{flex:none;display:flex;gap:4px;align-items:center}
.rf-slim-dots i{width:6px;height:6px;border-radius:3px;background:var(--rd-line-strong)}
.rf-slim-dots i.is-done{background:var(--rd-accent)}
.rf-slim-dots i.is-here{width:16px;background:var(--rd-accent)}
.rf-slim>svg{flex:none;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
/* This stage at a glance */
.rf-sheet{position:fixed;inset:0;z-index:90}
.rf-sheet-scrim{position:absolute;inset:0;background:rgba(20,35,20,.38)}
.rf-sheet-panel{position:absolute;left:0;right:0;bottom:0;max-height:82vh;overflow:auto;padding:10px 20px calc(22px + env(safe-area-inset-bottom));border-radius:22px 22px 0 0;background:var(--rd-surface);box-shadow:0 -10px 40px rgba(20,40,20,.2)}
.rf-sheet-grip{width:40px;height:5px;margin:0 auto 10px;border-radius:3px;background:var(--rd-line)}
.rf-sheet-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.rf-sheet-head small{display:block;font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--rd-muted)}
.rf-sheet-head h2{margin:2px 0 0;font-size:19px;font-weight:600;color:var(--rd-ink);outline:none}
.rf-icon-btn{flex:none;display:grid;place-items:center;width:44px;height:44px;border:1px solid var(--rd-line);border-radius:50%;background:var(--rd-surface);color:var(--rd-text);cursor:pointer}
.rf-icon-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.rf-sheet-list{list-style:none;margin:12px 0 0;padding:0}
.rf-sheet-list button,.rf-sp-item button{display:flex;align-items:center;gap:12px;width:100%;min-height:50px;padding:6px 10px;border:0;border-radius:12px;background:none;text-align:left;font:inherit;color:var(--rd-ink);cursor:pointer}
.rf-sheet-list button:disabled{cursor:default;color:var(--rd-muted)}
.rf-sheet-list .is-here button,.rf-sp-item.is-here button{background:var(--rd-soft)}
.rf-sheet-next{margin:12px 0 0;padding-top:12px;border-top:1px solid var(--rd-line);font-size:14px;color:var(--rd-muted)}
.rf-sp-mark{flex:none;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;border:1.5px solid var(--rd-line-strong);background:var(--rd-surface);color:var(--rd-muted)}
.rf-sp-mark svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.is-done>button>.rf-sp-mark{background:var(--rd-accent);border-color:var(--rd-accent);color:#fff}
html[data-theme=dark] .is-done>button>.rf-sp-mark{color:#161d14}
.is-here>button>.rf-sp-mark{border:2.5px solid var(--rd-accent)}
.is-q>button>.rf-sp-mark{border:0;background:none;color:var(--rd-accent)}
.is-q.is-done>button>.rf-sp-mark .rf-dia{background:var(--rd-accent)}
.is-later>button>.rf-sp-mark{border-style:dashed}
.rf-sp-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.rf-sp-text strong{font-size:15px;font-weight:500;line-height:1.35}
.is-here .rf-sp-text strong{font-weight:600}
.rf-sp-text small{font-size:13px;color:var(--rd-muted)}
.rf-here{display:inline-block;margin-left:8px;padding:2px 8px;border-radius:999px;background:var(--rd-accent);color:#fff;font-size:11px;font-weight:600;vertical-align:1px;white-space:nowrap}
html[data-theme=dark] .rf-here{color:#161d14}
.rf-sheet-list .rf-here{margin-left:auto;background:none;color:var(--rd-accent);padding:0}
/* Whole route: the spine */
.rf-sp-sum{margin:12px 2px 10px;font-size:13px;color:var(--rd-muted);outline:none}
.rf-spine{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.rf-sp-stage{border:1px solid var(--rd-line);border-radius:16px;background:var(--rd-surface)}
.rf-sp-stage.is-later{background:transparent;border-style:dashed}
.rf-sp-head{display:flex;align-items:center;gap:12px;width:100%;min-height:58px;padding:8px 14px;border:0;background:none;text-align:left;font:inherit;color:var(--rd-ink);cursor:pointer}
div.rf-sp-head{cursor:default}
.rf-sp-head>svg{flex:none;width:16px;height:16px;fill:none;stroke:var(--rd-muted);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .2s}
.rf-sp-head[aria-expanded=true]>svg{transform:rotate(180deg)}
.rf-sp-num{flex:none;display:grid;place-items:center;width:28px;height:28px;border-radius:8px;border:1.5px solid var(--rd-line-strong);font-size:11px;font-weight:600;color:var(--rd-muted)}
.rf-sp-num.is-cur{background:var(--rd-accent);border-color:var(--rd-accent);color:#fff}
.rf-sp-num.is-done{background:var(--rd-soft);border-color:var(--rd-accent);color:var(--rd-accent)}
html[data-theme=dark] .rf-sp-num.is-cur{color:#161d14}
.rf-sp-num svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.rf-sp-name{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.rf-sp-name strong{font-size:15.5px;font-weight:600;line-height:1.3}
.is-later .rf-sp-name strong{font-weight:500;color:var(--rd-text)}
.rf-sp-name small{font-size:13px;color:var(--rd-muted)}
.rf-sp-items{list-style:none;margin:0;padding:0 8px 10px;position:relative}
.rf-sp-items::before{content:"";position:absolute;left:29px;top:8px;bottom:22px;width:2px;background:var(--rd-line)}
.rf-sp-item{position:relative}
.rf-sp-item.is-stop .rf-sp-mark{border-color:var(--rd-warm-ink);background:var(--rd-warm)}

@media(max-width:820px){
 html body.rf-on.rf-reading #detail{position:relative!important}
 html body.rf-on.rf-reading #detail .detail-top{position:static!important;display:flex!important;align-items:center;justify-content:space-between;margin:0 0 4px!important;padding:0!important;border:0!important}
 html body.rf-on.rf-reading #detail .detail-top .eyebrow-group{display:block!important}
 html body.rf-on.rf-reading #detail .detail-top .eyebrow{font-size:12px!important;font-weight:600!important;letter-spacing:.06em!important;text-transform:uppercase;color:var(--rd-accent)!important}
 html body.rf-on.rf-reading #detail .detail-title-row,html body.rf-on.rf-reading #detail h2.detail-title-row{font-size:24px!important;line-height:1.28!important;color:var(--rd-ink)!important;letter-spacing:-.01em!important;padding-right:0!important;margin-top:6px!important}
 html body.rf-on.rf-reading #detail .reader-tabs{position:static!important;background:transparent!important;box-shadow:none!important}
 html body.rf-on.rf-reading .rf-step-kicker{min-height:40px;display:flex;align-items:center;margin:0 2px}
}
/* The primary buttons keep their colour in every state (generic button hover and disabled rules were bleaching them) */
.route-focus .rf-primary,.rf-nav .rf-primary,.rf-sheet .rf-primary{background:var(--rd-accent)!important;color:#fff!important;border:0!important;opacity:1}
html[data-theme=dark] .route-focus .rf-primary,html[data-theme=dark] .rf-nav .rf-primary{color:#161d14!important}
@media(hover:hover){.route-focus .rf-primary:not(:disabled):hover,.rf-nav .rf-primary:not(:disabled):hover{background:var(--rd-accent-hover)!important}html[data-theme=dark] .route-focus .rf-primary:not(:disabled):hover,html[data-theme=dark] .rf-nav .rf-primary:not(:disabled):hover{background:#bcd9b1!important}}
.route-focus .rf-primary:disabled,.rf-nav .rf-primary:disabled{background:var(--rd-line)!important;color:var(--rd-muted)!important;opacity:1!important;cursor:not-allowed}
.rf-back-btn,.rf-back-btn:hover{background:var(--rd-surface)!important}
.rf-switch button:not([aria-pressed=true]):hover{background:rgba(255,255,255,.4)}
html[data-theme=dark] .rf-switch button:not([aria-pressed=true]):hover{background:rgba(255,255,255,.06)}
html[data-theme=dark] .route-focus .rf-primary:disabled,html[data-theme=dark] .rf-nav .rf-primary:disabled{color:var(--rd-text)!important}

/* Phones, debt route: Save and the view switch are single icons beside More (1 Oct 2026). */
.rf-view-toggle{display:none}
@media (max-width:820px){
 html body.themis-workspace.rf-on .rail-intro>#saveRoute.rf-icon-save{width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important;padding:0!important;gap:0!important;border-radius:50%!important;justify-content:center!important}
 html body.themis-workspace.rf-on .rail-intro>#saveRoute.rf-icon-save span{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important}
 html body.themis-workspace.rf-on .rail-intro>#saveRoute.rf-icon-save svg{width:17px!important;height:17px!important}
 body.rf-on .rail-intro>.rf-view-toggle:not([hidden]){display:inline-grid;place-items:center;flex:none;align-self:center;width:40px;height:40px;margin:0;padding:0;border:1px solid var(--rd-line);border-radius:50%;background:var(--rd-surface);color:var(--rd-ink);cursor:pointer}
 body.rf-on .rail-intro>.rf-view-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
 body.rf-on .rail-intro>.rf-view-toggle:focus-visible{outline:2px solid var(--rd-focus);outline-offset:2px}
 body.rf-on .rail-intro .router-more-btn{width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important}
}
@media (max-width:820px) and (hover:hover){body.rf-on .rail-intro>.rf-view-toggle:hover{border-color:#8fae70;background:var(--rd-soft)}}
@media (max-width:820px){
 html body.themis-workspace.rf-on .rail-intro{column-gap:8px!important}
 html body.themis-workspace.rf-on .rail-intro #matterSubtitle{white-space:normal!important;overflow:visible!important;text-overflow:clip!important}
}
/* Footer: short label for the terms on phones */
.footer-links .fl-short{display:none}
@media (max-width:820px){.footer-links .fl-long{display:none}.footer-links .fl-short{display:inline}}

/* Route view you can work in (1 Oct 2026): descriptions, rules, answers in place, the item you are on opened as a card. */
.rf-sp-item>button{align-items:flex-start!important;padding-top:10px!important;padding-bottom:10px!important}
.rf-sp-item>button>.rf-sp-mark{margin-top:1px}
.rf-sp-no{display:inline-block;min-width:28px;margin-right:6px;font-size:12.5px;font-weight:600;color:var(--rd-muted);font-variant-numeric:tabular-nums}
.rf-sp-desc{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:13.5px;line-height:1.45;color:var(--rd-text);margin-top:2px}
.is-card .rf-sp-desc{-webkit-line-clamp:unset;display:block;font-size:14.5px;line-height:1.55}
.rf-rule{align-self:flex-start;display:inline-block;margin-top:6px;padding:2px 8px;border-radius:6px;background:var(--rd-soft);border:1px solid var(--rd-line);font-size:12px;font-weight:500;line-height:1.5;color:var(--rd-accent)}
.rf-sp-kick{font-size:12.5px!important;color:var(--rd-muted)!important}
.rf-sp-change{flex:none;align-self:center;font-size:13px;font-weight:600;color:var(--rd-accent);text-decoration:underline;text-underline-offset:3px}
.rf-sp-item.is-card{display:flex;gap:12px;align-items:flex-start;margin:4px 0;padding:14px 12px;border-radius:14px;background:var(--rd-soft);border:1px solid var(--rd-line)}
.rf-sp-item.is-card>.rf-sp-mark{margin-top:2px;border:2.5px solid var(--rd-accent);position:relative;z-index:1}
.rf-sp-item.is-card.is-q>.rf-sp-mark{border:0;background:none;color:var(--rd-accent)}
.rf-sp-item.is-card.is-end>.rf-sp-mark{background:var(--rd-accent);color:#fff}
html[data-theme=dark] .rf-sp-item.is-card.is-end>.rf-sp-mark{color:#161d14}
.rf-sp-body{flex:1;min-width:0;display:flex;flex-direction:column}
.rf-sp-body .rf-kicker{margin:0 0 4px;display:flex;align-items:center;flex-wrap:wrap;gap:6px}
.rf-sp-body .rf-kicker .rf-here{margin-left:0}
.rf-sp-body h3{margin:0 0 6px;font-size:17px;line-height:1.35;font-weight:600;color:var(--rd-ink);outline:none}
.rf-sp-body .rf-read{margin-top:12px;min-height:44px;font-size:14.5px}
.rf-read-note{margin-top:6px;text-align:center;font-size:12.5px;color:var(--rd-muted)}
.rf-sp-body .rf-card.rf-inline{margin:0;padding:0;border:0;background:none;box-shadow:none}
.rf-sp-body .rf-card.rf-inline .rf-opt{background:var(--rd-surface)}
.rf-sp-legal{margin:14px 4px 8px}
.rf-backlink{display:inline-flex;align-items:center;gap:6px;margin:4px 0 6px;padding:6px 2px;min-height:40px;border:0;background:none;font:inherit;font-size:14px;font-weight:600;color:var(--rd-accent);cursor:pointer}
.rf-backlink svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.rf-backlink:focus-visible{outline:2px solid var(--rd-focus);outline-offset:2px;border-radius:8px}
.rf-sp-items::before{bottom:28px}
html body .route-focus .rf-secondary,html body .rf-sheet .rf-secondary{border:1px solid var(--rd-accent)!important;background:var(--rd-surface)!important;color:var(--rd-accent)!important;border-radius:14px!important;font-weight:600!important}
@media (hover:hover){html body .route-focus .rf-secondary:hover,html body .rf-sheet .rf-secondary:hover{background:var(--rd-soft)!important}}
.route-focus>.rf-backlink+.rf-saved,.route-focus>.rf-backlink+.rf-stage{margin-top:0}
@media (max-width:820px){
 html body.themis-workspace .footer .footer-links{gap:2px 14px!important}
}
@media (max-width:374px){html body.themis-workspace .footer .footer-links{gap:2px 10px!important}}
/* Whole route, calmer (1 Oct 2026): one line per item; only the item you are on shows its description and rule. */
.rf-sp-no{min-width:0;margin-right:8px}
.rf-rule{margin-top:4px;padding:0;border:0;background:none;border-radius:0;font-size:12.5px;font-weight:500;color:var(--rd-muted)}
.rf-sp-item.is-here>button .rf-sp-desc{-webkit-line-clamp:3}
.rf-sp-item:not(.is-here)>button{min-height:44px;padding-top:7px!important;padding-bottom:7px!important}
.rf-sp-change{font-size:12.5px;font-weight:500;color:var(--rd-muted);text-decoration:none}
