/* Light / dark theme — hand-written part. theme-dark.css (generated from styles.css by build/make-dark-css.js) swaps the
   hard-coded colors; this file sets the dark CSS variables, the sun/moon button, colors written inline in the window's
   code, and the few places the automatic swap gets wrong. The theme is set on <html data-theme="light|dark"> by theme.js. */

/* the sun / moon button (top of the menu, every page) */
.brand{position:relative}
.theme-btn{margin-left:auto;flex:none;width:34px;height:34px;border-radius:10px;border:1.5px solid #ede9fe;background:#fff;color:#6d28d9;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0;transition:background .2s,color .2s,transform .25s cubic-bezier(.34,1.56,.64,1)}
.theme-btn:hover{background:#f5f3ff;transform:rotate(-15deg)}
.theme-btn:focus-visible{outline:2px solid #7c3aed;outline-offset:2px}
.theme-btn svg{width:17px;height:17px}
.theme-btn .t-sun{display:none}
html[data-theme="dark"] .theme-btn{background:#251f3e;border-color:#3d3660;color:#fcd34d}
html[data-theme="dark"] .theme-btn:hover{background:#2f2850}
html[data-theme="dark"] .theme-btn .t-sun{display:block}
html[data-theme="dark"] .theme-btn .t-moon{display:none}
/* the Theme choice in Settings */
.theme-pick{display:flex;gap:8px;flex-wrap:wrap}
.theme-pick button{display:inline-flex;align-items:center;gap:8px}
.theme-pick button svg{width:15px;height:15px}

/* ── dark ─────────────────────────────────────────────────────────────────── */
html[data-theme="dark"]{--ink:#ece9f7;--mut:#a8a2c2;--line:#2e2849;--bg:#0f0c1d;--card:#191529;--pt:#c4b5fd;--ok:#34d399;--err:#f87171;--warn:#fbbf24;color-scheme:dark}
html[data-theme="dark"] body{background:#0f0c1d}
html[data-theme="dark"] body::before{opacity:.10}
html[data-theme="dark"] body::after{opacity:.06}
:where(html[data-theme="dark"]) a{color:#c4b5fd}
:where(html[data-theme="dark"]) .btn,:where(html[data-theme="dark"]) a.btn{color:#fff}
:where(html[data-theme="dark"]) a.btn.g{color:#cfcbe0}
html[data-theme="dark"] .side{box-shadow:0 12px 32px rgba(0,0,0,.35)}
html[data-theme="dark"] .card,html[data-theme="dark"] .statc{box-shadow:0 1px 2px rgba(0,0,0,.3)}
html[data-theme="dark"] .card:hover,html[data-theme="dark"] .statc:hover{box-shadow:0 16px 36px rgba(0,0,0,.45)}
html[data-theme="dark"] .inp:focus{box-shadow:0 0 0 3px rgba(167,139,250,.25)}
html[data-theme="dark"] select option{background:#191529;color:#ece9f7}
html[data-theme="dark"] ::placeholder{color:#8a85a6}
html[data-theme="dark"] ::-webkit-scrollbar-thumb{background:#3d3660}
/* toggle switches: a light knob on a dark track */
:where(html[data-theme="dark"]) .switch input::after{background:#f3f1fb}
:where(html[data-theme="dark"]) .switch input{background:#3d3660}
:where(html[data-theme="dark"]) .switch input:checked{background:var(--c,#7c3aed)}
/* the article editor keeps its reading colors readable */
html[data-theme="dark"] .ed-body{color:#e4e0f2}
html[data-theme="dark"] .ed-body img{background:#fff}

/* colors written inline in the window's code (style="color:#dc2626" …) */
html[data-theme="dark"] [style*="color:#dc2626"]:not([style*="background:#dc2626"]),html[data-theme="dark"] [style*="color:#b91c1c"],html[data-theme="dark"] [style*="color:#991b1b"]{color:#f87171!important}
html[data-theme="dark"] [style*="color:#059669"]:not([style*="background:#059669"]),html[data-theme="dark"] [style*="color:#047857"],html[data-theme="dark"] [style*="color:#065f46"],html[data-theme="dark"] [style*="color:#16a34a"]{color:#34d399!important}
html[data-theme="dark"] [style*="color:#b45309"],html[data-theme="dark"] [style*="color:#d97706"],html[data-theme="dark"] [style*="color:#92400e"],html[data-theme="dark"] [style*="color:#ea580c"],html[data-theme="dark"] [style*="color:#c2410c"]{color:#fbbf24!important}
html[data-theme="dark"] [style*="color:#6d28d9"]:not([style*="background:#6d28d9"]),html[data-theme="dark"] [style*="color:#7c3aed"],html[data-theme="dark"] [style*="color:#4c1d95"],html[data-theme="dark"] [style*="color:#5b21b6"],html[data-theme="dark"] [style*=";color:var(--p)"],html[data-theme="dark"] [style^="color:var(--p)"]{color:#c4b5fd!important}
html[data-theme="dark"] [style*="color:#4f46e5"]:not([style*="background:#4f46e5"]),html[data-theme="dark"] [style*="color:#4338ca"]{color:#a5b4fc!important}
html[data-theme="dark"] [style*="color:#2563eb"],html[data-theme="dark"] [style*="color:#1d4ed8"],html[data-theme="dark"] [style*="color:#0369a1"],html[data-theme="dark"] [style*="color:#0891b2"]{color:#7dd3fc!important}
html[data-theme="dark"] [style*="color:#111827"],html[data-theme="dark"] [style*="color:#1f2937"],html[data-theme="dark"] [style*="color:#1e1b4b"],html[data-theme="dark"] [style*="color:#374151"],html[data-theme="dark"] [style*="color:#4b5563"]{color:#e4e0f2!important}
html[data-theme="dark"] [style*="color:#6b7280"],html[data-theme="dark"] [style*="color:#9ca3af"]{color:#a8a2c2!important}
html[data-theme="dark"] [style*="background:#fff;"],html[data-theme="dark"] [style$="background:#fff"],html[data-theme="dark"] [style*="background:#ffffff"]{background:#191529!important}
html[data-theme="dark"] [style*="background:#f5f3ff"],html[data-theme="dark"] [style*="background:#faf9ff"],html[data-theme="dark"] [style*="background:#f3f4f6"],html[data-theme="dark"] [style*="background:#f9fafb"],html[data-theme="dark"] [style*="background:#ede9fe"],html[data-theme="dark"] [style*="background:#faf5ff"]{background:#251f3e!important}
html[data-theme="dark"] [style*="background:#ecfdf5"]{background:#10302a!important}
html[data-theme="dark"] [style*="background:#fef3c7"],html[data-theme="dark"] [style*="background:#fffbeb"]{background:#36290f!important}
html[data-theme="dark"] [style*="background:#eef2ff"],html[data-theme="dark"] [style*="background:#e0e7ff"]{background:#232857!important}
html[data-theme="dark"] [style*="background:#d1fae5"]{background:#10302a!important}
html[data-theme="dark"] [style*="background:#dbeafe"],html[data-theme="dark"] [style*="background:#cffafe"]{background:#132640!important}
html[data-theme="dark"] [style*="color:#6366f1"]:not([style*="background:#6366f1"]){color:#a5b4fc!important}
html[data-theme="dark"] [style*="background:#fef2f2"]{background:#3a161d!important}
html[data-theme="dark"] [style*="border-color:#fca5a5"]{border-color:#6b2630!important}
html[data-theme="dark"] [style*="border:1px solid #e5e7eb"],html[data-theme="dark"] [style*="border:1px solid #ede9fe"],html[data-theme="dark"] [style*="border-top:1px solid #"],html[data-theme="dark"] [style*="border-bottom:1px solid #"]{border-color:#2e2849!important}
/* the chosen Theme button in Settings (html[data-theme-choice] is set by theme.js) */
html[data-theme-choice="light"] .theme-pick [data-t="light"],html[data-theme-choice="dark"] .theme-pick [data-t="dark"],html[data-theme-choice="system"] .theme-pick [data-t="system"]{background:var(--p);border-color:var(--p);color:#fff}
/* social content plan: the keyword column takes a dark tint of its platform color; format pills stay pastel with dark text */
html[data-theme="dark"] .plan tbody td.kc,html[data-theme="dark"] .plan tbody tr:nth-child(even) td.kc{background:color-mix(in srgb,var(--pc,#7c3aed) 16%,#191529)}
:where(html[data-theme="dark"]) .plan .fmt{color:#1e293b}
/* model cards and their badges take dark tints of their brand color (set inline as --mc / --mb) */
html[data-theme="dark"] .mcard{--mb:color-mix(in srgb,var(--mc,#7c3aed) 14%,#191529)!important}
html[data-theme="dark"] .i-ico,html[data-theme="dark"] .i-badge{color:color-mix(in srgb,var(--mc,#7c3aed) 45%,#fff)}
/* more pastel backgrounds and teal text written inline (badges, notes) */
html[data-theme="dark"] [style*="background:#f0fdf4"],html[data-theme="dark"] [style*="background:#f0fdfa"],html[data-theme="dark"] [style*="background:#dcfce7"],html[data-theme="dark"] [style*="background:#ccfbf1"]{background:#10302a!important}
html[data-theme="dark"] [style*="background:#ecfeff"],html[data-theme="dark"] [style*="background:#f0f9ff"],html[data-theme="dark"] [style*="background:#eff6ff"],html[data-theme="dark"] [style*="background:#e0f2fe"]{background:#132640!important}
html[data-theme="dark"] [style*="background:#fff7ed"],html[data-theme="dark"] [style*="background:#ffedd5"],html[data-theme="dark"] [style*="background:#fefce8"]{background:#36290f!important}
html[data-theme="dark"] [style*="background:#fee2e2"],html[data-theme="dark"] [style*="background:#fdf2f8"],html[data-theme="dark"] [style*="background:#fce7f3"],html[data-theme="dark"] [style*="background:#fff1f2"]{background:#3a161d!important}
html[data-theme="dark"] [style*="color:#0f766e"],html[data-theme="dark"] [style*="color:#0d9488"]{color:#5eead4!important}
