/* Login, first-run setup and settings: the same night-blue glass as the brain view. */
:root {
  --bg: #03040a; --glass: rgba(10, 16, 34, 0.72); --glass-hi: rgba(22, 32, 64, 0.8);
  --line: rgba(120, 160, 255, 0.18); --line-hi: rgba(140, 190, 255, 0.42);
  --text: #dfe7ff; --muted: #8d9bc2; --dim: #5d6a90; --accent: #7fd6ff; --gold: #ffc86b; --red: #ff5a7a; --green: #7dffb2; --violet: #b79dff;
  --font: Inter, "Noto Sans", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
body { background: radial-gradient(ellipse at 30% 10%, #13224f 0%, transparent 55%), radial-gradient(ellipse at 80% 90%, #2a1850 0%, transparent 50%), var(--bg); background-attachment: fixed; }
a { color: var(--accent); }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card { width: min(440px, 100%); padding: 28px 26px; border-radius: 18px; background: linear-gradient(160deg, var(--glass-hi), var(--glass)); border: 1px solid var(--line); box-shadow: 0 20px 60px rgba(0, 0, 0, .45); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.brand img { width: 52px; height: 52px; }
.brand .logo { font-weight: 800; letter-spacing: .22em; font-size: 15px; background: linear-gradient(90deg, #9fe6ff, #c9a0ff 50%, #ffc86b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .sub { color: var(--muted); font-size: 12px; }
h1 { font-size: 20px; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 13px; margin: 18px 0 8px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
p { margin: 0 0 12px; color: var(--muted); }
label { display: block; margin: 12px 0 4px; font-size: 12px; color: var(--muted); }
input, select, textarea { width: 100%; font: inherit; color: var(--text); background: rgba(5, 10, 24, .7); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--line-hi); }
select option { background: #0b1226; }
textarea { min-height: 80px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; font-size: 13px; color: var(--text); cursor: pointer; }
.check input { width: auto; margin-top: 3px; }
.check small { display: block; color: var(--muted); }
button, .button { font: inherit; color: var(--text); background: rgba(120, 160, 255, 0.12); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .button:hover { border-color: var(--line-hi); background: rgba(120, 160, 255, 0.2); }
button.primary { width: 100%; margin-top: 18px; padding: 12px; font-weight: 700; color: #061022; background: linear-gradient(90deg, #7fd6ff, #b79dff); border: 0; }
button.primary:disabled { opacity: .5; cursor: wait; }
button.small { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
button.danger { color: #ffd0d8; border-color: rgba(255, 90, 122, .45); }
.msg { margin-top: 12px; font-size: 13px; min-height: 1.2em; }
.msg.err { color: var(--red); }
.msg.ok { color: var(--green); }
.hint { font-size: 12px; color: var(--dim); margin-top: 6px; }
code, .mono { font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace; font-size: 12px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; border: 1px solid var(--line); color: var(--muted); }
.pill.ok { color: var(--green); border-color: rgba(125, 255, 178, .4); }
.pill.warn { color: var(--gold); border-color: rgba(255, 200, 107, .45); }
.pill.err { color: var(--red); border-color: rgba(255, 90, 122, .45); }

/* settings layout */
.settings { max-width: 1060px; margin: 0 auto; padding: 18px 16px 60px; }
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.topbar .brand { margin: 0; flex: 1; }
.layout { display: grid; grid-template-columns: 210px 1fr; gap: 16px; align-items: start; }
nav.tabs { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 12px; }
nav.tabs button { text-align: left; background: transparent; border-color: transparent; }
nav.tabs button.on { background: rgba(127, 214, 255, .14); border-color: var(--line-hi); }
.panel { padding: 20px 22px; border-radius: 16px; background: linear-gradient(160deg, var(--glass-hi), var(--glass)); border: 1px solid var(--line); margin-bottom: 14px; }
.panel[hidden] { display: none; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.list { display: grid; gap: 10px; }
.item { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(5, 10, 24, .45); }
.item-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.item-head b { font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13px; }
.kv span:nth-child(odd) { color: var(--muted); }
.progress { height: 4px; border-radius: 4px; background: rgba(120, 160, 255, .15); overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; background: var(--accent); }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; }
  nav.tabs { flex-direction: row; flex-wrap: wrap; position: static; }
  .row, .grid2 { grid-template-columns: 1fr; }
}
