/* Compact Corrupted Zone Tracker tool card: title + one live line. */
#open-corrupted-zones > span:not(.cz-tool-live){
  display:none!important;
}

#open-corrupted-zones .cz-tool-live{
  display:block!important;
  margin-top:6px!important;
  padding-top:0!important;
  border-top:0!important;
}

#open-corrupted-zones .cz-tool-live-inline{
  display:block!important;
  margin:0!important;
  color:var(--juxta-bone-bright,#fff4e2)!important;
  font-family:var(--juxta-font-ui,Optima,Candara,"Segoe UI",sans-serif)!important;
  font-size:16px!important;
  font-weight:700!important;
  line-height:1.35!important;
  white-space:normal;
}

#open-corrupted-zones .cz-tool-live-inline > span{
  display:inline!important;
  margin:0!important;
  padding:0!important;
  font:inherit!important;
  line-height:inherit!important;
}

#open-corrupted-zones .cz-tool-live-zone{
  color:var(--juxta-bone-bright,#fff4e2)!important;
}

#open-corrupted-zones .cz-tool-live-time{
  color:#f3a9ad!important;
  font-variant-numeric:tabular-nums!important;
}

/* ============================================================
   Readability pass
   - Every visible site/tool text element has a 16px floor.
   - Major headings are deliberately restored above the floor.
   - Surfaces are lifted slightly so the page is easier to scan without
     turning the dark theme into a bright theme.
   ============================================================ */
:root{
  --juxta-bg:#101318;
  --juxta-bg-soft:#15191f;
  --juxta-panel:#1a1f26;
  --juxta-panel-raised:#20262e;
  --juxta-panel-warm:#261a1f;
  --juxta-bone-bright:#fff8ec;
  --juxta-bone:#eee7dd;
  --juxta-bone-soft:#ddd5cb;
  --juxta-muted:#beb7af;
  --juxta-muted-dark:#9ea0a6;
  --juxta-border:#4b525c;
  --juxta-border-soft:#3e454e;
  --juxta-border-crimson:#81404a;
  --juxta-glow:rgba(200,77,87,.10);
  --juxta-glow-strong:rgba(239,106,112,.16);
}

html body{
  background:radial-gradient(circle at 50% -20%,rgba(110,36,47,.07),transparent 38%),var(--juxta-bg)!important;
  color:var(--juxta-bone)!important;
}

/* Main page + all tool/modal descendants. Duplicate root selectors give the
   floor enough specificity to beat legacy 9–15px component declarations. */
html body .site-shell.site-shell,
html body .site-shell.site-shell *,
html body [class$="-modal"][class$="-modal"],
html body [class$="-modal"][class$="-modal"] *,
html body .contributors-modal.contributors-modal,
html body .contributors-modal.contributors-modal *,
html body .pdu-modal.pdu-modal,
html body .pdu-modal.pdu-modal *,
html body .cex-directory-panel.cex-directory-panel,
html body .cex-directory-panel.cex-directory-panel *,
html body .cz-frame.cz-frame,
html body .cz-frame.cz-frame *,
html body .cex-hover-tooltip.cex-hover-tooltip,
html body .cex-hover-tooltip.cex-hover-tooltip *{
  font-size:16px!important;
}

/* Generated tooltip/label text inherits the same floor. */
html body .site-shell.site-shell *::before,
html body .site-shell.site-shell *::after,
html body [class$="-modal"][class$="-modal"] *::before,
html body [class$="-modal"][class$="-modal"] *::after,
html body .cex-directory-panel.cex-directory-panel *::before,
html body .cex-directory-panel.cex-directory-panel *::after{
  font-size:inherit!important;
}

/* Preserve clear typographic hierarchy after enforcing the floor. */
html body .site-shell.site-shell h1,
html body [class$="-modal"][class$="-modal"] h1{font-size:clamp(30px,3vw,42px)!important;line-height:1.15!important}
html body .site-shell.site-shell h2,
html body [class$="-modal"][class$="-modal"] h2,
html body .contributors-modal.contributors-modal h2,
html body .pdu-modal.pdu-modal h2{font-size:clamp(26px,2.5vw,36px)!important;line-height:1.18!important}
html body .site-shell.site-shell h3,
html body [class$="-modal"][class$="-modal"] h3,
html body .contributors-modal.contributors-modal h3,
html body .pdu-modal.pdu-modal h3{font-size:22px!important;line-height:1.22!important}
html body .site-shell.site-shell h4,
html body [class$="-modal"][class$="-modal"] h4{font-size:18px!important;line-height:1.25!important}

html body [class$="-modal"][class$="-modal"] :is(.skill-calc-close,.map-index-close,.currency-values-close,.cz-close,.rwz-close,.cex-close),
html body .contributors-modal.contributors-modal :is(button[aria-label*="Close"],.contributors-close),
html body .pdu-modal.pdu-modal :is(button[aria-label*="Close"],.pdu-close){font-size:24px!important}

/* More comfortable line-height for dense informational UI. */
html body .site-shell.site-shell :is(p,li,td,th,label,button,input,select,textarea,span,small),
html body [class$="-modal"][class$="-modal"] :is(p,li,td,th,label,button,input,select,textarea,span,small),
html body .contributors-modal.contributors-modal :is(p,li,td,th,label,button,input,select,textarea,span,small),
html body .pdu-modal.pdu-modal :is(p,li,td,th,label,button,input,select,textarea,span,small){line-height:1.4!important}

/* Lift the darkest surfaces and simplify visual contrast. */
html body :is(.panel,.section-card,.reference-box){
  background:linear-gradient(180deg,#1b2027,#15191e)!important;
  border-color:var(--juxta-border)!important;
}
html body .site-header{
  background:linear-gradient(90deg,#12161b,#1b2027 58%,#14181d)!important;
}
html body :is(.game-card,.guide-tool-button,.guide-tool-button.skill-tool){
  background:linear-gradient(180deg,#20252c,#181c21)!important;
  border-color:#4a5059!important;
}
html body :is(.game-card,.guide-tool-button,.guide-tool-button.skill-tool):hover,
html body :is(.game-card,.guide-tool-button,.guide-tool-button.skill-tool):focus-visible{
  background:linear-gradient(180deg,#282126,#1b1d22)!important;
  border-color:#98505a!important;
  box-shadow:none!important;
}

html body :is(.skill-calc-modal,.map-index-modal,.currency-values-modal,.cz-modal,.rwz-modal,.cex-modal,.contributors-modal,.pdu-modal){
  background:linear-gradient(180deg,#1a1f25,#13171c)!important;
  border-color:#664049!important;
  color:var(--juxta-bone)!important;
}

html body :is(
  .skill-control-box,.map-element-panel,.map-list-shell,.map-detail,
  .currency-credit,.cz-column,.cz-current-wrap,.rwz-filter-block,.rwz-card,
  .cex-search,.cex-directory-panel,.cex-section,.contributors-card,.pdu-filter-block,.pdu-card
){
  background:#1b2026!important;
  border-color:#464d56!important;
}

html body :is(input,select,textarea),
html body :is(.rwz-filter-button,.rwz-subtype-button,.rwz-socket-button,.map-element-button,.cz-header-actions button,#currency-values-refresh){
  background:#171b20!important;
  border-color:#515862!important;
  color:var(--juxta-bone)!important;
}

/* Muted copy was one of the hardest areas to read on the old near-black
   surfaces. Keep it secondary, but not faint. */
html body :is(
  .brand-copy p,.section-subtext,.game-card span,.guide-tool-button span,.feedback,.coming-soon p,
  .rwz-header p,.rwz-card-meta,.rwz-status,.currency-values-header p,.currency-status-row,
  .map-count,.map-source-link,.map-list-empty,.map-detail-placeholder,
  .cex-directory-launch span,.cz-zone-meta,.cz-alert-status,.contributors-description,.pdu-description
){color:var(--juxta-muted)!important}

/* Map Index: give 16px tables more room and reduce image-preview dominance. */
html body .map-index-modal.map-index-modal .map-list-header,
html body .map-index-modal.map-index-modal .map-list-row{min-height:42px!important}
html body .map-index-modal.map-index-modal .map-list-header,
html body .map-index-modal.map-index-modal .map-list-row{grid-template-columns:minmax(250px,1.8fr) 70px repeat(6,minmax(82px,.72fr))!important}
html body .map-index-modal.map-index-modal .map-detail-grid{grid-template-columns:minmax(650px,1.35fr) minmax(280px,.65fr)!important}
html body .map-index-modal.map-index-modal .map-monster-table{min-width:760px!important}
html body .map-index-modal.map-index-modal .map-monster-table th,
html body .map-index-modal.map-index-modal .map-monster-table td{padding:8px 7px!important}
html body .map-index-modal.map-index-modal .map-layout-thumb{flex-basis:110px!important;height:64px!important}
html body .map-index-modal.map-index-modal .map-layout-preview{min-height:230px!important;max-height:42vh!important}
html body .map-index-modal.map-index-modal .map-layout-preview img{max-height:40vh!important}

/* Controls that were designed around 9–13px labels need a little more room. */
html body :is(.rwz-filter-button,.rwz-subtype-button,.rwz-socket-button,.map-element-button,.skill-character-select,.cex-search input,.cex-search button,.cz-header-actions button,#currency-values-refresh){min-height:44px!important}

@media(max-width:900px){
  html body .map-index-modal.map-index-modal .map-detail-grid{grid-template-columns:1fr!important}
  html body .map-index-modal.map-index-modal .map-layouts{border-left:0!important;border-top:1px solid #464d56!important}
}
