:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #152033;
  --muted: #647084;
  --line: #dce4ef;
  --teal: #0e8a80;
  --teal-dark: #0f5f59;
  --blue: #2f6fed;
  --indigo: #6257d9;
  --violet: #8b5cf6;
  --rose: #e0527d;
  --orange: #f28c38;
  --red: #b42318;
  --green: #147d3f;
  --amber: #9a6700;
  --shadow: 0 20px 50px rgba(26, 39, 68, 0.12);
  --soft-shadow: 0 10px 30px rgba(26, 39, 68, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(47, 111, 237, 0.16), transparent 32rem),
    linear-gradient(145deg, #f8fbff 0%, #eef7f6 48%, #fff8f2 100%);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button,
select {
  font: inherit;
}

img,
video,
canvas,
svg {
  max-width: 100%;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

h1,
h2,
h3,
p,
li,
button,
label,
summary,
.badge,
.chip,
.question-list-main,
.question-head,
.answer,
.coach-output,
.guide-card,
.local-guide-item,
.plan-activity,
.lecture-card,
.note-card {
  overflow-wrap: anywhere;
}

.main-panel,
.page-section,
.question-card,
.coach-panel,
.home-panel,
.launch-panel,
.answer,
.question-list-item,
.browser-controls {
  min-width: 0;
}

button,
[role="button"],
.plan-activity,
.launch-card,
.pet-shop-card,
.owned-pet-card,
.badge-card,
.answer {
  position: relative;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease, filter .16s ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.plan-activity:focus-visible,
.answer:focus-within {
  outline: 3px solid rgba(20, 184, 166, .42);
  outline-offset: 3px;
}

button:active,
.pet-shop-card:active,
.owned-pet-card:active,
.plan-activity:active,
.answer:active {
  transform: scale(.985);
}

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid rgba(220, 228, 239, 0.88);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: white;
  font-weight: 800;
  border-radius: 8px;
  letter-spacing: 0;
  box-shadow: 0 12px 30px rgba(14, 138, 128, 0.28);
}

.brand h1 {
  font-size: 20px;
  line-height: 1.1;
  margin: 0;
}

.brand p,
.source-note p {
  color: var(--muted);
  margin: 4px 0 0;
  line-height: 1.45;
  font-size: 13px;
}

.side-nav {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: rgba(248, 251, 253, 0.82);
}

.nav-group-label {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 8px 6px 0;
}

.side-nav a {
  color: #1f2937;
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  display: grid;
  gap: 2px;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.side-nav a small {
  color: #667085;
  font-size: 11px;
  font-weight: 400;
}

.side-nav a:hover {
  background: #e7f6f4;
  color: var(--teal-dark);
  transform: translateX(2px);
}

.side-nav a.active {
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(47, 111, 237, 0.18);
}

.side-nav a.active small {
  color: #d9f2ee;
}

.score-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.score-card > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #f5fafb);
}

.eyebrow {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 5px;
}

.score-card strong {
  font-size: 22px;
}

.field-label {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: -10px;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  background: white;
}

.mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.mode-button {
  border: 0;
  background: white;
  padding: 10px;
  cursor: pointer;
}

.mode-button.active {
  background: #e6f4f1;
  color: var(--teal-dark);
  font-weight: 700;
}

.category-toggle-bar {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(220, 228, 239, 0.95);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
  padding: 10px;
}

.category-toggle-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin-right: 4px;
  text-transform: uppercase;
}

.category-toggle-bar button {
  background: #f8fafc;
  border: 1px solid rgba(220, 228, 239, 0.95);
  border-radius: 8px;
  color: #344054;
  cursor: pointer;
  font-weight: 800;
  padding: 9px 12px;
}

.category-toggle-bar button.active {
  background: linear-gradient(135deg, #0e8a80, #2f6fed);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(47, 111, 237, 0.18);
}

.subcategory-toggle-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -8px 0 8px;
}

.subcategory-toggle-bar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.subcategory-toggle-bar em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  font-weight: 700;
}

.subcategory-toggle-bar button {
  background: #ffffff;
  border: 1px solid rgba(220, 228, 239, 0.95);
  border-radius: 999px;
  color: #344054;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 7px 10px;
}

.subcategory-toggle-bar button.active {
  background: #ecfdf5;
  border-color: #82c7bf;
  color: var(--teal-dark);
}

.category-status {
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(130, 199, 191, 0.95);
  border-radius: 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 18px;
  padding: 9px 12px;
}

.actions {
  display: grid;
}

.test-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.test-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: #344054;
  font-size: 13px;
  line-height: 1.4;
  padding: 10px;
}

.attempt-history {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 8px;
  color: var(--muted);
  font-size: 13px;
}

.attempt-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 9px;
  color: #26313f;
  display: grid;
  gap: 4px;
}

.attempt-detail {
  padding: 0;
}

.attempt-detail summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 11px 12px;
}

.attempt-detail summary span {
  display: grid;
  gap: 3px;
}

.attempt-detail summary b {
  background: #ecfdf5;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  color: #0f766e;
  padding: 5px 8px;
  white-space: nowrap;
}

.attempt-meta {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
}

.attempt-question-list {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding: 10px;
}

.attempt-question {
  border: 1px solid var(--line);
  border-left: 4px solid #94a3b8;
  border-radius: 8px;
  display: grid;
  gap: 9px;
  padding: 10px;
}

.attempt-question.correct {
  border-left-color: #16a34a;
}

.attempt-question.missed {
  border-left-color: #dc2626;
  background: #fff7f7;
}

.attempt-question p {
  margin: 4px 0 0;
}

.attempt-answer-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.attempt-answer-grid span {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #334155;
  display: grid;
  gap: 4px;
  padding: 8px;
}

.attempt-answer-grid b {
  color: #111827;
}

.attempt-question-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attempt-item strong {
  color: #111827;
}

.attempt-item span,
.attempt-item small {
  color: var(--muted);
}

.main-history {
  max-height: none;
}

.source-note {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  font-size: 13px;
}

.main-panel {
  padding: clamp(16px, 2.2vw, 28px);
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
}

.top-switcher {
  align-items: center;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(220, 228, 239, 0.9);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  padding: 6px;
  position: sticky;
  top: 12px;
  z-index: 30;
  backdrop-filter: blur(14px);
}

.top-switcher a {
  border-radius: 7px;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 12px;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.top-switcher a:hover {
  background: #e7f6f4;
  color: var(--teal-dark);
}

.top-switcher a.active {
  background: #111827;
  color: white;
}

body.test-view .app-shell {
  grid-template-columns: 1fr;
}

body:not(.test-view) .page-section {
  display: none;
}

body[data-page="dashboard"]:not(.test-view) .page-section[data-page="dashboard"],
body[data-page="tests"]:not(.test-view) .page-section[data-page="tests"],
body[data-page="practice"]:not(.test-view) .page-section[data-page="practice"],
body[data-page="games"]:not(.test-view) .page-section[data-page="games"],
body[data-page="review-queue"]:not(.test-view) .page-section[data-page="review-queue"],
body[data-page="mastery"]:not(.test-view) .page-section[data-page="mastery"],
body[data-page="weekly-recap"]:not(.test-view) .page-section[data-page="weekly-recap"],
body[data-page="guides"]:not(.test-view) .page-section[data-page="guides"],
body[data-page="plan"]:not(.test-view) .page-section[data-page="plan"],
body[data-page="practice-blocks"]:not(.test-view) .page-section[data-page="practice-blocks"],
body[data-page="pre-exam"]:not(.test-view) .page-section[data-page="pre-exam"],
body[data-page="explanations"]:not(.test-view) .page-section[data-page="explanations"],
body[data-page="lectures"]:not(.test-view) .page-section[data-page="lectures"],
body[data-page="notes"]:not(.test-view) .page-section[data-page="notes"],
body[data-page="results"]:not(.test-view) .page-section[data-page="results"],
body[data-page="tutor"]:not(.test-view) .page-section[data-page="tutor"] {
  display: block;
}

body[data-page="dashboard"]:not(.test-view) .dashboard.page-section {
  display: grid;
}

body.test-view .sidebar,
body.test-view .top-switcher,
body.test-view .home-panel,
body.test-view .launch-panel,
body.test-view .dashboard,
body.test-view .coach-panel {
  display: none;
}

body.test-view .main-panel {
  max-width: 1040px;
  margin: 0 auto;
}

.test-view-bar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
  margin-bottom: 12px;
  display: grid;
  grid-template-columns: auto minmax(150px, 190px) minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  position: sticky;
  top: 12px;
  z-index: 20;
  box-shadow: 0 12px 28px rgba(21, 28, 38, 0.1);
}

.test-view-status {
  font-weight: 700;
  color: #243244;
  line-height: 1.35;
}

.timer-card {
  border: 2px solid #82c7bf;
  background: #e6f4f1;
  border-radius: 8px;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
  text-align: center;
}

.timer-card span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.timer-card strong {
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1;
  color: #0f172a;
}

.timer-card.warning {
  border-color: #d39b1f;
  background: #fff7df;
}

.timer-card.warning span {
  color: #7a4f00;
}

.timer-card.danger {
  border-color: #d92d20;
  background: #fff1f0;
}

.timer-card.danger span,
.timer-card.danger strong {
  color: #9b1c13;
}

.timer-card.paused {
  border-color: #98a2b3;
  background: #f2f4f7;
}

.home-panel,
.launch-panel {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(220, 228, 239, 0.9);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  padding: 22px;
  margin-bottom: 18px;
}

.home-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.home-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 7px;
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--orange), var(--rose));
}

.home-panel h2,
.section-heading h2 {
  margin: 4px 0 8px;
  font-size: 28px;
  line-height: 1.2;
}

.home-panel p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

.home-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.home-stats > div {
  border: 1px solid rgba(220, 228, 239, 0.9);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  box-shadow: 0 8px 20px rgba(26, 39, 68, 0.06);
}

.home-stats strong {
  font-size: 22px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 14px;
  background: linear-gradient(90deg, rgba(14, 138, 128, 0.08), rgba(47, 111, 237, 0.06));
  border: 1px solid rgba(220, 228, 239, 0.85);
  border-radius: 8px;
  padding: 16px;
}

.launch-group + .launch-group {
  margin-top: 20px;
}

.practice-path-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 18px;
}

.practice-path-card {
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  border: 1px solid rgba(220, 228, 239, 0.95);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 6px;
  min-height: 150px;
  padding: 15px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.practice-path-card:hover {
  border-color: #82c7bf;
  box-shadow: 0 18px 36px rgba(47, 111, 237, 0.13);
  transform: translateY(-2px);
}

.practice-path-card span {
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.practice-path-card strong {
  font-size: 18px;
  line-height: 1.15;
}

.practice-path-card small {
  color: var(--muted);
  line-height: 1.4;
}

.custom-drill-builder {
  border: 1px solid rgba(220, 228, 239, 0.9);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 253, 250, 0.92));
  box-shadow: var(--soft-shadow);
  padding: 16px;
  margin-bottom: 20px;
}

.domain-launcher {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.domain-launcher article {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(220, 228, 239, 0.95);
  border-top: 5px solid var(--blue);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 8px;
  padding: 14px;
}

.domain-launcher article:nth-child(2) {
  border-top-color: var(--teal);
}

.domain-launcher article:nth-child(3) {
  border-top-color: var(--orange);
}

.domain-launcher h3,
.domain-launcher p {
  margin: 0;
}

.domain-launcher p {
  color: var(--muted);
  line-height: 1.45;
}

.category-group {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(220, 228, 239, 0.9);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
}

.category-group-head {
  align-items: center;
  border-bottom: 1px solid rgba(220, 228, 239, 0.9);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
}

.category-group-head h3 {
  margin: 0;
}

.category-subgroup h4 {
  color: #334155;
  margin: 8px 0 10px;
}

.category-group-list,
.notes-list.grouped {
  display: grid;
  gap: 10px;
}

.category-group.collapsed .category-group-list,
.category-group.collapsed .category-subgroup,
.mastery-domain.collapsed .mastery-subgroup {
  display: none;
}

.category-path {
  color: var(--teal-dark);
  font-weight: 800;
}

.builder-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.builder-header h3 {
  margin: 3px 0 0;
}

.builder-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.builder-grid label,
.builder-grid fieldset {
  border: 1px solid rgba(220, 228, 239, 0.95);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.82);
  margin: 0;
}

.builder-grid label span,
.builder-grid legend {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
  padding: 0;
}

.builder-grid fieldset label {
  border: 0;
  padding: 0;
  display: block;
  font-size: 13px;
  margin-top: 5px;
}

.builder-status {
  color: #344054;
  background: #f7fbfa;
  border: 1px solid #b7ddd8;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 700;
}

.launch-group h3 {
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(220, 228, 239, 0.95);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  margin: 0 0 10px;
  padding: 12px 14px;
  font-size: 15px;
}

.collapse-indicator {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  color: #3730a3;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 9px;
}

.launch-group.collapsed .launch-grid {
  display: none;
}

.launch-group:not(.collapsed) .collapse-indicator {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

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

.launch-grid.compact {
  grid-template-columns: minmax(0, 1fr);
}

.launch-card {
  text-align: left;
  border: 1px solid rgba(220, 228, 239, 0.95);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
  display: grid;
  gap: 6px;
  min-height: 126px;
  overflow: hidden;
  position: relative;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.launch-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--teal), var(--blue));
}

.launch-card:hover {
  border-color: #82c7bf;
  box-shadow: 0 16px 34px rgba(47, 111, 237, 0.12);
  transform: translateY(-2px);
}

.launch-card strong {
  font-size: 16px;
}

.launch-card span {
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
}

.launch-card small {
  color: var(--muted);
  line-height: 1.35;
}

.dashboard {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.dashboard > div {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(220, 228, 239, 0.9);
  border-radius: 8px;
  padding: 14px;
  box-shadow: var(--soft-shadow);
}

.coach-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(220, 228, 239, 0.9);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--soft-shadow);
}

.coach-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.coach-header h2 {
  margin: 3px 0 0;
  font-size: 17px;
}

.helper-text {
  color: var(--muted);
  margin: 6px 0 0;
  line-height: 1.45;
  font-size: 13px;
}

.video-build-status {
  margin: 12px 0;
}

.video-build-card {
  background:
    radial-gradient(circle at 12% 0%, rgba(20, 184, 166, .18), transparent 30%),
    radial-gradient(circle at 96% 8%, rgba(251, 146, 60, .18), transparent 28%),
    linear-gradient(145deg, #ffffff, #f8fafc);
  border: 1px solid rgba(203, 213, 225, .86);
  border-radius: 10px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .08);
  display: grid;
  gap: 10px;
  padding: 14px;
}

.video-build-card strong {
  color: #0f172a;
  display: block;
  font-size: 20px;
  margin-top: 2px;
}

.video-build-card p {
  color: var(--muted);
  margin: 4px 0 0;
}

.video-build-meter {
  background: #e2e8f0;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.video-build-meter span {
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--orange));
  display: block;
  height: 100%;
}

.coach-output {
  margin-top: 12px;
  color: #26313f;
  line-height: 1.5;
  font-size: 14px;
}

.ask-input {
  margin-top: 12px;
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  line-height: 1.45;
}

.ask-input:focus {
  outline: 2px solid #b7ddd8;
  border-color: var(--teal);
}

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

.guide-card,
.local-guide-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.guide-card {
  display: grid;
  gap: 7px;
}

.guide-card strong,
.local-guide-item strong {
  font-size: 16px;
  color: #111827;
}

.guide-card span,
.local-guide-item span {
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 700;
}

.guide-card p {
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
  font-size: 14px;
}

.guide-card a,
.local-guide-item a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.guide-card a:hover,
.local-guide-item a:hover {
  text-decoration: underline;
}

.local-guides-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  margin-top: 24px;
}

.local-guides-head h3 {
  margin: 2px 0 0;
  font-size: 16px;
}

.guide-search {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  min-width: 260px;
}

.local-guides {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.local-guide-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
}

.local-guide-item div {
  display: grid;
  gap: 3px;
}

.local-guide-item small {
  color: var(--muted);
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  color: var(--muted);
  background: #fbfcfd;
}

.study-plan {
  display: none;
}

.plan-hero {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(236, 254, 255, 0.82));
  border: 1px solid rgba(220, 228, 239, 0.9);
  border-radius: 8px;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.8fr);
  gap: 18px;
  margin-bottom: 14px;
  box-shadow: var(--soft-shadow);
}

.plan-hero h2 {
  margin: 4px 0 6px;
}

.plan-hero p {
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

.plan-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.plan-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 12px;
}

.plan-summary strong {
  font-size: 20px;
}

.plan-toolbar,
.explanation-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(220, 228, 239, 0.9);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 8px 18px rgba(26, 39, 68, 0.05);
}

.study-plan-list {
  display: grid;
  gap: 12px;
}

.plan-day {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.plan-block-heading {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  align-items: center;
}

.plan-block-heading h3 {
  margin: 3px 0 0;
}

.plan-block-heading p {
  color: var(--muted);
  margin: 0;
  line-height: 1.45;
}

.plan-day.completed {
  opacity: 0.72;
}

.plan-day-head {
  width: 100%;
  border: 0;
  background: #fbfcfd;
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  text-align: left;
}

.plan-day-head span:first-child {
  display: grid;
  gap: 3px;
}

.plan-day-head small,
.plan-activity small {
  color: var(--muted);
}

.plan-activities {
  display: grid;
  gap: 0;
}

.plan-activity {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 38px auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.plan-activity:hover {
  background: #fbfdff;
  box-shadow: 0 10px 22px rgba(26, 39, 68, 0.1);
  transform: translateY(-1px);
}

.plan-day.supplemental .plan-day-head {
  background: #fff7df;
}

.plan-activity.completed strong {
  text-decoration: line-through;
  color: #667085;
}

.plan-check,
.plan-bookmark {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  font-weight: 800;
}

.plan-check {
  color: var(--green);
}

.plan-bookmark {
  color: #98a2b3;
}

.plan-bookmark.active {
  color: #9a6700;
  background: #fff7df;
  border-color: #d39b1f;
}

.plan-kind {
  display: inline-flex;
  width: fit-content;
  background: #e6f4f1;
  color: var(--teal-dark);
  border-radius: 8px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.question-explanation-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.explanation-workspace {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
}

.question-explanation-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.question-explanation-meta {
  display: grid;
  gap: 3px;
}

.lesson-player {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
  margin-top: 14px;
}

.lesson-video-output {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.video-toggle-bar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.video-select-control {
  display: grid;
  gap: 4px;
}

.video-select-control span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lesson-video-output video {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
}

.lesson-video-actions {
  display: flex;
  justify-content: flex-end;
}

.audio-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
  margin-top: 10px;
}

.audio-controls span {
  color: var(--muted);
  font-size: 13px;
  flex: 1 1 260px;
}

.lesson-frame {
  min-height: 260px;
  border: 1px solid #b7ddd8;
  border-radius: 8px;
  background: #f7fbfa;
  padding: 22px;
}

.lesson-frame h3 {
  margin: 4px 0 14px;
  font-size: 22px;
}

.lesson-frame p,
.lesson-frame li {
  line-height: 1.55;
}

.lesson-question-visual {
  display: grid;
  gap: 10px;
}

.lesson-question-reminder {
  border-left: 5px solid var(--teal);
  background: #e9f6f3;
  border-radius: 8px;
  padding: 12px 14px;
  line-height: 1.45;
}

.lesson-question-visual p {
  font-size: 18px;
  margin: 0 0 8px;
}

.lesson-question-visual mark {
  background: #fff08a;
  padding: 1px 3px;
  border-radius: 4px;
}

.lesson-choice {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 11px 12px;
  line-height: 1.45;
}

.lesson-choice.crossed {
  color: #667085;
  background: #f8fafc;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  border-color: #cbd5e1;
}

.lesson-choice.best {
  border-color: #69b578;
  background: #ecfdf3;
  box-shadow: inset 0 -4px 0 #69b578;
  font-weight: 700;
}

.lesson-controls {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.question-explanation-item div {
  display: grid;
  gap: 4px;
}

.lecture-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.lecture-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.lecture-card div {
  display: grid;
  gap: 5px;
}

.lecture-card p {
  margin: 0;
  color: var(--text);
}

.lecture-card small {
  color: var(--muted);
}

.notes-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.note-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 16px;
}

.note-card h3 {
  margin: 6px 0 8px;
}

.note-card p {
  margin-top: 0;
}

.note-card ul {
  margin: 12px 0 0;
  padding-left: 22px;
  line-height: 1.55;
}

.ai-note-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  margin: 14px 0;
  padding: 14px;
}

.ai-note-block.built-in-note {
  background: #f7fbfa;
}

.ai-note-block h4 {
  margin: 10px 0 6px;
  font-size: 0.95rem;
}

.ai-note-block h4:first-child {
  margin-top: 0;
}

.ai-note-block small {
  display: block;
  color: var(--muted);
  margin-bottom: 10px;
}

.ai-note-block p {
  line-height: 1.55;
}

.note-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.study-diagram {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.study-diagram span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfa;
  padding: 10px 12px;
  font-weight: 700;
}

.process-diagram {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.process-diagram span:not(:last-child)::after {
  content: ">";
  float: right;
  color: var(--muted);
}

.role-diagram,
.cycle-diagram {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.role-diagram small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  margin-top: 4px;
}

.term-diagram {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.note-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.reasoning-label {
  display: block;
  margin-top: 10px;
  font-weight: 700;
  font-size: 13px;
}

.reasoning-input {
  min-height: 64px;
}

.saved-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.coach-output ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.coach-output strong {
  color: #0f172a;
}

.script-box {
  white-space: pre-wrap;
  background: #0f172a;
  color: #f8fafc;
  border-radius: 8px;
  padding: 14px;
  overflow: auto;
  line-height: 1.5;
}

.chip-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: #f8fafc;
  color: #243244;
  font-size: 13px;
}

.chip.weak {
  border-color: #f3c0bc;
  background: #fff5f4;
  color: #8a1f17;
}

.review-next {
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.practice-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.practice-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.focus-mission {
  align-items: center;
  background: linear-gradient(135deg, #ecfeff, #fff7ed);
  border: 1px solid rgba(14, 138, 128, .22);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .05);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: 0 0 8px;
  padding: 9px 10px;
}

.focus-mission:empty {
  display: none;
}

.focus-mission strong {
  color: #0f5f59;
  display: block;
  font-size: 13px;
}

.focus-mission span {
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.mission-progress {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
  text-align: right;
}

.mission-dots {
  display: inline-flex;
  gap: 4px;
}

.mission-dots i {
  background: #cbd5e1;
  border-radius: 999px;
  display: block;
  height: 8px;
  width: 8px;
}

.mission-dots i.filled {
  animation: dotPop 360ms ease;
  background: #0e8a80;
}

.question-browser {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 8px;
  margin-bottom: 8px;
}

.compact-browser .browser-head {
  grid-template-columns: minmax(132px, .36fr) minmax(0, 1.64fr);
}

.compact-browser .question-browser-details {
  margin-top: 6px;
}

.compact-browser .question-list {
  max-height: 150px;
}

.browser-head {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) minmax(0, 1.45fr);
  gap: 8px;
  align-items: center;
}

.browser-head strong {
  display: block;
  font-size: 14px;
}

.browser-controls {
  display: grid;
  grid-template-columns: minmax(160px, 0.75fr) minmax(180px, 1fr);
  gap: 8px;
}

.question-browser-details {
  margin-top: 10px;
}

.question-browser-details summary {
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.25;
}

.question-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.question-list {
  display: grid;
  gap: 8px;
  max-height: 240px;
  overflow: auto;
  margin-top: 12px;
  padding-right: 4px;
}

.question-list-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 8px 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.question-list-item:hover {
  border-color: #82c7bf;
  background: #f7fbfa;
}

.question-list-item.active {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.question-list-item span {
  color: var(--teal-dark);
  font-weight: 800;
}

.question-list-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.question-list-main small {
  color: var(--muted);
}

.question-list-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.question-list-actions .primary-button,
.question-list-actions .secondary-button {
  padding: 8px 10px;
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 8px;
  background: #e6f4f1;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 700;
  margin-right: 6px;
}

.badge.muted {
  background: #edf2f7;
  color: #344054;
}

.counter {
  color: var(--muted);
  font-size: 14px;
}

.question-card,
.explanation-panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(220, 228, 239, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.question-card {
  padding: clamp(10px, 1.6vw, 14px);
}

.question-card.answer-saved-pulse {
  animation: answerSavedPulse 520ms ease;
}

.question-head h2 {
  font-size: clamp(14px, 1.5vw, 16px);
  color: var(--teal-dark);
  margin: 0;
}

.question-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.question-title-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.flag-button {
  min-width: 128px;
}

.flag-button.active {
  background: #fff7df;
  border-color: #d39b1f;
  color: #7a4f00;
  font-weight: 800;
}

.question-head p {
  font-size: clamp(16px, 1.7vw, 18px);
  line-height: 1.42;
  margin: 0;
}

.navigator-details {
  border: 1px solid rgba(220, 228, 239, 0.95);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  margin: 6px 0 8px;
  box-shadow: 0 8px 20px rgba(26, 39, 68, 0.06);
}

.compact-map summary {
  padding: 7px 10px;
}

.navigator-details summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 800;
  color: #344054;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.navigator-details summary small {
  color: var(--muted);
  font-weight: 600;
}

.navigator-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.navigator-legend span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.legend-box {
  width: 12px;
  height: 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #ffffff;
}

.legend-box.current {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px #b7ddd8;
}

.legend-box.answered {
  background: #e6f4f1;
  border-color: #82c7bf;
}

.legend-box.flagged {
  background: #fff7df;
  border-color: #d39b1f;
}

.question-navigator {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-top: 1px solid var(--line);
  padding: 8px 10px;
  max-height: 132px;
  overflow: auto;
}

.question-navigator button {
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.question-navigator button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(26, 39, 68, 0.12);
}

.nav-dot {
  width: 34px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #344054;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  display: grid;
  place-items: center;
}

.nav-dot b {
  position: absolute;
  top: -6px;
  right: -5px;
  background: #9a6700;
  color: #ffffff;
  border-radius: 999px;
  min-width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  font-size: 10px;
}

.nav-dot.current {
  outline: 3px solid #b7ddd8;
  border-color: var(--teal);
}

.nav-dot.answered {
  background: #e6f4f1;
  border-color: #82c7bf;
}

.nav-dot.flagged {
  background: #fff7df;
  border-color: #d39b1f;
}

.nav-dot.locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.nav-dot.nav-correct {
  background: #ecfdf3;
  border-color: #69b578;
}

.nav-dot.nav-wrong {
  background: #fff1f0;
  border-color: #ec9a93;
}

.keyword-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.highlight-tools {
  display: grid;
  grid-template-columns: auto minmax(180px, .65fr) auto minmax(240px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin: 6px 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 8px;
}

.study-tools-top {
  background: linear-gradient(180deg, #ffffff, #f8fffd);
  position: sticky;
  top: 8px;
  z-index: 5;
}

.study-tools-top .secondary-button,
.study-tools-top .swatch {
  min-height: 32px;
}

.tool-label {
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  margin-right: 2px;
  white-space: nowrap;
}

.shortcut-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.compact-button {
  min-width: 0;
  padding: 7px 10px;
}

.highlight-tools .active {
  background: #fff7df;
  border-color: #d89d00;
  color: #6d4c00;
  font-weight: 700;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.swatch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #344054;
  border-radius: 8px;
  min-height: 32px;
  padding: 5px 7px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.swatch.active {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.swatch-dot {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  display: inline-block;
}

.swatch-dot.yellow {
  background: #fff08a;
}

.swatch-dot.green {
  background: #bff3c6;
}

.swatch-dot.blue {
  background: #bfdbfe;
}

.swatch-dot.pink {
  background: #fecdd3;
}

.swatch-dot.purple {
  background: #ddd6fe;
}

.manual-highlight {
  background: #fff08a;
  border-radius: 4px;
  padding: 1px 2px;
}

.manual-highlight.yellow {
  background: #fff08a;
}

.manual-highlight.green {
  background: #bff3c6;
}

.manual-highlight.blue {
  background: #bfdbfe;
}

.manual-highlight.pink {
  background: #fecdd3;
}

.manual-highlight.purple {
  background: #ddd6fe;
}

.answer-eliminate {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  font-size: 18px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  width: 34px;
  height: 30px;
  margin-top: -2px;
  justify-self: end;
}

.answer-eliminate:hover {
  background: #e2e8f0;
}

.answer.eliminated span {
  text-decoration: line-through;
  color: #8792a0;
}

.answer.eliminated {
  background: #f8fafc;
}

.keyword {
  background: #fff7df;
  border: 1px solid #f3d68a;
  color: #6d4c00;
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 13px;
}

.answers {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.answer {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 36px;
  gap: 8px;
  align-items: start;
  border: 1px solid rgba(220, 228, 239, 0.95);
  border-radius: 8px;
  padding: 9px 10px;
  cursor: pointer;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.answer:hover {
  border-color: #9ab8d9;
  background: #fbfdff;
  box-shadow: 0 8px 18px rgba(47, 111, 237, 0.08);
  transform: translateY(-1px);
}

.answer:has(input:checked) {
  background: linear-gradient(90deg, rgba(20,184,166,.08), #ffffff 62%);
  border-color: rgba(20,184,166,.62);
  box-shadow: 0 10px 22px rgba(20,184,166,.11);
}

.answer:has(input:checked)::after {
  background: #0e8a80;
  border-radius: 999px;
  content: "";
  height: 8px;
  position: absolute;
  right: 10px;
  top: 10px;
  width: 8px;
}

.answer input {
  width: 18px;
  height: 18px;
  margin: 1px auto 0;
}

.answer.correct {
  border-color: #69b578;
  background: #f0fbf3;
}

.answer.incorrect {
  border-color: #ec9a93;
  background: #fff5f4;
}

body.focus-mode .question-browser,
body.focus-mode .navigator-details,
body.focus-mode .practice-badges,
body.focus-mode .keyword-panel:not([hidden]),
body.focus-mode .shortcut-hint {
  display: none;
}

body.focus-mode .practice-header {
  border-bottom: 0;
  margin-bottom: 6px;
  padding-bottom: 0;
}

body.focus-mode .question-card {
  box-shadow: 0 20px 60px rgba(14, 138, 128, .13);
}

body.focus-mode .question-head p {
  font-size: clamp(18px, 2vw, 21px);
  line-height: 1.5;
}

body.focus-mode .answer {
  padding: 12px;
}

body.focus-mode .reasoning-label,
body.focus-mode .reasoning-input,
body.focus-mode .saved-note {
  display: none;
}

.result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.inline-explanation-button {
  padding: 8px 12px;
}

.button-row {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 12px;
}

#checkButton[hidden] {
  display: none;
}

.primary-button,
.secondary-button {
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  border: 1px solid transparent;
  min-width: 92px;
  font-weight: 800;
  transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--teal), var(--blue));
  color: white;
  box-shadow: 0 10px 24px rgba(47, 111, 237, 0.18);
}

.primary-button:hover {
  box-shadow: 0 14px 30px rgba(47, 111, 237, 0.24);
  transform: translateY(-1px);
}

.secondary-button {
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  color: var(--ink);
}

.secondary-button:hover {
  background: #f4fbfa;
  border-color: #9bd8d1;
  box-shadow: 0 10px 22px rgba(14, 138, 128, 0.12);
  transform: translateY(-1px);
}

.explanation-panel {
  margin-top: 18px;
  padding: 18px;
  box-shadow: none;
}

.result-line {
  font-weight: 800;
  margin-bottom: 16px;
}

.result-line.correct {
  color: var(--green);
}

.result-line.incorrect {
  color: var(--red);
}

.explanation-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.explanation-panel h3 {
  font-size: 14px;
  margin: 0 0 8px;
  color: #0f172a;
}

.explanation-panel p,
.explanation-panel li {
  color: #26313f;
  line-height: 1.5;
  font-size: 14px;
}

.explanation-panel ul {
  padding-left: 19px;
  margin: 0;
}

.takeaway {
  margin-top: 18px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.plan-activity {
  border-left: 4px solid transparent;
}

.plan-activity:has([data-plan-start]) {
  border-left-color: #2563eb;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.06), transparent 46%);
}

.plan-activity:has([data-plan-topic]),
.plan-activity:has([data-plan-row-topic]) {
  border-left-color: #0f766e;
  background: linear-gradient(90deg, rgba(15, 118, 110, 0.07), transparent 46%);
}

.plan-activity:has([data-plan-guide]) {
  border-left-color: #7c3aed;
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.06), transparent 46%);
}

.lecture-card {
  background: linear-gradient(135deg, #ffffff 0%, #f0fdfa 100%);
  border-left: 5px solid #0f766e;
}

.note-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-top: 4px solid #0f766e;
}

.note-card:nth-child(3n + 2) {
  border-top-color: #2563eb;
}

.note-card:nth-child(3n + 3) {
  border-top-color: #7c3aed;
}

.note-card-head {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.compact-note-actions {
  justify-content: flex-end;
}

.embedded-study-video {
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin: 14px 0;
  padding: 12px;
}

.embedded-study-video video {
  aspect-ratio: 16 / 9;
  background: #111827;
  border-radius: 8px;
  width: 100%;
}

.video-note-panel {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 12px;
}

.video-note-panel label {
  color: #9a3412;
  font-size: 13px;
  font-weight: 800;
}

.video-notes-input {
  border: 1px solid #fdba74;
  border-radius: 8px;
  box-sizing: border-box;
  font: inherit;
  min-height: 96px;
  padding: 10px;
  resize: vertical;
  width: 100%;
}

.xp-panel {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(239, 246, 255, 0.96) 45%, rgba(236, 253, 245, 0.96) 100%);
  border: 1px solid rgba(199, 210, 254, 0.95);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(79, 70, 229, 0.12);
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.xp-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, #2f6fed, #0e8a80, #f28c38, #e0527d);
}

.xp-head,
.quest-head,
.xp-actions,
.reward-grid {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.reward-tabs {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
}

.reward-tabs button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #475467;
  cursor: pointer;
  font-weight: 800;
  padding: 8px 10px;
}

.reward-tabs button.active {
  background: #111827;
  color: #fff;
}

.xp-panel .reward-tab-panel,
.xp-panel .badge-panel > [data-reward-panel],
.xp-panel .inventory-strip,
.xp-panel .owned-pet-strip,
.xp-panel .pet-room-page,
.xp-panel .pet-shop-grid {
  display: none;
}

.xp-panel[data-reward-tab="overview"] .pet-companion,
.xp-panel[data-reward-tab="overview"] .reward-tab-panel[data-reward-panel="collections"],
.xp-panel[data-reward-tab="overview"] .badge-panel > [data-reward-panel="pets"],
.xp-panel[data-reward-tab="overview"] .inventory-strip,
.xp-panel[data-reward-tab="overview"] .owned-pet-strip,
.xp-panel[data-reward-tab="quests"] .reward-tab-panel[data-reward-panel="quests"],
.xp-panel[data-reward-tab="badges"] .reward-tab-panel[data-reward-panel="collections"],
.xp-panel[data-reward-tab="badges"] .badge-panel > [data-reward-panel="badges"],
.xp-panel[data-reward-tab="pets"] .reward-tab-panel[data-reward-panel="collections"],
.xp-panel[data-reward-tab="pets"] .badge-panel > [data-reward-panel="pets"],
.xp-panel[data-reward-tab="room"] .reward-tab-panel[data-reward-panel="collections"],
.xp-panel[data-reward-tab="room"] .badge-panel > [data-reward-panel="pets"],
.xp-panel[data-reward-tab="room"] .owned-pet-strip,
.xp-panel[data-reward-tab="room"] .pet-room-page,
.xp-panel[data-reward-tab="shop"] .reward-tab-panel[data-reward-panel="shop"],
.xp-panel[data-reward-tab="shop"] .reward-tab-panel[data-reward-panel="collections"],
.xp-panel[data-reward-tab="shop"] .badge-panel > [data-reward-panel="pets"],
.xp-panel[data-reward-tab="shop"] .pet-shop-grid,
.xp-panel[data-reward-tab="inventory"] .reward-tab-panel[data-reward-panel="collections"],
.xp-panel[data-reward-tab="inventory"] .badge-panel > [data-reward-panel="pets"],
.xp-panel[data-reward-tab="inventory"] .inventory-strip,
.xp-panel[data-reward-tab="inventory"] .owned-pet-strip {
  display: grid;
}

.xp-panel[data-reward-tab="overview"] .inventory-strip,
.xp-panel[data-reward-tab="overview"] .owned-pet-strip {
  display: flex;
}

.xp-panel[data-reward-tab="shop"] .pet-companion,
.xp-panel[data-reward-tab="inventory"] .pet-companion,
.xp-panel[data-reward-tab="pets"] .pet-companion,
.xp-panel[data-reward-tab="room"] .pet-companion {
  display: grid;
}

.xp-panel[data-reward-tab="room"] .pet-companion {
  grid-template-columns: 1fr;
}

.xp-panel[data-reward-tab="room"] .pet-stage {
  display: none;
}

.xp-head h3 {
  margin: 0;
}

.xp-bar,
.quest-progress {
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.xp-bar span,
.quest-progress span {
  background: linear-gradient(90deg, var(--blue), var(--teal));
  display: block;
  height: 100%;
  transition: width 240ms ease;
}

.quest-panel {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.quest-head span {
  color: #64748b;
  font-size: 13px;
}

.quest-list {
  display: grid;
  gap: 8px;
}

.quest-item {
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 5px solid #2563eb;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1.2fr) minmax(120px, 0.8fr) auto;
  padding: 10px;
  box-shadow: 0 6px 16px rgba(26, 39, 68, 0.05);
}

.quest-item[data-tone="green"] {
  border-left-color: #16a34a;
}

.quest-item[data-tone="purple"] {
  border-left-color: #7c3aed;
}

.quest-item[data-tone="orange"] {
  border-left-color: #f97316;
}

.quest-item[data-tone="teal"] {
  border-left-color: #0f766e;
}

.quest-item strong,
.quest-item span {
  display: block;
}

.quest-item span {
  color: #64748b;
  font-size: 13px;
}

.quest-item button,
.reward-grid button {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  cursor: pointer;
  font-weight: 800;
  padding: 9px 11px;
}

.quest-item button:not(:disabled),
.reward-grid button:hover {
  background: #111827;
  border-color: #111827;
  color: #fff;
}

.quest-item button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.quest-item.claimed {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.badge-panel {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr 1fr;
}

.continue-panel {
  background: linear-gradient(135deg, #ffffff, #eef6ff);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
}

.continue-panel strong,
.coach-mini-card strong {
  display: block;
  font-size: 17px;
  margin-bottom: 4px;
}

.continue-panel p,
.coach-mini-card p {
  color: var(--muted);
  margin: 0;
}

.continue-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.coach-mini-card {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(220, 228, 239, 0.95);
  border-radius: 8px;
  color: #334155;
  padding: 12px;
}

.mastery-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.mastery-summary span {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #334155;
  padding: 10px 12px;
}

.mastery-map,
.review-queue-list {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.mastery-domain {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(220, 228, 239, 0.9);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.mastery-domain-head,
.mastery-domain-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.mastery-domain-head {
  border-bottom: 1px solid rgba(220, 228, 239, 0.9);
  padding-bottom: 10px;
}

.mastery-domain-head h3 {
  margin: 0;
}

.mastery-subgroup h4 {
  margin: 6px 0 10px;
}

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

.mastery-card,
.review-queue-card,
.recap-next {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(220, 228, 239, 0.95);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  padding: 14px;
}

.mastery-head,
.review-queue-card {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.mastery-card h3,
.review-queue-card h3 {
  margin: 4px 0 6px;
}

.mastery-card p,
.review-queue-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 10px;
}

.mastery-bar {
  background: #e2e8f0;
  border-radius: 999px;
  height: 9px;
  margin: 10px 0;
  overflow: hidden;
}

.mastery-bar span {
  background: linear-gradient(90deg, var(--blue), var(--teal));
  display: block;
  height: 100%;
}

.mastery-card[data-level="New"] .mastery-bar span {
  background: #94a3b8;
}

.mastery-card[data-level="Mastered"] .mastery-bar span {
  background: linear-gradient(90deg, #22c55e, #fbbf24);
}

.mini-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-chip-row span {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  color: #3730a3;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
}

.queue-actions {
  display: grid;
  gap: 8px;
}

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

.recap-grid > div {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(220, 228, 239, 0.95);
  border-radius: 8px;
  padding: 14px;
}

.recap-grid strong {
  display: block;
  font-size: 24px;
}

.badge-panel > div {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.badge-list,
.item-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.item-list {
  display: grid;
  gap: 12px;
}

.pet-companion {
  align-items: center;
  background: linear-gradient(135deg, #f8fbff, #edfdf8);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: 170px minmax(0, 1fr);
  padding: 12px;
}

.pet-companion p {
  color: #475467;
  margin: 4px 0 0;
}

.pet-needs {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.pet-need {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 58px minmax(0, 1fr) 30px;
}

.pet-need span,
.pet-need strong {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.pet-need div {
  background: rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}

.pet-need i {
  background: linear-gradient(90deg, #22c55e, #14b8a6);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.pet-need[data-need="hunger"] i { background: linear-gradient(90deg, #f97316, #facc15); }
.pet-need[data-need="energy"] i { background: linear-gradient(90deg, #3b82f6, #38bdf8); }
.pet-need[data-need="focus"] i { background: linear-gradient(90deg, #8b5cf6, #c084fc); }
.pet-need[data-need="mood"] i { background: linear-gradient(90deg, #ec4899, #fb7185); }
.pet-need[data-need="health"] i { background: linear-gradient(90deg, #16a34a, #84cc16); }

.pet-needs-summary {
  color: #64748b;
  font-size: 12px;
  line-height: 1.35;
  margin: 8px 0 0;
}

.pet-care-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.pet-care-group {
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  padding: 7px;
}

.pet-care-group summary {
  color: #475467;
  cursor: pointer;
  font-size: 11px;
  font-weight: 900;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.pet-care-actions button {
  background: #111827;
  border: 1px solid #111827;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  margin: 3px;
  padding: 8px 10px;
}

.pet-care-actions button:hover {
  background: #0f766e;
  border-color: #0f766e;
  transform: translateY(-1px);
}

.pet-care-actions small {
  color: #fde68a;
  font-weight: 900;
}

.pet-stage {
  aspect-ratio: 1 / 1;
  background:
    radial-gradient(circle at 50% 76%, rgba(15, 23, 42, 0.15), transparent 32%),
    linear-gradient(180deg, #dff4ff 0%, #f8fafc 55%, #d8f3e6 56%, #b7dfc9 100%);
  border: 1px solid rgba(125, 149, 178, 0.35);
  border-radius: 8px;
  box-shadow: inset 0 16px 30px rgba(255, 255, 255, 0.65), 0 18px 34px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.pet-stage::before {
  display: none;
}

.pet-stage::after {
  content: "";
  background:
    radial-gradient(circle, #facc15 0 4px, transparent 5px),
    radial-gradient(circle, #38bdf8 0 4px, transparent 5px),
    radial-gradient(circle, #f472b6 0 4px, transparent 5px),
    radial-gradient(circle, #34d399 0 4px, transparent 5px);
  background-position: 26% 28%, 72% 30%, 34% 70%, 78% 68%;
  background-repeat: no-repeat;
  background-size: 32px 32px;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: scale(0.7);
  z-index: 30;
}

.pet-stage.pet-happy::after,
.pet-stage.pet-excited::after {
  animation: petSparkles 1050ms ease-out forwards;
}

.pet-stage img {
  pointer-events: none;
  position: absolute;
  user-select: none;
}

.pet-avatar {
  animation: petIdle 3.8s ease-in-out infinite;
  bottom: 8px;
  filter: drop-shadow(0 14px 12px rgba(15, 23, 42, 0.24));
  left: 50%;
  transform: translateX(-50%);
  width: 82%;
  z-index: 5;
}

.pet-stage.pet-happy .pet-avatar {
  animation: petHappy 900ms ease-in-out, petIdle 3.8s ease-in-out infinite 900ms;
}

.pet-stage.pet-excited .pet-avatar {
  animation: petExcited 1050ms cubic-bezier(.22, 1.2, .36, 1), petIdle 3.8s ease-in-out infinite 1050ms;
}

.pet-color {
  bottom: 20px;
  left: 50%;
  mix-blend-mode: multiply;
  opacity: 0.55;
  transform: translateX(-50%);
  width: 72%;
  z-index: 6;
}

.pet-shirt {
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  width: 32%;
  z-index: 8;
}

.pet-pants {
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  z-index: 9;
}

.pet-collar {
  bottom: 62px;
  left: 50%;
  transform: translateX(-50%);
  width: 30%;
  z-index: 10;
}

.pet-glasses {
  left: 50%;
  top: 62px;
  transform: translateX(-50%);
  width: 30%;
  z-index: 11;
}

.pet-hat {
  left: 50%;
  top: 26px;
  transform: translateX(-50%);
  width: 30%;
  z-index: 12;
}

.pet-hat[data-pet-kind="pet-owl"] { top: 24px; width: 31%; }
.pet-glasses[data-pet-kind="pet-owl"] { top: 68px; width: 34%; }
.pet-collar[data-pet-kind="pet-owl"] { bottom: 62px; width: 32%; }
.pet-shirt[data-pet-kind="pet-owl"] { bottom: 34px; width: 35%; }
.pet-pants[data-pet-kind="pet-owl"] { bottom: 19px; width: 31%; }

.pet-hat[data-pet-kind="pet-fox"] { top: 34px; width: 28%; }
.pet-glasses[data-pet-kind="pet-fox"] { top: 78px; width: 31%; }
.pet-collar[data-pet-kind="pet-fox"] { bottom: 58px; width: 28%; }
.pet-shirt[data-pet-kind="pet-fox"] { bottom: 35px; width: 30%; }
.pet-pants[data-pet-kind="pet-fox"] { bottom: 19px; width: 28%; }

.pet-hat[data-pet-kind="pet-cat"] { top: 34px; width: 29%; }
.pet-glasses[data-pet-kind="pet-cat"] { top: 74px; width: 32%; }
.pet-collar[data-pet-kind="pet-cat"] { bottom: 58px; width: 30%; }
.pet-shirt[data-pet-kind="pet-cat"] { bottom: 34px; width: 31%; }
.pet-pants[data-pet-kind="pet-cat"] { bottom: 18px; width: 29%; }

.pet-hat[data-pet-kind="pet-star-pup"] { top: 32px; width: 30%; }
.pet-glasses[data-pet-kind="pet-star-pup"] { top: 75px; width: 32%; }
.pet-collar[data-pet-kind="pet-star-pup"] { bottom: 56px; width: 31%; }
.pet-shirt[data-pet-kind="pet-star-pup"] { bottom: 33px; width: 31%; }
.pet-pants[data-pet-kind="pet-star-pup"] { bottom: 17px; width: 29%; }

.pet-stage.pet-happy .pet-hat,
.pet-stage.pet-excited .pet-hat,
.pet-stage.pet-happy .pet-glasses,
.pet-stage.pet-excited .pet-glasses,
.pet-stage.pet-happy .pet-collar,
.pet-stage.pet-excited .pet-collar,
.pet-stage.pet-happy .pet-shirt,
.pet-stage.pet-excited .pet-shirt,
.pet-stage.pet-happy .pet-pants,
.pet-stage.pet-excited .pet-pants {
  animation: petAccessoryBounce 900ms ease-in-out;
}

.pet-room {
  right: 6px;
  top: 8px;
  width: 36%;
  z-index: 2;
}

.pet-floor {
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1;
}

.pet-toy {
  animation: petToyBob 2.4s ease-in-out infinite;
  bottom: 11px;
  right: 12px;
  width: 21%;
  z-index: 13;
}

@keyframes petIdle {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(-1deg); }
  50% { transform: translateX(-50%) translateY(-5px) rotate(1deg); }
}

@keyframes petHappy {
  0%, 100% { transform: translateX(-50%) translateY(0) scale(1); }
  35% { transform: translateX(-50%) translateY(-14px) scale(1.05); }
  65% { transform: translateX(-50%) translateY(-4px) scale(0.98); }
}

@keyframes petExcited {
  0%, 100% { transform: translateX(-50%) translateY(0) rotate(0) scale(1); }
  20% { transform: translateX(-50%) translateY(-18px) rotate(-5deg) scale(1.07); }
  42% { transform: translateX(-50%) translateY(-6px) rotate(5deg) scale(1.02); }
  66% { transform: translateX(-50%) translateY(-16px) rotate(-3deg) scale(1.06); }
}

@keyframes petAccessoryBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
}

@keyframes petToyBob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-5px) rotate(2deg); }
}

@keyframes petSparkles {
  0% { opacity: 0; transform: scale(0.65) rotate(0); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.25) rotate(16deg); }
}

.inventory-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.owned-pet-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.owned-pet-card {
  align-items: center;
  background: #fff;
  border: 1px solid #d7deea;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-template-columns: 48px minmax(0, 1fr);
  padding: 8px;
  text-align: left;
}

.owned-pet-select {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  grid-template-columns: 48px minmax(0, 1fr);
  padding: 0;
  text-align: left;
}

.owned-pet-card img {
  height: 48px;
  object-fit: contain;
  width: 48px;
}

.owned-pet-card span {
  display: grid;
  gap: 2px;
}

.owned-pet-card small {
  color: #64748b;
}

.owned-pet-card.active {
  background: #ecfdf5;
  border-color: #0e8a80;
}

.owned-pet-card.lost {
  background: #fff1f0;
  border-color: #fda29b;
}

.owned-pet-select:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.pet-room-page {
  display: none;
}

.pet-home-room {
  background:
    linear-gradient(180deg, rgba(255,255,255,.72), rgba(248,250,252,.86));
  border: 1px solid rgba(125, 149, 178, 0.35);
  border-radius: 8px;
  box-shadow: inset 0 18px 34px rgba(255,255,255,.7), 0 18px 34px rgba(15,23,42,.12);
  min-height: 560px;
  overflow: hidden;
  padding: 16px;
  position: relative;
}

.pet-room-tabs {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 10px;
  position: relative;
  z-index: 20;
}

.pet-room-tabs button {
  aspect-ratio: 1.45 / 1;
  background: rgba(255,255,255,.78);
  border: 2px solid rgba(255,255,255,.7);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(15,23,42,.14);
  cursor: pointer;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.pet-room-tabs button.active {
  border-color: #0f766e;
  box-shadow: 0 0 0 3px rgba(20,184,166,.22), 0 10px 22px rgba(15,23,42,.18);
}

.pet-room-tabs button::after {
  background: linear-gradient(180deg, transparent 35%, rgba(15,23,42,.35));
  content: "";
  inset: 0;
  position: absolute;
}

.room-tab-image {
  background-position: center;
  background-size: cover;
  display: block;
  height: 100%;
  transform: scale(1.04);
  width: 100%;
}

.room-tab-icon {
  align-items: center;
  background: rgba(255,255,255,.9);
  border-radius: 999px;
  bottom: 6px;
  box-shadow: 0 4px 10px rgba(15,23,42,.18);
  display: inline-flex;
  font-size: 18px;
  height: 30px;
  justify-content: center;
  position: absolute;
  right: 6px;
  width: 30px;
  z-index: 2;
}

.room-tab-bed .room-tab-image { background-image: url("assets/rooms/cozy-bedroom.png"); }
.room-tab-kitchen .room-tab-image { background-image: url("assets/rooms/cozy-kitchen.png"); }
.room-tab-study .room-tab-image { background-image: url("assets/rooms/cozy-study.png"); }
.room-tab-play .room-tab-image { background-image: url("assets/rooms/cozy-playroom.png"); }

.pet-room-tabs button:hover .room-tab-image {
  transform: scale(1.1);
}

.pet-home-zone {
  background-image:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(15,23,42,.06)),
    var(--room-bg);
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(71, 85, 105, 0.18);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-height: 420px;
  padding: 12px;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.36);
}

.pet-home-zone.active-room {
  min-height: 420px;
}

.pet-home-zone strong {
  font-size: 15px;
  z-index: 1;
}

.pet-home-zone small {
  color: #64748b;
  z-index: 1;
}

.pet-home-bed,
.pet-home-kitchen,
.pet-home-study,
.pet-home-play {
  background-color: #f8fafc;
}

.pet-room-hotspot {
  align-items: center;
  background: rgba(255, 255, 255, .12);
  border: 2px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  box-shadow: 0 0 0 0 rgba(20,184,166,.22);
  cursor: pointer;
  display: flex;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0;
  position: absolute;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  z-index: 24;
  animation: hotspotPulse 2.8s ease-in-out infinite;
}

.pet-room-hotspot span {
  display: none;
}

.pet-room-hotspot:hover,
.pet-room-hotspot:focus-visible {
  background: rgba(20,184,166,.2);
  border-color: rgba(20,184,166,.72);
  box-shadow: 0 0 0 5px rgba(20,184,166,.16);
  outline: none;
  transform: scale(1.04);
}

.pet-room-hotspot:active {
  transform: scale(.96);
}

.pet-placement-spot {
  align-items: center;
  background: rgba(15, 23, 42, .16);
  border: 1px dashed rgba(255, 255, 255, .62);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 8px 18px rgba(15,23,42,.12);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  font-size: 0;
  justify-content: center;
  min-height: 34px;
  min-width: 34px;
  opacity: .58;
  padding: 0;
  position: absolute;
  transition: opacity .16s ease, transform .16s ease, background .16s ease, border-color .16s ease;
  z-index: 23;
}

.pet-placement-spot::before {
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(15, 23, 42, .18);
  border-radius: 999px;
  content: "+";
  color: #0f766e;
  display: grid;
  font-size: 15px;
  font-weight: 900;
  height: 22px;
  place-items: center;
  width: 22px;
}

.pet-placement-spot.filled::before {
  content: "✓";
  color: #2563eb;
}

.pet-placement-spot::after {
  background: rgba(17, 24, 39, .94);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  bottom: calc(100% + 8px);
  box-shadow: 0 14px 30px rgba(15,23,42,.22);
  color: #ffffff;
  content: attr(data-note);
  font-size: 12px;
  font-weight: 700;
  left: 50%;
  line-height: 1.3;
  max-width: 240px;
  min-width: 190px;
  opacity: 0;
  padding: 8px 10px;
  pointer-events: none;
  position: absolute;
  text-align: left;
  transform: translate(-50%, 4px);
  transition: opacity .16s ease, transform .16s ease;
  z-index: 60;
}

.pet-placement-spot:hover,
.pet-placement-spot:focus,
.pet-placement-spot:focus-visible {
  background: rgba(20, 184, 166, .22);
  border-color: rgba(255, 255, 255, .88);
  opacity: 1;
  outline: none;
  transform: scale(1.04);
}

.pet-placement-spot:hover span,
.pet-placement-spot:focus span,
.pet-placement-spot:focus-visible span {
  background: rgba(17, 24, 39, .88);
  border-radius: 999px;
  bottom: -28px;
  box-shadow: 0 8px 18px rgba(15,23,42,.16);
  color: #ffffff;
  display: block;
  font-size: 11px;
  font-weight: 900;
  left: 50%;
  max-width: 150px;
  overflow: hidden;
  padding: 5px 8px;
  position: absolute;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  white-space: nowrap;
}

.pet-placement-spot:hover::after,
.pet-placement-spot:focus::after,
.pet-placement-spot:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pet-place-blanket { bottom: 102px; left: 12%; width: 22%; height: 18%; }
.pet-place-bed-rug { bottom: 38px; left: 35%; width: 34%; height: 12%; }
.pet-place-food { bottom: 74px; left: 52%; width: 9%; height: 9%; border-radius: 999px; }
.pet-place-mug { bottom: 132px; right: 48%; width: 8%; height: 8%; border-radius: 999px; }
.pet-place-lamp { bottom: 126px; left: 16%; width: 12%; height: 22%; }
.pet-place-wall { right: 35%; top: 82px; width: 22%; height: 17%; }
.pet-place-window { right: 8%; bottom: 112px; width: 13%; height: 18%; }
.pet-place-desk { bottom: 104px; left: 41%; width: 14%; height: 10%; }
.pet-place-study-rug { bottom: 38px; left: 36%; width: 36%; height: 12%; opacity: .2; }
.pet-place-play-rug { bottom: 36px; left: 34%; width: 36%; height: 13%; }
.pet-place-toy { bottom: 68px; right: 14%; width: 13%; height: 12%; border-radius: 999px; }

.pet-hotspot-bed { bottom: 142px; left: 14%; width: 22%; height: 22%; border-radius: 20px; }
.pet-hotspot-blanket { bottom: 116px; right: 4%; width: 14%; height: 18%; border-radius: 22px; }

.pet-hotspot-food { bottom: 92px; left: 38%; width: 13%; height: 13%; }
.pet-hotspot-tea { bottom: 154px; right: 35%; width: 11%; height: 11%; }
.pet-hotspot-meal { bottom: 126px; right: 20%; width: 14%; height: 14%; }

.pet-hotspot-desk { bottom: 134px; left: 14%; width: 26%; height: 19%; border-radius: 18px; }
.pet-hotspot-puzzle { bottom: 90px; right: 20%; width: 15%; height: 15%; }

.pet-hotspot-ball { bottom: 94px; right: 28%; width: 13%; height: 13%; }
.pet-hotspot-toy { bottom: 114px; left: 16%; width: 20%; height: 15%; border-radius: 18px; }

.room-prop,
.room-prop span {
  position: absolute;
}

.room-prop {
  inset: 0;
  pointer-events: none;
}

.prop-bed {
  background: linear-gradient(180deg, #a78bfa, #7c3aed);
  border: 3px solid #5b21b6;
  border-radius: 16px 16px 8px 8px;
  bottom: 18px;
  height: 52px;
  left: 22px;
  width: 130px;
}

.prop-pillow {
  background: #f5f3ff;
  border: 3px solid #c4b5fd;
  border-radius: 12px;
  bottom: 56px;
  height: 30px;
  left: 34px;
  width: 48px;
  z-index: 1;
}

.prop-blanket {
  background: rgba(255,255,255,.28);
  border-radius: 10px;
  bottom: 30px;
  height: 28px;
  left: 72px;
  width: 70px;
  z-index: 2;
}

.prop-fridge {
  background: linear-gradient(180deg, #ffffff, #dbeafe);
  border: 3px solid #93c5fd;
  border-radius: 10px;
  bottom: 24px;
  height: 108px;
  right: 26px;
  width: 52px;
}

.prop-counter {
  background: linear-gradient(180deg, #fcd34d, #d97706);
  border: 3px solid #92400e;
  border-radius: 10px;
  bottom: 22px;
  height: 42px;
  left: 24px;
  width: 116px;
}

.prop-bowl {
  background: radial-gradient(circle at 50% 30%, #fff7ed, #fb923c);
  border: 3px solid #c2410c;
  border-radius: 999px;
  bottom: 69px;
  height: 32px;
  left: 58px;
  width: 50px;
}

.prop-desk {
  background: linear-gradient(180deg, #bae6fd, #38bdf8);
  border: 3px solid #0369a1;
  border-radius: 10px;
  bottom: 28px;
  height: 54px;
  left: 28px;
  width: 126px;
}

.prop-book {
  background: linear-gradient(90deg, #ffffff 0 48%, #bfdbfe 49% 100%);
  border: 3px solid #2563eb;
  border-radius: 8px;
  bottom: 86px;
  height: 34px;
  left: 48px;
  width: 74px;
}

.prop-lamp {
  background: #facc15;
  border: 3px solid #92400e;
  border-radius: 20px 20px 8px 8px;
  bottom: 86px;
  height: 48px;
  right: 36px;
  width: 42px;
}

.prop-ball {
  background: radial-gradient(circle at 35% 28%, #fff, #f87171 48%, #dc2626 100%);
  border: 3px solid #991b1b;
  border-radius: 999px;
  bottom: 36px;
  height: 48px;
  right: 36px;
  width: 48px;
}

.prop-blocks {
  background: #60a5fa;
  border: 3px solid #1d4ed8;
  border-radius: 8px;
  bottom: 32px;
  height: 36px;
  left: 38px;
  width: 42px;
  box-shadow: 42px -16px 0 #facc15, 84px 2px 0 #34d399;
}

.prop-mat {
  background: rgba(244, 114, 182, .2);
  border: 3px dashed #f472b6;
  border-radius: 999px;
  bottom: 14px;
  height: 50px;
  left: 22%;
  width: 54%;
}

.home-floor-item {
  bottom: 44px;
  left: 50%;
  filter: drop-shadow(0 18px 16px rgba(15, 23, 42, .24)) saturate(1.08) contrast(1.02);
  opacity: .94;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%);
  width: 46%;
  z-index: 9;
}

.home-room-item {
  filter: drop-shadow(0 14px 12px rgba(15, 23, 42, .24)) saturate(1.08) contrast(1.04);
  pointer-events: none;
  position: absolute;
  right: 24px;
  top: 112px;
  width: 108px;
  z-index: 10;
}

.home-toy-item {
  bottom: 70px;
  filter: drop-shadow(0 10px 9px rgba(15, 23, 42, .24)) saturate(1.1);
  pointer-events: none;
  position: absolute;
  right: 72px;
  width: 74px;
  z-index: 12;
}

.home-floor-item.room-place-rug {
  bottom: 35px;
  left: 50%;
  transform: translateX(-50%) perspective(520px) rotateX(58deg);
  transform-origin: center bottom;
  width: min(430px, 62%);
  z-index: 6;
}

.home-room-item.room-place-lamp {
  bottom: 102px;
  left: 18%;
  right: auto;
  top: auto;
  width: 96px;
  z-index: 14;
}

.home-room-item.room-place-blanket {
  bottom: 64px;
  left: 12%;
  right: auto;
  top: auto;
  transform: perspective(420px) rotateX(42deg) rotateZ(-2deg);
  transform-origin: center bottom;
  width: 172px;
  z-index: 7;
}

.home-room-item.room-place-wall {
  right: 16%;
  top: 118px;
  width: 136px;
  z-index: 9;
}

.home-room-item.room-place-window {
  bottom: 104px;
  right: 10%;
  top: auto;
  width: 116px;
  z-index: 11;
}

.home-toy-item.room-place-desk {
  bottom: 108px;
  left: 23%;
  right: auto;
  width: 86px;
  z-index: 16;
}

.home-toy-item.room-place-toy {
  animation: toyRoomIdle 2.8s ease-in-out infinite;
  bottom: 78px;
  right: 18%;
  width: 82px;
  z-index: 16;
}

.home-pets {
  bottom: 54px;
  left: 0;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 104px;
  z-index: 26;
}

.pet-speech-bubble {
  animation: petSpeechIn 360ms ease both;
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(20, 184, 166, .34);
  border-radius: 14px;
  box-shadow: 0 16px 34px rgba(15,23,42,.18);
  color: #1f2937;
  font-size: 13px;
  font-weight: 800;
  left: 54%;
  line-height: 1.3;
  max-width: min(280px, 42%);
  padding: 10px 12px;
  position: absolute;
  top: 118px;
  z-index: 35;
}

.pet-speech-bubble::after {
  border: 9px solid transparent;
  border-top-color: rgba(255,255,255,.94);
  bottom: -17px;
  content: "";
  left: 28px;
  position: absolute;
}

.pet-speech-bubble.excited {
  border-color: rgba(245, 158, 11, .45);
}

.pet-speech-bubble.curious {
  border-color: rgba(96, 165, 250, .5);
}

.pet-room-note {
  background: rgba(17, 24, 39, .9);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  box-shadow: 0 14px 30px rgba(15,23,42,.2);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  left: 18px;
  line-height: 1.35;
  max-width: min(420px, calc(100% - 36px));
  padding: 9px 11px;
  pointer-events: none;
  position: absolute;
  top: 88px;
  z-index: 36;
}

.pet-room-note.success {
  background: rgba(15, 118, 110, .92);
}

.pet-room-note.warning {
  background: rgba(154, 103, 0, .92);
}

.home-pet {
  background: transparent;
  border: 0;
  border-radius: 18px;
  bottom: calc(26px + (var(--i) % 2) * 76px);
  box-shadow: none;
  cursor: grab;
  display: grid;
  gap: 2px;
  left: calc(42px + var(--i) * 86px);
  overflow: visible;
  padding: 4px;
  pointer-events: auto;
  position: absolute;
  text-align: center;
  touch-action: none;
  user-select: none;
}

.home-pet .interaction-ripple,
.pet-room-hotspot .interaction-ripple,
.pet-room-tabs .interaction-ripple {
  display: none;
}

.home-pet-figure {
  display: block;
  height: 108px;
  position: relative;
  overflow: visible;
  width: 108px;
}

.home-pet-figure img {
  pointer-events: none;
  position: absolute;
  user-select: none;
}

.home-pet-avatar {
  animation: petIdle 3.8s ease-in-out infinite;
  filter: none;
  height: 100px;
  left: 0;
  object-fit: contain;
  top: 0;
  width: 100px;
}

.home-pet-layer.pet-color { bottom: 9px; left: 10%; opacity: .45; width: 80%; z-index: 6; }
.home-pet-layer.pet-shirt { bottom: 17px; left: 34%; width: 32%; z-index: 8; }
.home-pet-layer.pet-pants { bottom: 7px; left: 35%; width: 30%; z-index: 9; }
.home-pet-layer.pet-collar { bottom: 31px; left: 34%; width: 32%; z-index: 10; }
.home-pet-layer.pet-glasses { top: 25px; left: 33%; width: 34%; z-index: 11; }
.home-pet-layer.pet-hat { top: 8px; left: 34%; width: 32%; z-index: 12; }

.home-pet > span:not(.home-pet-figure),
.home-pet > em {
  display: none !important;
}

.pet-action-prop {
  filter: drop-shadow(0 8px 7px rgba(15, 23, 42, .25));
  pointer-events: none;
  position: absolute;
  z-index: 18;
}

.pet-action-prop.prop-bowl {
  background:
    radial-gradient(ellipse at 50% 18%, #fff7ed 0 34%, transparent 35%),
    linear-gradient(180deg, #fb923c, #c2410c);
  border: 2px solid rgba(124, 45, 18, .45);
  border-radius: 12px 12px 18px 18px;
  bottom: 2px;
  height: 18px;
  left: 13px;
  width: 36px;
}

.pet-action-prop.prop-berry,
.pet-action-prop.prop-cookie {
  animation: petToyBob 1.1s ease-in-out infinite;
  background:
    radial-gradient(circle at 35% 30%, #ffffff, transparent 18%),
    radial-gradient(circle at 50% 50%, #f97316, #b45309 68%);
  border: 2px solid rgba(124, 45, 18, .42);
  border-radius: 999px;
  bottom: 8px;
  height: 24px;
  left: 22px;
  width: 24px;
}

.pet-action-prop.prop-berry {
  background:
    radial-gradient(circle at 36% 28%, #dbeafe, transparent 17%),
    radial-gradient(circle at 50% 50%, #60a5fa, #1d4ed8 70%);
}

.pet-action-prop.prop-mug {
  animation: mugSteam 2s ease-in-out infinite;
  background:
    radial-gradient(ellipse at 72% 52%, transparent 0 34%, #67e8f9 36% 48%, transparent 50%),
    linear-gradient(180deg, #ecfeff, #67e8f9);
  border: 2px solid rgba(14, 116, 144, .42);
  border-radius: 6px 6px 12px 12px;
  bottom: 5px;
  height: 28px;
  left: 20px;
  width: 25px;
}

.pet-action-prop.prop-book {
  animation: bookPageFlip 2.4s ease-in-out infinite;
  background:
    linear-gradient(90deg, #ffffff 0 47%, #2563eb 48% 52%, #dbeafe 53% 100%);
  border: 2px solid rgba(37, 99, 235, .52);
  border-radius: 5px;
  bottom: 6px;
  height: 30px;
  left: 13px;
  transform: perspective(220px) rotateX(22deg) rotateZ(-5deg);
  width: 54px;
}

.pet-action-prop.prop-cards {
  animation: cardShuffle 1.9s ease-in-out infinite;
  background:
    linear-gradient(90deg, #bfdbfe 0 31%, #ffffff 32% 65%, #fecaca 66% 100%);
  border: 2px solid rgba(37, 99, 235, .45);
  border-radius: 6px;
  bottom: 7px;
  height: 26px;
  left: 16px;
  width: 46px;
}

.pet-action-prop.prop-puzzle {
  animation: puzzleWiggle 1.7s ease-in-out infinite;
  background:
    radial-gradient(circle at 68% 24%, #fff 0 10%, transparent 11%),
    linear-gradient(45deg, #a7f3d0 0 50%, #ddd6fe 51% 100%);
  border: 2px solid rgba(15, 118, 110, .42);
  border-radius: 7px;
  bottom: 6px;
  height: 31px;
  left: 17px;
  width: 42px;
}

.pet-action-prop.prop-ball,
.pet-action-prop.prop-toy {
  animation: ballChase 1.25s ease-in-out infinite;
  background:
    radial-gradient(circle at 34% 28%, #ffffff, transparent 18%),
    radial-gradient(circle at 50% 50%, #60a5fa, #2563eb 68%);
  border: 2px solid rgba(37, 99, 235, .42);
  border-radius: 999px;
  bottom: 8px;
  height: 28px;
  right: -18px;
  width: 28px;
}

.pet-action-prop.prop-toy {
  background:
    radial-gradient(circle at 35% 28%, #fef3c7, transparent 18%),
    radial-gradient(circle at 50% 50%, #f59e0b, #d97706 68%);
}

.pet-action-prop.prop-pillow,
.pet-action-prop.prop-blanket {
  background: linear-gradient(135deg, rgba(219, 234, 254, .98), rgba(147, 197, 253, .96));
  border: 2px solid rgba(37, 99, 235, .36);
  border-radius: 14px;
  bottom: 2px;
  height: 25px;
  left: 12px;
  transform: perspective(240px) rotateX(28deg);
  width: 62px;
  z-index: 4;
}

.pet-action-prop.prop-blanket {
  background: linear-gradient(135deg, rgba(224, 231, 255, .96), rgba(196, 181, 253, .96));
  width: 72px;
}

.pet-action-prop.prop-spark,
.pet-action-prop.prop-kit {
  background: linear-gradient(135deg, #ffffff, #fef08a);
  border: 2px solid rgba(202, 138, 4, .38);
  border-radius: 8px;
  bottom: 16px;
  height: 26px;
  right: -4px;
  transform: rotate(14deg);
  width: 26px;
}

.home-pet.is-eating::before,
.home-pet.is-snacking::before,
.home-pet.is-treating::before,
.home-pet.is-sipping::before,
.home-pet.is-studying::before,
.home-pet.is-planning::before,
.home-pet.is-puzzling::before,
.home-pet.is-playing::before,
.home-pet.is-chasing::before,
.home-pet.is-bouncing::before,
.home-pet.is-sleeping::before,
.home-pet.is-cozy::before {
  content: none !important;
  display: none !important;
}

.home-pet.is-chasing,
.home-pet.is-bouncing {
  animation: petRunAround 3.2s ease-in-out infinite;
}

.home-pet.is-playing {
  animation: petPlayAround 2.5s ease-in-out infinite;
}

.home-pet.is-studying,
.home-pet.is-planning,
.home-pet.is-puzzling {
  animation: petLeanIn 3s ease-in-out infinite;
}

.home-pet.is-eating,
.home-pet.is-snacking,
.home-pet.is-treating,
.home-pet.is-sipping {
  animation: petStepToFood 2.2s ease-in-out infinite;
}

.home-pet.is-sleeping img {
  animation: petSleep 3.5s ease-in-out infinite;
  filter: saturate(.85);
}

.home-pet.is-sleeping::after {
  display: none;
}

.home-pet.is-eating img {
  animation: petNibble 1.4s ease-in-out infinite;
}

.home-pet.is-snacking img,
.home-pet.is-treating img {
  animation: petNibble 1.1s ease-in-out infinite;
}

.home-pet.is-sipping img {
  animation: petSip 1.8s ease-in-out infinite;
}

.home-pet.is-eating::before {
  background: linear-gradient(180deg, #fff7ed, #fb923c 62%, #c2410c);
  border: 2px solid rgba(124, 45, 18, .45);
  border-radius: 12px 12px 16px 16px;
  bottom: 8px;
  content: "";
  height: 13px;
  left: 22px;
  position: absolute;
  transform: rotate(-4deg);
  width: 28px;
  z-index: 15;
}

.home-pet.is-snacking::before,
.home-pet.is-treating::before {
  background: radial-gradient(circle at 35% 28%, #fecaca, #f97316 62%, #c2410c);
  border: 2px solid rgba(124, 45, 18, .42);
  border-radius: 999px;
  bottom: 10px;
  content: "";
  height: 17px;
  left: 24px;
  position: absolute;
  width: 17px;
  z-index: 15;
}

.home-pet.is-sipping::before {
  background: linear-gradient(180deg, #ecfeff, #67e8f9);
  border: 2px solid rgba(14, 116, 144, .42);
  border-radius: 4px 4px 9px 9px;
  bottom: 9px;
  content: "";
  height: 22px;
  left: 24px;
  position: absolute;
  transform: rotate(-5deg);
  width: 18px;
  z-index: 15;
}

.home-pet.is-studying img {
  animation: petStudy 2.6s ease-in-out infinite;
}

.home-pet.is-planning img,
.home-pet.is-puzzling img {
  animation: petStudy 2.2s ease-in-out infinite;
}

.home-pet.is-studying::before {
  background: linear-gradient(90deg, #ffffff 0 48%, #dbeafe 49% 100%);
  border: 2px solid rgba(37, 99, 235, .55);
  border-radius: 5px;
  bottom: 12px;
  content: "";
  height: 18px;
  left: 18px;
  position: absolute;
  transform: rotate(-8deg);
  width: 42px;
  z-index: 15;
}

.home-pet.is-planning::before {
  background:
    linear-gradient(90deg, #bfdbfe 0 31%, #ffffff 32% 65%, #fecaca 66% 100%);
  border: 2px solid rgba(37, 99, 235, .45);
  border-radius: 5px;
  bottom: 12px;
  content: "";
  height: 22px;
  left: 18px;
  position: absolute;
  transform: rotate(-7deg);
  width: 42px;
  z-index: 15;
}

.home-pet.is-puzzling::before {
  background:
    linear-gradient(45deg, #a7f3d0 0 50%, #ddd6fe 51% 100%);
  border: 2px solid rgba(15, 118, 110, .42);
  border-radius: 6px;
  bottom: 12px;
  content: "";
  height: 26px;
  left: 18px;
  position: absolute;
  transform: rotate(-7deg);
  width: 34px;
  z-index: 15;
}

.home-pet.is-playing img {
  animation: petExcited 1.5s ease-in-out infinite;
}

.home-pet.is-chasing img,
.home-pet.is-bouncing img {
  animation: petExcited 1.15s ease-in-out infinite;
}

.home-pet.is-playing::before {
  background: radial-gradient(circle at 35% 28%, #fef3c7, #f59e0b 62%, #d97706);
  border: 2px solid rgba(146, 64, 14, .45);
  border-radius: 999px;
  bottom: 8px;
  content: "";
  height: 22px;
  position: absolute;
  right: 15px;
  width: 22px;
  z-index: 15;
  animation: petToyBob 1.2s ease-in-out infinite;
}

.home-pet.is-chasing::before,
.home-pet.is-bouncing::before {
  background: radial-gradient(circle at 35% 28%, #dbeafe, #60a5fa 58%, #2563eb);
  border: 2px solid rgba(37, 99, 235, .45);
  border-radius: 999px;
  bottom: 8px;
  content: "";
  height: 21px;
  position: absolute;
  right: 14px;
  width: 21px;
  z-index: 15;
  animation: toyBounce 900ms ease-in-out infinite;
}

.home-pet.is-sleeping::before {
  background: linear-gradient(135deg, rgba(219, 234, 254, .95), rgba(147, 197, 253, .95));
  border: 2px solid rgba(37, 99, 235, .42);
  border-radius: 9px;
  bottom: 7px;
  content: "";
  height: 18px;
  left: 18px;
  position: absolute;
  transform: rotate(-8deg);
  width: 56px;
  z-index: 4;
}

.home-pet.is-cozy img {
  animation: petSleep 4s ease-in-out infinite;
}

.home-pet.is-cozy::before {
  background: linear-gradient(135deg, rgba(224, 231, 255, .96), rgba(196, 181, 253, .96));
  border: 2px solid rgba(109, 40, 217, .38);
  border-radius: 10px;
  bottom: 7px;
  content: "";
  height: 22px;
  left: 17px;
  position: absolute;
  transform: rotate(-7deg);
  width: 64px;
  z-index: 4;
}

.home-pet.is-stretching img {
  animation: petStretch 2.7s ease-in-out infinite;
}

.home-pet.is-checking img {
  animation: petHappy 1.8s ease-in-out infinite;
}

.home-pet.is-playing:not(.dragging) {
  animation: petRunAround 5.8s ease-in-out infinite;
}

.home-pet.is-eating::before,
.home-pet.is-snacking::before,
.home-pet.is-treating::before,
.home-pet.is-sipping::before,
.home-pet.is-studying::before,
.home-pet.is-planning::before,
.home-pet.is-puzzling::before,
.home-pet.is-playing::before,
.home-pet.is-chasing::before,
.home-pet.is-bouncing::before,
.home-pet.is-sleeping::before,
.home-pet.is-cozy::before {
  content: none !important;
  display: none !important;
}

.pet-room-controls {
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  left: 14px;
  position: absolute;
  right: 14px;
  z-index: 24;
}

.pet-room-controls button {
  background: rgba(17,24,39,.9);
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
}

@keyframes petSleep {
  0%, 100% { transform: translateY(0) rotate(-10deg) scale(.95); opacity: .88; }
  50% { transform: translateY(3px) rotate(-12deg) scale(.92); opacity: .72; }
}

@keyframes petNibble {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(2px) scale(.97); }
}

@keyframes petStudy {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-2px) rotate(1deg); }
}

@keyframes petSip {
  0%, 100% { transform: translateY(0) rotate(0); }
  40% { transform: translateY(1px) rotate(-3deg); }
  70% { transform: translateY(0) rotate(2deg); }
}

@keyframes petStretch {
  0%, 100% { transform: translateX(0) scale(1); }
  45% { transform: translateX(4px) scaleX(1.08) scaleY(.94); }
  70% { transform: translateX(-2px) scaleX(.98) scaleY(1.03); }
}

@keyframes toyBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); }
}

@keyframes toyRoomIdle {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-4px) rotate(3deg); }
}

@keyframes mugSteam {
  0%, 100% { transform: translateY(0) rotate(0); filter: drop-shadow(0 8px 7px rgba(15, 23, 42, .25)); }
  50% { transform: translateY(-2px) rotate(-2deg); filter: drop-shadow(0 10px 9px rgba(15, 23, 42, .2)); }
}

@keyframes bookPageFlip {
  0%, 100% { transform: perspective(220px) rotateX(22deg) rotateZ(-5deg) scale(1); }
  50% { transform: perspective(220px) rotateX(18deg) rotateZ(3deg) scale(1.04); }
}

@keyframes cardShuffle {
  0%, 100% { transform: translateX(0) rotate(-5deg); }
  35% { transform: translateX(3px) rotate(4deg); }
  70% { transform: translateX(-2px) rotate(-2deg); }
}

@keyframes puzzleWiggle {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(5deg) translateY(-2px); }
}

@keyframes ballChase {
  0%, 100% { transform: translate(0, 0) scale(1); }
  28% { transform: translate(18px, -10px) scale(1.05); }
  58% { transform: translate(-10px, 6px) scale(.98); }
}

@keyframes petPlayAround {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25% { transform: translate(18px, -10px) rotate(4deg); }
  55% { transform: translate(4px, 8px) rotate(-3deg); }
  78% { transform: translate(-12px, 2px) rotate(2deg); }
}

@keyframes petLeanIn {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(4px) rotate(-2deg); }
}

@keyframes petStepToFood {
  0%, 100% { transform: translateX(0); }
  45% { transform: translateX(-6px) translateY(2px); }
}

@keyframes petSpeechIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes petRunAround {
  0%, 100% { transform: translate(0, 0); }
  22% { transform: translate(38px, -16px); }
  46% { transform: translate(76px, 6px); }
  68% { transform: translate(28px, 26px); }
  84% { transform: translate(-18px, 8px); }
}

@keyframes sleepBubble {
  0%, 100% { opacity: .55; transform: translateY(0) scale(.9); }
  50% { opacity: 1; transform: translateY(-8px) scale(1); }
}

@keyframes hotspotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(20,184,166,.14); }
  50% { box-shadow: 0 0 0 8px rgba(20,184,166,.08); }
}

.home-pet.active {
  filter: none;
}

.home-pet.dragging {
  cursor: grabbing;
  transform: scale(1.06);
  z-index: 40;
}

.home-empty {
  background: rgba(255,255,255,.86);
  border-radius: 8px;
  color: #475467;
  left: 24px;
  margin: 0;
  padding: 12px;
  position: absolute;
  top: 24px;
}

.pet-shop-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.pet-shop-group {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #d7deea;
  border-radius: 8px;
  overflow: hidden;
}

.pet-shop-group summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 900;
  justify-content: space-between;
  padding: 11px 12px;
}

.pet-shop-group summary span {
  background: #e7f6f4;
  border-radius: 999px;
  color: #0f766e;
  font-size: 12px;
  padding: 3px 8px;
}

.pet-shop-group-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  padding: 0 10px 10px;
}

.pet-shop-card {
  align-items: center;
  background: #ffffff;
  border: 1px solid #d7deea;
  border-radius: 8px;
  color: #334155;
  cursor: pointer;
  display: grid;
  gap: 11px;
  grid-template-columns: 78px minmax(0, 1fr);
  min-height: 104px;
  padding: 10px;
  text-align: left;
}

.pet-shop-card img {
  background:
    radial-gradient(circle at 50% 36%, rgba(255,255,255,.92), rgba(236,253,245,.55) 42%, rgba(219,234,254,.58) 100%);
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 8px 18px rgba(15,23,42,.08);
  height: 74px;
  object-fit: contain;
  padding: 5px;
  width: 74px;
  transition: transform .16s ease, filter .16s ease;
}

.pet-shop-card span {
  display: grid;
  gap: 2px;
}

.pet-shop-card small {
  color: #64748b;
  line-height: 1.25;
}

.pet-shop-card em {
  color: #0f766e;
  font-style: normal;
  font-weight: 800;
}

.pet-shop-card:hover:not(:disabled) {
  border-color: #82c7bf;
  box-shadow: 0 14px 30px rgba(26, 39, 68, 0.14);
  transform: translateY(-2px);
}

.pet-shop-card:hover:not(:disabled) img {
  filter: saturate(1.08) contrast(1.03);
  transform: scale(1.04);
}

.pet-shop-card:disabled,
.pet-shop-card.locked {
  opacity: 0.72;
}

.pet-shop-card.locked {
  cursor: help;
}

.pet-shop-card.equipped {
  background: linear-gradient(180deg, #ffffff, #ecfdf5);
  border-color: #0e8a80;
  box-shadow: 0 0 0 3px rgba(20,184,166,.14);
}

.pet-shop-card.pending {
  background: linear-gradient(180deg, #fffbeb, #ffffff);
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .18);
}

.pet-shop-card.pending em {
  color: #92400e;
}

.badge-chip,
.item-chip {
  border: 1px solid #d7deea;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  align-items: center;
  display: inline-flex;
  gap: 9px;
  min-width: 168px;
  padding: 9px 10px;
  text-align: left;
}

button.item-chip {
  cursor: pointer;
  font: inherit;
}

.equip-chip {
  display: inline-flex;
  flex-wrap: wrap;
  min-width: 220px;
}

.equip-chip-main {
  align-items: center;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  flex: 1;
  gap: 9px;
  min-width: 150px;
  padding: 0;
  text-align: left;
}

.equip-chip img {
  background:
    radial-gradient(circle at 50% 35%, #ffffff, #eef7ff);
  border: 1px solid rgba(148, 163, 184, .28);
  border-radius: 8px;
  height: 44px;
  object-fit: contain;
  padding: 3px;
  width: 44px;
}

.equip-chip span {
  flex: 1;
  font-weight: 800;
}

.equip-chip.equipped {
  background: linear-gradient(180deg, #ffffff, #ecfdf5);
  border-color: #0e8a80;
  box-shadow: 0 0 0 3px rgba(20,184,166,.12);
}

button.item-chip:hover,
.equip-chip-main:hover,
.owned-pet-select:hover {
  box-shadow: 0 10px 22px rgba(26, 39, 68, 0.12);
  transform: translateY(-1px);
}

.sell-chip {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  color: #9a3412;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 10px;
  white-space: nowrap;
}

.sell-chip:hover {
  background: #ffedd5;
  border-color: #fb923c;
  transform: translateY(-1px);
}

.pet-sell {
  grid-column: 1 / -1;
  justify-self: start;
}

button.badge-chip {
  cursor: pointer;
  font: inherit;
}

button.badge-chip:hover {
  box-shadow: 0 10px 22px rgba(26, 39, 68, 0.12);
  transform: translateY(-1px);
}

.badge-chip img {
  flex: 0 0 auto;
  height: 42px;
  width: 42px;
}

.badge-chip > span {
  display: grid;
  gap: 2px;
}

.badge-chip small {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge-chip strong,
.item-chip strong {
  color: #111827;
}

.badge-chip.locked {
  opacity: 0.55;
  filter: grayscale(0.9);
}

.badge-chip.earned {
  box-shadow: 0 8px 18px rgba(26, 39, 68, 0.08);
  filter: none;
}

.mini-game-hub {
  display: grid;
  gap: 16px;
}

.mini-game-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  perspective: 1200px;
}

.mini-game-wallet {
  background:
    radial-gradient(circle at 4% 20%, rgba(248, 113, 113, .22), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(20, 184, 166, .24), transparent 32%),
    linear-gradient(135deg, #fff7ed, #ecfeff 52%, #f5f3ff);
  border: 1px solid rgba(245, 158, 11, .55);
  border-radius: 8px;
  color: #26334b;
  font-weight: 800;
  padding: 12px 14px;
}

.mini-game-wallet strong {
  color: #92400e;
}

.mini-game-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,.96)),
    radial-gradient(circle at 86% 22%, rgba(242, 140, 56, .2), transparent 30%),
    linear-gradient(145deg, #ffffff, #effaf8);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 14px;
  box-shadow:
    0 22px 48px rgba(15, 23, 42, .16),
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 -14px 22px rgba(15, 23, 42, .045);
  color: #152033;
  cursor: pointer;
  display: grid;
  gap: 8px;
  min-height: 250px;
  overflow: hidden;
  padding: 18px;
  position: relative;
  text-align: left;
  transform-style: preserve-3d;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.mini-game-card::before {
  background:
    radial-gradient(circle at 24% 22%, rgba(255,255,255,.78), transparent 18%),
    radial-gradient(circle at 76% 90%, rgba(15,23,42,.12), transparent 28%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.mini-game-card:nth-child(4n + 1) {
  background:
    radial-gradient(circle at 88% 14%, rgba(45, 212, 191, .28), transparent 32%),
    linear-gradient(145deg, #ffffff, #eff6ff);
}

.mini-game-card:nth-child(4n + 2) {
  background:
    radial-gradient(circle at 86% 18%, rgba(251, 146, 60, .28), transparent 32%),
    linear-gradient(145deg, #ffffff, #fff7ed);
}

.mini-game-card:nth-child(4n + 3) {
  background:
    radial-gradient(circle at 86% 18%, rgba(168, 85, 247, .22), transparent 32%),
    linear-gradient(145deg, #ffffff, #f5f3ff);
}

.mini-game-card:nth-child(4n) {
  background:
    radial-gradient(circle at 86% 18%, rgba(244, 63, 94, .18), transparent 32%),
    linear-gradient(145deg, #ffffff, #fdf2f8);
}

.mini-game-card:hover {
  border-color: #0e8a80;
  box-shadow:
    0 30px 62px rgba(14, 138, 128, .2),
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 -16px 24px rgba(15, 23, 42, .055);
  transform: translateY(-6px) rotateX(3deg);
}

.mini-game-card.locked,
.mini-game-card:disabled {
  cursor: not-allowed;
  filter: grayscale(.85);
  opacity: .62;
  transform: none;
}

.mini-game-card span,
.mini-game-card em {
  background: rgba(255,255,255,.82);
  border-radius: 999px;
  color: #0f766e;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  justify-self: start;
  padding: 4px 9px;
}

.mini-game-card > * {
  position: relative;
  z-index: 1;
}

.game-card-top {
  align-items: center;
  background: transparent !important;
  display: flex;
  justify-content: space-between;
  padding: 0 !important;
  width: 100%;
}

.mini-game-card .game-time,
.mini-game-card .game-cost {
  background: rgba(255,255,255,.84);
  border: 1px solid rgba(203, 213, 225, .72);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
  color: #0f766e;
  padding: 5px 9px;
}

.game-token {
  align-self: center;
  background-color: #ffffff;
  border-radius: 18px;
  box-shadow:
    0 18px 28px rgba(15, 23, 42, .18),
    inset 0 1px 0 rgba(255,255,255,.65);
  display: block;
  height: 112px;
  justify-self: center !important;
  overflow: hidden;
  padding: 0 !important;
  position: relative;
  width: 138px;
  transform: translateZ(24px);
}

.game-token img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.game-token i {
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, .22), transparent 62%);
  bottom: -18px;
  display: block;
  height: 28px;
  left: 12%;
  position: absolute;
  width: 76%;
}

.mini-game-card strong {
  font-size: 20px;
}

.mini-game-card small {
  color: #475569;
  line-height: 1.4;
}

.mini-game-play {
  background:
    radial-gradient(circle at 16% 0%, rgba(47, 111, 237, .2), transparent 32%),
    radial-gradient(circle at 96% 2%, rgba(251, 146, 60, .18), transparent 28%),
    linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(220, 228, 239, .95);
  border-radius: 16px;
  box-shadow:
    0 26px 60px rgba(15, 23, 42, .15),
    inset 0 1px 0 rgba(255,255,255,.96);
  display: grid;
  gap: 16px;
  padding: 22px;
}

.mini-game-top {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.mini-game-top span {
  color: #0f766e;
  font-weight: 900;
}

.mini-progress {
  background: #e2e8f0;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.mini-progress i {
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--orange));
  display: block;
  height: 100%;
}

.mini-choice-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.mini-choice-grid button {
  background: #ffffff;
  border: 1px solid #d7deea;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
  padding: 16px;
  text-align: left;
}

.mini-choice-grid button:hover {
  background: #ecfdf5;
  border-color: #0e8a80;
  box-shadow: 0 12px 24px rgba(14, 138, 128, .12);
  transform: translateY(-2px);
}

.mini-feedback,
.mini-score {
  color: #475569;
  font-weight: 800;
  margin: 0;
}

.mini-result {
  border-radius: 999px;
  font-size: 14px;
  font-weight: 950;
  justify-self: start;
  margin: 0;
  padding: 8px 12px;
}

.mini-result.won {
  background: #dcfce7;
  color: #166534;
}

.mini-result.tied {
  background: #e0f2fe;
  color: #075985;
}

.mini-result.lost {
  background: #fee2e2;
  color: #991b1b;
}

.mini-game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mini-game-overlay {
  align-items: center;
  background: rgba(15, 23, 42, .48);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 120;
}

.mini-game-overlay[hidden] {
  display: none;
}

.mini-game-modal {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, .28);
  max-height: min(760px, 92vh);
  max-width: 760px;
  overflow: auto;
  padding: 24px;
  position: relative;
  width: min(760px, 94vw);
}

.mini-game-offer {
  display: grid;
  gap: 16px;
}

.video-reward-offer {
  text-align: left;
}

.video-reward-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-board {
  display: grid;
  gap: 10px;
}

.mini-board.ticTacToe {
  background: linear-gradient(145deg, #9a5a2d, #5f351c);
  border: 10px solid #7c451f;
  border-radius: 18px;
  box-shadow:
    0 22px 34px rgba(92, 54, 26, .28),
    inset 0 4px 10px rgba(255,255,255,.18),
    inset 0 -8px 18px rgba(0,0,0,.22);
  grid-template-columns: repeat(3, minmax(64px, 1fr));
  padding: 10px;
  transform: rotateX(4deg);
}

.mini-board.memoryMatch,
.mini-board.colorEcho,
.mini-board.starCatch,
.mini-board.balloonPop {
  grid-template-columns: repeat(4, minmax(58px, 1fr));
}

.mini-board.starCatch {
  grid-template-columns: repeat(3, minmax(72px, 1fr));
}

.mini-board.balloonPop {
  background:
    url("./assets/games/arcade-realistic-sheet.png") center 12% / 120% auto no-repeat,
    linear-gradient(180deg, rgba(219, 234, 254, .8), rgba(236, 253, 245, .88)),
    repeating-linear-gradient(90deg, rgba(14, 165, 233, .1) 0 1px, transparent 1px 28px);
  border: 1px solid rgba(125, 211, 252, .72);
  border-radius: 18px;
  box-shadow: inset 0 0 0 999px rgba(255,255,255,.62), 0 22px 38px rgba(14, 165, 233, .16);
  padding: 12px;
}

.mini-board.connectFour {
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  border: 12px solid #1e40af;
  border-radius: 20px;
  box-shadow:
    0 24px 42px rgba(30, 64, 175, .28),
    inset 0 5px 10px rgba(255,255,255,.22),
    inset 0 -10px 18px rgba(15,23,42,.22);
  grid-template-columns: repeat(7, minmax(38px, 1fr));
  padding: 10px;
  transform: rotateX(3deg);
}

.mini-board button {
  aspect-ratio: 1;
  background: linear-gradient(180deg, #ffffff, #eef8f7);
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 900;
}

.mini-board.ticTacToe button {
  background: linear-gradient(145deg, #f8d8a2, #b97939);
  border: 2px solid rgba(89, 49, 22, .48);
  box-shadow: inset 0 2px 8px rgba(255,255,255,.28), inset 0 -8px 14px rgba(69,36,15,.28);
  color: #fef3c7;
  font-size: clamp(28px, 6vw, 54px);
  min-height: 86px;
  text-shadow: 0 3px 8px rgba(49, 26, 11, .35);
}

.mini-board.ticTacToe button.filled {
  border-color: rgba(127, 29, 29, .7);
  color: #ffffff;
  text-shadow: 0 3px 10px rgba(15, 23, 42, .42);
}

.mini-board.ticTacToe button.mark-X {
  background: radial-gradient(circle at 34% 24%, #ffffff, #ef4444 32%, #991b1b 88%);
  border-color: rgba(127, 29, 29, .7);
  color: #ffffff;
}

.mini-board.ticTacToe button.mark-O {
  background: radial-gradient(circle at 34% 24%, #fff7ed, #d6a461 42%, #8a5724 88%);
  border-color: rgba(120, 72, 31, .72);
  color: #fff7ed;
}

.mini-board.ticTacToe button.filled:has(:empty) {
  background: #ffffff;
}

.mini-board button:hover {
  border-color: #0f766e;
  box-shadow: 0 10px 24px rgba(14, 138, 128, .14);
  transform: translateY(-2px);
}

.connect-drop-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(7, minmax(42px, 1fr));
}

.connect-drop-row button {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  color: #92400e;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 6px;
}

.mini-board.connectFour span {
  aspect-ratio: 1;
  background: radial-gradient(circle at 35% 30%, #ffffff, #bfdbfe 42%, #93c5fd);
  border-radius: 999px;
  box-shadow: inset 0 5px 12px rgba(15, 23, 42, .34), 0 2px 0 rgba(255,255,255,.35);
  display: block;
}

.mini-board.connectFour .piece.player {
  background: radial-gradient(circle at 35% 28%, #ccfbf1, #14b8a6 45%, #0f766e);
  box-shadow: inset -5px -8px 12px rgba(15, 118, 110, .55), inset 5px 5px 10px rgba(255,255,255,.45);
}

.mini-board.connectFour .piece.cpu {
  background: radial-gradient(circle at 35% 28%, #ffedd5, #fb923c 45%, #c2410c);
  box-shadow: inset -5px -8px 12px rgba(154, 52, 18, .55), inset 5px 5px 10px rgba(255,255,255,.45);
}

.mini-sequence {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-sequence span {
  background: #ecfeff;
  border: 1px solid #67e8f9;
  border-radius: 999px;
  color: #155e75;
  font-weight: 900;
  padding: 8px 12px;
}

.memory-card {
  color: #0f172a;
  font-size: 28px;
  min-height: 74px;
  box-shadow:
    0 14px 22px rgba(15,23,42,.14),
    inset 0 1px 0 rgba(255,255,255,.85),
    inset 0 -8px 14px rgba(15,23,42,.08);
  transform: rotateX(3deg);
}

.mini-board.memoryMatch {
  background:
    radial-gradient(circle at 15% 10%, rgba(139, 92, 246, .14), transparent 32%),
    linear-gradient(145deg, #f8fafc, #eef2ff);
  border: 1px solid rgba(165, 180, 252, .65);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 18px 32px rgba(99, 102, 241, .12);
  padding: 12px;
}

.mini-board.colorEcho {
  background: linear-gradient(145deg, #111827, #263143);
  border: 1px solid rgba(15, 23, 42, .5);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 20px 34px rgba(15, 23, 42, .22);
  padding: 12px;
}

.mini-board.starCatch {
  background:
    radial-gradient(circle at 20% 20%, rgba(253, 224, 71, .22), transparent 20%),
    radial-gradient(circle at 80% 60%, rgba(96, 165, 250, .22), transparent 24%),
    linear-gradient(145deg, #172554, #312e81);
  border: 1px solid rgba(129, 140, 248, .55);
  border-radius: 16px;
  box-shadow: 0 22px 38px rgba(30, 41, 59, .25), inset 0 1px 0 rgba(255,255,255,.12);
  padding: 12px;
}

.memory-card.sun { background: linear-gradient(145deg, #fef3c7, #f97316); color: #7c2d12; }
.memory-card.teal { background: linear-gradient(145deg, #ccfbf1, #14b8a6); color: #134e4a; }
.memory-card.rose { background: linear-gradient(145deg, #ffe4e6, #fb7185); color: #881337; }
.memory-card.violet { background: linear-gradient(145deg, #ede9fe, #8b5cf6); color: #3b0764; }

.color-pad.teal { background: #14b8a6; color: #ffffff; }
.color-pad.orange { background: #f97316; color: #ffffff; }
.color-pad.violet { background: #8b5cf6; color: #ffffff; }
.color-pad.rose { background: #f43f5e; color: #ffffff; }

.color-pad {
  box-shadow: inset 0 10px 18px rgba(255,255,255,.22), inset 0 -12px 20px rgba(15,23,42,.24), 0 14px 22px rgba(15,23,42,.18);
}

.starCatch button {
  min-height: 78px;
}

.starCatch .star-target {
  animation: starPulse 900ms ease-in-out infinite alternate;
  background: radial-gradient(circle, #fde68a, #f59e0b 55%, #f97316);
  border-color: #f59e0b;
  color: #78350f;
  font-size: 32px;
}

.balloonPop button {
  align-items: center;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  justify-items: center;
  min-height: 72px;
  padding: 4px;
}

.balloonPop button:hover {
  box-shadow: none;
}

.balloonPop .balloon span {
  border-radius: 55% 55% 50% 50%;
  box-shadow:
    inset -9px -12px 18px rgba(15, 23, 42, .16),
    inset 7px 7px 12px rgba(255, 255, 255, .42),
    0 10px 22px rgba(15, 23, 42, .14);
  display: block;
  height: 54px;
  position: relative;
  transform-origin: center bottom;
  width: 42px;
}

.balloonPop .balloon span::after {
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 8px solid currentColor;
  bottom: -7px;
  content: "";
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
}

.balloonPop .balloon.pink span { background: linear-gradient(145deg, #fecdd3, #f43f5e); color: #be123c; }
.balloonPop .balloon.blue span { background: linear-gradient(145deg, #bfdbfe, #2563eb); color: #1d4ed8; }
.balloonPop .balloon.yellow span { background: linear-gradient(145deg, #fef3c7, #f59e0b); color: #b45309; }
.balloonPop .balloon.green span { background: linear-gradient(145deg, #bbf7d0, #22c55e); color: #15803d; }
.balloonPop .balloon.purple span { background: linear-gradient(145deg, #ddd6fe, #8b5cf6); color: #6d28d9; }
.balloonPop .balloon.coral span { background: linear-gradient(145deg, #fed7aa, #fb7185); color: #e11d48; }

.balloonPop .balloon.target span {
  animation: balloonBob 620ms ease-in-out infinite alternate;
  outline: 4px solid rgba(250, 204, 21, .72);
  outline-offset: 5px;
}

@keyframes balloonBob {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-5px) scale(1.08); }
}

@media (max-width: 700px) {
  .mini-game-grid {
    grid-template-columns: 1fr;
  }

  .mini-game-card {
    min-height: 220px;
  }

  .game-token {
    height: 96px;
    width: 118px;
  }

  .connect-drop-row {
    grid-template-columns: repeat(7, minmax(30px, 1fr));
  }

  .connect-drop-row button {
    font-size: 0;
    padding: 10px 4px;
  }

  .connect-drop-row button::after {
    content: "↓";
    font-size: 16px;
  }
}

@keyframes starPulse {
  from { box-shadow: 0 0 0 rgba(245, 158, 11, .2); }
  to { box-shadow: 0 0 24px rgba(245, 158, 11, .55); }
}

.badge-chip[data-tier="Meteorite"].earned {
  border-color: #94a3b8;
  background: linear-gradient(180deg, #ffffff, #f1f5f9);
}

.badge-chip[data-tier="Moon"].earned {
  border-color: #a5b4fc;
  background: linear-gradient(180deg, #ffffff, #eef2ff);
}

.badge-chip[data-tier="Earth"].earned {
  border-color: #86efac;
  background: linear-gradient(180deg, #ffffff, #ecfdf5);
}

.badge-chip[data-tier="Sun"].earned {
  border-color: #fbbf24;
  background: linear-gradient(180deg, #ffffff, #fffbeb);
}

.badge-chip[data-tier="Black Hole"].earned {
  border-color: #111827;
  background: linear-gradient(135deg, #111827, #4338ca);
  color: white;
}

.badge-chip[data-tier="Black Hole"].earned small,
.badge-chip[data-tier="Black Hole"].earned strong {
  color: white;
}

.reward-grid {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.xp-theme .main-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f0fdfa 100%);
}

.modal-backdrop {
  align-items: center;
  background: rgba(15, 23, 42, 0.52);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 10000;
}

.modal-backdrop[hidden] {
  display: none;
}

.badge-modal {
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.34);
  max-width: 560px;
  padding: 20px;
  position: relative;
  width: min(100%, 560px);
}

.modal-close {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 22px;
  height: 36px;
  line-height: 1;
  position: absolute;
  right: 12px;
  top: 12px;
  width: 36px;
}

.badge-modal-head {
  align-items: center;
  display: grid;
  gap: 14px;
  grid-template-columns: 96px minmax(0, 1fr);
  padding-right: 32px;
}

.badge-modal-head img {
  height: 96px;
  width: 96px;
}

.badge-modal-head h2 {
  margin: 0 0 8px;
}

.badge-modal-head p {
  color: var(--muted);
  margin: 0;
}

.badge-progress-detail {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 12px;
}

.xp-toast {
  animation: xpToastIn 2400ms ease forwards;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(17, 24, 39, 0.28);
  color: white;
  display: grid;
  gap: 2px;
  left: 50%;
  min-width: 220px;
  padding: 13px 16px;
  position: fixed;
  text-align: center;
  top: 24px;
  transform: translateX(-50%);
  z-index: 9999;
}

.xp-toast strong {
  font-size: 22px;
  line-height: 1.1;
}

.xp-toast span {
  color: #cbd5e1;
  font-size: 13px;
}

.xp-fireworks {
  height: 1px;
  left: 50%;
  pointer-events: none;
  position: fixed;
  top: 88px;
  width: 1px;
  z-index: 9998;
}

.xp-fireworks i {
  animation: xpSpark 900ms ease-out forwards;
  background: var(--c);
  border-radius: 999px;
  display: block;
  height: 7px;
  left: 0;
  position: absolute;
  top: 0;
  width: 7px;
}

.action-toast {
  animation: actionToast 1500ms ease forwards;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 8px;
  bottom: 22px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, .22);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  left: 50%;
  max-width: min(420px, calc(100vw - 32px));
  padding: 10px 14px;
  pointer-events: none;
  position: fixed;
  text-align: center;
  transform: translateX(-50%);
  z-index: 10001;
}

.action-toast.success {
  background: #0f766e;
}

.action-toast.warning {
  background: #9a6700;
}

.interaction-ripple {
  animation: interactionRipple 620ms ease-out forwards;
  background: rgba(47, 111, 237, .16);
  border-radius: 999px;
  pointer-events: none;
  position: absolute;
  transform: scale(0);
  z-index: 0;
}

button > :not(.interaction-ripple),
.answer > :not(.interaction-ripple),
.launch-card > :not(.interaction-ripple),
.practice-path-card > :not(.interaction-ripple),
.plan-activity > :not(.interaction-ripple),
.pet-shop-card > :not(.interaction-ripple),
.owned-pet-card > :not(.interaction-ripple),
.guide-card > :not(.interaction-ripple),
.lecture-card > :not(.interaction-ripple) {
  position: relative;
  z-index: 1;
}

@keyframes xpToastIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -14px) scale(0.96);
  }
  12%,
  78% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -10px) scale(0.98);
  }
}

@keyframes xpSpark {
  0% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(var(--x), var(--y)) scale(0.2);
  }
}

@keyframes actionToast {
  0% {
    opacity: 0;
    transform: translate(-50%, 14px) scale(.96);
  }
  12%,
  78% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(.98);
  }
}

@keyframes interactionRipple {
  0% {
    opacity: .7;
    transform: scale(0);
  }
  100% {
    opacity: 0;
    transform: scale(2.25);
  }
}

@keyframes answerSavedPulse {
  0% {
    box-shadow: var(--shadow);
  }
  42% {
    border-color: rgba(20, 184, 166, .75);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, .12), var(--shadow);
  }
  100% {
    box-shadow: var(--shadow);
  }
}

.think-check,
.think-answer {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 16px;
  padding: 16px;
}

.think-check {
  background: #fff7ed;
  border-color: #fed7aa;
}

.think-check strong,
.think-answer strong {
  color: #111827;
  display: block;
  font-size: 18px;
  line-height: 1.35;
  margin-bottom: 8px;
}

.think-check span,
.think-answer p {
  color: #374151;
  display: block;
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}

.think-answer {
  background: #f8fafc;
}

.teaching-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 16px;
}

.teaching-grid span {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #374151;
  display: block;
  font-size: 14px;
  line-height: 1.45;
  padding: 12px;
}

.teaching-grid strong {
  color: #111827;
  display: block;
  font-size: 13px;
  letter-spacing: 0;
  margin-bottom: 5px;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  .highlight-tools {
    grid-template-columns: auto minmax(170px, 1fr) auto;
  }

  .highlight-tools #highlightButton,
  .highlight-tools #clearHighlightsButton {
    justify-self: stretch;
  }

  .question-title-row {
    grid-template-columns: 1fr;
  }

  .question-title-actions {
    justify-content: flex-start;
  }

  .test-view-bar {
    grid-template-columns: auto minmax(150px, 190px) minmax(0, 1fr);
  }

  .test-view-bar .primary-button,
  .test-view-bar .secondary-button {
    min-width: 0;
  }
}

@media (max-width: 850px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    position: static;
    height: auto;
  }

  .main-panel {
    padding: 18px;
  }

  .topbar,
  .button-row,
  .dashboard,
  .home-panel,
  .coach-header,
  .plan-hero,
  .plan-toolbar,
  .explanation-controls {
    align-items: stretch;
    flex-direction: column;
    display: flex;
  }

  .practice-header,
  .question-title-row {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .practice-badges,
  .question-title-actions {
    justify-content: flex-start;
  }

  .highlight-tools {
    grid-template-columns: 1fr;
    position: static;
  }

  .shortcut-hint {
    order: -1;
  }

  .swatches {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .swatch {
    justify-content: flex-start;
    white-space: normal;
  }

  .answer {
    grid-template-columns: 28px minmax(0, 1fr) 34px;
  }

  .answer-eliminate {
    width: 32px;
  }

  .button-row {
    flex-direction: row;
  }

  .home-stats,
  .practice-path-grid,
  .launch-grid,
  .domain-launcher,
  .builder-grid,
  .mastery-map,
  .review-queue-list,
  .recap-grid,
  .mastery-topic-grid,
  .badge-panel,
  .continue-panel,
  .browser-head,
  .browser-controls,
  .test-view-bar,
  .guide-grid,
  .local-guide-item,
  .plan-summary,
  .plan-activity,
  .question-explanation-item,
  .lecture-card,
  .process-diagram,
  .role-diagram,
  .cycle-diagram,
  .term-diagram {
    grid-template-columns: 1fr;
  }

  .video-toggle-bar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .local-guides-head {
    display: grid;
  }

  .guide-search {
    min-width: 0;
    width: 100%;
  }

  .quest-item {
    grid-template-columns: 1fr;
  }

  .xp-head,
  .quest-head,
  .xp-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .explanation-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .main-panel {
    padding: 12px;
  }

  .question-card {
    padding: 10px;
  }

  .browser-controls,
  .test-view-bar {
    grid-template-columns: 1fr;
  }

  .test-view-bar {
    position: static;
  }

  .timer-card {
    order: -1;
  }

  .question-head p {
    font-size: 16px;
  }

  .answer {
    grid-template-columns: 26px minmax(0, 1fr) 32px;
    padding: 8px;
  }

  .nav-dot {
    width: 32px;
    height: 30px;
  }
}
