:root {
  color-scheme: light;
  --ink: #10261f;
  --muted: #5d6b66;
  --paper: #f7f3e9;
  --surface: #fffdf8;
  --line: #d9d7cb;
  --gold: #f4c95d;
  --gold-dark: #8a6508;
  --jade: #1d6b54;
  --jade-soft: #dcece6;
  --danger: #a53f33;
  --danger-soft: #f7e4df;
  --shadow: 0 18px 60px rgba(16, 38, 31, .11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, a, input, textarea, select, summary { min-height: 44px; }
a { color: var(--jade); text-underline-offset: 3px; }
button { cursor: pointer; }
summary { display: flex; align-items: center; cursor: pointer; color: var(--jade); font-weight: 750; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 20; transform: translateY(-150%); background: var(--ink); color: white; padding: 12px 16px; border-radius: 10px; }
.skip-link:focus { transform: none; }

.shell { min-height: 100vh; }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: 1160px; margin: auto; padding: 18px 24px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--ink); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.nav-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 11px 17px; font-weight: 750; line-height: 1.2; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid rgba(29,107,84,.28); outline-offset: 2px; }
.btn-primary { background: var(--ink); color: white; box-shadow: 0 7px 18px rgba(16,38,31,.18); }
.btn-gold { background: var(--gold); color: #271e05; box-shadow: 0 7px 18px rgba(138,101,8,.16); }
.btn-soft { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: #e9c5bd; }
.btn-link { background: transparent; color: var(--jade); padding-inline: 8px; }

.hero { max-width: 1160px; margin: auto; display: grid; grid-template-columns: 1.1fr .9fr; gap: 54px; align-items: center; padding: 80px 24px 96px; }
.eyebrow { margin: 0 0 16px; text-transform: uppercase; letter-spacing: .13em; font-size: .78rem; font-weight: 850; color: var(--jade); }
.eyebrow-gold { color: var(--gold); }
h1, h2, h3 { margin-top: 0; letter-spacing: -.035em; line-height: 1.05; }
h1 { max-width: 720px; margin-bottom: 22px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3rem, 7vw, 6.6rem); font-weight: 500; }
h2 { font-size: clamp(1.8rem, 3vw, 2.7rem); }
h3 { font-size: 1.25rem; }
.hero-copy { max-width: 650px; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.28rem); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.price-note { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 24px; color: var(--muted); font-size: .93rem; }
.price-note span::before { content: "✓"; margin-right: 7px; color: var(--jade); font-weight: 900; }
.seller-note { max-width: 650px; margin-top: 14px; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.belt-card { position: relative; overflow: hidden; min-height: 490px; border-radius: 32px; background: var(--ink); color: white; box-shadow: var(--shadow); padding: 38px; }
.belt-card::after { content: ""; position: absolute; inset: auto -70px -100px auto; width: 330px; height: 330px; border-radius: 50%; background: rgba(244,201,93,.11); }
.belt-lines { display: grid; gap: 15px; margin: 35px 0; }
.belt-line { height: 26px; border-radius: 7px; transform: rotate(-2deg); box-shadow: 0 8px 15px rgba(0,0,0,.15); }
.belt-line:nth-child(1) { width: 72%; background: #fff; }
.belt-line:nth-child(2) { width: 84%; background: #f4c95d; }
.belt-line:nth-child(3) { width: 93%; background: #45a870; }
.belt-line:nth-child(4) { width: 100%; background: #243f8e; }
.belt-stats { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.belt-stat { padding: 18px; border: 1px solid rgba(255,255,255,.15); border-radius: 16px; background: rgba(255,255,255,.06); }
.belt-stat strong { display: block; margin-bottom: 5px; font-size: 1.5rem; }
.belt-stat span { color: rgba(255,255,255,.7); font-size: .88rem; }

.auth-section { max-width: 980px; margin: auto; padding: 10px 24px 90px; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 26px; box-shadow: 0 8px 24px rgba(16,38,31,.05); }
.card-subtle { background: rgba(255,255,255,.45); }
.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
label { display: grid; gap: 7px; color: var(--ink); font-size: .92rem; font-weight: 720; }
input, textarea, select { width: 100%; border: 1px solid #bfc7c1; border-radius: 11px; background: white; color: var(--ink); padding: 11px 13px; }
select { min-height: 44px; appearance: none; -webkit-appearance: none; padding-right: 38px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 12px) 19px; background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.hint { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.5; }

.app-layout { max-width: 1220px; margin: auto; padding: 36px 24px 90px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; }
.page-head p { margin-bottom: 0; color: var(--muted); }
.app-title { font-size: clamp(2.5rem, 6vw, 4.8rem); }
.exam-title { font-size: clamp(2.3rem, 7vw, 4.4rem); }
.error-title { font-size: 3rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); gap: 24px; align-items: start; }
.dashboard-side { display: grid; gap: 18px; }
.account-card summary { margin-bottom: 14px; }
.account-card[open] summary { margin-bottom: 18px; }
.grading-list { display: grid; gap: 12px; }
.grading-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.grading-item h3 { margin-bottom: 5px; }
.meta { display: flex; flex-wrap: wrap; gap: 10px 16px; color: var(--muted); font-size: .88rem; }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 9px; border-radius: 999px; background: var(--jade-soft); color: var(--jade); font-size: .78rem; font-weight: 800; text-transform: capitalize; }
.badge-gold { background: #fff1bd; color: #795800; }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.empty { padding: 40px 22px; text-align: center; border: 1px dashed #aeb9b2; border-radius: 18px; color: var(--muted); }

.detail-stack { display: grid; gap: 20px; }
.step-card { display: grid; grid-template-columns: 46px minmax(0,1fr); gap: 16px; }
.step-number { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--ink); color: var(--gold); font-weight: 900; }
.step-content h3 { margin: 6px 0 8px; }
.action-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { padding: 12px 9px; border-bottom: 1px solid var(--line); text-align: left; }
.data-table th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; }
.table-scroll { overflow-x: auto; }
.result-pass { color: var(--jade); font-weight: 850; }
.result-retest { color: var(--danger); font-weight: 850; }
.link-box { display: flex; align-items: center; gap: 10px; margin-top: 13px; padding: 12px; border-radius: 11px; background: var(--jade-soft); overflow-wrap: anywhere; }
.summary-strip { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin: 20px 0 28px; }
.summary-tile { border: 1px solid var(--line); border-radius: 15px; background: white; padding: 15px; }
.summary-tile strong { display: block; font-size: 1.4rem; }
.summary-tile span { color: var(--muted); font-size: .8rem; }

.exam-shell { max-width: 950px; margin: auto; padding: 24px 20px 90px; }
.exam-head { position: sticky; top: 0; z-index: 5; margin: 0 -20px 22px; padding: 14px 20px; background: rgba(247,243,233,.94); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.candidate-card { margin-bottom: 16px; }
.criterion-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.score-field { grid-template-columns: 1fr 90px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.score-field input { text-align: center; }
.save-state { min-height: 24px; margin-top: 8px; color: var(--muted); font-size: .84rem; }

.toast { position: fixed; z-index: 30; right: 20px; bottom: 20px; max-width: min(420px, calc(100vw - 40px)); padding: 14px 18px; border-radius: 13px; background: var(--ink); color: white; box-shadow: var(--shadow); }
.toast.error { background: var(--danger); }
.footer { max-width: 1160px; margin: auto; padding: 30px 24px 50px; display: flex; justify-content: space-between; align-items: center; gap: 18px; color: var(--muted); font-size: .88rem; border-top: 1px solid var(--line); }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px; }
.footer a { display: inline-flex; align-items: center; padding: 0 10px; }
.legal-page { max-width: 820px; margin: auto; padding: 70px 24px 100px; }
.legal-page h2 { margin-top: 42px; font-size: 1.7rem; }
.legal-page p { color: var(--muted); line-height: 1.75; }
.legal-title { max-width: 760px; font-size: clamp(2.8rem, 7vw, 5.4rem); }
.support-form { max-width: 680px; margin-top: 38px; }

@media (max-width: 820px) {
  .hero, .dashboard-grid, .auth-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 42px; }
  .belt-card { min-height: 400px; }
  .dashboard-grid { gap: 16px; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 540px) {
  .nav { padding-inline: 16px; }
  .nav-actions:not(.nav-actions-authenticated) .btn-link { display: none; }
  .hero, .app-layout, .auth-section { padding-inline: 16px; }
  .hero { padding-bottom: 66px; }
  .belt-card { padding: 26px; min-height: 350px; border-radius: 24px; }
  .form-row, .criterion-grid { grid-template-columns: 1fr; }
  .page-head { align-items: start; flex-direction: column; }
  .grading-item { grid-template-columns: 1fr; }
  .grading-item .btn { width: 100%; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .footer { align-items: flex-start; flex-direction: column; }
  .legal-page { padding: 42px 16px 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
