:root {
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f4f7fb;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, #f7faff 0%, #eef3f9 100%); }
.container { width: min(720px, calc(100% - 20px)); margin: 0 auto; padding: 18px 0 24px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.hero-subtitle { margin: 5px 0 0; color: #64748b; font-size: 13px; font-weight: 600; }
.eyebrow { margin: 0; font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
h1 { margin: 0; font-size: clamp(38px, 10vw, 56px); line-height: .95; letter-spacing: -.05em; color: #14213d; }
.title-accent { color: var(--accent); }

.card { border: 1px solid #dbe3ef; border-radius: 16px; background: rgba(255, 255, 255, .94); box-shadow: 0 8px 24px rgba(37, 99, 235, .07); }
.result { padding: 20px 16px; text-align: center; border-top: 3px solid var(--accent); }
.result-label { margin: 0 0 3px; color: #64748b; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.score { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 0 0 7px; color: var(--accent); }
.score-editable { cursor: text; }
.score-editable:focus-within { border-radius: 10px; }
.score-editable input { width: 180px; min-width: 0; margin: 0; padding: 0; border: 0; box-shadow: none; background: transparent; color: inherit; text-align: right; font-size: clamp(50px, 16vw, 76px); font-weight: 800; letter-spacing: -.05em; line-height: .95; }
.score-editable input:focus { border: 0; box-shadow: none; outline: none; }
.score-editable input::-webkit-inner-spin-button, .score-editable input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.score-editable input[type=number] { -moz-appearance: textfield; }
.score-max { color: #64748b; font-size: 22px; font-weight: 600; letter-spacing: 0; }
.score-adjust { flex: 0 0 auto; min-width: 38px; min-height: 38px; padding: 6px 5px; border: 1px solid #cbd5e1; border-radius: 9px; background: #f8fafc; color: #475569; font: inherit; font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer; }
.score-adjust:hover { border-color: var(--accent-border); color: var(--accent); }
.score-adjust:active { transform: translateY(1px); }
.score-adjust:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.score-adjust-wide { min-width: 42px; }
.score-slider-wrap { width: min(430px, 88%); margin: 0 auto 14px; }
.score-slider { width: 100%; height: 5px; margin: 0; padding: 0; accent-color: var(--accent); cursor: pointer; }
.slider-labels { display: flex; justify-content: space-between; margin-top: 3px; color: #94a3b8; font-size: 9px; }
.rank-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 auto 12px; max-width: 420px; }
.rank-preview > div { padding: 10px 8px; border: 1px solid #dbeafe; border-radius: 12px; background: var(--accent-soft); }
.rank-label { display: block; margin-bottom: 2px; color: #64748b; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.rank-preview strong { display: block; font-size: 18px; letter-spacing: -.02em; color: #1e40af; }

.calculator { margin-top: 28px; padding: 14px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
h2 { margin: 0; font-size: 18px; color: #172033; }
.total-badge { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; background: var(--accent-soft); color: #1d4ed8; border: 1px solid var(--accent-border); font-size: 11px; font-weight: 700; }
.fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 13px; font-weight: 650; }
.field small { color: #64748b; font-size: 11px; }
input { width: 100%; border: 1px solid #cbd5e1; border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 17px; outline: none; background: #fff; color: #172033; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }
.derived-field input { background: #f1f5f9; color: #64748b; }
.derived-field em { font-size: 10px; font-style: normal; font-weight: 500; color: var(--accent); }
.error { min-height: 16px; margin: 0; color: #b42318; font-size: 12px; }

.model-info { margin: 26px 4px 0; }
.model-info > h2 { margin-bottom: 12px; font-size: 16px; }
.model-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.model-info article { padding: 12px 13px; border: 1px solid #dbe3ef; border-radius: 12px; background: rgba(255, 255, 255, .58); }
.model-info article h3 { margin: 0 0 5px; font-size: 12px; color: #334155; }
.model-info article p { margin: 0; color: #64748b; font-size: 11px; line-height: 1.5; }
.model-info article:last-child { grid-column: 1 / -1; }

.site-links { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 28px auto 0; width: 100%; }
.site-link { display: flex; width: min(100%, 520px); min-height: 78px; align-items: center; justify-content: center; flex-direction: column; gap: 4px; padding: 14px 12px; border-radius: 14px; text-align: center; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.site-link span { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.site-link small { font-size: 11px; font-weight: 550; opacity: .82; }
.site-link:hover { transform: translateY(-1px); }
.site-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.site-link-primary { color: #fff; background: var(--accent); border: 1px solid var(--accent); box-shadow: 0 8px 20px rgba(37, 99, 235, .18); }
.site-link-primary:hover { box-shadow: 0 10px 24px rgba(37, 99, 235, .24); }
.site-link-secondary { color: #1e293b; background: #fff; border: 1px solid #cbd5e1; box-shadow: 0 8px 20px rgba(15, 23, 42, .06); }
.site-link-secondary:hover { border-color: var(--accent-border); box-shadow: 0 10px 24px rgba(15, 23, 42, .09); }
footer { padding: 18px 4px 0; color: #94a3b8; text-align: center; font-size: 11px; }
.build-info { margin: 0; font-variant-numeric: tabular-nums; }
footer p { margin: 0; }

@media (max-width: 560px) {
  .fields { grid-template-columns: repeat(2, 1fr); }
  .derived-field { grid-column: 1 / -1; }
  .score-editable input { width: 142px; font-size: clamp(46px, 14vw, 66px); }
  .score-max { font-size: 18px; }
  .score { gap: 2px; }
  .score-adjust { min-width: 34px; min-height: 36px; padding: 6px 4px; font-size: 11px; }
  .score-adjust-wide { min-width: 38px; }
}

@media (max-width: 430px) {
  .hero { align-items: flex-start; }
  .hero-subtitle { font-size: 12px; }
  .eyebrow { font-size: 10px; }
  .score-editable input { width: 116px; font-size: clamp(42px, 13vw, 56px); }
  .score-max { font-size: 15px; }
  .score-adjust { min-width: 30px; min-height: 34px; }
  .score-adjust-wide { min-width: 34px; }
  .model-info-grid { grid-template-columns: 1fr; }
  .model-info article:last-child { grid-column: auto; }
  .site-link { min-height: 72px; }
}

@media (prefers-color-scheme: dark) {
  :root { --accent: #60a5fa; --accent-soft: #172554; --accent-border: #1d4ed8; color: #e5edf8; background: #0b1220; }
  body { background: linear-gradient(180deg, #0b1220 0%, #111827 100%); }
  .eyebrow, .title-accent { color: #93c5fd; }
  h1 { color: #eff6ff; }
  .hero-subtitle { color: #94a3b8; }
  .card { border-color: #26364d; background: rgba(17, 24, 39, .95); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
  .result { border-top-color: var(--accent); }
  .result-label, .rank-label, .field small, footer, .score-max, .slider-labels { color: #94a3b8; }
  .score { color: var(--accent); }
  .rank-preview > div, .total-badge { background: #172554; border-color: #1e40af; }
  .rank-preview strong, .total-badge { color: #bfdbfe; }
  h2, .breakdown b { color: #e5edf8; }
  input { border-color: #334155; background: #111827; color: #f1f5f9; }
  input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(96, 165, 250, .14); }
  .score-editable input { border: 0; background: transparent; color: var(--accent); }
  .score-adjust { border-color: #334155; background: #1e293b; color: #cbd5e1; }
  .score-adjust:hover { border-color: #3b82f6; color: #93c5fd; }
  .derived-field input { background: #1e293b; color: #94a3b8; }
  .derived-field em { color: #93c5fd; }
  .model-info article { border-color: #26364d; background: rgba(17, 24, 39, .55); }
  .model-info article h3 { color: #cbd5e1; }
  .model-info article p { color: #94a3b8; }
  .site-link-primary { color: #0b1220; background: #93c5fd; border-color: #93c5fd; box-shadow: 0 8px 20px rgba(0, 0, 0, .18); }
  .site-link-secondary { color: #e5edf8; background: #1e293b; border-color: #334155; box-shadow: 0 8px 20px rgba(0, 0, 0, .18); }
}
