:root {
  --bg: #13100e;
  --ink: #f3e8da;
  --dim: rgba(243, 232, 218, 0.55);
  --line: rgba(243, 232, 218, 0.12);
  --warm: #e7a964;
  --card: rgba(36, 28, 22, 0.82);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 800px at 50% 45%, #2a1d14 0%, var(--bg) 60%);
  color: var(--ink);
  font: 15px/1.45 ui-sans-serif, system-ui, -apple-system, sans-serif;
}
[hidden] { display: none !important; }
h1, .brand { font-family: Fraunces, Georgia, serif; font-weight: 600; letter-spacing: -0.01em; }
button {
  font: inherit; color: var(--ink); background: rgba(255,255,255,0.06);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer;
}
button:hover { background: rgba(255,255,255,0.1); }
button:disabled { opacity: .5; cursor: default; }
button.on { border-color: var(--warm); color: var(--warm); }
input:not([type]), input[type=text] {
  font: inherit; color: var(--ink); background: rgba(0,0,0,0.3);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; margin-top: 4px;
}
input[type=range] { width: 100%; accent-color: var(--warm); }
input[type=checkbox] { accent-color: var(--warm); }
kbd { font: 12px ui-monospace, monospace; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.dim { color: var(--dim); }

#landing { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.card { width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 28px; display: grid; gap: 14px; }
.card h1 { margin: 0; font-size: 2.2rem; }
.lede { margin: -6px 0 6px; color: var(--dim); }
label { display: block; color: var(--dim); font-size: 13px; }
label.check { display: flex; gap: 8px; align-items: baseline; color: var(--ink); font-size: 14px; }
label.check small { color: var(--dim); }
#sit { background: var(--warm); color: #23160b; font-weight: 600; border: 0; padding: 12px; margin-top: 6px; }
.note { color: #f0a08a; margin: 0; min-height: 1em; font-size: 13px; }

#table { position: fixed; inset: 0; }
#table header { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 14px 18px; z-index: 2; gap: 12px; }
#status.bad { color: #f0a08a; }
#cv { position: absolute; top: 0; left: 0; bottom: 0; right: 312px; width: calc(100% - 312px); height: 100%; cursor: pointer; }
.hint { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; color: var(--dim); font-size: 12px; margin: 0; padding: 0 16px; }

#panel { position: absolute; top: 56px; right: 16px; width: 280px; max-height: calc(100% - 100px); overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 10px; backdrop-filter: blur(8px); }
#panel details { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 8px; }
#panel summary { cursor: pointer; font-weight: 600; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px; }
#panel label { margin: 6px 0; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btns button { flex: 1; }
#stats .row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; padding: 2px 0; }
#stats .row span { color: var(--dim); }
#probeBtn { width: 100%; margin-top: 8px; }
#probeOut .big { font-family: Fraunces, Georgia, serif; font-size: 2rem; margin-top: 8px; }
#probeOut .good { color: #9ed39a; } #probeOut .ok { color: #e7c564; } #probeOut .bad { color: #f0a08a; }
#probeOut .sub { color: var(--dim); font-size: 12px; }

@media (max-width: 720px) {
  #panel { top: auto; bottom: 40px; left: 16px; right: 16px; width: auto; max-height: 38%; }
  #cv { right: 0; width: 100%; bottom: auto; height: 58%; }
}

.apple-btn { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #000;
  border-radius: 10px; padding: 12px; font-weight: 600; text-decoration: none; font-size: 16px; }
.apple-btn:hover { background: #ececec; }
.card a button { width: 100%; }
