:root{--page:#081320;--surface:#102132;--field:#091725;--ink:#f0f6fd;--muted:#b9cadd;--line:#486178;--accent:#69dbe9;--active:#8be2a2;color-scheme:dark}
:root[data-theme=light]{--page:#edf2f7;--surface:#fff;--field:#f5f7fb;--ink:#122439;--muted:#40556b;--line:#70879c;--accent:#006878;--active:#116b33;color-scheme:light}
:root[data-theme=contrast]{--page:#000;--surface:#090909;--field:#000;--ink:#fff;--muted:#e5e5e5;--line:#fff;--accent:#ffe34a;--active:#6aff9a;color-scheme:dark}
:root[data-accent=blue]{--accent:#94bcff}:root[data-accent=purple]{--accent:#d2b1ff}:root[data-accent=gold]{--accent:#f5ce83}
:root[data-theme=light][data-accent=blue]{--accent:#164cb0}:root[data-theme=light][data-accent=purple]{--accent:#7325a8}:root[data-theme=light][data-accent=gold]{--accent:#765200}
html,body{background:var(--page)!important;color:var(--ink)!important}
#swlor-build-calculator{background:var(--page)!important;color:var(--ink)!important}
#swlor-build-calculator .sw-heading,#swlor-build-calculator .sw-data-strip,#swlor-build-calculator .sw-code-toolbar{color:var(--ink)!important;background:var(--page)!important}
#swlor-build-calculator :is(.sw-stat,.sw-card,.sw-choice-card,.sw-saved-card,.sw-helper,.sw-change-card,.sw-current-controls,.nav-pills,.sw-summary-sheet,.sw-code-panel,.sw-share-panel),.panel,.card,dialog{background:var(--surface)!important;border-color:var(--line)!important;color:var(--ink)!important}
#swlor-build-calculator :is(h1,h2,h3,h4,strong,.form-label,.sw-stat-value,.sw-stat-label,.sw-stat-note,.text-muted,.text-small),.muted{color:var(--ink)!important}
#swlor-build-calculator .text-muted,.muted{color:var(--muted)!important}
#swlor-build-calculator :is(input,select,textarea,option,optgroup),input,select,textarea,option{background:var(--field)!important;color:var(--ink)!important;border-color:var(--line)!important;color-scheme:inherit}
#swlor-build-calculator :is(.btn,.nav-link),button,.button{background:var(--surface)!important;color:var(--accent)!important;border-color:var(--line)!important}
a{color:var(--accent)!important}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid var(--accent);outline-offset:3px}
#swlor-build-calculator .sw-choice-card[data-current-state=active]{border:2px solid var(--active)!important}
#swlor-build-calculator .sw-choice-card[data-current-state=planned]{border:1px solid var(--line)!important}
#swlor-build-calculator .sw-state-active{color:var(--active)!important}
.sw-sticky{position:sticky;top:0;z-index:30;background:var(--page);border-bottom:1px solid var(--line);padding-bottom:6px}
#swlor-sticky-status{display:flex;flex-wrap:wrap;gap:12px;padding:6px 12px;font-size:13px}#swlor-sticky-status details{color:#ffbd9d}#swlor-sticky-status details[open]{max-height:25vh;overflow:auto}
.theme-picker{position:relative}.theme-picker summary{list-style:none;cursor:pointer}.theme-options{position:absolute;right:0;top:100%;z-index:45;min-width:210px;padding:16px;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 30px #0005}.theme-options label{display:block;margin:8px 0}.theme-options select{display:block;width:100%;padding:8px}
#swlor-home-frame{width:100%;border:0;min-height:350px;display:block}#swlor-home-frame[hidden]{display:none}#swlor-help-dialog{width:min(840px,90vw);max-height:85vh;overflow:auto;padding:24px;border-radius:14px}#swlor-help-dialog p,#swlor-help-dialog li{line-height:1.6}
body.embedded{padding:0!important}body.embedded>header,body.embedded>footer{display:none}body.embedded main{max-width:none;margin:0;padding:0}body.embedded .panel{margin-bottom:12px}
@media(max-width:600px){.sw-sticky .nav-pills{gap:0!important;padding:3px!important}.sw-sticky .nav-link{padding:7px!important;font-size:12px!important}.sw-sticky svg{display:none}#swlor-sticky-status{font-size:11px}.theme-options{right:0}.sw-code-toolbar{flex-wrap:wrap}#swlor-edit-character{max-width:100%}}
@media print{.sw-sticky,.theme-picker{position:static}.theme-picker,#swlor-sticky-status{display:none}}

:root[data-theme=light] #swlor-sticky-status details{color:#92340b}
#swlor-build-calculator .nav-link.active{border:2px solid var(--accent)!important;font-weight:700}
#swlor-build-calculator .btn-primary,.primary{border:2px solid var(--accent)!important;font-weight:700}
.sw-build-toolbar{gap:10px;flex-wrap:wrap}.sw-build-toolbar>label{min-width:180px;flex:1}
.sw-theme-picker{position:relative}.sw-theme-picker[open]{padding:12px;border:1px solid var(--line);background:var(--surface);max-width:320px}

/* Keep child margins inside the body measured by the embedded Home resize bridge. */
body.embedded{min-height:0!important;display:flow-root}
:root{--foreground:var(--ink);--muted-foreground:var(--muted);--background:var(--page);--border:var(--line);--primary:var(--accent);--primary-foreground:var(--page)}
#swlor-build-calculator :is(.sw-panel,.sw-mastery-shell,details,.sw-build-toolbar,.sw-identity,.sw-feat-balance,.sw-focus,.sw-privacy,.sw-request-card,.sw-timeline-step,.sw-timeline-rank,.sw-node,.sw-operator,.sw-condition,.sw-detail,.sw-requirement-path,.sw-change-type,.sw-summary-stat,.sw-summary-field,.sw-summary-feat,.sw-summary-mastery,.sw-summary-empty,.sw-summary-notice,.sw-grant-detail-list,.sw-staff-ticket){background:var(--surface)!important;color:var(--ink)!important;border-color:var(--line)!important}
#swlor-build-calculator :is(input,select,textarea,option,optgroup){color-scheme:inherit!important;background-color:var(--field)!important}
#swlor-build-calculator #swlor-feat-counts{background:var(--surface)!important;color:var(--ink)!important}
:root[data-theme=light] #swlor-build-calculator .sw-state-planned{background:#e5ebf4;color:var(--ink)}
:root[data-theme=light] #swlor-build-calculator .sw-state-active{background:#e1f3e7;color:var(--active)}
:root[data-theme=light] #swlor-build-calculator :is(.sw-build-issues,.sw-warning,.text-destructive,.text-warning){background:#fff2ec!important;color:#92340b!important}
@media print{#swlor-build-calculator :is(.sw-summary-sheet,.sw-summary-field,.sw-summary-feat,.sw-summary-stat,.sw-summary-mastery){background:#fff!important;color:#122439!important}}

body.embedded dialog{position:fixed;top:16px;bottom:auto;left:12px;right:12px;margin:0 auto;width:min(620px,calc(100% - 24px));max-height:min(600px,calc(100vh - 32px));overflow:auto}
#swlor-home-frame{scroll-margin-top:180px}

.sw-rule-sources,.sw-preparation,.sw-announcement{padding:12px;border:1px solid var(--line);border-radius:10px;margin:10px 0;background:var(--surface);color:var(--ink)}
.sw-rule-sources a{margin-right:8px}.sw-rule-sources p{font-size:.8rem;margin:6px 0}.sw-community-tools{display:flex;flex-wrap:wrap;gap:8px;padding:14px 0}#sw-community-announcements{max-width:100%}.sw-announcement p{white-space:pre-wrap}.sw-preparation li{margin:6px 0}.sw-switch-dialog form label{display:block;margin:10px 0}.sw-switch-dialog input:not([type=checkbox]),.sw-switch-dialog select,.sw-switch-dialog textarea{display:block;width:100%;box-sizing:border-box}
.sw-rule-sources .sw-source-current{margin-top:4px}.sw-rule-sources .sw-source-versions{margin:6px 0 0;padding:0;border:0;background:transparent}.sw-rule-sources .sw-source-versions>summary{padding:0;font-size:inherit}.sw-rule-sources .sw-source-versions ul{margin:6px 0;padding-left:20px}.sw-rule-sources .sw-source-versions li{margin:4px 0}.sw-rule-sources a{overflow-wrap:anywhere}

.sw-account-bar{display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:10px;padding:12px 0;border-bottom:1px solid var(--line);margin-bottom:12px}.sw-account-bar form{margin:0}.sw-account-bar a{font-size:13px}@media(max-width:600px){.sw-account-bar{justify-content:flex-start}.sw-account-bar .btn{padding:7px 10px}}
@media print{.sw-account-bar{display:none}}

/* Retirement review: compact source context and distinct successor proposal. */
.sw-retirement{padding:20px;border:1px solid var(--line);border-radius:16px}.sw-retirement label,.sw-retirement-dialog label{display:block;margin:14px 0}.sw-retirement input:not([type=checkbox]),.sw-retirement select,.sw-retirement textarea,.sw-retirement-dialog input:not([type=checkbox]),.sw-retirement-dialog select,.sw-retirement-dialog textarea{display:block;width:100%;box-sizing:border-box;padding:10px;border:1px solid var(--line);border-radius:8px;margin-top:6px}.sw-retirement textarea{min-height:90px}.sw-retirement .actions{display:flex;flex-wrap:wrap;gap:8px}.sw-retirement-compare{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:16px}.sw-retirement-compare .card{min-width:0;padding:18px;border:1px solid var(--line);border-radius:14px}.sw-retirement-fyi{border-left:3px solid var(--accent);padding:10px 14px;background:var(--field);border-radius:6px}.sw-retirement-dialog{width:min(620px,calc(100vw - 28px));max-height:85vh;overflow:auto;padding:20px}#retirement-staff-queue summary{overflow-wrap:anywhere}#retirement-staff-queue .card{overflow-wrap:anywhere}.sw-retirement [data-retirement-history]{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}.sw-retirement [data-retirement-history] h3{width:100%}@media(max-width:700px){.sw-retirement-compare{grid-template-columns:1fr}.sw-retirement{padding:12px}.sw-retirement-dialog{margin:auto}}
/* Theme selector is a peer of Share / Load code, without an extra frame. */
.theme-picker{border:0!important;padding:0!important;background:transparent!important}.theme-picker>summary{padding:8px 12px!important;min-height:38px;border:1px solid var(--line)!important;border-radius:8px}.theme-picker[open]{max-width:none!important;padding:0!important}
#swlor-home-frame{scroll-margin-top:140px}

/* Shared catalogue choices: markers remain legible where the OS uses its own
   native popup, while supported native menus also share the summary palette. */
:root{--sw-choice-mentored:#94bcff;--sw-choice-rare:#d2b1ff;--sw-choice-both:#e6af6c}
:root[data-theme=light]{--sw-choice-mentored:#164cb0;--sw-choice-rare:#7325a8;--sw-choice-both:#885007}
:root[data-theme=contrast]{--sw-choice-mentored:#a9d3ff;--sw-choice-rare:#e5c5ff;--sw-choice-both:#ffe34a}
#swlor-build-calculator select option[data-restriction=mentored],select option[data-restriction=mentored]{color:var(--sw-choice-mentored)!important}
#swlor-build-calculator select option[data-restriction=rare],select option[data-restriction=rare]{color:var(--sw-choice-rare)!important}
#swlor-build-calculator select option[data-restriction=both],select option[data-restriction=both]{color:var(--sw-choice-both)!important}
#swlor-build-calculator select option[data-restriction],select option[data-restriction]{font-weight:600}
