:root {
  color-scheme: light;
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-soft: #eef4ef;
  --ink: #1e2a32;
  --muted: #66747b;
  --line: #d9e1dc;
  --teal: #0f6b68;
  --teal-dark: #094f51;
  --gold: #b78a34;
  --coral: #c95f48;
  --shadow: 0 14px 34px rgba(29, 49, 54, 0.12);
  --app-vh: 1vh;
  --viewport-width: 100vw;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: calc(var(--app-vh) * 100);
  background:
    linear-gradient(180deg, rgba(15, 107, 104, 0.08), transparent 280px),
    var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

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

.app-shell {
  width: min(100%, 460px);
  min-height: calc(var(--app-vh) * 100);
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 14px 88px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: calc(-16px - env(safe-area-inset-top)) -14px 14px;
  padding: calc(14px + env(safe-area-inset-top)) 14px 10px;
  background: rgba(245, 247, 244, 0.94);
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.brand-lockup > div {
  min-width: 0;
}

.brand-lockup img {
  width: 78px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}

.eyebrow,
.section-kicker {
  margin: 0 0 3px;
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.05;
  white-space: nowrap;
}

h2 {
  margin-bottom: 6px;
  font-size: 22px;
  line-height: 1.18;
}

h3 {
  margin-bottom: 6px;
  font-size: 16px;
  line-height: 1.25;
}

h1,
h2,
h3,
p,
button {
  overflow-wrap: anywhere;
}

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

.language-switch,
.profile-button,
.text-button,
.ghost-button,
.primary-button,
.icon-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.language-switch {
  width: 46px;
  color: #fff;
  background: var(--teal);
  font-weight: 800;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 154px;
  padding: 0 10px;
  color: var(--teal-dark);
  background: #edf5f3;
  border: 1px solid var(--line);
  font-weight: 900;
}

.profile-button svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
  flex: 0 0 auto;
}

.profile-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.text-button {
  padding: 0 4px;
  color: var(--teal);
  background: transparent;
  font-weight: 800;
}

.text-button.done {
  color: var(--teal-dark);
  background: #e8f3ef;
  padding-inline: 10px;
}

.text-button:disabled,
.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.72;
}

.primary-button,
.ghost-button {
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--teal);
}

.ghost-button {
  color: var(--teal-dark);
  background: var(--surface-soft);
}

.icon-button {
  width: 42px;
  color: var(--ink);
  background: var(--surface-soft);
  font-weight: 900;
}

.profile-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.profile-panel h2,
.level-card strong,
.semester-status-card strong,
.content-card strong,
.admin-table strong {
  overflow-wrap: anywhere;
  word-break: normal;
  writing-mode: horizontal-tb;
}

.section-heading.compact {
  margin-bottom: 10px;
}

.today-action-panel {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid rgba(15, 107, 104, 0.22);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

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

.today-action-grid article {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf9;
}

.today-action-grid strong {
  color: var(--teal-dark);
  font-size: 22px;
  line-height: 1;
}

.today-action-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.today-action-button {
  width: 100%;
}

.level-card {
  padding: 14px;
  border-radius: 8px;
  background: #f7fbf9;
}

.level-card-top {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.level-icon,
.level-ring {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.34), transparent 30%),
    linear-gradient(135deg, var(--teal), var(--gold));
  box-shadow: 0 8px 20px rgba(15, 107, 104, 0.22);
  font-weight: 900;
}

.level-icon {
  width: 64px;
  height: 64px;
  font-size: 15px;
}

.level-icon.has-level-art {
  border-radius: 14px;
  background-color: transparent;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  box-shadow: none;
}

.level-card span,
.level-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.level-card strong {
  display: block;
  margin: 4px 0 10px;
}

.semester-status-card {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #cbded8;
  border-radius: 8px;
  background: #fff;
}

.semester-status-card span {
  color: var(--teal);
  font-weight: 900;
}

.semester-status-card strong {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #dde7e2;
}

.progress-track div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.level-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 74px;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf9;
}

.level-summary span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.level-summary strong {
  display: block;
  margin: 3px 0 5px;
  font-size: 22px;
}

.level-summary p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.level-ring {
  width: 74px;
  height: 74px;
  font-size: 24px;
}

.level-source-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.level-source-grid article {
  padding: 10px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.level-source-grid span {
  color: var(--teal-dark);
  font-size: 14px;
  font-weight: 900;
}

.home-skill-badges {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(42, 118, 111, 0.14);
}

.home-skill-badges > span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.skill-badge-row,
.admin-skill-badges,
.skill-roadmap-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.skill-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 5px 8px;
  border: 1px solid rgba(42, 118, 111, 0.18);
  border-radius: 8px;
  color: var(--teal-dark);
  background: #fff;
  font-size: 11px;
  font-weight: 900;
}

.skill-badge img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.skill-badge b {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #788287;
  background: #edf2f0;
}

.skill-badge small,
.skill-badge em {
  display: block;
  font-style: normal;
  line-height: 1.18;
}

.skill-badge em {
  color: var(--muted);
  font-size: 10px;
}

.skill-badge.locked {
  opacity: 0.58;
  filter: grayscale(0.45);
}

.level-source-grid p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.performance-panel {
  overflow: hidden;
}

.performance-intro {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.performance-controls {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.performance-controls label {
  display: grid;
  gap: 6px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
}

.performance-controls select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 800;
}

.performance-language {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.performance-language button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--teal-dark);
  background: #fff;
  font-weight: 900;
}

.performance-language button.active {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.performance-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.performance-card {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.performance-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.performance-card strong {
  color: var(--teal-dark);
  font-size: 22px;
  line-height: 1;
}

.performance-card p,
.performance-next-action p,
.performance-trend-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.performance-card small {
  color: var(--teal);
  font-weight: 900;
}

.performance-trend-card,
.performance-next-action {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.performance-trend {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.trend-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.trend-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8efed;
}

.trend-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #c59a38);
}

.performance-next-action {
  margin-top: 12px;
  background: #f7fbf9;
}

.performance-next-action strong {
  display: block;
  margin-bottom: 4px;
  color: var(--teal-dark);
  font-size: 14px;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.quick-stats article,
.section-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.quick-stats article {
  padding: 12px 10px;
  text-align: center;
}

.quick-stats span {
  display: block;
  font-size: 22px;
  font-weight: 900;
  color: var(--teal-dark);
}

.quick-stats p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.section-block {
  margin-top: 12px;
  padding: 14px;
  scroll-margin-top: 96px;
}

.production-access-notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(201, 95, 72, 0.32);
  border-radius: 8px;
  background: rgba(201, 95, 72, 0.08);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.production-access-notice.is-approved {
  border-color: rgba(15, 107, 104, 0.24);
  background: rgba(15, 107, 104, 0.08);
}

.production-access-locked .bottom-nav a:not([href="#register"]) {
  pointer-events: none;
  opacity: 0.38;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading > div {
  min-width: 0;
}

.content-list {
  display: grid;
  gap: 16px;
}

.library-controls {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 8px 0;
  background: var(--surface);
}

.library-controls input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fbfcfa;
  font: inherit;
  font-weight: 800;
}

.content-jump-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.content-jump-nav::-webkit-scrollbar {
  display: none;
}

.content-jump-nav button {
  flex: 0 0 auto;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--teal-dark);
  background: #eef7f4;
  font-weight: 900;
  cursor: pointer;
}

.content-jump-nav button.active {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.content-jump-nav button:active {
  transform: translateY(1px);
}

.registration-form {
  display: grid;
  gap: 12px;
}

.field-label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-weight: 800;
}

.field-label input,
.field-label textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fbfcfa;
}

.field-label textarea {
  min-height: 88px;
  padding-block: 10px;
  resize: vertical;
  font: inherit;
}

.hisato-device-auth {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(15, 107, 104, 0.22);
  border-radius: 8px;
  background: #f6fbf8;
}

.hisato-device-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.hisato-device-heading strong {
  display: block;
  color: var(--teal-dark);
  font-size: 15px;
}

.hisato-device-heading p,
.hisato-device-status {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.hisato-device-heading span {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--teal-dark);
  background: #e3f2ed;
  font-size: 11px;
  font-weight: 900;
}

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

.device-auth-divider {
  height: 1px;
  background: var(--line);
}

.hisato-device-status[data-tone="success"] {
  color: var(--teal-dark);
  font-weight: 800;
}

.hisato-device-status[data-tone="error"] {
  color: #9a3f2f;
  font-weight: 800;
}

.choice-field {
  gap: 10px;
  padding: 12px;
  background: #fbfcfa;
}

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

.choice-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-chip {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 800;
  cursor: pointer;
}

.choice-chip.selected {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.id-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px;
  border-radius: 8px;
  background: #edf5f3;
}

.id-preview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.id-preview strong {
  font-size: 15px;
}

.content-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 134px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.content-card > div {
  min-width: 0;
}

.content-category {
  display: grid;
  gap: 10px;
  scroll-margin-top: 76px;
}

.content-category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 2px;
}

.content-category-heading h3 {
  margin: 0;
  font-size: 17px;
}

.content-category-heading span {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 99px;
  color: var(--teal-dark);
  background: #dcece7;
  font-size: 12px;
  font-weight: 900;
}

.category-content-list {
  display: grid;
  gap: 10px;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}

.new-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 99px;
  color: #fff;
  background: #d81f32;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.series-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 99px;
  color: #8b5b00;
  background: #fff0c9;
  font-size: 11px;
  font-weight: 900;
}

.content-card img,
.placeholder-art {
  width: 96px;
  height: 118px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--surface-soft);
}

.series-card {
  grid-template-columns: 1fr;
  align-items: start;
}

.series-card img,
.series-card .placeholder-art {
  width: 100%;
  height: 156px;
  aspect-ratio: auto;
  object-position: top;
}

[data-gm-card] img {
  object-fit: contain;
  background: #17172c;
}

.placeholder-art {
  display: grid;
  place-items: center;
  color: var(--teal-dark);
  font-size: 28px;
  font-weight: 900;
  border: 1px solid var(--line);
}

.content-card p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.pill,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 99px;
  color: var(--teal-dark);
  background: #dcece7;
  font-size: 11px;
  font-weight: 800;
}

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

.episode-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.episode-row {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.episode-row strong,
.episode-row small {
  display: block;
}

.episode-row strong {
  font-size: 13px;
  line-height: 1.25;
}

.episode-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.episode-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.episode-actions .primary-button,
.episode-actions .text-button {
  min-height: 36px;
  font-size: 12px;
}

.empty-library {
  margin: 0;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfa;
  font-weight: 800;
  text-align: center;
}

.test-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #fff8eb;
}

.test-panel p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.curriculum-note {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.curriculum-grid {
  display: grid;
  gap: 10px;
}

.semester-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
}

.semester-card.current {
  border-color: #b9d5cd;
  box-shadow: 0 10px 24px rgba(15, 107, 104, 0.08);
}

.semester-card.next-locked {
  background: #f7faf8;
  opacity: 0.82;
}

.semester-head {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
}

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

.semester-head strong {
  font-size: 15px;
  line-height: 1.25;
}

.curriculum-progress {
  margin-bottom: 6px;
}

.phase-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.phase-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 48px;
  padding: 9px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.phase-row b,
.phase-row small {
  display: block;
}

.phase-row b {
  font-size: 13px;
}

.phase-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.phase-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.phase-row .text-button {
  min-width: max-content;
  white-space: nowrap;
}

.phase-row.done {
  border-color: #d7c083;
  background: #fff9ec;
}

.phase-row.done > span {
  color: var(--teal-dark);
}

.phase-row.ready {
  border-color: #cbded8;
  background: #f7fbf9;
}

.phase-row.locked {
  opacity: 0.72;
}

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

.growth-roadmap-heading {
  display: grid;
  gap: 4px;
  margin: 2px 0 10px;
}

.growth-roadmap-heading strong {
  color: var(--ink);
  font-size: 16px;
}

.growth-roadmap-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.trophy {
  min-height: 112px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.trophy span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--muted);
  background: #e8eeea;
  font-weight: 900;
}

.trophy strong {
  display: block;
  min-height: 40px;
  margin: 8px 0 4px;
  font-size: 13px;
  line-height: 1.2;
}

.trophy small {
  color: var(--muted);
  font-size: 11px;
}

.trophy.earned {
  background: #fff9ec;
  border-color: #e7d19c;
}

.trophy.earned span {
  color: #fff;
  background: var(--gold);
}

.semester-roadmap-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 210px;
  background: #f7faf8;
}

.semester-roadmap-card.complete {
  border-color: #d9c28b;
  background: #fff9ec;
}

.semester-roadmap-card.current {
  border-color: #a9d3ca;
  background: #f0faf7;
  box-shadow: 0 12px 26px rgba(15, 107, 104, 0.1);
}

.semester-roadmap-card.locked {
  opacity: 0.68;
}

.semester-roadmap-card.complete > span,
.semester-roadmap-card.current > span {
  color: #fff;
}

.semester-roadmap-card.complete > span {
  background: var(--gold);
}

.semester-roadmap-card.current > span {
  background: var(--teal);
}

.semester-roadmap-card strong {
  min-height: auto;
  margin: 0;
}

.semester-roadmap-card p {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.roadmap-phase-list {
  display: grid;
  gap: 5px;
}

.roadmap-phase-list span {
  display: block;
  width: auto;
  height: auto;
  padding: 5px 7px;
  border-radius: 8px;
  color: var(--muted);
  background: #eef4f1;
  font-size: 10px;
  line-height: 1.25;
  text-align: left;
}

.roadmap-phase-list span.done {
  color: var(--teal-dark);
  background: #dceee8;
}

.roadmap-subheading {
  min-height: 90px;
  padding: 12px;
  border: 1px solid #cbded8;
  border-radius: 8px;
  color: var(--teal-dark);
  background: #edf7f4;
}

.roadmap-subheading strong,
.roadmap-subheading small {
  display: block;
}

.skill-roadmap-card .skill-badge {
  width: 100%;
  justify-content: center;
}

.admin-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.admin-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid #c9ded8;
  border-radius: 8px;
  background: linear-gradient(135deg, #edf7f4, #fff9ec);
}

.admin-hero strong {
  display: block;
  font-size: 20px;
}

.admin-hero p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.admin-hero > span {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.admin-summary-grid,
.branch-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

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

.admin-summary-grid article,
.branch-summary article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbf9;
}

.admin-summary-grid article {
  padding: 12px 10px;
  text-align: center;
}

.admin-summary-grid span {
  display: block;
  color: var(--teal-dark);
  font-size: 24px;
  font-weight: 900;
}

.admin-summary-grid p,
.branch-summary span,
.admin-toolbar p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.admin-toolbar {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-toolbar > span {
  justify-self: start;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: #edf5f3;
  font-size: 12px;
  font-weight: 900;
}

.admin-control-panel {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.admin-control-panel label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.admin-control-panel input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 800;
}

.admin-filter-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-filter-row span,
.admin-filter-row button {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--teal-dark);
  background: #edf5f3;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.admin-filter-row button.active {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.admin-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  align-items: start;
}

.admin-main-panel,
.admin-side-panel section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.admin-main-panel {
  min-width: 0;
  padding: 12px;
}

.admin-side-panel {
  display: grid;
  gap: 12px;
}

.admin-side-panel .branch-summary {
  grid-template-columns: 1fr;
}

.admin-side-panel section {
  padding: 12px;
}

.side-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.side-heading span {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: #dcece7;
  font-size: 12px;
  font-weight: 900;
}

.branch-summary article {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.branch-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

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

.approval-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.approval-list article > div {
  min-width: 0;
}

.approval-list strong,
.approval-list span {
  display: block;
}

.approval-list span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.approval-list button,
.admin-action-cell button {
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  padding: 0 9px;
  color: #fff;
  background: var(--teal);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.admin-table [role="row"] {
  display: grid;
  grid-template-columns: 1.2fr 0.45fr 0.65fr 0.85fr 0.85fr;
}

.admin-table-wide {
  overflow-x: auto;
}

.admin-table-wide [role="row"] {
  min-width: 1540px;
  grid-template-columns: 1fr 1fr 0.52fr 0.8fr 0.52fr 0.58fr 1.05fr 0.9fr 0.48fr 0.48fr 1.1fr 0.5fr 0.58fr 0.82fr 0.72fr 1.25fr;
}

.admin-table-wide .admin-group-row {
  grid-template-columns: 1fr;
}

.admin-table .admin-group-row span {
  grid-column: 1 / -1;
  padding: 9px 10px;
  border-bottom: 1px solid #d9cda8;
  color: var(--teal-dark);
  background: #fff8e7;
  font-size: 12px;
  font-weight: 900;
}

.admin-table span {
  min-width: 0;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}

.admin-table span strong,
.admin-table span small {
  display: block;
}

.admin-table span small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.admin-action-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.technical-action-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.technical-action-buttons button[disabled] {
  cursor: default;
  opacity: 0.72;
}

.technical-approval-detail {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.technical-latest-approval {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #dde7e4;
}

.technical-latest-approval b {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.tech-role-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
}

.tech-role-chip.done {
  color: #fff;
  background: var(--teal);
}

.tech-role-chip.complete {
  color: #473600;
  background: #f7d36a;
}

.tech-role-chip.pending {
  color: #6f7780;
  background: #e9efed;
}

.admin-action-cell button + button,
.approval-list button + button {
  color: var(--teal-dark);
  background: #edf5f3;
}

.admin-empty-row span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.mini-progress {
  display: inline-block;
  width: 56px;
  height: 7px;
  margin-right: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #dde7e2;
  vertical-align: middle;
}

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

.admin-table [role="row"]:first-child {
  color: var(--muted);
  background: var(--surface-soft);
  font-weight: 800;
}

.admin-table [role="row"]:last-child span {
  border-bottom: 0;
}

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

.warn {
  color: var(--coral);
  font-weight: 800;
}

.pending {
  color: #8b5b00;
  font-weight: 800;
}

.blocked {
  color: #7a7f86;
  font-weight: 800;
}

@media (max-width: 599px) {
  .admin-hero {
    display: grid;
    gap: 10px;
  }

  .admin-summary-grid,
  .admin-control-panel,
  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .admin-side-panel .branch-summary {
    grid-template-columns: 1fr;
  }

  .admin-table-wide [role="row"] {
    min-width: 1080px;
  }
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  width: min(100%, 460px);
  transform: translateX(-50%);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

.bottom-nav a {
  display: grid;
  place-items: center;
  min-height: 42px;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
}

dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(100% - 18px, 460px);
  max-height: 90vh;
  overflow: auto;
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: rgba(15, 28, 34, 0.52);
}

.dialog-top {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.content-watermark {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  align-content: start;
  gap: 52px 20px;
  padding: max(34px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(34px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
  overflow: hidden;
  color: rgba(7, 68, 70, 0.28);
  pointer-events: none;
  user-select: none;
  opacity: 0.2;
}

dialog[open] .content-watermark {
  display: grid;
}

.content-watermark span {
  display: block;
  width: max-content;
  max-width: 260px;
  transform: rotate(-24deg);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.45;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: normal;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 8px rgba(255, 255, 255, 0.12);
}

.content-watermark-test {
  z-index: 20;
  color: rgba(7, 68, 70, 0.22);
  opacity: 0.16;
}

dialog[data-reader-category="meeting"] .content-watermark,
dialog[data-reader-category="manual"] .content-watermark,
dialog[data-reader-category="video"] .content-watermark {
  color: rgba(7, 68, 70, 0.3);
  opacity: 0.22;
}

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wide-toggle {
  display: none;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

dialog[data-reader-category="meeting"] .wide-toggle,
dialog[data-reader-category="manual"] .wide-toggle,
dialog[data-reader-category="video"] .wide-toggle {
  display: inline-flex;
  align-items: center;
}

.reader-strip {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: #f1f4f0;
  overflow-anchor: none;
  scroll-margin-top: 0;
}

.reader-strip img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(31, 44, 51, 0.14);
  overflow-anchor: none;
}

.reader-loading {
  position: sticky;
  bottom: 14px;
  z-index: 4;
  display: flex;
  justify-content: center;
  margin: -58px 14px 14px;
  pointer-events: none;
}

.reader-loading span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 34px rgba(15, 95, 99, 0.16);
  font-size: 12px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.reader-loading[hidden] {
  display: none;
}

.update-banner {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 90;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: min(720px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 12px;
  border: 1px solid rgba(42, 118, 111, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(20, 34, 37, 0.18);
  backdrop-filter: blur(14px);
}

.update-banner[hidden] {
  display: none;
}

.update-banner strong {
  display: block;
  color: var(--teal-dark);
  font-size: 14px;
}

.update-banner p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.agreement-check {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(240, 246, 243, 0.78);
  color: var(--ink);
}

.agreement-check input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--green);
}

.agreement-check strong {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.agreement-check small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
}

.training-video {
  display: block;
  width: 100%;
  max-height: 72vh;
  background: #101820;
}

dialog[data-reader-category="meeting"],
dialog[data-reader-category="manual"],
dialog[data-reader-category="video"] {
  background: #101820;
}

dialog[data-reader-category="meeting"] .dialog-top,
dialog[data-reader-category="manual"] .dialog-top,
dialog[data-reader-category="video"] .dialog-top {
  color: #fff;
  border-bottom-color: rgba(255, 255, 255, 0.14);
  background: #101820;
}

dialog[data-reader-category="meeting"] .section-kicker,
dialog[data-reader-category="manual"] .section-kicker,
dialog[data-reader-category="video"] .section-kicker {
  color: #73d0c8;
}

dialog[data-reader-category="meeting"] .reader-strip,
dialog[data-reader-category="manual"] .reader-strip {
  background: #101820;
}

dialog[data-reader-category="meeting"] .reader-strip img,
dialog[data-reader-category="manual"] .reader-strip img {
  box-shadow: none;
}

dialog.wide-preview[data-reader-category="meeting"],
dialog.wide-preview[data-reader-category="manual"],
dialog.wide-preview[data-reader-category="video"] {
  width: var(--viewport-width);
  max-width: none;
  height: calc(var(--app-vh) * 100);
  max-height: none;
  border-radius: 0;
}

dialog.wide-preview[data-reader-category="meeting"] .dialog-top,
dialog.wide-preview[data-reader-category="manual"] .dialog-top,
dialog.wide-preview[data-reader-category="video"] .dialog-top {
  min-height: 54px;
  padding: 8px 14px;
}

dialog.wide-preview[data-reader-category="meeting"] .dialog-top h2,
dialog.wide-preview[data-reader-category="manual"] .dialog-top h2,
dialog.wide-preview[data-reader-category="video"] .dialog-top h2 {
  margin-bottom: 0;
  font-size: 16px;
}

dialog.wide-preview[data-reader-category="meeting"] .reader-strip,
dialog.wide-preview[data-reader-category="manual"] .reader-strip {
  min-height: calc(var(--app-vh) * 100);
  padding: 0;
  place-items: center;
}

dialog.wide-preview[data-reader-category="meeting"] .reader-strip figure,
dialog.wide-preview[data-reader-category="manual"] .reader-strip figure {
  display: grid;
  place-items: center;
  width: var(--viewport-width);
  height: calc(var(--app-vh) * 100);
  margin: 0;
}

dialog.wide-preview[data-reader-category="meeting"] .reader-strip img,
dialog.wide-preview[data-reader-category="manual"] .reader-strip img {
  width: auto;
  max-width: var(--viewport-width);
  max-height: calc(var(--app-vh) * 100);
  object-fit: contain;
  border-radius: 0;
}

dialog.wide-preview[data-reader-category="video"] {
  display: grid;
  grid-template-rows: auto 1fr;
}

dialog.wide-preview[data-reader-category="video"] .training-video {
  align-self: center;
  justify-self: center;
  width: min(var(--viewport-width), calc(((var(--app-vh) * 100) - 54px) * 16 / 9));
  max-height: calc((var(--app-vh) * 100) - 54px);
}

@media (orientation: landscape) {
  dialog[data-reader-category="meeting"],
  dialog[data-reader-category="manual"],
  dialog[data-reader-category="video"] {
    width: var(--viewport-width);
    max-width: none;
    height: calc(var(--app-vh) * 100);
    max-height: none;
    border-radius: 0;
  }

  dialog[data-reader-category="meeting"] .dialog-top,
  dialog[data-reader-category="manual"] .dialog-top,
  dialog[data-reader-category="video"] .dialog-top {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    z-index: 6;
    display: flex;
    width: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    pointer-events: none;
  }

  dialog[data-reader-category="meeting"] .dialog-top > div:first-child,
  dialog[data-reader-category="manual"] .dialog-top > div:first-child,
  dialog[data-reader-category="video"] .dialog-top > div:first-child,
  dialog[data-reader-category="meeting"] .wide-toggle,
  dialog[data-reader-category="manual"] .wide-toggle,
  dialog[data-reader-category="video"] .wide-toggle {
    display: none;
  }

  dialog[data-reader-category="meeting"] .dialog-actions,
  dialog[data-reader-category="manual"] .dialog-actions,
  dialog[data-reader-category="video"] .dialog-actions {
    pointer-events: auto;
  }

  dialog[data-reader-category="meeting"] .view-timer,
  dialog[data-reader-category="manual"] .view-timer,
  dialog[data-reader-category="video"] .view-timer {
    min-height: 46px;
    color: rgba(255, 255, 255, 0.78);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(16, 24, 32, 0.58);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(10px);
  }

  dialog[data-reader-category="meeting"] .view-timer strong,
  dialog[data-reader-category="manual"] .view-timer strong,
  dialog[data-reader-category="video"] .view-timer strong {
    color: #fff;
  }

  dialog[data-reader-category="meeting"] .icon-button,
  dialog[data-reader-category="manual"] .icon-button,
  dialog[data-reader-category="video"] .icon-button {
    width: 46px;
    min-height: 46px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(16, 24, 32, 0.72);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(10px);
  }

  dialog[data-reader-category="meeting"] .dialog-top h2,
  dialog[data-reader-category="manual"] .dialog-top h2,
  dialog[data-reader-category="video"] .dialog-top h2 {
    margin-bottom: 0;
    font-size: 16px;
  }

  dialog[data-reader-category="meeting"] .reader-strip,
  dialog[data-reader-category="manual"] .reader-strip {
    min-height: calc(var(--app-vh) * 100);
    padding: 0;
    place-items: center;
  }

  dialog[data-reader-category="meeting"] .reader-strip figure,
  dialog[data-reader-category="manual"] .reader-strip figure {
    display: grid;
    place-items: center;
    width: var(--viewport-width);
    height: calc(var(--app-vh) * 100);
    margin: 0;
  }

  dialog[data-reader-category="meeting"] .reader-strip img,
  dialog[data-reader-category="manual"] .reader-strip img {
    width: auto;
    max-width: var(--viewport-width);
    max-height: calc(var(--app-vh) * 100);
    object-fit: contain;
    border-radius: 0;
  }

  dialog[data-reader-category="video"] {
    display: grid;
    grid-template-rows: auto 1fr;
  }

  dialog[data-reader-category="video"] .training-video {
    align-self: center;
    justify-self: center;
    width: min(var(--viewport-width), calc(((var(--app-vh) * 100) - 54px) * 16 / 9));
    max-height: calc((var(--app-vh) * 100) - 54px);
  }
}

.test-dialog {
  padding-bottom: 14px;
}

.timer-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #edf5f3;
}

.timer-line strong {
  font-size: 1.25rem;
  color: var(--teal-dark);
}

.view-timer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(42, 118, 111, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(244, 250, 248, 0.92);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.view-timer strong {
  color: var(--teal-dark);
  font-size: 1rem;
}

.test-rule-note {
  margin: 0 14px 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.quiz-form {
  display: grid;
  gap: 12px;
  padding: 0 14px;
}

.question-progress {
  display: flex;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--teal-dark);
  background: #f4faf8;
  font-weight: 800;
}

fieldset {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

legend {
  padding: 0 4px;
  font-weight: 800;
}

label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.35;
}

.written-question textarea {
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
  line-height: 1.55;
  color: var(--ink);
  background: #fbfdfc;
}

.written-question textarea:focus {
  outline: 3px solid rgba(42, 118, 111, 0.16);
  border-color: var(--teal);
}

.question-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.result-panel {
  display: grid;
  gap: 6px;
  margin: 14px 14px 0;
  padding: 14px;
  border-radius: 8px;
  background: #fff8eb;
}

.celebration {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100%;
  max-width: none;
  height: calc(var(--app-vh) * 100);
  max-height: none;
  margin: 0;
  border: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.34), transparent 20%),
    rgba(9, 79, 81, 0.62);
  backdrop-filter: blur(10px);
}

.celebration:not([open]),
.celebration[hidden] {
  display: none;
}

.celebration.is-showing {
  display: grid;
}

.celebration::backdrop {
  background: rgba(9, 79, 81, 0.62);
  backdrop-filter: blur(10px);
}

.celebration-card {
  position: relative;
  width: min(100%, 340px);
  min-height: 310px;
  padding: 28px 22px 24px;
  border-radius: 8px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 249, 0.98)),
    #fff;
  box-shadow: 0 24px 60px rgba(8, 44, 47, 0.28);
  animation: level-pop 680ms cubic-bezier(0.2, 1.2, 0.25, 1);
}

.celebration-icon {
  position: relative;
  z-index: 1;
  width: 132px;
  height: 132px;
  object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(0 18px 26px rgba(11, 80, 81, 0.24));
  animation: icon-bounce 980ms ease-out;
}

.pass-celebration .celebration-card {
  background:
    radial-gradient(circle at 50% 0%, rgba(183, 138, 52, 0.18), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 251, 248, 0.98)),
    #fff;
}

.celebration.pass-celebration .badge-mark {
  color: #fff;
  background: linear-gradient(135deg, #0c706d, #b78a34);
  box-shadow: 0 8px 18px rgba(12, 112, 109, 0.22);
}

.pass-celebration .celebration-icon {
  animation: icon-bounce 980ms ease-out, pass-glow 1800ms ease-in-out 260ms infinite alternate;
}

.celebration-card h2 {
  position: relative;
  z-index: 1;
  margin: 10px 0 4px;
  font-size: 24px;
}

.celebration-card strong {
  position: relative;
  z-index: 1;
  display: block;
  margin: 0 0 8px;
  color: var(--teal-dark);
  font-size: 24px;
  line-height: 1.12;
}

.celebration-score {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin: 0 0 10px;
  padding: 0 14px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #b2312f, #d85b4d);
  box-shadow: 0 10px 22px rgba(178, 49, 47, 0.22);
  font-weight: 900;
}

.celebration-card p {
  position: relative;
  z-index: 1;
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 700;
}

.badge-mark {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: 99px;
  color: #fff;
  background: var(--gold);
  font-weight: 900;
}

.level-burst {
  position: absolute;
  inset: 16px;
  pointer-events: none;
}

.level-burst span {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(183, 138, 52, 0.72);
  animation: sparkle 1050ms ease-out both;
}

.level-burst span:nth-child(1) {
  left: 18%;
  top: 28%;
}

.level-burst span:nth-child(2) {
  right: 18%;
  top: 22%;
  animation-delay: 80ms;
  background: #1aa7b0;
}

.level-burst span:nth-child(3) {
  left: 28%;
  bottom: 24%;
  animation-delay: 160ms;
  background: #e64e91;
}

.level-burst span:nth-child(4) {
  right: 25%;
  bottom: 30%;
  animation-delay: 220ms;
}

.level-burst span:nth-child(5) {
  left: 48%;
  top: 14%;
  animation-delay: 120ms;
  background: #8cc63f;
}

.level-burst span:nth-child(6) {
  right: 10%;
  top: 52%;
  animation-delay: 260ms;
  background: #ff9f1c;
}

@keyframes level-pop {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.86);
  }
  62% {
    opacity: 1;
    transform: translateY(-4px) scale(1.04);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes icon-bounce {
  from {
    opacity: 0;
    transform: translateY(18px) rotate(-8deg) scale(0.7);
  }
  58% {
    opacity: 1;
    transform: translateY(-8px) rotate(5deg) scale(1.08);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

@keyframes sparkle {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.4);
  }
  45% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateY(-36px) scale(1.25);
  }
}

@keyframes pass-glow {
  from {
    filter: drop-shadow(0 14px 22px rgba(11, 80, 81, 0.2));
  }
  to {
    filter: drop-shadow(0 20px 34px rgba(183, 138, 52, 0.38));
  }
}

@media (prefers-reduced-motion: reduce) {
  .celebration-card,
  .celebration-icon,
  .level-burst span {
    animation: none;
  }
}

@media (max-width: 359px) {
  .app-shell {
    padding: calc(12px + env(safe-area-inset-top)) 10px 84px;
  }

  .topbar {
    margin: calc(-12px - env(safe-area-inset-top)) -10px 12px;
    padding: calc(12px + env(safe-area-inset-top)) 10px 8px;
  }

  .brand-lockup img {
    width: 68px;
  }

  .top-actions {
    gap: 6px;
  }

  .language-switch {
    width: 42px;
  }

  .profile-button {
    max-width: 44px;
    padding: 0 11px;
  }

  .profile-button span {
    display: none;
  }

  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 20px;
  }

  .profile-panel,
  .section-block {
    padding: 12px;
  }

  .quick-stats {
    gap: 6px;
  }

  .content-jump-nav {
    gap: 6px;
  }

  .content-jump-nav button {
    min-height: 40px;
    font-size: 13px;
  }

  .content-card {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
  }

  .content-card img,
  .placeholder-art {
    width: 82px;
    height: 104px;
  }

  .series-card img,
  .series-card .placeholder-art {
    width: 100%;
    height: 142px;
    aspect-ratio: auto;
  }

  .admin-table {
    font-size: 12px;
  }

  .admin-table span {
    padding: 8px 6px;
  }
}

@media (max-width: 430px) {
  .topbar {
    gap: 6px;
  }

  .brand-lockup {
    gap: 8px;
  }

  .brand-lockup img {
    width: 58px;
    height: 30px;
  }

  .eyebrow {
    font-size: 10px;
  }

  h1 {
    font-size: 18px;
  }

  .language-switch {
    width: 44px;
  }

  .profile-button {
    width: 44px;
    max-width: 44px;
    justify-content: center;
    padding: 0;
  }

  .profile-button span {
    display: none;
  }

  .update-banner {
    grid-template-columns: 1fr;
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 600px) and (max-width: 819px) {
  .app-shell {
    width: min(100% - 32px, 680px);
  }

  .profile-panel {
    grid-template-columns: minmax(0, 1fr) 240px;
    align-items: center;
  }

  .content-jump-nav {
    flex-wrap: wrap;
  }

  .category-content-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-card {
    grid-template-columns: 108px minmax(0, 1fr);
  }

  .content-card img,
  .placeholder-art {
    width: 108px;
    height: 126px;
  }

  .trophy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .series-card {
    grid-template-columns: 160px minmax(0, 1fr);
  }

  .series-card img,
  .series-card .placeholder-art {
    width: 160px;
    height: 180px;
    aspect-ratio: auto;
  }
}

@media (min-width: 720px) and (max-width: 819px) {
  .app-shell,
  .bottom-nav,
  dialog {
    width: min(100% - 32px, 680px);
  }
}

@media (min-width: 600px) and (max-width: 819px) {
  .admin-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-control-panel,
  .admin-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .admin-side-panel .branch-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 820px) {
  body {
    background:
      linear-gradient(180deg, rgba(15, 107, 104, 0.08), transparent 340px),
      var(--bg);
  }

  .app-shell {
    width: min(100% - 48px, 1180px);
    padding: 22px 24px 40px 170px;
  }

  .topbar {
    position: static;
    margin: 0 0 18px;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .brand-lockup img {
    width: 104px;
    height: 46px;
  }

  h1 {
    font-size: 30px;
  }

  main {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    grid-template-areas:
      "profile stats"
      "learn learn"
      "register test"
      "curriculum curriculum"
      "growth growth"
      "performance performance"
      "admin admin";
    gap: 16px;
    align-items: start;
  }

  .profile-panel {
    grid-area: profile;
  }

  .quick-stats {
    grid-area: stats;
  }

  .register-panel {
    grid-area: register;
  }

  #learn {
    grid-area: learn;
  }

  #test {
    grid-area: test;
  }

  #curriculum {
    grid-area: curriculum;
  }

  #growth {
    grid-area: growth;
  }

  #performance {
    grid-area: performance;
  }

  #admin {
    grid-area: admin;
  }

  .profile-panel {
    grid-template-columns: minmax(0, 1fr) 260px;
    align-items: center;
  }

  .quick-stats {
    margin: 0;
    grid-template-columns: 1fr;
  }

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

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

  .admin-side-panel .branch-summary {
    grid-template-columns: 1fr;
  }

  .admin-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .register-panel,
  #test {
    margin-top: 0;
  }

  .curriculum-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  }

  .bottom-nav {
    position: fixed;
    top: 96px;
    left: max(24px, calc((100vw - 1180px) / 2));
    bottom: auto;
    width: 132px;
    transform: none;
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
  }

  .bottom-nav a {
    justify-content: start;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 8px;
  }

  .bottom-nav a:hover {
    color: var(--teal-dark);
    background: #edf5f3;
  }

  .content-jump-nav {
    flex-wrap: wrap;
  }

  .library-controls {
    position: static;
    margin-bottom: 18px;
    padding: 0;
  }

  .content-category {
    scroll-margin-top: 28px;
  }

  .category-content-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content-card {
    grid-template-columns: 124px minmax(0, 1fr);
    min-height: 156px;
    padding: 12px;
  }

  .content-card img,
  .placeholder-art {
    width: 124px;
    height: 132px;
  }

  .series-card {
    grid-column: span 2;
    grid-template-columns: 170px minmax(0, 1fr);
  }

  .series-card img,
  .series-card .placeholder-art {
    width: 170px;
    height: 190px;
    aspect-ratio: auto;
  }

  .episode-row {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

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

  dialog {
    width: min(100% - 48px, 860px);
  }
}

@media (min-width: 1120px) {
  main {
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  }

  .category-content-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .content-card {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .series-card {
    grid-column: span 3;
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .series-card img,
  .series-card .placeholder-art {
    width: 220px;
    height: 248px;
    aspect-ratio: auto;
  }

  .content-card img,
  .placeholder-art {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
  }

  [data-content-category="manga"] img,
  [data-content-category="manual"] img {
    aspect-ratio: 3 / 4;
  }
}

@media (min-width: 1440px) {
  .app-shell {
    width: min(100% - 72px, 1320px);
  }

  .bottom-nav {
    left: max(36px, calc((100vw - 1320px) / 2));
  }

  .category-content-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .curriculum-grid {
    grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .app-shell {
    width: min(100% - 32px, 760px);
    padding: 12px 14px 76px;
  }

  .topbar {
    position: static;
    margin: 0 0 12px;
    padding: 0;
  }

  main {
    display: block;
  }

  .profile-panel {
    grid-template-columns: minmax(0, 1fr) 220px;
  }

  .content-jump-nav {
    position: static;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .bottom-nav {
    position: fixed;
    top: auto;
    left: 50%;
    bottom: 0;
    width: min(100%, 760px);
    transform: translateX(-50%);
    grid-template-columns: repeat(6, 1fr);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
  }

  .bottom-nav a {
    justify-content: center;
    padding: 0;
  }
}

body:not(.owner-admin-access) #admin,
body:not(.owner-admin-access) .bottom-nav a[href="#admin"] {
  display: none !important;
}
