:root {
  color-scheme: light;
  --blue: #0b6bcb;
  --blue-dark: #084f96;
  --gold: #f2b705;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --border: #dde3ec;
  --border-strong: #cfd7e3;
  --text: #1c2430;
  --muted: #5d6b7e;
  --ok: #1f8a4c;
  --bad: #c43d3d;
  --selected: #e6f0fb;
  --header: #0b6bcb;
  --toast-bg: #1c2430;
  --toast-text: #ffffff;
  --easy-bg: #e3f4ea;
  --medium-bg: #fdf3d7;
  --medium-text: #9a6b00;
  --hard-bg: #fbe4e4;
  --very-hard: #3b1f4f;
}

/* Dark theme: chosen with the 🌙 button, or automatic when the device uses dark mode */
:root[data-theme="dark"] {
  color-scheme: dark;
  --blue: #4c9be8;
  --blue-dark: #2f7fcf;
  --bg: #11161d;
  --surface: #1a212b;
  --surface-2: #232c38;
  --border: #2c3644;
  --border-strong: #3a4656;
  --text: #e4e9f0;
  --muted: #98a4b3;
  --ok: #4cc27f;
  --bad: #f07373;
  --selected: #1d3550;
  --header: #12304f;
  --toast-bg: #e4e9f0;
  --toast-text: #11161d;
  --easy-bg: #17352a;
  --medium-bg: #3a3014;
  --medium-text: #f2c94c;
  --hard-bg: #3d1e22;
  --very-hard: #8e5bb8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  position: sticky; top: 0; z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--header);
  color: white;
  border-bottom: 4px solid var(--gold);
}
header h1 { margin: 0; font-size: 1.4rem; }

.lang-switch button {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,.6);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.lang-switch button.active { background: white; color: #0b6bcb; }

main { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }

.lead { font-size: 1.2rem; color: var(--muted); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer; font: inherit; color: inherit;
}
.card:hover { border-color: var(--blue); box-shadow: 0 2px 10px rgba(11,107,203,.12); }
.card strong { font-size: 1.2rem; }
.card span { color: var(--muted); }

.test-bar { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 16px; }
.timer { font-variant-numeric: tabular-nums; background: var(--surface); padding: 4px 10px; border-radius: 6px; border: 1px solid var(--border); }
.timer.warning { color: var(--bad); border-color: var(--bad); }

#question-box { background: var(--surface); padding: 24px; border-radius: 12px; border: 1px solid var(--border); }
.topic { color: var(--muted); font-size: .9rem; }
#question-box h2 { font-size: 1.2rem; margin: 8px 0 20px; }

.option {
  display: block; width: 100%; text-align: left; font: inherit; color: inherit;
  padding: 12px 16px; margin-bottom: 10px; background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 8px; cursor: pointer;
}
.option:hover { border-color: var(--blue); }
.option.selected { background: var(--selected); border-color: var(--blue); font-weight: 600; }

.nav { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.nav button, #btn-home {
  font: inherit; padding: 10px 18px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: inherit;
}
.nav button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--blue); color: white; border-color: var(--blue); }
button.primary:hover { background: var(--blue-dark); }

.score { text-align: center; background: var(--surface); border-radius: 12px; padding: 24px; margin-bottom: 20px; border: 1px solid var(--border); }
.score .big { font-size: 2.6rem; font-weight: 700; color: var(--blue); }

.review-item { background: var(--surface); border-radius: 10px; padding: 16px 20px; margin-bottom: 12px; border-left: 5px solid; }
.review-item.ok { border-color: var(--ok); }
.review-item.bad { border-color: var(--bad); }
.review-item h3 { font-size: 1rem; margin: 0 0 8px; }
.review-item p { margin: 4px 0; }
.review-item .explanation { color: var(--muted); font-style: italic; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--toast-bg); color: var(--toast-text); padding: 12px 20px; border-radius: 8px;
}

.badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 10px; font-size: .8rem; font-weight: 600; }
.badge.easy { background: var(--easy-bg); color: var(--ok); }
.badge.medium { background: var(--medium-bg); color: var(--medium-text); }
.badge.hard { background: var(--hard-bg); color: var(--bad); }
.badge.very_hard { background: var(--very-hard); color: white; }
.level-card.easy { border-left: 5px solid var(--ok); }
.level-card.medium { border-left: 5px solid var(--gold); }
.level-card.hard { border-left: 5px solid var(--bad); }
.level-card.very_hard { border-left: 5px solid var(--very-hard); }
.level-card.mixed { border-left: 5px solid var(--blue); }
.q-image { display: block; max-width: 100%; height: auto; margin: 0 auto 20px; border: 1px solid var(--border); border-radius: 8px; background: white; }
.review-item .q-image { max-width: 320px; margin: 8px 0; }

.auth-area { display: flex; align-items: center; gap: 8px; }
.auth-area button {
  background: transparent; color: white; border: 1px solid rgba(255,255,255,.6);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; font: inherit; font-size: .9rem;
}
.auth-area button:hover { background: rgba(255,255,255,.15); }
.user-email { font-size: .85rem; opacity: .85; }
.auth-form { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; max-width: 440px; margin: 0 auto; }
.auth-form h2 { margin-top: 0; }
.auth-form input { display: block; width: 100%; font: inherit; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg); color: var(--text); }
.auth-message { color: var(--bad); min-height: 1.2em; }
.auth-message.ok { color: var(--ok); }
.muted { color: var(--muted); }
.save-status { text-align: center; margin-bottom: 16px; }
.save-status.ok { color: var(--ok); font-weight: 600; }
.save-status.bad { color: var(--bad); }
.save-status button { font: inherit; padding: 4px 12px; border-radius: 6px; border: 1px solid var(--blue); background: var(--surface); color: var(--blue); cursor: pointer; }
.stat-card { cursor: default; }
.stat-card em { margin-top: 6px; font-style: normal; font-weight: 600; }
.history-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: 12px; overflow: hidden; }
.history-table th, .history-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.history-table th { background: var(--surface-2); }
@media (max-width: 600px) { .user-email { display: none; } .settings-btn { font-size: 1rem !important; } header h1 { font-size: 1.1rem; } }

.header-right { display: flex; align-items: center; gap: 8px; }
.theme-toggle {
  background: transparent; border: 1px solid rgba(255,255,255,.6); color: white;
  width: 36px; height: 34px; border-radius: 6px; cursor: pointer; font-size: 1.05rem; line-height: 1;
}
.theme-toggle:hover { background: rgba(255,255,255,.15); }
/* Diagrams keep a light "paper" background; soften them a little at night */
:root[data-theme="dark"] .q-image { filter: brightness(.92); }

.intro { margin-top: 32px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; line-height: 1.55; }
.intro h2 { margin-top: 0; font-size: 1.2rem; }
.intro ul { padding-left: 20px; }
.intro li { margin: 4px 0; }

.home-title { font-size: 1.25rem; margin: 28px 0 4px; }
.home-title:first-of-type { margin-top: 4px; }
#screen-subjects .muted { margin: 4px 0 12px; }
.full-card { border-left: 5px solid var(--gold); }
.section-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.section-tabs button { font: inherit; font-size: .85rem; padding: 6px 10px; border-radius: 16px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.section-tabs button.active { background: var(--blue); border-color: var(--blue); color: white; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.palette button { width: 36px; height: 34px; font: inherit; font-size: .85rem; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.palette button.answered { background: var(--selected); border-color: var(--blue); }
.palette button.current { outline: 2px solid var(--blue); font-weight: 700; }
.passage { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; }
.passage summary { cursor: pointer; font-weight: 600; }
.passage-text { white-space: pre-line; line-height: 1.6; margin-top: 8px; max-height: 50vh; overflow-y: auto; }
.score-table { margin-top: 16px; text-align: left; }
.small { font-size: .85rem; }
.review-section { font-size: 1.15rem; margin: 24px 0 10px; }

.modal { position: fixed; inset: 0; background: rgba(10, 16, 24, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.modal-box { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; max-width: 440px; width: 100%; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.modal-box p { margin: 0 0 8px; line-height: 1.5; }

.home-link { color: inherit; text-decoration: none; }
.home-link:hover { opacity: .85; }
.top-actions { margin-bottom: 12px; }
.back-home { font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.back-home:hover { border-color: var(--blue); }

/* Question header with "come back later" flag */
.q-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.flag-btn { font: inherit; font-size: .82rem; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--border-strong); background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.flag-btn.active { border-color: #e8890c; color: #e8890c; background: rgba(232, 137, 12, .1); }
.palette button.flagged { box-shadow: inset 0 -3px 0 #e8890c; }

/* Results: all / only mistakes */
.review-filter { margin: 8px 0 12px; }
.review-filter > div { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.review-subjects { gap: 6px !important; }
.review-subjects button { font-size: .82rem; padding: 5px 11px; }
.review-filter button { font: inherit; padding: 7px 14px; border-radius: 18px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.review-filter button.active { background: var(--blue); border-color: var(--blue); color: white; }

/* Unfinished test banner on the home page */
.resume { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; margin-bottom: 8px; border-radius: 12px; border: 1px solid var(--gold); background: var(--medium-bg); }
.resume .nav { margin-top: 8px; justify-content: flex-start; }
.resume .nav button { font: inherit; padding: 8px 16px; border-radius: 8px; cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.resume .nav button.primary { background: var(--blue); border-color: var(--blue); color: white; }

/* ---------- Phones ---------- */
@media (max-width: 640px) {
  header { padding: 10px 14px; }
  .auth-area button { padding: 5px 8px; font-size: .8rem; }
  main { padding: 16px 12px 40px; }
  .test-bar { flex-wrap: wrap; gap: 4px 12px; font-size: .9rem; }
  .test-bar #test-title { flex-basis: 100%; }
  #question-box { padding: 16px; }
  #question-box h2 { font-size: 1.08rem; }
  .option { padding: 14px 14px; font-size: 1rem; }
  /* subject tabs scroll sideways instead of wrapping */
  .section-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .section-tabs button { flex: 0 0 auto; }
  /* Back / Next / Finish always visible at the bottom during a test */
  #screen-test .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(0,0,0,.08);
  }
  #screen-test .nav button { flex: 1; padding: 12px 6px; }
  body.in-test main { padding-bottom: 90px; }
  .palette button { width: 40px; height: 40px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 14px; }
  .card strong { font-size: 1.05rem; }
}
@media (max-width: 380px) { .cards { grid-template-columns: 1fr; } }

/* ---------- Landing (visitors who are not logged in) ---------- */
body.signed-in .landing { display: none; }
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: center; margin: 8px 0 28px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-weight: 700; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; }
.hero h2 { font-size: 2rem; line-height: 1.2; margin: 0 0 14px; }
.hero-sub { color: var(--muted); font-size: 1.05rem; line-height: 1.5; margin: 0 0 20px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.big-btn { font: inherit; font-weight: 600; padding: 13px 22px; border-radius: 10px; cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface); color: inherit; }
.big-btn.ghost:hover { border-color: var(--blue); }
.hero-note { color: var(--muted); font-size: .88rem; margin: 12px 0 0; }
.hero-demo { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; box-shadow: 0 12px 30px rgba(11,107,203,.12); transform: rotate(1.2deg); }
.demo-bar { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; color: var(--muted); }
.demo-timer { font-variant-numeric: tabular-nums; }
.demo-q { font-weight: 600; margin: 12px 0; }
.demo-opt { border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; font-size: .95rem; }
.demo-opt.ok { border-color: var(--ok); color: var(--ok); font-weight: 600; background: var(--easy-bg); }
.demo-exp { margin: 10px 0 0; font-size: .88rem; color: var(--muted); font-style: italic; }
.stats { list-style: none; padding: 16px; margin: 0 0 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; text-align: center; }
.stats strong { display: block; font-size: 1.7rem; color: var(--blue); }
.stats span { color: var(--muted); font-size: .85rem; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 12px; }
.features > div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; }
.features p { margin: 6px 0 0; color: var(--muted); line-height: 1.45; }
.steps ol { padding-left: 22px; margin: 0 0 8px; line-height: 1.8; }
.faq { margin-top: 32px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 8px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; color: var(--muted); line-height: 1.5; }
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; gap: 20px; }
  .hero h2 { font-size: 1.55rem; }
  .hero-demo { transform: none; }
  .big-btn { flex: 1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: 1fr; }
}

/* ---------- Account settings ---------- */
.settings-box { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin-bottom: 14px; }
.settings-box h3 { margin: 0 0 6px; }
.settings-box p.muted { margin: 0 0 12px; }
.settings-box input { display: block; width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--bg); color: var(--text); }
.settings-box .nav { margin-top: 12px; }
.settings-box .auth-message { margin: 8px 0 0; min-height: 0; }
.settings-box.danger { border-color: var(--bad); }
.settings-box.danger h3 { color: var(--bad); }
.nav button.danger-btn { background: var(--bad); border-color: var(--bad); color: #fff; }
.settings-btn { max-width: 220px; overflow: hidden; white-space: nowrap; }
.settings-btn .user-email { margin-left: 6px; }

/* Program code in informatics questions */
.code-block { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 0 0 16px;
  font: .95rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-x: auto; white-space: pre; tab-size: 4; }
#question-box h2, .review-item h3 { white-space: pre-line; }

/* Real ҰБТ task types */
.task-hint { margin: -8px 0 14px; color: var(--blue); font-weight: 600; font-size: .92rem; }
.option.check { position: relative; padding-left: 44px; }
.option.check::before { content: ""; position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  border: 2px solid var(--border-strong); border-radius: 4px; background: var(--surface); }
.option.check.selected::before { content: "✓"; background: var(--blue); border-color: var(--blue); color: #fff;
  font-size: 13px; line-height: 18px; text-align: center; font-weight: 700; }
.match-options { margin: 0 0 16px; padding-left: 24px; line-height: 1.6; }
.match-options li { margin-bottom: 4px; }
.match-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--border-strong); border-radius: 8px; }
.match-row > span { font-weight: 600; flex: 1 1 220px; }
.match-picks { display: flex; gap: 8px; }
.match-picks button { width: 44px; height: 44px; font: inherit; font-weight: 700; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: inherit; }
.match-picks button.selected { background: var(--blue); border-color: var(--blue); color: #fff; }
.review-item.part { border-color: var(--gold); }
.review-item .match-items { white-space: pre-line; }
.review-item .points-line { font-weight: 600; }
.passage-text { white-space: pre-wrap; }

/* Matching: two columns like the exam sheet, then an answer grid */
.match-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.match-cols ul { list-style: none; margin: 0; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 8px; line-height: 1.55; }
.match-cols li + li { margin-top: 8px; }
.match-cols ul:first-child li { font-weight: 600; }
.match-grid { border-collapse: collapse; margin: 0 auto 4px; }
.match-grid th { padding: 6px 12px; font-weight: 700; }
.match-grid td { padding: 6px 10px; text-align: center; }
.match-dot { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); cursor: pointer; }
.match-dot.selected { background: var(--blue); border-color: var(--blue); box-shadow: inset 0 0 0 5px var(--surface); }
@media (max-width: 640px) { .match-cols { grid-template-columns: 1fr; } }

/* ---------- Test picker: tabs, two dropdowns, subject chips ---------- */
.picker { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px 20px 22px; margin: 8px 0 20px; }
.picker-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 0 -20px 16px; padding: 0 12px; }
.picker-tabs button { font: inherit; font-weight: 600; padding: 14px 14px 12px; border: 0; background: none; color: var(--muted);
  border-bottom: 3px solid transparent; cursor: pointer; }
.picker-tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }
.pair-select { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 16px; }
.pair-select label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; color: var(--muted); font-weight: 600; }
.pair-select select { font: inherit; font-size: 1.05rem; color: var(--text); padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--bg); cursor: pointer; }
#start-full { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font: inherit; color: inherit; cursor: pointer;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); }
.chip:hover { border-color: var(--blue); }
.chip small { color: var(--muted); font-size: .8rem; }
@media (max-width: 640px) {
  .pair-select { grid-template-columns: 1fr; }
  .picker-tabs button { flex: 1; padding: 12px 6px; }
  .chip { flex: 1 1 calc(50% - 10px); }
}

/* Variants grid */
.variants-head { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 10px; }
.variants { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 14px; max-width: 520px; }
.variant { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; font: inherit; color: inherit;
  cursor: pointer; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--bg); }
.variant:hover { border-color: var(--blue); }
.variant small { color: var(--muted); font-size: .78rem; }
.variant.done { border-color: var(--ok); background: var(--easy-bg); }
.variant.done small { color: var(--ok); font-weight: 600; }
.variant.unfinished { border-color: var(--gold); border-style: dashed; }
#start-full { width: 100%; }
.variant strong { font-size: 1.15rem; }
.variant small { min-height: 1.1em; }
.variant em { font-style: normal; font-size: .72rem; color: var(--muted); min-height: 1em; }
.variant-legend { font-size: .8rem; margin: -6px 0 14px; }
.pair-select.one { grid-template-columns: 1fr; margin-bottom: 6px; }
#start-subject { width: 100%; }

/* Signed-in name on phones (header is too narrow for it) */
.user-line { display: none; }
@media (max-width: 600px) {
  body.signed-in .user-line:not([hidden]) {
    display: block; width: 100%; padding: 6px 14px; border: 0; text-align: left; font: inherit; font-size: .9rem;
    background: var(--surface); color: var(--text); border-bottom: 1px solid var(--border); cursor: pointer;
  }
}

.link-btn:disabled { opacity: .5; cursor: default; }
.link-btn { background: none; border: 0; padding: 0; margin-top: 4px; font: inherit; font-size: .92rem; color: var(--blue); text-decoration: underline; cursor: pointer; }

/* Password fields with a show/hide (eye) button */
.pw-wrap { position: relative; display: block; }
.pw-wrap[hidden] { display: none; }
.pw-wrap input { padding-right: 52px !important; margin-bottom: 0 !important; }
.auth-form .pw-wrap { margin-bottom: 12px; }
.pw-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 8px; }
.pw-eye:hover { color: var(--text); }

#form-password .pw-wrap + .pw-wrap { margin-top: 10px; }

/* Sign in with Google (hidden until Google is enabled in Supabase) */
body:not(.google-on) .google-btn, body:not(.google-on) .auth-or { display: none; }
.google-btn img { flex-shrink: 0; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; font: inherit; font-weight: 600; padding: 12px; min-height: 46px; border-radius: 8px; border: 1px solid var(--border-strong); background: #ffffff; color: #1f1f1f; cursor: pointer; }
.google-btn:hover { background: #f2f2f2; }
.google-btn:disabled { opacity: .6; cursor: default; }
.auth-or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--muted); font-size: .9rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.settings-box[hidden] { display: none; }

.site-footer { text-align: center; padding: 24px 16px 40px; font-size: .9rem; color: var(--muted); }
.site-footer a { color: var(--muted); }
body.in-test .site-footer { display: none; }
.home-link { display: inline-flex; align-items: center; gap: .45em; }
.home-link::before { content: ""; width: 1.5em; height: 1.5em; flex: none; border-radius: .38em; background: url("/favicon.svg") center / cover no-repeat; box-shadow: 0 0 0 2px rgba(255,255,255,.85); }

.q-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.report-btn { font: inherit; font-size: .82rem; padding: 4px 10px; border-radius: 14px; border: 1px solid var(--border-strong); background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.report-btn:hover { color: var(--text); }
.report-row { display: flex; justify-content: flex-end; margin-top: 8px; }
.report-box h3 { margin: 0 0 6px; }
.report-box .report-q { font-size: .9rem; margin: 0 0 12px; }
.report-reasons { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.report-reasons label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.report-box textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--bg, transparent); color: var(--text); resize: vertical; }
