/* Quick Check — shared styles */
:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --ink: #1a1d24;
  --ink-2: #4a4f5c;
  --ink-3: #767b88;
  --line: #dedbd2;
  --accent: #2456d3;
  --accent-ink: #ffffff;
  --accent-soft: #e4ebfb;
  --good: #16895c;
  --good-soft: #dcf2e8;
  --warn: #b85c00;
  --warn-soft: #fbead6;
  --danger: #c23434;
  --c0: #2f6fed; --c1: #e0662b; --c2: #16935f; --c3: #8a55e8; --c4: #d13b6c; --c5: #0e93a8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 22, 30, .06), 0 4px 16px rgba(20, 22, 30, .06);
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161b; --surface: #1d2027; --surface-2: #262a33; --ink: #f1f2f5; --ink-2: #c3c7d1; --ink-3: #8d93a1;
    --line: #333844; --accent: #6b93ff; --accent-ink: #0d1020; --accent-soft: #232c45; --good: #3fcf8e; --good-soft: #17352a;
    --warn: #f0a24a; --warn-soft: #3a2a17; --danger: #ff6b6b;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14161b; --surface: #1d2027; --surface-2: #262a33; --ink: #f1f2f5; --ink-2: #c3c7d1; --ink-3: #8d93a1;
  --line: #333844; --accent: #6b93ff; --accent-ink: #0d1020; --accent-soft: #232c45; --good: #3fcf8e; --good-soft: #17352a;
  --warn: #f0a24a; --warn-soft: #3a2a17; --danger: #ff6b6b;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 44px; padding: .55em 1.05em;
  border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--danger); }
.btn.sm { min-height: 36px; padding: .35em .75em; font-size: .9rem; border-radius: 9px; }
.btn.lg { min-height: 56px; font-size: 1.15rem; padding: .6em 1.4em; }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.muted { color: var(--ink-3); }
.pill { display: inline-flex; align-items: center; gap: .35em; font-size: .82rem; font-weight: 600; padding: .2em .65em; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: .55em; height: .55em; border-radius: 50%; background: currentColor; display: inline-block; }

input[type=text], input:not([type]), textarea, select {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: .6em .75em; min-height: 44px;
}
textarea { resize: vertical; min-height: 64px; }
input:focus-visible, textarea:focus-visible, select:focus-visible, .btn:focus-visible, .choice:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px;
}
label.field { display: grid; gap: .3em; font-weight: 600; font-size: .92rem; }
label.field input, label.field textarea, label.field select { font-weight: 400; }
label.field > span.hint { font-weight: 400; color: var(--ink-3); font-size: .85rem; }

.switch { display: inline-flex; align-items: center; gap: .6em; cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--line); position: relative; margin: 0; cursor: pointer; transition: background .15s; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked { background: var(--good); }
.switch input:checked::after { left: 21px; }

/* choice letters */
.letter { display: inline-grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 9px; font-weight: 800; color: #fff; flex: none; }
.c0 { --c: var(--c0); } .c1 { --c: var(--c1); } .c2 { --c: var(--c2); } .c3 { --c: var(--c3); } .c4 { --c: var(--c4); } .c5 { --c: var(--c5); }
.letter { background: var(--c, var(--accent)); }

/* toast */
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(30px); opacity: 0; background: var(--ink); color: var(--bg);
  padding: .7em 1.1em; border-radius: 12px; font-weight: 600; transition: all .2s; z-index: 100; pointer-events: none; max-width: calc(100vw - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* modal */
dialog { border: 0; border-radius: 18px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.3); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
dialog::backdrop { background: rgba(10, 12, 18, .5); }
dialog .dhead { padding: 20px 22px 6px; display: flex; justify-content: space-between; align-items: start; gap: 12px; }
dialog .dbody { padding: 10px 22px 8px; display: grid; gap: 14px; }
dialog .dfoot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.conn { font-size: .85rem; font-weight: 600; display: inline-flex; align-items: center; gap: .4em; color: var(--ink-3); }
.conn.on { color: var(--good); }
.conn.bad { color: var(--warn); }
