/* Coide app themes: "sable" (default) and "dusk" put the site's sky behind the workspace.
   No data-theme attribute = the original dark look. Set by app-theme.js, remembered per browser. */
html:root[data-theme] { --line: rgb(255 255 255 / .2); --line-strong: rgb(255 255 255 / .34); --ink: #fff; --ink-soft: rgb(255 255 255 / .8); --ink-faint: rgb(255 255 255 / .58);
  --accent: #fff; --accent-soft: rgb(255 255 255 / .18); --button-bg: #fff; --button-ink: #1b1715; --button-hover: #f1ece8; }
html[data-theme] body { background: var(--sky) center / cover no-repeat fixed, var(--sky-base); }
html[data-theme] .app { background: none; }
html[data-theme] .topbar { background: var(--glass); border-bottom-color: var(--line); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); }
html[data-theme] .shell { gap: 12px; padding: 12px; }
html[data-theme] .sidebar { border: 0; border-radius: 16px; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); }
html[data-theme] .main { border-radius: 16px; overflow: hidden; background: var(--glass); box-shadow: inset 0 0 0 1px var(--line), 0 30px 80px -40px rgb(40 20 10 / .5); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); }
html[data-theme] .tabs { background: none; border-bottom-color: var(--line); }
html[data-theme] .tabs button.on { border-bottom-color: #fff; }
/* terminal and code stay dark, warm, like a card on the sky */
html[data-theme] .terminal-wrap { background: var(--term); margin: 0 10px 10px; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 50px -24px rgb(30 15 8 / .55); }
html[data-theme] .terminal-head { background: var(--term); border-bottom-color: rgb(255 255 255 / .08); }
html[data-theme] .tree-wrap, html[data-theme] .viewer-wrap { background: none; }
html[data-theme] .viewer-wrap pre, html[data-theme] .viewer-wrap textarea, html[data-theme] .code { background: var(--term) !important; }
html[data-theme] .term-foot { background: none; border-top-color: var(--line); }
html[data-theme] .side-section { border-color: var(--line); }
html[data-theme] .agent-tile, html[data-theme] .agent-tile[data-agent] { background: rgb(255 255 255 / .16) !important; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .26) !important; }
html[data-theme] .agents { background: rgb(255 255 255 / .06); }
html[data-theme] .demo-pill { background: var(--glass) !important; border-color: var(--line) !important; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
html[data-theme] .dialog { background: var(--term); }
html[data-theme] .auth-right { background: var(--glass); backdrop-filter: blur(18px); }
html[data-theme] .auth-left { background: none; }
html[data-theme] .auth-left::before { display: none; }
/* status text stays readable on the sky */
html:root[data-theme] { --green: #c9f2d2; --mint: #c9f2d2; --amber: #ffe2a8; --red: #ffc2c2; }
html[data-theme] .demo-pill { background: rgb(30 20 16 / .28) !important; }
html[data-theme="sable"] { --sky: url(sky-sand.webp); --sky-base: linear-gradient(180deg, #b0887a, #d9bbad); --glass: rgb(70 36 22 / .12); --term: #1d1816; }
html[data-theme="dusk"] { --sky: url(sky-dusk.webp); --sky-base: linear-gradient(180deg, #7d7480, #d6b8bd); --glass: rgb(40 28 40 / .22); --term: #1a1519; }
html[data-theme] .cluster-pill { color: #fff; border-color: rgb(255 255 255 / .4); background: rgb(255 255 255 / .12); }

/* theme switch in the top bar */
.theme-btn { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px 0 8px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--ink-soft); font-size: 12px; cursor: pointer; }
.theme-btn:hover { color: var(--ink); background: rgb(255 255 255 / .08); }
.theme-btn i { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .5); background: #2a2a2e; }
html[data-theme="sable"] .theme-btn i { background: linear-gradient(180deg, #b0887a, #e6c7b8); }
html[data-theme="dusk"] .theme-btn i { background: linear-gradient(180deg, #7d7480, #f2cfd4); }
@media (max-width: 720px) { .theme-btn span { display: none; } .theme-btn { padding: 0 7px; } }
html[data-theme] .auth { background: none; }
