/* TERA Coding Space v7.0.2 · Trust theme, loaded last on every page. It changes appearance only, never behaviour.
   Light theme: pure white surfaces on a very light page, hairline borders, soft depth, TERA navy and gold.
   Night theme: TERA's deep navy with a faint gold light, quieter borders, premium depth.
   Both: nothing alarming without a reason. Destructive actions stay recognizable but calm until the pointer or the
   keyboard reaches them; warnings and errors use soft tints with clear words; focus is always visible. */

/* ---------- light: pure white ---------- */
html:not([data-theme="dark"]){--bg:#f6f8fb;--surface:#ffffff;--surface2:#f1f5fa;--surface3:#fafbfd;--ink:#132238;--muted:#4e6077;--border:#dce4ee;
  --blue:#2f5585;--blue2:#1f3a5c;--gold:#a88646;--gold2:#f6efe0;--green:#0b7a59;--green2:#e3f4ed;--amber:#8a5a00;--amber2:#fdf4de;--red:#9f4541;--red2:#fbefee;
  --shadow:0 1px 2px rgba(16,24,40,.04),0 10px 28px rgba(31,58,92,.07);color-scheme:light}
html:not([data-theme="dark"]) body{background-color:var(--bg)}
html:not([data-theme="dark"]) input,html:not([data-theme="dark"]) select,html:not([data-theme="dark"]) textarea{border-color:#ccd7e4}
html:not([data-theme="dark"]) input:hover:not(:focus):not(:disabled),html:not([data-theme="dark"]) select:hover:not(:focus):not(:disabled),html:not([data-theme="dark"]) textarea:hover:not(:focus):not(:disabled){border-color:#b3c2d4}
html:not([data-theme="dark"]) .card{border-color:var(--border)}
html:not([data-theme="dark"]) .btn.soft{background:#fff;border-color:#d3dce8}
html:not([data-theme="dark"]) .btn.soft:hover{background:var(--surface2)}
html:not([data-theme="dark"]) ::selection{background:#d4e3f7;color:#132238}
html:not([data-theme="dark"]) *{scrollbar-color:#c5d1df transparent}

/* ---------- night: premium deep navy ---------- */
html[data-theme="dark"]{--bg:#0b1220;--surface:#121c2c;--surface2:#182538;--surface3:#0f1826;--ink:#eef3fa;--muted:#b3c0d3;--border:#27384f;
  --blue:#8fb8f0;--blue2:#c3dafa;--gold:#d8b768;--gold2:#2c2618;--green:#6fd3ad;--green2:#14342b;--amber:#ecc574;--amber2:#33291a;--red:#efa3a3;--red2:#2e1c21;
  --shadow:0 1px 0 rgba(255,255,255,.03) inset,0 16px 36px rgba(0,0,0,.36);color-scheme:dark}
html[data-theme="dark"] body{background:radial-gradient(1100px 520px at 88% -8%,rgba(216,183,104,.07),transparent 62%),radial-gradient(900px 520px at -8% 108%,rgba(143,184,240,.06),transparent 60%),var(--bg);background-attachment:fixed}
html[data-theme="dark"] .card{background-image:linear-gradient(180deg,rgba(255,255,255,.022),rgba(255,255,255,0) 160px)}
html[data-theme="dark"] ::selection{background:#2b4466;color:#fff}
html[data-theme="dark"] *{scrollbar-color:#33465f transparent}

/* ---------- calm by default, clear when it matters ---------- */
/* destructive buttons: readable as such, quiet until reached */
html:not([data-theme="dark"]) .btn.danger{background:#fff;color:#9f4541;border-color:#e8cdca}
html:not([data-theme="dark"]) .btn.danger:hover:not(:disabled),html:not([data-theme="dark"]) .btn.danger:focus-visible{background:#fbefee;border-color:#d9aaa6}
html[data-theme="dark"] .btn.danger{background:transparent!important;color:#f1b3b3!important;border-color:#4b3138!important}
html[data-theme="dark"] .btn.danger:hover:not(:disabled),html[data-theme="dark"] .btn.danger:focus-visible{background:#2e1c21!important;border-color:#6d4149!important}
/* status colours: soft tints, never a block of alarm */
.badge.bad{border-color:color-mix(in srgb,var(--red) 28%,var(--border))}
.notice.bad{border-left-width:4px}
.toast.bad{border-left-color:color-mix(in srgb,var(--red) 70%,var(--border))}
/* depth and rhythm */
.card{border-radius:var(--radius);box-shadow:var(--shadow)}
.btn{transition:background-color .15s,border-color .15s,box-shadow .15s,color .15s}
.btn:active:not(:disabled){transform:translateY(1px)}
/* keyboard users always see where they are */
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid color-mix(in srgb,var(--blue) 50%,transparent);outline-offset:2px}
/* thin, quiet scrollbars */
*{scrollbar-width:thin}
::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:color-mix(in srgb,var(--muted) 35%,transparent);border-radius:10px;border:2px solid transparent;background-clip:padding-box}
::-webkit-scrollbar-thumb:hover{background:color-mix(in srgb,var(--muted) 55%,transparent);background-clip:padding-box}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important}}
