/* ==========================================================================
   JAPAPER — design system
   Navy + green + amber, light blue-grey canvas, thin-bordered white cards.
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

:root {
  /* surfaces */
  --bg: #f5f8fd;
  --bg-soft: #eef3fb;
  --surface: #ffffff;
  --surface-2: #f9fbff;
  /* ink */
  --ink: #101d33;
  --ink-2: #33425c;
  --muted: #64748b;
  --faint: #93a1b5;
  /* lines */
  --line: #e3e8f0;
  --line-2: #eef2f8;
  /* brand */
  --navy: #0d1c3f;
  --navy-2: #142c5e;
  --navy-deep: #091531;
  --green: #0f9d68;
  --green-dark: #0c8557;
  --green-soft: #e7f7f0;
  --amber: #ef8b1f;
  --amber-dark: #d9780f;
  --amber-soft: #fff4e3;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --red: #e11d48;
  --red-soft: #fdecf1;
  --violet: #7c3aed;
  /* shape */
  --r: 14px;
  --r-sm: 9px;
  --r-pill: 999px;
  --shadow-xs: 0 1px 2px rgba(16, 29, 51, .05);
  --shadow-sm: 0 4px 14px -10px rgba(13, 28, 63, .35);
  --shadow-md: 0 18px 40px -26px rgba(13, 28, 63, .45);
  --shadow-lg: 0 40px 80px -40px rgba(9, 21, 49, .55);
  --maxw: 1200px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", Arial, sans-serif;
  --font-display: "Sora", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.22; letter-spacing: -.022em; font-family: var(--font-display); font-weight: 800; color: var(--ink); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--bg-soft); padding: 1px 5px; border-radius: 5px; }
::selection { background: #cfe6ff; }

/* ---------------- layout ---------------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.page { min-height: 62vh; padding-bottom: 72px; animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wrapflex { display: flex; flex-wrap: wrap; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hide { display: none !important; }
.new-bubble { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; background: #e11d48; color: #fff; font-size: 8px; font-weight: 800; letter-spacing: .02em; line-height: 1; vertical-align: middle; clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.section { margin-top: 40px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-head h2 { font-size: 21px; }
.section-head p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.eyebrow { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--green); margin-bottom: 6px; }

/* ---------------- header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 26px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.logo-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--navy); box-shadow: 0 6px 16px -8px rgba(13, 28, 63, .8); flex: 0 0 auto; }
.logo-mark svg { width: 22px; height: 22px; }
.logo-words { display: flex; flex-direction: column; line-height: 1.1; }
.logo-text { font-family: var(--font-display); font-size: 18px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.logo-tag { font-size: 9.5px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); margin-top: 3px; white-space: nowrap; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a { position: relative; padding: 8px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: color .15s, background .15s; }
.nav a:hover { color: var(--navy); background: var(--bg-soft); }
.nav a.active { color: var(--navy); }
.nav a.active::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--green); }
.pill-new { display: inline-block; margin-left: 6px; padding: 1px 5px; border-radius: 4px; background: var(--red); color: #fff; font-size: 9px; font-weight: 800; letter-spacing: .04em; vertical-align: 2px; }

.header-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.header-search { display: flex; align-items: center; gap: 7px; background: var(--bg-soft); border: 1px solid transparent; border-radius: var(--r-pill); padding: 7px 12px; color: var(--faint); transition: .15s; }
.header-search:focus-within { background: #fff; border-color: var(--line); }
.header-search input { border: 0; background: transparent; outline: none; width: 132px; font-size: 13px; color: var(--ink); }
.header-search input::placeholder { color: var(--faint); }
.account { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border: 1px solid var(--line); border-radius: var(--r-pill); font-size: 13px; font-weight: 600; color: var(--ink-2); background: #fff; transition: .15s; }
.account:hover { border-color: #c9d4e5; box-shadow: var(--shadow-xs); }
.account .av { width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-size: 11px; font-weight: 800; font-family: var(--font-display); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--r-sm); border: 1px solid var(--navy);
  background: var(--navy); color: #fff; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: .16s ease; white-space: nowrap; text-align: center;
}
.btn:hover { background: var(--navy-2); border-color: var(--navy-2); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.sm { padding: 7px 13px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { padding: 13px 24px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { background: var(--bg-soft); border-color: #c9d4e5; color: var(--navy); }
.btn.green { background: var(--green); border-color: var(--green); }
.btn.green:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn.amber { background: var(--amber); border-color: var(--amber); }
.btn.amber:hover { background: var(--amber-dark); border-color: var(--amber-dark); }
.btn.blue { background: var(--blue); border-color: var(--blue); }
.btn.blue:hover { background: #1d4ed8; border-color: #1d4ed8; }
.btn.dark { background: #fff; color: var(--navy); border-color: #fff; }
.btn.dark:hover { background: #eef3fb; border-color: #eef3fb; }
.btn.outline-white { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35); }
.btn.outline-white:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .6); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn svg { flex: 0 0 auto; }

/* ---------------- badges ---------------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .01em; background: var(--bg-soft); color: var(--ink-2); border: 1px solid transparent; }
.badge.green { background: var(--green-soft); color: #0a7a51; }
.badge.amber { background: var(--amber-soft); color: #a8620a; }
.badge.red { background: var(--red-soft); color: #b31338; }
.badge.grey { background: #f1f4f9; color: #5c6b82; }
.badge.navy { background: var(--navy); color: #fff; }
.badge.violet { background: #f1eafe; color: #6425c4; }
.cat-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 5px; background: #eef4ec; color: #3f7a4f; font-size: 10.5px; font-weight: 700; }
.cat-badge.entrance { background: #fdf1e3; color: #a4650c; }

/* ---------------- hero band ---------------- */
.hero-band { background: var(--bg-soft); border-bottom: 1px solid var(--line); padding: 40px 0 34px; text-align: center; }
.hero-band h1 { font-size: clamp(26px, 3.4vw, 36px); letter-spacing: -.03em; }
.hero-band .lead { color: var(--ink-2); font-size: 15px; max-width: 620px; margin: 12px auto 0; }
.hero-band .hero-facts { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; font-size: 13.5px; color: var(--ink-2); }
.hero-band .hero-facts b { color: var(--navy); font-weight: 800; }
.hero-band .dot { width: 4px; height: 4px; border-radius: 50%; background: #b9c6da; }
.search-pill { display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 22px auto 0; background: #fff; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 5px 6px 5px 16px; box-shadow: var(--shadow-xs); color: var(--faint); }
.search-pill:focus-within { border-color: #b9c9e2; box-shadow: 0 0 0 4px rgba(37, 99, 235, .07); }
.search-pill input { flex: 1; border: 0; outline: none; background: transparent; font-size: 14px; color: var(--ink); min-width: 0; }
.search-pill input::placeholder { color: var(--faint); }
.search-pill .btn { border-radius: var(--r-pill); padding: 8px 16px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: var(--r-pill); background: #fff; border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: .15s; }
.chip:hover { border-color: #b9c9e2; color: var(--navy); box-shadow: var(--shadow-xs); }
.chip.on { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------------- cards ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-xs); }
.card-pad { padding: 20px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

/* paper card */
.paper-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; transition: .18s; }
.paper-card:hover { border-color: #cdd8e8; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.paper-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.paper-title { font-family: var(--font-display); font-size: 14.5px; font-weight: 700; color: var(--ink); line-height: 1.4; letter-spacing: -.01em; }
.paper-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.paper-meta span { display: inline-flex; align-items: center; gap: 4px; }
.paper-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.paper-actions .btn { flex: 1; }

/* test series card */
.test-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 9px; transition: .18s; position: relative; }
.test-card:hover { border-color: #cdd8e8; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.test-card .tc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.test-card .tc-id { display: flex; align-items: center; gap: 9px; min-width: 0; }
.test-card .tc-logo { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-family: var(--font-display); font-size: 12.5px; font-weight: 800; color: #fff; flex: 0 0 auto; letter-spacing: -.02em; }
.test-card h3 { font-size: 14.5px; font-weight: 700; line-height: 1.4; letter-spacing: -.012em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.test-facts { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }
.test-facts span { display: inline-flex; align-items: center; gap: 4px; }
.test-card .btn { margin-top: 2px; }
.tc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* carousel */
.carousel { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 12px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.carousel > * { flex: 0 0 268px; scroll-snap-align: start; }
.carousel::-webkit-scrollbar { height: 6px; }
.carousel::-webkit-scrollbar-thumb { background: #d5deec; border-radius: 4px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat b { display: block; font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -.03em; color: var(--navy); }
.stat span { font-size: 12px; color: var(--muted); font-weight: 600; }

/* board / exam tile */
.board-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.board-tile { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; cursor: pointer; transition: .16s; display: flex; align-items: center; gap: 11px; }
.board-tile:hover { border-color: #cdd8e8; box-shadow: var(--shadow-md); transform: translateY(-2px); }
.board-tile .code { font-family: var(--font-display); font-size: 14px; font-weight: 700; letter-spacing: -.02em; }
.board-tile .st { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tile-logo { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-soft); color: var(--navy); font-family: var(--font-display); font-weight: 800; font-size: 12px; flex: 0 0 auto; }

/* class cards */
.class-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.class-card { position: relative; overflow: hidden; border-radius: var(--r); padding: 24px; color: #fff; background: var(--navy); cursor: pointer; transition: .18s; }
.class-card.c12 { background: linear-gradient(135deg, #0f9d68, #0a7a51); }
.class-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.class-card .big { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -.03em; }
.class-card .sub { font-size: 13.5px; opacity: .82; margin-top: 6px; max-width: 420px; }
.class-card .go { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-size: 13px; font-weight: 700; }

/* ---------------- notes / list rows ---------------- */
.note-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.note-row:last-child { border-bottom: 0; }
.note-row:hover { background: var(--surface-2); }
.note-ico { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--bg-soft); color: var(--navy); font-size: 10.5px; font-weight: 800; flex: 0 0 auto; }
.note-ico.f { background: var(--amber-soft); color: #a8620a; }
.note-ico.s { background: var(--green-soft); color: #0a7a51; }
.note-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.note-main b { font-size: 14px; font-weight: 650; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-main span { font-size: 12px; color: var(--muted); }

/* table */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; padding: 11px 16px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }

/* ---------------- filters ---------------- */
.filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.filters.filters-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 10.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.field input, .field select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font-size: 13.5px; color: var(--ink); outline: none; transition: .15s; }
.field input:focus, .field select:focus { border-color: #b9c9e2; box-shadow: 0 0 0 3px rgba(37, 99, 235, .07); }
.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 16px 0 14px; flex-wrap: wrap; }

/* sidebar layout (test series) */
.side-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 20px; align-items: start; }
.side-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px; position: sticky; top: 84px; }
.side-card h4 { font-size: 13.5px; font-weight: 800; margin-bottom: 10px; }
.side-search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; color: var(--faint); margin-bottom: 12px; }
.side-search input { border: 0; outline: none; background: transparent; width: 100%; font-size: 12.5px; min-width: 0; }
.cat-list { display: flex; flex-direction: column; gap: 1px; }
.cat-row { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; transition: .13s; }
.cat-row:hover { background: var(--bg-soft); }
.cat-row.on { background: var(--bg-soft); color: var(--navy); font-weight: 700; }
.cat-row .box { width: 13px; height: 13px; border-radius: 3.5px; border: 1.5px solid #c4d0e2; flex: 0 0 auto; display: grid; place-items: center; }
.cat-row.on .box { background: var(--green); border-color: var(--green); color: #fff; }
.cat-row .n { margin-left: auto; font-size: 11.5px; color: var(--faint); font-weight: 700; }

/* ---------------- tabs ---------------- */
.tabs { display: inline-flex; gap: 2px; padding: 4px; background: var(--bg-soft); border-radius: var(--r-pill); }
.tabs button { padding: 7px 14px; border: 0; background: transparent; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 700; color: var(--ink-2); cursor: pointer; transition: .15s; white-space: nowrap; }
.tabs button:hover { color: var(--navy); }
.tabs button.on { background: #fff; color: var(--navy); box-shadow: var(--shadow-xs); }
.tabs.bar { display: flex; width: 100%; border-radius: 10px; padding: 5px; overflow-x: auto; }

/* ---------------- footer ---------------- */
.site-footer { background: var(--navy); color: #c9d4e8; margin-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 26px; padding: 42px 0 30px; }
.footer-grid h5 { color: #fff; font-family: var(--font); font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 12px; }
.footer-grid a { display: block; font-size: 13px; color: #b6c4dd; padding: 3px 0; transition: .13s; }
.footer-grid a:hover { color: #fff; }
.footer-brand .logo-text { color: #fff; }
.footer-brand .logo-mark { background: rgba(255, 255, 255, .12); }
.footer-brand p { font-size: 12.5px; color: #9fb0cd; margin-top: 10px; max-width: 280px; line-height: 1.65; }
.footer-cta { margin-top: 16px; display: inline-flex; align-items: center; gap: 8px; }
.tg-note { display: flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 12px; color: #9fb0cd; }
.socials { display: flex; gap: 16px; margin-top: 16px; }
.social { display: inline-flex; align-items: center; justify-content: center; color: #c9d4e8; transition: color .15s, transform .15s; }
.social:hover { color: #fff; transform: translateY(-2px); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 0 20px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 12px; color: #8fa2c2; }
.build-stamp { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: #7c8fb0; }

/* ---------------- empty / alert ---------------- */
.empty { background: #fff; border: 1px dashed var(--line); border-radius: var(--r); padding: 40px 22px; text-align: center; color: var(--muted); font-size: 13.5px; }
.empty b { display: block; font-family: var(--font-display); font-size: 16px; color: var(--ink); margin-bottom: 6px; }
.alert { padding: 11px 14px; border-radius: var(--r-sm); font-size: 13px; margin-bottom: 14px; background: var(--blue-soft); color: #17408f; border: 1px solid #d5e3ff; }
.alert.err { background: var(--red-soft); color: #a30f33; border-color: #fbd0dc; }
.alert.ok { background: var(--green-soft); color: #0a6e49; border-color: #c9eddd; }

/* ---------------- forms ---------------- */
.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.form-field label { font-size: 11.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.form-field input, .form-field select, .form-field textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; font-size: 14px; outline: none; transition: .15s; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: #b9c9e2; box-shadow: 0 0 0 3px rgba(37, 99, 235, .07); }
.form-field input[type=file] { padding: 8px; font-size: 12.5px; }
.auth-wrap { max-width: 420px; margin: 44px auto; }

/* ---------------- pagination ---------------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 26px; }
.pagination button { min-width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.pagination button:hover:not([disabled]) { border-color: #b9c9e2; color: var(--navy); }
.pagination button.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.pagination button[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------------- test instruction page ---------------- */
.crumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); padding: 16px 0; flex-wrap: wrap; }
.crumb a:hover { color: var(--navy); }
.crumb .sep { color: #c3cddd; }
.crumb b { color: var(--ink); font-weight: 700; }
.instr-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 26px 28px; max-width: 860px; margin: 0 auto; box-shadow: var(--shadow-sm); }
.instr-card h1 { font-size: clamp(21px, 2.6vw, 27px); letter-spacing: -.03em; }
.instr-facts { display: flex; flex-wrap: wrap; gap: 18px; margin: 16px 0 4px; font-size: 13px; color: var(--ink-2); }
.instr-facts span { display: inline-flex; align-items: center; gap: 6px; }
.instr-list { margin: 18px 0 0; padding-left: 20px; color: var(--ink-2); font-size: 13.5px; }
.instr-list li { margin-bottom: 9px; }
.instr-foot { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-2); display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ---------------- runner ---------------- */
.runner-head { position: sticky; top: 68px; z-index: 40; background: #fff; border-bottom: 1px solid var(--line); padding: 10px 0; margin: 0 -20px 18px; padding-inline: 20px; }
.runner-head .rh-in { display: flex; align-items: center; justify-content: space-between; gap: 14px; max-width: var(--maxw); margin: 0 auto; }
.timer { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: var(--r-pill); background: var(--blue-soft); color: #17408f; font-family: var(--font-display); font-weight: 800; font-size: 14px; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.timer.warn { background: var(--red-soft); color: #a30f33; animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .62; } }
.runner { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.q-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; }
.q-num { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.q-text { font-size: 16px; font-weight: 600; line-height: 1.62; color: var(--ink); margin: 14px 0 18px; white-space: pre-wrap; }
.opt { display: flex; align-items: flex-start; gap: 11px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 9px; cursor: pointer; font-size: 14.5px; color: var(--ink-2); background: #fff; transition: .14s; }
.opt:hover { border-color: #c4d2e8; background: var(--surface-2); }
.opt .k { width: 24px; height: 24px; border-radius: 50%; background: var(--bg-soft); color: var(--ink-2); display: grid; place-items: center; font-size: 11.5px; font-weight: 800; flex: 0 0 auto; }
.opt.sel { border-color: var(--navy); background: #f2f6ff; box-shadow: 0 0 0 1px var(--navy) inset; }
.opt.sel .k { background: var(--navy); color: #fff; }
.opt.correct { border-color: var(--green); background: var(--green-soft); }
.opt.correct .k { background: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt.wrong .k { background: var(--red); color: #fff; }
.runner-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.palette { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; position: sticky; top: 146px; }
.palette h4 { font-size: 13.5px; font-weight: 800; margin-bottom: 12px; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 10px; margin: 14px 0 0; font-size: 11.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.pal-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-height: 330px; overflow-y: auto; padding-right: 3px; }
.pal-grid button { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 12px; font-weight: 700; color: var(--ink-2); cursor: pointer; transition: .12s; }
.pal-grid button:hover { border-color: #b9c9e2; }
.pal-grid button.ans { background: var(--green); border-color: var(--green); color: #fff; }
.pal-grid button.mark { background: var(--violet); border-color: var(--violet); color: #fff; }
.pal-grid button.cur { box-shadow: 0 0 0 2px var(--navy); }

/* ---------------- result ---------------- */
.score-hero { background: var(--navy); color: #fff; border-radius: var(--r); padding: 26px 28px; display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.score-hero h1 { color: #fff; }
.ring { --p: 0; width: 122px; height: 122px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
  background: conic-gradient(#2ee6a8 calc(var(--p) * 1%), rgba(255, 255, 255, .14) 0); }
.ring > div { width: 96px; height: 96px; border-radius: 50%; background: var(--navy); display: grid; place-items: center; text-align: center; }
.ring b { font-family: var(--font-display); font-size: 26px; font-weight: 800; display: block; line-height: 1.1; }
.ring span { font-size: 11.5px; color: #a9bcd9; }
.score-facts { display: flex; gap: 22px; flex-wrap: wrap; }
.score-facts > div { display: flex; flex-direction: column; }
.score-facts b { font-family: var(--font-display); font-size: 19px; font-weight: 800; }
.score-facts span { font-size: 11.5px; color: #a9bcd9; }
.review-item { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 12px; }
.solution { margin-top: 10px; padding: 11px 13px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2); }

/* ---------------- dark CTA band ---------------- */
.cta-band { background: var(--navy); border-radius: var(--r); padding: 30px; color: #fff; margin-top: 40px; }
.cta-band h2 { color: #fff; font-size: 22px; }
.cta-band p { color: #b7c6e0; font-size: 13.5px; margin-top: 8px; max-width: 760px; }
.cta-band .mini-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.cta-band .mini-stats span { padding: 4px 10px; border-radius: 6px; background: rgba(255, 255, 255, .1); font-size: 11.5px; font-weight: 700; }
.cta-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 24px; }
.cta-features > div { border-left: 2px solid rgba(255, 255, 255, .18); padding-left: 12px; }
.cta-features b { display: block; font-size: 13px; margin-bottom: 4px; }
.cta-features span { font-size: 12px; color: #a9bcd9; line-height: 1.5; display: block; }
.cta-foot { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .12); font-size: 12px; color: #a9bcd9; }

/* FAQ */
.faq { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.faq details { border-bottom: 1px solid var(--line-2); }
.faq details:last-child { border-bottom: 0; }
.faq summary { padding: 14px 18px; font-size: 13.5px; font-weight: 650; color: var(--ink); cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "⌄"; color: var(--faint); font-size: 15px; transition: .15s; }
.faq details[open] summary::after { transform: rotate(180deg); }
.faq p { padding: 0 18px 15px; font-size: 13px; color: var(--muted); max-width: 760px; }

/* ---------------- modal ---------------- */
.modal-back { position: fixed; inset: 0; background: rgba(9, 21, 49, .55); backdrop-filter: blur(2px); z-index: 200; display: grid; place-items: center; padding: 20px; animation: fade .16s ease; }
.modal { background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 520px; box-shadow: var(--shadow-lg); max-height: 88vh; overflow-y: auto; }
.modal h3 { font-size: 18px; letter-spacing: -.02em; }
.modal-close { position: absolute; top: 14px; right: 14px; }
.pay-modal { max-width: 440px; }
.pay-tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg-soft); border-radius: 10px; margin-bottom: 16px; overflow-x: auto; }
.pay-tabs button { flex: 1; padding: 7px 10px; border: 0; background: transparent; border-radius: 7px; font-size: 12px; font-weight: 700; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.pay-tabs button.on { background: #fff; color: var(--navy); box-shadow: var(--shadow-xs); }
.pay-apps { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.pay-apps span { padding: 5px 10px; border-radius: 7px; background: var(--bg-soft); font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.pay-methods { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 16px; }
.pay-methods span { padding: 5px 10px; border-radius: 7px; background: var(--bg-soft); font-size: 11.5px; font-weight: 600; color: var(--ink-2); }

/* ---------------- admin ---------------- */
.admin-grid { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 16px; align-items: start; }

/* ---------------- responsive ---------------- */
@media (max-width: 1080px) {
  .side-layout { grid-template-columns: 200px minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters.filters-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .header-inner { height: auto; padding: 10px 0 8px; flex-wrap: wrap; gap: 10px 14px; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .header-search { display: none; }
  .header-right { margin-left: auto; }
  .runner { grid-template-columns: 1fr; }
  .palette { position: static; }
  .pal-grid { grid-template-columns: repeat(8, 1fr); max-height: none; }
  .side-layout { grid-template-columns: 1fr; }
  .side-card { position: static; }
  .cat-list { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .cat-row { border: 1px solid var(--line); border-radius: var(--r-pill); padding: 5px 11px; }
  .cat-row.on { border-color: var(--green); background: var(--green-soft); }
  .cat-row .box { display: none; }
  .cat-row .n { margin-left: 4px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cta-features { grid-template-columns: repeat(2, 1fr); }
  .runner-head { position: static; }
  .class-grid { grid-template-columns: 1fr; }
  .instr-card { padding: 20px; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .wrap { padding: 0 14px; }
  .hero-band { padding: 26px 0 24px; }
  .hero-band h1 { font-size: 24px; }
  .hero-band .lead { font-size: 13.5px; }
  .grid-2, .grid-3, .board-grid, .cta-features { grid-template-columns: 1fr; }
  .filters, .filters.filters-4 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 22px; padding: 30px 0 22px; }
  .footer-brand { grid-column: 1 / -1; }
  .logo-tag { display: none; }
  .nav a { padding: 7px 9px; font-size: 13px; }
  .nav .pill-new { display: none; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .carousel > * { flex-basis: 240px; }
  .pal-grid { grid-template-columns: repeat(6, 1fr); }
  .runner-head { margin-inline: -14px; padding-inline: 14px; }
  .score-hero { padding: 20px; gap: 18px; }
  .paper-actions { flex-wrap: wrap; }
  .note-row { padding: 11px 12px; }
  .stat b { font-size: 19px; }
  .instr-facts { gap: 12px; font-size: 12px; }
  .modal { padding: 18px; }
  .admin-grid { gap: 12px; }
  .tabs { overflow-x: auto; max-width: 100%; }
}
