:root {
  color-scheme: dark;
  --bg: #171e1b;
  --panel: #222b26;
  --panel-soft: #26312a;
  --border: #35443a;
  --text: #eef4ef;
  --muted: #a4b6aa;
  --accent: #9edabb;
  --accent-strong: #247c59;
  --danger: #efaaa3;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.page { width: min(100% - 2.5rem, 1180px); margin: 0 auto; padding-bottom: 2.5rem; }
.skip-link { position: absolute; top: -70px; left: 1rem; z-index: 20; padding: .7rem 1rem; background: var(--accent); color: var(--bg); }
.skip-link:focus { top: 1rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.6rem 0 1.35rem; border-bottom: 1px solid var(--border); }
.brand { flex: none; line-height: 1; text-decoration: none; }
.brand strong { display: block; color: var(--text); font-size: 1.65rem; font-weight: 850; letter-spacing: -.065em; }
.brand span { display: block; margin-top: .28rem; color: var(--muted); font-size: .72rem; font-weight: 650; letter-spacing: .02em; text-align: center; }
.topbar-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; }
.meta-pill { display: inline-flex; align-items: center; gap: .45rem; min-height: 38px; padding: .45rem .8rem; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); color: var(--muted); font-size: .84rem; white-space: nowrap; }
.meta-pill b { color: var(--text); font-weight: 650; }
.meta-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.meta-button { color: var(--accent); }
.meta-button:hover { background: #2d3a31; }
.hero { padding: clamp(2rem, 5vw, 4rem) 0 1.6rem; }
.eyebrow { color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: .55rem 0 .75rem; font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 750; letter-spacing: -.055em; line-height: 1.13; }
.intro { color: var(--muted); font-size: 1rem; max-width: 700px; }
.panel { border: 1px solid var(--border); border-radius: 16px; background: var(--panel); box-shadow: 0 6px 25px rgba(0,0,0,.07); }
.test-panel { padding: clamp(1.25rem, 3vw, 2rem); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.panel-heading h2 { margin: 0 0 .2rem; font-size: 1.2rem; letter-spacing: -.02em; }
.panel-heading p { margin: 0; color: var(--muted); font-size: .9rem; }
.live-badge { display: inline-flex; align-items: center; border: 1px solid #45644e; border-radius: 8px; padding: .35rem .65rem; background: #2d4436; color: var(--accent); font-size: .8rem; font-weight: 650; white-space: nowrap; }
.test-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto auto; gap: .75rem; align-items: end; margin-top: 1.5rem; }
.field { min-width: 0; }
.form-label { display: block; margin-bottom: .4rem; color: var(--text); font-size: .82rem; font-weight: 650; }
.input-unit { position: relative; }
.input-unit .control { padding-right: 5.7rem; }
.input-unit span { position: absolute; right: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: .82rem; pointer-events: none; }
.control { width: 100%; min-height: 46px; padding: .7rem .85rem; border: 1px solid #496052; border-radius: 9px; outline: 0; background: var(--panel-soft); color: var(--text); }
.control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(158,218,187,.14); }
.control::placeholder { color: #91a197; }
input[type=number] { font-variant-numeric: tabular-nums; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { appearance: textfield; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 46px; padding: .7rem 1.25rem; border: 1px solid transparent; border-radius: 9px; font-weight: 700; line-height: 1.2; text-decoration: none; white-space: nowrap; }
.btn-primary { background: var(--accent-strong); color: #fff; }
.btn-primary:hover { background: #30936b; }
.btn-secondary { background: #2d4436; color: var(--accent); border-color: #45644e; }
.btn-secondary:hover { background: #375340; }
.btn-small { min-height: 34px; padding: .45rem .7rem; font-size: .78rem; }
.quick-values { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; margin-top: 1rem; color: var(--muted); font-size: .82rem; }
.quick-values button { padding: .3rem .55rem; border: 1px solid var(--border); border-radius: 7px; background: var(--panel-soft); color: var(--accent); font-size: .78rem; }
.quick-values button:hover { border-color: var(--accent); }
.form-help { color: var(--muted); font-size: .82rem; margin: .9rem 0 0; }
.notice { color: var(--danger); font-size: .84rem; margin: .8rem 0 0; min-height: 1.2rem; }
.section { margin-top: 2.35rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.section-head h2 { margin: 0; font-size: 1.45rem; letter-spacing: -.035em; }
.section-head span { color: var(--muted); font-size: .9rem; }
.results-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.result-card { padding: 1.5rem 1.6rem 1.3rem; min-width: 0; }
.result-heading { display: flex; align-items: center; gap: .8rem; }
.direction { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; background: #2d4436; color: var(--accent); font-size: 1.25rem; }
.result-heading h3 { margin: 0; font-size: 1rem; }
.result-heading p { color: var(--muted); margin: 0; font-size: .8rem; }
.result-value { margin: 1.25rem 0 1rem; font-size: clamp(1.9rem,3.8vw,3.2rem); font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.05em; overflow-wrap: anywhere; }
.bar { height: 7px; overflow: hidden; border-radius: 20px; background: #344238; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.result-note { margin: .65rem 0 0; color: var(--muted); font-size: .78rem; }
.summary { padding: 1rem 1.3rem; margin-top: 1rem; color: var(--muted); font-size: .88rem; }
.about { padding: 1.3rem 1.6rem; color: var(--muted); font-size: .9rem; line-height: 1.7; }
.about p { margin-bottom: .6rem; max-width: 850px; }
.about p:last-child { margin-bottom: 0; }
.admin-panel { padding: 1.4rem 1.6rem 1.5rem; }
.admin-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin: 1.4rem 0; }
.admin-settings label { font-size: .88rem; }
.admin-settings input { accent-color: var(--accent-strong); }
.users-heading { padding-top: 1.2rem; border-top: 1px solid var(--border); }
.table-wrap { overflow-x: auto; margin-top: 1rem; }
table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: .88rem; }
th { color: var(--muted); font-size: .75rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
th, td { padding: .75rem .5rem; border-bottom: 1px solid var(--border); text-align: left; }
tr:last-child td { border-bottom: 0; }
td input, td select { min-height: 34px; padding: .35rem .5rem; border: 1px solid #496052; border-radius: 7px; background: var(--panel-soft); color: var(--text); }
td input { width: 120px; }
footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; }
footer a { text-decoration: none; }
dialog { width: min(100% - 1.5rem, 420px); padding: 1.5rem; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); color: var(--text); box-shadow: 0 24px 90px #0009; }
dialog::backdrop { background: #080d0aca; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
.dialog-head h2 { margin: 0; font-size: 1.2rem; }
.dialog-head button { border: 0; background: none; color: var(--muted); font-size: 1.6rem; }
.auth-tabs { display: flex; gap: 1rem; margin: 1.2rem 0; }
.auth-tabs button { padding: .3rem 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); }
.auth-tabs .selected { border-color: var(--accent); color: var(--accent); }
#authForm .control { margin-bottom: 1rem; }
#authForm .btn { width: 100%; }
#authMessage { min-height: 1.2rem; margin: .75rem 0 0; color: var(--danger); font-size: .82rem; }
@media (max-width: 900px) { .test-form { grid-template-columns: repeat(2,minmax(0,1fr)); } .test-form .btn { width: 100%; } }
@media (max-width: 600px) { .page { width: min(100% - 1.25rem, 560px); } .topbar { align-items: flex-start; flex-direction: column; gap: 1rem; padding: 1.2rem 0; } .topbar-meta { justify-content: flex-start; } .meta-pill { font-size: .77rem; } .hero { padding-top: 2rem; } .test-form, .results-grid { grid-template-columns: 1fr; } .test-panel, .result-card, .admin-panel { padding: 1.1rem; } .section-head { align-items: flex-start; flex-direction: column; gap: .2rem; } .section-head span { font-size: .8rem; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
