/* FrontierHuman, dressed in sharkyloop.com's plush look: rounded type, soft shark blues,
   foam fills, pill shapes and dashed "stitched" outlines. Dark theme is the same toy underwater. */
:root,
:root[data-theme="light"] {
  --bg: #ffffff;
  --panel: #ffffff;
  --foam: #e8f6f8;
  --line: #cfe6ee;
  --stitch: #b9dcea;
  --fg: #2f5f85;
  --muted: #4b7696;
  --accent: #5b8db5;
  --deep: #3f729c;
  --aqua: #4fb3c2;
  --on-accent: #ffffff;
  --pink: #d9627f;
  --pink-soft: #fde9ee;
  --pink-ink: #a8324f;
  --soft: 0 10px 26px rgb(63 114 156 / 0.16);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b1d2c;
  --panel: #11283b;
  --foam: #173449;
  --line: #24465e;
  --stitch: #36627f;
  --fg: #dcf0f7;
  --muted: #9dc2d6;
  --accent: #6fa6cc;
  --deep: #8fc6e8;
  --aqua: #7fd3df;
  --on-accent: #0b1d2c;
  --pink: #f29bb0;
  --pink-soft: #3a2230;
  --pink-ink: #f6b3c3;
  --soft: 0 10px 26px rgb(0 0 0 / 0.35);
  color-scheme: dark;
}

:root {
  --s: 2px;
  --rim: 5px;
  --cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", "WenQuanYi Micro Hei", sans-serif;
  --round: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", var(--cjk);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--round);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
main { flex: 1; width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* A stitched patch: the fill runs a little past the dashes, like a sewn-on label. */
.box, .score, .share, .table, .review, .qr {
  background: var(--panel);
  border: var(--s) dashed var(--stitch);
  border-radius: 26px;
  box-shadow: 0 0 0 var(--rim) var(--panel), var(--soft);
}

/* ---------- Bar ---------- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: var(--panel);
  border-bottom: var(--s) dashed var(--line);
}
.brand {
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--deep);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border-radius: 16px;
}
.brand .word span { color: var(--aqua); }
.logo-mark {
  display: block;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 4px;
  background: var(--foam);
  border: var(--s) dashed var(--stitch);
  border-radius: 14px;
  image-rendering: pixelated;
  transition: transform 0.2s;
}
.brand:hover .logo-mark { transform: rotate(-8deg); }
:root[data-theme="dark"] .logo-light, :root:not([data-theme="dark"]) .logo-dark { display: none; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav > a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  color: var(--deep);
  white-space: nowrap;
  transition: background-color 0.15s;
}
.nav > a:hover { background: var(--foam); }
@media (max-width: 900px) { .nav > a { padding: 0 10px; } }
@media (max-width: 820px) { .nav .sk-chip img { display: none; } .nav .sk-chip { padding-left: 5px; } }
.theme {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--deep);
  background: var(--foam);
  border: var(--s) dashed var(--stitch);
  border-radius: 999px;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.theme svg { transition: transform 0.3s; }
.theme:hover { background: var(--accent); border-color: var(--deep); color: var(--on-accent); }
.theme:hover svg { transform: rotate(180deg); }

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 36px 20px 72px;
}

/* ---------- Primitives ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 28px;
  border: var(--s) dashed var(--stitch);
  border-radius: 999px;
  background: var(--foam);
  color: var(--deep);
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.btn:hover:not(:disabled) { background: var(--accent); border-color: var(--deep); color: var(--on-accent); transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-accent {
  background: var(--deep);
  color: var(--on-accent);
  border-color: color-mix(in srgb, var(--on-accent) 55%, transparent);
  box-shadow: 0 0 0 4px var(--deep), var(--soft);
}
.btn-accent:hover:not(:disabled) { border-color: color-mix(in srgb, var(--on-accent) 55%, transparent); box-shadow: 0 0 0 4px var(--accent), var(--soft); }
.btn-xl { min-height: 72px; font-size: 24px; padding: 0 44px; }

/* ---------- Chat ---------- */
.chat { display: grid; gap: 10px; }
.turn {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: start;
  gap: 10px;
}
.turn .who {
  justify-self: end;
  margin-top: 7px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--foam);
  color: var(--deep);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.turn .text {
  justify-self: start;
  min-width: 0;
  padding: 10px 16px;
  background: var(--foam);
  border-radius: 6px 20px 20px 20px;
}
.turn .text, .option .label, .opt .label, .context, .cue, .why, .bands .mean, .crit .name, .item summary .r { overflow-wrap: anywhere; }
.turn.past .who { background: none; color: var(--muted); }
.turn.past .text { background: none; border: var(--s) dashed var(--line); color: var(--muted); padding: 8px 14px; }
.turn.reply .who { background: var(--deep); color: var(--on-accent); }
.turn.reply .text {
  background: var(--deep);
  color: var(--on-accent);
  font-weight: 800;
  font-size: clamp(26px, 4.6vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  padding: 12px 20px 14px;
  border-radius: 6px 24px 24px 24px;
}

/* ---------- Intro ---------- */
.intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: center; }
.intro > * { grid-column: 1; }
.intro h1 {
  font-weight: 900;
  font-size: clamp(46px, 9.5vw, 108px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 8px 0 12px;
  color: var(--deep);
}
.intro h1 mark {
  display: inline-block;
  background: var(--foam);
  color: var(--accent);
  border: 3px dashed var(--stitch);
  border-radius: 0.28em;
  padding: 0 0.16em 0.04em;
  transform: rotate(-2deg);
}
.intro .demo { max-width: 680px; padding: 18px; margin-bottom: 16px; }
.intro .demo .turn.reply .text { font-size: clamp(48px, 10vw, 92px); padding: 4px 28px 12px; }
.intro .actions { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.intro-sharky {
  grid-column: 2;
  grid-row: 1 / span 3;
  display: block;
  padding: 10px;
  background: #fff;
  border: var(--s) dashed #b9dcea;
  border-radius: 40px;
  box-shadow: 0 0 0 6px #fff, var(--soft);
  transform: rotate(3deg);
}
.intro-sharky img { display: block; width: 240px; height: 240px; animation: sharky-bob 6s ease-in-out infinite; }
.intro-sharky:hover img { animation-duration: 1.6s; }
@media (max-width: 940px) { .intro-sharky { display: none; } }

/* ---------- Exam ---------- */
.exam-top { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.counter {
  font-weight: 800;
  font-size: 22px;
  line-height: 1.2;
  padding: 6px 16px;
  background: var(--foam);
  border: var(--s) dashed var(--stitch);
  border-radius: 999px;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.counter small { font-size: 14px; color: var(--muted); }
.cells { flex: 1; display: grid; grid-template-columns: repeat(20, 1fr); gap: 4px; }
.cells i { display: block; height: 12px; border-radius: 999px; background: var(--foam); }
.cells i.done { background: var(--accent); }
.cells i.now { background: var(--deep); transform: scaleY(1.5); }

.q { padding: 0; overflow: hidden; }
.q .context {
  padding: 14px 20px;
  border-bottom: var(--s) dashed var(--line);
  color: var(--muted);
  font-size: 15px;
}
.q .chat { padding: 18px 20px; }
.options { display: grid; gap: 10px; padding: 16px 20px 20px; border-top: var(--s) dashed var(--line); }
.option {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  text-align: left;
  min-height: 62px;
  padding: 9px 16px 9px 9px;
  border: var(--s) dashed var(--stitch);
  border-radius: 22px;
  background: var(--panel);
  font-size: 16px;
  transition: background-color 0.15s, color 0.15s, transform 0.15s;
}
.option .letter {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--foam);
  color: var(--deep);
  font-weight: 800;
  font-size: 17px;
}
.option:hover { background: var(--foam); transform: translateY(-1px); }
.option:hover .letter { background: var(--panel); }
.option.selected, .option.selected:hover {
  background: var(--deep);
  color: var(--on-accent);
  border-color: color-mix(in srgb, var(--on-accent) 55%, transparent);
  box-shadow: 0 0 0 3px var(--deep);
}
.option.selected .letter { background: var(--on-accent); color: var(--deep); }

.exam-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; }

/* ---------- Report ---------- */
.score { display: grid; grid-template-columns: auto 1fr; overflow: hidden; }
.score .num {
  font-weight: 900;
  font-size: clamp(80px, 15vw, 156px);
  line-height: 0.9;
  letter-spacing: -0.04em;
  padding: 26px 40px 24px 32px;
  border-radius: 0 56px 56px 0;
  background: var(--deep);
  color: var(--on-accent);
  font-variant-numeric: tabular-nums;
}
.score .num small { font-size: 0.35em; letter-spacing: -0.01em; }
.score .verdict {
  font-weight: 800;
  font-size: clamp(26px, 4.2vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  padding: 24px 28px;
  align-self: center;
  color: var(--deep);
}

.h2 {
  font-weight: 800;
  font-size: 23px;
  letter-spacing: -0.01em;
  margin: 48px 0 16px;
  color: var(--deep);
}

.table { overflow: hidden; }
.row {
  display: grid;
  grid-template-columns: 200px 1fr 84px;
  border-bottom: var(--s) dashed var(--line);
  min-height: 50px;
}
.row:last-child { border-bottom: 0; }
.row > * { display: flex; align-items: center; padding: 0 16px; }
.row .name { font-weight: 700; font-size: 15px; }
.row .val { justify-content: flex-end; font-weight: 800; font-variant-numeric: tabular-nums; }
.row .meter { position: relative; padding: 0 4px; }
.row .meter::before { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 12px; margin-top: -6px; border-radius: 999px; background: var(--foam); }
.meter span { position: relative; display: block; height: 12px; border-radius: 999px; background: var(--accent); }
.row.you { background: var(--foam); }
.row.you .meter::before { background: var(--panel); }
.row.you .meter span { background: var(--deep); }
.row.you .name { font-weight: 800; color: var(--deep); }

.filters {
  display: flex;
  gap: 4px;
  width: max-content;
  padding: 4px;
  margin-bottom: 16px;
  background: var(--foam);
  border: var(--s) dashed var(--stitch);
  border-radius: 999px;
}
.filters button {
  min-width: 68px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 800;
  color: var(--deep);
  transition: background-color 0.15s, color 0.15s;
}
.filters button:hover { background: var(--panel); }
.filters button.on { background: var(--deep); color: var(--on-accent); }

.review { overflow: hidden; }
.item { border-bottom: var(--s) dashed var(--line); }
.item:last-child { border-bottom: 0; }
.item summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: 52px 40px 1fr auto;
  align-items: center;
  min-height: 58px;
  transition: background-color 0.15s;
}
.item summary::-webkit-details-marker { display: none; }
.item summary .n { text-align: center; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.item summary .mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--foam);
  color: var(--accent);
  font-size: 16px;
  font-weight: 900;
}
.item.miss summary .mark { background: var(--pink-soft); color: var(--pink); }
.item summary .r { padding: 10px 14px; font-weight: 800; font-size: 19px; letter-spacing: -0.01em; }
.item summary .pick { padding: 0 20px 0 8px; font-weight: 800; color: var(--muted); }
.item summary:hover { background: var(--foam); }
.item summary:hover .mark { background: var(--panel); }
.item[open] summary { border-bottom: var(--s) dashed var(--line); }
.item .body { padding: 18px 20px 20px; display: grid; gap: 16px; }
.item .context { color: var(--muted); font-size: 14px; }

.opts { display: grid; gap: 8px; }
.opt {
  display: grid;
  grid-template-columns: 32px 1fr 24px;
  gap: 10px;
  align-items: center;
  padding: 7px 14px 7px 7px;
  border-radius: 18px;
  background: var(--foam);
  font-size: 15px;
}
.opt .letter { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: var(--panel); color: var(--deep); font-weight: 800; }
.opt .tag { font-weight: 900; text-align: center; }
.opt.correct { background: var(--deep); color: var(--on-accent); }
.opt.correct .letter { background: var(--on-accent); color: var(--deep); }
.opt.wrong { background: var(--pink-soft); color: var(--pink-ink); }
.opt.wrong .letter { color: var(--pink-ink); }
.opt.wrong .label { text-decoration: line-through; text-decoration-thickness: 2px; }

.cue {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.45;
  padding: 12px 16px;
  background: var(--foam);
  border: var(--s) dashed var(--stitch);
  border-radius: 6px 20px 20px 20px;
  color: var(--deep);
}
.why { margin: 0; }

.report-actions { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 40px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--deep);
  color: var(--on-accent);
  font-weight: 800;
  padding: 12px 22px;
  border-radius: 999px;
  box-shadow: var(--soft);
  z-index: 10;
}

/* ---------- Language ---------- */
.lang {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--foam);
  border: var(--s) dashed var(--stitch);
  border-radius: 999px;
}
.lang button {
  min-width: 40px;
  min-height: 34px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  color: var(--deep);
  transition: background-color 0.15s, color 0.15s;
}
.lang button:hover { background: var(--panel); }
.lang button[aria-pressed="true"] { background: var(--deep); color: var(--on-accent); }

/* ---------- Share ---------- */
.share { margin-top: 32px; padding: 14px; display: grid; gap: 12px; }
.link {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 5px;
  background: var(--foam);
  border-radius: 999px;
}
.link input {
  min-width: 0;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  min-height: 46px;
}
.link button {
  font-weight: 800;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--deep);
  color: var(--on-accent);
  transition: background-color 0.15s;
}
.link button:hover { background: var(--accent); }
.socials { display: flex; flex-wrap: wrap; gap: 8px; }
.socials > * {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: var(--s) dashed var(--stitch);
  border-radius: 999px;
  background: var(--foam);
  color: var(--deep);
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  text-align: center;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.socials > *:hover { background: var(--accent); border-color: var(--deep); color: var(--on-accent); transform: translateY(-2px); }
.socials > *:active { transform: translateY(0); }
.socials .primary, .socials .cover { background: var(--deep); color: var(--on-accent); border-color: color-mix(in srgb, var(--on-accent) 55%, transparent); font-weight: 800; }

/* Sharky's corner: sharkyloop's own card, a white patch in both themes so the plush logo always sits on white. */
.sharky, .sk-chip {
  --sk-ink: #2f5f85;
  --sk-shark: #5b8db5;
  --sk-deep: #3f729c;
  --sk-foam: #e8f6f8;
  --sk-line: #b9dcea;
}
.sharky {
  margin: 34px 6px 0;
  display: flex;
  align-items: center;
  gap: 8px 22px;
  padding: 10px 26px 10px 14px;
  background: #fff;
  color: var(--sk-ink);
  border: 2px dashed var(--sk-line);
  border-radius: 32px;
  box-shadow: 0 0 0 6px #fff, var(--soft);
}
.sharky-logo { flex: none; display: block; border-radius: 24px; }
.sharky-logo img { display: block; width: 124px; height: 124px; animation: sharky-bob 6s ease-in-out infinite; }
.sharky-logo:hover img { animation-duration: 1.6s; }
@keyframes sharky-bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-5px) rotate(-2deg); }
}
.sharky-body { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; }
.sharky-title { font-weight: 800; font-size: 26px; letter-spacing: -0.01em; line-height: 1.15; }
.sharky-links { display: flex; flex-wrap: wrap; gap: 10px; }
.sharky-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 20px;
  border: 2px dashed var(--sk-line);
  border-radius: 999px;
  background: var(--sk-foam);
  color: var(--sk-deep);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.15s;
}
.sharky-links a:hover, .sharky-links a:focus-visible { background: var(--sk-shark); border-color: var(--sk-deep); color: #fff; transform: translateY(-2px); }
.sharky-links a:active { transform: translateY(0); }
.sharky a:focus-visible { outline: 3px solid var(--sk-line); outline-offset: 3px; }
.sharky-links svg { width: 19px; height: 19px; fill: currentColor; flex: none; }

/* The same patch, shrunk to a chip for the header and the mobile footer. */
.sk-cell { display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.sk-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 5px 3px 3px; background: #fff; border: 2px dashed var(--sk-line); border-radius: 999px; }
.sk-chip img { display: block; width: 34px; height: 34px; border-radius: 999px; }
.sk-chip:hover img { animation: sharky-wiggle 0.7s ease-in-out; }
@keyframes sharky-wiggle {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-12deg); }
  65% { transform: rotate(9deg); }
}
.sk-chip a {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--sk-foam);
  color: var(--sk-deep);
  transition: background-color 0.15s, color 0.15s, transform 0.15s;
}
.sk-chip a:hover, .sk-chip a:focus-visible { background: var(--sk-shark); color: #fff; transform: translateY(-2px); }
.sk-chip a:focus-visible { outline: 3px solid var(--sk-line); outline-offset: 2px; }
.sk-chip svg { width: 16px; height: 16px; fill: currentColor; }

.qr {
  color: var(--fg);
  padding: 22px;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
.qr[open] { display: grid; gap: 16px; justify-items: stretch; }
.qr::backdrop { background: rgb(16 44 66 / 0.6); }
.qr .code { background: #ffffff; border: var(--s) dashed var(--stitch); border-radius: 20px; padding: 12px; line-height: 0; justify-self: center; width: min(260px, 100%); }
.qr .code svg { width: 100%; height: auto; display: block; }
.qr .scan { font-weight: 800; font-size: 22px; text-align: center; color: var(--deep); }
.qr .btn { width: 100%; }

.foot { display: none; }

/* ---------- Rubric ---------- */
.bands .row { grid-template-columns: 96px 260px 1fr; }
.bands .row > * { padding: 12px 16px; }
.bands .range { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.bands .band { font-weight: 800; font-size: 16px; line-height: 1.2; color: var(--deep); }
.bands .mean { color: var(--muted); font-size: 14px; }
.bands .row.on { background: var(--deep); }
.bands .row.on > * { color: var(--on-accent); }

.crit .row { grid-template-columns: 1fr 120px 72px; }
.crit .name { flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 12px 16px; }
.crit .name small { font-weight: 500; color: var(--muted); font-size: 13px; line-height: 1.35; }

.notice { display: grid; gap: 28px; justify-items: start; }
.notice h1 {
  font-weight: 900;
  font-size: clamp(34px, 7vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin: 8px 0 0;
  color: var(--deep);
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .btn { min-height: 52px; padding: 0 20px; font-size: 16px; }
  .btn:hover:not(:disabled) { transform: none; }
  .btn-xl { width: 100%; min-height: 62px; font-size: 21px; }

  .bar { padding: calc(8px + env(safe-area-inset-top)) 12px 8px; gap: 8px; }
  .brand { font-size: 19px; gap: 8px; }
  .logo-mark { width: 40px; height: 40px; padding: 2px; border-radius: 12px; }
  .nav .wide { display: none; }
  .lang button { min-width: 38px; min-height: 32px; }
  .theme { width: 40px; height: 40px; }
  .foot {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    background: var(--panel);
    border-top: var(--s) dashed var(--line);
  }
  .foot > a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 999px; font-weight: 700; font-size: 14px; text-decoration: none; color: var(--deep); }
  .foot > a:active { background: var(--foam); }
  .foot .sk-cell { flex: none; padding: 0; }
  .foot .sk-chip { gap: 6px; }
  .foot .sk-chip a { width: 38px; height: 38px; }
  .foot .sk-chip svg { width: 18px; height: 18px; }

  main { padding: 22px max(16px, env(safe-area-inset-right)) 36px max(16px, env(safe-area-inset-left)); }
  .intro { gap: 20px; }
  .intro h1 { font-size: clamp(42px, 13vw, 72px); margin: 4px 0 6px; }
  .intro .demo { padding: 12px; margin-bottom: 10px; }
  .intro .demo .turn.reply .text { font-size: clamp(44px, 15vw, 76px); padding: 2px 20px 8px; }
  .intro .actions { flex-direction: column; align-items: stretch; gap: 18px; }

  .chat { gap: 8px; }
  .turn { grid-template-columns: 54px 1fr; gap: 8px; }
  .turn .who { font-size: 11px; padding: 3px 8px; margin-top: 6px; letter-spacing: 0; }
  .turn .text { padding: 8px 12px; font-size: 15px; }
  .turn.past .text { padding: 6px 10px; }
  .turn.reply .text { font-size: clamp(24px, 7.5vw, 34px); padding: 10px 14px 12px; }
  .q .context { padding: 12px 14px; font-size: 14px; }
  .q .chat { padding: 14px 12px; }
  .exam-top { margin-bottom: 18px; gap: 10px; }
  .counter { font-size: 18px; padding: 5px 12px; }
  .counter small { font-size: 13px; }
  .cells { gap: 3px; }
  .cells i { height: 10px; }
  .options { gap: 8px; padding: 12px; }
  .option { grid-template-columns: 36px 1fr; gap: 10px; min-height: 58px; padding: 8px 12px 8px 8px; border-radius: 20px; font-size: 15px; line-height: 1.4; }
  .option .letter { width: 36px; height: 36px; font-size: 16px; }
  .option:hover { background: var(--panel); transform: none; }
  .option:hover .letter { background: var(--foam); }
  .option.selected:hover { background: var(--deep); }
  .option.selected:hover .letter { background: var(--on-accent); }
  .exam-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    margin: 0;
    padding: 12px max(18px, env(safe-area-inset-left)) calc(12px + env(safe-area-inset-bottom));
    background: var(--panel);
    border-top: var(--s) dashed var(--line);
    gap: 16px;
  }
  main:has(.exam-nav) { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  body:has(.exam-nav) .foot { display: none; }
  .exam-nav [data-go="prev"] { flex: 0 0 64px; padding: 0; }
  .exam-nav [data-go="next"] { flex: 1; }

  .score { grid-template-columns: 1fr; }
  .score .num { border-radius: 0 0 40px 40px; font-size: clamp(72px, 24vw, 112px); padding: 18px 24px 16px; }
  .score .verdict { font-size: clamp(24px, 7.5vw, 34px); padding: 16px 22px 20px; }
  .h2 { font-size: 20px; margin: 36px 0 14px; }
  .share { margin-top: 24px; padding: 12px; }
  .link button { padding: 0 16px; font-size: 14px; }
  .link input { padding: 0 12px; }
  .socials { display: grid; grid-template-columns: repeat(3, 1fr); }
  .socials .primary, .socials .cover { grid-column: 1 / -1; }
  .socials > * { padding: 0 8px; font-size: 14px; }
  .socials > *:hover { transform: none; }
  .sharky { margin-top: 28px; flex-direction: column; padding: 6px 14px 18px; border-radius: 28px; text-align: center; }
  .sharky-logo img { width: 148px; height: 148px; }
  .sharky-body { flex-direction: column; justify-content: center; width: 100%; gap: 12px; }
  .sharky-title { font-size: 24px; }
  .sharky-links { width: 100%; }
  .sharky-links a { flex: 1; min-height: 50px; padding: 0 12px; }
  .row { grid-template-columns: 104px 1fr 56px; }
  .row > * { padding: 0 12px; }
  .row .name { font-size: 13px; }
  .bands .row { grid-template-columns: 70px 1fr; }
  .bands .range { white-space: nowrap; font-size: 14px; }
  .bands .row > * { padding: 10px 12px; }
  .bands .mean { grid-column: 1 / -1; padding-top: 0; font-size: 13px; }
  .crit .row { grid-template-columns: 1fr 56px 52px; }
  .crit .name { padding: 10px 12px; }
  .filters { width: auto; }
  .filters button { flex: 1; min-width: 0; }
  .item summary { grid-template-columns: 42px 36px 1fr auto; min-height: 54px; }
  .item summary .r { font-size: 16px; padding: 10px; }
  .item summary .pick { padding: 0 14px 0 6px; }
  .item .body { padding: 14px; gap: 12px; }
  .opt { grid-template-columns: 30px 1fr 20px; gap: 8px; font-size: 14px; padding: 6px 12px 6px 6px; }
  .opt .letter { width: 30px; height: 30px; }
  .cue { font-size: 15px; padding: 10px 14px; }
  .report-actions .btn { width: 100%; }
  .notice .btn { width: 100%; }
  .toast { bottom: calc(24px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .brand { font-size: 17px; }
  .row { grid-template-columns: 92px 1fr 52px; }
}

@media (max-height: 480px) and (orientation: landscape) {
  .intro h1 { font-size: clamp(36px, 8vw, 64px); }
  .intro .demo .turn.reply .text { font-size: 44px; }
  .exam-nav { position: static; margin: 16px 0 0; padding: 0; border-top: 0; background: none; }
  main:has(.exam-nav) { padding-bottom: 32px; }
  .qr { max-height: calc(100dvh - 16px); grid-template-columns: auto 1fr; align-items: center; }
  .qr[open] { grid-template-columns: 180px 1fr; }
  .qr .code { width: 180px; grid-row: span 2; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .sharky-logo img, .intro-sharky img, .sk-chip:hover img { animation: none; }
}

/* ---------- Wish box: chat with Sharky to ask for changes to the site ---------- */
.wish-fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px 5px 5px;
  background: var(--panel);
  color: var(--deep);
  border: var(--s) dashed var(--stitch);
  border-radius: 999px;
  box-shadow: var(--soft);
  font-weight: 800;
  font-size: 15px;
  transition: transform 0.15s, background-color 0.15s;
}
.wish-fab img { display: block; width: 40px; height: 40px; border-radius: 999px; background: #fff; }
.wish-fab:hover { transform: translateY(-2px); background: var(--foam); }
.wish-fab:hover img { animation: sharky-wiggle 0.7s ease-in-out; }
body.wish-open .wish-fab, body:has(.exam-nav) .wish-fab { display: none; }

.wish-panel {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 9;
  width: min(380px, calc(100vw - 36px));
  max-height: min(560px, calc(100dvh - 36px));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: var(--s) dashed var(--stitch);
  border-radius: 24px;
  box-shadow: var(--soft);
  overflow: hidden;
}
.wish-panel[hidden] { display: none; }
.wish-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 10px 18px; border-bottom: var(--s) dashed var(--line); }
.wish-head h2 { margin: 0; font-size: 17px; font-weight: 800; color: var(--deep); }
.wish-close { width: 40px; height: 40px; border-radius: 999px; font-size: 24px; line-height: 1; color: var(--muted); }
.wish-close:hover { background: var(--foam); }
.wish-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.wish-msg { max-width: 88%; padding: 9px 13px; border-radius: 18px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.wish-msg p { margin: 0; }
.wish-msg.from-sharky { align-self: flex-start; background: var(--foam); border-bottom-left-radius: 6px; }
.wish-msg.from-you { align-self: flex-end; background: var(--deep); color: var(--on-accent); border-bottom-right-radius: 6px; }
.wish-msg ul { margin: 6px 0 0; padding-left: 18px; }
.wish-msg li small { display: block; color: var(--muted); font-size: 12px; }
.wish-post {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 8px;
  padding: 0 16px;
  background: var(--deep);
  color: var(--on-accent);
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}
.wish-post:hover { background: var(--accent); }
.wish-msg .wish-note { margin-top: 8px; font-size: 13px; color: var(--muted); }
.wish-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: var(--s) dashed var(--line); }
.wish-form textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  padding: 9px 13px;
  font: inherit;
  font-size: 16px;
  color: var(--fg);
  background: var(--bg);
  border: var(--s) solid var(--line);
  border-radius: 18px;
}
.wish-form textarea::placeholder { color: var(--muted); }
.wish-send { min-height: 44px; padding: 0 18px; background: var(--deep); color: var(--on-accent); border-radius: 999px; font-weight: 800; }
.wish-send:hover { background: var(--accent); }

@media (max-width: 720px) {
  .wish-fab { right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); }
  .wish-panel { right: 10px; left: 10px; width: auto; bottom: calc(10px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 20px - env(safe-area-inset-top)); }
}
@media (prefers-reduced-motion: reduce) { .wish-fab:hover img { animation: none; } }
