/* Themis: styles for the 29 September fixes (themis-fixes.js, themis-search.js, start screen, debt route). */

/* Start screen: due this week, and the way back to the route */
.start-due{margin-top:26px;padding:16px 18px;border:1px solid #e3b870;border-radius:14px;background:#fffaf0}
.start-due h2{margin:0 0 8px;font-size:13px;font-weight:650;letter-spacing:.08em;text-transform:uppercase;color:#7a4b10}
.start-due ul{list-style:none;margin:0 0 8px;padding:0;display:grid;gap:8px}
.start-due li{display:flex;gap:14px;align-items:baseline}
.start-due-when{flex:none;min-width:92px;font-size:13px;font-weight:650;color:#7a4b10}
.start-due li.late .start-due-when{color:#a3311f}
.start-resume{display:flex;align-items:center;gap:14px;width:100%;margin-top:18px;padding:14px 18px;border:1px dashed #9fbb86;border-radius:14px;background:transparent;color:#243f2a}
.start-resume>span{flex:none;font-size:13px;font-weight:600;color:#4f6b3f}
.start-resume>strong{flex:1;font-size:15px}
html[data-theme=dark] .start-due{background:#2f2616;border-color:#8a6526}
html[data-theme=dark] :is(.start-due h2,.start-due-when){color:#f3d79f}
html[data-theme=dark] .start-due li.late .start-due-when{color:#ffb4a6}
html[data-theme=dark] .start-resume{border-color:var(--d-accent-line);color:var(--d-text)}
html[data-theme=dark] .start-resume>span{color:var(--d-accent)}

/* Route: read-ahead preview of later phases */
.debt-preview-toggle .debt-phase-state{color:#4f6b3f!important;font-weight:600}
.debt-previewing{opacity:1!important}
.debt-preview-note{list-style:none;margin:4px 0 8px;padding:8px 12px;border-radius:10px;background:#f3f6ee;font-size:13px;line-height:1.45;color:#4a6043}
.debt-preview-step .stage-hit{opacity:.78;border-style:dashed!important}
.debt-preview-step .stage-hit:hover{opacity:1}
.debt-preview-step .step-no{background:transparent!important;border:1px dashed #9fbb86!important;color:#4f6b3f!important}
html[data-theme=dark] .debt-preview-note{background:var(--d-surface);color:var(--d-text2)}
html[data-theme=dark] .debt-preview-toggle .debt-phase-state{color:var(--d-accent)!important}
html[data-theme=dark] .debt-preview-step .step-no{border-color:var(--d-accent-line)!important;color:var(--d-accent)!important}

/* Checkpoints: assumed answers and the reminder that this is not advice */
.debt-assumed{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:999px;background:#fbeed7;color:#7a4b10;font-size:11px;font-weight:650;letter-spacing:.02em;text-transform:none;vertical-align:1px}
.debt-choice-legal{margin:6px 0 0;font-size:12.5px;line-height:1.45;color:#596e50}
html[data-theme=dark] .debt-assumed{background:#4a3a1d;color:#f3d79f}
html[data-theme=dark] .debt-choice-legal{color:var(--d-text3)}

/* Reader header: honest review status, copy link, back after a search */
.reader-meta #readerReview.review-checked{color:#3f5a31;text-decoration-color:#9fbb86}
.copy-step-link{display:inline-flex;align-items:center;gap:6px;margin-left:auto;padding:4px 10px;border:1px solid #d7e2cb;border-radius:999px;background:#fff;color:#4f6b3f;font:inherit;font-size:12.5px;font-weight:600;cursor:pointer}
.copy-step-link svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round}
.copy-step-link:hover{border-color:#8fae70}
.back-to-step{display:inline-flex;margin:0 0 10px;padding:6px 12px;border:1px solid #cfdcc3;border-radius:999px;background:#f3f6ee;color:#3f5a31;font:inherit;font-size:13px;font-weight:600;cursor:pointer;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html[data-theme=dark] :is(.copy-step-link,.back-to-step){background:var(--d-surface);border-color:var(--d-line2);color:var(--d-accent)}
html[data-theme=dark] .reader-meta #readerReview.review-checked{color:var(--d-accent)}

/* Toolbar: New matter */
#newMatter{display:inline-flex;align-items:center;align-self:center;gap:6px;height:32px;margin:0;padding:0 12px;line-height:1;border:1px solid #cfdcc3;border-radius:999px;background:#fff;color:#3f5a31;font:inherit;font-size:13.5px;font-weight:600;cursor:pointer}
#newMatter svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
#newMatter:hover{border-color:#8fae70}
html[data-theme=dark] #newMatter{background:var(--d-surface);border-color:var(--d-line2);color:var(--d-accent)}
@media(max-width:820px){#newMatter span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}#newMatter{width:32px;padding:0;justify-content:center}}

/* Matters: backup and restore */
.matters-backup{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 24px;margin:0 0 18px;padding:14px 18px;border:1px solid #e3b870;border-radius:14px;background:#fffaf0}
.matters-backup strong{display:block;color:#243f2a}
.matters-backup p{margin:4px 0 0;font-size:13.5px;color:#4a6043;max-width:560px}
.matters-backup-tools{display:flex;flex-wrap:wrap;gap:10px}
.matters-backup-tools button,.matters-restore{display:inline-flex;align-items:center;padding:8px 14px;border:1px solid #cfdcc3;border-radius:10px;background:#fff;color:#3f5a31;font:inherit;font-size:13.5px;font-weight:600;cursor:pointer}
.matters-restore input{position:absolute;width:1px;height:1px;opacity:0}
.matters-restore:focus-within{outline:2px solid #4f6b3f;outline-offset:2px}
html[data-theme=dark] .matters-backup{background:#2f2616;border-color:#8a6526}
html[data-theme=dark] .matters-backup strong{color:var(--d-text)}
html[data-theme=dark] .matters-backup p{color:var(--d-text2)}
html[data-theme=dark] :is(.matters-backup-tools button,.matters-restore){background:var(--d-surface);border-color:var(--d-line2);color:var(--d-accent)}

/* Ask Themis: step links */
.tg-step-links{display:grid;gap:8px;margin-top:10px}
.tg-step-link{display:block;width:100%;padding:10px 12px;border:1px solid #d7e2cb;border-radius:10px;background:#fff;color:#243f2a;font:inherit;font-weight:600;text-align:left;cursor:pointer}
.tg-step-link small{display:block;margin-top:2px;font-weight:400;font-size:12.5px;color:#596e50}
html[data-theme=dark] .tg-step-link{background:var(--d-surface);border-color:var(--d-line2);color:var(--d-text)}
html[data-theme=dark] .tg-step-link small{color:var(--d-text3)}

/* Worked example: the way out */
.leave-example{margin-top:12px;padding:8px 14px;border:1px solid #cfdcc3;border-radius:10px;background:#fff;color:#3f5a31;font:inherit;font-size:13.5px;font-weight:600;cursor:pointer}
html[data-theme=dark] .leave-example{background:var(--d-surface);border-color:var(--d-line2);color:var(--d-accent)}

/* Guided setup: visible choices instead of dropdowns, and a message when something is missing */
.intake-radios{border:0;margin:0 0 16px;padding:0}
.intake-radios legend{margin-bottom:8px;font-weight:600}
.intake-radio{display:flex;align-items:center;gap:10px;margin:0 0 6px;padding:10px 12px;border:1px solid #d7e2cb;border-radius:10px;background:#fff;cursor:pointer}
.intake-radio:has(input:checked){border-color:#4f6b3f;box-shadow:0 0 0 1px #4f6b3f}
.intake-radio input{accent-color:#4f6b3f;width:18px;height:18px;margin:0}
.intake-error{margin:6px 0 0;font-size:13px;font-weight:600;color:#a3311f}
.intake-error:empty{display:none}
.intake-missing .intake-radio{border-color:#e0a397}
html[data-theme=dark] .intake-radio{background:var(--d-surface);border-color:var(--d-line2)}
html[data-theme=dark] .intake-radio:has(input:checked){border-color:var(--d-accent);box-shadow:0 0 0 1px var(--d-accent)}
html[data-theme=dark] .intake-error{color:#ffb4a6}

/* Search: steps on your route stand out */
.search-results .result-on-route{border-left:3px solid #4f6b3f}
html[data-theme=dark] .search-results .result-on-route{border-left-color:var(--d-accent)}

/* The floating Ask Themis button no longer covers the reading text */
@media(min-width:821px){
 body.themis-workspace #detail{padding-bottom:88px}
 #wakeThemis>span:not(.tg-mark){position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
 #wakeThemis{width:52px;height:52px;padding:0!important;justify-content:center;border-radius:50%!important}
}
.search-results .result-cta{display:block;width:100%;margin-bottom:8px;border:1px solid #e3b870!important;background:#fffaf0!important}
.search-results .result-cta b{color:#7a4b10}
html[data-theme=dark] .search-results .result-cta{background:#2f2616!important;border-color:#8a6526!important}
html[data-theme=dark] .search-results .result-cta b{color:#f3d79f}
.workspace-toolbar #newMatter{height:32px!important;min-height:0!important;padding:0 12px!important;border:1px solid #cfdcc3!important;border-radius:999px!important;background:#fff!important;color:#3f5a31!important;box-shadow:none!important}
@media(max-width:820px){.workspace-toolbar #newMatter{width:32px!important;padding:0!important}}
html[data-theme=dark] .workspace-toolbar #newMatter{background:var(--d-surface)!important;border-color:var(--d-line2)!important;color:var(--d-accent)!important}
.switch-side{display:block;margin:6px 0 0;padding:0;border:0;background:none;color:#4f6b3f;font:inherit;font-size:13px;font-weight:600;text-decoration:underline;text-decoration-color:#9fbb86;text-underline-offset:3px;cursor:pointer}
html[data-theme=dark] .switch-side{color:var(--d-accent)}
.help-list{margin:14px 0 0;padding-left:20px;display:grid;gap:10px;line-height:1.5}
.help-list strong{display:block}
.help-note{margin-top:14px;font-size:13.5px;color:#596e50}
html[data-theme=dark] .help-note{color:var(--d-text3)}
/* Contrast: phases that can now be opened as a preview are real controls */
#rail .debt-phase.debt-locked .debt-preview-toggle strong{color:#4a6043!important}
#rail .debt-phase.debt-locked .debt-preview-toggle strong small{color:#596e50!important}
html[data-theme=dark] #rail .debt-phase.debt-locked .debt-preview-toggle strong{color:var(--d-text2)!important}
html[data-theme=dark] #rail .debt-phase.debt-locked .debt-preview-toggle strong small{color:var(--d-text2)!important}
#rail .debt-choice p.debt-choice-legal{color:#596e50!important}
html[data-theme=dark] #rail .debt-choice p.debt-choice-legal{color:var(--d-text3)!important}
.reader-meta #readerReview:not(.review-checked){color:#6f5a24!important}
html[data-theme=dark] .reader-meta #readerReview:not(.review-checked){color:#e6c98a!important}
html[data-theme=dark] .rail-intro .debt-rail-action,html[data-theme=dark] .rail-intro .debt-rail-action span{color:var(--d-accent)!important}
html:not([data-theme=dark]) .wsx-eyebrow{color:#4f6b3f!important}
html:not([data-theme=dark]) :is(.wsx-head p,.wsx-empty){color:#596e50!important}
html:not([data-theme=dark]) .wsx-btn.primary{background:#4f6b3f!important;border-color:#4f6b3f!important;color:#fff!important}
