/* Shared appearance only. No sizing, calculation or difficulty-palette changes. */
html[data-hjl-theme="dark"] {
  --hjl-bg:#000; --hjl-panel:#151b1e; --hjl-control:#20292d;
  --hjl-text:#edf3f0; --hjl-muted:#b7c5c0; --hjl-line:#465650;
  --hjl-accent:#85ddbe; --hjl-selected:#163128; --hjl-hover:#2b383b;
  --hjl-warning-bg:#302818; --hjl-warning:#f0d398;
  --hjl-error-bg:#2b1b22; --hjl-error:#ffb4bd; --hjl-scheme:dark;
}
html[data-hjl-theme="light"] {
  --hjl-bg:#fff; --hjl-panel:#f4f7f6; --hjl-control:#fff;
  --hjl-text:#18342f; --hjl-muted:#4c655c; --hjl-line:#9eb5ac;
  --hjl-accent:#14634f; --hjl-selected:#e0f2e9; --hjl-hover:#e8efec;
  --hjl-warning-bg:#fff5de; --hjl-warning:#745014;
  --hjl-error-bg:#fff0f0; --hjl-error:#982c3c; --hjl-scheme:light;
}
html[data-hjl-theme] body:is(.hjl-boss-app,.hjl-liberation-app,.hjl-pb-app,.hjl-pulse-app,.hjl-ied-app,.hjl-eff-app,.hjl-hexa-app,.hjl-afk-app) {
  background:var(--hjl-bg); color:var(--hjl-text); color-scheme:var(--hjl-scheme);
}
html[data-hjl-theme] :is(.boss-board,.hjl-liberation,[data-personal-burning],[data-pulse-calculator],[data-ied-app],[data-eff-app],[data-hexa-calculator],[data-afk-calculator],.hjl-crystal,.hjl-arc,.hjl-aut,.hjl-epic,.hjl-exp) {
  background:var(--hjl-bg); color:var(--hjl-text); color-scheme:var(--hjl-scheme);
  --boss-bg:var(--hjl-bg); --boss-panel:var(--hjl-panel); --boss-control:var(--hjl-control);
  --boss-border:var(--hjl-line); --boss-text:var(--hjl-text); --boss-muted:var(--hjl-muted); --boss-accent:var(--hjl-accent);
  --lib-bg:var(--hjl-bg); --lib-panel:var(--hjl-panel); --lib-control:var(--hjl-control);
  --lib-border:var(--hjl-line); --lib-text:var(--hjl-text); --lib-muted:var(--hjl-muted); --lib-accent:var(--hjl-accent);
  --ha-ink:var(--hjl-text); --ha-teal:var(--hjl-accent); --ha-line:var(--hjl-line);
  --hu-ink:var(--hjl-text); --hu-teal:var(--hjl-accent); --hu-line:var(--hjl-line);
  --ink:var(--hjl-text); --green:var(--hjl-accent); --line:var(--hjl-line);
  --he-ink:var(--hjl-text); --he-green:var(--hjl-accent); --he-line:var(--hjl-line);
  --ep:var(--hjl-accent); --pale:var(--hjl-selected);
}
html[data-hjl-theme] :is(.boss-board,.hjl-liberation,[data-personal-burning],[data-pulse-calculator],[data-ied-app],[data-eff-app],[data-hexa-calculator],[data-afk-calculator],.hjl-crystal,.hjl-arc,.hjl-aut,.hjl-epic,.hjl-exp) :is(h1,h2,h3,h4,caption) {color:var(--hjl-text)!important}
html[data-hjl-theme] :is(.hjl-liberation,[data-personal-burning],[data-pulse-calculator],[data-ied-app],[data-eff-app],[data-hexa-calculator],[data-afk-calculator],.hjl-crystal,.hjl-arc,.hjl-aut,.hjl-epic,.hjl-exp) a {color:var(--hjl-accent)}
html[data-hjl-theme] :is(.boss-board,.hjl-liberation,[data-personal-burning],[data-pulse-calculator],[data-ied-app],[data-eff-app],[data-hexa-calculator],[data-afk-calculator],.hjl-crystal,.hjl-arc,.hjl-aut,.hjl-epic,.hjl-exp) :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {background:var(--hjl-control);color:var(--hjl-text);border-color:var(--hjl-line)}
html[data-hjl-theme] :is(.boss-board,.hjl-liberation,[data-personal-burning],[data-pulse-calculator],[data-ied-app],[data-eff-app],[data-hexa-calculator],[data-afk-calculator],.hjl-crystal,.hjl-arc,.hjl-aut,.hjl-epic,.hjl-exp) :is(input,textarea)::placeholder {color:var(--hjl-muted);opacity:1}
html[data-hjl-theme] :is(.boss-board,.hjl-liberation,[data-personal-burning],[data-pulse-calculator],[data-ied-app],[data-eff-app],[data-hexa-calculator],[data-afk-calculator],.hjl-crystal,.hjl-arc,.hjl-aut,.hjl-epic,.hjl-exp) :is(th,td,fieldset) {border-color:var(--hjl-line)}
html[data-hjl-theme] :is(.boss-board,.hjl-liberation,[data-personal-burning],[data-pulse-calculator],[data-ied-app],[data-eff-app],[data-hexa-calculator],[data-afk-calculator],.hjl-crystal,.hjl-arc,.hjl-aut,.hjl-epic,.hjl-exp) :focus-visible {outline:2px solid var(--hjl-accent);outline-offset:3px}

/* Shared menu and an embedded-calculator fallback toolbar. */
html[data-hjl-theme] .hjl-utility-header {grid-template-columns:120px minmax(0,1fr) auto;background:var(--hjl-panel);color:var(--hjl-text);border-color:var(--hjl-line)}
html[data-hjl-theme] .hjl-utility-header .hjl-utility-brand {color:var(--hjl-text)}
html[data-hjl-theme] .hjl-utility-header nav {grid-template-columns:repeat(9,minmax(0,1fr));width:100%;max-width:1210px;justify-self:start}
html[data-hjl-theme] .hjl-utility-header :is(nav a,summary) {color:var(--hjl-muted)}
html[data-hjl-theme] .hjl-utility-header :is(a[aria-current],.is-current>summary,a:hover,summary:hover,details[open]>summary) {background:var(--hjl-selected);color:var(--hjl-accent)}
html[data-hjl-theme] .hjl-utility-submenu {background:var(--hjl-panel);border-color:var(--hjl-line)}
html[data-hjl-theme] .hjl-theme-toggle {font:600 13px/1.5 system-ui,sans-serif;background:var(--hjl-control);color:var(--hjl-text);border:1px solid var(--hjl-line);border-radius:9px;padding:10px 12px;min-height:44px;white-space:nowrap;cursor:pointer}
html[data-hjl-theme] .hjl-theme-toggle:hover {background:var(--hjl-hover)}
html[data-hjl-theme] .hjl-theme-toggle:disabled {opacity:.65;cursor:wait}
html[data-hjl-theme] .hjl-theme-toggle:focus-visible {outline:2px solid var(--hjl-accent);outline-offset:3px}
.hjl-theme-toolbar {display:flex;justify-content:flex-end;margin:12px 0;gap:8px}
html[data-hjl-theme] :is(.hjl-crystal,.hjl-arc,.hjl-aut,.hjl-epic,.hjl-exp) {box-sizing:border-box;padding:20px;border-radius:14px}
html[data-hjl-theme] body:is(.hjl-boss-app,.hjl-liberation-app,.hjl-pb-app,.hjl-pulse-app,.hjl-ied-app,.hjl-eff-app,.hjl-hexa-app,.hjl-afk-app) footer a {color:var(--hjl-muted)}
@media(max-width:1050px){html[data-hjl-theme] .hjl-utility-header {grid-template-columns:120px minmax(0,1fr);gap:8px}html[data-hjl-theme] .hjl-utility-header nav{grid-row:2;grid-column:1/-1}html[data-hjl-theme] .hjl-utility-header .hjl-theme-toggle{grid-row:1;grid-column:2;justify-self:end}}
@media(max-width:700px){html[data-hjl-theme] .hjl-utility-header {grid-template-columns:minmax(0,1fr) auto}html[data-hjl-theme] .hjl-utility-header nav {grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Weekly boss list/popup: keep saturated selected difficulty fills. */
html[data-hjl-theme] .boss-board :is(.preset-bar,.picker-footer,.week-table thead) {background:var(--hjl-panel)}
html[data-hjl-theme] .boss-board :is(.boss-row.picked,.boss-picker .boss-row.picked) {background:var(--hjl-selected);border-color:var(--hjl-accent)}
html[data-hjl-theme] .boss-board :is(button:not(.difficulty):not(.primary),.file-button):hover {background:var(--hjl-hover);border-color:var(--hjl-accent)}
html[data-hjl-theme] .boss-board .diff-buttons .difficulty:not(.active):hover {background:var(--hjl-hover);border-color:var(--hjl-accent)}
html[data-hjl-theme] .boss-board :is(.selected-preview span,.board-title span) {background:var(--hjl-selected);color:var(--hjl-accent)}
html[data-hjl-theme] .boss-board :is(.limit-note,.character-notice) {background:var(--hjl-warning-bg);color:var(--hjl-warning)}
html[data-hjl-theme] .boss-board .cube-unconfirmed {color:var(--hjl-warning)}
html[data-hjl-theme] .boss-board .patch-note {color:var(--hjl-muted)}
html[data-hjl-theme] .boss-board button[data-save-week] {background:var(--hjl-control);color:var(--hjl-text);border-color:var(--hjl-line)}
html[data-hjl-theme] .boss-board :is(.boss-list,.boss-picker .boss-list) {scrollbar-color:var(--hjl-muted) var(--hjl-panel)}

/* Liberation, PB, IED and efficiency. */
html[data-hjl-theme] .hjl-liberation :is(.lib-income-total,.lib-row.is-selected,.lib-guide-highlight,.lib-tabs button[aria-selected=true]) {background:var(--hjl-selected);border-color:var(--hjl-accent)}
html[data-hjl-theme] .hjl-liberation :is(.lib-income-total strong,.lib-guide-highlight a) {color:var(--hjl-accent)}
html[data-hjl-theme] .hjl-liberation :is(.lib-income-total small,.lib-monthly,.lib-boss-name small,.lib-row-income small,.lib-guide-notes summary) {color:var(--hjl-muted)}
html[data-hjl-theme] .hjl-liberation :is(.lib-row-head,.lib-guide-table thead) {background:var(--hjl-panel);color:var(--hjl-muted)}
html[data-hjl-theme] .hjl-liberation :is(.lib-section-title button,.lib-difficulty:not([aria-pressed=true])) {background:var(--hjl-control);color:var(--hjl-text);border-color:var(--hjl-line)}
html[data-hjl-theme] .hjl-liberation :is(.lib-row,.lib-boss-scroll,.lib-guide-notes,.lib-guide-table th,.lib-guide-table td) {border-color:var(--hjl-line)}
html[data-hjl-theme] .hjl-liberation :is(input[aria-invalid=true],.lib-fix-input) {background:var(--hjl-error-bg);color:var(--hjl-error)}
html[data-hjl-theme] .hjl-liberation :is(.lib-field-error,.has-input-error [data-result=days]) {color:var(--hjl-error)}
html[data-hjl-theme] :is(.pb-results,.pb-card,.ied-card,.eff-card) {background:var(--hjl-panel);color:var(--hjl-text);border-color:var(--hjl-line)}
html[data-hjl-theme] :is(.pb-main-result,.pb-table-wrap .is-selected) {background:var(--hjl-selected);color:var(--hjl-accent)}
html[data-hjl-theme] :is(.pb-main-result strong,.pb-eyebrow,.pb-level-pairs legend,.ied-kicker,.ied-result strong,.eff-kicker,.eff-results strong) {color:var(--hjl-accent)!important}
html[data-hjl-theme] :is(.pb-intro p,.pb-card p,.pb-results span,.pb-notice,.pb-grid label,.pb-table-wrap thead,.pb-table-wrap small,.pb-actions span,.ied-result small,.ied-note,.ied-grid small,.eff-note,.eff-card small,.eff-head) {color:var(--hjl-muted)}
html[data-hjl-theme] :is(.pb-actions button,.ied-copy,.ied-actions button,.eff-actions button) {background:var(--hjl-control);color:var(--hjl-text);border-color:var(--hjl-line)}
html[data-hjl-theme] :is(.pb-results>div,.ied-result>div+div,.eff-row,.eff-breakdown span) {border-color:var(--hjl-line)}
html[data-hjl-theme] :is(#pb-error,.pulse-error) {background:var(--hjl-error-bg);color:var(--hjl-error)}
html[data-hjl-theme] :is(.ied-error,.eff-error) {color:var(--hjl-error)}

/* Pulse, symbols, EXP, epic dungeon and single-character crystal. */
html[data-hjl-theme] :is(.pulse-panel,.pulse-results,.pulse-outcomes div,.hjl-preferences,.ha-hero,.hu-hero,.ha-card,.hu-card,.ha-metric,.hu-metric,.hc-result,.hc-boss,.hc-guide,.he-start,.he-item,.he-presets,.he-personal-option,.he-result,.ep-card,.ep-locked,.ha-growth-region,.hu-growth-region,.hc-preset-info,.ha-toc,.hu-toc,.ep-details) {background:var(--hjl-panel);color:var(--hjl-text);border-color:var(--hjl-line)}
html[data-hjl-theme] :is(.ha-card.is-selected,.hu-card.is-selected,.ha-metric.is-focus,.hu-metric.is-focus,.hu-total,.hc-boss.is-selected,.ha-common-event,.hu-common-event,.ha-tip,.hu-tip,.ha-quick,.hu-quick,.he-mission-summary,.he-case,.ep-end,.hjl-epic td.is-active) {background:var(--hjl-selected);color:var(--hjl-text);border-color:var(--hjl-accent)}
html[data-hjl-theme] :is(.ha-saving,.hu-saving) {background:var(--hjl-selected);color:var(--hjl-text)}
html[data-hjl-theme] :is(.ha-chips span,.hu-chips span,.he-icon,.ha-region-tabs button,.hu-region-tabs button,.hjl-epic .ep-stage span,.hjl-arc button,.hjl-aut button,.hjl-crystal button,.hjl-exp button,.hjl-preferences button,.pulse-actions button,.hjl-epic button[data-reset]) {background:var(--hjl-control);color:var(--hjl-text);border-color:var(--hjl-line)}
html[data-hjl-theme] :is(.ha-region-tabs button[aria-pressed=true],.hu-region-tabs button[aria-pressed=true]) {background:var(--hjl-selected);color:var(--hjl-accent);box-shadow:inset 0 -3px var(--hjl-accent)}
html[data-hjl-theme] :is(.hjl-arc .ha-calculate,.hjl-aut .hu-calculate,.hjl-crystal .hc-difficulty-buttons button[aria-pressed=true],.hjl-crystal [data-preset][aria-pressed=true],.hjl-epic .ep-stage input:checked+span,.hjl-epic button:not([data-reset])) {background:#176b55;color:#fff;border-color:#176b55}
html[data-hjl-theme] :is(.pulse-main-result>strong,.ha-finish,.hu-finish,.ha-lead strong,.hu-lead strong,.ha-bonus-inputs label,.hu-bonus-inputs label,.hc-unit,.he-eyebrow,.ep-kicker,.ep-total) {color:var(--hjl-accent)}
html[data-hjl-theme] :is(.pulse-kicker,.pulse-heading p,.pulse-result-note,.pulse-grid small,.pulse-help,.pulse-actions span,.ha-kicker,.hu-kicker,.ha-footnote,.hu-footnote,.ha-toc a,.hu-toc a,.ha-arrow,.hu-arrow,.hc-help,.hc-boss-title small,.hc-unit small,.hc-result small,.he-header p,.he-muted,.he-item-name small,.he-quantity,.he-row small,.he-details,.he-empty,.he-personal-option p,.he-mission-summary small,.he-result-label,.he-result [data-result-detail],.hjl-epic .ep-intro,.hjl-epic .ep-footnote,.hjl-epic .ep-min,.hjl-epic td small,.hjl-epic .ep-raw,.hjl-epic .ep-locked p) {color:var(--hjl-muted)}
html[data-hjl-theme] :is(.pulse-table thead,.hjl-arc th,.hjl-aut th,.hjl-epic th) {background:var(--hjl-panel);color:var(--hjl-text)}
html[data-hjl-theme] :is(.pulse-totals div,.pulse-plan,.ha-fixed-extra,.hu-fixed-extra,.hu-cost-row,.hc-compare,.hc-monthly,.he-row,.he-source,.he-details) {border-color:var(--hjl-line)}
html[data-hjl-theme] :is(.ha-notice,.hu-notice,.hc-notice,.he-error,.he-result.is-incomplete) {background:var(--hjl-warning-bg);color:var(--hjl-warning)}
html[data-hjl-theme] :is(.hc-result [data-limit-message],.he-preset-note) {color:var(--hjl-warning)}
html[data-hjl-theme] .he-details summary {color:var(--hjl-text)}
html[data-hjl-theme] :is(.ha-error,.hu-error,.ep-error) {background:var(--hjl-error-bg);color:var(--hjl-error)}
