:root {
  --brand: #a78bfa;
  --text: inherit;
  --card: color-mix(in oklab, var(--brand) 1%, transparent);
  --border: color-mix(in oklab, currentColor 20%, transparent);
  --ok: #16a34a;
  --warn: #f59e0b;
  --alert: #ef4444;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, Segoe UI, Roboto, Arial, sans-serif; color: var(--text); }
.page { max-width: 960px; margin: 0 auto; padding: 24px 16px; }
.page-header { margin-bottom: 16px; }
.crumbs { opacity: .8; display: flex; gap: 8px; align-items: center; font-size: .95rem; flex-wrap: wrap; }
.crumbs a { color: var(--brand); text-decoration: none; }
.lead { opacity: .9; margin: 6px 0 0; }
.highlight-seo { text-align: center; background: color-mix(in oklab, var(--brand) 15%, transparent); padding: 8px 12px; border-radius: 8px; font-weight: 500; margin-bottom: 10px; }
.centered { text-align: center; }
.container { display: grid; gap: 16px; }
form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.form-row.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-row.three { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.field.highlight input { border: 2px solid var(--brand); background: color-mix(in oklab, var(--brand) 8%, transparent); font-size: 1.15rem; font-weight: 500; padding: 14px 16px; }
.field.highlight input:focus { border-color: color-mix(in oklab, var(--brand) 60%, black); background: color-mix(in oklab, var(--brand) 14%, transparent); outline: none; }
.field.highlight label { font-size: 1.05rem; font-weight: 600; color: var(--brand); }
.field input, .field select { border: 1px solid var(--border); background: var(--card); border-radius: 10px; padding: 10px 12px; color: inherit; }
.input-group { display: flex; }
.input-group input { border-radius: 10px 0 0 10px; flex: 1; }
.input-group select { border-radius: 0 10px 10px 0; }
.help { font-size: .9rem; opacity: .8; }
.actions { grid-column: 1/-1; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.btn { border: 1px solid var(--border); background: transparent; padding: 10px 14px; border-radius: 10px; cursor: pointer; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.ghost { opacity: .9; }
.card { border: 1px solid var(--border); border-radius: 14px; padding: 20px; background: var(--card); }
.card h2 { font-size: 1.1rem; font-weight: 700; margin: 0 0 16px; color: var(--brand); }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.label { font-size: .9rem; opacity: .85; margin-bottom: 4px; }
.result-main { font-size: clamp(26px, 3vw, 38px); font-weight: 800; color: var(--brand); }
.result-small { font-size: clamp(18px, 2.5vw, 24px); font-weight: 700; color: var(--brand); }
.verdict { margin: 16px 0; padding: 14px; border-radius: 12px; font-weight: 600; font-size: 1.05rem; }
.verdict.good { background: color-mix(in oklab, var(--ok) 12%, transparent); color: var(--ok); border: 1px solid color-mix(in oklab, var(--ok) 30%, transparent); }
.verdict.mid { background: color-mix(in oklab, var(--warn) 12%, transparent); color: var(--warn); border: 1px solid color-mix(in oklab, var(--warn) 30%, transparent); }
.verdict.bad { background: color-mix(in oklab, var(--alert) 12%, transparent); color: var(--alert); border: 1px solid color-mix(in oklab, var(--alert) 30%, transparent); }
.details { margin-top: 12px; }
.result-breakdown table { width: 100%; border-collapse: collapse; }
.result-breakdown td { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.result-breakdown td:last-child { text-align: right; font-weight: 600; }
.muted { opacity: .8; font-size: .9rem; }
.doc h3 { margin: 12px 0 6px; }
.formula { margin: 6px 0 10px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; background: color-mix(in oklab, var(--brand) 6%, transparent); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.faq details { margin: 6px 0; }
.page-footer { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.result-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.calc-fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.stat-card { padding: 16px; border-radius: 12px; text-align: center; border: 1px solid var(--border); background: var(--card); }
/* Time display */
.time-display { display: flex; align-items: center; justify-content: center; margin: 20px 0; gap: 8px; }
.time-unit { text-align: center; }
.time-val { font-size: clamp(36px, 8vw, 56px); font-weight: 900; color: var(--brand); line-height: 1; }
.time-label { font-size: .85rem; opacity: .7; text-transform: uppercase; letter-spacing: 2px; margin-top: 4px; }
.time-sep { font-size: 2rem; font-weight: 300; opacity: .4; }
/* Progress */
.progress-wrap { margin: 16px 0; }
.progress-label { font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.progress-bar { height: 20px; background: color-mix(in oklab, var(--brand) 8%, transparent); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand), #8b5cf6); border-radius: 999px; transition: width 1.2s ease; width: 0; }
.progress-labels { display: flex; justify-content: space-between; margin-top: 4px; font-size: .8rem; opacity: .7; }
.btn-back, a.btn-back {
  display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600;
  text-decoration: none; padding: 8px 14px; border-radius: 12px; border: 1px solid #e2e8f0;
  background: #fff; color: #0f172a; cursor: pointer; margin-bottom: 10px;
}
.btn-back:hover { transform: translateY(-1px); border-color: var(--calc-accent, #0ea5e9); }
.btn-back svg { flex-shrink: 0; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .btn-back { border-color: #1f2a37; background: #0f141b; color: #e6edf3; }
}
html[data-theme="dark"] .btn-back { border-color: #1f2a37 !important; background: #0f141b !important; color: #e6edf3 !important; }
@media (max-width: 640px) {
  .form-row.two, .form-row.three, .result-grid { grid-template-columns: 1fr !important; }
  .actions { flex-direction: column; }
  .btn { width: 100%; }
}
