/* ぷにっとWiki v407 dark theme
   - Uses the user-provided transparent Puni background over a warm charcoal/plum base.
   - Cyan/light-blue legacy UI is remapped to cream/pink-neutral surfaces for readability.
   - Character artwork gets a white backing in dark mode so accidental transparency never turns eyes/faces black.
   - Avoids global "paint every white inline style dark" rules that caused black slabs in v401-v403.
*/
:root{
  --pwt404-bg:#2f2731;
  --pwt404-bg-deep:#282129;
  --pwt404-surface:#433842;
  --pwt404-surface-2:#4c404a;
  --pwt404-surface-3:#574954;
  --pwt404-line:#8d7483;
  --pwt404-line-soft:#715e69;
  --pwt404-text:#fffafc;
  --pwt404-muted:#eadde4;
  --pwt404-muted-2:#d5c3cc;
  --pwt404-pink:#ff94b9;
  --pwt404-pink-strong:#ff78aa;
  --pwt404-cream:#ffe6ac;
  --pwt404-cream-soft:#f4ddb4;
  --pwt404-lav:#e2d5f5;
  --pwt404-green:#b9e7c6;
  --pwt404-shadow:0 10px 28px rgba(18,10,17,.24);
}
html[data-theme="dark"]{
  color-scheme:dark;
  --main:var(--pwt404-pink-strong) !important;
  --sub:var(--pwt404-cream) !important;
  --yellow:#ffd866 !important;
  --bg:var(--pwt404-bg) !important;
  --card:var(--pwt404-surface) !important;
  --panel:var(--pwt404-surface) !important;
  --soft:var(--pwt404-surface-2) !important;
  --line:var(--pwt404-line) !important;
  --text:var(--pwt404-text) !important;
  --ink:var(--pwt404-text) !important;
  --muted:var(--pwt404-muted) !important;
  --shadow:var(--pwt404-shadow) !important;
  --pink:var(--pwt404-pink) !important;
  --blue:var(--pwt404-cream) !important;
  --accent:var(--pwt404-pink) !important;
  --quality-bg:#493d47 !important;
  --quality-line:#927888 !important;
  --quality-main:var(--pwt404-pink) !important;
  --quality-blue:var(--pwt404-cream) !important;
  background:var(--pwt404-bg);
}
html[data-theme="dark"] body{
  color:var(--pwt404-text) !important;
  background-color:var(--pwt404-bg) !important;
  background-image:
    linear-gradient(rgba(47,39,49,.18),rgba(40,33,41,.33)),
    url("../bg/dark-puni-bg-v404.png") !important;
  background-size:cover !important;
  background-position:center bottom !important;
  background-attachment:fixed !important;
  background-repeat:no-repeat !important;
  background-blend-mode:normal !important;
}
html[data-theme="dark"] body::before{
  background:linear-gradient(180deg,rgba(47,39,49,.10),rgba(47,39,49,.30)) !important;
}
html[data-theme="dark"] body::after{border-color:transparent !important}
html[data-theme="dark"] ::selection{background:#ffabd0;color:#3c2331}

/* Navigation */
html[data-theme="dark"] :is(nav,.wikiNav,.nav,.topnav){
  background:rgba(55,45,55,.97) !important;
  border-color:#9b7085 !important;
  box-shadow:0 5px 18px rgba(18,10,17,.25) !important;
}
html[data-theme="dark"] :is(nav a,.wikiNav a,.nav-links a,.navin a){color:#ffe4ee !important}
html[data-theme="dark"] :is(nav a,.wikiNav a,.nav-links a,.navin a):hover,
html[data-theme="dark"] :is(nav a.current,.wikiNav a.current){color:#402733 !important;background:#ffb3cf !important}

/* Header: retain warm/yellow brand instead of introducing cyan. */
html[data-theme="dark"] :is(header:not(.article-head),.hero,.topbar,.guide-head){
  border-color:#9a7484 !important;background-color:#4b3943 !important;
}
html[data-theme="dark"] header:not(.article-head){
  background-image:linear-gradient(180deg,#745a32 0%,#65453f 46%,#4b3943 100%) !important;
  background-blend-mode:normal !important;
}
html[data-theme="dark"] :is(.hero-card,.logo-plate){border-color:#9a7484 !important}
html[data-theme="dark"] .sub{color:#50380e !important;background:#fff0bd !important;border-color:#d1ad5b !important}

/* Main content surfaces: clearly separate from the background without going black. */
html[data-theme="dark"] :is(
  .card,.article,.cat,.tool,.panel,.section,.box,.form-card,.wiki-article,.article-body,
  .mini-section,.official-card,.quality-explainer,.quality-card,.work-card,.link-card,
  .gallery-card,.result-box,.dashCard,.calc-block,.calcBlock,.formulaBox,.tableWrap,
  .captureCard,.obsPanel,.resetPanel,.counterCard,.itemRow,.historyList,.settings-card,
  .guide-article,.guide-body,.current-character-card,.event-character-card,.event-figure,
  .rating-item,.rating-note,.rating-caveat,.source-note,.edit-suggest-v127,.precheck,
  .actualLuckPanel,.statsPanel,.sidePanel,.tablePanel,.animationPanel,.luckPanel,.periodComparePanel,
  .statCard,.breakCard,.importantCard,.infoBox,.actualLuckTargetRow,.actualLuckResult,
  .hundredBox,.drawBox,.machineStage,.control-panel,.yokai-card,.puni-play-entry,
  .home-guide-card,.char-search-panel,.event-countdown,.update-item,.update-card
){
  color:var(--pwt404-text) !important;
  background-color:var(--pwt404-surface) !important;
  border-color:var(--pwt404-line) !important;
  box-shadow:var(--pwt404-shadow) !important;
}
html[data-theme="dark"] :is(.cat,.tool,.article,.current-character-card,.yokai-card,.home-guide-card){
  background-image:linear-gradient(145deg,#51424d 0%,#433842 100%) !important;
}
html[data-theme="dark"] :is(.cat,.tool,.article,.current-character-card,.yokai-card,.home-guide-card):hover{
  border-color:#e08aac !important;box-shadow:0 11px 25px rgba(255,120,170,.14) !important;
}

html[data-theme="dark"] .article-head{
  color:#fff !important;border-color:#a4748a !important;
  background:linear-gradient(135deg,#734454 0%,#58404d 55%,#493a48 100%) !important;
}
html[data-theme="dark"] .article-head p{color:#f4e7ed !important}

/* Artwork safety: keep transparent PNGs visually sane in dark mode. */
html[data-theme="dark"] :is(.image-card,.image-area){
  background:#fdfbfd !important;border-color:#e2c7d3 !important;
}
html[data-theme="dark"] :is(
  img.char-img,img.yokai-image,img.cf-thumb,.thumb,
  .current-character-card img[src*="characters/"],.event-character-card img[src*="characters/"],
  img[src*="assets/characters/"],img[src*="../assets/characters/"],img[src*="../../assets/characters/"]
){
  background:#fff !important;
  background-image:none !important;
  filter:none !important;
  box-shadow:0 0 0 1px rgba(91,66,78,.12) inset !important;
}
html[data-theme="dark"] .image-card > b{color:#583746 !important}
html[data-theme="dark"] .image-area .rank-icon{background:transparent !important;box-shadow:none !important}

/* Typography */
html[data-theme="dark"] :is(h1,h2,h3,h4,h5,h6){color:#fffafd !important;text-shadow:none !important}
html[data-theme="dark"] h2{border-left-color:var(--pwt404-pink-strong) !important}
html[data-theme="dark"] :is(.cat b,.tool h2,.article h3,.card-title,.yokai-card .card-title,.current-character-card b,.home-guide-card h3,.event-title){color:#ffc0d5 !important}
html[data-theme="dark"] :is(.meta,.muted,.hint,.small-note,.quality-note,.card-meta,.desc,.tinyNote,.rate-note,.source-note,.hero p,.tool p,.cat small,.current-character-card small,.result-head){color:var(--pwt404-muted) !important}
html[data-theme="dark"] p,html[data-theme="dark"] li{line-height:1.72}
html[data-theme="dark"] a{color:#ffd0df}
html[data-theme="dark"] a:visited{color:#e9d5df}
html[data-theme="dark"] a:hover{color:#fff3f7}
html[data-theme="dark"] :is(.side-list a,.tool-links a,.related a){color:#ffd0df !important}

/* Inputs */
html[data-theme="dark"] :is(input,textarea,select){
  color:#fffafd !important;background:#392f39 !important;border-color:#947585 !important;
  caret-color:#ff94b9;box-shadow:inset 0 1px 0 rgba(255,255,255,.04) !important;
}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:#d0bdc6 !important;opacity:1}
html[data-theme="dark"] select option{background:#433842 !important;color:#fffafd !important}
html[data-theme="dark"] :is(input,textarea,select):focus{border-color:#ff99bd !important;outline:3px solid rgba(255,120,170,.18) !important;outline-offset:1px}
html[data-theme="dark"] :is(button,.btn,.plain,.softBtn,.puni-play-btn){border-color:#967386}
html[data-theme="dark"] button:not(.primary):not(.danger):not(.dangerBtn):not(.yellow):not(.obsPrimary):not(.plusBtn):not(.minusBtn):not([class*="rank"]){color:#fff8fb}
html[data-theme="dark"] :is(.plain,.softBtn,#resetButton,.btn.white,button.white,.white){color:#ffe8f0 !important;background:#594552 !important;border-color:#aa7c92 !important}
html[data-theme="dark"] :is(.plain,.softBtn,#resetButton,.btn.white,button.white,.white):hover{background:#6a4c5b !important}
html[data-theme="dark"] :is(.primary,.obsPrimary){color:#402432 !important;background:#ff9fc1 !important}
html[data-theme="dark"] :is(.btn.yellow,.yellow){color:#4a3500 !important}

/* Tables */
html[data-theme="dark"] :is(table,.info,.wiki-table,.quality-table,.dataTable,.periodCompareTable){color:#fffafd !important;background:#443942 !important;border-color:#8e7483 !important}
html[data-theme="dark"] :is(th,td){border-color:#806875 !important}
html[data-theme="dark"] th{color:#fff8fb !important;background:#624856 !important}
html[data-theme="dark"] td{background:#493d46 !important}
html[data-theme="dark"] tr:nth-child(even) td{background:#52444e !important}
html[data-theme="dark"] .dataTable tbody tr:hover td{background:#62505b !important}

/* Pills/tags */
html[data-theme="dark"] :is(.tag-row span,.badge,.chip,.kindTag,.heroBadges > *){color:#ffe8f0 !important;background:#644452 !important;border-color:#b47894 !important}
html[data-theme="dark"] .pill{color:#4b3815 !important;background:#ffe3a6 !important;border-color:#d0ae62 !important}
html[data-theme="dark"] :is(.detail-meta span,.quick-tags button){color:#ffe7ef !important;background:#60424f !important;border-color:#aa728a !important}

/* Former light-blue/cyan information areas: cream-tinted neutral, never cyan text. */
html[data-theme="dark"] :is(.note.tip,.term-link-box,.link-card,.source-box,.info-tip,.blue-note,.help-box){
  color:#fff0c9 !important;background:#564b3d !important;border-color:#b99a67 !important;
}
html[data-theme="dark"] :is(.note.tip,.term-link-box,.link-card,.source-box,.info-tip,.blue-note,.help-box) a{color:#ffe3a5 !important}
html[data-theme="dark"] :is(.notice,.note,.warning,.warn,.data-caution,.quality-note,.hintBox,.creditRuleBox){color:#fff1bf !important;background:#5a4b2d !important;border-color:#c8a458 !important}
html[data-theme="dark"] :is(.note.important,.important,.hot){color:#ffeaf2 !important;background:#68394b !important;border-color:#cf789d !important}
html[data-theme="dark"] :is(.related a,.tool-links a){color:#fff0c9 !important;background:#55473f !important;border-color:#9e8067 !important}

/* Encyclopedia */
html[data-theme="dark"] .dictionary-grid{color:#fffafd}
html[data-theme="dark"] .hero-count{background:#674653 !important;border-color:#b47b94 !important;color:#fff5f9 !important}
html[data-theme="dark"] .view-switch{background:#4c404a !important;border-color:#927485 !important}
html[data-theme="dark"] .view-switch button{background:#574954 !important;color:#fff0f5 !important}
html[data-theme="dark"] .view-switch button.active{background:#ff9abd !important;color:#462736 !important}
html[data-theme="dark"] .missing-standing{background:#5a5057 !important;color:#f0e7eb !important}
html[data-theme="dark"] :is(.char-filter-grid label,.profile-item b,.block-title){color:#ffe0eb !important}
html[data-theme="dark"] .yokai-card .image-area{background:#fff !important}
html[data-theme="dark"] .yokai-card .card-body{background:#493c47 !important}

/* Gasha/tools */
html[data-theme="dark"] .appShell{color:#fffafd}
html[data-theme="dark"] .gashaQuickNav{background:#4b3e48 !important;border-color:#927485 !important}
html[data-theme="dark"] .gashaQuickNavInner a{background:#5a4551 !important;color:#ffe8f0 !important;border-color:#ad788f !important}
html[data-theme="dark"] :is(.stepBlock,.rankSummary,.targetBreakdown,.actualLuckForm,.luckGrid,.targetChoice,.targetChip,.customCostBlock){background:#4c404a !important;border-color:#8d7280 !important}
html[data-theme="dark"] .barTrack{background:#62515c !important}
html[data-theme="dark"] .machine{filter:drop-shadow(0 14px 20px rgba(18,10,17,.25))}
html[data-theme="dark"] :is(.summaryItem,.obsSettings,.obsStep,.shortcutRow,.historyList li,.mockItem){background:#4c404a !important;border-color:#8d7280 !important}
html[data-theme="dark"] :is(.counterNumber,.itemCount){color:#fff !important}

/* Older structural components, explicit only. */
html[data-theme="dark"] :is(.profile-item,.source-box>div,.item,.compare,.preview,.block,.image-box,.block-image-preview,.admin-summary>div,.badge-img,.edit-body-image-box,.char-search-panel,.event-timer,.threadItem,.bodyText,.reply,.editBox,.filebox,.linkitem,.mini-preview,.editor,.member,.mark-card,.mini-item,.report,.reason){
  background:#4b3f49 !important;border-color:#8d7281 !important;color:#fff8fb !important;
}
html[data-theme="dark"] :is(.link-card b,.source-box b,.item-title,.block-image-status,.image-status-v131,.event-title,.msg,.eyebrow,.linktitle,.title,.detail-title,.block h4,.admin-section>summary){color:#ffc0d5 !important}
html[data-theme="dark"] :is(.small,.note:not(.important),.path,.body-img-name,.empty){color:var(--pwt404-muted) !important}
html[data-theme="dark"] .item.active{background:#70495b !important;border-color:#dc84a8 !important}
html[data-theme="dark"] .big-confirm{background:#634452 !important;border-color:#d282a4 !important}
html[data-theme="dark"] .badge-img.verified{background:#51475b !important;border-color:#8f7baa !important;color:#f2ebff !important}
html[data-theme="dark"] .badge-img.famous{background:#65434b !important;border-color:#ad727d !important;color:#ffdde2 !important}
html[data-theme="dark"] .badge-img.admin{background:#50484f !important;border-color:#827882 !important;color:#f3edf1 !important}
html[data-theme="dark"] :is(.blue,button.blue,.detail-actions .save-main,.filter-actions button.active){background:#a45f81 !important;color:#fff9fb !important}
html[data-theme="dark"] :is(.mini button,.toolbar button,.fileBtn,.detail-actions .nav-small){background:#594652 !important;color:#ffe9f1 !important;border-color:#a4778c !important}
html[data-theme="dark"] .threadItem.active{border-color:#e58aae !important;box-shadow:0 0 0 4px rgba(255,120,170,.16) !important}
html[data-theme="dark"] .admin-section>summary{background:#52434d !important}

/* Remap known legacy cyan/blue accents without painting arbitrary white regions dark. */
html[data-theme="dark"] [style*="background:#00a6d6"],html[data-theme="dark"] [style*="background: #00a6d6"],
html[data-theme="dark"] [style*="background:#67c9ff"],html[data-theme="dark"] [style*="background: #67c9ff"],
html[data-theme="dark"] [style*="background:#eef9ff"],html[data-theme="dark"] [style*="background: #eef9ff"],
html[data-theme="dark"] [style*="background:#edfbff"],html[data-theme="dark"] [style*="background: #edfbff"],
html[data-theme="dark"] [style*="background:#f4fbff"],html[data-theme="dark"] [style*="background: #f4fbff"],
html[data-theme="dark"] [style*="background:#f2fbff"],html[data-theme="dark"] [style*="background: #f2fbff"]{
  background:#594d40 !important;color:#fff1c5 !important;border-color:#b99a68 !important;
}
html[data-theme="dark"] [style*="color:#22749e"],html[data-theme="dark"] [style*="color: #22749e"],
html[data-theme="dark"] [style*="color:#1580b5"],html[data-theme="dark"] [style*="color: #1580b5"],
html[data-theme="dark"] [style*="color:#28769a"],html[data-theme="dark"] [style*="color: #28769a"],
html[data-theme="dark"] [style*="color:#0c7fb0"],html[data-theme="dark"] [style*="color: #0c7fb0"],
html[data-theme="dark"] [style*="color:#177bad"],html[data-theme="dark"] [style*="color: #177bad"],
html[data-theme="dark"] [style*="color:#00a6d6"],html[data-theme="dark"] [style*="color: #00a6d6"]{
  color:#ffe2a5 !important;
}

/* Countdown */
html[data-theme="dark"] .event-countdown{background:#4b3f49 !important;border-color:#927687 !important}
html[data-theme="dark"] .event-countdown .event-title{background:rgba(75,63,73,.92) !important;color:#fff4f8 !important;border-color:#b27492 !important}
html[data-theme="dark"] .event-countdown .event-period{color:#eadce3 !important}
html[data-theme="dark"] .event-countdown .event-timer{background:transparent !important;border:0 !important;color:#fffafc !important}

/* Footer */
html[data-theme="dark"] :is(footer,.footer,.footer-note,.quality-footer-v357){color:#e7d9e0 !important;background:#382f38 !important;border-color:#806676 !important}
html[data-theme="dark"] :is(footer a,.footer a,.footer-note a){color:#ffd0df !important}

/* Theme control */
.punitto-theme-switcher{position:fixed;right:max(14px,env(safe-area-inset-right));bottom:max(14px,env(safe-area-inset-bottom));z-index:2147482000;font-family:"Hiragino Sans","Yu Gothic",Meiryo,sans-serif}
.punitto-theme-toggle{width:48px;height:48px;border-radius:50%;border:2px solid rgba(255,255,255,.82);display:grid;place-items:center;cursor:pointer;font-size:22px;line-height:1;background:linear-gradient(145deg,#fff,#fff5c9);color:#8a4d66;box-shadow:0 8px 22px rgba(0,0,0,.22);transition:transform .15s ease,box-shadow .15s ease}
.punitto-theme-toggle:hover{transform:translateY(-2px);box-shadow:0 11px 26px rgba(0,0,0,.28)}
html[data-theme="dark"] .punitto-theme-toggle{color:#ffe7a7;background:linear-gradient(145deg,#6a4a59,#4d3d47);border-color:#bd829e}
.punitto-theme-menu{position:absolute;right:0;bottom:58px;width:215px;padding:8px;border-radius:18px;background:rgba(255,255,255,.99);border:1px solid #eadbe3;box-shadow:0 16px 40px rgba(0,0,0,.24)}
html[data-theme="dark"] .punitto-theme-menu{background:rgba(70,57,67,.99);border-color:#9a7889;color:#fff8fb}
.punitto-theme-menu[hidden]{display:none !important}
.punitto-theme-title{display:block;padding:5px 8px 7px;font-size:12px;font-weight:900;color:#7a6670}
html[data-theme="dark"] .punitto-theme-title{color:#e5d7de}
.punitto-theme-choice{width:100%;display:flex;align-items:center;gap:9px;text-align:left;border:0;border-radius:12px;padding:9px 10px;background:transparent;color:#3a2e34;cursor:pointer;font-weight:800}
html[data-theme="dark"] .punitto-theme-choice{color:#fff5f9}
.punitto-theme-choice:hover{background:#fff0f6}
html[data-theme="dark"] .punitto-theme-choice:hover{background:#624a57}
.punitto-theme-choice[aria-checked="true"]{background:#ffe2ef;color:#a31c60}
html[data-theme="dark"] .punitto-theme-choice[aria-checked="true"]{background:#754c5f;color:#fff0f5}
.punitto-theme-choice span:first-child{font-size:17px;width:24px;text-align:center}
.punitto-theme-choice small{display:block;font-weight:600;color:#806f78}
html[data-theme="dark"] .punitto-theme-choice small{color:#d9c7d0}
.punitto-theme-choice-text{display:block;line-height:1.15}

@media(max-width:900px){
  html[data-theme="dark"] body{background-attachment:scroll !important;background-size:auto 100% !important;background-position:center bottom !important}
}
@media(max-width:600px){
  .punitto-theme-switcher{right:10px;bottom:10px}.punitto-theme-toggle{width:43px;height:43px;font-size:20px}.punitto-theme-menu{bottom:52px;width:198px}
  html[data-theme="dark"] :is(.card,.tool,.article,.cat,.panel){box-shadow:0 7px 18px rgba(18,10,17,.20) !important}
}
@media(prefers-reduced-motion:reduce){.punitto-theme-toggle{transition:none}}
body.punitto-theme-overlay-page .punitto-theme-switcher{display:none !important}
@supports selector(body:has(*)){body:has(#puniPlayground:not([hidden])) .punitto-theme-switcher{display:none}}

/* v404: remaining legacy cyan components. */
html[data-theme="dark"] :is(.cf-panel,.cf-card,.cf-empty,.skill-panel,.skill-toggle,.skill2-box,.lottery-box,.filebox){
  background:#4d414a !important;border-color:#947786 !important;color:#fff8fb !important;
}
html[data-theme="dark"] .cf-collapsible>summary{
  color:#fff0c9 !important;background:linear-gradient(90deg,#60464f,#5a4d40) !important;border:1px solid #9f7f73 !important;
}
html[data-theme="dark"] :is(.cf-quick button,.cf-chip){background:#604653 !important;border-color:#ad788f !important;color:#ffe4ee !important}
html[data-theme="dark"] .quality-step li:before{background:#ff94b9 !important;color:#402432 !important}
html[data-theme="dark"] .quality-note{border-left-color:#e1bb74 !important;background:#594d40 !important;color:#fff0c9 !important}
html[data-theme="dark"] .profileImg{background:#fff !important}
html[data-theme="dark"] .editBtn{background:#ffe2a4 !important;color:#4c3816 !important;border-color:#c8a560 !important}
html[data-theme="dark"] .variant-advice{background:#4f424c !important;border-color:#91798c !important;color:#fff8fb !important}
html[data-theme="dark"] .variant-advice strong{color:#ffc0d5 !important}
html[data-theme="dark"] .variant-advice span{color:#e9dce3 !important}
html[data-theme="dark"] .priorityPill.low{background:#5b4f40 !important;border-color:#b49768 !important;color:#ffe8b5 !important}
html[data-theme="dark"] :is(.block-head,.panelHead,.controls,.controlGrid){color:#fff8fb !important}

/* ============================================================
   v405 readability pass
   - Bring back the playful polka-dot motif in dark mode.
   - Former cyan/light-blue cards become warm, LIGHT information cards
     with dark text rather than low-contrast dark khaki blocks.
   - Explicitly fix the home "記事作成 / 情報提供フォーム" cards.
   ============================================================ */
html[data-theme="dark"]{
  --pwt405-ink:#493540;
  --pwt405-ink-muted:#6f5662;
  --pwt405-light-card:#f8edf2;
  --pwt405-light-card-2:#f3e3ea;
  --pwt405-cream-card:#f7ecd7;
  --pwt405-cream-line:#d8b879;
  --pwt405-pink-line:#e3a3bd;
  --pwt405-pink-dark:#9c2f61;
}

/* The background image is transparent; put two subtle dot layers UNDER the UI
   and OVER the charcoal base so dark mode keeps the familiar Puni Wiki motif. */
html[data-theme="dark"] body{
  background-color:#332a34 !important;
  background-image:
    radial-gradient(circle at 9px 9px, rgba(255,250,252,.15) 0 6px, transparent 6.8px),
    radial-gradient(circle at 34px 34px, rgba(255,181,210,.075) 0 4px, transparent 4.8px),
    linear-gradient(rgba(51,42,52,.10),rgba(43,35,45,.28)),
    url("../bg/dark-puni-bg-v404.png") !important;
  background-size:48px 48px,48px 48px,cover,cover !important;
  background-position:0 0,0 0,center bottom,center bottom !important;
  background-repeat:repeat,repeat,no-repeat,no-repeat !important;
  background-attachment:fixed,fixed,fixed,fixed !important;
}
html[data-theme="dark"] body::before{
  background:linear-gradient(180deg,rgba(43,35,45,.04),rgba(43,35,45,.18)) !important;
}

/* HOME: these were almost unreadable because the card's original dark text
   and the global dark link color were fighting each other. Make them a deliberate
   light accent surface, close to the normal Puni Wiki look. */
html[data-theme="dark"] .info-split-v117 .info-card-v117{
  background:linear-gradient(145deg,#fff4f8 0%,#f4e4eb 100%) !important;
  color:var(--pwt405-ink) !important;
  border-color:var(--pwt405-pink-line) !important;
  box-shadow:0 10px 24px rgba(20,10,18,.22) !important;
}
html[data-theme="dark"] .info-split-v117 .info-card-v117:hover{
  background:linear-gradient(145deg,#fff8fb 0%,#f8e9ef 100%) !important;
  border-color:#f08bb5 !important;
  box-shadow:0 14px 30px rgba(20,10,18,.28),0 0 0 3px rgba(240,139,181,.12) !important;
}
html[data-theme="dark"] .info-split-v117 .info-card-v117 h3{
  color:#9b2d60 !important;
  text-shadow:none !important;
}
html[data-theme="dark"] .info-split-v117 .info-card-v117 p,
html[data-theme="dark"] .info-split-v117 .info-card-v117 strong,
html[data-theme="dark"] .info-split-v117 .info-card-v117 small{
  color:#4b3741 !important;
}
html[data-theme="dark"] .info-split-v117 .info-card-v117 .badge{
  color:#8f2858 !important;
  background:#f9dce8 !important;
  border-color:#dda0b9 !important;
}

/* Former light-blue information boxes: do not turn them into murky brown/dark boxes.
   Use a restrained cream surface with genuinely dark text. */
html[data-theme="dark"] :is(.note.tip,.term-link-box,.link-card,.source-box,.info-tip,.blue-note,.help-box){
  color:#493a32 !important;
  background:linear-gradient(145deg,#f8efdF 0%,#efe0c8 100%) !important;
  border-color:var(--pwt405-cream-line) !important;
  box-shadow:0 6px 16px rgba(21,13,17,.16) !important;
}
html[data-theme="dark"] :is(.note.tip,.term-link-box,.link-card,.source-box,.info-tip,.blue-note,.help-box) :is(p,li,span,small,strong,b){
  color:#493a32 !important;
}
html[data-theme="dark"] :is(.note.tip,.term-link-box,.link-card,.source-box,.info-tip,.blue-note,.help-box) a{
  color:#8e2c59 !important;
  text-decoration-color:#bc7896 !important;
}
html[data-theme="dark"] :is(.note.tip,.term-link-box,.link-card,.source-box,.info-tip,.blue-note,.help-box) a:hover{
  color:#6f1843 !important;
}

/* Common legacy cyan/light-blue utility surfaces.  These selectors intentionally
   cover named components, not arbitrary containers, so we do not recreate the
   old "black slab" problem. */
html[data-theme="dark"] :is(
  .cf-panel,.cf-card,.cf-empty,.skill-panel,.skill-toggle,.skill2-box,.lottery-box,
  .quality-note,.variant-advice,.source-note-box,.guide-note,.tips,.tip-box,
  .info-panel,.info-card,.help-card,.guide-card,.howto,.how-to,.explain-box
){
  border-color:#b991a3 !important;
}

/* If a component literally carries the old light-blue inline background,
   use the same light, high-contrast treatment. */
html[data-theme="dark"] [style*="background:#eef9ff"],html[data-theme="dark"] [style*="background: #eef9ff"],
html[data-theme="dark"] [style*="background:#edfbff"],html[data-theme="dark"] [style*="background: #edfbff"],
html[data-theme="dark"] [style*="background:#f4fbff"],html[data-theme="dark"] [style*="background: #f4fbff"],
html[data-theme="dark"] [style*="background:#f2fbff"],html[data-theme="dark"] [style*="background: #f2fbff"]{
  background:#f6ead5 !important;
  color:#493a32 !important;
  border-color:#d6b778 !important;
}
html[data-theme="dark"] [style*="background:#eef9ff"] *,html[data-theme="dark"] [style*="background: #eef9ff"] *,
html[data-theme="dark"] [style*="background:#edfbff"] *,html[data-theme="dark"] [style*="background: #edfbff"] *,
html[data-theme="dark"] [style*="background:#f4fbff"] *,html[data-theme="dark"] [style*="background: #f4fbff"] *,
html[data-theme="dark"] [style*="background:#f2fbff"] *,html[data-theme="dark"] [style*="background: #f2fbff"] *{
  color:#493a32 !important;
}

/* Cyan text on dark surfaces was especially hard to read.  Make old cyan text
   near-white/cream on normal dark surfaces; the light info-card rules above
   replace it with dark ink when applicable. */
html[data-theme="dark"] [style*="color:#22749e"],html[data-theme="dark"] [style*="color: #22749e"],
html[data-theme="dark"] [style*="color:#1580b5"],html[data-theme="dark"] [style*="color: #1580b5"],
html[data-theme="dark"] [style*="color:#28769a"],html[data-theme="dark"] [style*="color: #28769a"],
html[data-theme="dark"] [style*="color:#0c7fb0"],html[data-theme="dark"] [style*="color: #0c7fb0"],
html[data-theme="dark"] [style*="color:#177bad"],html[data-theme="dark"] [style*="color: #177bad"],
html[data-theme="dark"] [style*="color:#00a6d6"],html[data-theme="dark"] [style*="color: #00a6d6"]{
  color:#fff0cf !important;
}

/* Links that are acting as whole cards should not inherit the global pink link
   color for all descendant text. */
html[data-theme="dark"] :is(.info-card-v117,.link-card,.home-guide-card,.tool,.cat,.article,.yokai-card){
  text-decoration-color:currentColor;
}

@media(max-width:900px){
  html[data-theme="dark"] body{
    background-attachment:scroll,scroll,scroll,scroll !important;
    background-size:44px 44px,44px 44px,cover,auto 100% !important;
    background-position:0 0,0 0,center top,center bottom !important;
  }
}

/* ============================================================
   v406 global legacy-blue cleanup
   The v405 home cards were much easier to read because the old cyan
   panels became light Puni-Wiki-like paper cards with dark ink.
   Apply that same visual language across the rest of the site.
   ============================================================ */
html[data-theme="dark"]{
  --pwt406-paper:#fff4f8;
  --pwt406-paper-2:#f7e7ee;
  --pwt406-cream:#fbf1df;
  --pwt406-cream-2:#f1dfc2;
  --pwt406-ink:#493540;
  --pwt406-ink-soft:#6d5360;
  --pwt406-berry:#962c5a;
  --pwt406-pink-line:#e1a2bb;
  --pwt406-cream-line:#d7b777;
}

/* Former cyan / pale-blue information surfaces. */
html[data-theme="dark"] :is(
  .note:not(.warning):not(.important):not(.hot),
  .note.tip,
  .link-card,.term-link-box,.move-box,.toc,.char-search-panel,
  .event-character-card,.tool-links a,
  .cf-panel,.cf-card,.cf-empty,.skill-panel,.skill-toggle,.skill2-box,.lottery-box,
  .quality-note,.variant-advice,.source-note-box,.guide-note,.tips,.tip-box,
  .info-panel,.info-card,.help-card,.guide-card,.howto,.how-to,.explain-box,
  .block,.formulaBox,.var,.example>div,.fact-note,.event-role,.exchange-guide,
  .trade-card,.trade-item,.lineup-summary span,
  .profile-item,.dashboard-item,.mini-item,.box.blueish,.subpanel.blueish,
  .auto-comparison-note,.guarantee-info,.projection-note,.target-panel,.sub-card,.stat-card,
  .resultBlock,.slotCard,.speciesCard,.effectTargets label,.memoGrid>div,
  .syncInfo,.shortcutNotice,.itemVisual,.auto-state-field,.growth-rule,
  .trade-field,.trade-field__image,.form-card--profile
){
  color:var(--pwt406-ink) !important;
  background:linear-gradient(145deg,var(--pwt406-paper) 0%,var(--pwt406-paper-2) 100%) !important;
  border-color:var(--pwt406-pink-line) !important;
  box-shadow:0 7px 18px rgba(24,12,20,.16) !important;
}
html[data-theme="dark"] :is(
  .note:not(.warning):not(.important):not(.hot),
  .note.tip,
  .link-card,.term-link-box,.move-box,.toc,.char-search-panel,
  .event-character-card,.tool-links a,
  .cf-panel,.cf-card,.cf-empty,.skill-panel,.skill-toggle,.skill2-box,.lottery-box,
  .quality-note,.variant-advice,.source-note-box,.guide-note,.tips,.tip-box,
  .info-panel,.info-card,.help-card,.guide-card,.howto,.how-to,.explain-box,
  .block,.formulaBox,.var,.example>div,.fact-note,.event-role,.exchange-guide,
  .trade-card,.trade-item,.lineup-summary span,
  .profile-item,.dashboard-item,.mini-item,.box.blueish,.subpanel.blueish,
  .auto-comparison-note,.guarantee-info,.projection-note,.target-panel,.sub-card,.stat-card,
  .resultBlock,.slotCard,.speciesCard,.effectTargets label,.memoGrid>div,
  .syncInfo,.shortcutNotice,.itemVisual,.auto-state-field,.growth-rule,
  .trade-field,.trade-field__image,.form-card--profile
) :is(p,li,span,small,strong,b,h2,h3,h4,h5,label,summary,dt,dd){
  color:var(--pwt406-ink) !important;
  text-shadow:none !important;
}
html[data-theme="dark"] :is(
  .note:not(.warning):not(.important):not(.hot),
  .note.tip,
  .link-card,.term-link-box,.move-box,.toc,.char-search-panel,
  .event-character-card,.tool-links a,
  .cf-panel,.cf-card,.cf-empty,.skill-panel,.skill-toggle,.skill2-box,.lottery-box,
  .quality-note,.variant-advice,.source-note-box,.guide-note,.tips,.tip-box,
  .info-panel,.info-card,.help-card,.guide-card,.howto,.how-to,.explain-box,
  .block,.formulaBox,.var,.example>div,.fact-note,.event-role,.exchange-guide,
  .trade-card,.trade-item,.lineup-summary span,
  .profile-item,.dashboard-item,.mini-item,.box.blueish,.subpanel.blueish,
  .auto-comparison-note,.guarantee-info,.projection-note,.target-panel,.sub-card,.stat-card,
  .resultBlock,.slotCard,.speciesCard,.effectTargets label,.memoGrid>div,
  .syncInfo,.shortcutNotice,.itemVisual,.auto-state-field,.growth-rule,
  .trade-field,.trade-field__image,.form-card--profile
) a{
  color:var(--pwt406-berry) !important;
  text-decoration-color:#c4819e !important;
}
html[data-theme="dark"] :is(
  .note:not(.warning):not(.important):not(.hot),.note.tip,.link-card,.term-link-box,
  .move-box,.toc,.char-search-panel,.cf-panel,.cf-card,.skill-panel,.lottery-box,
  .info-panel,.help-card,.guide-card,.block,.formulaBox,.trade-card,.trade-item,
  .profile-item,.dashboard-item,.syncInfo,.shortcutNotice,.form-card--profile
) :is(input,textarea,select){
  color:var(--pwt406-ink) !important;
  background:#fffafc !important;
  border-color:#d89bb4 !important;
  caret-color:#a72d61 !important;
}
html[data-theme="dark"] :is(
  .note:not(.warning):not(.important):not(.hot),.note.tip,.link-card,.term-link-box,
  .move-box,.toc,.char-search-panel,.cf-panel,.cf-card,.skill-panel,.lottery-box,
  .info-panel,.help-card,.guide-card,.block,.formulaBox,.trade-card,.trade-item,
  .profile-item,.dashboard-item,.syncInfo,.shortcutNotice,.form-card--profile
) :is(input,textarea)::placeholder{color:#8b6e7b !important}
html[data-theme="dark"] :is(
  .note:not(.warning):not(.important):not(.hot),.note.tip,.link-card,.term-link-box,
  .move-box,.toc,.char-search-panel,.cf-panel,.cf-card,.skill-panel,.lottery-box,
  .info-panel,.help-card,.guide-card,.block,.formulaBox,.trade-card,.trade-item,
  .profile-item,.dashboard-item,.syncInfo,.shortcutNotice,.form-card--profile
) select option{background:#fffafc !important;color:var(--pwt406-ink) !important}

/* Compact blue chips/buttons become pink paper chips instead of cyan. */
html[data-theme="dark"] :is(
  .ypBadge,.autoDetectedBadge,.puni-play-btn.sky,.puni-play-pill.blue,.puni-play-btn.capture,
  .editBtn,.mini-pill,.status-pill,.priorityPill.low,
  .event-countdown .event-timer,.freeTotal,.freeCharStatic>em,
  .chartTapHint,.chartTapDetailHead,.backBtn,.presets button,
  .preset-buttons button,.target-actions button,.secondaryBtn,
  .wikiNav a.current,.wikiNav a:hover,.lineup-summary span
){
  color:var(--pwt406-berry) !important;
  background:linear-gradient(145deg,#fff2f7,#f4e0e9) !important;
  border-color:#dfa0b9 !important;
  text-shadow:none !important;
}
html[data-theme="dark"] :is(.puni-play-btn.sky,.puni-play-btn.capture,.presets button,.preset-buttons button,.target-actions button,.secondaryBtn):hover{
  color:#731b46 !important;
  background:#ffe8f1 !important;
  border-color:#ef8eb5 !important;
}

/* Account/admin status badges: readable light variants, preserving meaning. */
html[data-theme="dark"] :is(.badge-img.admin,.badge-img.verified){
  color:#633b5b !important;
  background:#f2e9fa !important;
  border-color:#c9acd9 !important;
}
html[data-theme="dark"] :is(.status.static,.status.draft){
  color:#66455a !important;
  background:#f2e8f2 !important;
  border-color:#c9a9be !important;
}
html[data-theme="dark"] :is(.status-ok,.approved,.ok,.saveState,.statusPill.done,.compat.good,.variant-advice.is-current,.money-budget-preview.safe,.state-card.best,.allocation-card.best,.result-block.good,.compareBestCard,.onirenStep.continue){
  color:#285841 !important;
  background:#eaf7ef !important;
  border-color:#a8d0b8 !important;
}

/* High-contrast article/table treatment. */
html[data-theme="dark"] :is(.info,.wiki-table,.quality-table,.dataTable,.periodCompareTable) th{
  color:#7e2450 !important;
  background:#f6dfe9 !important;
  border-color:#dba1b8 !important;
}
html[data-theme="dark"] .wiki-table th :is(a,span,strong,b){color:#7e2450 !important}
html[data-theme="dark"] :is(.character-meta,.rating-criteria summary){color:#f5dfe8 !important}

/* Event pages used several cyan presentation panels. Keep them bright but Puni-like. */
html[data-theme="dark"] .event-visual{
  color:var(--pwt406-ink) !important;
  background:radial-gradient(circle at 50% 0,#fff8cf 0%,#ffe8f1 48%,#efdce7 100%) !important;
  border-color:#e1a2bb !important;
}
html[data-theme="dark"] .event-visual :is(p,span,small,strong,b,h2,h3,h4){color:var(--pwt406-ink) !important}
html[data-theme="dark"] .pageHeader{
  color:#573a48 !important;
  background:linear-gradient(135deg,#fff3f8 0%,#f7e3ec 56%,#fff0c8 100%) !important;
  border-color:#e0a5bc !important;
}
html[data-theme="dark"] .pageHeader :is(h1,h2,h3,p,span,small,strong,b){color:#573a48 !important}

/* Legacy image holders that were pale blue stay white-ish; they often contain artwork. */
html[data-theme="dark"] :is(.image-card,.itemVisual,.trade-field__image,.report img,.image-button img){
  background-color:#fff !important;
  color:#493540 !important;
  border-color:#e4b5c8 !important;
}

/* Inline legacy palettes that still appear on a few handcrafted pages. */
html[data-theme="dark"] :is(
  [style*="background:#eef9ff"],[style*="background: #eef9ff"],
  [style*="background:#effaff"],[style*="background: #effaff"],
  [style*="background:#edfbff"],[style*="background: #edfbff"],
  [style*="background:#f4fbff"],[style*="background: #f4fbff"],
  [style*="background:#f2fbff"],[style*="background: #f2fbff"],
  [style*="background:#f3fbff"],[style*="background: #f3fbff"],
  [style*="background:#f5fcff"],[style*="background: #f5fcff"],
  [style*="background:#f7fcff"],[style*="background: #f7fcff"],
  [style*="background:#f8fdff"],[style*="background: #f8fdff"],
  [style*="background:#eefaff"],[style*="background: #eefaff"],
  [style*="background:#eafcff"],[style*="background: #eafcff"],
  [style*="background:#effcff"],[style*="background: #effcff"],
  [style*="background:#f2fdff"],[style*="background: #f2fdff"],
  [style*="background:#f4fdff"],[style*="background: #f4fdff"]
){
  color:var(--pwt406-ink) !important;
  background:#f8e9ef !important;
  border-color:#e0a3bb !important;
}
html[data-theme="dark"] :is(
  [style*="background:#eef9ff"],[style*="background: #eef9ff"],
  [style*="background:#effaff"],[style*="background: #effaff"],
  [style*="background:#edfbff"],[style*="background: #edfbff"],
  [style*="background:#f4fbff"],[style*="background: #f4fbff"],
  [style*="background:#f2fbff"],[style*="background: #f2fbff"],
  [style*="background:#f3fbff"],[style*="background: #f3fbff"],
  [style*="background:#f5fcff"],[style*="background: #f5fcff"],
  [style*="background:#f7fcff"],[style*="background: #f7fcff"],
  [style*="background:#f8fdff"],[style*="background: #f8fdff"],
  [style*="background:#eefaff"],[style*="background: #eefaff"],
  [style*="background:#eafcff"],[style*="background: #eafcff"],
  [style*="background:#effcff"],[style*="background: #effcff"],
  [style*="background:#f2fdff"],[style*="background: #f2fdff"],
  [style*="background:#f4fdff"],[style*="background: #f4fdff"]
) :is(p,li,span,small,strong,b,h1,h2,h3,h4,label){color:var(--pwt406-ink) !important}

/* Keep true warning/important boxes semantically distinct and readable. */
html[data-theme="dark"] :is(.notice,.note.warning,.warning,.warn,.data-caution,.hintBox,.creditRuleBox){
  color:#4f3b16 !important;
  background:linear-gradient(145deg,#fff4c9,#f3dfad) !important;
  border-color:#d5ae56 !important;
}
html[data-theme="dark"] :is(.notice,.note.warning,.warning,.warn,.data-caution,.hintBox,.creditRuleBox) :is(p,li,span,small,strong,b,h2,h3,h4,a){color:#4f3b16 !important}
html[data-theme="dark"] :is(.note.important,.important,.hot){
  color:#5f2942 !important;
  background:linear-gradient(145deg,#ffe9f1,#f3cadb) !important;
  border-color:#df8eaf !important;
}
html[data-theme="dark"] :is(.note.important,.important,.hot) :is(p,li,span,small,strong,b,h2,h3,h4,a){color:#5f2942 !important}

/* v406 theme chooser follows the same light-card language. */
html[data-theme="dark"] .punitto-theme-menu{
  background:#f8edf2 !important;
  border-color:#dfa7bd !important;
  color:var(--pwt406-ink) !important;
}
html[data-theme="dark"] .punitto-theme-title{color:#6f5260 !important}
html[data-theme="dark"] .punitto-theme-choice{color:var(--pwt406-ink) !important}
html[data-theme="dark"] .punitto-theme-choice small{color:#806572 !important}
html[data-theme="dark"] .punitto-theme-choice:hover{background:#f3dce6 !important}
html[data-theme="dark"] .punitto-theme-choice[aria-checked="true"]{background:#edcad9 !important;color:#7f2450 !important}

/* v406 second pass: remaining isolated cool/light-blue widgets found by the site-wide audit. */
html[data-theme="dark"] :is(.char-placeholder,.growth-box,.targetPickerTop,.compareBestCard.alt){
  color:var(--pwt406-ink) !important;
  background:linear-gradient(145deg,#fff3f8,#f5e4ec) !important;
  border-color:#dfa4bc !important;
}
html[data-theme="dark"] :is(.char-placeholder,.growth-box,.targetPickerTop,.compareBestCard.alt) :is(p,span,small,strong,b,h2,h3,h4,label){color:var(--pwt406-ink) !important}
html[data-theme="dark"] :is(.rank-pill,.luckBadge,.luckBadge.down1,.luckBadge.down2,.luckBadge.even,.state-card .confidence,.targetSearchClear,.hero--sao .hero__eyebrow,.obsEyebrow,.obsMiniStatus.on,.obsState.on,.statusPill.archived){
  color:#7c3155 !important;
  background:#f2e4ed !important;
  border-color:#d1a5b9 !important;
}
html[data-theme="dark"] :is(.boss-puni-figure,.watch-showcase,.character-check--future .character-check__visual){
  color:var(--pwt406-ink) !important;
  background:#fffafc !important;
  border-color:#e2b1c5 !important;
}
html[data-theme="dark"] .character-check__future-mark{color:#76445b !important;background:#efe3e8 !important;border-color:#c9a7b6 !important}
html[data-theme="dark"] :is(.filters button,.search-row button,.luckDiscordBtn){
  color:#7b2851 !important;
  background:#f4e4ec !important;
  border-color:#d5a3b8 !important;
}
html[data-theme="dark"] :is(.filters button,.search-row button,.luckDiscordBtn):hover{background:#ffeaf2 !important;border-color:#e28aaf !important}
html[data-theme="dark"] .allocation-advice{
  color:#315742 !important;
  background:linear-gradient(135deg,#eaf7ef,#fff4d9) !important;
  border-color:#b7d0ae !important;
}
html[data-theme="dark"] .allocation-advice :is(p,span,small,strong,b,h2,h3,h4){color:#315742 !important}


/* ============================================================
   v407 definitive blue-removal pass
   Goal: in dark mode there must be no legacy aqua/cyan UI left.
   Former blue UI is translated to one of three roles:
     - pale rose paper (information / secondary panels)
     - berry pink (interactive / strong accents)
     - warm plum (dark structural panels)
   Runtime classes are added by theme-v407.js after checking the actual
   computed colours, so this also catches old one-off pages and widgets.
   ============================================================ */
html[data-theme="dark"]{
  --pwt407-paper:#fff3f7;
  --pwt407-paper-2:#f8e6ed;
  --pwt407-paper-cream:#fff0da;
  --pwt407-ink:#402c35;
  --pwt407-ink-soft:#69515c;
  --pwt407-berry:#b33f6d;
  --pwt407-berry-strong:#cf4f80;
  --pwt407-berry-deep:#82244e;
  --pwt407-plum:#463641;
  --pwt407-plum-2:#523d49;
  --pwt407-line:#e3a9c0;
}

/* Runtime-detected leftover blue backgrounds. */
html[data-theme="dark"] .pwt407-blue-surface-light{
  background-color:var(--pwt407-paper) !important;
  background-image:linear-gradient(145deg,var(--pwt407-paper) 0%,var(--pwt407-paper-2) 100%) !important;
  color:var(--pwt407-ink) !important;
  border-color:var(--pwt407-line) !important;
  text-shadow:none !important;
}
html[data-theme="dark"] .pwt407-blue-surface-mid{
  background-color:var(--pwt407-berry) !important;
  background-image:linear-gradient(145deg,#d95e8e 0%,#b43f6e 100%) !important;
  color:#fffafc !important;
  border-color:#f1a8c4 !important;
  text-shadow:none !important;
}
html[data-theme="dark"] .pwt407-blue-surface-dark{
  background-color:var(--pwt407-plum) !important;
  background-image:linear-gradient(145deg,var(--pwt407-plum-2) 0%,var(--pwt407-plum) 100%) !important;
  color:#fff8fb !important;
  border-color:#a97c90 !important;
  text-shadow:none !important;
}
html[data-theme="dark"] .pwt407-blue-gradient{
  background-image:linear-gradient(135deg,#d95889 0%,#b13d6c 55%,#8f315a 100%) !important;
  background-color:#b13d6c !important;
  color:#fffafc !important;
  border-color:#efa4c0 !important;
}
html[data-theme="dark"] .pwt407-blue-text{color:#ffbfd5 !important;text-shadow:none !important}
html[data-theme="dark"] .pwt407-blue-border{border-color:#e0a4bc !important}
html[data-theme="dark"] .pwt407-blue-surface-light.pwt407-blue-text,
html[data-theme="dark"] .pwt407-blue-surface-light .pwt407-blue-text{color:var(--pwt407-berry-deep) !important}
html[data-theme="dark"] .pwt407-blue-surface-light :is(a,h1,h2,h3,h4,h5,h6,strong,b,label,summary){
  color:var(--pwt407-berry-deep) !important;
}
html[data-theme="dark"] .pwt407-blue-surface-light :is(p,li,span,small,dt,dd){
  color:var(--pwt407-ink) !important;
}
html[data-theme="dark"] .pwt407-blue-surface-mid :is(a,h1,h2,h3,h4,h5,h6,strong,b,p,li,span,small,label,summary),
html[data-theme="dark"] .pwt407-blue-gradient :is(a,h1,h2,h3,h4,h5,h6,strong,b,p,li,span,small,label,summary){
  color:#fffafc !important;
}

/* Known common blue variables/controls: force a colour family that is visibly
   different from cyan. */
html[data-theme="dark"] :is(.blue,button.blue,.btn.blue,.sky,.cyan,.aqua,[class*="blue-btn"],[class*="cyan-btn"]){
  background:#c94c7c !important;
  background-image:linear-gradient(145deg,#db648f,#b83d6d) !important;
  border-color:#f0a6c1 !important;
  color:#fff !important;
}
html[data-theme="dark"] :is(.blue,button.blue,.btn.blue,.sky,.cyan,.aqua,[class*="blue-btn"],[class*="cyan-btn"]):hover{
  background:#df628f !important;
  border-color:#ffc0d5 !important;
}

/* Old blue-tinted link / info cards get the same rose-paper treatment everywhere. */
html[data-theme="dark"] :is(
  .term-link-box,.link-card,.tool-links a,.source-box,.source-note,.note.tip,.blue-note,
  .help-box,.help-card,.info-tip,.info-panel,.guide-note,.guide-card,.tips,.tip-box,
  .char-search-panel,.toc,.move-box,.cf-panel,.cf-card,.cf-empty,.quality-note,
  .variant-advice,.skill-panel,.skill-toggle,.skill2-box,.lottery-box
){
  background:#fff3f7 !important;
  background-image:linear-gradient(145deg,#fff5f8,#f7e5ec) !important;
  border-color:#e4abc1 !important;
  color:#402c35 !important;
}
html[data-theme="dark"] :is(
  .term-link-box,.link-card,.tool-links a,.source-box,.source-note,.note.tip,.blue-note,
  .help-box,.help-card,.info-tip,.info-panel,.guide-note,.guide-card,.tips,.tip-box,
  .char-search-panel,.toc,.move-box,.cf-panel,.cf-card,.cf-empty,.quality-note,
  .variant-advice,.skill-panel,.skill-toggle,.skill2-box,.lottery-box
) :is(a,h1,h2,h3,h4,h5,h6,strong,b,label,summary){color:#84254f !important}
html[data-theme="dark"] :is(
  .term-link-box,.link-card,.tool-links a,.source-box,.source-note,.note.tip,.blue-note,
  .help-box,.help-card,.info-tip,.info-panel,.guide-note,.guide-card,.tips,.tip-box,
  .char-search-panel,.toc,.move-box,.cf-panel,.cf-card,.cf-empty,.quality-note,
  .variant-advice,.skill-panel,.skill-toggle,.skill2-box,.lottery-box
) :is(p,li,span,small,dt,dd){color:#402c35 !important}

/* Blue edit/secondary gradients were especially conspicuous on old articles. */
html[data-theme="dark"] :is(.edit-suggest-v127 a,.edit-suggest a,.secondary-action,.backBtn){
  background:linear-gradient(135deg,#d95b89,#ad3867) !important;
  color:#fff !important;
  border-color:#ffd1df !important;
}

/* Do not let pale-blue table headers or pills survive as cyan. */
html[data-theme="dark"] :is(.info,.wiki-table,.quality-table,.dataTable,.periodCompareTable) th,
html[data-theme="dark"] :is(.rank-pill,.status-pill,.mini-pill,.chip,.badge){
  border-color:#dfa4bb !important;
}

/* If image artwork itself contains transparency, keep the existing white backing. */
html[data-theme="dark"] :is(img.char-img,img.yokai-image,img.cf-thumb,.thumb,img[src*="assets/characters/"]){
  background-color:#fff !important;
}
