:root {
  color-scheme: light;
  --navy: #18344a;
  --navy-deep: #102636;
  --blue: #2d6178;
  --ice: #e9f2f6;
  --sky: #d9e9ef;
  --page: #f5f8fa;
  --white: #ffffff;
  --text: #1c2b35;
  --muted: #627582;
  --line: #dce5e9;
  --green: #1f765e;
  --green-bg: #e7f5ef;
  --red: #a33737;
  --red-bg: #fff0ee;
  --shadow: 0 10px 30px rgba(17, 45, 61, .06);
  --radius: 18px;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body { margin: 0; color: var(--text); background: var(--page); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #74abc2; outline-offset: 2px; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px max(22px, calc((100vw - 1180px) / 2)); color: white; background: var(--navy); box-shadow: 0 3px 15px rgba(10, 37, 52, .14); }
.brand { display: inline-flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #dbeaf0; color: var(--navy); font-size: 21px; font-weight: 850; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.02em; line-height: 1.2; }
.brand small { display: block; color: #bed2dd; margin-top: 3px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.topnav { display: flex; align-items: center; justify-content: flex-end; gap: 22px; font-size: 13px; font-weight: 650; }
.topnav > a { padding: 9px 0; color: #edf5f8; }
.topnav > a:hover, .nav-button:hover { color: #b9dbe8; }
.inline-form { display: inline-flex; margin: 0; }
.nav-button { border: 0; padding: 8px 0; color: #edf5f8; background: transparent; cursor: pointer; font-weight: 650; font-size: 13px; }
.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; min-height: calc(100vh - 76px); display: flex; flex-direction: column; }
.page-shell > .page-heading:first-child { padding-top: 43px; }
.page-heading { margin-bottom: 25px; }
.page-heading h1, .auth-intro h1 { margin: 5px 0 7px; font-size: clamp(28px, 4vw, 38px); line-height: 1.13; letter-spacing: -.045em; color: var(--navy-deep); }
.page-heading p { margin: 0; }
.eyebrow { color: #5d8294; font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.top-gap { margin-top: 19px; }
.heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.back-link { display: inline-block; color: var(--blue); font-size: 13px; font-weight: 700; margin-bottom: 18px; }
.back-link:hover, .text-link:hover { color: #1c7893; }
.button { min-height: 45px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 12px; padding: 11px 17px; cursor: pointer; font-weight: 750; font-size: 13px; letter-spacing: -.005em; transition: transform .15s, background .15s, box-shadow .15s; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }
.button-primary { color: #fff; background: var(--navy); box-shadow: 0 5px 12px rgba(24, 52, 74, .14); }
.button-primary:hover { background: #234b65; }
.button-secondary { color: var(--navy); border-color: var(--line); background: var(--white); }
.button-secondary:hover { background: #f7fafb; }
.button-wide { width: 100%; margin-top: 10px; }
.button-danger-quiet { min-height: 34px; padding: 5px 0; color: #a44a4a; border: 0; background: transparent; font-size: 12px; }
.button-danger-quiet:hover { color: #7d2222; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
.flash-stack { display: grid; gap: 8px; padding-top: 18px; }
.flash { border: 1px solid var(--line); border-radius: 12px; padding: 12px 15px; font-size: 13px; }
.flash-success { color: #195d49; border-color: #c3e5d5; background: var(--green-bg); }
.flash-error { color: #8b2c2b; border-color: #f0c9c6; background: var(--red-bg); }
.flash-info { color: #28576e; border-color: #c5dfe9; background: #edf7fb; }
.test-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding-bottom: 30px; }
.test-card { overflow: hidden; display: flex; flex-direction: column; min-height: 280px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); transition: transform .17s, box-shadow .17s; }
.test-card:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(17,45,61,.09); }
.test-card-top { display: flex; justify-content: space-between; align-items: center; padding: 17px 19px 0; }
.pill, .count-pill { display: inline-block; border-radius: 999px; padding: 5px 9px; color: #426272; background: var(--ice); font-size: 11px; font-weight: 750; }
.card-score { display: flex; align-items: baseline; gap: 5px; color: var(--navy); }
.card-score strong { font-size: 22px; line-height: 1; letter-spacing: -.04em; }
.card-score small { font-size: 10px; color: var(--muted); }
.ski-symbol { position: relative; height: 20px; margin: 15px 19px 8px; display: flex; gap: 5px; align-items: center; }
.ski-symbol span { width: 4px; height: 22px; border-radius: 5px; background: #aecbd8; transform: rotate(27deg); }
.ski-symbol span:first-child { background: #4c8197; }
.test-card-body { padding: 0 19px 16px; flex: 1; }
.test-card-body .eyebrow { font-size: 10px; }
.test-card-body h2 { margin: 4px 0 3px; color: var(--navy-deep); font-size: 21px; letter-spacing: -.035em; line-height: 1.2; }
.test-card-body p { font-size: 12px; margin: 0 0 13px; }
.condition-line { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.condition-dot { width: 7px; height: 7px; border-radius: 50%; background: #6aa7b7; }
.test-card-footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #edf1f3; padding: 13px 19px; }
.text-link { color: var(--blue); font-size: 12px; font-weight: 800; }
.icon-link { color: #6e828c; font-size: 11px; font-weight: 700; }
.empty-state { display: flex; align-items: center; flex-direction: column; text-align: center; padding: 56px 20px; }
.empty-state h2 { margin: 13px 0 4px; color: var(--navy); }
.empty-state p { margin: 0 0 22px; }
.empty-icon { display: grid; place-items: center; width: 55px; height: 55px; border-radius: 18px; color: #285d76; background: var(--ice); font-size: 28px; }
.form-layout { display: grid; gap: 18px; max-width: 920px; margin: 0 auto 35px; }
.form-panel { padding: clamp(19px, 3vw, 29px); }
.section-title { display: flex; gap: 14px; align-items: flex-start; padding-bottom: 19px; margin-bottom: 21px; border-bottom: 1px solid #edf1f3; }
.section-number { flex: 0 0 34px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; color: #2a637d; background: var(--ice); font-size: 13px; font-weight: 850; }
.section-title h2 { margin: 1px 0 3px; color: var(--navy-deep); font-size: 19px; letter-spacing: -.025em; }
.section-title p { margin: 0; color: var(--muted); font-size: 12px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-full { grid-column: 1 / -1; }
label { color: #334956; font-size: 12px; font-weight: 750; }
.required { color: #a74242; }
input:not([type=checkbox]), select, textarea { width: 100%; border: 1px solid #cfdae0; border-radius: 11px; padding: 12px 13px; color: var(--text); background: #fff; box-shadow: 0 1px 1px rgba(9, 35, 49, .02); font-size: 14px; }
input:not([type=checkbox]), select { min-height: 45px; }
textarea { min-height: 82px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #9aaab3; }
input:focus, select:focus, textarea:focus { border-color: #5f9eb8; outline: 3px solid rgba(95,158,184,.15); }
input:disabled { color: #60717a; background: #f2f5f6; }
.field-note { display: block; color: #778b95; font-size: 11px; line-height: 1.5; margin-top: 5px; }
.question-list { display: grid; }
.question-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px; align-items: center; gap: 18px; padding: 15px 0; border-bottom: 1px solid #edf1f3; }
.question-row:first-child { padding-top: 0; }
.question-row:last-child { border-bottom: 0; }
.question-copy { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.question-copy label { font-size: 13px; line-height: 1.5; }
.question-index { color: #8aa0ad; font-size: 11px; font-weight: 850; letter-spacing: .04em; }
.question-copy .field-note { width: 100%; margin-left: 31px; }
.question-inactive { opacity: .7; }
.score-input-wrap { display: flex; align-items: center; gap: 8px; }
.score-input-wrap input { text-align: center; font-weight: 800; padding: 10px 8px; }
.score-input-wrap span { white-space: nowrap; color: #82949d; font-size: 11px; }
.inline-notice { display: flex; flex-direction: column; gap: 4px; padding: 15px 16px; border: 1px solid #d8e7ed; border-radius: 12px; background: #f4fafc; color: #436675; font-size: 12px; }
.inline-notice strong { color: #294f61; font-size: 13px; }
.total-preview { display: flex; align-items: baseline; gap: 8px; margin-top: 20px; padding: 16px 18px; border-radius: 13px; color: #c9e1eb; background: var(--navy); }
.total-preview span:first-child { margin-right: auto; font-size: 12px; color: #d5e5ec; }
.total-preview strong { color: #fff; font-size: 27px; letter-spacing: -.05em; }
.total-preview span:last-child { font-size: 11px; }
.save-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 0 0 12px; }
.save-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.save-status { color: #9a4a34; font-size: 12px; text-align: right; }
.save-status.status-ok { color: var(--green); }
.result-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 19px; padding: 27px 30px; border-radius: var(--radius); color: white; background: var(--navy); }
.result-label { font-size: 11px; font-weight: 850; letter-spacing: .14em; color: #b7d2df; }
.result-hero p { margin: 6px 0 0; color: #d1e0e7; font-size: 12px; }
.result-number { display: flex; align-items: baseline; gap: 7px; font-size: 52px; line-height: 1; font-weight: 850; letter-spacing: -.065em; }
.result-number span { font-size: 15px; letter-spacing: 0; color: #c1d9e3; }
.result-panel { padding: clamp(19px, 3vw, 29px); }
.score-results { display: grid; }
.score-result-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; padding: 15px 0; border-bottom: 1px solid #edf1f3; font-size: 13px; }
.score-result-row strong { white-space: nowrap; color: var(--navy); font-size: 15px; }
.score-result-row strong small { color: #8ba0a9; font-size: 10px; font-weight: 500; }
.notes-block { margin-top: 24px; padding-top: 20px; border-top: 1px solid #edf1f3; }
.notes-block h3 { margin: 0 0 8px; font-size: 13px; }
.notes-block p { margin: 0; white-space: pre-wrap; font-size: 13px; color: var(--muted); }
.danger-zone { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 35px; }
.danger-zone form { margin: 0; }
.auth-layout { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: clamp(25px, 7vw, 90px); max-width: 980px; margin: auto; padding: 55px 0 75px; }
.auth-intro { position: relative; overflow: hidden; min-height: 350px; display: flex; flex-direction: column; justify-content: center; padding: 15px 0; }
.auth-intro h1 { max-width: 480px; font-size: clamp(36px, 5vw, 51px); margin: 12px 0 15px; }
.auth-intro p { max-width: 425px; color: #5e737f; font-size: 15px; }
.mountain-art { position: relative; height: 125px; margin-top: 22px; overflow: hidden; }
.mountain-art span { position: absolute; bottom: -40px; display: block; width: 0; height: 0; border-left: 130px solid transparent; border-right: 130px solid transparent; border-bottom: 170px solid #e2edf1; }
.mountain-art span:nth-child(1) { left: 8%; border-bottom-color: #cfdee5; }
.mountain-art span:nth-child(2) { left: 33%; bottom: -57px; border-left-width: 170px; border-right-width: 170px; border-bottom-width: 200px; border-bottom-color: #dce9ee; }
.mountain-art span:nth-child(3) { left: 61%; bottom: -68px; border-bottom-color: #c5d9e2; }
.auth-panel { padding: 30px; }
.auth-panel h2 { margin: 0 0 4px; font-size: 24px; color: var(--navy-deep); letter-spacing: -.035em; }
.auth-panel > p { font-size: 12px; margin: 0 0 25px; }
.stack-form { display: flex; flex-direction: column; align-items: stretch; gap: 9px; }
.stack-form label:not(.checkbox-label) { margin-top: 7px; }
.stack-form .button { align-self: flex-start; margin-top: 9px; }
.stack-form .button-wide { align-self: stretch; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 21px; }
.stat-card { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.stat-card span { color: var(--muted); font-size: 12px; font-weight: 650; }
.stat-card strong { color: var(--navy); font-size: 30px; letter-spacing: -.05em; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-bottom: 20px; }
.admin-link-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: white; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.admin-link-card:hover { transform: translateY(-2px); border-color: #bdd3de; }
.admin-card-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: 12px; color: #2c647f; background: var(--ice); font-size: 22px; }
.admin-link-card h2 { margin: 0 0 6px; color: var(--navy); font-size: 17px; }
.admin-link-card p { min-height: 38px; margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.export-card { background: #f2f8fa; }
.admin-two-column { display: grid; grid-template-columns: minmax(250px, .82fr) minmax(0, 1.18fr); align-items: start; gap: 18px; margin-bottom: 28px; }
.conditions-layout { grid-template-columns: minmax(260px, .75fr) minmax(0, 1.25fr); }
.narrow-panel { max-width: 650px; margin: 0 auto 35px; }
.panel h2 { color: var(--navy); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { padding: 10px; text-align: left; color: #667d88; background: #f5f8fa; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; white-space: nowrap; }
.data-table td { padding: 12px 10px; border-bottom: 1px solid #edf1f3; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td form { margin: 0; }
.status-pill { display: inline-block; border-radius: 999px; padding: 4px 8px; font-size: 10px; font-weight: 800; }
.status-on { color: #18664d; background: #e3f4ec; }
.status-off { color: #8d4c3f; background: #fbece7; }
.text-button { border: 0; padding: 4px; color: var(--blue); background: transparent; cursor: pointer; font-size: 11px; font-weight: 800; }
.settings-list { display: grid; }
.settings-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 14px 0; border-bottom: 1px solid #edf1f3; font-size: 13px; }
.settings-row:first-child { padding-top: 0; }
.settings-row:last-child { padding-bottom: 0; border-bottom: 0; }
.settings-row strong { display: block; }
.settings-row .small { margin-top: 4px; }
.checkbox-label { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 12px; cursor: pointer; }
.checkbox-label input { width: 17px; height: 17px; accent-color: var(--navy); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 10px; }
.error-panel { max-width: 580px; margin: 70px auto; padding: 30px; }
.error-panel h1 { color: var(--navy); }
.site-footer { display: flex; justify-content: space-between; gap: 20px; margin-top: auto; padding: 25px 0 22px; color: #8a9aa2; font-size: 11px; }
.footer-placeholder { text-align: right; }

@media (max-width: 900px) {
  .test-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-two-column, .conditions-layout { grid-template-columns: 1fr; }
  .auth-layout { gap: 28px; }
  .topnav { gap: 14px; }
}
@media (max-width: 650px) {
  .topbar { min-height: 68px; align-items: flex-start; flex-direction: column; gap: 10px; padding: 12px 18px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .topnav { width: 100%; justify-content: flex-start; gap: 17px; overflow-x: auto; padding-bottom: 2px; }
  .topnav > a, .nav-button { white-space: nowrap; font-size: 12px; }
  .page-shell { width: calc(100% - 28px); min-height: calc(100vh - 110px); }
  .page-shell > .page-heading:first-child { padding-top: 27px; }
  .heading-row { align-items: flex-start; flex-direction: column; }
  .heading-row > .button { width: 100%; }
  .page-heading h1 { font-size: 30px; }
  .test-grid { grid-template-columns: 1fr; gap: 13px; }
  .test-card { min-height: 250px; }
  .form-grid { grid-template-columns: 1fr; gap: 15px; }
  .field-full { grid-column: auto; }
  .question-row { grid-template-columns: minmax(0, 1fr) 115px; gap: 10px; }
  .score-input-wrap { gap: 5px; }
  .score-input-wrap span { font-size: 10px; }
  .score-input-wrap input { padding: 10px 5px; }
  .save-bar { position: sticky; bottom: 0; z-index: 5; margin: 0 -14px; padding: 12px 14px max(12px, env(safe-area-inset-bottom)); background: rgba(245,248,250,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
  .save-actions { flex-direction: column-reverse; align-items: stretch; gap: 3px; flex: 1; }
  .save-actions .button { width: 100%; }
  .save-status { text-align: center; min-height: 14px; }
  .save-bar > .button { flex-shrink: 0; }
  .result-hero { padding: 22px; }
  .result-number { font-size: 43px; }
  .auth-layout { display: flex; flex-direction: column; align-items: stretch; gap: 22px; padding: 33px 0 42px; }
  .auth-intro { min-height: auto; padding: 0; }
  .auth-intro h1 { font-size: 38px; max-width: 360px; }
  .auth-intro p { font-size: 13px; margin-bottom: 0; }
  .mountain-art { height: 58px; margin-top: 7px; }
  .mountain-art span { bottom: -110px; }
  .auth-panel { padding: 23px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card strong { font-size: 26px; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-link-card p { min-height: 0; }
  .settings-row { align-items: flex-start; }
  .site-footer { flex-direction: column; gap: 5px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .footer-placeholder { text-align: left; }
  .danger-zone { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
