/* Persistent, site-wide midnight and starlight palette. */
html[data-theme="night"] {
  color-scheme: dark;
  --cj-paper:#080e1b;
  --cj-paper-light:#111b2d;
  --cj-paper-deep:#18263d;
  --cj-ink:#e5e9f0;
  --cj-muted:#a6b2c5;
  --cj-green:#557fb5;
  --cj-green-deep:#0b1526;
  --cj-green-soft:#1d2d46;
  --cj-gold:#e2bd63;
  --cj-gold-soft:#51472f;
  --cj-line:#30405a;
  --cj-shadow:0 12px 32px rgba(0,0,0,.3);
  --quiz-ink:#e5e9f0;
  --quiz-muted:#a6b2c5;
  --quiz-line:#30405a;
  --quiz-soft:#1a2940;
  --quiz-accent:#7199cf;
  --quiz-accent-soft:#203652;
  --quiz-track:#3a4d68;
  --quiz-white:#111b2d;
  --quiz-focus:rgba(226,189,99,.3);
  --ink:#e5e9f0;
  --muted:#a6b2c5;
  --line:#30405a;
  --soft:#1a2940;
  --search-ink:#e5e9f0;
  --search-muted:#a6b2c5;
  --search-line:#30405a;
  --search-green:#e2bd63;
  --search-soft:#1a2940;
  --tag-ink:#e5e9f0;
  --tag-muted:#a6b2c5;
  --tag-line:#30405a;
  --tag-soft:#1a2940;
  background:#080e1b;
}
html[data-theme="night"] body {
  color:var(--cj-ink)!important;
  background-color:#080e1b!important;
  background-image:radial-gradient(1px 1px at 18px 24px,rgba(226,189,99,.13),transparent 1.5px),radial-gradient(1px 1px at 76px 88px,rgba(145,177,225,.11),transparent 1.5px),linear-gradient(180deg,#080e1b,#0a1221 65%,#0b1424)!important;
  background-attachment:fixed!important;
}
html[data-theme="night"] :is(h1,h2,h3,h4,h5,h6,p,li,dt,dd,label,figcaption,caption,th,td,blockquote){color:inherit}
html[data-theme="night"] a{color:#e5c66f}
html[data-theme="night"] a:hover{color:#f3d988}
html[data-theme="night"] :is(input,select,textarea){color:var(--cj-ink);background-color:#111d31;border-color:var(--cj-line)}
html[data-theme="night"] :is(button,.btn,[role="button"]){color:inherit}
html[data-theme="night"] .site-header,
html[data-theme="night"] .main-nav,
html[data-theme="night"] .site-search-results{background:rgba(10,18,33,.97)!important;border-color:var(--cj-line)!important;color:var(--cj-ink)}
html[data-theme="night"] .site-header{box-shadow:0 4px 20px rgba(0,0,0,.35)}
html[data-theme="night"] .main-nav>a{color:var(--cj-ink)}
html[data-theme="night"] .site-search-form{background:#111b2d;border-color:var(--cj-line)}
html[data-theme="night"] .site-search-input{color:var(--cj-ink)}
html[data-theme="night"] .site-search-input::placeholder{color:#91a0b7}
html[data-theme="night"] .site-search-submit{color:#e2bd63}
html[data-theme="night"] .site-search-results [role="option"]:hover{background:#1a2940}
html[data-theme="night"] .site-footer{background:#0b1526!important;border-color:#51472f!important;color:#d5dceb!important}
html[data-theme="night"] .footer-nav a{color:#d5dceb!important}
html[data-theme="night"] :is(.home-main,.features,.latest,.type-section,.theory-main,.page-wrap,.search-main,.tag-main,.quiz-page,.alchemy-main){background-color:transparent!important;color:var(--cj-ink)}
html[data-theme="night"] :is(.hero,.hero-copy,.quiz-landing-hero,.quiz-landing-grid,.quiz-landing-why,.quiz-landing-how,.quiz-landing-disclaimer){background-color:#111b2d!important;background-image:linear-gradient(135deg,#111b2d,#17263d)!important;color:var(--cj-ink)!important;border-color:#695a38!important}
html[data-theme="night"] :is(.features,.latest,.type-section){background:#0d1728!important}
html[data-theme="night"] :is(.article-card,.latest .article-card--text,.category-card,.card,.search-result,.recommendations .card,.theory-card,.quiz-card,.result-content,.tie-content,.category-content,.search-empty,.tag-card){background:#111b2d!important;color:var(--cj-ink)!important;border-color:var(--cj-line)!important;box-shadow:0 8px 24px rgba(0,0,0,.25)}
html[data-theme="night"] :is(.article-title,.category-name,.theory-main h1,.theory-main .section-heading,.hero h1,.about-text h2,.feature-copy h2,.latest-head h2,.type-section h2,.search-heading,.quiz-intro h1){color:#e7c96f!important}
html[data-theme="night"] :is(.article-excerpt,.article-category,.article-date,.category-description,.home-copy,.home-note,.quiz-instruction,.quiz-side,.search-intro,.search-result-excerpt,.meta,.taxonomy,.card-excerpt){color:#b3bfd0!important}
html[data-theme="night"] :is(.article-body,.article-body p,.article-body li,.article-body h1,.article-body h2,.article-body h3,.article-body h4,.article-body blockquote,.article-body td,.article-body th){color:#dce3ee!important}
html[data-theme="night"] .article-body blockquote{background:#17263b!important;border-color:#7199cf!important}
html[data-theme="night"] .article-body :is(table,th,td){border-color:#394b65!important}
html[data-theme="night"] :is(.article-tags,.article-tag-link,.category,.tag-chip){border-color:var(--cj-line)!important;background:#17263b!important;color:#d4deed!important}
html[data-theme="night"] :is(.share-button,.quiz-btn.secondary,.search-field){background:#17263b!important;border-color:#3b4e69!important;color:#e5e9f0!important}
html[data-theme="night"] :is(.quiz-progress,.quiz-group-title,.quiz-question,.quiz-value,.quiz-scale,.quiz-loading){color:var(--quiz-ink)!important}
html[data-theme="night"] .quiz-value{background:#1b2c45!important;border-color:#495a71!important}
html[data-theme="night"] .quiz-side{background:#17263b}
html[data-theme="night"] .quiz-message{background:#1b2b40!important;border-color:#e2bd63!important;color:#e5e9f0!important}
html[data-theme="night"] .quiz-message.error{background:#3a202b!important;border-color:#d97575!important;color:#ffdede!important}
html[data-theme="night"] .quiz-tie-panel{background:#1b2b40!important;color:#e5e9f0!important;border-color:#e2bd63!important}
html[data-theme="night"] .quiz-result-page .content{background:#111b2d!important;border-color:var(--cj-line)!important;color:var(--cj-ink)!important}
html[data-theme="night"] .quiz-result-page.result-redesign .result-content{background:linear-gradient(145deg,#111b2d,#15243a)!important;border-color:#51472f!important}
html[data-theme="night"] .result-redesign .result-section p:not(.result-kicker){color:#c4cfdd!important}
html[data-theme="night"] .result-redesign .result-section h3{color:#e7c96f!important}
html[data-theme="night"] .result-redesign .result-section .result-read{background:#17263b!important;color:#e7c96f!important}
html[data-theme="night"] .tie-redesign .tie-card{background:#111b2d!important;border-color:var(--cj-line)!important}
html[data-theme="night"] .search-field{background:#111b2d!important;color:#e5e9f0!important;border-color:var(--cj-line)!important}
html[data-theme="night"] .search-button{background:#29466e!important;color:#fff!important}
html[data-theme="night"] .search-result-type{background:#20324c!important;color:#e2bd63!important}
html[data-theme="night"] .search-empty{background:#111b2d!important;color:#a6b2c5!important}
html[data-theme="night"] .progress-track{background:#293a53!important}
html[data-theme="night"] .quiz-range::-webkit-slider-thumb{border-color:#111b2d}
html[data-theme="night"] .back-to-top{background:#10203a!important;color:#e2bd63!important;border-color:#a78646!important}
html[data-theme="night"] .theme-toggle{background:#15243a;color:#edcf79;border-color:#826b39}
html[data-theme="night"] .theme-icon-moon{display:none}
html[data-theme="night"] .theme-icon-sun{display:block}
.theme-toggle{order:3;flex:none;display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:40px;min-height:40px;padding:7px 11px;border:1px solid var(--cj-gold-soft);border-radius:999px;background:var(--cj-paper);color:var(--cj-green-deep);font:inherit;font-size:13px;line-height:1;cursor:pointer;transition:background-color .2s ease,color .2s ease,border-color .2s ease,transform .2s ease}
.theme-toggle:hover{transform:translateY(-1px);background:var(--cj-paper-deep);border-color:var(--cj-gold)}
.theme-toggle:focus-visible{outline:3px solid rgba(226,189,99,.55);outline-offset:3px}
.theme-icon{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.theme-icon-sun{display:none}
.theme-toggle-label{white-space:nowrap}
@media(max-width:760px){.theme-toggle{order:2;width:40px;height:40px;min-width:40px;padding:8px;border-radius:50%}.theme-toggle-label{display:none}.site-search{order:3}}

html[data-theme="night"] :is(.post-list li,.empty,.page-button,.page-actions,.tag-chip,.tag-list a){border-color:var(--cj-line)!important}
html[data-theme="night"] .post-list a{color:#e2c66f!important}
html[data-theme="night"] .empty{background:#111b2d!important;color:var(--cj-muted)!important}
html[data-theme="night"] .page-button{background:#29466e!important;color:#f1d486!important;border-color:#806b3d!important}
html[data-theme="night"] .site-burger{color:#e2bd63!important}
html[data-theme="night"] .site-search-results :is(button,a,[role="option"]){color:var(--cj-ink)!important;background:transparent}
html[data-theme="night"] .site-search-results :is(button,a,[role="option"]):hover{background:#1b2b40!important}
html[data-theme="night"] .quiz-result-page.result-redesign .result-visual .btn{background:#29466e!important;color:#f1d486!important;border-color:#806b3d!important}html[data-theme="night"] body:has(.quiz-compass-page){--fg:#e5e9f0;--muted:#a6b2c5;--accent:#e2bd63;--yellow:#29466e}
html[data-theme="night"] .quiz-compass-page{background:radial-gradient(circle at 18% 22%,rgba(226,189,99,.07),transparent 25%),linear-gradient(115deg,#0e1a2d,#101e34 54%,#0b1526)!important;border-color:#806b3d!important;box-shadow:0 12px 34px rgba(0,0,0,.35),inset 0 0 0 5px rgba(30,48,74,.8),inset 0 0 0 6px rgba(226,189,99,.12)!important}
html[data-theme="night"] .quiz-compass-page h1{color:#e7c96f!important}
html[data-theme="night"] .quiz-compass-subtitle,html[data-theme="night"] .quiz-compass-right p,html[data-theme="night"] .quiz-compass-list li{color:#c2cede!important}
html[data-theme="night"] .quiz-compass-disclaimer{background:linear-gradient(90deg,#111d31,#17263d 50%,#111d31)!important;color:#b8c4d5!important;border-color:#51472f!important}
html[data-theme="night"] .quiz-compass-disclaimer p{color:#b8c4d5!important}
html[data-theme="night"] .quiz-compass-page .notice{background:#1a2940!important;color:#e5e9f0!important}
html[data-theme="night"] body:has(.workshop){--bg1:#0a1220;--bg2:#0d1728;--paper:#111b2d;--paper2:#152139;--ink:#e5e9f0;--ink2:#b3bfd0;--ink3:#8e9bb0;--line:#30405a;--line2:#30405a;--green:#7199cf;--green-d:#182a45;--bronze:#e2bd63;--bronze2:#51472f;--deep:#0d1a31;--deep2:#080e1b;--g1:#e2bd63;--g2:#7199cf;--g3:#d08b72;--glow:#405b81}
html[data-theme="night"] body:has(.workshop) .lab{background:linear-gradient(180deg,#111b2d,#15233a)!important;border-color:#51472f!important;box-shadow:0 10px 32px rgba(0,0,0,.35)!important}
html[data-theme="night"] body:has(.workshop) .rules,html[data-theme="night"] body:has(.workshop) .rules::before,html[data-theme="night"] body:has(.workshop) .help>button{background:#17263d!important;color:#e5e9f0!important;border-color:#51472f!important}
html[data-theme="night"] body:has(.workshop) .step.active{background:rgba(113,153,207,.12)!important;border-color:#51472f!important}/* Contrast corrections for pages with their own embedded light-theme rules. */
html[data-theme="night"] .about-layout-refined>.about-panel-refined,
html[data-theme="night"] .about-layout-refined>.shop-panel-refined{background:linear-gradient(145deg,#111b2d,#17263d)!important;color:#dce3ee!important;border-color:#30405a!important}
html[data-theme="night"] .about-layout-refined :is(p,li,.shop-description,.shop-address-refined){color:#d0d9e6!important}
html[data-theme="night"] .about-layout-refined :is(h2,h3,.shop-name,.shop-address-refined p span){color:#e7c96f!important}
html[data-theme="night"] .about-layout-refined .shop-instagram{box-shadow:0 0 0 4px #111b2d,0 0 0 5px #806b3d,0 5px 12px rgba(0,0,0,.3)!important}
html[data-theme="night"] :is(.announcement-window,.announcement-body,.announcement-empty,.contact-section){background:#111b2d!important;color:#dce3ee!important}
html[data-theme="night"] :is(.announcement-label,.contact-status){color:#a6b2c5!important}
html[data-theme="night"] .announcement-read{background:#29466e!important;color:#f1d486!important}
html[data-theme="night"] .announcement-control{background:#17263d!important;color:#e2bd63!important;border:1px solid #51472f}
html[data-theme="night"] .contact-field :is(input,select,textarea){background:#0d1728!important;color:#e5e9f0!important;border-color:#394b65!important}
html[data-theme="night"] body:has(.workshop) :is(.pane.cs,.undo,.cbtn,.cat,.articles){background:#142139!important;color:#e3e9f2!important;border-color:#394b65!important}
html[data-theme="night"] body:has(.workshop) .pane.cs :is(h4,.code,p,p em){color:#dce5f3!important}
html[data-theme="night"] body:has(.workshop) .note{background:#1b2b40!important;color:#c6d0de!important;border-color:#51472f!important}
html[data-theme="night"] body:has(.workshop) .note b{color:#e2c66f!important}
html[data-theme="night"] body:has(.workshop) .arthint{background:#111b2d!important;color:#bdc8d8!important}
html[data-theme="night"] body:has(.workshop) .token{color:#f0d27c!important;background:radial-gradient(circle at 35% 30%,color-mix(in srgb,var(--c) 40%,#263854),#0d1728 80%)!important;border-color:color-mix(in srgb,var(--c) 65%,#e2bd63)!important}
html[data-theme="night"] body:has(.workshop) .token.off{opacity:.72;filter:grayscale(.35)}
html[data-theme="night"] body:has(.workshop) .ghost{color:#f0d27c!important;background:radial-gradient(circle at 35% 30%,color-mix(in srgb,var(--c) 40%,#263854),#0d1728 80%)!important}
html[data-theme="night"] :is(.home-btn,.ig-button.follow,.category-link,.quiz-btn:not(.secondary),.btn:not(.social),.result-read,.search-button,.page-button,.contact-submit,.quiz-compass-start){background:linear-gradient(135deg,#26476f,#315c88)!important;color:#f2d98d!important;border:1px solid #8b7240!important;box-shadow:0 4px 14px rgba(0,0,0,.3)}
html[data-theme="night"] :is(.home-btn,.ig-button.follow,.category-link,.quiz-btn:not(.secondary),.btn:not(.social),.result-read,.search-button,.page-button,.contact-submit,.quiz-compass-start):hover{background:linear-gradient(135deg,#315a89,#3b6a9e)!important;color:#fff0bd!important}html[data-theme="night"] body:has(.workshop) .vessel rect[fill="#fffdf6"]{fill:#17263d!important}
html[data-theme="night"] body:has(.workshop) .vessel .lbl{fill:#e0c575!important}
html[data-theme="night"] body:has(.workshop) .vessel .lbl2{fill:#a9bddb!important}
html[data-theme="night"] body:has(.workshop) .emptyhint{color:#d6dfec!important}
html[data-theme="night"] body:has(.workshop) .emptyhint small{color:#a9b8ce!important}
html[data-theme="night"] body:has(.workshop) .readout .pane.cs{background:#142139!important}
html[data-theme="night"] .about-layout-refined .about-panel-refined>p strong{color:#e7c96f!important}/* Homepage uses its own palette tokens and several fixed-color card rules. */
html[data-theme="night"] body:has(.home-main){--home-ink:#e5e9f0;--home-muted:#c1ccdb;--home-green:#7199cf;--home-line:#30405a;--home-pale:#15243a}
html[data-theme="night"] .home-copy,html[data-theme="night"] .home-note,html[data-theme="night"] .about-text,html[data-theme="night"] .feature-copy,html[data-theme="night"] .site-about,html[data-theme="night"] .site-about p{color:#c5d0df!important}
html[data-theme="night"] .home-copy a,html[data-theme="night"] .home-main .home-paper-panel a{color:#edcf79!important}
html[data-theme="night"] .home-main .home-paper-panel{background:linear-gradient(145deg,#111b2d,#17263d)!important;color:#dce3ee!important;border-color:#30405a!important}
html[data-theme="night"] .home-main .home-paper-panel :is(p,li){color:#c5d0df!important}
html[data-theme="night"] .home-main .home-paper-panel :is(h2,h3){color:#e7c96f!important}
html[data-theme="night"] .latest .article-card--text{background:linear-gradient(145deg,#111b2d,#17263d)!important;color:#dce3ee!important;border-color:#30405a!important}
html[data-theme="night"] .latest .article-card--text .article-title{color:#e7c96f!important}
html[data-theme="night"] .latest .article-card--text :is(.article-category,.article-date,.article-excerpt){color:#bdc9d9!important}
html[data-theme="night"] .latest .article-card-more{color:#e2bd63!important}
html[data-theme="night"] .home-main :is(.carousel-control,.latest .carousel-control){background:#17263d!important;color:#e2bd63!important;border:1px solid #51472f!important}
html[data-theme="night"] .home-main :is(.carousel-control,.latest .carousel-control):hover{background:#29466e!important;color:#fff0bd!important}
html[data-theme="night"] .home-main .carousel-dots button{background:#60738f!important}
html[data-theme="night"] .home-main .carousel-dots button[aria-current="true"]{background:#e2bd63!important}
html[data-theme="night"] .ig-empty{background:#142139!important;color:#c5d0df!important;border-color:#40536e!important}
/* Announcement carousel has its own fixed light backgrounds and black CTA. */
html[data-theme="night"] .announcement-heading{color:#e7c96f!important}
html[data-theme="night"] .announcement-body{background:#111b2d!important;color:#dce3ee!important}
html[data-theme="night"] .announcement-title{color:#e5e9f0!important}
html[data-theme="night"] .announcement-label{color:#a6b2c5!important}
html[data-theme="night"] .announcement-read{background:linear-gradient(135deg,#26476f,#315c88)!important;color:#f2d98d!important;border:1px solid #8b7240!important}
html[data-theme="night"] .announcement-control{background:#17263d!important;color:#e2bd63!important;border-color:#51472f!important}
html[data-theme="night"] .announcement-dots button{background:#60738f!important}
html[data-theme="night"] .announcement-dots button[aria-current="true"]{background:#e2bd63!important}/* Theory subheader and concept tables have a private palette in theory/index.html. */
html[data-theme="night"] body:has(.subbar){--bg:#080e1b;--card:#111b2d;--line:#30405a;--line2:#435572;--line3:#2d3e57;--navy:#29466e;--beige:#18263d;--tan:#d9b85f;--text:#dce3ee;--muted:#aab8cc;--gold:#e2bd63}
html[data-theme="night"] .subbar{background:#0e1829!important;border-color:#30405a!important;box-shadow:0 4px 14px rgba(0,0,0,.35)!important}
html[data-theme="night"] .subbar .tab{color:#b8c5d7!important}
html[data-theme="night"] .subbar .tab:hover,html[data-theme="night"] .subbar .tab[aria-selected="true"]{color:#f0d17b!important}
html[data-theme="night"] .subbar .tab[aria-selected="true"]{border-bottom-color:#e2bd63!important}
html[data-theme="night"] .gbody,html[data-theme="night"] .mc,html[data-theme="night"] table.stack,html[data-theme="night"] .mc .btn,html[data-theme="night"] .note,html[data-theme="night"] .toolbar input,html[data-theme="night"] .chip{background:#111b2d!important;color:#dce3ee!important;border-color:#30405a!important}
html[data-theme="night"] .gbody>.intro,html[data-theme="night"] .lead,html[data-theme="night"] .rex,html[data-theme="night"] .tag,html[data-theme="night"] .ml small{color:#bdc9d9!important}
html[data-theme="night"] .rtitle,html[data-theme="night"] .phead h1,html[data-theme="night"] .glabel b,html[data-theme="night"] .ml b,html[data-theme="night"] .stack tbody th,html[data-theme="night"] .stack td.dom{color:#e7c96f!important}
html[data-theme="night"] .mh,html[data-theme="night"] .stack thead th,html[data-theme="night"] .feat,html[data-theme="night"] .btn:hover,html[data-theme="night"] .disc:hover{background:#29466e!important;color:#f0d17b!important;border-color:#806b3d!important}
html[data-theme="night"] .glabel,html[data-theme="night"] .ml,html[data-theme="night"] .stack tr.gh td{background:#18263d!important;color:#dce3ee!important;border-color:#30405a!important}
html[data-theme="night"] .tab.sep,html[data-theme="night"] .stack td,html[data-theme="night"] .stack th{border-color:#394b65!important}
html[data-theme="night"] .mc .btn{background:#17263d!important;color:#e2bd63!important;border-color:#806b3d!important}
html[data-theme="night"] .mc .btn:hover,html[data-theme="night"] .btn[aria-pressed="true"],html[data-theme="night"] .chip[aria-pressed="true"]{background:#29466e!important;color:#f0d17b!important}
html[data-theme="night"] .row:hover{background:#142139!important}
html[data-theme="night"] .toolbar input::placeholder{color:#91a0b7!important}html[data-theme="night"] .btn,html[data-theme="night"] .disc{background:#17263d!important;color:#e2bd63!important;border-color:#806b3d!important}
html[data-theme="night"] .chip{color:#e2bd63!important}
html[data-theme="night"] .btn:hover,html[data-theme="night"] .disc:hover{background:#29466e!important;color:#fff0bd!important}/* Theory article preview modal: replace its remaining fixed light surfaces. */
html[data-theme="night"] .dlg{background:#111b2d!important;color:#dce3ee!important;border-color:#435572!important;box-shadow:0 18px 54px rgba(0,0,0,.58)!important}
html[data-theme="night"] .backdrop{background:rgba(3,8,17,.78)!important}
html[data-theme="night"] .dtop{border-color:#394b65!important}
html[data-theme="night"] .dchip{background:#1c2d46!important;color:#cbd5e3!important}
html[data-theme="night"] .dlg h2{color:#e7c96f!important}
html[data-theme="night"] .dlg .meta{background:#17263d!important;color:#dce3ee!important;border-color:#435572!important}
html[data-theme="night"] .dlg .dsub{color:#e2bd63!important}
html[data-theme="night"] .dlg .prev{border-color:#7199cf!important;color:#dce3ee!important}
html[data-theme="night"] .dlg .pvbody,html[data-theme="night"] .dlg .pvbody p{color:#dce3ee!important}
html[data-theme="night"] .dlg .ghost{background:#17263d!important;color:#e2bd63!important;border-color:#806b3d!important}
html[data-theme="night"] .dlg .primary{background:linear-gradient(135deg,#26476f,#315c88)!important;color:#f2d98d!important;border:1px solid #8b7240!important}
html[data-theme="night"] .dlg .primary:hover{background:linear-gradient(135deg,#315a89,#3b6a9e)!important;color:#fff0bd!important}
html[data-theme="night"] .dlg .xbtn{color:#e2bd63!important}
html[data-theme="night"] .dlg .xbtn:hover{background:#1c2d46!important;color:#fff0bd!important;border-radius:50%}

/* Final night palette fixes: inactive theory tabs, contact form contrast and homepage social links. */
html[data-theme="night"] .subbar .tabs>.tab{
  border-bottom:3px solid transparent!important;
  box-shadow:none!important;
  text-decoration:none!important;
}
html[data-theme="night"] .subbar .tabs>.tab[aria-selected="true"]{
  border-bottom-color:#e2bd63!important;
}
html[data-theme="night"] .subbar .tabs>.tab:focus:not(:focus-visible){outline:none!important}
html[data-theme="night"] .subbar .tabs>.tab:focus-visible{
  outline:2px solid #7199cf!important;
  outline-offset:-3px!important;
}
html[data-theme="night"] .contact-section,
html[data-theme="night"] .contact-section :is(p,em,label,.contact-required,.contact-status){
  color:#dce3ee!important;
}
html[data-theme="night"] .contact-section :is(input,select,textarea){
  background:#0d1728!important;
  color:#f0f3f8!important;
  border-color:#526783!important;
}
html[data-theme="night"] .contact-section :is(input,select,textarea)::placeholder{color:#aab8cc!important;opacity:1}
html[data-theme="night"] .contact-section select option{background:#111b2d!important;color:#e5e9f0!important}
html[data-theme="night"] .contact-section .contact-submit{
  background:linear-gradient(135deg,#26476f,#315c88)!important;
  color:#f2d98d!important;
  border:1px solid #8b7240!important;
}
html[data-theme="night"] .home-main .home-social-icon{
  background:#29466e!important;
  color:#f2d98d!important;
  border-color:#8b7240!important;
  box-shadow:0 0 0 4px #111b2d,0 0 0 5px #51472f,0 5px 16px rgba(0,0,0,.38)!important;
}
html[data-theme="night"] .home-main .home-social-icon:hover{
  background:#315c88!important;
  color:#fff0bd!important;
  border-color:#e2bd63!important;
}

/* Result pages have their own high-specificity light palette rules. */
html[data-theme="night"] .quiz-result-page.result-redesign .result-content>h2,
html[data-theme="night"] .quiz-result-page.tie-redesign .tie-content>h2{
  color:#e7c96f!important;
}
html[data-theme="night"] .quiz-result-page.result-redesign .result-note,
html[data-theme="night"] .quiz-result-page.tie-redesign .result-note{
  color:#b8c5d7!important;
}
html[data-theme="night"] .quiz-result-page.result-redesign .result-note-link,
html[data-theme="night"] .quiz-result-page.tie-redesign .result-note-link{
  color:#e2bd63!important;
  text-decoration-color:#7199cf!important;
}

/* The about page has inline styles with greater specificity than the shared theme. */
html[data-theme="night"] body:has(.about-shop-grid) .contact-section h2{
  color:#e7c96f!important;
}
html[data-theme="night"] body:has(.about-shop-grid) .about-layout-refined .social-links .social-icon,
html[data-theme="night"] body:has(.about-shop-grid) .about-layout-refined .shop-instagram{
  background:#29466e!important;
  color:#f2d98d!important;
  border-color:#8b7240!important;
  box-shadow:0 0 0 4px #111b2d,0 0 0 5px #51472f,0 5px 16px rgba(0,0,0,.38)!important;
}
html[data-theme="night"] body:has(.about-shop-grid) .about-layout-refined .social-links .social-icon:hover,
html[data-theme="night"] body:has(.about-shop-grid) .about-layout-refined .shop-instagram:hover{
  background:#315c88!important;
  color:#fff0bd!important;
  border-color:#e2bd63!important;
}
/* Night-mode fixes for the tag index and article sharing controls. */
html[data-theme="night"] body:has(.tag-list) h1 {
  color: #e7c96f !important;
}

html[data-theme="night"] .share-block .share-button {
  background: linear-gradient(135deg, #26476f, #315c88) !important;
  color: #f2d98d !important;
  border-color: #8b7240 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .28) !important;
}

html[data-theme="night"] .share-block .share-button svg {
  color: #f2d98d !important;
}

html[data-theme="night"] .share-block .share-button:hover {
  background: linear-gradient(135deg, #315a89, #3b6a9e) !important;
  color: #fff0bd !important;
  border-color: #e2bd63 !important;
}

html[data-theme="night"] .share-block .share-button:hover svg {
  color: #fff0bd !important;
}

html[data-theme="night"] .about-layout-refined>.friend-panel-refined{background:linear-gradient(145deg,#111b2d,#17263d)!important;color:#dce3ee!important;border-color:#30405a!important}
html[data-theme="night"] .about-layout-refined .friend-panel-refined :is(p,.friend-subtitle){color:#d0d9e6!important}
html[data-theme="night"] .about-layout-refined .friend-panel-refined h2{color:#e7c96f!important}
html[data-theme="night"] .about-layout-refined .friend-panel-refined .friend-tagline strong{color:#e2bd63!important}

/* Article reading cards need their own dark surfaces: translucent ivory surfaces turn gray under night mode. */
html[data-theme="night"] .article-head{
  background:linear-gradient(115deg,#111b2d 0%,#121f33 58%,#18263d 100%)!important;
  border-color:#51472f!important;
  box-shadow:inset 0 0 0 5px rgba(255,255,255,.025),inset 0 0 0 6px rgba(226,189,99,.08),0 8px 24px rgba(0,0,0,.22)!important;
}
html[data-theme="night"] .article h1{color:#e7c96f!important}
html[data-theme="night"] .article-head .meta,html[data-theme="night"] .article-head .taxonomy{color:#b8c5d7!important}
html[data-theme="night"] .article-head .category{background:#1c2d46!important;border-color:#394b65!important;color:#dce3ee!important}
html[data-theme="night"] .article-body{
  background:#111b2d!important;
  border-color:#30405a!important;
  color:#dce3ee!important;
  box-shadow:0 8px 24px rgba(0,0,0,.22)!important;
}
html[data-theme="night"] .article-body :is(p,li){color:#dce3ee!important}
html[data-theme="night"] .article-body :is(h2,h3,h4){color:#e7c96f!important}
html[data-theme="night"] .article-body a{color:#9fc3f2!important;text-decoration-color:#7199cf!important}
html[data-theme="night"] .article-body blockquote{background:#17263b!important;border-color:#7199cf!important;color:#dce3ee!important}
html[data-theme="night"] .article .cover{background:#111b2d!important;border-color:#51472f!important}

/* Tag result pages use .post-list, so include their h1 in the night palette. */
html[data-theme="night"] body:has(.tag-list) main>h1,
html[data-theme="night"] body:has(.post-list) main>h1{color:#e7c96f!important}

/* Keep social-platform colors distinct and readable in night mode too. */
html[data-theme="night"] .home-main .home-social-icon.instagram,html[data-theme="night"] body:has(.about-shop-grid) .about-layout-refined .social-links .social-icon.instagram,html[data-theme="night"] body:has(.about-shop-grid) .about-layout-refined .shop-instagram{background:linear-gradient(145deg,#793153,#974253 55%,#a95638)!important;color:#fff!important}
html[data-theme="night"] .home-main .home-social-icon.threads,html[data-theme="night"] body:has(.about-shop-grid) .about-layout-refined .social-links .social-icon.threads{background:#171d22!important;color:#f4f0e7!important}
html[data-theme="night"] .home-main .home-social-icon.discord,html[data-theme="night"] body:has(.about-shop-grid) .about-layout-refined .social-links .social-icon.discord{background:#454fb8!important;color:#fff!important}

/* Night palette for the framed homepage welcome panel and its quiz-style actions. */
html[data-theme="night"] body:has(.home-main) .home-main>.hero{background:linear-gradient(135deg,#111b2d,#17263d)!important;border-color:#8b7240!important;box-shadow:0 5px 17px rgba(0,0,0,.28),inset 0 0 0 4px rgba(255,255,255,.025),inset 0 0 0 5px rgba(226,189,99,.12)!important}
html[data-theme="night"] body:has(.home-main) .home-buttons .home-btn:first-child,html[data-theme="night"] body:has(.home-main) .feature-actions .home-btn:first-child{background:linear-gradient(145deg,#26476f,#315c88)!important;color:#f2d98d!important;border-color:#8b7240!important}
html[data-theme="night"] body:has(.home-main) .home-buttons .home-btn:not(:first-child),html[data-theme="night"] body:has(.home-main) .feature-actions .home-btn:not(:first-child){background:#17263d!important;color:#e7c96f!important;border-color:#8b7240!important}
html[data-theme="night"] body:has(.home-main) .home-buttons .home-btn:hover,html[data-theme="night"] body:has(.home-main) .feature-actions .home-btn:hover{background:linear-gradient(145deg,#315a89,#3b6a9e)!important;color:#fff0bd!important;border-color:#e2bd63!important}
