/* ==========================================================================
   Cek Jawaban — Design System
   ========================================================================== */
:root {
  --bg: #f6f3ec;
  --bg-2: #efe9dd;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --surface-glass: rgba(255, 255, 255, 0.72);
  --ink: #161a33;
  --ink-2: #3c4263;
  --muted: #767b95;
  --line: #e7e2d6;
  --line-2: #d9d2c2;
  --primary: #1f2a6b;
  --primary-2: #3446b5;
  --primary-ink: #ffffff;
  --accent: #ff7a45;
  --accent-2: #ffb547;
  --ok: #0ea371;
  --ok-soft: #dff5ec;
  --bad: #e5484d;
  --bad-soft: #fde6e6;
  --warn: #e0a100;
  --warn-soft: #fdf1d4;
  --info: #2f7de1;
  --info-soft: #e2eefc;
  --empty: #a9adbf;
  --empty-soft: #eeeff4;
  --shadow-sm: 0 1px 2px rgba(22, 26, 51, .06), 0 1px 1px rgba(22, 26, 51, .04);
  --shadow: 0 10px 30px -12px rgba(22, 26, 51, .18), 0 2px 6px rgba(22, 26, 51, .05);
  --shadow-lg: 0 30px 60px -20px rgba(22, 26, 51, .28);
  --radius: 18px;
  --radius-sm: 12px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --grad: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --grad-ink: linear-gradient(135deg, #1f2a6b 0%, #3446b5 55%, #6a4bc4 100%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1020; --bg-2: #12162b; --surface: #171b33; --surface-2: #1c2140; --surface-glass: rgba(23, 27, 51, .78);
    --ink: #eef0fb; --ink-2: #c3c7e0; --muted: #8d92b0; --line: #262b4a; --line-2: #343a61;
    --primary: #8ea0ff; --primary-2: #a9b6ff; --primary-ink: #0d1020;
    --ok-soft: rgba(14,163,113,.16); --bad-soft: rgba(229,72,77,.16); --warn-soft: rgba(224,161,0,.16);
    --info-soft: rgba(47,125,225,.18); --empty-soft: rgba(169,173,191,.12);
    --shadow: 0 10px 30px -12px rgba(0,0,0,.6); --shadow-lg: 0 30px 60px -20px rgba(0,0,0,.7);
    --grad-ink: linear-gradient(135deg, #26307a 0%, #3446b5 55%, #6a4bc4 100%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1020; --bg-2: #12162b; --surface: #171b33; --surface-2: #1c2140; --surface-glass: rgba(23, 27, 51, .78);
  --ink: #eef0fb; --ink-2: #c3c7e0; --muted: #8d92b0; --line: #262b4a; --line-2: #343a61;
  --primary: #8ea0ff; --primary-2: #a9b6ff; --primary-ink: #0d1020;
  --ok-soft: rgba(14,163,113,.16); --bad-soft: rgba(229,72,77,.16); --warn-soft: rgba(224,161,0,.16);
  --info-soft: rgba(47,125,225,.18); --empty-soft: rgba(169,173,191,.12);
  --shadow: 0 10px 30px -12px rgba(0,0,0,.6); --shadow-lg: 0 30px 60px -20px rgba(0,0,0,.7);
  --grad-ink: linear-gradient(135deg, #26307a 0%, #3446b5 55%, #6a4bc4 100%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.55; min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(700px 420px at 8% -5%, rgba(255, 122, 69, .16), transparent 60%),
    radial-gradient(640px 460px at 100% 0%, rgba(52, 70, 181, .14), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(106, 75, 196, .10), transparent 60%);
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
.serif { font-family: var(--serif); font-optical-sizing: auto; }
a { color: var(--primary-2); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 16px; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px } .mt-4 { margin-top: 36px }
.mb-1 { margin-bottom: 8px } .mb-2 { margin-bottom: 16px } .mb-3 { margin-bottom: 24px }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 22px;
}
.card.glass { background: var(--surface-glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.card.lift { box-shadow: var(--shadow); }
.card-title { font-weight: 700; font-size: 16px; display: flex; align-items: center; gap: 10px; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.section-label {
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--muted);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent;
  background: var(--primary); color: var(--primary-ink); font-weight: 650; font-size: 14.5px;
  cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s, opacity .2s;
  white-space: nowrap; user-select: none; text-decoration: none;
}
.btn:hover { box-shadow: 0 8px 18px -8px rgba(31, 42, 107, .55); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.accent { background: var(--grad); color: #2a1406; }
.btn.accent:hover { box-shadow: 0 10px 22px -10px rgba(255, 122, 69, .7); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn.soft { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.btn.soft:hover { box-shadow: none; border-color: var(--line-2); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.ok { background: var(--ok); color: #fff; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.xs { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { height: 54px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 34px; }
.btn.icon.xs { width: 30px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); transition: border .15s, box-shadow .15s; outline: none; font-size: 15px;
}
.textarea { height: auto; min-height: 90px; padding: 12px 14px; resize: vertical; }
.select { appearance: none; -webkit-appearance: none; padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23767b95' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-2) 18%, transparent); }
.input.sm, .select.sm { height: 38px; font-size: 14px; border-radius: 10px; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.input-icon .input { padding-left: 42px; }
.hint { font-size: 12.5px; color: var(--muted); }

.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 14px; }
.switch input { display: none; }
.switch .track { width: 42px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s; }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::after { transform: translateX(18px); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
}
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: #a77800; border-color: transparent; }
.chip.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip.ink { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.chip.click { cursor: pointer; transition: all .15s; }
.chip.click.active { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- Topbar / brand ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar-in { max-width: 1040px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center;
  background: var(--grad-ink); color: #fff; box-shadow: 0 6px 16px -6px rgba(31, 42, 107, .6);
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-family: var(--serif); font-weight: 700; font-size: 19px; line-height: 1.05; }
.brand-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-pill {
  display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 5px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); max-width: 260px;
}
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--grad); color: #2a1406; font-weight: 800; font-size: 13px;
}
.user-pill .meta { min-width: 0; line-height: 1.15; }
.user-pill .meta b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-pill .meta span { font-size: 11.5px; color: var(--muted); }

.container { max-width: 1040px; margin: 0 auto; padding: 24px 20px 120px; }

/* ---------- Hero / welcome ---------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center; padding-top: 18px; }
.hero h1 { font-family: var(--serif); font-size: clamp(34px, 5.2vw, 58px); font-weight: 650; letter-spacing: -.02em; }
.hero h1 em { font-style: italic; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 4px; }
.hero p.lead { font-size: 17px; color: var(--ink-2); max-width: 46ch; margin: 16px 0 0; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.feature-list { display: grid; gap: 14px; margin-top: 26px; }
.feature { display: flex; gap: 12px; align-items: flex-start; }
.feature .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--primary-2); flex: none; }
.feature .ic svg { width: 19px; height: 19px; }
.feature b { display: block; font-size: 14.5px; }
.feature span { font-size: 13px; color: var(--muted); }

.login-card { padding: 28px; position: relative; overflow: hidden; }
.login-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; background: var(--grad);
}
.login-card h2 { font-family: var(--serif); font-size: 26px; }

/* ---------- Page heading ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1, .page-head h2 { font-family: var(--serif); font-size: clamp(26px, 3.6vw, 36px); font-weight: 650; }
.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); font-weight: 600; cursor: pointer; background: none; border: 0; padding: 0; margin-bottom: 10px; }
.back-link:hover { color: var(--ink); }
.back-link svg { width: 16px; height: 16px; }

/* ---------- Assessment cards ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.a-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.a-card {
  position: relative; text-align: left; cursor: pointer; padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s; overflow: hidden; display: flex; flex-direction: column; gap: 12px;
}
.a-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.a-card .subject-ic {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff;
  font-family: var(--serif); font-weight: 700; font-size: 20px;
}
.a-card h3 { font-size: 17px; font-weight: 700; }
.a-card .desc { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.a-card .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 12.5px; color: var(--muted); }
.a-card .done-badge { position: absolute; top: 16px; right: 16px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state svg { width: 64px; height: 64px; margin: 0 auto 14px; color: var(--line-2); }
.empty-state b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

/* ---------- Answer sheet ---------- */
.sheet-head {
  display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 20px 22px;
  border-radius: var(--radius); color: #fff; background: var(--grad-ink); box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.sheet-head::after {
  content: ""; position: absolute; width: 260px; height: 260px; right: -80px; top: -120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 181, 71, .45), transparent 65%);
}
.sheet-head h2 { font-family: var(--serif); font-size: 24px; font-weight: 650; }
.sheet-head .meta { opacity: .82; font-size: 13px; margin-top: 4px; }
.sheet-head .chip { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.18); }
.progress-ring { position: relative; width: 66px; height: 66px; z-index: 1; }
.progress-ring svg { width: 66px; height: 66px; transform: rotate(-90deg); }
.progress-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 800; }

.sec { margin-top: 22px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-head h3 { font-size: 17px; display: flex; align-items: center; gap: 10px; }
.sec-head h3 .badge { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-size: 12px; font-weight: 800; }
.q-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.q-grid.wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.q-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); transition: border-color .15s, background .15s;
}
.q-row.filled { border-color: color-mix(in srgb, var(--primary-2) 40%, var(--line)); background: color-mix(in srgb, var(--primary-2) 4%, var(--surface)); }
.q-no { width: 34px; flex: none; text-align: center; font-weight: 800; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.opts { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.opt {
  width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line-2); background: var(--surface);
  font-weight: 750; font-size: 14px; cursor: pointer; display: grid; place-items: center; color: var(--ink-2);
  transition: all .12s ease; padding: 0; -webkit-tap-highlight-color: transparent;
}
.opt:hover { border-color: var(--primary-2); color: var(--primary-2); }
.opt.sel { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); transform: scale(1.04); box-shadow: 0 6px 14px -6px rgba(31, 42, 107, .6); }
.opt.wide { width: auto; padding: 0 14px; border-radius: 99px; min-width: 76px; }
.opt.sm { width: 32px; height: 32px; font-size: 12.5px; }
.q-row .jd-select { flex: 1; }

.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -18px rgba(22, 26, 51, .3);
}
.sticky-bar .in { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.bar-progress { flex: 1; min-width: 0; }
.bar-progress .track { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar-progress .fill { height: 100%; background: var(--grad); border-radius: 99px; transition: width .3s ease; }

/* ---------- Result ---------- */
.result-hero {
  position: relative; overflow: hidden; border-radius: 24px; padding: 30px; color: #fff;
  background: var(--grad-ink); box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: auto 1fr; gap: 30px; align-items: center;
}
.result-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(500px 300px at 100% 0%, rgba(255, 181, 71, .35), transparent 60%),
              radial-gradient(400px 260px at 0% 100%, rgba(255, 122, 69, .25), transparent 60%);
}
.result-hero > * { position: relative; }
.score-ring { width: 196px; height: 196px; position: relative; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .val { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.score-ring .num { font-family: var(--serif); font-size: 58px; font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.score-ring .lbl { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; opacity: .75; margin-top: 4px; }
.grade-badge {
  display: inline-flex; align-items: center; gap: 12px; padding: 8px 16px 8px 8px; border-radius: 99px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2);
}
.grade-badge .letter { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--serif); font-weight: 800; font-size: 22px; color: #fff; }
.result-hero h2 { font-family: var(--serif); font-size: clamp(24px, 3.4vw, 34px); font-weight: 650; margin-top: 14px; }
.result-hero .msg { opacity: .9; margin-top: 8px; font-size: 15.5px; max-width: 52ch; }
.result-hero .who { opacity: .75; font-size: 13px; margin-top: 14px; }
.pass-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 99px; font-size: 12.5px; font-weight: 750; letter-spacing: .02em; }
.pass-tag.ok { background: rgba(14, 163, 113, .22); color: #7ff0c6; }
.pass-tag.bad { background: rgba(229, 72, 77, .22); color: #ffb3b5; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; position: relative; overflow: hidden;
}
.stat .k { font-size: 12px; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.stat .v { font-family: var(--serif); font-size: 30px; font-weight: 700; margin-top: 4px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--muted); }
.stat.ok .v { color: var(--ok); } .stat.bad .v { color: var(--bad); } .stat.mute .v { color: var(--empty); } .stat.info .v { color: var(--info); }
.stat .bar { position: absolute; left: 0; bottom: 0; height: 3px; background: currentColor; }

.sec-bars { display: grid; gap: 14px; }
.sec-bar .top { display: flex; justify-content: space-between; font-size: 13.5px; font-weight: 600; }
.sec-bar .track { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 6px; }
.sec-bar .fill { height: 100%; border-radius: 99px; background: var(--grad-ink); transition: width 1s cubic-bezier(.2,.8,.2,1); }

.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.rv {
  border-radius: 12px; padding: 8px 6px; text-align: center; border: 1px solid transparent; font-variant-numeric: tabular-nums;
}
.rv .n { font-size: 11px; font-weight: 700; opacity: .7; }
.rv .a { font-weight: 800; font-size: 16px; line-height: 1.2; }
.rv .k { font-size: 10.5px; font-weight: 700; opacity: .8; }
.rv.c { background: var(--ok-soft); color: var(--ok); }
.rv.w { background: var(--bad-soft); color: var(--bad); }
.rv.e { background: var(--empty-soft); color: var(--empty); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* ---------- Ranking ---------- */
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); gap: 2px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-weight: 650; font-size: 13.5px; cursor: pointer; color: var(--muted); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.podium { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.15fr) minmax(0,1fr); gap: 12px; align-items: end; margin: 8px 0 4px; }
.pod { text-align: center; min-width: 0; }
.pod .av { width: 58px; height: 58px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; border: 3px solid var(--surface); box-shadow: var(--shadow); }
.pod .nm { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.pod .sc { font-family: var(--serif); font-weight: 700; font-size: 20px; }
.pod .base { margin-top: 10px; border-radius: 14px 14px 6px 6px; display: grid; place-items: center; font-family: var(--serif); font-weight: 800; font-size: 26px; color: #fff; }
.pod.p1 .base { height: 110px; background: linear-gradient(180deg, #f6c445, #e09b12); }
.pod.p2 .base { height: 82px; background: linear-gradient(180deg, #c6cbdc, #8f96b0); }
.pod.p3 .base { height: 64px; background: linear-gradient(180deg, #f0a777, #c9733d); }
.pod.p1 .av { width: 70px; height: 70px; font-size: 22px; }
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.rank-item.me { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.rank-item .r { font-family: var(--serif); font-weight: 800; font-size: 20px; text-align: center; color: var(--muted); }
.rank-item .nm { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-item .mini { height: 5px; border-radius: 99px; background: var(--line); margin-top: 6px; overflow: hidden; }
.rank-item .mini i { display: block; height: 100%; background: var(--grad-ink); border-radius: 99px; }
.rank-item .sc { font-family: var(--serif); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.my-rank {
  display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 20px 22px; border-radius: var(--radius);
  background: var(--grad); color: #2a1406; box-shadow: var(--shadow);
}
.my-rank .big { font-family: var(--serif); font-size: 54px; font-weight: 800; line-height: 1; }
.my-rank .big small { font-size: 20px; opacity: .7; }

/* ---------- Modal / toast ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 100; background: rgba(13, 16, 32, .48); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 16px; animation: fadeIn .18s ease;
}
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 22px;
  box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: pop .22s cubic-bezier(.2,.9,.3,1.2);
}
.modal.lg { width: min(980px, 100%); }
.modal.xl { width: min(1200px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h3 { font-size: 18px; font-family: var(--serif); }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); flex-wrap: wrap; }
.toasts { position: fixed; z-index: 200; top: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; display: flex; gap: 10px; align-items: center; animation: slideDown .25s ease; }
.toast.ok { background: var(--ok); color: #fff; } .toast.bad { background: var(--bad); color: #fff; }
.toast svg { width: 18px; height: 18px; flex: none; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; display: inline-block; }
.loading-block { display: grid; place-items: center; padding: 60px 0; color: var(--muted); gap: 12px; }
.skeleton { background: linear-gradient(90deg, var(--line) 25%, var(--surface-2) 50%, var(--line) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 14px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(8px); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.rise { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.rise.d1 { animation-delay: .06s } .rise.d2 { animation-delay: .12s } .rise.d3 { animation-delay: .18s } .rise.d4 { animation-delay: .24s }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; background: var(--surface-2); padding: 11px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--primary-2) 3%, transparent); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl.compact td { padding: 7px 10px; }

footer.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 30px 16px 40px; }
footer.foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .q-grid.wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .container { padding: 16px 16px 120px; }
  .topbar-in { padding: 10px 16px; }
  .brand-sub { display: none; }
  .q-grid, .q-grid.wide { grid-template-columns: 1fr; }
  .result-hero { grid-template-columns: 1fr; text-align: center; padding: 26px 20px; gap: 18px; }
  .result-hero .score-ring { margin: 0 auto; width: 170px; height: 170px; }
  .result-hero .msg { margin-left: auto; margin-right: auto; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 18px; }
  .sheet-head { padding: 18px; }
  .sheet-head h2 { font-size: 20px; }
  .modal-back { place-items: end center; padding: 0; }
  .modal { border-radius: 22px 22px 0 0; max-height: 92vh; }
  .user-pill .meta { display: none; }
  .user-pill { padding: 4px; }
  .my-rank .big { font-size: 44px; }
}
@media (max-width: 380px) {
  .opt { width: 34px; height: 34px; font-size: 13px; }
  .opts { gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
