/* Bottom-right preferences; reserve room for final content and save controls. */
body{padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))}
.theme-widget{position:fixed;right:max(16px,env(safe-area-inset-right,0px));bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:60;font:14px/1.5 "Pretendard","Noto Sans KR","Malgun Gothic",system-ui,sans-serif}
.theme-toggle,.theme-close{display:flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;border:1px solid #b38b9f;background:#fff;color:#70435c;border-radius:12px;font:inherit;font-weight:650;cursor:pointer;box-shadow:0 4px 20px #70435c18;padding:8px 14px;gap:8px;transform:none}
.theme-toggle{height:48px}.theme-toggle>span:first-child{font-size:19px;line-height:1}.theme-toggle:hover{background:#fff0f6;transform:none}
.theme-panel{position:absolute;right:0;bottom:calc(100% + 12px);width:min(288px,calc(100vw - 32px));max-height:calc(100vh - 112px - env(safe-area-inset-bottom,0px));max-height:calc(100dvh - 112px - env(safe-area-inset-bottom,0px));overflow:auto;overscroll-behavior:contain;padding:16px;background:#fff;border:1px solid #dec3d1;border-radius:16px;box-shadow:0 12px 45px #42313a28;color:#42313a;text-align:left}
.theme-panel[hidden]{display:none!important}.theme-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:8px}.theme-panel-heading h2{margin:0;font-size:16px}.theme-close{padding:0;font-size:24px;background:transparent;border-color:transparent;box-shadow:none;border-radius:8px}.theme-options{border:0;padding:0;margin:0;min-width:0}.theme-options legend{font-size:12px;color:#765a69;margin:0 0 8px;padding:0}.theme-option{display:flex;align-items:center;gap:12px;min-height:48px;padding:10px 12px;border:1px solid transparent;border-radius:10px;cursor:pointer;font-size:14px}.theme-option:hover{background:#fff7fa}.theme-option:has(input:checked){background:#fceaf2;border-color:#c984a2;color:#86365c}.theme-option input{appearance:auto;width:18px;height:18px;min-height:0;padding:0;margin:0;flex-shrink:0;accent-color:#963b66}
.theme-widget button:focus-visible,.theme-widget input:focus-visible{outline:3px solid #963b66;outline-offset:3px}.theme-toggle:disabled{opacity:.6;cursor:not-allowed}
:root[data-theme=light]{color-scheme:light}
:root[data-theme-keyboard=open] .theme-widget{visibility:hidden;pointer-events:none}
@media(max-width:640px){.theme-widget{right:max(12px,env(safe-area-inset-right,0px));bottom:calc(12px + env(safe-area-inset-bottom,0px))}.theme-toggle{padding:8px 12px}.theme-panel{width:min(288px,calc(100vw - 24px))}}

/* DARK_RULES_START */
:root[data-theme=dark]{color-scheme:dark;--bg:#18141c;--bg-strong:#241b27;--paper:#241c27;--surface:#241c27;--surface-strong:#2d2330;--text:#f1e7ee;--muted:#c3adbd;--line:#523e4e;--line-strong:#86667a;--green:#f2a9c8;--soft:#3b2735;--accent:#f2a9c8;--accent-strong:#ffd1e4;--accent-soft:#3b2735;--highlight:#d9a5bd;--highlight-soft:#3b2735;--danger:#ffc6bd;--danger-soft:#45262d;--shadow:0 20px 70px #0005}
:root[data-theme=dark] body,:root[data-theme=dark] body.entry-home{color:var(--text);background:#18141c;background-image:radial-gradient(ellipse at 10% 0%,#30202d 0,transparent 45%)}
:root[data-theme=dark] .theme-panel,:root[data-theme=dark] .sidebar,:root[data-theme=dark] .topbar{background:#211a24;border-color:var(--line);color:var(--muted)}
:root[data-theme=dark] .entry-card,:root[data-theme=dark] .card,:root[data-theme=dark] .hero,:root[data-theme=dark] .panel-card,:root[data-theme=dark] .overview-card,:root[data-theme=dark] .feature-card,:root[data-theme=dark] .start-steps li,:root[data-theme=dark] .sample-box,:root[data-theme=dark] .editor,:root[data-theme=dark] .command-list,:root[data-theme=dark] .command-row,:root[data-theme=dark] .save-bar,:root[data-theme=dark] dialog,:root[data-theme=dark] .empty-state,:root[data-theme=dark] .snapshot,:root[data-theme=dark] .metric,:root[data-theme=dark] .surface-note,:root[data-theme=dark] .toggle-card,:root[data-theme=dark] .editor-card,:root[data-theme=dark] .workspace-tab{background:var(--paper);border-color:var(--line);color:var(--text);box-shadow:none}
:root[data-theme=dark] .hero::before,:root[data-theme=dark] .hero::after{background:none}
:root[data-theme=dark] .entry-brand a,:root[data-theme=dark] .entry-card h1,:root[data-theme=dark] h1,:root[data-theme=dark] h2,:root[data-theme=dark] h3,:root[data-theme=dark] .entry-ready strong,:root[data-theme=dark] .runtime-notice strong,:root[data-theme=dark] .command-name,:root[data-theme=dark] .brand{color:var(--text)}
:root[data-theme=dark] p,:root[data-theme=dark] .entry-brand span,:root[data-theme=dark] .entry-eyebrow,:root[data-theme=dark] .entry-intro,:root[data-theme=dark] .entry-flow,:root[data-theme=dark] .entry-flow b,:root[data-theme=dark] .entry-consent,:root[data-theme=dark] .entry-admin a,:root[data-theme=dark] .entry-footer,:root[data-theme=dark] .streamer-badge,:root[data-theme=dark] .streamer-privacy,:root[data-theme=dark] .eyebrow,:root[data-theme=dark] .page-label,:root[data-theme=dark] .response-text,:root[data-theme=dark] .command-meta,:root[data-theme=dark] .preview-label,:root[data-theme=dark] .quiet,:root[data-theme=dark] .sidebar nav a,:root[data-theme=dark] .unit-input span,:root[data-theme=dark] .field-title,:root[data-theme=dark] .subtle{color:var(--muted)}
:root[data-theme=dark] .entry-flow,:root[data-theme=dark] .entry-admin,:root[data-theme=dark] .donation-row,:root[data-theme=dark] .status-row,:root[data-theme=dark] .subsection,:root[data-theme=dark] .donation-tabs{border-color:var(--line)}
:root[data-theme=dark] .entry-ready,:root[data-theme=dark] .runtime-notice,:root[data-theme=dark] .preview,:root[data-theme=dark] .command-list>.editor,:root[data-theme=dark] .unsupported-note,:root[data-theme=dark] .note{background:#2d202c;border-color:var(--line);color:var(--muted)}
:root[data-theme=dark] .entry-dot,:root[data-theme=dark] .brand-dot{background:var(--accent)}
:root[data-theme=dark] input,:root[data-theme=dark] textarea,:root[data-theme=dark] select,:root[data-theme=dark] .field input,:root[data-theme=dark] .field textarea{background:#211a24;color:var(--text);border-color:#86667a}
:root[data-theme=dark] input::placeholder,:root[data-theme=dark] textarea::placeholder{color:#bca7b5;opacity:1}
:root[data-theme=dark] .button.primary,:root[data-theme=dark] button.primary{background:#f2a9c8;color:#291c25;border-color:#f2a9c8;box-shadow:none}
:root[data-theme=dark] .button.primary:hover,:root[data-theme=dark] button.primary:hover{background:#ffd1e4;border-color:#ffd1e4}
:root[data-theme=dark] .button.secondary,:root[data-theme=dark] button.secondary,:root[data-theme=dark] .row-actions button,:root[data-theme=dark] .sample-buttons button,:root[data-theme=dark] .variable-row button,:root[data-theme=dark] .donation-tabs button{background:#302531;color:var(--text);border-color:#86667a}
:root[data-theme=dark] .row-actions .on,:root[data-theme=dark] .sidebar nav a.active,:root[data-theme=dark] .donation-tabs button[aria-selected=true],:root[data-theme=dark] .workspace-tab.is-active{background:#3b2735;color:#ffd1e4;border-color:#a57d94}
:root[data-theme=dark] .row-actions .off{background:#302a33;color:#c3adbd}
:root[data-theme=dark] .sidebar nav a:hover{background:#302531}
:root[data-theme=dark] nav span,:root[data-theme=dark] .start-steps b,:root[data-theme=dark] .variable-row code,:root[data-theme=dark] .inline-code,:root[data-theme=dark] .tooltip-trigger,:root[data-theme=dark] .workspace-tab__eyebrow{background:#3b2735;color:#ffd1e4}
:root[data-theme=dark] .status-pill,:root[data-theme=dark] .feedback,:root[data-theme=dark] .notice-banner--ok,:root[data-theme=dark] .stat-chip--ok,:root[data-theme=dark] .mini-badge,:root[data-theme=dark] .token-pill{background:#342733;border-color:#86667a;color:#f6c8df}
:root[data-theme=dark] .feedback.error,:root[data-theme=dark] .notice-banner--error,:root[data-theme=dark] .stat-chip--error{background:#45262d;border-color:#b97775;color:#ffc6bd}
:root[data-theme=dark] .delete{color:#ffc6bd!important}
:root[data-theme=dark] .danger,:root[data-theme=dark] button.danger{background:#ffc6bd;color:#3c1819;border-color:#ffc6bd}
:root[data-theme=dark] .stat-chip--waiting{background:#3b3026;color:#f3d3a8;border-color:#897355}
:root[data-theme=dark] .card-link,:root[data-theme=dark] .bot-reply,:root[data-theme=dark] .entry-admin a:hover{color:#ffd1e4}
:root[data-theme=dark] .tooltip-bubble{background:#f1e7ee;color:#291c25}
:root[data-theme=dark] .notice-banner{background:#302531;border-color:var(--line)}
:root[data-theme=dark] .notice-banner--error{background:#45262d}
:root[data-theme=dark] dialog::backdrop{background:#09060cb3}
:root[data-theme=dark] button:focus-visible,:root[data-theme=dark] a:focus-visible,:root[data-theme=dark] input:focus-visible,:root[data-theme=dark] select:focus-visible,:root[data-theme=dark] textarea:focus-visible{outline:3px solid #f2a9c8;outline-offset:3px}
:root[data-theme=dark] .inherited{opacity:1}
:root[data-theme=dark] button:disabled:not(.entry-naver),:root[data-theme=dark] input:disabled,:root[data-theme=dark] textarea:disabled,:root[data-theme=dark] select:disabled{opacity:1;background:#2b232d;color:#b6a4b1;border-color:#685162;cursor:not-allowed}

:root[data-theme=dark] .theme-toggle,:root[data-theme=dark] .theme-close{background:#302531;border-color:#86667a;color:#f1e7ee;box-shadow:none}
:root[data-theme=dark] .theme-toggle:hover,:root[data-theme=dark] .theme-option:hover{background:#3b2735}
:root[data-theme=dark] .theme-close{background:transparent;border-color:transparent}
:root[data-theme=dark] .theme-options legend{color:#c3adbd}
:root[data-theme=dark] .theme-option:has(input:checked){background:#3b2735;color:#ffd1e4;border-color:#a57d94}
:root[data-theme=dark] .theme-option input{accent-color:#f2a9c8}

/* DARK_RULES_END */
@media(prefers-color-scheme:dark){
:root:not([data-theme]){color-scheme:dark;--bg:#18141c;--bg-strong:#241b27;--paper:#241c27;--surface:#241c27;--surface-strong:#2d2330;--text:#f1e7ee;--muted:#c3adbd;--line:#523e4e;--line-strong:#86667a;--green:#f2a9c8;--soft:#3b2735;--accent:#f2a9c8;--accent-strong:#ffd1e4;--accent-soft:#3b2735;--highlight:#d9a5bd;--highlight-soft:#3b2735;--danger:#ffc6bd;--danger-soft:#45262d;--shadow:0 20px 70px #0005}
:root:not([data-theme]) body,:root:not([data-theme]) body.entry-home{color:var(--text);background:#18141c;background-image:radial-gradient(ellipse at 10% 0%,#30202d 0,transparent 45%)}
:root:not([data-theme]) .theme-panel,:root:not([data-theme]) .sidebar,:root:not([data-theme]) .topbar{background:#211a24;border-color:var(--line);color:var(--muted)}
:root:not([data-theme]) .entry-card,:root:not([data-theme]) .card,:root:not([data-theme]) .hero,:root:not([data-theme]) .panel-card,:root:not([data-theme]) .overview-card,:root:not([data-theme]) .feature-card,:root:not([data-theme]) .start-steps li,:root:not([data-theme]) .sample-box,:root:not([data-theme]) .editor,:root:not([data-theme]) .command-list,:root:not([data-theme]) .command-row,:root:not([data-theme]) .save-bar,:root:not([data-theme]) dialog,:root:not([data-theme]) .empty-state,:root:not([data-theme]) .snapshot,:root:not([data-theme]) .metric,:root:not([data-theme]) .surface-note,:root:not([data-theme]) .toggle-card,:root:not([data-theme]) .editor-card,:root:not([data-theme]) .workspace-tab{background:var(--paper);border-color:var(--line);color:var(--text);box-shadow:none}
:root:not([data-theme]) .hero::before,:root:not([data-theme]) .hero::after{background:none}
:root:not([data-theme]) .entry-brand a,:root:not([data-theme]) .entry-card h1,:root:not([data-theme]) h1,:root:not([data-theme]) h2,:root:not([data-theme]) h3,:root:not([data-theme]) .entry-ready strong,:root:not([data-theme]) .runtime-notice strong,:root:not([data-theme]) .command-name,:root:not([data-theme]) .brand{color:var(--text)}
:root:not([data-theme]) p,:root:not([data-theme]) .entry-brand span,:root:not([data-theme]) .entry-eyebrow,:root:not([data-theme]) .entry-intro,:root:not([data-theme]) .entry-flow,:root:not([data-theme]) .entry-flow b,:root:not([data-theme]) .entry-consent,:root:not([data-theme]) .entry-admin a,:root:not([data-theme]) .entry-footer,:root:not([data-theme]) .streamer-badge,:root:not([data-theme]) .streamer-privacy,:root:not([data-theme]) .eyebrow,:root:not([data-theme]) .page-label,:root:not([data-theme]) .response-text,:root:not([data-theme]) .command-meta,:root:not([data-theme]) .preview-label,:root:not([data-theme]) .quiet,:root:not([data-theme]) .sidebar nav a,:root:not([data-theme]) .unit-input span,:root:not([data-theme]) .field-title,:root:not([data-theme]) .subtle{color:var(--muted)}
:root:not([data-theme]) .entry-flow,:root:not([data-theme]) .entry-admin,:root:not([data-theme]) .donation-row,:root:not([data-theme]) .status-row,:root:not([data-theme]) .subsection,:root:not([data-theme]) .donation-tabs{border-color:var(--line)}
:root:not([data-theme]) .entry-ready,:root:not([data-theme]) .runtime-notice,:root:not([data-theme]) .preview,:root:not([data-theme]) .command-list>.editor,:root:not([data-theme]) .unsupported-note,:root:not([data-theme]) .note{background:#2d202c;border-color:var(--line);color:var(--muted)}
:root:not([data-theme]) .entry-dot,:root:not([data-theme]) .brand-dot{background:var(--accent)}
:root:not([data-theme]) input,:root:not([data-theme]) textarea,:root:not([data-theme]) select,:root:not([data-theme]) .field input,:root:not([data-theme]) .field textarea{background:#211a24;color:var(--text);border-color:#86667a}
:root:not([data-theme]) input::placeholder,:root:not([data-theme]) textarea::placeholder{color:#bca7b5;opacity:1}
:root:not([data-theme]) .button.primary,:root:not([data-theme]) button.primary{background:#f2a9c8;color:#291c25;border-color:#f2a9c8;box-shadow:none}
:root:not([data-theme]) .button.primary:hover,:root:not([data-theme]) button.primary:hover{background:#ffd1e4;border-color:#ffd1e4}
:root:not([data-theme]) .button.secondary,:root:not([data-theme]) button.secondary,:root:not([data-theme]) .row-actions button,:root:not([data-theme]) .sample-buttons button,:root:not([data-theme]) .variable-row button,:root:not([data-theme]) .donation-tabs button{background:#302531;color:var(--text);border-color:#86667a}
:root:not([data-theme]) .row-actions .on,:root:not([data-theme]) .sidebar nav a.active,:root:not([data-theme]) .donation-tabs button[aria-selected=true],:root:not([data-theme]) .workspace-tab.is-active{background:#3b2735;color:#ffd1e4;border-color:#a57d94}
:root:not([data-theme]) .row-actions .off{background:#302a33;color:#c3adbd}
:root:not([data-theme]) .sidebar nav a:hover{background:#302531}
:root:not([data-theme]) nav span,:root:not([data-theme]) .start-steps b,:root:not([data-theme]) .variable-row code,:root:not([data-theme]) .inline-code,:root:not([data-theme]) .tooltip-trigger,:root:not([data-theme]) .workspace-tab__eyebrow{background:#3b2735;color:#ffd1e4}
:root:not([data-theme]) .status-pill,:root:not([data-theme]) .feedback,:root:not([data-theme]) .notice-banner--ok,:root:not([data-theme]) .stat-chip--ok,:root:not([data-theme]) .mini-badge,:root:not([data-theme]) .token-pill{background:#342733;border-color:#86667a;color:#f6c8df}
:root:not([data-theme]) .feedback.error,:root:not([data-theme]) .notice-banner--error,:root:not([data-theme]) .stat-chip--error{background:#45262d;border-color:#b97775;color:#ffc6bd}
:root:not([data-theme]) .delete{color:#ffc6bd!important}
:root:not([data-theme]) .danger,:root:not([data-theme]) button.danger{background:#ffc6bd;color:#3c1819;border-color:#ffc6bd}
:root:not([data-theme]) .stat-chip--waiting{background:#3b3026;color:#f3d3a8;border-color:#897355}
:root:not([data-theme]) .card-link,:root:not([data-theme]) .bot-reply,:root:not([data-theme]) .entry-admin a:hover{color:#ffd1e4}
:root:not([data-theme]) .tooltip-bubble{background:#f1e7ee;color:#291c25}
:root:not([data-theme]) .notice-banner{background:#302531;border-color:var(--line)}
:root:not([data-theme]) .notice-banner--error{background:#45262d}
:root:not([data-theme]) dialog::backdrop{background:#09060cb3}
:root:not([data-theme]) button:focus-visible,:root:not([data-theme]) a:focus-visible,:root:not([data-theme]) input:focus-visible,:root:not([data-theme]) select:focus-visible,:root:not([data-theme]) textarea:focus-visible{outline:3px solid #f2a9c8;outline-offset:3px}
:root:not([data-theme]) .inherited{opacity:1}
:root:not([data-theme]) button:disabled:not(.entry-naver),:root:not([data-theme]) input:disabled,:root:not([data-theme]) textarea:disabled,:root:not([data-theme]) select:disabled{opacity:1;background:#2b232d;color:#b6a4b1;border-color:#685162;cursor:not-allowed}

:root:not([data-theme]) .theme-toggle,:root:not([data-theme]) .theme-close{background:#302531;border-color:#86667a;color:#f1e7ee;box-shadow:none}
:root:not([data-theme]) .theme-toggle:hover,:root:not([data-theme]) .theme-option:hover{background:#3b2735}
:root:not([data-theme]) .theme-close{background:transparent;border-color:transparent}
:root:not([data-theme]) .theme-options legend{color:#c3adbd}
:root:not([data-theme]) .theme-option:has(input:checked){background:#3b2735;color:#ffd1e4;border-color:#a57d94}
:root:not([data-theme]) .theme-option input{accent-color:#f2a9c8}
}
@media(prefers-reduced-motion:reduce){.theme-widget *{transition:none!important}}

:root[data-theme=dark] .master-bot{background:#241c27;border-color:#86667a}
:root[data-theme=dark] .master-bot h2,:root[data-theme=dark] .master-bot-main p,:root[data-theme=dark] .master-bot-status,:root[data-theme=dark] #master-bot-request{color:#c3adbd}
:root[data-theme=dark] .master-bot-status{border-color:#523e4e}
:root[data-theme=dark] .master-bot-status strong{color:#ffd1e4}

@media(prefers-color-scheme:dark){
:root:not([data-theme]) .master-bot{background:#241c27;border-color:#86667a}
:root:not([data-theme]) .master-bot h2,:root:not([data-theme]) .master-bot-main p,:root:not([data-theme]) .master-bot-status,:root:not([data-theme]) #master-bot-request{color:#c3adbd}
:root:not([data-theme]) .master-bot-status{border-color:#523e4e}
:root:not([data-theme]) .master-bot-status strong{color:#ffd1e4}
}
