/* Shared preferences and the night palette. Character artwork keeps its own colors. */
:root{--surface:#fffefa;--surface-soft:#edf2e6;--surface-raised:#f9fbf4;--accent:#486a42;--on-accent:#fffef5;--gold:#ae9861;--focus:#789360}
.preference-button{display:inline-grid;place-items:center;flex:0 0 36px;width:36px;height:36px;padding:8px;border:1px solid var(--line);border-radius:50%;background:transparent;color:var(--deep,var(--ink));cursor:pointer;transition:background .18s,border-color .18s}
.preference-button:hover{background:var(--surface-soft);border-color:var(--focus)}
.preference-button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round;display:block}
.preference-button .theme-sun{display:none}html[data-theme=dark] .preference-button .theme-sun{display:block}html[data-theme=dark] .preference-button .theme-moon{display:none}
[data-sound-toggle][aria-pressed=true] .sound-off,[data-sound-toggle][aria-pressed=false] .sound-on{display:none}



.admin-head-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
@media(max-width:600px){.preference-button{width:34px;height:34px;flex-basis:34px;padding:7px}.header-actions{gap:6px}.council-header nav{gap:9px}.council-header nav>a{display:none}}
@media(max-width:360px){.brand-wordmark{font-size:13px}.brand-wordmark b{font-size:12px}.brand-symbol{width:29px;height:29px}.brand{gap:6px}.header-actions{gap:4px}.header-actions .preference-button{width:30px;height:32px;flex-basis:30px}}

html[data-theme=dark]{color-scheme:dark;--paper:#101b18;--white:#192721;--cream:#192721;--surface:#192721;--surface-soft:#21342b;--surface-raised:#23382e;--text:#e5eadf;--ink:#e5eadf;--muted:#b0bda9;--deep:#bcd6a9;--green:#a6c88e;--mint:#23392d;--mint2:#1c2d25;--line:#354b3e;--glass:#192721;--accent:#b8d39f;--on-accent:#18271c;--gold:#d0ba81;--focus:#b8cf9b;--shadow:0 12px 40px #030b0829;background:var(--paper);color:var(--text);scrollbar-color:#5a745e var(--paper)}
html[data-theme=dark] body{background:var(--paper);color:var(--text)}
html[data-theme=dark] ::selection{background:#52704c;color:#fffef5}
html[data-theme=dark] :where(a,button,input,select,textarea,[tabindex]):focus-visible{outline-color:var(--focus)}
html[data-theme=dark] :is(h1,h2,h3,h4){color:var(--text)}
html[data-theme=dark] :is(.muted,.section-desc,.hero-note.hero-note-em,.eyebrow,.small-label,.field-hint,.field-optional,.field-count,.privacy-note,.hero-title-question,.brand-wordmark small){color:var(--muted)}
html[data-theme=dark] .site-header,html[data-theme=dark] .site-header.scrolled,html[data-theme=dark] .council-header{background:linear-gradient(115deg,#14251eea,#1b2d25cf);border-bottom:1px solid #79956b29;box-shadow:inset 0 1px #bfceb00a,0 5px 28px #030a0926;backdrop-filter:blur(28px) saturate(125%);-webkit-backdrop-filter:blur(28px) saturate(125%)}
html[data-theme=dark] .site-header .nav a{color:#bbc8b1}html[data-theme=dark] .site-header .nav a:is(.active,:hover){background:#2b4030;color:#e0edd2}
html[data-theme=dark] .brand,html[data-theme=dark] .council-brand{color:var(--text)}
html[data-theme=dark] :is(.mini-login.login-prominent,.menu-btn,#council-account){background:var(--surface-soft);border-color:var(--line);color:var(--deep)}
html[data-theme=dark] .mini-login.login-prominent.logged-in{background:var(--surface);border-color:#708269}
html[data-theme=dark] .header-account .account-popover{background:var(--surface);border-color:var(--line);box-shadow:0 18px 44px #0005}
html[data-theme=dark] :is(.account-popover strong,.account-council){color:var(--text)}html[data-theme=dark] :is(.account-popover span,.account-logout){color:var(--muted)}
html[data-theme=dark] .account-council{border-color:var(--line)}html[data-theme=dark] :is(.account-council:hover,.account-logout:hover){background:var(--surface-raised)}
html[data-theme=dark] .hero h1,html[data-theme=dark] .hero-title-lead,html[data-theme=dark] .hero-greeting{color:#dfe8d7!important}
html[data-theme=dark] .hero-title-is,html[data-theme=dark] .hero-title-question{color:#b6c6a7!important}html[data-theme=dark] .hero-title-luck,html[data-theme=dark] .hero-title-comma{color:#b8d59d!important}
html[data-theme=dark] #hero-title-user.identity-no-medal{color:#d3dfc9;-webkit-text-fill-color:currentColor}
html[data-theme=dark] #hero-title-user.identity-medal{background:linear-gradient(110deg,#d0e6a6,#9fc49b);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}
html[data-theme=dark] #hero-title-user.identity-captain{background:linear-gradient(110deg,#b9e9dd,#92bee5);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}
html[data-theme=dark] #hero-title-user.identity-admiral{background:linear-gradient(110deg,#e1c0eb,#b9c9ec);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}
html[data-theme=dark] #hero-title-user.identity-governor{background:linear-gradient(110deg,#eddfb2,#d2ae70);background-clip:text;-webkit-background-clip:text;-webkit-text-fill-color:transparent}
html[data-theme=dark] :is(.hero .live-chip,.live-chip-text,.live-chip-arrow){color:var(--muted);border-color:var(--line)}
html[data-theme=dark] .hero-visual .portrait-garden{background:radial-gradient(ellipse at 50% 52%,#67805021,transparent 67%)}
html[data-theme=dark] .sky-curves{opacity:.5}html[data-theme=dark] .sky-stars{opacity:.8}
html[data-theme=dark] :is(.portrait-controls,.puppet-toolbar,.live2d-loading){background:#1a2b23ed;border-color:#506147;box-shadow:0 6px 25px #0002}
html[data-theme=dark] :is(.portrait-controls span,.portrait-controls b,.puppet-toolbar button,.live2d-loading,.live2d-loading button,.puppet-detach){color:var(--deep)}
html[data-theme=dark] .portrait-controls small{color:var(--muted)}html[data-theme=dark] .portrait-controls>button{background:#2d4531;color:#d4e4bc}html[data-theme=dark] .puppet-toolbar button:hover{background:#2d4531}
html[data-theme=dark] .puppet-reaction{background:#293426ec;border-color:#85774f;color:#e2c98a;box-shadow:0 5px 20px #0003}html[data-theme=dark] .puppet-reaction[data-mood=angry]{color:#efaea0}html[data-theme=dark] .puppet-reaction[data-mood=gloomy]{background:#2b2d3ce8;color:#c9cadd}
html[data-theme=dark] :is(.glass,.stat-card,.random-stream,.stream-calendar,.sync-panel,.mailbox-picker,.mailbox-choice,.letter-compose,.yearring-panel,.shop-summary,.shop-product,.shop-rule-card,.shop-order-row,.shop-feedback,.voice-player-bar,.fortune-card,.empty-state,.lottery-history,.magic-lottery,.draw-reward,.draw-reward.gift){background:var(--surface);border-color:var(--line);box-shadow:none}
html[data-theme=dark] :is(.profile-card h3,.profile-live-card h3,.profile-stats strong,.profile-countdown strong,.stat-card strong,.random-stream strong,.memory-copy h3,.yearring-copy h3,.ring-days strong,.shop-metric>strong,.shop-product h3,.shop-product-foot strong,.ritual-copy h3,.shop-subheading h3,.lottery-balance strong,.draw-cost,.fortune-card h2){color:var(--deep)}
html[data-theme=dark] :is(.profile-card p,.profile-card small,.profile-stats small,.fact-card p,.story-card p,.profile-countdown span,.stat-card small,.random-stream small,.calendar-head>span,.archive-status small,.archive-status>a,.stream-meta,.memory-copy p,.memory-copy>span,.memory-meta,.yearring-copy p,.shop-metric small,.shop-product-copy>p,.shop-rule-card p,.ritual-description,.ritual-caption,.lottery-balance,.lottery-status,.draw-confirm-note,.draw-reward small,.fortune-text,.fortune-card>small){color:var(--muted)}
html[data-theme=dark] :is(.tag,.tags span,.profile-tags span,.profile-countdown div,.sync-badge,.connected,.mailbox-choice.selected,.shop-stock,.shop-order-status,.letter-sent,.draw-reward.gift){background:var(--surface-soft);border-color:#526946;color:var(--deep)}
html[data-theme=dark] :is(.memory-art,.memory-art.image-art,.supporter-art,.affection-art-wrap,.voice-preview){background:#203228!important}
html[data-theme=dark] :is(.memory-copy,.voice-card-illustrated .voice-copy,.shop-product-image){background:var(--surface);border-color:var(--line)}
html[data-theme=dark] .memory-card,html[data-theme=dark] .voice-card-illustrated{background:var(--surface);border-color:var(--line)}
html[data-theme=dark] :is(.stream-card,.ring-days,.shop-rules-grid p,.mini-avatar,.archive-status>a,.social-row a){background:var(--surface-soft);border-color:var(--line)}
html[data-theme=dark] .stream-card{background:var(--surface)}
html[data-theme=dark] .stream-card::after{box-shadow:inset 0 0 0 1px #a6c88e0a}
html[data-theme=dark] :is(.stream-metrics span,.stream-card:hover .stream-metrics span){background:var(--surface-soft);color:var(--muted)}
html[data-theme=dark] .shop-rules summary{color:var(--deep)}
html[data-theme=dark] .memory-art.image-art::after{background:linear-gradient(180deg,#19272100 0%,#19272185 58%,var(--surface) 100%)}
html[data-theme=dark] :is(.profile-card,.fact-card,.story-card,.profile-stats,.live-panel,.stream-calendar,.sync-panel,.yearring-panel,.luck-album)::after{background:radial-gradient(circle,#91b47713,#91b47700)}
html[data-theme=dark] :is(.affection-bar,.month-bar,.result-track,.ratio-strip){background:#2b402f}html[data-theme=dark] .month-bar i{background:#748f61}
html[data-theme=dark] :is(.field-label input,.field-label textarea,.history-toolbar input,.history-toolbar select,.admin input,.admin textarea,.admin select){background:#122119;border-color:#3d5642;color:#e2e9d9;box-shadow:none;caret-color:var(--text)}
html[data-theme=dark] :is(input,textarea)::placeholder{color:#91a18a;opacity:1}
html[data-theme=dark] .field-label textarea{background-image:repeating-linear-gradient(transparent 0,transparent 31px,#c5d8a708 31px,#c5d8a708 32px)}
html[data-theme=dark] :is(.field-label,.mailbox-choice-copy strong,.mailbox-picker-head h3,.compose-head h3,.letter-body){color:var(--text)}
html[data-theme=dark] :is(.mailbox-choice-copy small,.mailbox-choice-state,.draft-bar,.compose-head .muted,.letter-sent p){color:var(--muted)}
html[data-theme=dark] :is(.draft-bar,.lottery-odds,.lottery-odds li,.draw-record,.shop-order-row,.profile-stats>div+div,.shop-metric:first-child){border-color:var(--line)}
html[data-theme=dark] :is(.btn,.btn.ghost,.icon-btn,.tiny-btn,.voice-replay,.back-top){background:var(--surface-soft);border-color:var(--line);color:var(--deep);box-shadow:none}
html[data-theme=dark] .btn.primary{background:#a7c68e;border-color:#a7c68e;color:#16251c}html[data-theme=dark] .btn.primary:hover{background:#bed7a7;border-color:#bed7a7;color:#16251c}
html[data-theme=dark] :is(.btn.ghost:hover,.tiny-btn:hover,.icon-btn:hover){background:#304a34;border-color:#607b50}
html[data-theme=dark] :is(.text-button,.history-reset,.lottery-odds summary,.lottery-history>summary,.footer-version,.footer-version:hover){color:var(--deep)}
html[data-theme=dark] :is(.lottery-odds>p,.lottery-odds small,#lottery-history-list,.draw-record small,.draw-record p){color:var(--muted)}
html[data-theme=dark] .draw-record>div{color:var(--text)}html[data-theme=dark] .ritual-visual{background:radial-gradient(ellipse,#6e8b3d2e,transparent 64%)}
html[data-theme=dark] .ring-inner{background:#25382733}html[data-theme=dark] .ritual-core{background:var(--surface-soft)}
html[data-theme=dark] :is(.voice-card-illustrated strong,.voice-copy strong){color:var(--text)}html[data-theme=dark] :is(.voice-card-illustrated small,.voice-card-illustrated .voice-tag,.voice-time,.voice-status,.voice-volume){color:var(--muted)}
html[data-theme=dark] .voice-card-illustrated .voice-copy:after,html[data-theme=dark] .voice-toggle{background:#a7c68e;color:#1a2a20}
html[data-theme=dark] :is(.modal-card,.release-note,.lottery-dialog,.hall-dialog,.admin-letter-dialog){background:#1b2c23;color:var(--text);border-color:#506348;box-shadow:0 25px 100px #0006}
html[data-theme=dark] :is(.modal-card,.release-note,.lottery-dialog,.hall-dialog,.admin-letter-dialog)::backdrop{background:#030a08b0;backdrop-filter:blur(8px)}
html[data-theme=dark] :is(.modal-card p,.release-entry ul,.release-note-foot,.release-entry-meta,.draw-ceremony>p){color:var(--muted)}html[data-theme=dark] .release-note .release-entry{border-color:var(--line)}
html[data-theme=dark] :is(.release-note-badge,.release-entry-meta strong,.changelog-version span){background:#2c4430;color:var(--deep)}
html[data-theme=dark] .qr-wrap{background:#fff;border-color:#afc397}html[data-theme=dark] .qr-wrap img,html[data-theme=dark] #council-qr img{background:#fff;border-radius:8px}
html[data-theme=dark] .toast{background:#243b2df5;color:#e5eddc;border-color:#668156;box-shadow:0 8px 30px #0004}
html[data-theme=dark] :is(.mobile-dock,.creator-nav){background:#14261fee;border-color:var(--line);box-shadow:0 -4px 20px #0002}
html[data-theme=dark] :is(.mobile-dock a,.mobile-dock button,.creator-nav a){color:var(--muted)}html[data-theme=dark] :is(.mobile-dock .active,.mobile-dock [aria-expanded=true],.creator-nav a:hover){background:#2d4431;color:var(--deep)}
html[data-theme=dark] :is(.footer,.council-footer){border-color:var(--line)}html[data-theme=dark] :is(.footer,.footer-meta p,.footer>p,.footer>p small,.council-footer){color:var(--muted)}
html[data-theme=dark] .signature-crop img{filter:invert(1);mix-blend-mode:screen}
/* Creator tools, including the actual letter paper and envelope layers. */
html[data-theme=dark] :is(.admin-card,.admin-stat,.mailbox-admin-item,.letter-row,.letter-empty,.shop-admin-item,.redemption-row,.changelog-card,.admin-changelog-list>summary,.lottery-config,.lottery-prize-row){background:var(--surface);border-color:var(--line);color:var(--text)}
html[data-theme=dark] :is(.letter-row.unread,.status-line,.admin .log,.shop-admin-thumb,.redemption-status,.council-split-preview span){background:var(--surface-soft);border-color:var(--line);color:var(--muted)}
html[data-theme=dark] :is(.admin h1,.admin h2,.admin h3,.admin-stat strong,.council-current-heading b){color:var(--deep)}html[data-theme=dark] :is(.admin-stat span,.admin-stat small,.changelog-card ul,.letter-row small,.shop-admin-main p,.redemption-row small,.council-admin-tallies b,.council-history-row small,.mailbox-admin-item p){color:var(--muted)}
html[data-theme=dark] .letter-reading-room{background:radial-gradient(ellipse at 50% 30%,#35412b,#1a2b23 70%);border-color:var(--line)}
html[data-theme=dark] :is(.letter-paper,.envelope-address){background:#2d3729;color:#e5e7d7;border-color:#65724f;box-shadow:0 12px 45px #0004}
html[data-theme=dark] .envelope-back{background:#34462f}html[data-theme=dark] .envelope-pocket{background:#394b33}html[data-theme=dark] .envelope-flap{background:#495e3d}
html[data-theme=dark] :is(.envelope-from,.envelope-subject,.letter-paper h3,.letter-paper .letter-body,.preview-letter-body){color:#e1e5d4}html[data-theme=dark] :is(.letter-sign,.letter-paper .small-label,.envelope-hint){color:#b8c7a2}
html[data-theme=dark] :is(.council-history-row,.council-admin-tallies>span,.admin-letter-dialog .dialog-actions,.preview-letter-scroll){border-color:var(--line)}
html[data-theme=dark] :is(.error,.lottery-status.error,#admin-council-message.error){color:#efa792}
@media(max-width:900px){html[data-theme=dark] .nav{background:#1a2d24fa;border-color:var(--line)}html[data-theme=dark] .nav a{background:#22382b}html[data-theme=dark] .nav a.active{background:#385335}}
@media(prefers-reduced-transparency:reduce){html[data-theme=dark] :is(.site-header,.site-header.scrolled,.council-header,.mobile-dock){background:#192b22}}

html[data-theme=dark] .fortune-luck{color:#bdcba9;background:#223326;border-color:#455b3b}html[data-theme=dark] .fortune-luck b{color:#98b765;background:none;-webkit-text-fill-color:#98b765;text-shadow:none}
