/* Marqot */

:root {
  --bg: #f2efe6;
  --bg-2: #e8e3d6;
  --paper: #fffdf8;
  --ink: #172126;
  --ink-soft: #3d4a51;
  --muted: #6b787f;
  --line: #d8d1c3;
  --line-strong: #c4bba8;
  --teal: #0b6b68;
  --teal-deep: #084844;
  --teal-soft: #d7eeec;
  --teal-mid: #1a8a85;
  --gold: #b0892e;
  --good: #1d6b42;
  --good-soft: #e3f3e9;
  --bad: #9f2a22;
  --bad-soft: #f8e6e4;
  --locked: #8b959b;
  --shadow: 0 1px 0 rgba(23, 33, 38, 0.04), 0 12px 32px rgba(23, 33, 38, 0.06);
  --radius: 14px;
  --max: 1080px;
  --sans: "IBM Plex Sans", "Source Sans 3", "Segoe UI", sans-serif;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --fredoka: "Fredoka", "IBM Plex Sans", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { color-scheme: light; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--bg);
  background-image: url("img/bg-pattern.svg");
  background-repeat: repeat;
  background-position: 0 0;
  background-size: 180px 180px;
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

.app {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 32px 80px;
}

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  box-shadow: 0 1px 0 rgba(23, 33, 38, 0.06);
  flex: 0 0 auto;
}
.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.brand:hover { text-decoration: none; }
.brand-kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
}
.brand-name {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.progress-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px 8px 10px;
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.progress-bar {
  width: 88px;
  height: 6px;
  background: var(--bg-2);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar > i {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: 99px;
  width: 0%;
}

.hero {
  margin: 8px 0 28px;
}
.hero:has(.hero-market) {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 300px);
  gap: 28px 36px;
  align-items: center;
}
.hero-copy { min-width: 0; }
.hero-market {
  display: block;
  position: relative;
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--paper);
  text-decoration: none;
  color: inherit;
  isolation: isolate;
  transition: transform 0.08s ease, border-color 0.12s ease;
  transform-origin: center center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.hero-market:hover { text-decoration: none; border-color: var(--teal); transform: scale(1.03); }
.hero-market:active { transform: scale(0.96); }
.hero-market img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}
.hero-market-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 14px 12px;
  background: linear-gradient(to top, rgba(8, 72, 68, 0.88), rgba(8, 72, 68, 0.0));
  color: #fffdf8;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.hero-market-kicker {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.85;
}
.hero-market-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.hero-market-sub {
  font-size: 12px;
  opacity: 0.9;
}
.hero-market:hover .hero-market-title { text-decoration: underline; }

.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 42px;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  line-height: 1.15;
}
.hero p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  max-width: 36em;
}

.home-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.home-actions h2 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.08s ease, border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
  transform-origin: center center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:hover:not([disabled]),
a.btn:hover {
  border-color: var(--teal);
  color: var(--teal-deep);
  text-decoration: none;
}
.btn-primary {
  background: var(--teal);
  border-color: var(--teal-deep);
  color: #fff;
}
.btn-primary:hover:not([disabled]),
a.btn-primary:hover {
  background: var(--teal-deep);
  color: #fff;
  text-decoration: none;
}
.btn:active:not([disabled]) { transform: none; }
.btn-primary:active:not([disabled]) { transform: none; }
.btn-ghost {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover { color: var(--teal-deep); border-color: transparent; transform: none; }
.btn-danger {
  color: var(--bad);
  border-color: #e2c4c0;
}
.btn[disabled],
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.map {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.map-unit-10 {
  grid-column: 2;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  min-height: 168px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  width: 100%;
  font: inherit;
  position: relative;
  overflow: hidden;
}
a.card:hover { text-decoration: none; border-color: var(--teal-mid); transform: translateY(-1px); }
.card.locked {
  cursor: default;
  background: #f6f3eb;
  color: var(--locked);
  box-shadow: none;
}
.card.locked:hover { transform: none; border-color: var(--line); }
.card.complete {
  border-color: #b9d4c4;
  padding-right: 22px;
}
.card.complete .badge { margin-right: 18px; }
.btn:focus-visible, .choice:focus-within, a.card:focus-visible, a.lesson-row:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.card.complete::after {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: 0; height: 0;
  border-top: 36px solid var(--good);
  border-left: 36px solid transparent;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.unit-num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}
.card.locked .unit-num { color: var(--locked); }
.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-deep);
}
.badge.lock { background: var(--bg-2); color: var(--locked); }
.badge.done { background: var(--good-soft); color: var(--good); }
.card h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
}
.card.locked h3 { color: #7d878d; }
.card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  flex: 1;
}
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
}
.card.locked .card-foot { color: var(--locked); font-weight: 500; }

.back-row { margin: 0 0 26px; }
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.08s ease, border-color 0.12s ease, color 0.12s ease;
  transform-origin: center center;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.back-btn:hover {
  transform: none;
  text-decoration: none;
  border-color: var(--teal);
  color: var(--teal-deep);
}
.back-btn:active { transform: none; }
.back-arrow { font-size: 16px; line-height: 1; }

.unit-head h1 {
  font-family: var(--serif);
  font-size: 34px;
  margin: 8px 0 6px;
  letter-spacing: -0.03em;
}
.unit-head p { margin: 0 0 22px; color: var(--ink-soft); }

.lesson-list { display: flex; flex-direction: column; gap: 10px; }
.lesson-row {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 14px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}
a.lesson-row:hover { border-color: var(--teal-mid); text-decoration: none; }
.lesson-row.locked {
  background: #f6f3eb;
  box-shadow: none;
  color: var(--locked);
  cursor: default;
}
.step {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  background: var(--teal-soft);
  color: var(--teal-deep);
}
.lesson-row.locked .step { background: var(--bg-2); color: var(--locked); }
.lesson-row.complete .step { background: var(--good); color: #fff; }
.lesson-row h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.lesson-row small { color: var(--muted); }

.teach {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px;
  margin-bottom: 28px;
}
.teach h1 {
  font-family: var(--serif);
  font-size: 32px;
  letter-spacing: -0.03em;
  margin: 0 0 18px;
  line-height: 1.2;
}
.teach p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 1em;
  max-width: 42em;
}
.teach p:last-child { margin-bottom: 0; }

.quiz {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 32px 32px;
}
.quiz h2 {
  font-family: var(--serif);
  font-size: 24px;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.quiz-lead {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 14px;
}

.q-block { margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.q-block:last-of-type { border-bottom: 0; }
.q-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 6px;
}
.q-text {
  font-size: 16.5px;
  font-weight: 600;
  margin: 0 0 12px;
  line-height: 1.4;
}
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  font-size: 15px;
}
.choice:hover { border-color: var(--teal-mid); }
.choice input { margin-top: 3px; accent-color: var(--teal); }
.choice.correct {
  border-color: #8fbf9e;
  background: var(--good-soft);
}
.choice.wrong {
  border-color: #e0aaa4;
  background: var(--bad-soft);
}
.explain {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f6f3eb;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.5;
}
.explain.miss { background: var(--bad-soft); color: #6d221c; }
.explain.hit { background: var(--good-soft); color: #184e30; }

.quiz-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 8px;
}

.result {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 10px;
  font-weight: 600;
}
.result.pass { background: var(--good-soft); color: var(--good); }
.result.fail { background: #f4efe0; color: #6a5420; }

.town-strip {
  height: 168px;
  margin: 40px 0 0;
  border-radius: 16px;
  background: url("img/bg-town.jpg") center 72% / cover no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 32%);
  mask-image: linear-gradient(to bottom, transparent, #000 32%);
  pointer-events: none;
}
.footer-note {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.01em;
}

.check {
  position: absolute;
  top: 6px;
  right: 7px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  z-index: 1;
}

@media (max-width: 860px) {
  .app { padding: 24px 18px 64px; }
  .map { grid-template-columns: 1fr; }
  .map-unit-10 { grid-column: auto; }
  .hero { grid-template-columns: 1fr; }
  .hero-market { max-width: 280px; }
  .hero h1 { font-size: 32px; }
  .teach, .quiz { padding: 20px; }
}

.home-btns { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
  align-items: end;
  margin: 0 0 20px;
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.editor-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.editor-toolbar select {
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--ink);
  min-width: 260px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
}
.editor-toolbar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.editor-status {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 14px;
}
.editor-status.ok { background: var(--good-soft); color: var(--good); }
.editor-help { margin: 0 0 16px; color: var(--muted); font-size: 14px; font-weight: 400; }
.edit-lesson h2 {
  font-family: var(--serif);
  margin: 28px 0 12px;
}
.edit-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.edit-block textarea,
.edit-block input[type="text"],
.edit-choice input[type="text"] {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper);
  line-height: 1.45;
}
.edit-block textarea { resize: vertical; }
.edit-q {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 8px;
  margin: 0 0 16px;
}
.edit-q h3 { margin: 0 0 10px; font-size: 16px; }
.edit-choices { display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; }
.edit-choice { display: flex; gap: 10px; align-items: center; }
.edit-correct {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--teal-deep);
  white-space: nowrap;
}


.hero p.hero-sub {
  margin-top: 8px;
  font-size: 15px;
  color: var(--muted);
}
.topbar-side {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-link {
  font-weight: 600;
  font-size: 14px;
  color: var(--teal-deep);
  text-decoration: none;
}
.topbar-link:hover { text-decoration: underline; }

.mkt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 22px;
}
.mkt-head h1 {
  font-family: var(--serif);
  font-size: 34px;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
}
.mkt-head p {
  margin: 0;
  color: var(--ink-soft);
  max-width: 36em;
}
.mkt-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 220px;
  text-align: right;
}
.mkt-chip {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.mkt-chip.open { background: var(--good-soft); color: var(--good); }
.mkt-chip.closed { background: var(--bg-2); color: var(--muted); }
.mkt-live {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}

.mkt-closed-banner {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.mkt-closed-banner p {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--muted);
  margin: 8px 0 0;
  font-weight: 400;
  letter-spacing: 0;
}

.mkt-catchup {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin: 0 0 18px;
}
.mkt-catchup h2 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.mkt-catchup p { margin: 0 0 10px; color: var(--ink-soft); font-size: 14px; }
.mkt-catchup ul { margin: 0; padding-left: 1.2em; color: var(--ink); }
.mkt-catchup li { margin: 0 0 6px; }

.mkt-port {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 0 0 22px;
}
.mkt-port > div {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
}
.mkt-port span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.mkt-port strong { font-size: 18px; }

.mkt-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 12px;
}
.mkt-section-head h2 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mkt-ico {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--teal);
}
.mkt-section-head p { margin: 0; font-size: 13px; color: var(--muted); }

.mkt-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 28px; }
.mkt-row {
  display: grid;
  grid-template-columns: 1fr 160px auto;
  gap: 12px 18px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}
a.mkt-row:hover { border-color: var(--teal-mid); text-decoration: none; }
a.mkt-row:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.mkt-row h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.mkt-row small { color: var(--muted); font-size: 13px; }
.mkt-price { text-align: right; }
.mkt-price strong { display: block; font-size: 20px; letter-spacing: -0.02em; }
.mkt-price span { font-size: 13px; font-weight: 700; }
.mkt-last {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.mkt-row-simple {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.mkt-open-hint {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--teal);
}
.mkt-sheet {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px 18px 18px;
  margin: 0 0 16px;
}
.mkt-sheet h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
}
.mkt-sheet > p { margin: 0 0 14px; color: var(--ink-soft); }
.mkt-sheet-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 14px;
  margin: 0 0 18px;
}
.mkt-sheet-facts div {
  background: #f7f3ea;
  border-radius: 10px;
  padding: 10px 12px;
}
.mkt-sheet-facts span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2px;
}
.mkt-sheet-facts strong { font-size: 18px; letter-spacing: -0.02em; }
.mkt-sheet-news ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.mkt-sheet-news li {
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.mkt-sheet-news li:first-child { border-top: 0; padding-top: 0; }
.mkt-sheet-news span {
  display: inline-block;
  min-width: 4.5em;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
.mkt-sheet-news em { color: var(--muted); font-style: normal; font-size: 12px; }
@media (max-width: 860px) {
  .mkt-sheet-facts { grid-template-columns: 1fr 1fr; }
}

.mkt-up { color: var(--good); }
.mkt-down { color: var(--bad); }
.mkt-flat { color: var(--muted); }

.mkt-feed { display: flex; flex-direction: column; gap: 10px; }
.mkt-news {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px 16px 16px;
}
.mkt-news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.mkt-news-meta time { margin-left: auto; color: var(--muted); font-weight: 500; }
.mkt-news h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}
.mkt-news p { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.mkt-empty { color: var(--muted); font-size: 14px; }

.mkt-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
}
.mkt-tag-signal { background: var(--teal-soft); color: var(--teal-deep); }
.mkt-tag-noise { background: var(--bg-2); color: var(--muted); }

.mkt-reset-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}
.mkt-reset-row p { margin: 0; font-size: 13px; color: var(--muted); }

.mkt-trade {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
  margin-bottom: 22px;
}
.mkt-trade-price strong { font-size: 32px; letter-spacing: -0.03em; }
.mkt-trade-price span { margin-left: 10px; font-weight: 700; }
.mkt-trade-price p { margin: 8px 0 0; color: var(--ink-soft); }

.mkt-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
}
.mkt-qty {
  min-width: 48px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
}
.mkt-preview p { margin: 0 0 6px; }
.mkt-trade-note { color: var(--muted); font-size: 14px; }
.mkt-trade-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}
.mkt-flash {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}
.mkt-flash.ok { background: var(--good-soft); color: var(--good); }
.mkt-flash.no { background: var(--bad-soft); color: var(--bad); }

@media (max-width: 860px) {
  .mkt-head { flex-direction: column; }
  .mkt-status { align-items: flex-start; text-align: left; min-width: 0; }
  .mkt-port { grid-template-columns: 1fr 1fr; }
  .mkt-trade { padding: 18px; }
  .mkt-reset-row { flex-direction: column; align-items: flex-start; }
  .topbar { flex-wrap: wrap; }
}

.mkt-row { display: grid; grid-template-columns: 1fr 160px auto; gap: 12px 18px; align-items: center; }
.mkt-row .mkt-last { grid-column: 1 / -1; margin: 0; }
.mkt-spark { width: 160px; height: 44px; }
.mkt-svg { width: 100%; height: 100%; display: block; }
.mkt-svg.spark { height: 44px; }
.mkt-zoom { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.mkt-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 28px; }
.mkt-chart-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 10px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
}
.mkt-chart-card:hover { text-decoration: none; border-color: var(--teal-mid); }
.mkt-chart-card h3 { margin: 0 0 8px; font-size: 13px; letter-spacing: 0.08em; }
.mkt-chart-card p { margin: 8px 0 0; font-weight: 600; }
.mkt-chart-card .mkt-svg { height: 140px; }
.mkt-chart-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 10px;
  margin: 0 0 18px;
}
.mkt-chart-note { margin: 0 0 10px; color: var(--ink-soft); font-size: 14px; }
.mkt-chart-wrap .mkt-svg { height: 220px; }
@media (max-width: 860px) {
  .mkt-charts { grid-template-columns: 1fr; }
  .mkt-row { grid-template-columns: 1fr auto; }
  .mkt-spark { grid-column: 1 / -1; width: 100%; }
}

.mkt-basket {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #f4e8c8;
  color: #7a5b14;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}
.mkt-compare-wrap {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 12px;
  margin: 0 0 24px;
  box-shadow: var(--shadow);
}
.mkt-compare-wrap .mkt-section-head { margin-top: 0; }
.mkt-compare { height: 220px; }
.mkt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
}
.lg-pile::before, .lg-towns::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 3px;
  margin-right: 6px;
  vertical-align: middle;
  border-radius: 2px;
}
.lg-pile::before { background: #0b6b68; }
.lg-towns::before { background: #b0892e; }

.mkt-guess {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
  margin: 0 0 20px;
  box-shadow: var(--shadow);
}
.mkt-guess h2 { margin: 0 0 8px; font-family: var(--serif); }
.mkt-guess.live { border-color: var(--teal-mid); }
.mkt-guess.ok { background: var(--good-soft); border-color: #9cc9ad; }
.mkt-guess.no { background: var(--bad-soft); border-color: #e3b4af; }
.mkt-guess-hl {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin: 10px 0 6px;
  line-height: 1.3;
}
.mkt-guess-co, .mkt-guess-tally { color: var(--ink-soft); font-size: 14px; }
.mkt-guess-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 10px; }
.mkt-guess.idle { padding: 12px 16px; }
.mkt-guess.idle p { margin: 0 0 6px; }
.mkt-guess.idle p:last-child { margin: 0; }

.mkt-guess-trades { margin: 14px 0 8px; }
.mkt-guess-trades > p { margin: 0 0 10px; color: var(--ink-soft); font-size: 14px; }
.mkt-guess-trade {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.mkt-guess-trade small { display: block; color: var(--muted); font-weight: 400; }
.mkt-guess-trade-btns { display: flex; flex-wrap: wrap; gap: 6px; }

.mkt-port-wrap { margin: 0 0 22px; }
.mkt-port-wrap .mkt-port { margin-bottom: 0; }
.mkt-tickets-line {
  margin: 8px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.mkt-tickets {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.mkt-tickets h2 {
  margin: 0 0 8px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.mkt-tickets > p {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.45;
}
.mkt-ticket-offer p { margin: 0 0 6px; font-weight: 600; }
.mkt-ticket-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0 0 16px;
}
.mkt-ticket-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 16px 14px;
}
.mkt-ticket-card h3 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 22px;
}
.mkt-ticket-card p {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
}
.mkt-ticket-card .btn { width: 100%; }
.mkt-ticket-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
}
.mkt-ticket-qty p { margin: 0; font-weight: 600; }
@media (max-width: 860px) {
  .mkt-ticket-cards { grid-template-columns: 1fr; }
}
.mkt-ticket-list {
  margin: 14px 0 0;
  padding-left: 1.2em;
  color: var(--ink);
  font-size: 14px;
}
.mkt-ticket-list li { margin: 0 0 6px; }
.mkt-ticket-empty {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}


.topbar-side {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.acct-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
  box-shadow: var(--shadow);
}
.acct-chip-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.acct-chip-text strong { font-size: 13px; }
.acct-chip-text small { font-size: 11px; color: var(--muted); }
.acct-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: 0 0 auto;
}
.acct-avatar.lg { width: 48px; height: 48px; font-size: 20px; }
.acct-home {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  margin: 0 0 22px;
}
.acct-home h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}
.acct-home p { margin: 0; color: var(--muted); font-size: 14px; }
.acct-home-kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 600;
}
.acct-home .btn { margin-left: auto; }
.auth-wrap { max-width: 460px; margin: 12px auto 0; }
.auth-brand { margin-bottom: 22px; }
.auth-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 22px 20px;
}
.auth-form h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 28px;
}
.auth-form > p { margin: 0 0 16px; color: var(--ink-soft); }
.auth-form label {
  display: block;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.auth-form input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: #fff;
}
.auth-form input:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}
.auth-form .btn { margin-right: 8px; margin-top: 6px; }
.auth-err {
  margin: 0 0 10px;
  color: var(--bad);
  font-size: 14px;
  font-weight: 600;
}
.auth-err.ok { color: var(--good); }
.prof-email { margin-top: 22px; }
@media (max-width: 860px) {
  .acct-home { flex-wrap: wrap; }
  .acct-home .btn { margin-left: 0; }
}

/* —— polish pass (revert-safe overlay) —— */
:root {
  --shadow: 0 1px 0 rgba(23, 33, 38, 0.04), 0 16px 40px rgba(23, 33, 38, 0.08);
  --shadow-lg: 0 20px 50px rgba(23, 33, 38, 0.14);
}
.app { padding: 22px 28px 88px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  align-items: center;
  margin: -8px -8px 22px;
  padding: 14px 8px 16px;
  background: rgba(242, 239, 230, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.brand-name { font-size: 26px; }
@keyframes ia-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.acct-home,
.hero,
.home-actions,
.map,
.auth-card,
.teach,
.quiz,
.unit-head,
.lesson-list {
  animation: ia-rise 0.48s ease both;
}
.mkt-enter {
  animation: ia-rise 0.48s ease both;
}
.hero { animation-delay: 0.04s; }
.home-actions { animation-delay: 0.08s; }
.map { animation-delay: 0.1s; }
.hero-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--teal);
}
.hero h1 { font-size: 46px; letter-spacing: -0.035em; }
.hero-sub { margin-top: 8px !important; font-size: 15px !important; }
.hero-cta { margin-top: 16px; }
.hero-all-done { margin-top: 12px !important; font-weight: 600; color: var(--teal-deep) !important; }
.hero-market {
  box-shadow: var(--shadow-lg);
}
.hero-market:hover { transform: scale(1.035) translateY(-2px); }
.acct-home {
  background:
    linear-gradient(180deg, rgba(215, 238, 236, 0.55), rgba(255, 253, 248, 0.2)),
    var(--paper);
  border-color: #c9ddd9;
  padding: 16px 18px;
}
.acct-home h2 { font-size: 24px; }
.card {
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  min-height: 188px;
}
a.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--teal);
}
.card-prog {
  height: 5px;
  background: var(--bg-2);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 2px;
}
.card-prog > i {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: 99px;
}
.map { gap: 16px; }
.map-unit-10 { grid-column: auto; }
.lesson-row {
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
a.lesson-row:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--teal);
}
.choice { transition: border-color 0.12s ease, background 0.12s ease, transform 0.08s ease; }
.choice:hover { transform: translateX(2px); }
.mkt-row {
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
a.mkt-row:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--teal);
}
.mkt-chip.open {
  animation: ia-pulse 1.8s ease-in-out infinite;
}
@keyframes ia-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(11, 107, 104, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(11, 107, 104, 0); }
}
.mkt-sheet.mkt-enter {
  animation: ia-rise 0.42s ease both;
}
.auth-wrap { max-width: 480px; }
.auth-card { padding: 28px 26px 24px; }
.auth-form h1 { font-size: 32px; }
.auth-form input { padding: 12px 14px; }
.progress-chip {
  padding: 8px 16px 8px 12px;
}
.topbar-side { gap: 10px; }
.teach, .quiz {
  box-shadow: var(--shadow);
}
.town-strip { height: 190px; margin-top: 48px; }
@media (max-width: 860px) {
  .hero h1 { font-size: 36px; }
  .app { padding: 16px 16px 72px; }
  .topbar { position: static; background: transparent; backdrop-filter: none; }
}

/* closet / tokens / avatar */
.acct-chip { text-decoration: none; color: inherit; }
a.acct-chip:hover { text-decoration: none; border-color: var(--teal); }
.acct-avatar.face {
  width: 36px;
  height: 36px;
  background: #efe6d6;
  overflow: hidden;
  padding: 0;
}
.acct-avatar.face.lg { width: 64px; height: 64px; }
.av-svg { width: 100%; height: 100%; display: block; }
.av-svg.sm { width: 36px; height: 36px; }
.av-svg.md { width: 64px; height: 64px; }
.av-svg.lg { width: 168px; height: 200px; margin: 0 auto; }
.token-chip {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal-deep);
  background: var(--teal-soft);
  border-radius: 999px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tok {
  width: 14px;
  height: 14px;
  display: inline-block;
  vertical-align: -0.16em;
  flex: 0 0 auto;
}
.tok-amt {
  display: inline;
  white-space: nowrap;
}
.tok-amt .tok {
  width: 0.92em;
  height: 0.92em;
  vertical-align: -0.16em;
  margin: 0 0.14em 0 0.04em;
  position: static;
  top: auto;
}
.tok-amt b {
  font-weight: 700;
  font-size: 1em;
  line-height: inherit;
  vertical-align: baseline;
}
.av-wheel-hub .tok {
  width: 22px;
  height: 22px;
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -11px 0 0 -11px;
}
.av-opt small .tok-amt { font-size: 11px; }
#av-modal-text .tok-amt { font-weight: 700; }

.acct-home-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.av-page {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 28px;
  align-items: start;
}
.av-stage {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px 22px;
  text-align: center;
  position: sticky;
  top: 84px;
}
.av-stage h1 {
  font-family: var(--serif);
  font-size: 30px;
  margin: 8px 0 6px;
}
.av-stage > p { margin: 0 0 12px; color: var(--ink-soft); font-size: 14px; }
.av-tokens {
  display: inline-block;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-weight: 700;
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 16px;
}
.av-wheel-wrap { position: relative; padding-top: 4px; }
.av-wheel-pointer {
  display: block;
  width: 28px;
  height: 24px;
  margin: 0 auto -8px;
  position: relative;
  z-index: 4;
  filter: drop-shadow(0 2px 2px rgba(23,33,38,.25));
}
.av-wheel-pointer path { fill: #9f2a22; }
.av-wheel-rim {
  width: 228px;
  height: 228px;
  margin: 0 auto 16px;
  border-radius: 50%;
  padding: 11px;
  background:
    radial-gradient(circle at 28% 22%, #fff3b0, #e6c35c 38%, #b0892e 70%, #7a5b14);
  box-shadow: var(--shadow-lg), inset 0 2px 0 rgba(255,255,255,.4);
  position: relative;
}
.av-wheel {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 50%;
  border: 0;
  box-shadow: inset 0 0 0 3px rgba(23,33,38,.16);
  position: relative;
  overflow: hidden;
  transition: transform 1.2s cubic-bezier(.12,.75,.2,1);
}
.av-wheel-lab {
  position: absolute;
  left: 50%;
  top: 16px;
  transform-origin: 0 92px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.av-wheel-lab b {
  display: inline-block;
  transform: translateX(-50%);
}
.av-wheel-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffdf8, #e6c35c 55%, #b0892e);
  box-shadow: 0 2px 10px rgba(23,33,38,.25), inset 0 2px 0 rgba(255,255,255,.5);
  z-index: 3;
}
.av-wheel-shine {
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: linear-gradient(140deg, rgba(255,255,255,.32), transparent 42%);
  pointer-events: none;
  z-index: 2;
}
.av-spin-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.av-streak {
  display: inline-block;
  margin: 10px 0 0;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 10px;
}
.av-shop h2 {
  margin: 18px 0 8px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.av-shop h2:first-child { margin-top: 0; }
.av-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.av-opt {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 12px;
  padding: 8px 10px;
  min-width: 104px;
  text-align: left;
  cursor: pointer;
  font: inherit;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.av-opt i {
  display: block;
  width: 100%;
  height: 10px;
  border-radius: 99px;
  margin-bottom: 4px;
}
.av-opt span { font-weight: 700; font-size: 13px; }
.av-opt small { color: var(--muted); font-size: 11px; }
.av-opt.on { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-soft); }
.av-opt.locked { opacity: 0.78; }
.av-opt:hover { border-color: var(--teal); }
@media (max-width: 860px) {
  .av-page { grid-template-columns: 1fr; }
  .av-stage { position: static; }
  .acct-home-actions { margin-left: 0; }
}

.av-alert {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bad-soft);
  color: var(--bad);
  font-weight: 700;
  font-size: 16px;
  border: 1px solid #e0aaa4;
}
.av-modal {
  position: fixed;
  inset: 0;
  background: rgba(23, 33, 38, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 20px;
}
.av-modal[hidden] { display: none; }
.av-modal-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 22px 22px 18px;
  max-width: 360px;
  width: 100%;
}
.av-modal-card p {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
}
.av-modal-actions { display: flex; gap: 10px; }

.av-stage.av-enter, .av-shop.av-enter { animation: ia-rise 0.48s ease both; }
.av-shop.av-enter { animation-delay: 0.06s; }
.av-enter .av-stage-face {
  animation: av-pop 0.38s ease;
}
@keyframes av-pop {
  from { transform: scale(0.9); opacity: 0.35; }
  to { transform: none; opacity: 1; }
}
.av-svg.lg { overflow: visible; }
.av-svg.lg .av-bob {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: av-bob 2.6s ease-in-out infinite;
}
.av-svg.lg .av-shadow {
  transform-box: fill-box;
  transform-origin: center;
  animation: av-shadow 2.6s ease-in-out infinite;
}
@keyframes av-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes av-shadow {
  0%, 100% { transform: scaleX(1); opacity: 0.08; }
  50% { transform: scaleX(0.86); opacity: 0.05; }
}
.av-svg.lg .av-blink {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: av-blink 4.4s ease-in-out infinite;
}
@keyframes av-blink {
  0%, 86%, 94%, 100% { transform: scaleY(1); }
  89%, 91% { transform: scaleY(0.08); }
}
.av-opt {
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, opacity 0.14s ease;
}
.av-enter .av-opt {
  animation: ia-rise 0.4s ease both;
}
.av-enter .av-opts .av-opt:nth-child(1) { animation-delay: 0.02s; }
.av-enter .av-opts .av-opt:nth-child(2) { animation-delay: 0.05s; }
.av-enter .av-opts .av-opt:nth-child(3) { animation-delay: 0.08s; }
.av-enter .av-opts .av-opt:nth-child(4) { animation-delay: 0.11s; }
.av-enter .av-opts .av-opt:nth-child(5) { animation-delay: 0.14s; }
.av-enter .av-opts .av-opt:nth-child(6) { animation-delay: 0.17s; }
.av-opt:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow-lg);
}
.av-opt:active { transform: scale(0.96); }
.av-opt.on { transform: translateY(-1px); }
.av-enter .av-tokens { animation: av-pop 0.35s ease; }
.av-alert { animation: ia-rise 0.28s ease both; }
.av-modal { animation: av-fade 0.18s ease; }
.av-modal-card { animation: ia-rise 0.28s ease both; }
@keyframes av-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .av-svg.lg .av-bob,
  .av-svg.lg .av-blink,
  .av-svg.lg .av-shadow,
  .av-stage-face,
  .av-opt,
  .av-stage,
  .av-shop { animation: none; }
}

.av-test {
  margin-top: 28px;
  padding: 16px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  background: #f6f3eb;
}
.av-test p { margin: 0 0 10px; font-size: 13px; color: var(--ink-soft); }
.av-test-btns { display: flex; flex-wrap: wrap; gap: 8px; }

.av-svg.circle { border-radius: 50%; }
.av-stage-face.circle {
  width: 168px;
  height: 168px;
  margin: 0 auto 8px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.av-stage-face.circle .av-svg.lg {
  width: 168px;
  height: 168px;
  margin: 0;
}
.acct-avatar.face {
  border-radius: 50%;
  overflow: hidden;
}
.av-svg.lg .av-icon {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: av-bob 2.6s ease-in-out infinite;
}

.av-modal-preview {
  width: 132px;
  height: 132px;
  margin: 0 auto 10px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.av-modal-preview .av-svg { width: 132px; height: 132px; }
.av-modal-preview.is-name {
  width: auto;
  height: auto;
  max-width: 100%;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  margin: 4px auto 12px;
}
.av-modal-try {
  margin: 0 0 8px !important;
  text-align: center;
  font-size: 11px !important;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  font-weight: 700;
}
.av-modal-card { text-align: center; }
.av-modal-actions { justify-content: center; }

/* —— lesson film (unit 1 lesson 1) —— */
.ia-film {
  margin: 0 0 4px;
}
.ia-film-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #12191c;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(12, 20, 22, 0.32);
}
.ia-film-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 720ms cubic-bezier(0.22, 1, 0.36, 1);
}
.ia-film-layer.is-on {
  z-index: 2;
  opacity: 1;
}
.ia-film-layer svg,
.ia-film-svg {
  display: block;
  width: 100%;
  height: 100%;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}
.ia-film-svg text {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}
.ia-film-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  margin: 0;
  padding: 10px 22px 38px;
  background: linear-gradient(180deg, transparent, rgba(10, 16, 18, 0.55) 38%, rgba(10, 16, 18, 0.9));
  color: #fffdf8;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}
.ia-film-bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 34px;
  z-index: 4;
  height: 3px;
  background: rgba(255, 253, 248, 0.16);
  border-radius: 99px;
  overflow: hidden;
  pointer-events: none;
}
.ia-film-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #0b6b68, #c4a35a);
}
.ia-film-transport {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 0 10px;
  background: rgba(10, 16, 18, 0.72);
}
.ia-film-transport button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fffdf8;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
}
.ia-film-transport button:hover {
  background: rgba(255, 253, 248, 0.12);
}
.ia-film-transport button:disabled {
  opacity: 0.35;
  cursor: default;
}
.ia-film-transport button:disabled:hover {
  background: transparent;
}

.ia-anim-toggle {
  margin-top: 16px;
}
#ia-teach-text[hidden],
#ia-anim[hidden] { display: none; }
#ia-teach-text p { max-width: 42em; }

.ia-film-svg .ia-fade { opacity: 0; }
.ia-film-svg.ia-play .ia-fade {
  animation: ia-film-fade 0.95s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ia-film-svg.ia-static .ia-fade { opacity: 1; animation: none; }
.ia-film-svg.ia-play .ia-d1 { animation-delay: 0.12s; }
.ia-film-svg.ia-play .ia-d2 { animation-delay: 0.28s; }
.ia-film-svg.ia-play .ia-d3 { animation-delay: 0.44s; }
.ia-film-svg.ia-play .ia-d4 { animation-delay: 0.60s; }
.ia-film-svg.ia-play .ia-d5 { animation-delay: 0.76s; }
.ia-film-svg.ia-play .ia-d6 { animation-delay: 0.92s; }
.ia-film-svg.ia-play .ia-d7 { animation-delay: 1.08s; }
.ia-film-svg.ia-play .ia-d8 { animation-delay: 1.24s; }

@keyframes ia-film-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes ia-film-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

.ia-film-svg .ia-pencils,
.ia-film-svg .ia-sign-c,
.ia-film-svg .ia-big,
.ia-film-svg .ia-phase2-set { opacity: 0; }

.ia-film-svg.ia-swap .ia-bikes,
.ia-film-svg.ia-swap .ia-sign-a {
  animation: ia-film-fade-out 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.ia-film-svg.ia-swap .ia-pencils,
.ia-film-svg.ia-swap .ia-sign-c {
  animation: ia-film-fade 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

.ia-film-svg.ia-grown .ia-small {
  animation: ia-film-fade-out 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.ia-film-svg.ia-grown .ia-big {
  animation: ia-film-fade 0.95s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.ia-film-svg.ia-phase2 .ia-phase1 {
  animation: ia-film-fade-out 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.ia-film-svg.ia-phase2 .ia-phase2-set {
  animation: ia-film-fade 0.95s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.ia-film-svg.ia-phase2 .ia-phase2-set.ia-d2 { animation-delay: 0.16s; }

.ia-film.is-paused .ia-film-layer,
.ia-film.is-paused .ia-film-layer * {
  animation-play-state: paused !important;
}

@media (max-width: 860px) {
  .ia-film-caption {
    font-size: 16px;
    padding: 32px 16px 40px;
  }
  .ia-film-transport button {
    padding: 4px 7px;
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ia-film-layer { transition: none; }
  .ia-film-svg.ia-play .ia-fade,
  .ia-film-svg.ia-swap .ia-bikes,
  .ia-film-svg.ia-swap .ia-pencils,
  .ia-film-svg.ia-swap .ia-sign-a,
  .ia-film-svg.ia-swap .ia-sign-c,
  .ia-film-svg.ia-grown .ia-small,
  .ia-film-svg.ia-grown .ia-big,
  .ia-film-svg.ia-phase2 .ia-phase1,
  .ia-film-svg.ia-phase2 .ia-phase2-set {
    animation: ia-film-fade 0.2s ease both !important;
  }
}


/* —— beat player —— */
.ia-beat-wrap { padding-top: 24px; }
.ia-beat {
  animation: ia-rise 0.36s ease both;
}
.ia-beat-recap {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ia-beat-recap span {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-deep);
}
.ia-beat-source {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.ia-beat-text {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 16px;
  max-width: 40em;
}
.ia-beat-prog {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.ia-beat-bar {
  flex: 1;
  height: 5px;
  background: var(--bg-2);
  border-radius: 99px;
  overflow: hidden;
}
.ia-beat-bar > i {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: 99px;
}
.ia-beat .choice {
  appearance: none;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}
.ia-beat .choice:disabled,
.ia-beat .choice:disabled:hover {
  cursor: default;
  transform: none;
}
.ia-choice-mark {
  font-weight: 700;
  color: var(--teal);
  font-size: 13px;
  line-height: 1.4;
}
.ia-beat-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 12px;
}

/* lesson confirm + NOT + selected */
.q-not {
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.choice.selected {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 0 0 1px var(--teal-mid);
}
.choice.selected .ia-choice-mark {
  background: var(--teal);
  color: #fffdf8;
}
.ia-beat-confirm {
  margin-top: 18px;
  display: flex;
  justify-content: flex-start;
}
.ia-beat-confirm[hidden] { display: none; }
.ia-beat-confirm .btn {
  min-width: 8em;
}
.ia-beat .choice.selected:hover {
  transform: none;
}

.ia-beat .q-text { margin: 0; flex: 1; }
.q-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 10px;
}
.ia-q-info-btn {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid var(--teal);
  background: #fffdf8;
  color: var(--teal);
  font-family: var(--serif);
  font-size: 14px;
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.ia-q-info-btn.on,
.ia-q-info-btn[aria-expanded="true"] {
  background: var(--teal);
  color: #fffdf8;
}
.ia-q-info {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--teal);
  background: var(--teal-soft);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.45;
}
.ia-q-info[hidden] { display: none; }
.ia-anim-toggle { margin: 0 0 12px; }
#ia-beat[hidden] { display: none; }

/* crystal leaderboard */
.board-head { margin: 12px 0 18px; }
.board-head h1 {
  font-family: var(--serif);
  font-size: 36px;
  margin: 0 0 6px;
}
.board-head p { margin: 0; color: var(--ink-soft); max-width: 42em; }
.board-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 28px;
}
.board-row {
  display: grid;
  grid-template-columns: 44px 56px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 14px;
}
.board-row.you {
  border-color: var(--teal);
  box-shadow: var(--shadow), 0 0 0 3px var(--teal-soft);
}
.board-row.empty {
  background: transparent;
  box-shadow: none;
  border-style: dashed;
  color: var(--muted);
}
.board-rank {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  background: var(--bg-2);
  color: var(--ink-soft);
}
.board-rank.gold { background: #e6c35c; color: #172126; }
.board-rank.silver { background: #c5cdd4; color: #172126; }
.board-rank.bronze { background: #c47a4a; color: #fffdf8; }
.board-face { width: 48px; height: 48px; display: block; }
.board-face .av-svg { width: 48px; height: 48px; }
.board-who strong { display: block; font-size: 16px; }
.board-who small { color: var(--muted); font-size: 12px; }
.board-pile { font-size: 16px; }
.board-ghost { grid-column: 2 / -1; font-size: 14px; }
@media (max-width: 640px) {
  .board-row { grid-template-columns: 36px 44px 1fr auto; padding: 8px 10px; }
  .board-face, .board-face .av-svg { width: 40px; height: 40px; }
}

.acct-rank {
  margin: 4px 0 8px;
  color: var(--ink-soft);
  font-size: 14px;
}
.acct-rank span {
  display: inline-block;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: 6px;
}
.result.rankup {
  background: var(--teal-soft);
  border-color: var(--teal);
  font-size: 18px;
}
.rankup-sub { margin: 8px 0 0; color: var(--ink-soft); }

.acct-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.acct-name .name-title { margin-left: 10px; }
.acct-chip-text strong { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.board-who strong { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.name-title {
  display: inline-block;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.3;
  vertical-align: middle;
}
.name-title.easy { background: var(--bg-2); color: var(--ink-soft); }
.name-title.mid { background: var(--teal-soft); color: var(--teal-deep); }
.name-title.hard { background: #e6c35c; color: #172126; }
.name-title.donor { background: #b0892e; color: #fffdf8; }
.title-get { margin: 10px 0 0; font-weight: 700; color: var(--teal-deep); }

.av-title-hint { margin: -4px 0 10px; font-size: 13px; color: var(--muted); }
.av-opt .name-title { margin: 0 0 4px; }
.av-opt[data-title] { min-width: 132px; }

.title-name-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 28px;
  padding: 8px 4px 4px;
}
.title-name-preview strong { font-weight: 700; }
.av-opt.locked { cursor: pointer; opacity: 0.85; }


/* clubs */
.club-page { margin: 8px 0 28px; }
.club-head { margin: 0 0 18px; }
.club-head h1 {
  font-family: var(--serif);
  font-size: 36px;
  margin: 8px 0 6px;
}
.club-head p { margin: 0; color: var(--ink-soft); max-width: 42em; }
.club-motto {
  font-family: var(--serif);
  font-size: 18px;
  color: var(--ink-soft);
  font-style: italic;
  margin: 0 0 8px;
}
.club-sec {
  margin: 20px 0 8px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.club-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 18px;
}
.club-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 12px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
}
a.club-card:hover {
  text-decoration: none;
  border-color: var(--teal);
  transform: translateY(-1px);
}
.club-card.invite { border-color: var(--teal); box-shadow: var(--shadow), 0 0 0 3px var(--teal-soft); }
.club-card-who strong { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 16px; }
.club-card-who small { display: block; color: var(--muted); font-size: 12px; }
.club-card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.club-you {
  display: inline-block;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 7px;
  font-weight: 700;
}
.club-empty, .club-owned-note, .club-note {
  background: var(--paper);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 16px;
  color: var(--ink-soft);
  margin: 0 0 16px;
}
.club-note { border-style: solid; font-size: 13px; color: var(--muted); }
.club-form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  margin: 0 0 16px;
}
.club-form h2, .club-panel h2 {
  margin: 0 0 6px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.club-panel h3 {
  margin: 14px 0 8px;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.club-form > p, .club-panel > p { margin: 0 0 12px; color: var(--ink-soft); font-size: 14px; }
.club-form label {
  display: block;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.club-form input, .club-inline input, .club-give input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
.club-form input:focus, .club-inline input:focus, .club-give input:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}
.club-badge {
  width: 80px;
  height: 80px;
  display: inline-grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
}
.club-badge .club-svg,
.club-badge .av-svg { width: 80px; height: 80px; display: block; }
.club-badge.crest-bronze,
.club-badge.crest-silver,
.club-badge.crest-gold { filter: drop-shadow(0 2px 6px rgba(23,33,38,.12)); }
.club-detail {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 28px;
  align-items: start;
}
.club-stage {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 18px 22px;
  text-align: center;
  position: sticky;
  top: 84px;
}
.club-stage .club-badge { width: 132px; height: 132px; margin: 0 auto; }
.club-stage .club-badge .club-svg,
.club-stage .club-badge .av-svg { width: 132px; height: 132px; }
.club-stage h1 {
  font-family: var(--serif);
  font-size: 30px;
  margin: 10px 0 6px;
}
.club-meta { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.club-given { margin: 0 0 14px; color: var(--muted); font-size: 13px; }
.club-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 16px 14px;
  margin: 0 0 14px;
}
.club-inline, .club-give {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.club-inline input { flex: 1 1 160px; width: auto; margin-top: 0; }
.club-give input { width: 96px; flex: 0 0 96px; margin-top: 0; }
.club-upgrade, .club-member {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.club-member { grid-template-columns: 48px 1fr auto; }
.club-upgrade:first-of-type, .club-member:first-of-type { border-top: 0; padding-top: 4px; }
.club-upgrade strong, .club-member strong { display: block; }
.club-upgrade small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.club-max {
  display: inline-block;
  background: var(--bg-2);
  color: var(--muted);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 8px;
}
.club-member { grid-template-columns: 48px 1fr auto; }
.club-member.pending { opacity: 0.78; }
.club-member-face { width: 48px; height: 48px; display: block; }
.club-member-face .av-svg { width: 48px; height: 48px; }
.club-log {
  list-style: none;
  margin: 0;
  padding: 0;
}
.club-log li {
  padding: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
}
.club-log li:first-child { border-top: 0; }
.club-log span { color: var(--muted); font-size: 12px; margin-right: 6px; }
.club-log-empty { color: var(--muted); }
.club-tape p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.club-tape-buy { color: var(--teal); }
.club-tape-sell { color: #b45309; }
@media (max-width: 860px) {
  .club-detail { grid-template-columns: 1fr; }
  .club-stage { position: static; }
  .club-card { grid-template-columns: 64px 1fr; }
  .club-card-actions { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .club-member { grid-template-columns: 40px 1fr auto; }
  .club-member-face, .club-member-face .av-svg { width: 40px; height: 40px; }
  .club-badge { width: 64px; height: 64px; }
  .club-badge .club-svg, .club-badge .av-svg { width: 64px; height: 64px; }
}

.club-head-links { margin: 12px 0 0; }
.club-lvl-chip {
  display: inline-block;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 7px;
  margin-right: 6px;
}
.club-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 8px;
}
.club-stat {
  background: var(--bg-2);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: var(--muted);
}
.club-stat b { color: var(--ink); margin-right: 3px; }
.club-stat.vault {
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-weight: 700;
}
.club-up-n {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--teal-soft);
  color: var(--teal-deep);
}
.club-card {
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.club-stage {
  background:
    radial-gradient(120px 80px at 50% 18%, rgba(11,107,104,.08), transparent 70%),
    var(--paper);
}
a.club-board-row {
  color: inherit;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}
a.club-board-row:hover {
  text-decoration: none;
  border-color: var(--teal);
  transform: translateY(-1px);
}
.board-face .club-badge,
.board-face .club-badge .club-svg,
.board-face .club-badge .av-svg {
  width: 48px;
  height: 48px;
}
.club-board-lvl {
  color: var(--teal-deep);
  font-weight: 800;
  letter-spacing: 0.02em;
}
@media (max-width: 640px) {
  .board-face .club-badge,
  .board-face .club-badge .club-svg,
  .board-face .club-badge .av-svg {
    width: 40px;
    height: 40px;
  }
}


/* multiplayer hub */
.play-head { margin: 8px 0 18px; text-align: center; }
.play-head h1 {
  font-family: var(--serif);
  font-size: 36px;
  margin: 0 0 6px;
  letter-spacing: -0.03em;
}
.play-head p { margin: 0; color: var(--ink-soft); }
.play-boards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
  margin: 0 0 28px;
}
.play-board {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 12px 10px;
  min-width: 0;
}
.play-board h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 2px;
  color: var(--ink);
}
.play-board > p {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}
.play-board-scroll {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}
.play-row {
  display: grid;
  grid-template-columns: 28px 36px 1fr auto;
  gap: 8px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  color: inherit;
  text-decoration: none;
}
a.play-row:hover {
  text-decoration: none;
  border-color: var(--teal);
}
.play-row.you {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px var(--teal-soft);
}
.play-rank {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 11px;
  background: var(--bg-2);
  color: var(--ink-soft);
}
.play-rank.gold { background: #e6c35c; color: #172126; }
.play-rank.silver { background: #c5cdd4; color: #172126; }
.play-rank.bronze { background: #c47a4a; color: #fffdf8; }
.play-face {
  width: 36px;
  height: 36px;
  display: block;
}
.play-face .av-svg { width: 36px; height: 36px; }
.play-face .club-badge,
.play-face .club-badge .club-svg,
.play-face .club-badge .av-svg {
  width: 36px;
  height: 36px;
}
.play-who { min-width: 0; }
.play-who strong {
  display: block;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.play-who small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.play-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--teal-deep);
  white-space: nowrap;
}
.play-score.mkt-up,
.play-score .mkt-up { color: var(--good); }
.play-score.mkt-down,
.play-score .mkt-down { color: var(--bad); }
.play-score.mkt-flat,
.play-score .mkt-flat { color: var(--muted); }
.play-board-note {
  margin: -6px 0 10px;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
}
.club-card-who .mkt-up,
.club-mkt-members .mkt-up,
.club-stat.mkt-up { color: var(--good); }
.club-card-who .mkt-down,
.club-mkt-members .mkt-down,
.club-stat.mkt-down { color: var(--bad); }
.club-stat.mkt-up,
.club-stat.mkt-down { font-weight: 700; }
.club-mkt-members {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
}
.play-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 8px 2px;
}
@media (max-width: 1100px) {
  .play-boards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .play-boards { grid-template-columns: 1fr; }
}


/* club week */
.club-week-days { margin: -6px 0 12px; color: var(--muted); font-size: 12px; }
.club-week-goal { margin: 0 0 8px; }
.club-week-goal a { font-weight: 700; color: var(--teal-deep); }
.club-week-progress {
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--teal-deep);
  font-size: 14px;
}
.club-week-bar {
  height: 8px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 0 12px;
}
.club-week-bar span {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: 999px;
}
.club-week-members {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 10px;
}
.club-week-member {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.club-week-member.club-week-done {
  color: var(--teal-deep);
  font-weight: 600;
}
.club-week-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 11px;
  font-weight: 800;
  flex: 0 0 auto;
}
.club-week-check.empty { background: var(--bg-2); }
.club-week-pay { margin: 0 0 8px; font-size: 13px; color: var(--ink-soft); }
.club-week-pick { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.club-week-pick .club-inline { margin: 0; }
.club-week-pick select,
.club-form select {
  flex: 1 1 180px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}
.club-week-pick select:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

/* —— polish 2: paper academy finish —— */
:root {
  --shadow:
    0 1px 0 rgba(255, 253, 248, 0.85) inset,
    0 1px 0 rgba(23, 33, 38, 0.035),
    0 6px 16px rgba(23, 33, 38, 0.045),
    0 18px 36px rgba(23, 33, 38, 0.05);
  --shadow-lg:
    0 1px 0 rgba(255, 253, 248, 0.7) inset,
    0 10px 24px rgba(23, 33, 38, 0.06),
    0 28px 56px rgba(23, 33, 38, 0.08);
}

body { line-height: 1.45; }

.btn-primary {
  background: var(--teal);
  border-color: var(--teal-deep);
  color: #fffdf8;
  box-shadow:
    0 1px 0 rgba(255, 253, 248, 0.22) inset,
    0 1px 0 rgba(23, 33, 38, 0.04),
    0 8px 18px rgba(8, 72, 68, 0.16);
}
.btn-primary:hover:not([disabled]),
a.btn-primary:hover {
  background: var(--teal-deep);
  color: #fffdf8;
  border-color: #063835;
  text-decoration: none;
}
.btn-ghost {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover:not([disabled]),
a.btn-ghost:hover {
  color: var(--teal-deep);
  background: var(--teal-soft);
  border-color: transparent;
  transform: none;
}
.btn-danger {
  color: var(--bad);
  background: var(--bad-soft);
  border-color: #e2c4c0;
}
.btn-danger:hover:not([disabled]) {
  color: #7a1d18;
  border-color: #c98983;
  background: #f3d6d3;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="search"],
select,
textarea {
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font: inherit;
}
input[type="text"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(11, 107, 104, 0.18);
}

.play-board-scroll {
  scrollbar-width: thin;
  scrollbar-color: #c4bba8 transparent;
}
.play-board-scroll::-webkit-scrollbar { width: 8px; }
.play-board-scroll::-webkit-scrollbar-track { background: transparent; }
.play-board-scroll::-webkit-scrollbar-thumb {
  background: #c4bba8;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* topbar as a real paper header */
.topbar {
  position: sticky;
  top: 10px;
  z-index: 30;
  align-items: center;
  margin: 0 0 26px;
  padding: 10px 12px 10px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.brand-mark {
  border-radius: 10px;
  box-shadow: none;
}
.brand-name { letter-spacing: -0.025em; }
.progress-chip {
  align-items: center;
  background: #f7f3ea;
  border-color: #d8d1c3;
}
.progress-bar {
  height: 7px;
  background: #e8e3d6;
}
.progress-bar > i {
  background: linear-gradient(90deg, var(--teal), var(--teal-mid));
  box-shadow: 0 0 10px rgba(11, 107, 104, 0.45);
}
.acct-chip {
  align-items: center;
  background: #fffdf8;
}
.acct-chip .acct-avatar.face {
  box-shadow: 0 0 0 1.5px #d8d1c3, 0 0 0 3px #fffdf8;
}
.topbar-side { align-items: center; }

/* home */
.acct-home {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(215, 238, 236, 0.42), rgba(255, 253, 248, 0.15) 48%),
    var(--paper);
  border-color: #c9ddd9;
  padding: 16px 18px;
}
.acct-home-well {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fbf7ee, #efe6d6);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 253, 248, 0.9);
  flex: 0 0 auto;
}
.acct-home-well .acct-avatar.face.lg {
  width: 64px;
  height: 64px;
}
.acct-home-copy { min-width: 0; }
.acct-home h2 { font-size: 24px; letter-spacing: -0.02em; }

.keep-going {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 4px;
  width: 100%;
  padding: 20px 24px 18px;
  background: var(--teal);
  border: 1px solid var(--teal-deep);
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: #fffdf8;
  min-width: 0;
  transition: transform 0.08s ease, background-color 0.12s ease, box-shadow 0.12s ease;
  transform-origin: center center;
}
.keep-going:hover {
  text-decoration: none;
  background: var(--teal-deep);
  border-color: var(--teal-deep);
  box-shadow: var(--shadow-lg);
  transform: none;
}
.keep-going:active { transform: scale(0.97); }
.keep-going-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: #d7eeec;
}
.keep-going-arrow {
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
}
.keep-going strong {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #fffdf8;
}
.keep-going-unit {
  font-size: 14px;
  color: rgba(255, 253, 248, 0.78);
}

.hero-market {
  box-shadow: var(--shadow-lg);
}
.hero-market:hover {
  border-color: var(--gold);
  transform: scale(1.035) translateY(-2px);
  box-shadow:
    0 0 0 1px rgba(176, 137, 46, 0.28),
    var(--shadow-lg);
}
.hero-market-label {
  background: linear-gradient(to top, rgba(8, 72, 68, 0.92), rgba(8, 72, 68, 0.0));
}

.card {
  min-height: 192px;
  padding: 18px 18px 15px;
}
.card h3 {
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.card p { line-height: 1.4; }
.card-foot {
  font-size: 12px;
  letter-spacing: 0.02em;
}
.card-prog { height: 4px; }
.card.complete {
  border-color: #d4c08a;
  background:
    linear-gradient(180deg, rgba(244, 232, 200, 0.28), transparent 42%),
    var(--paper);
}
.card.complete::after { border-top-color: var(--gold); }
.check { color: #fffdf8; }
.badge.done {
  background: #f4e8c8;
  color: #7a5b14;
}
.badge.done.completed {
  background: #efe8d6;
  color: #5c5340;
}

/* lessons / beats */
.quiz.ia-beat-wrap {
  padding: 30px 34px 32px;
  border-color: #d4cbb8;
  background:
    linear-gradient(180deg, #fffdf8, #fbf8f0);
  box-shadow: var(--shadow);
}
.ia-beat .q-text {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin: 6px 0 16px;
}
.ia-beat .choice,
.choices .choice {
  grid-template-columns: 32px 1fr;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-radius: 12px;
  background: #fffdf8;
  box-shadow: 0 1px 0 rgba(23, 33, 38, 0.035);
}
.ia-choice-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--teal-soft);
  color: var(--teal-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.choice.correct {
  border-color: var(--good);
  background: var(--good-soft);
  box-shadow: 0 0 0 1px #8fbf9e;
}
.choice.wrong {
  border-color: #c96b64;
  background: var(--bad-soft);
  box-shadow: 0 0 0 1px #e0aaa4;
}
.choice.correct .ia-choice-mark {
  background: var(--good);
  color: #fffdf8;
}
.choice.wrong .ia-choice-mark {
  background: var(--bad);
  color: #fffdf8;
}
.ia-beat-recap span {
  background: #f4e8c8;
  color: #7a5b14;
  border: 1px solid rgba(176, 137, 46, 0.32);
  letter-spacing: 0.1em;
  padding: 3px 9px;
}
.ia-beat-bar > i {
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

/* closet + wheel */
.av-stage {
  background:
    radial-gradient(140px 90px at 50% 16%, rgba(176, 137, 46, 0.12), transparent 68%),
    radial-gradient(120px 80px at 50% 22%, rgba(11, 107, 104, 0.08), transparent 70%),
    var(--paper);
  border-color: #d4c4a0;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 253, 248, 0.85);
}
.av-wheel-rim {
  background:
    radial-gradient(circle at 28% 22%, #fff8d0, #e6c35c 38%, #b0892e 68%, #7a5b14 92%);
  box-shadow:
    var(--shadow-lg),
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    inset 0 -3px 8px rgba(122, 91, 20, 0.25);
}
.av-wheel-shine {
  background:
    linear-gradient(140deg, rgba(255, 255, 248, 0.46), transparent 40%),
    radial-gradient(circle at 72% 78%, rgba(255, 255, 255, 0.16), transparent 42%);
}
.av-wheel-hub {
  box-shadow:
    0 2px 10px rgba(23, 33, 38, 0.25),
    inset 0 2px 0 rgba(255, 255, 255, 0.65),
    0 0 0 2px rgba(122, 91, 20, 0.28);
}
.av-streak {
  background: linear-gradient(180deg, #fff3b0, #e6c35c);
  color: #5a430f;
  border: 1px solid #b0892e;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, var(--shadow);
  letter-spacing: 0.08em;
}
.av-opts {
  background: #f6f3eb;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  gap: 10px;
}
.av-opt {
  background: var(--paper);
  min-width: 108px;
}
.av-opt.on {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px var(--teal-soft), var(--shadow);
}

/* multiplayer boards */
.play-board {
  padding: 14px 14px 12px;
  background:
    linear-gradient(180deg, #fffdf8, #faf6ee);
}
.play-board h2 {
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(176, 137, 46, 0.42);
}
.play-rank.gold {
  background: linear-gradient(160deg, #fff3b0, #e6c35c 55%, #b0892e);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.play-rank.silver {
  background: linear-gradient(160deg, #f4f6f8, #c5cdd4 60%, #9aa4ad);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.play-rank.bronze {
  background: linear-gradient(160deg, #e8b089, #c47a4a 60%, #9a5730);
  box-shadow: inset 0 1px 0 rgba(255, 230, 210, 0.35);
}
.play-row {
  background: #fffdf8;
}
.club-card {
  background:
    linear-gradient(180deg, #fffdf8, #faf6ee);
}
.club-card:hover,
a.club-card:hover {
  box-shadow: var(--shadow-lg);
}

/* club week poster */
.club-panel.club-week {
  padding: 20px 20px 18px;
  background:
    linear-gradient(180deg, rgba(244, 232, 200, 0.38), rgba(255, 253, 248, 0.2) 36%),
    var(--paper);
  border-color: #d4c08a;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 253, 248, 0.8);
}
.club-week-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--gold);
}
.club-panel.club-week h2 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--ink);
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(176, 137, 46, 0.4);
}
.club-week-bar {
  height: 7px;
  background: #ebe4d4;
}
.club-week-bar span {
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

/* club stage plaque */
.club-stage {
  background:
    radial-gradient(140px 90px at 50% 14%, rgba(176, 137, 46, 0.16), transparent 68%),
    linear-gradient(180deg, #fffdf8, #f7f1e4);
  border-color: #d4c4a0;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 253, 248, 0.9);
  padding: 22px 18px 22px;
}
.club-stage h1 {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(176, 137, 46, 0.4);
  display: inline-block;
}
.club-stage .club-motto { margin-top: 8px; }
.club-stat {
  background: #f4efe3;
  border: 1px solid transparent;
}
.club-stat.vault {
  border-color: #c9ddd9;
}
.club-upgrade,
.club-member {
  padding: 12px 6px;
  border-radius: 10px;
}
.club-upgrade + .club-upgrade,
.club-member + .club-member {
  margin-top: 2px;
}

/* market stall / ticket desk */
.mkt-row {
  border-radius: 10px;
  background:
    linear-gradient(180deg, #fffdf8, #fbf8f0);
}
.mkt-row h3 { letter-spacing: -0.025em; }
.mkt-sheet {
  border-radius: 10px;
  border-color: #d4cbb8;
  background:
    linear-gradient(180deg, #fffdf8, #faf6ee);
  box-shadow: var(--shadow);
}
.mkt-sheet h2 {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}
.mkt-sheet-facts div {
  background: #f4efe3;
  border: 1px solid #e6dfd0;
}
.mkt-port > div {
  background:
    linear-gradient(180deg, #fffdf8, #faf6ee);
}

/* auth */
.auth-wrap { max-width: 440px; }
.auth-card {
  padding: 30px 28px 26px;
  background:
    linear-gradient(180deg, #fffdf8, #faf6ee);
  border-color: #d4cbb8;
}
.auth-form h1 {
  font-size: 30px;
  letter-spacing: -0.03em;
}
.auth-form > p {
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.45;
}
.auth-form label { margin-bottom: 14px; }

/* footer town */
.town-strip {
  height: 196px;
  margin-top: 52px;
  border: 1px solid rgba(196, 187, 168, 0.55);
  box-shadow: var(--shadow);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 26%);
  mask-image: linear-gradient(to bottom, transparent, #000 26%);
}
.footer-note {
  letter-spacing: 0.02em;
}

@media (max-width: 860px) {
  .topbar {
    position: static;
    background: var(--paper);
    backdrop-filter: none;
    margin-left: 0;
    margin-right: 0;
    padding-left: 4px;
    padding-right: 4px;
  }
  .app {
    padding: 18px 22px 72px;
    padding-left: max(22px, env(safe-area-inset-left, 0px));
    padding-right: max(22px, env(safe-area-inset-right, 0px));
  }
  .hero:has(.hero-market),
  .hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
    grid-template-columns: 1fr;
  }
  .hero-copy { width: 100%; }
  .hero-market { max-width: none; width: 100%; }
  .hero h1 { font-size: 30px; }
  .keep-going {
    min-width: 0;
    width: 100%;
    padding: 18px 18px 16px;
  }
  .keep-going strong { font-size: 20px; }
  .quiz.ia-beat-wrap { padding: 20px 18px 22px; }
  .ia-beat .q-text { font-size: 19px; }
  .acct-home-well { width: 72px; height: 72px; }
  .club-panel.club-week { padding: 16px; }
}

@media (max-width: 640px) {
  .play-boards { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .app {
    padding: 16px 20px 64px;
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
  }
  .hero h1 { font-size: 28px; }
  .hero-copy { padding: 0 2px; }
}


/* nits: crystal align, streak spacing, unclip logo */

.av-wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.av-wheel-wrap > .btn {
  margin-top: 2px;
}
.av-streak {
  display: block;
  margin: 16px 0 0;
}
.av-spin-note { margin-top: 8px; }

.topbar { overflow: visible; }
.brand {
  flex: 0 0 auto;
  overflow: visible;
  min-width: max-content;
}
.brand-mark-wrap {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
  box-shadow: 0 1px 0 rgba(23, 33, 38, 0.08);
}
.brand-mark {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transform: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
}
.brand-text {
  flex-shrink: 0;
  overflow: visible;
}
.brand-name, .brand-kicker { white-space: nowrap; }


/* Fredoka on display text */
.brand-name,
.brand-kicker,
.hero h1,
.hero-market-title,
.hero-market-kicker,
.play-head h1,
.play-board h2,
.club-head h1,
.club-panel h2,
.club-sec,
.av-page h1,
.av-wheel-lab,
.tok-amt b,
.mkt-price strong,
.btn,
.btn-primary,
.unit-card h2,
.lesson-card h1,
.beat-q,
h1, h2 {
  font-family: var(--fredoka);
}


.ia-float {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  left: 50%;
  transform: translate(-50%, 0);
  font-family: "Fredoka", var(--fredoka), sans-serif;
  font-weight: 700;
  font-size: 42px;
  line-height: 1;
  letter-spacing: 0.02em;
  -webkit-text-stroke: 2px #111;
  paint-order: stroke fill;
  text-shadow:
    1px 0 0 #111,
    -1px 0 0 #111,
    0 1px 0 #111,
    0 -1px 0 #111;
  animation: ia-float-up 0.95s linear forwards;
}
.ia-float-buy { color: var(--good); }
.ia-float-sell { color: var(--bad); }
@keyframes ia-float-up {
  from { opacity: 1; transform: translate(-50%, 0); }
  to { opacity: 0; transform: translate(-50%, -160px); }
}


/* town paper */
.paper {
  background: #fffdf8;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 28px 28px 36px;
  margin: 8px 0 28px;
}
.paper-enter { animation: ia-rise 0.48s ease both; }
.paper-mast {
  text-align: center;
  border-bottom: 3px double var(--ink);
  padding-bottom: 14px;
  margin-bottom: 22px;
}
.paper-mast > p {
  margin: 0 0 4px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}
.paper-mast h1 {
  font-family: var(--fredoka), var(--serif);
  font-size: 48px;
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  line-height: 1;
}
.paper-mast-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.paper-editorial {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  margin: 0 0 28px;
  padding-bottom: 8px;
}
.paper-editorial p { margin: 0 0 14px; }
.paper-sec {
  font-family: var(--fredoka);
  font-size: 16px;
  margin: 28px 0 12px;
  letter-spacing: 0.04em;
}
.paper-hold {
  background: var(--teal-soft);
  color: var(--teal-deep);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}
.paper-lead { margin-bottom: 8px; }
.paper-lead h2 {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.15;
  margin: 0 0 12px;
}
.paper-story p {
  margin: 0 0 13px;
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.58;
}
.paper-lead .paper-story p:first-of-type {
  font-size: 18px;
  color: var(--ink);
}
.paper-meta { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.paper-kicker { font-size: 12px; font-weight: 700; color: var(--teal); letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 6px; }
.paper-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 32px;
  margin-top: 8px;
  padding-top: 8px;
}
.paper-cols .paper-story h2 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 0 0 10px;
}
.paper-briefs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 28px;
  padding-top: 4px;
}
.paper-brief h3 {
  font-family: var(--serif);
  font-size: 17px;
  margin: 0 0 6px;
}
.paper-brief p {
  margin: 0;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.paper-notes {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 3px double var(--ink);
}
.paper-notes h3 {
  font-family: var(--fredoka);
  font-size: 16px;
  margin: 0 0 10px;
}
.paper-notes p {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
.paper-empty { text-align: left; max-width: 40em; margin: 0 auto; padding: 24px 8px 8px; color: var(--ink-soft); font-family: var(--serif); line-height: 1.55; }
.paper-foot { margin: 28px 0 0; font-size: 12px; color: var(--muted); text-align: center; }

.paper-deck {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
  margin: 0 0 6px !important;
  font-style: italic;
}
.paper-by {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 14px !important;
  font-family: var(--sans, inherit);
}
.paper-index {
  border: 1px solid var(--line);
  padding: 10px 14px 8px;
  margin: 0 0 22px;
}
.paper-index > p {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}
.paper-index ul { margin: 0; padding: 0; list-style: none; }
.paper-index li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 14px;
}
.paper-index li span { color: var(--muted); white-space: nowrap; }
@media (max-width: 700px) {
  .paper-mast h1 { font-size: 36px; }
  .paper-mast-bar { flex-direction: column; }
  .paper-cols { grid-template-columns: 1fr; }
  .paper-briefs { grid-template-columns: 1fr; }
  .paper-lead h2 { font-size: 28px; }
}


/* lesson clip — town paper scrap, not a game popup */
.ia-clip {
  background: var(--paper);
  border: 1px solid var(--line-strong);
  padding: 14px 16px 16px;
  margin: 0 0 16px;
  box-shadow: var(--shadow);
}
.ia-clip.live {
  border-left: 3px solid var(--teal);
}
.ia-clip-kicker {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 6px;
}
.ia-clip-shop {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 4px;
}
.ia-clip h3 {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.02em;
}

.ia-beat-confirm { gap: 10px; align-items: center; }
.ia-skip-test {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
  font-size: 13px;
}
.ia-skip-test:hover { color: var(--ink-soft); }

.rank-track {
  margin: 18px auto 0;
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper, #fffdf8);
  max-width: 34em;
  text-align: center;
}
.rank-badge-row {
  display: flex;
  justify-content: center;
  margin: 4px 0 12px;
}
.rank-badge {
  text-align: center;
}
.rank-badge.on { opacity: 1; }
.rank-badge-svg {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 6px;
}
.rank-badge span {
  display: block;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--ink);
  font-weight: 700;
  font-family: var(--fredoka), var(--serif);
}
.rank-track-kicker {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--teal);
}
.rank-track p { margin: 0 0 8px; color: var(--ink); }
.rank-track-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  max-width: 22em;
  margin: 0 auto;
}
.rank-track-bar i {
  display: block;
  height: 100%;
  background: var(--teal);
  border-radius: 999px;
}
.rank-track-count {
  margin: 8px 0 0 !important;
  font-size: 12px;
  color: var(--muted) !important;
}

@keyframes av-rim-land {
  0% { transform: scale(1); }
  28% { transform: scale(1.055); filter: brightness(1.12); }
  62% { transform: scale(0.985); }
  100% { transform: scale(1); filter: none; }
}
@keyframes av-pointer-land {
  0% { transform: translateY(0); }
  25% { transform: translateY(4px); }
  100% { transform: translateY(0); }
}
@keyframes av-hub-land {
  0% { transform: scale(1); }
  30% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.av-wheel-rim.land {
  animation: av-rim-land 0.42s ease;
}
.av-wheel-pointer.land {
  animation: av-pointer-land 0.32s ease;
}
.av-wheel-hub.land {
  animation: av-hub-land 0.38s ease;
}
.av-wheel-rim.land::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid rgba(230, 195, 92, 0.7);
  pointer-events: none;
  animation: av-land-ring 0.45s ease forwards;
}
@keyframes av-land-ring {
  0% { opacity: 0.9; transform: scale(0.94); }
  100% { opacity: 0; transform: scale(1.22); }
}
.av-wheel-burst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 8;
}
.av-spark {
  position: absolute;
  left: 0;
  top: 0;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 2px;
  background: #e6c35c;
  box-shadow: 0 0 0 1px rgba(23,33,38,.16);
  animation: av-spark 0.72s ease-out forwards;
}
.av-spark.teal { background: #0b6b68; }
.av-spark.ice { background: #9ad4e6; }
.av-spark.rose { background: #c45b7a; }
.av-spark.gold { background: #e6c35c; }
@keyframes av-spark {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.25); opacity: 0; }
}
.av-prize-pop {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translateX(-50%);
  font-family: Fredoka, "IBM Plex Sans", sans-serif;
  font-weight: 700;
  font-size: 34px;
  letter-spacing: -0.03em;
  color: #0b6b68;
  -webkit-text-stroke: 4px #172126;
  paint-order: stroke fill;
  pointer-events: none;
  z-index: 9;
  white-space: nowrap;
  animation: av-prize-pop 0.88s ease-out forwards;
}
@keyframes av-prize-pop {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(0.72); }
  16% { opacity: 1; transform: translate(-50%, -2px) scale(1.1); }
  68% { opacity: 1; transform: translate(-50%, -30px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -48px) scale(0.96); }
}

.ia-sound {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.ia-sound-btns {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.ia-music {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  color: var(--teal-deep);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.ia-music svg { width: 22px; height: 22px; display: block; }
.ia-music.muted { color: var(--muted); }
.ia-music:hover { border-color: var(--teal-mid); }
.ia-music:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.ia-sound-menu {
  width: 210px;
  padding: 12px 14px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
}
.ia-sound-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-deep);
}
.ia-sound-row:last-child { margin-bottom: 2px; }
.ia-sound-row input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #d7eeec;
  outline: none;
}
.ia-sound-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0b6b68;
  border: 2px solid #fffdf8;
  box-shadow: 0 1px 3px rgba(23,33,38,.25);
  cursor: pointer;
}
.ia-sound-row input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0b6b68;
  border: 2px solid #fffdf8;
  box-shadow: 0 1px 3px rgba(23,33,38,.25);
  cursor: pointer;
}

.ia-feedback-modal {
  position: fixed;
  inset: 0;
  background: rgba(23, 33, 38, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  padding: 20px;
}
.ia-feedback-modal[hidden] { display: none; }
.ia-feedback-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 22px 22px 18px;
  max-width: 400px;
  width: 100%;
}
.ia-feedback-card h2 {
  margin: 0 0 6px;
  font-size: 22px;
  color: var(--teal-deep);
}
.ia-feedback-lead {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.45;
}
.ia-feedback-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-deep);
}
.ia-feedback-opt {
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
  font-size: 12px;
}
.ia-feedback-field textarea,
.ia-feedback-field input {
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fffdf8;
  resize: vertical;
  min-height: 44px;
}
.ia-feedback-field textarea:focus,
.ia-feedback-field input:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal-mid);
}
.ia-feedback-status {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}
.ia-feedback-status.is-ok { color: var(--teal-deep); }
.ia-feedback-status.is-err { color: #b33a2e; }
.ia-feedback-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 4px;
}

.auth-kinds {
  border: 0;
  margin: 0 0 16px;
  padding: 0;
}
.auth-kinds legend {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.auth-kind {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 8px !important;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  cursor: pointer;
  font-weight: 400 !important;
}
.auth-kind:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
}
.auth-kind input { position: absolute; opacity: 0; pointer-events: none; }
.auth-kind strong { font-size: 15px; color: var(--ink); }
.auth-kind span { font-size: 13px; font-weight: 400; color: var(--muted); }
.auth-hint { margin: 4px 0 12px; font-size: 13px; color: var(--muted); }
.class-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  margin: 0 0 16px;
}
.class-card h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 22px; }
.class-card h3 { margin: 16px 0 8px; font-size: 15px; }
.class-card p { margin: 0; color: var(--muted); font-size: 14px; }
.class-card-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.class-code {
  font-family: var(--sans);
  font-size: 28px !important;
  font-weight: 700 !important;
  letter-spacing: 0.18em;
  color: var(--teal-deep) !important;
  margin: 4px 0 8px !important;
}
.class-lock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  white-space: nowrap;
}
.class-list { display: flex; flex-direction: column; gap: 8px; }
.class-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 12px;
}
.class-row small { display: block; color: var(--muted); font-size: 13px; }
.class-empty { color: var(--muted); }
.class-join label { display: block; margin: 10px 0; font-size: 13px; font-weight: 600; }
.class-join input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: inherit;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.mkt-locked {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  max-width: 520px;
}
.mkt-locked h1 { margin: 0 0 8px; font-family: var(--serif); }
.mkt-locked p { margin: 0; color: var(--muted); }
@media (max-width: 860px) {
  .class-card-head { flex-direction: column; }
}

.class-card-wide { padding: 22px 22px 20px; }
.class-hero { margin-bottom: 18px; }
.class-card-wide .class-code { font-size: 36px !important; letter-spacing: 0.2em; }
.class-invite {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin: 12px 0 0;
  flex-wrap: wrap;
}
.class-invite input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  background: var(--bg);
  color: var(--ink);
}
.class-invite .btn { white-space: nowrap; }
.auth-join input[readonly],
#auth-join input[readonly] {
  background: var(--bg);
  color: var(--ink-soft);
}
.class-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 18px;
}
.class-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
}
.class-toggle input { width: 18px; height: 18px; }
.class-units {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-weight: 600;
  font-size: 16px;
}
.class-units select {
  font: inherit;
  font-weight: 500;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
}
.av-name {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: 10px 0 12px;
}
.av-name label {
  flex: 1;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.av-name input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: inherit;
}
@media (max-width: 860px) {
  .class-controls { grid-template-columns: 1fr; }
  .av-name { flex-direction: column; align-items: stretch; }
}

.prof-page { max-width: 1020px; }
.prof-page > h1 {
  margin: 10px 0 16px;
  font-family: var(--serif);
  font-size: 34px;
}
.prof-look {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 18px;
}
.prof-look strong { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 22px; }
.prof-look .name-title { margin-left: 2px; }
.prof-look small { display: block; color: var(--muted); margin-top: 2px; }
.prof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 20px;
}
.prof-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}
.prof-item span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.prof-item strong { font-size: 16px; }
.prof-show {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin: 0 0 16px;
}
.prof-show h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 22px; }
.prof-show > p { margin: 0 0 12px; color: var(--muted); }
.prof-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 8px;
}
.class-card-student { padding: 22px 22px 20px; }
.class-card-student h2 { font-size: 28px; }
.class-card-student .class-people { margin: 14px 0 16px; }
.class-people {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.class-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 14px;
}
.class-person.you { border: 1px solid var(--teal); background: var(--teal-soft); }
.class-person strong { display: block; }
.class-person small { display: block; color: var(--muted); }
@media (max-width: 860px) {
  .prof-grid { grid-template-columns: 1fr; }
}

.class-add { margin: 0 0 18px; }
.class-add h3 { margin: 0 0 4px; }
.class-add-lead { margin: 0 0 12px !important; }
.class-add-ways {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: addway;
  display: grid;
  gap: 12px;
}
.class-add-ways > li {
  counter-increment: addway;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px 16px;
}
.class-add-ways > li h4 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
}
.class-add-ways > li h4::before {
  content: counter(addway) ". ";
  color: var(--teal);
}
.class-add-ways > li p { margin: 0; }
.class-invite-email {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-top: 10px;
}
.class-invite-email label {
  flex: 1 1 220px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}
.class-invite-email input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  letter-spacing: 0;
  text-transform: none;
}
.class-invite-email .btn { white-space: nowrap; }
.class-invite-email .btn:disabled { opacity: 0.6; cursor: wait; }
.class-invite-msg { margin: 8px 0 0 !important; font-size: 13px !important; }
.class-invite-msg.ok { color: var(--good) !important; }
.class-invite-msg.err { color: var(--bad) !important; }
.class-invite-msg.hint { color: var(--muted) !important; }

.class-card h1 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 28px;
}
.class-settings-link { margin: 14px 0 0 !important; }
.class-settings-block { margin: 18px 0 0; }
.class-settings-block h3 { margin: 0 0 8px; font-size: 15px; }
.class-settings-block > p { margin: 0 0 10px !important; }
.class-units-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.class-unit-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 0;
}
.class-unit-list .class-toggle {
  margin: 0;
  font-size: 15px;
  padding: 12px 14px;
}
.class-toggle.is-off { opacity: 0.45; pointer-events: none; }
.class-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.class-unlock-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 0;
}
.class-unlock {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-weight: 600;
  font-size: 16px;
}
.class-unlock select {
  font: inherit;
  font-weight: 500;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
}
.class-rec { margin: 10px 0 0; }
#class-student .class-settings-block > .class-toggle { margin-top: 8px; }
@media (max-width: 860px) {
  .class-unit-list,
  .class-unlock-list { grid-template-columns: 1fr; }
  .class-row { flex-wrap: wrap; }
}


body.handout-mode {
  background: #fff;
  background-image: none;
}
body.handout-mode .app {
  max-width: 8.5in;
  padding: 24px 28px 40px;
}
.handout {
  background: #fff;
  color: #172126;
  max-width: 7.5in;
  margin: 0 auto;
}
.handout-actions {
  display: flex;
  gap: 8px;
  margin: 0 0 22px;
}
.handout-brand {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #084844;
}
.handout-kicker {
  margin: 0 0 20px;
  color: #3d4a51;
  font-size: 16px;
}
.handout h1 {
  font-family: var(--serif);
  font-size: 22px;
  margin: 0 0 8px;
}
.handout-code {
  font-size: 52px;
  font-weight: 700;
  letter-spacing: 0.22em;
  margin: 8px 0 22px;
  text-align: center;
  font-family: var(--sans);
}
.handout-steps {
  font-size: 17px;
  line-height: 1.55;
  padding-left: 1.3em;
  margin: 0 0 8px;
}
.handout-steps li { margin: 0 0 10px; }
.handout-link-label {
  font-weight: 700;
  margin: 18px 0 6px;
  font-size: 15px;
}
.handout-link {
  font-size: 16px;
  word-break: break-all;
  font-family: var(--sans);
  border: 1px solid #c4bba8;
  padding: 12px 14px;
  border-radius: 8px;
  margin: 0;
  background: #fffdf8;
}
.handout-note {
  margin: 22px 0 0;
  font-size: 14px;
  color: #3d4a51;
}

@media print {
  html, body {
    background: #fff !important;
    background-image: none !important;
    color: #111;
  }
  body.handout-mode .app {
    max-width: none;
    padding: 0;
    margin: 0;
  }
  .handout-actions,
  .no-print { display: none !important; }
  .handout {
    max-width: none;
    box-shadow: none;
  }
  .handout-brand { font-size: 26px; }
  .handout-code { font-size: 44px; margin: 6px 0 16px; }
  .handout-steps { font-size: 16px; }
  .handout-link { background: none; }
  @page { size: letter; margin: 0.55in; }
}


/* Insights (guide-only) */
.insights-page .page-head { margin-bottom: 18px; }
.insights-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 14px;
  margin: 0 0 16px;
}
.insights-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--teal-deep);
}
.insights-lead,
.insights-loading,
.insights-empty {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.insights-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px;
}
.insights-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px;
}
.insights-table th,
.insights-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 8px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}
.insights-table th {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal-deep);
  background: rgba(11, 107, 104, 0.06);
}
.insights-table td small,
.insights-table tfoot td small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  margin-top: 2px;
}
.insights-table tfoot td {
  background: rgba(11, 107, 104, 0.04);
}
.insights-feedback-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.insights-feedback-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  padding: 12px 14px;
}
.insights-feedback-item p { margin: 0; line-height: 1.45; }
.insights-feedback-meta {
  margin: 0 0 6px !important;
  font-size: 12px;
  color: var(--muted);
}
.insights-feedback-meta strong { color: var(--teal-deep); }
.class-settings-link .btn { margin: 0 8px 8px 0; }


.insights-top {
  background: var(--teal-soft);
  font-weight: 700;
  color: var(--teal-deep);
}
