/* Shared tokens also exist on desktop, where the legacy system was mobile-only. */
:root{--ui-canvas:#0e131b;--ui-surface:#171e29;--ui-raised:#202a38;--ui-line:#2c3747;--ui-text:#e9edf5;--ui-muted:#a8b4c6;--ui-accent:#aac1ee;--ui-red:#e48d98;--ui-yellow:#d9be72;--ui-green:#78c7a1;--ui-radius:10px;--ui-control-radius:7px}
/* Shared site tools and real light surfaces; artwork is never colour-inverted. */
.site-tools{display:flex;align-items:center;gap:8px;margin-left:auto}
.site-tools .notice-link,.site-tools .theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:6px;box-sizing:border-box;min-height:40px;padding:7px 12px;border:1px solid var(--ui-line,#2c3747);border-radius:var(--ui-control-radius,7px);background:var(--ui-surface,#171e29);color:var(--ui-text,#e9edf5);text-decoration:none;font-family:inherit;font-size:13px;font-weight:650;line-height:1.4;white-space:nowrap;cursor:pointer}
.site-tools .notice-link.active,.site-tools .notice-link:hover,.site-tools .theme-toggle:hover{background:var(--ui-raised,#202a38);border-color:var(--ui-accent,#aac1ee)}
.topbar .viewnav a{word-break:keep-all;overflow-wrap:normal;white-space:normal;text-wrap:balance;line-height:1.4;min-width:0;text-align:center}
@media(max-width:760px){.topbar{gap:12px;flex-wrap:wrap}.topbar .viewnav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;order:2;gap:4px}.topbar .viewnav a{display:flex;align-items:center;justify-content:center;min-height:42px;padding:8px;font-size:13px}.topbar .site-tools{order:1;margin-left:auto}.topbar .local-status{order:3;width:100%;margin:0;text-align:right}}
@media(max-width:420px){.topbar .site-tools{width:100%;justify-content:flex-end}.site-tools .notice-link,.site-tools .theme-toggle{min-height:40px}}
html[data-theme="light"]{color-scheme:light;--bg:#f5f7fb;--panel:#fff;--line:#ccd5e2;--text:#202d40;--muted:#58677c;--accent:#365d9d;--purple:#66559c;--p:#216e61;--d:#365d9d;--m:#805f18;--surface:#fff;--accent-soft:#e8eef8;--accent-border:#9cb1d2;--ink-secondary:#47586d;--ui-canvas:#f5f7fb;--ui-surface:#fff;--ui-raised:#e9eef6;--ui-line:#ccd5e2;--ui-text:#202d40;--ui-muted:#58677c;--ui-accent:#365d9d;--ui-red:#ac3549;--ui-yellow:#805f18;--ui-green:#216e61}
html[data-theme="light"] body{background:var(--ui-canvas);color:var(--ui-text)}
html[data-theme="light"] :is(.heading,.hy-heading,.toolbar,.dialog-head,.dialog-footer,.nt-main,.dm-head-actions,.dm-title-row,.dm-library,.dm-search,.sim-heading) :is(button,.download-link,.file-label){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme="light"] :is(button.primary,#addRecord,.nt-actions .nt-send){background:var(--ui-accent);color:#fff;border-color:var(--ui-accent)}
html[data-theme="light"] :is(.viewnav a.active,.tabs button.active,.hy-list a.active,.deck-option.selected,.deck-chip){background:#e1eaf8;color:#294e87;border-color:#a9bedc}
html[data-theme="light"] :is(.brand-title,.brand-kicker,.hy-trap-heading b,.hy-ctile p,.hy-mobile-copy > p,.hy-flow-path b,.hy-hand-plan strong){color:var(--ui-text)}
html[data-theme="light"] :is(.local-status,.hy-src,.hy-sources summary,.hy-note,.hy-secnote,.hy-tactics p,.hy-tips li,.hy-matchup p,.site-credit){color:var(--ui-muted)}
html[data-theme="light"] :is(.toolbar,.hy-matchup,.hy-flow,.hy-tactics,.hy-hand-plan,.hy-hand-branches,.cm-invite,.my-block,.my-bar,.my-notice,.my-empty,.deck-section,.record,.dialog,.modal,.hy-theme-drawer){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme="light"] :is(.hy-overview-card,.hy-overview-item,.hy-overview-grid > *){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme="light"] :is(.hy-sevlabel.sev-r,.hy-chip.sev-r){background:#fbe7eb;color:var(--ui-red)}
html[data-theme="light"] :is(.hy-sevlabel.sev-y,.hy-chip.sev-y){background:#f7efd9;color:var(--ui-yellow)}
html[data-theme="light"] :is(.hy-sevlabel.sev-g,.hy-chip.sev-g){background:#e0f2e9;color:var(--ui-green)}
/* These selectors match existing priority overrides, retaining their geometry. */
html[data-theme="light"] .hy-sevgroups.is-packed .hy-sevgroup[data-sev="R"] .hy-ctile{background:#fff3f5!important}
html[data-theme="light"] .hy-sevgroups.is-packed .hy-sevgroup[data-sev="Y"] .hy-ctile{background:#fff9eb!important}
html[data-theme="light"] .hy-sevgroups.is-packed .hy-sevgroup[data-sev="G"] .hy-ctile{background:#eef8f2!important}
html[data-theme="light"] .hy-hero{--text:#e9edf5;--accent:#aac1ee;--bg:#0e131b;--ui-text:#e9edf5;--ui-muted:#a8b4c6;--ui-accent:#aac1ee}
html[data-theme="light"] .hy-hero .hy-hero-text h2,html[data-theme="light"] .hy-hero .hy-hero-meta p{color:#e9edf5}
html[data-theme="light"] .hy-hero :is(.hy-ygo-guide,.cm-meta-feedback){background:#192332e6;color:#d7e2f2;border-color:#405068}
html[data-theme="light"] :is(.nt-board,.nt-item,.nt-form){background:var(--ui-surface)}
html[data-theme="light"] .nt-field :is(select,textarea){background:var(--ui-canvas);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme="light"] .nt-msg{color:#984119}

html[data-theme="light"] .brand-title>span{color:var(--ui-accent)}
html[data-theme="light"] .nt-tabs button{background:transparent;color:var(--ui-muted)}
html[data-theme="light"] .nt-tabs button[aria-selected="true"]{background:var(--ui-surface);color:var(--ui-accent)}
html[data-theme="light"] :is(.my-set,.my-write,.my-build,.my-current){color:var(--ui-accent);border-color:var(--accent-border)}
html[data-theme="light"] :is(.my-block li,.my-empty){background:var(--ui-canvas)}
html[data-theme="light"] .deckmaker-page :is(.dm-detail,.dm-decks,.dm-search,.dm-card-art,.dm-dialog>div,.dm-mobile-sheet,.dm-mobile-detail,.dm-bottom-sheet){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme="light"] .deckmaker-page :is(.dm-head p,.dm-detail p,.dm-hint,.dm-switch,.dm-switch small,.dm-filter-row label,.dm-result small,.dm-kicker,.dm-zone h2 span,.dm-card-art span,.dm-steps){color:var(--ui-muted)}
html[data-theme="light"] .deckmaker-page :is(input,select,textarea){background:var(--ui-canvas);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme="light"] .deckmaker-page .dm-zone h2{border-color:var(--ui-line)}
html[data-theme="light"] .deckmaker-page .dm-result:hover{background:var(--ui-raised)}
html[data-theme="light"] .deckmaker-page .dm-head-actions button{color:var(--ui-text)}

/* Session metadata has its own minimum measure; groups wrap before text collapses. */
html:not(.sim-compact):not(.sim-rot) .sim-heading{flex-wrap:wrap;align-items:center;gap:10px 16px}
html:not(.sim-compact):not(.sim-rot) .sim-heading .session-meta{flex:1 1 180px;min-width:180px;max-width:260px}
html:not(.sim-compact):not(.sim-rot) .sim-heading .session-meta span{white-space:normal;word-break:keep-all;overflow-wrap:normal;line-height:1.5}
html:not(.sim-compact):not(.sim-rot) .sim-heading .session-actions{flex:0 1 auto;flex-wrap:wrap;max-width:100%}
html:not(.sim-compact):not(.sim-rot) .sim-heading .session-actions>button{white-space:nowrap}
html[data-theme="light"] .sim-page :is(.compact-menu summary,.menu-pop,.sim-guide,.sim-help,.sim-chooser,.sim-pile,.sim-menu,.sim-setupbar,.sim-modebar,.review-banner,.sim-tip){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line);box-shadow:none}
html[data-theme="light"] .sim-page .compact-menu.primary summary{background:var(--ui-accent);color:#fff;border-color:var(--ui-accent)}
html[data-theme="light"] .sim-page :is(.session-meta span,.sim-heading p,.sim-guide p,.sim-guide .g-next,.menu-pop small,.log-empty-guide,.log-tips,.sim-steps .hint){color:var(--ui-muted)}
html[data-theme="light"] .sim-page .sim-guide .g-step{background:var(--ui-raised);color:var(--ui-accent);border-color:var(--ui-line)}
html[data-theme="light"] .sim-page .sim-board-wrap{background:radial-gradient(ellipse at 50% 55%,#edf2fa,#e0e7f2 75%)}
html[data-theme="light"] .sim-page .sim-guide .g-btns button{background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme="light"] .sim-page .sim-guide .g-or button{color:var(--ui-accent)!important}
html[data-theme="light"] .sim-page :is(.sim-guide .guide-demo,.sim-guide .g-btns button.primary){background:var(--ui-accent)!important;color:#fff}
html[data-theme="light"] .sim-page :is(.zone,.zone.gylist){background:#e8eef7;border-color:#9eafc8}
html[data-theme="light"] .sim-page :is(.zone-label,.zone .label,.pilelabel,.hand-label){color:#53677f}

html[data-theme="light"] body.sim-page .topbar{background:var(--ui-canvas);border-color:var(--ui-line)}
html[data-theme="light"] body.sim-page .topbar .viewnav{background:var(--ui-surface);border-color:var(--ui-line)}
html[data-theme="light"] body.sim-page :is(.sim-side,.sim-log,.sim-steps,.resume-note,.log-selection){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme="light"] body.sim-page :is(.sim-steps .todo,.sim-steps .current-action,.log-state,.log-empty-guide,.sim-guide .g-next,.sim-guide .g-or,.sim-guide .g-or span){color:var(--ui-muted);border-color:var(--ui-line)}
html[data-theme="light"] body.sim-page .sim-steps [data-step]{color:var(--ui-muted)}
html[data-theme="light"] body.sim-page .sim-steps [data-step].on{background:var(--ui-raised)!important;color:var(--ui-accent)}
html[data-theme="light"] body.sim-page .sim .compact-menu.primary summary{background:var(--ui-accent);color:#fff;border-color:var(--ui-accent)}
html[data-theme="light"] body.sim-page .sim-guide .g-demo{background:var(--ui-accent);color:#fff;border-color:var(--ui-accent)}

html[data-theme="light"] body.sim-page .sim-steps [data-step].on{color:var(--ui-accent)!important}
html[data-theme="light"] body.sim-page .sim-view-options>summary{background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}

html[data-theme="light"] .topbar{background:var(--ui-canvas);border-color:var(--ui-line)}
html[data-theme="light"] .topbar .viewnav{background:var(--ui-surface);border-color:var(--ui-line)}

html[data-theme="light"] :is(.hy-heading h1,.hy-overview h3,.hy-matchup summary>strong,.hy-tile strong,.hy-trap-heading b){color:var(--ui-text)}
html[data-theme="light"] .hy-matchup.is-conditional summary>b{color:var(--ui-yellow)}
html[data-theme="light"] .hy-matchup.is-high summary>b{color:var(--ui-red)}
html[data-theme="light"] .hy-matchup.is-low summary>b{color:var(--ui-green)}
html[data-theme="light"] .hy-matchup summary::after{color:var(--ui-muted)}
html[data-theme="light"] .hy-hero .cm-deck{background:#192332e6;color:#d7e2f2;border-color:#405068}

/* Archive light surfaces: cover the full reading path, including desktop legacy rules. */
html[data-theme="light"] .hy-list{background:var(--ui-surface);border:1px solid var(--ui-line);scrollbar-color:#9dadc5 #eef2f8}
html[data-theme="light"] .hy-list a{color:var(--ui-text)}
html[data-theme="light"] .hy-list a:hover{background:var(--ui-raised)}
html[data-theme="light"] .hy-list a.active{background:#e1eaf8;color:#294e87}
html[data-theme="light"] .hy-side .search-wrap{background:var(--ui-surface);border-color:var(--ui-line);color:var(--ui-muted)}
html[data-theme="light"] .hy-side .search-wrap input{color:var(--ui-text)}
html[data-theme="light"] .hy-side .search-wrap input::placeholder{color:var(--ui-muted);opacity:1}
html[data-theme="light"] :is(.hy-list .hy-count,.hy-list .count,.hy-list .hy-badge){background:var(--ui-raised);color:var(--ui-muted)}
html[data-theme="light"] .hy-card{background:transparent}
html[data-theme="light"] :is(.hy-hand-branches h3,.hy-hand-plan h3,.hy-tactics h3,.hy-flow h3,.hy-legend h3,.hy-trap>small,.hy-overview>small,.hy-timing,.hy-chip,.hy-secnote,.hy-card .hy-sources,.hy-card .hy-sources summary,.hy-card .hy-note){color:var(--ui-text)}
html[data-theme="light"] :is(.hy-trap>small,.hy-overview>small,.hy-legend-note,.hy-hand-branches p,.hy-hand-plan p){color:var(--ui-muted)}
html[data-theme="light"] .hy-card .hy-secnote:not(:empty){background:var(--ui-raised);color:var(--ui-text)}
html[data-theme="light"] :is(.hy-hand-branches,.hy-hand-plan,.hy-tactics,.hy-flow){background:var(--ui-surface);border-color:var(--ui-line);color:var(--ui-text)}
html[data-theme="light"] .hy-card .hy-ctile .hy-timing{color:var(--ui-text)}
html[data-theme="light"] .hy-card .hy-ctile :is(p,strong,.hy-mobile-names){color:var(--ui-text)}
html[data-theme="light"] .hy-card :is(.hy-chip,.hy-matchup p,.hy-tips li){color:var(--ui-text)}
html[data-theme="light"] .hy-card .hy-mobile-footer :is(button,summary){color:var(--ui-muted)}
html[data-theme="light"] .hy-card .cm-sec.cm-sec{background:#e8eef8;color:#365d9d;border-color:#a9bedc}
html[data-theme="light"] :is(.cm-invite strong,.cm-invite p,.cm-thread,.cm-compose,.cm-help,.cm-empty,.hy-empty,.tour-feedback-deck,.tour-feedback-deck>div){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}

html[data-theme="light"] .hy-side .search-wrap #hySearch{background:transparent!important;color:var(--ui-text);border:0}
html[data-theme="light"] .hy-card .hy-note.hy-secnote:not(:empty){background:var(--ui-raised)!important;color:var(--ui-text)}
html[data-theme="light"] .hy-card .hy-secnote :is(b,strong,span,p){color:var(--ui-text)}
html[data-theme="light"] .hy-card .hy-timing::before{color:var(--ui-muted)}
html[data-theme="light"] :is(.hy-warning,.hy-no,.hy-avoid,.hy-empty){color:var(--ui-muted)}

html[data-theme="light"] .hy-card .hy-note.hy-secnote::before{color:var(--ui-accent)}

/* Paired semantic surfaces: preserve each component's emphasis in either mode. */
html[data-theme="light"]{--ui-canvas:#f1f4f8;--ui-raised:#e0e7f0;--ui-line:#b8c5d6;--ui-muted:#46576c;--muted:#46576c;--line:#b8c5d6;--ui-red:#963346;--ui-yellow:#76540e;--ui-green:#22674a;--hy-rule-section:#c0cad8;--hy-rule-inner:#c0cad8}
html[data-theme="light"] .hy-list .hy-item small{background:#dce5f0;color:#354c6c;border:1px solid #b6c6da;font-weight:600}
html[data-theme="light"] .hy-trap-heading .hy-trap-icons img{background:var(--ui-surface);border:1px solid #a7b6c9;box-shadow:0 0 0 2px var(--ui-canvas)}
html[data-theme="light"] .hy-hero [data-cm-jump]{background:#192332e6;color:#d7e2f2;border-color:#405068}
html[data-theme="light"] .hy-card .hy-trap>small,html[data-theme="light"] .hy-overview>small{color:var(--ui-muted)}
html[data-theme="light"] .hy-card .hy-secnote::before{color:#345784;font-weight:700}
html[data-theme="light"] .hy-card .hy-timing::before{color:#46576c}
html[data-theme="light"] .hy-card .hy-sevlabel{font-weight:700;border:1px solid currentColor}
html[data-theme="light"] .hy-sevgroups.is-packed .hy-sevgroup[data-sev="R"] .hy-ctile{background:#f0d5dc!important;border:0!important}
html[data-theme="light"] .hy-sevgroups.is-packed .hy-sevgroup[data-sev="Y"] .hy-ctile{background:#f0e2b6!important;border:0!important}
html[data-theme="light"] .hy-sevgroups.is-packed .hy-sevgroup[data-sev="G"] .hy-ctile{background:#d1e5d9!important;border:0!important}
html[data-theme="light"] .hy-card .hy-mobile-footer :is(button,summary){color:#3e5068}
html[data-theme="light"] :is(.board-scroll,.board .year,.board .month,.board .corner){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme="light"] .board .year small{background:var(--ui-raised);color:var(--ui-muted)}
html[data-theme="light"] .board .empty-cell{border-color:#d3dce7}
html[data-theme="light"] .board .empty-cell button{background:transparent;color:#657c9a;border:1px dashed #c5d1e0;border-radius:7px}
html[data-theme="light"] .board .empty-cell button:hover{background:#e1eaf8;color:#294e87;border-color:#7392bd}
html[data-theme="light"] .toolbar .range input{background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme="light"] :is(.merge-control,.legend,.board-footer,.bottom-note,.sample-note){color:var(--ui-muted)}
html[data-theme="light"] .board-heading .tabs{background:var(--ui-raised);padding:4px;border-radius:7px;gap:4px}
html[data-theme="light"] .board-heading .tabs button{border:0;border-radius:5px;padding:8px 12px;color:var(--ui-muted)}
html[data-theme="light"] .board-heading .tabs button.active{background:#fff;color:#294e87;box-shadow:0 1px 3px #19365418}
html[data-theme="light"] .board-scroll{scrollbar-color:#91a4c0 #e8eef6}
html[data-theme="light"] .dialog-body :is(input,select,textarea){background:var(--ui-canvas);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme="light"] :is(.deck-option,.template-entry,.era-list){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme="light"] .hy-card .hy-overview-grid .hy-matchup{border:1px solid #b8c5d6;border-top:3px solid #77869b}
html[data-theme="light"] .hy-card .hy-overview-grid .hy-matchup.is-high{border-top-color:#b94d60}
html[data-theme="light"] .hy-card .hy-overview-grid .hy-matchup.is-low{border-top-color:#428264}

html[data-theme="light"] .hy-card :is(.cm-btn,.branch-help,.hy-matchup .cm-ov){background:#e0e8f3;color:#294e7f;border-color:#a4b8d3}
html[data-theme="light"] .hy-card :is(.cm-btn,.branch-help):hover{background:#cad9ee;color:#203e67}
html[data-theme="light"] .hy-hero :is(.cm-btn,[data-cm-jump]){background:#192332e6;color:#d7e2f2;border-color:#405068}
html[data-theme="light"] .hy-card .hy-sevlabel.sev-r{color:#963346;border-color:#c38491}
html[data-theme="light"] .hy-card .hy-sevlabel.sev-y{color:#76540e;border-color:#bda767}
html[data-theme="light"] .hy-card .hy-sevlabel.sev-g{color:#22674a;border-color:#86b09b}
html[data-theme="light"] .hy-tile-art img:not(.hy-ban){box-shadow:0 2px 5px #26384c30}

html[data-theme="light"] :is(dialog,.dialog-head,.dialog-body,.dialog-footer,.confirmation){background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme="light"] :is(.dialog-head h2,.dialog-body label,.section-label h3,.confirmation h2,.confirmation p,.rank-context,.rating-toggle){color:var(--ui-text)}
html[data-theme="light"] .dialog-body .search-wrap{background:var(--ui-canvas);color:var(--ui-muted);border-color:var(--ui-line)}
html[data-theme="light"] .dialog-body .search-wrap input{background:transparent!important;color:var(--ui-text)}
html[data-theme="light"] .dialog-body :is(.form-hint,.muted,.section-label span,.rank-context small){color:var(--ui-muted)}

html[data-theme="light"] .deckmaker-page :is(.dm-detail,.dm-decks,.dm-search){border:1px solid var(--ui-line);border-radius:10px;box-shadow:0 2px 8px #253d5710}
html[data-theme="light"] .deckmaker-page :is(.dm-zone h2,.dm-card-art,.dm-odds-result>div){background:var(--ui-raised);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme="light"] .deckmaker-page :is(.dm-detail-actions,.dm-head-actions,.dm-library,.dm-search) button{background:#e0e8f3;color:#294e7f;border-color:#a4b8d3}
html[data-theme="light"] .deckmaker-page :is(.dm-detail-actions,.dm-head-actions,.dm-library,.dm-search) button:hover{background:#cad9ee}
html[data-theme="light"] .deckmaker-page :is(.dm-head-actions details>summary,.dm-import-menu>summary){background:#e0e8f3;color:#294e7f;border-color:#a4b8d3}
html[data-theme="light"] .deckmaker-page :is(.dm-empty,.dm-steps,.dm-zone h2 span,.dm-hint,.dm-card-art span){color:var(--ui-muted)}
html[data-theme="light"] .deckmaker-page .dm-head-actions button.primary{background:var(--ui-accent);color:#fff}
html[data-theme="light"] :is(.sim-page .duel-hud,.sim-page .sim-log-head,.sim-page .pane-title){background:var(--ui-raised);color:var(--ui-text);border-color:var(--ui-line)}

/* Priority stays on the card name, as in the original; no extra leading stripe. */
html[data-theme="light"] .hy-sevgroups.is-packed .hy-sevgroup[data-sev="R"] .hy-ctile :is(.hy-tile strong,.hy-mobile-names){color:#9a283e}
html[data-theme="light"] .hy-sevgroups.is-packed .hy-sevgroup[data-sev="Y"] .hy-ctile :is(.hy-tile strong,.hy-mobile-names){color:#78530b}
html[data-theme="light"] .hy-sevgroups.is-packed .hy-sevgroup[data-sev="G"] .hy-ctile :is(.hy-tile strong,.hy-mobile-names){color:#216847}
html[data-theme="light"] .sim-page :is(.sim-side,.sim-log,.duel-hud) :is(h2,h3,p,span,label,b,small){color:var(--ui-text)}
html[data-theme="light"] .sim-page :is(.sim-side,.sim-log,.resume-note,.duel-hud) button:not(.sc){background:#e0e8f3;color:#294e7f;border-color:#a4b8d3}
html[data-theme="light"] .sim-page :is(.resume-note,.sim-side) button.primary{background:var(--ui-accent);color:#fff}
html[data-theme="light"] .sim-page :is(.sim-hint,.shot-d,.pane-title span,.sim-log .log-state){color:var(--ui-muted)}

/* Preserve the original overview states in both text and edge color. */
html[data-theme="light"] .hy-card .hy-overview-grid .hy-matchup.is-high{border-top-color:#a52d43}
html[data-theme="light"] .hy-card .hy-overview-grid .hy-matchup.is-conditional{border-top-color:#91690f}
html[data-theme="light"] .hy-card .hy-overview-grid .hy-matchup.is-low{border-top-color:#28714f}
html[data-theme="light"] .hy-card .hy-overview-grid .hy-matchup.is-high b{color:#98253b}
html[data-theme="light"] .hy-card .hy-overview-grid .hy-matchup.is-conditional b{color:#79530a}
html[data-theme="light"] .hy-card .hy-overview-grid .hy-matchup.is-low b{color:#216847}
html[data-theme="light"] .hy-card .hy-overview-grid :is(.hy-matchup.is-unknown,.hy-matchup.is-unclassified){border-top-color:#718197;border-top-style:dashed}
html[data-theme="light"] .hy-card .hy-overview-grid :is(.hy-matchup.is-unknown,.hy-matchup.is-unclassified) b{color:#46576c}
html[data-theme="light"] .hy-card :is(.hy-overview>small,.hy-src,.hy-sources summary,.hy-timing-label){color:#46576c}
html[data-theme="light"] .hy-card :is(.hy-ctile p,.hy-ctile .hy-timing,.hy-secnote){font-weight:500}
/* Light mode keeps illustration highlights; shade is concentrated behind text. */
html[data-theme="light"] .hy-card .hy-hero .hy-hero-shade{background:linear-gradient(90deg,rgba(0,0,0,.48),rgba(0,0,0,.16) 36%,transparent 68%),linear-gradient(0deg,rgba(0,0,0,.58),rgba(0,0,0,.10) 43%,transparent 72%)}
html[data-theme="light"] .hy-card .hy-hero.my-vs-on .my-vs-slab::after{background:linear-gradient(0deg,rgba(9,15,24,.60),rgba(9,15,24,.22) 28%,transparent 60%)}
@media(max-width:650px){html[data-theme="light"] .hy-card .hy-hero .hy-hero-shade{background:linear-gradient(0deg,rgba(9,15,24,.72),rgba(9,15,24,.14) 52%,transparent 80%)}}

html[data-theme="light"] .hy-card .hy-sevgroup[data-sev="N"] .hy-ctile{background:#e1e7ef!important;border:0!important}
html[data-theme="light"] .hy-card :is(.hy-sevlabel.sev-n,.hy-chip.sev-n){background:#e1e7ef;color:#46576c;border-color:#a9b8ca}
html[data-theme="light"] .hy-card .hy-sevgroup[data-sev="N"] .hy-ctile :is(strong,.hy-mobile-names){color:#34455e}
html[data-theme="light"] .hy-card .hy-ctile :is(.hy-src,.hy-timing-label,small){color:#46576c}
html[data-theme="light"] .hy-card .hy-ctile .hy-srcline{border-color:#b9c6d6}

/* First visit and tutorial share the same light surfaces and severity palette. */
html[data-theme="light"] .hy-empty .hy-general{background:var(--ui-surface);color:var(--ui-text);border-color:var(--ui-line)}
html[data-theme="light"] .hy-empty :is(p,.hy-general small){color:#46576c}
html[data-theme="light"] .hy-empty .hy-tile.sev-r{background:#f0d5dc;border-color:#a52d43}
html[data-theme="light"] .hy-empty .hy-tile.sev-r strong{color:#98253b}
html[data-theme="light"] .hy-empty .hy-chip.sev-n{background:#e1e7ef;color:#46576c;border-color:#a9b8ca}
html[data-theme="light"] dialog.help-tour{background:transparent;color:var(--ui-text)}
html[data-theme="light"] dialog.help-tour :is(.tour-tip){background:#fff;color:#202d40;border-color:#8ea6c7;box-shadow:0 12px 40px #172c4c30}
html[data-theme="light"] dialog.help-tour :is(.tour-tip h2,.tour-tip p){color:#202d40}
html[data-theme="light"] dialog.help-tour :is(.tour-top,.tour-top button){color:#365d9d}
html[data-theme="light"] dialog.help-tour .tour-nav button{background:#e0e8f3;color:#294e7f;border-color:#a4b8d3}
html[data-theme="light"] dialog.help-tour .tour-nav button.primary{background:#365d9d;color:#fff}
html[data-theme="light"] dialog.help-tour .tour-nav button:disabled{opacity:1;background:#edf0f4;color:#64748a}
html[data-theme="light"] dialog.help-tour .tour-tip button:focus-visible{outline-color:#365d9d}
html[data-theme="light"] dialog.help-tour .tour-ring{border-color:#365d9d;box-shadow:0 0 0 9999px #24344c80}
html[data-theme="light"] dialog.help-tour:is(.tour-no-target,.tour-feedback-overview){background:#24344c80}
html[data-theme="light"] :is(.tour-feedback-example,.feedback-map){background:#e0e8f3;color:#294e7f;border-color:#a4b8d3}

html[data-theme="light"] :is(.hy-sevlabel.sev-r,.hy-chip.sev-r){background:#f0d5dc;color:#98253b;border-color:#b95065}
html[data-theme="light"] :is(.hy-sevlabel.sev-y,.hy-chip.sev-y){background:#f0e2b6;color:#704b00;border-color:#a17b20}
html[data-theme="light"] :is(.hy-sevlabel.sev-g,.hy-chip.sev-g){background:#d1e5d9;color:#195b3e;border-color:#4b9370}

/* Dark counterparts retain the same severity meaning with clearer hue separation. */
html:not([data-theme="light"]) .hy-sevgroups.is-packed .hy-sevgroup[data-sev="R"] .hy-ctile{background:#482630!important}
html:not([data-theme="light"]) .hy-sevgroups.is-packed .hy-sevgroup[data-sev="Y"] .hy-ctile{background:#443b1d!important}
html:not([data-theme="light"]) .hy-sevgroups.is-packed .hy-sevgroup[data-sev="G"] .hy-ctile{background:#1d4033!important}
html:not([data-theme="light"]) .hy-sevgroups.is-packed .hy-sevgroup[data-sev="N"] .hy-ctile{background:#273244!important}
html:not([data-theme="light"]) .hy-sevgroup[data-sev="R"] .hy-ctile :is(.hy-tile strong,.hy-mobile-names){color:#ffb8c6}
html:not([data-theme="light"]) .hy-sevgroup[data-sev="Y"] .hy-ctile :is(.hy-tile strong,.hy-mobile-names){color:#f7df8c}
html:not([data-theme="light"]) .hy-sevgroup[data-sev="G"] .hy-ctile :is(.hy-tile strong,.hy-mobile-names){color:#a6e5c3}
html:not([data-theme="light"]) .hy-sevgroup[data-sev="N"] .hy-ctile :is(.hy-tile strong,.hy-mobile-names){color:#d7e2f1}
html:not([data-theme="light"]) .hy-card .hy-sevlabel.sev-r{background:#482630;color:#ffb8c6;border-color:#d66981}
html:not([data-theme="light"]) .hy-card .hy-sevlabel.sev-y{background:#443b1d;color:#f7df8c;border-color:#c7a840}
html:not([data-theme="light"]) .hy-card .hy-sevlabel.sev-g{background:#1d4033;color:#a6e5c3;border-color:#5fae87}
html:not([data-theme="light"]) .hy-card .hy-sevlabel.sev-n{background:#273244;color:#d7e2f1;border-color:#7c90af}

/* Existing mobile hint color is important; pair it with a readable light counterpart. */
html[data-theme="light"] .hy-card .hy-trap>small{color:#46576c!important;font-weight:500}

/* Overview uses a quiet status tint, with dark text in light mode. */
html[data-theme="light"] .hy-card .hy-overview-grid .hy-matchup.is-high{background:#f8e4e9}
html[data-theme="light"] .hy-card .hy-overview-grid .hy-matchup.is-conditional{background:#f8efcf}
html[data-theme="light"] .hy-card .hy-overview-grid .hy-matchup.is-low{background:#e1efe7}
html[data-theme="light"] .hy-card .hy-overview-grid .hy-matchup summary>strong{color:#202d40}
html[data-theme="light"] .hy-card .hy-overview-grid .hy-matchup summary>b{font-weight:750}
html[data-theme="light"] .hy-card .hy-overview-grid .hy-matchup summary::after{color:#46576c}
html:not([data-theme="light"]) .hy-card .hy-overview-grid .hy-matchup.is-high{background:#35242d;border-top-color:#da7890}
html:not([data-theme="light"]) .hy-card .hy-overview-grid .hy-matchup.is-conditional{background:#343020;border-top-color:#c7aa56}
html:not([data-theme="light"]) .hy-card .hy-overview-grid .hy-matchup.is-low{background:#20372e;border-top-color:#67b38d}
html:not([data-theme="light"]) .hy-card .hy-overview-grid .hy-matchup.is-high b{color:#ffb8c6}
html:not([data-theme="light"]) .hy-card .hy-overview-grid .hy-matchup.is-conditional b{color:#f7df8c}
html:not([data-theme="light"]) .hy-card .hy-overview-grid .hy-matchup.is-low b{color:#a6e5c3}
html:not([data-theme="light"]) .hy-card .hy-overview-grid .hy-matchup summary>strong{color:#eef2f8}
html:not([data-theme="light"]) .hy-card .hy-overview-grid .hy-matchup summary::after{color:#c2ccdc}

/* Card copy needs its own contrast against severity-tinted surfaces. */
html[data-theme="light"] .hy-card .hy-ctile :is(p,.hy-timing,.hy-mobile-copy){color:#263447}
html[data-theme="light"] .hy-card .hy-ctile :is(.hy-timing-label,.hy-src,.hy-sources summary,small){color:#35465c;opacity:1;font-weight:500}
html:not([data-theme="light"]) .hy-card .hy-ctile :is(p,.hy-timing,.hy-mobile-copy){color:#e4eaf2}
html:not([data-theme="light"]) .hy-card .hy-ctile :is(.hy-timing-label,.hy-src,.hy-sources summary,small){color:#cbd5e3;opacity:1;font-weight:500}

html[data-theme="light"] .hy-card .hy-ctile .hy-timing{color:#263447;font-weight:650}
html[data-theme="light"] .hy-card .hy-ctile .hy-timing::before{color:#35465c;font-weight:500}
html:not([data-theme="light"]) .hy-card .hy-ctile .hy-timing{color:#e4eaf2;font-weight:650}
html:not([data-theme="light"]) .hy-card .hy-ctile .hy-timing::before{color:#cbd5e3;font-weight:500}

/* Light theme finish: neutral surfaces, quiet cool accents, readable art controls. */
html[data-theme="light"]{--bg:#f3f4f6;--panel:#fff;--line:#bfc8d4;--text:#243247;--muted:#46566c;--ui-canvas:#f3f4f6;--ui-surface:#fff;--ui-raised:#e8ecf1;--ui-line:#bfc8d4;--ui-text:#243247;--ui-muted:#46566c;--hy-rule-line:#c9d0da}
html[data-theme="light"] .hy-card .hy-secnote{background:#e8ecf1!important;color:#263447}
html[data-theme="light"] .hy-hero.my-vs-on .my-vs-badge{-webkit-text-stroke:.6px #263447; text-shadow:2px 3px 0 #263447,0 3px 9px #18273966}
html[data-theme="light"] .hy-hero.my-vs-on .my-vs-slab{filter:drop-shadow(5px 0 6px #17283b55)}
html[data-theme="light"] .hy-hero.my-vs-on .my-vs-line{filter:drop-shadow(1px 0 3px #17283b66)}
html[data-theme="light"] .hy-card .hy-hero :is(.hy-ygo-guide,.cm-meta-feedback,.cm-btn,[data-cm-jump]){background:#f4f6faed;color:#253d5b;border-color:#b1bdcc;text-shadow:none;box-shadow:0 1px 4px #15223825}
html[data-theme="light"] .hy-card .hy-hero :is(.hy-ygo-guide,.cm-meta-feedback,.cm-btn,[data-cm-jump]):hover{background:#fff;color:#203d67;border-color:#8198b7}
html[data-theme="light"] .hy-card .hy-hero :is(.hy-hero-text>small,.my-vs-bottom .hy-hero-text>small){color:#e2eaf6;text-shadow:0 1px 4px #182438}
html[data-theme="light"] .hy-card .hy-hero .hy-hero-shade{background:linear-gradient(90deg,rgba(19,30,45,.35),rgba(19,30,45,.10) 36%,transparent 68%),linear-gradient(0deg,rgba(19,30,45,.62),rgba(19,30,45,.12) 43%,transparent 72%)}
html[data-theme="light"] .hy-card .hy-hero.my-vs-on .my-vs-slab::after{background:linear-gradient(0deg,rgba(19,30,45,.64),rgba(19,30,45,.18) 30%,transparent 62%)}
@media(max-width:650px){html[data-theme="light"] .hy-card .hy-hero .hy-hero-shade{background:linear-gradient(0deg,rgba(19,30,45,.74),rgba(19,30,45,.14) 52%,transparent 80%)}}

html[data-theme="light"] .hy-card .hy-hero.my-vs-on .my-vs-bottom .hy-hero-meta>:is(.hy-ygo-guide,.cm-meta-feedback){background:#f4f6faed;color:#253d5b;border-color:#b1bdcc;text-shadow:none;box-shadow:0 1px 4px #15223825}
html[data-theme="light"] .hy-card .hy-hero.my-vs-on .my-vs-bottom .hy-hero-meta>:is(.hy-ygo-guide,.cm-meta-feedback):hover{background:#fff;color:#203d67;border-color:#8198b7}

html[data-theme="light"] :is(img.brand-symbol,.hy-empty-icon>img){content:url('/brand-symbol-light.svg?v=2d9c71a749');filter:none}
html[data-theme="light"] .brand:hover .brand-symbol{filter:none}
html[data-theme="light"] .brand-kicker{color:#526078}
html[data-theme="light"] .brand-title{color:#25334a}
html[data-theme="light"] .brand-title>span{color:#65518b}

/* Tutorial snapshots lack is-packed; match the severity carried by their cards. */
html[data-theme="light"] .hy-card .hy-sevgroup:has(.sev-r) .hy-ctile{background:#f0d5dc!important}
html[data-theme="light"] .hy-card .hy-sevgroup:has(.sev-y) .hy-ctile{background:#f0e2b6!important}
html[data-theme="light"] .hy-card .hy-sevgroup:has(.sev-g) .hy-ctile{background:#d1e5d9!important}
html[data-theme="light"] .hy-card .hy-sevgroup:has(.sev-n) .hy-ctile{background:#e1e7ef!important}
html[data-theme="light"] .hy-card .hy-sevgroup:has(.sev-r) .hy-ctile strong{color:#98253b}
html[data-theme="light"] .hy-card .hy-sevgroup:has(.sev-y) .hy-ctile strong{color:#704b00}
html[data-theme="light"] .hy-card .hy-sevgroup:has(.sev-g) .hy-ctile strong{color:#195b3e}
html[data-theme="light"] .feedback-map :is(.fm-hero,.fm-draw,.fm-deck){background:#fff;color:#243247;border:1px solid #bfc8d4}
html[data-theme="light"] .feedback-map :is(b,small){color:#35465c}
html[data-theme="light"] .feedback-map .fm-pin{background:#dae5f3;color:#294e7f;border-color:#8fa7c7}
html[data-theme="light"] .feedback-map .fm-deck>div{background:#e8ecf1;color:#35465c}
html[data-theme="light"] .deckmaker-page :is(.dm-steps,.dm-head p,.dm-kicker,.dm-detail p,.dm-hint,.dm-switch small,.dm-empty,.dm-search-section,#dmRelatedHeader small){color:#46576c}
html[data-theme="light"] .deckmaker-page .dm-toolbar-tools svg{color:#365d9d}
html[data-theme="light"] .deckmaker-page button:disabled{opacity:1;background:#edf0f4;color:#5c6b80;border-color:#c1cad6}
html[data-theme="light"] .deckmaker-page button:disabled svg{color:#5c6b80}
html[data-theme="light"] .deckmaker-page .dm-main-subhead{background:#eee7dd;color:#735127}
html[data-theme="light"] .deckmaker-page .dm-main-subhead.dm-type-spell{background:#dcece5;color:#216847}
html[data-theme="light"] .deckmaker-page .dm-main-subhead.dm-type-trap{background:#ecdeeb;color:#76376d}
html[data-theme="light"] .deckmaker-page #dmRelatedHeader{background:#e0e8f3;color:#243247;border-color:#a4b8d3}
html[data-theme="light"] .sim-menu{background:#fff;color:#243247;border-color:#a8b6ca;box-shadow:0 8px 24px #23344b30}
html[data-theme="light"] .sim-menu button{background:#e7ecf3;color:#243247;border-color:#b5c1d2}
html[data-theme="light"] .sim-menu button:hover{background:#d6e2f2;border-color:#819abb}
html[data-theme="light"] .sim-menu :is(small,kbd,.menu-section){color:#46576c;opacity:1}
html[data-theme="light"] .sim-menu hr{border-color:#c5cedb}
html[data-theme="light"] .sim-menu button[data-a="act"]{background:#365d9d;color:#fff;border-color:#365d9d}
html[data-theme="light"] .sim-menu button[data-a="del"]{color:#98253b}
html[data-theme="light"] .sim :is(#bDraw5,#bDraw1,#duelSideSwitch,#opDeckApply,#setupDone,#bTurn,#bSetup,#bPick,#bShuffle,#bMill,#bExcav,#reviewOpen)::before,
html[data-theme="light"] .sim-steps [data-step]::before,
html[data-theme="light"] .sim .op-deck-setup summary::before{filter:brightness(.42) saturate(.75)}

html[data-theme="light"] .deckmaker-page :is(.dm-workflow,.dm-workflow b){color:#46576c}
html[data-theme="light"] .deckmaker-page #dmMain:empty::before{color:#46576c}
html[data-theme="light"] .deckmaker-page :is(input,textarea)::placeholder{color:#65748a;opacity:1}
html[data-theme="light"] .deckmaker-page button:disabled{box-shadow:none}

html[data-theme="light"] .sim :is(.sim-setupbar,.sim-bar,.sim-duelbar){background:#e8ecf1;color:#243247;border-color:#b5c1d2}
html[data-theme="light"] .sim :is(.sim-setupbar,.sim-bar,.sim-duelbar) button{background:#e0e8f3;color:#294e7f;border-color:#a4b8d3}
html[data-theme="light"] .sim .field-tools button{background:#edf2f8;color:#365d9d;border-color:#829cbd;box-shadow:0 2px 6px #23344b25}
html[data-theme="light"] .sim .field-tools button:is(:hover,.on){background:#d5e3f4;box-shadow:0 2px 8px #23344b30}
html[data-theme="light"] .sim .field-tools span{color:#294e7f}
html[data-theme="light"] .sim .cell[data-zone]>.label{color:#46576c}

html[data-theme="light"] .sim #bDraw5{background:#365d9d;color:#fff;border-color:#365d9d}
html[data-theme="light"] .sim :is(#bDraw5,#reviewOpen)::before{filter:brightness(1.8)}

/* Complete light surfaces, including sheets and nested simulator controls. */
html[data-theme="light"] .deckmaker-page :is(.dm-grid .dm-detail,.dm-detail #dmCardName,#dmFilters){background:#fff;color:#243247;border-color:#b6c2d0;box-shadow:0 8px 28px #26344718}
html[data-theme="light"] .deckmaker-page :is(#dmCardText,.dm-card-meta,.dm-tags small,#dmBookmark){color:#35465c;opacity:1}
html[data-theme="light"] .deckmaker-page #dmToast{background:#365d9d;color:#fff}
html[data-theme="light"] :is(.sim-help-box,.duel-prep-box,.menu-pop,.sim .sim-steps .sim-view-options .view,.reset-tools>div){background:#fff;color:#243247;border-color:#b6c2d0;box-shadow:0 12px 36px #26344726}
html[data-theme="light"] :is(.sim-help-box p,.sim-dlg .dlg-text,.duel-prep-lead,.duel-prep-grid p,.duel-prep-grid small,.menu-pop small){color:#46566c;opacity:1}
html[data-theme="light"] .duel-prep-grid section{background:#f1f4f8;border-color:#c0cad7;color:#243247}
html[data-theme="light"] :is(.duel-prep-grid select,.sim-dlg input){background:#fff;color:#243247;border-color:#9dadc2}
html[data-theme="light"] :is(.sim-help-box button,.duel-prep-box button,.sim .menu-pop button,.sim .sim-phase button,.sim .sim-play button,.sim .sim-play select){background:#e7edf5;color:#294567;border-color:#a8b9d0}
html[data-theme="light"] :is(.sim-help-box button.primary,.duel-prep-box button.primary,.sim .sim-play button.primary,.sim .sim-phase .ph button.on){background:#365d9d;color:#fff;border-color:#365d9d}
html[data-theme="light"] .sim :is(.sim-phase,.sim-play){background:#e8ecf1;border-color:#b6c2d0;box-shadow:none}
html[data-theme="light"] .sim :is(#turnLabel,#pStep,.side-control,.sim-view-options label){color:#35465c}
html[data-theme="light"] .sim .cell :is(.pile-label,.pile-count,.zone-label){color:#35465c}
html[data-theme="light"] .duel-hud{box-shadow:0 3px 12px #26344720;border-color:#b1becd}
html[data-theme="light"] .duel-hud .hud-cover:empty{background:linear-gradient(145deg,#e5eaf2,#cad5e3);border:1px solid #a5b4c9;box-sizing:border-box}
.dm-mobile-tabs{display:none}
@media(max-width:959px) and (min-height:601px){
.deckmaker-page .topbar,.deckmaker-page .dm-head>div:first-child{display:none}
.deckmaker-page .dm-mobile-bar{display:flex;position:sticky;top:0;z-index:80;align-items:center;gap:6px;padding:8px 10px;background:#171e29;border-bottom:1px solid #405064;flex-wrap:wrap}
.dm-mobile-bar strong{margin-right:auto;font-size:17px}.dm-mobile-bar button{min-height:40px}.dm-mobile-bar a{display:none}
.dm-mobile-tabs{display:flex;gap:6px;padding:10px;background:#171e29;position:sticky;top:57px;z-index:75}
.dm-mobile-tabs button{flex:1;min-height:44px;font-weight:700;border-radius:10px}
.dm-mobile-tabs button[aria-selected="true"]{background:#365d9d;color:#fff;border-color:#6689bb}
.deckmaker-page .dm-shell{padding:0 10px 24px}.deckmaker-page .dm-head{display:contents}
.deckmaker-page .dm-grid{display:block}.deckmaker-page .dm-decks,.deckmaker-page .dm-search{padding:12px;border-radius:12px;min-height:0}
.deckmaker-page:not(.dm-search-view) .dm-search,.deckmaker-page.dm-search-view .dm-decks{display:none}
.deckmaker-page .dm-head-actions,.deckmaker-page .dm-mobile-management{display:none;position:fixed;inset:65px 10px auto;max-height:calc(100dvh - 85px);overflow:auto;padding:16px;z-index:9100;background:#172333;border:1px solid #637c96;border-radius:14px;box-sizing:border-box}
.deckmaker-page.dm-mobile-tools-open .dm-head-actions{display:flex;flex-direction:column;align-items:stretch;gap:10px}
.deckmaker-page.dm-mobile-manage-open .dm-mobile-management{display:block}
.deckmaker-page .dm-mobile-panel-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.dm-mobile-panel-title button{width:44px;height:44px}
.deckmaker-page .dm-workflow{display:none}.deckmaker-page .dm-toolbar-tools{display:grid;grid-template-columns:1fr;gap:8px}.deckmaker-page .dm-toolbar-tools button{justify-content:flex-start;min-height:48px}
.deckmaker-page .dm-title-row{flex-wrap:nowrap}.deckmaker-page .dm-title-row input{flex:1;min-height:44px;font-size:16px}.deckmaker-page #dmSave{min-height:44px;white-space:nowrap}
.deckmaker-page .dm-cards{grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}.deckmaker-page #dmMain{min-height:110px}
.deckmaker-page .dm-search #dmQuery{min-height:48px;font-size:16px}.deckmaker-page .dm-search #dmResults:not(:empty){grid-template-columns:repeat(4,minmax(0,1fr));max-height:none;overflow:visible}
.deckmaker-page .dm-search-tools button,.deckmaker-page .dm-search-tabs button{min-height:44px}
.deckmaker-page.dm-sheet-open .dm-grid .dm-detail{max-height:88dvh;padding:16px 16px 22px;border-radius:20px 20px 0 0}
.deckmaker-page .dm-detail #dmCardName{order:-2;margin:0;padding:0 48px 0 0;min-height:40px;font-size:20px}
.deckmaker-page .dm-detail .dm-mobile-close{position:absolute;right:12px;top:12px}
.deckmaker-page .dm-card-art{height:200px;background:#e8ecf1;border-radius:12px;margin-top:4px}.deckmaker-page .dm-card-art img{height:190px}
.deckmaker-page .dm-detail #dmCardText{max-height:none;overflow:visible;font-size:14px;line-height:1.8;padding:12px 0;margin:0}
.deckmaker-page .dm-detail-actions{position:sticky;bottom:-22px;padding:10px 0 18px;background:#172333;z-index:2;order:10}
.deckmaker-page .dm-detail-actions button{min-height:48px;font-size:14px}
html[data-theme="light"] .deckmaker-page :is(.dm-mobile-bar,.dm-mobile-tabs){background:#f3f4f6;color:#243247;border-color:#c0cad7}
html[data-theme="light"] .deckmaker-page .dm-detail-actions{background:#fff}
}

html[data-theme="light"] .deckmaker-page :is(.dm-mobile-bar button,.dm-mobile-tabs button,.dm-detail .dm-mobile-close,#dmBookmark){background:#e7edf5;color:#294567;border-color:#a8b9d0}
html[data-theme="light"] .deckmaker-page .dm-mobile-tabs button[aria-selected="true"]{background:#365d9d;color:#fff;border-color:#365d9d}
html[data-theme="light"] .deckmaker-page .dm-tags{background:#eef2f7;color:#243247;border-color:#bac7d7}
html[data-theme="light"] .deckmaker-page .dm-tags :is(b,small,label,span){color:#35465c}
html[data-theme="light"] .deckmaker-page .dm-card-meta :is(span,b){background:#e7edf5;color:#35465c;border-color:#a8b9d0}
html[data-theme="light"] .deckmaker-page .dm-tags label:has(input:checked){background:#d5e5f5;border-color:#527aa6}
@media(max-width:959px) and (min-height:601px){.deckmaker-page #dmMobileImport{display:none}.deckmaker-page .dm-mobile-bar{flex-wrap:nowrap;height:57px}.deckmaker-page .dm-mobile-bar button{white-space:nowrap;font-size:12px}.deckmaker-page .dm-detail-actions button:disabled{opacity:1}}

html[data-theme="light"] .deckmaker-page .dm-mobile-tabs button[aria-selected="true"]{background:#365d9d!important;color:#fff!important;border-color:#365d9d!important}
.deckmaker-page .dm-mobile-panel-title button{flex:0 0 44px!important;width:44px!important}
html[data-theme="light"] .sim :is(#duelSide,.side-label,.sim-bar .muted){color:#46566c;opacity:1}
html[data-theme="light"] .sim input[type="checkbox"]{accent-color:#365d9d}

html[data-theme="light"] :is(.cm-sg-body,.cm-sg-q,.cm-form textarea){background:#f5f7fa!important;color:#243247!important;border-color:#a8b9d0!important;box-sizing:border-box}
html[data-theme="light"] :is(.cm-sg-body,.cm-sg-q,.cm-form textarea)::placeholder{color:#5a687c;opacity:1}
html[data-theme="light"] :is(.cm-guide,.cm-sg-sub,.cm-sg-none,.cm-sg-opt summary small){color:#46566c!important;opacity:1}
html[data-theme="light"] :is(.cm-sg-ht button,.cm-sg-rank button,.cm-sg-res button){background:#edf2f8;color:#294567;border-color:#a8b9d0}
html[data-theme="light"] :is(.cm-sg-ht button.on,.cm-sg-rank button.on){background:#365d9d;color:#fff;border-color:#365d9d}
html[data-theme="light"] .cm-send:disabled{opacity:1;background:#e1e7ef!important;color:#56657a!important;border:1px solid #bdc7d4;cursor:not-allowed}

/* Compact trap heading: feedback stays beside the name without inflating the row. */
.hy-card .hy-trap{row-gap:3px!important;align-items:start}
.hy-card .hy-trap>.cm-sec.cm-sec{min-height:28px!important;padding:3px 8px!important;white-space:nowrap!important;font-size:11px}
.hy-card .hy-trap>.cm-sec.cm-sec>.cm-sl{white-space:nowrap;font-size:11px}
.hy-card .hy-trap>.hy-trap-heading>b{line-height:1.35}
.hy-card .hy-trap>small{margin:0!important;line-height:1.5}
.hy-card .hy-tactics{border:1px solid var(--ui-line);border-radius:12px;padding:14px 16px;margin:18px var(--hy-inset) 24px}
.hy-card .hy-tactics>h3{display:flex;align-items:center;gap:10px;margin:0 0 10px;font-size:15px}
.hy-card .hy-tactics p{margin:6px 0;line-height:1.65}
html[data-theme="light"] .hy-card .hy-tactics{background:#eaf0f7;color:#35465c;border-color:#c0ccdc}
html[data-theme="light"] .sim :is(#shareMenu>summary,.opp-toggle){background:#e7edf5!important;color:#294567!important;border-color:#a8b9d0!important}
html[data-theme="light"] .sim .pl{color:#35465c!important}.sim .pl{font-weight:650}
html[data-theme="light"] .sim .pl img{filter:brightness(.45) saturate(.6)}
html[data-theme="light"] .duel-prep-box header small{color:#46648a}

.hy-card .hy-trap>.cm-sec.cm-sec .cm-sl br{display:none}
html[data-theme="light"] .sim label:has(#oppToggle){background:#e7edf5!important;color:#294567!important;border-color:#a8b9d0!important}

html[data-theme="light"] .deckmaker-page :is(.dm-mobile-bar,.dm-title-row){background:#f3f4f6;color:#243247;border-color:#c0cad7}
html[data-theme="light"] .deckmaker-page .dm-mobile-bar a{background:#e7edf5;color:#294567;border-color:#a8b9d0}

@media(min-width:960px) and (min-height:601px){
html[data-theme="light"] .deckmaker-page .dm-head-actions{background:transparent;box-shadow:none;border:0}
.deckmaker-page .dm-head{align-items:center;gap:24px}
.deckmaker-page .dm-head-actions{flex:0 1 auto;gap:8px;max-width:680px}
}
@media(max-width:959px),(max-height:600px){
html[data-theme="light"] .deckmaker-page :is(.dm-head-actions,.dm-mobile-management){background:#fff;color:#243247;border-color:#b6c2d0;box-shadow:0 8px 28px #26344718}
}

.sim .duel-hud button.hud-cover{width:54px;height:54px;min-width:54px;flex:none;padding:0;border:1px solid #a1b1c5;border-radius:7px;overflow:hidden;pointer-events:auto;cursor:pointer;background:#dfe6ef;position:relative}
.sim .duel-hud button.hud-cover img,.hud-cover-choice .hud-cover img{width:100%;height:100%;object-fit:cover;object-position:center;display:block}
.sim .duel-hud button.hud-cover::after{content:'✎';position:absolute;right:1px;bottom:1px;font-size:12px;line-height:18px;width:18px;text-align:center;background:#243247d9;color:#fff;border-radius:4px}
.sim .duel-hud button.hud-cover:hover{outline:2px solid #527caf;outline-offset:2px}
.hud-cover-picker .sim-help-box{width:min(640px,100%)}.hud-cover-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(90px,1fr));gap:10px;margin-top:14px}
.hud-cover-grid button.hud-cover-choice{display:flex;flex-direction:column;align-items:center;gap:6px;padding:8px;font-size:12px;line-height:1.4;min-width:0}
.hud-cover-choice .hud-cover{width:70px;height:70px;display:block;border-radius:6px;overflow:hidden;background:#dfe6ef}
.hud-cover-grid button[aria-pressed="true"]{outline:2px solid #527caf;outline-offset:1px}
@media(max-width:1200px){.sim .duel-hud button.hud-cover{width:42px;height:42px;min-width:42px}}

.hud-cover-search{width:100%;box-sizing:border-box;padding:12px;font:inherit;font-size:16px;margin-top:10px;border-radius:8px}
.hud-cover-status{font-size:12px;line-height:1.5;margin:10px 0!important}
.hud-cover-picker .hud-cover-grid{margin-top:8px}

.hud-cover-grid{grid-template-columns:repeat(auto-fill,minmax(110px,1fr))}
.hud-cover-choice>span:last-child{word-break:keep-all;overflow-wrap:normal;line-height:1.5}
.sim .duel-hud .hud-cover.pend-art img,.hud-cover-choice .hud-cover.pend-art img{object-position:center top}

html[data-theme="light"] .hud-cover-picker input.hud-cover-search{background:#f5f7fa!important;color:#243247!important;border-color:#a8b9d0!important}

/* Light mode counterparts for deck pickers and memo controls. */
html[data-theme="light"] :is(.my-q,.my-res button,.my-set,.my-on,.my-write,.my-build,.my-side,.deck-option,.deck-chip){background:#edf2f8!important;color:#294567!important;border-color:#a8b9d0!important}
html[data-theme="light"] :is(.my-q,.my-set,.my-res button){box-sizing:border-box}
html[data-theme="light"] .my-q::placeholder{color:#5a687c;opacity:1}
html[data-theme="light"] :is(.my-set small,.my-on span,.my-none,.my-empty,.my-block li small,.my-notice,.my-lead,.my-share small){color:#46566c!important;opacity:1}
html[data-theme="light"] :is(.my-res button:hover,.my-res button:focus-visible,.my-set:hover,.deck-option:hover){background:#dce7f4!important;border-color:#6689bb!important}
html[data-theme="light"] :is(.my-block,.my-notice){background:#f7f9fc!important;color:#243247;border-color:#b6c2d0}
html[data-theme="light"] .my-block li{background:#eaf0f7;color:#35465c}
html[data-theme="light"] .my-side-F{background:#e8e1f3!important;color:#574077!important}
html[data-theme="light"] .my-side-S{background:#dceee6!important;color:#275e49!important}
html[data-theme="light"] .deck-option.chosen{background:#dce7f4!important;border-color:#365d9d!important}
html[data-theme="light"] :is(.cm-form input,.cm-form textarea,.my-memo input:not([type="checkbox"]),.my-memo textarea){background:#f5f7fa!important;color:#243247!important;border-color:#a8b9d0!important}

/* Archive detail surfaces and consistent reading rhythm. */
.hy-card .hy-ctile :is(.hy-timing,p){font-size:13px;line-height:1.5;letter-spacing:0;font-weight:500}
.hy-card .hy-ctile .hy-timing{margin-top:0}
.hy-card .hy-ctile{gap:6px}
.hy-card-preview p,.sim-tip p{line-height:1.55}
html[data-theme="light"] :is(.hy-card-preview,.hy-cm-tip){background:#fff;color:#243247;border-color:#bfc8d4;box-shadow:0 12px 36px #24324726}
html[data-theme="light"] :is(.hy-card-preview,.sim-tip) :is(strong,p,small){color:#243247}
html[data-theme="light"] .hy-card-preview.is-sheet .hy-sheet-bar{background:linear-gradient(#fff 70%,#ffffff00)}
html[data-theme="light"] .hy-card-preview .hy-preview-close{background:#edf2f8;color:#294567;border-color:#a8b9d0}
html[data-theme="light"] .hy-card-preview .hy-sheet-grip{background:#a8b9d0}
html[data-theme="light"] .hy-card .hy-flow-path{border-color:#d3dce6}
html[data-theme="light"] .hy-card .hy-flow :is(p,small){color:#46566c;opacity:1}
html[data-theme="light"] .hy-card .hy-flow .hy-tile{background:#edf2f8;border-color:#a8b9d0;box-shadow:none}
html[data-theme="light"] .hy-card .hy-flow .hy-tile :is(strong,small){color:#294567;opacity:1}
html[data-theme="light"] .hy-card .hy-flow-arrow{color:#91621a}
html[data-theme="light"] .hy-card .hy-sources{background:transparent;color:#35465c;border-color:#bfc8d4}
html[data-theme="light"] .hy-card .hy-sources[open]{background:#f7f9fc;border:1px solid #bfc8d4;border-radius:8px;padding:7px 9px}
html[data-theme="light"] .hy-card .hy-sources :is(summary,a,li,p,small,.hy-src){color:#35465c;background:transparent;opacity:1}
html[data-theme="light"] .hy-card .hy-sources a:hover{color:#244f91;text-decoration:underline}

html[data-theme="light"] .hy-lb{background:#f3f4f6f5;color:#243247}
html[data-theme="light"] .hy-lb figcaption :is(strong,p){color:#243247}
html[data-theme="light"] .hy-lb-x{background:#edf2f8;color:#294567;border-color:#a8b9d0}

.hy-card .cm-tile-actions .hy-sources[open]{flex:1 0 100%;width:100%;min-width:0}
html[data-theme="light"] .hy-totop{background:#edf2f8;color:#294567;border-color:#a8b9d0}


html[data-theme] .hy-card .hy-hero .hy-hero-meta > :is(.hy-ygo-guide,.cm-meta-feedback),html[data-theme="light"] .hy-card .hy-hero.my-vs-on .my-vs-bottom .hy-hero-meta > :is(.hy-ygo-guide,.cm-meta-feedback){background:#182131b8;color:#fff;border-color:#ffffff50;box-shadow:none;backdrop-filter:blur(6px)}
html[data-theme] .hy-card .hy-hero .hy-hero-meta > :is(.hy-ygo-guide,.cm-meta-feedback):hover,html[data-theme="light"] .hy-card .hy-hero.my-vs-on .my-vs-bottom .hy-hero-meta > :is(.hy-ygo-guide,.cm-meta-feedback):hover{background:#182131e6;color:#fff;border-color:#ffffff90}
