:root {
  color-scheme: light;
  --ink: #172033;
  --ink-strong: #0f1c31;
  --muted: #657287;
  --subtle: #8390a3;
  --line: rgba(50, 78, 112, 0.14);
  --line-strong: rgba(50, 78, 112, 0.24);
  --paper: #ffffff;
  --panel: rgba(255, 255, 255, 0.9);
  --surface: #f7fbff;
  --surface-blue: #eef8ff;
  --surface-teal: #e7fbf8;
  --blue: #2457d6;
  --blue-dark: #173b9b;
  --teal: #0f9f9b;
  --mint: #dff8f5;
  --violet: #6f61e8;
  --amber: #f5ad24;
  --danger: #e5644e;
  --shadow: 0 16px 42px rgba(29, 57, 107, 0.12);
  --small-shadow: 0 8px 24px rgba(29, 57, 107, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(241, 249, 255, 0.96) 0%, #ffffff 42%),
    linear-gradient(rgba(36, 87, 214, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 87, 214, 0.045) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
  font-family:
    "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", "Segoe UI",
    system-ui, -apple-system, sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.auth-locked {
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: auto;
}

.auth-locked .topbar,
.auth-locked .summary,
.auth-locked .workspace,
.auth-locked .mode-switcher,
.auth-locked .welcome-app,
.auth-locked .practice-app,
.auth-locked .materials-app,
.auth-locked .admin-app,
.auth-locked .access-banner {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  align-items: stretch;
  background:
    linear-gradient(135deg, rgba(14, 29, 52, 0.94), rgba(11, 103, 110, 0.78)),
    #102033;
}

.login-visual {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    linear-gradient(90deg, rgba(16, 32, 51, 0.78), rgba(16, 32, 51, 0.24)),
    url("/college/assets/hero-learning-map.png") center / cover no-repeat;
}

.login-card {
  align-self: center;
  width: min(100% - 40px, 430px);
  margin: 0 auto;
  padding: 30px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.login-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.login-card-header img {
  display: block;
  width: min(240px, 68%);
}

.login-card-actions {
  flex: 0 0 auto;
  display: grid;
  gap: 8px;
  justify-items: stretch;
}

.login-home-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: var(--blue-dark);
  background: #edf7ff;
  border: 1px solid rgba(36, 87, 214, 0.18);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.login-reference-button {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: #0b7874;
  background: #e9fbf8;
  border: 1px solid rgba(14, 165, 164, 0.28);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.login-home-button:hover {
  background: #dff0ff;
  border-color: rgba(36, 87, 214, 0.3);
}

.login-reference-button:hover {
  background: #d9f7f3;
  border-color: rgba(14, 165, 164, 0.45);
}

.login-card h1 {
  margin: 0 0 12px;
  color: var(--ink-strong);
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.12;
}

.login-copy {
  margin: 0 0 22px;
  color: #4b5c73;
  line-height: 1.75;
}

.login-card label {
  display: block;
  margin-bottom: 16px;
}

.login-card label span {
  display: block;
  margin-bottom: 7px;
  color: #344159;
  font-size: 13px;
  font-weight: 850;
}

.login-card input {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.login-card .primary-action {
  width: 100%;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: #6d7b90;
  font-size: 13px;
  font-weight: 800;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.google-signin-button,
.google-login-placeholder {
  width: 100%;
  min-height: 44px;
}

.google-signin-button > div {
  margin: 0 auto;
}

.google-login-placeholder {
  color: #53647b;
  background: #ffffff;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  font-weight: 850;
}

.google-login-note {
  margin: 10px 0 0;
  color: #6d7b90;
  font-size: 13px;
  line-height: 1.55;
}

.text-link-button {
  display: block;
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  color: var(--blue-dark);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.text-link-button:hover {
  background: #edf7ff;
}

.auth-notice {
  margin: 14px 0 0;
  padding: 12px 14px;
  color: #0d6b68;
  background: var(--mint);
  border: 1px solid rgba(15, 159, 155, 0.28);
  border-radius: 8px;
  line-height: 1.65;
}

.trial-note {
  margin-top: 18px;
  padding: 14px;
  color: #30415a;
  background: #eef8ff;
  border: 1px solid rgba(36, 87, 214, 0.14);
  border-radius: 8px;
}

.trial-note strong,
.trial-note span {
  display: block;
}

.trial-note strong {
  margin-bottom: 5px;
  color: var(--blue-dark);
}

.trial-note span {
  color: #53647b;
  line-height: 1.6;
}

.trial-credential {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(36, 87, 214, 0.14);
}

.trial-credential b {
  color: var(--ink-strong);
  font-weight: 900;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 12px clamp(18px, 4vw, 72px);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: clamp(148px, 18vw, 220px);
  height: 44px;
  display: block;
  object-fit: contain;
  object-position: left center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  border-radius: 8px;
  font-size: 20px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(36, 87, 214, 0.22);
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  color: var(--ink-strong);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.25;
}

.brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.paper-title {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  color: #344159;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
  font-size: 14px;
  font-weight: 700;
}

.user-menu {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 6px 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
}

.user-menu span,
.user-menu strong,
.user-menu small {
  display: block;
}

.user-menu strong {
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 900;
}

.user-menu small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.user-menu button {
  min-height: 32px;
  padding: 6px 10px;
  color: #344159;
  background: #f6f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.notification-wrap {
  position: relative;
}

.notification-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.notification-button strong {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  color: #ffffff;
  background: #0f9f9b;
  border-radius: 999px;
  font-size: 12px;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 60;
  width: min(380px, calc(100vw - 28px));
  display: none;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(16, 33, 61, 0.2);
}

.notification-panel.open {
  display: block;
}

.notification-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.notification-panel-header strong {
  color: var(--ink-strong);
  font-size: 15px;
}

.notification-panel-header button {
  color: #1550ba;
  background: #eef5ff;
  border: 1px solid #c8dcff;
  border-radius: 8px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.notification-panel-header button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.notification-list {
  max-height: 440px;
  overflow: auto;
}

.notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.notification-item.unread {
  background: linear-gradient(90deg, rgba(15, 159, 155, 0.1), rgba(36, 87, 214, 0.06));
}

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

.notification-item strong {
  color: var(--ink-strong);
  font-size: 14px;
}

.notification-item p {
  margin: 5px 0;
  color: #4b5c73;
  font-size: 13px;
  line-height: 1.55;
}

.notification-item span {
  color: var(--muted);
  font-size: 12px;
}

.notification-item-actions {
  display: grid;
  align-content: start;
  gap: 7px;
}

.notification-item-actions a,
.notification-item-actions button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  color: #ffffff;
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.notification-item-actions button {
  color: #1550ba;
  background: #eef5ff;
  border: 1px solid #c8dcff;
}

.notification-empty {
  padding: 22px 16px;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.upgrade-account-button,
.upgrade-inline-button,
.secondary-action {
  min-height: 40px;
  padding: 9px 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 900;
}

.upgrade-account-button {
  color: #ffffff;
  background: linear-gradient(135deg, #0f9f9b, #2457d6);
  border: 0;
  box-shadow: 0 12px 26px rgba(15, 159, 155, 0.2);
  white-space: nowrap;
}

.upgrade-inline-button,
.secondary-action {
  color: #173b9b;
  background: #ffffff;
  border: 1px solid rgba(36, 87, 214, 0.22);
  box-shadow: var(--small-shadow);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px rgba(15, 159, 155, 0.14);
}

.summary {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  max-width: 1500px;
  margin: 0 auto;
  padding: 18px clamp(18px, 4vw, 42px);
  overflow: hidden;
}

.access-banner {
  max-width: 1500px;
  margin: 18px auto 0;
  padding: 13px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #0c5d59;
  background: #e8faf7;
  border: 1px solid rgba(15, 159, 155, 0.18);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
}

.access-banner strong {
  flex: 0 0 auto;
  font-weight: 950;
}

.access-banner span {
  color: #315c66;
  line-height: 1.55;
}

.promo-inline-button {
  margin-left: auto;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid rgba(15, 159, 155, 0.3);
  border-radius: 8px;
  background: #ffffff;
  color: #0a7474;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.promo-inline-button:hover {
  border-color: rgba(15, 159, 155, 0.55);
  box-shadow: 0 10px 24px rgba(15, 159, 155, 0.12);
}

.summary::after {
  content: "";
  position: absolute;
  inset: -34px 0 auto auto;
  width: min(460px, 42vw);
  height: 170px;
  background: url("/college/assets/question-bank-visual.png") center / contain no-repeat;
  opacity: 0.08;
  pointer-events: none;
}

.summary div {
  position: relative;
  z-index: 1;
  min-height: 78px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
}

.summary span,
.summary strong {
  display: block;
}

.summary span {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.summary strong {
  color: var(--ink-strong);
  font-size: 28px;
  font-weight: 900;
}

.workspace {
  display: grid;
  grid-template-columns: 240px 340px minmax(0, 1fr);
  min-height: calc(100vh - 150px);
  max-width: 1500px;
  margin: 0 auto 42px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.filters,
.question-browser {
  border-right: 1px solid var(--line);
}

.filters {
  position: relative;
  padding: 22px 18px;
  background:
    linear-gradient(180deg, rgba(238, 248, 255, 0.96), rgba(255, 255, 255, 0.92)),
    #ffffff;
}

.filters::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 16px;
  width: 72px;
  height: 72px;
  background: url("/college/assets/brand-logo-mark.png") center / cover no-repeat;
  border-radius: 8px;
  opacity: 0.08;
  pointer-events: none;
}

.filters label,
.filters fieldset {
  display: block;
  margin: 0 0 20px;
  padding: 0;
  border: 0;
}

.filters label > span,
.filters legend {
  display: block;
  margin-bottom: 8px;
  color: #344159;
  font-size: 12px;
  font-weight: 850;
}

.filters input,
.filters select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

.filters input:focus,
.filters select:focus,
.student-essay:focus {
  border-color: rgba(36, 87, 214, 0.8);
  box-shadow: 0 0 0 4px rgba(36, 87, 214, 0.12);
}

.segment {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.segment button {
  min-width: 0;
  min-height: 38px;
  padding: 7px 4px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}

.segment button:last-child {
  border-right: 0;
}

.segment button.active {
  color: white;
  background: linear-gradient(135deg, var(--blue), #1586d5);
}

.filter-note {
  position: relative;
  z-index: 1;
  padding: 14px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(15, 159, 155, 0.22);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.65;
}

.filter-note strong,
.filter-note span {
  display: block;
}

.filter-note strong {
  color: var(--ink-strong);
}

.filter-note span {
  margin-top: 4px;
  color: var(--muted);
}

.question-browser {
  min-width: 0;
  background: rgba(255, 255, 255, 0.92);
}

.section-heading {
  height: 62px;
  display: flex;
  align-items: center;
  padding: 0 17px;
  border-bottom: 1px solid var(--line);
}

.section-heading div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  width: 100%;
}

.section-heading span {
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: 850;
}

.section-heading strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.question-list {
  height: calc(100vh - 212px);
  overflow: auto;
}

.question-row {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 11px;
  padding: 14px 15px;
  text-align: left;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.question-row:hover {
  background: #f3f9ff;
}

.question-row.active {
  background: linear-gradient(90deg, rgba(36, 87, 214, 0.1), rgba(15, 159, 155, 0.08));
  box-shadow: inset 4px 0 0 var(--blue);
}

.question-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--blue-dark);
  background: #edf5ff;
  border: 1px solid #d7e6fa;
  border-radius: 8px;
  font-weight: 900;
}

.question-row.active .question-number {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  border-color: transparent;
}

.question-row p {
  display: -webkit-box;
  margin: 0 0 8px;
  overflow: hidden;
  color: #344159;
  font-size: 13px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.row-meta .image-badge {
  padding: 1px 6px;
  color: #0d6b68;
  background: var(--mint);
  border: 1px solid rgba(15, 159, 155, 0.22);
  border-radius: 999px;
  font-weight: 800;
}

.grade-badge {
  padding: 1px 7px;
  color: #173b9b;
  background: #eef4ff;
  border: 1px solid rgba(36, 87, 214, 0.2);
  border-radius: 999px;
  font-weight: 900;
}

.grade-tag {
  color: #173b9b !important;
  background: #eef4ff !important;
  border-color: rgba(36, 87, 214, 0.22) !important;
}

.question-detail {
  min-width: 0;
  padding: 30px clamp(24px, 4vw, 64px) 60px;
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.98)),
    url("/college/assets/hero-learning-map.png") right top / 760px auto no-repeat;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.detail-header h1 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 28px;
  font-weight: 900;
  line-height: 1.2;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.tag {
  padding: 5px 9px;
  color: #344159;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.stimulus {
  margin-bottom: 25px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(245, 173, 36, 0.28);
  border-left: 4px solid var(--amber);
  border-radius: 8px;
}

.stimulus h2 {
  margin: 0 0 9px;
  color: var(--ink-strong);
  font-size: 15px;
}

.stimulus p {
  margin: 0;
  color: #4b5c73;
  font-size: 14px;
  line-height: 1.85;
}

.stem {
  margin: 0 0 24px;
  color: var(--ink-strong);
  font-size: clamp(17px, 1.5vw, 20px);
  font-weight: 800;
  line-height: 1.85;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 0 0 25px;
}

.audio-list {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
}

.audio-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(220px, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: #eef8ff;
  border: 1px solid #d7e6fa;
  border-radius: 8px;
}

.audio-row strong {
  font-size: 13px;
}

.audio-row audio {
  width: 100%;
  min-width: 0;
}

.audio-player {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.audio-speed-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #294260;
  font-size: 13px;
  font-weight: 800;
}

.audio-speed-options {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #b9cee8;
  border-radius: 6px;
  background: #fff;
}

.audio-speed-option {
  min-width: 58px;
  min-height: 32px;
  padding: 5px 10px;
  border: 0;
  border-right: 1px solid #b9cee8;
  border-radius: 0;
  background: #fff;
  color: #38516f;
  font: inherit;
  cursor: pointer;
}

.audio-speed-option:last-child {
  border-right: 0;
}

.audio-speed-option:hover {
  background: #e8f4ff;
}

.audio-speed-option.active {
  background: #1769d8;
  color: #fff;
}

.audio-speed-option:focus-visible {
  position: relative;
  outline: 2px solid #10213d;
  outline-offset: -2px;
}

.asset-figure {
  margin: 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
}

.asset-figure img {
  display: block;
  height: auto;
  max-width: 100%;
  max-height: 430px;
  margin: 0 auto;
  object-fit: contain;
}

.asset-figure figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.choices {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-height: 50px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.choice-label {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--blue-dark);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-weight: 900;
}

.choice.correct {
  background: rgba(223, 248, 245, 0.84);
  border-color: rgba(15, 159, 155, 0.42);
}

.choice.correct .choice-label {
  color: white;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  border-color: transparent;
}

.choice-placeholder {
  color: var(--muted);
  font-size: 13px;
}

.answer-toolbar,
.extension-toolbar,
.score-toolbar,
.writing-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.answer-toolbar {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.answer-toolbar button,
.extension-toolbar button,
.score-toolbar button,
.rubric-open-button {
  min-height: 40px;
  padding: 9px 15px;
  color: white;
  background: linear-gradient(135deg, var(--blue), #1586d5);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(36, 87, 214, 0.24);
  font-weight: 850;
}

.answer-toolbar button:hover,
.extension-toolbar button:hover,
.score-toolbar button:hover,
.rubric-open-button:hover {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
}

.answer-status,
.response-status,
.muted-text {
  color: var(--muted);
  font-size: 13px;
}

.answer-status strong {
  color: var(--blue);
}

.response-status,
.score-pending,
.score-error {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px;
  background: #f3f9ff;
  border: 1px solid #d7e6fa;
  border-radius: 8px;
}

.illustrated-explanation {
  margin: 28px 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(36, 87, 214, 0.18);
  border-left: 5px solid var(--blue);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
}

.learning-panel .illustrated-explanation {
  margin: 18px 0 0;
  background: #ffffff;
  box-shadow: none;
}

.illustrated-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.illustrated-header h2 {
  margin: 0 0 6px;
  color: var(--ink-strong);
  font-size: 18px;
}

.illustrated-header p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.illustrated-header a {
  flex: 0 0 auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  color: white;
  text-decoration: none;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(15, 159, 155, 0.22);
  font-size: 13px;
  font-weight: 850;
}

.illustrated-explanation iframe {
  width: 100%;
  height: min(72vh, 760px);
  display: block;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.learning-tools {
  margin-top: 32px;
  border-top: 1px solid var(--line);
}

.learning-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 22px 0 0;
}

.learning-tabs button {
  min-height: 38px;
  padding: 8px 13px;
  color: #344159;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
}

.learning-tabs button:hover {
  color: var(--blue);
  background: #edf7ff;
}

.learning-tabs button.active {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.learning-panel,
.step-solution,
.writing-sample,
.writing-practice,
.score-result {
  margin-top: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
}

.learning-kicker {
  margin: 0 0 14px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.learning-panel h2,
.step-solution h3,
.writing-sample h2,
.writing-practice h2,
.score-result h3 {
  margin: 0 0 12px;
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 900;
}

.learning-panel p,
.step-solution p,
.writing-sample p,
.writing-practice p {
  margin: 0;
  color: #344159;
  line-height: 1.85;
}

.step-solution {
  border-left: 4px solid var(--blue);
}

.step-solution ol,
.step-solution ul,
.distractor-list,
.extension-choices,
.score-list {
  margin: 10px 0 0;
  padding-left: 22px;
  color: #344159;
  line-height: 1.85;
}

.distractor-list {
  display: grid;
  gap: 10px;
  padding-left: 0;
  list-style: none;
}

.distractor-list li,
.extension-choices li,
.score-list li {
  padding: 10px 12px;
  background: #f7fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.extension-stem {
  margin: 0 0 14px;
  color: var(--ink-strong);
  font-weight: 800;
  line-height: 1.75;
}

.unavailable {
  padding: 18px;
  color: var(--muted);
  background: #f7fbff;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 32px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.74);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
}

.empty-state strong {
  color: var(--ink-strong);
  font-size: 16px;
}

.writing-actions {
  margin: 22px 0 12px;
}

.student-essay {
  width: 100%;
  min-height: 260px;
  padding: 14px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  outline: none;
  resize: vertical;
  line-height: 1.8;
}

.score-toolbar {
  margin-top: 12px;
}

.score-toolbar span {
  color: var(--muted);
  font-size: 13px;
}

.score-result header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.score-result header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.score-result header strong {
  color: var(--blue);
  font-size: 24px;
  font-weight: 900;
}

.dimension-grid,
.rubric-criteria,
.rubric-levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.dimension-grid article,
.rubric-criteria article,
.rubric-levels article {
  padding: 14px;
  background: #f7fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.dimension-grid strong,
.rubric-criteria strong,
.rubric-levels span {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 900;
}

.dimension-grid p,
.rubric-criteria p,
.rubric-levels p {
  margin: 0;
  color: #4b5c73;
  font-size: 13px;
  line-height: 1.7;
}

.revision-suggestion,
.zero-reason {
  margin-top: 14px;
  padding: 12px 14px;
  background: #fff8e4;
  border: 1px solid rgba(245, 173, 36, 0.34);
  border-radius: 8px;
  color: #6d5620;
}

.score-error {
  color: #7b2b22;
  background: #fff0ed;
  border-color: rgba(229, 100, 78, 0.32);
}

.score-pending {
  color: #255171;
}

.rubric-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 28, 49, 0.46);
  backdrop-filter: blur(10px);
}

.rubric-dialog {
  width: min(920px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 68px rgba(15, 28, 49, 0.28);
}

.rubric-dialog-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.rubric-dialog-header h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 18px;
}

.rubric-dialog-header button {
  min-height: 36px;
  padding: 7px 12px;
  color: var(--ink);
  background: #edf7ff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
}

.rubric-content {
  display: grid;
  gap: 22px;
  padding: 20px;
}

.rubric-content h3 {
  margin: 0 0 12px;
  color: var(--ink-strong);
  font-size: 16px;
}

.rubric-notes {
  margin: 0;
  padding-left: 20px;
  color: #4b5c73;
  line-height: 1.8;
}

.rubric-loading {
  padding: 24px;
  color: var(--muted);
}

.is-hidden {
  display: none !important;
}

.mode-switcher {
  max-width: 1500px;
  margin: 18px auto 0;
  padding: 0 clamp(18px, 4vw, 42px);
  display: flex;
  gap: 8px;
}

.mode-switcher button {
  min-height: 40px;
  padding: 8px 15px;
  color: #344159;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 850;
  box-shadow: var(--small-shadow);
}

.mode-switcher button.active {
  color: #ffffff;
  background: var(--ink);
  border-color: var(--ink);
}

.welcome-app {
  max-width: 1500px;
  margin: 18px auto 42px;
  padding: 0 clamp(18px, 4vw, 42px);
}

.materials-app {
  max-width: 1500px;
  margin: 18px auto 42px;
  padding: 0 clamp(18px, 4vw, 42px);
}

.welcome-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 370px);
  gap: 18px;
  align-items: stretch;
  padding: clamp(24px, 4vw, 42px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.78)),
    url("/college/assets/hero-learning-map.png") right center / 760px auto no-repeat;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.welcome-copy h1 {
  max-width: 850px;
  margin: 0 0 14px;
  color: var(--ink-strong);
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.12;
  font-weight: 950;
}

.welcome-copy p:not(.eyebrow),
.welcome-access-panel p,
.welcome-feature-card p,
.upgrade-dialog-panel header p,
.upgrade-plan p {
  color: #4b5c73;
  line-height: 1.8;
}

.welcome-copy > p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  font-size: 16px;
}

.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.welcome-access-panel {
  align-self: stretch;
  padding: 22px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 159, 155, 0.22);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
}

.welcome-access-panel span,
.welcome-access-panel strong {
  display: block;
}

.welcome-access-panel span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 950;
}

.welcome-access-panel strong {
  margin-top: 8px;
  color: var(--ink-strong);
  font-size: 22px;
  line-height: 1.25;
  font-weight: 950;
}

.welcome-access-panel button {
  width: 100%;
  margin-top: 14px;
}

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

.welcome-quota-summary span {
  padding: 9px 10px;
  color: #344159;
  background: #f3f9fc;
  border: 1px solid var(--line);
  border-radius: 8px;
  line-height: 1.5;
}

.welcome-quota-summary strong {
  display: inline;
  margin: 0;
  font-size: inherit;
}

.welcome-section {
  margin-top: 18px;
  padding: clamp(20px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
}

.welcome-section h2 {
  margin: 0;
  color: var(--ink-strong);
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.3;
}

.welcome-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.welcome-feature-card {
  min-height: 150px;
  padding: 18px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.welcome-feature-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 950;
}

.welcome-feature-card p {
  margin: 0;
  font-size: 14px;
}

.access-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.access-compare article {
  padding: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
}

.access-compare ul {
  margin: 16px 0 0;
  padding-left: 20px;
  color: #4b5c73;
  line-height: 1.9;
}

.upgrade-dialog {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  align-items: start;
  justify-items: center;
  overflow: auto;
  padding: 12px 24px;
  background: rgba(15, 28, 49, 0.48);
  backdrop-filter: blur(8px);
}

.upgrade-dialog-panel {
  width: min(1140px, 100%);
  max-height: none;
  overflow: visible;
  padding: 20px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(15, 28, 49, 0.28);
}

.upgrade-dialog-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.upgrade-dialog-panel h2 {
  margin: 0 0 6px;
  color: var(--ink-strong);
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  line-height: 1.2;
}

.upgrade-dialog-panel header p {
  max-width: 720px;
  margin: 0;
}

.upgrade-dialog-panel header .payment-contact-note {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: none;
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(20, 184, 166, 0.28);
  border-radius: 8px;
  background: rgba(236, 253, 245, 0.82);
  color: #0f766e;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.upgrade-dialog-panel header .payment-contact-note a {
  color: #0f5f76;
  font-weight: 950;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.upgrade-error {
  margin: 0 0 12px;
}

.plan-feature-list li {
  position: relative;
  padding-left: 18px;
  color: #344159;
  line-height: 1.55;
}

.plan-feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 8px;
  height: 8px;
  background: var(--teal);
  border-radius: 999px;
  transform: translateY(-50%);
}

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

.upgrade-plan {
  position: relative;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  background: #f8fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.upgrade-plan.featured {
  background: linear-gradient(180deg, #ecfbf8, #ffffff);
  border-color: rgba(15, 159, 155, 0.32);
  box-shadow: 0 18px 36px rgba(15, 159, 155, 0.12);
}

.upgrade-plan.current-plan {
  border-color: rgba(37, 99, 235, 0.48);
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.plan-badge {
  align-self: flex-start;
  margin-bottom: 10px;
  padding: 5px 9px;
  color: #0c5d59;
  background: #dff8f5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

.plan-current-label {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin: -3px 0 10px;
  padding: 4px 9px;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.upgrade-plan h3 {
  margin: 0 0 10px;
  color: var(--ink-strong);
  font-size: 18px;
  font-weight: 950;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.plan-price strong {
  color: var(--ink-strong);
  font-size: 39px;
  line-height: 1;
  font-weight: 950;
}

.plan-price span,
.upgrade-plan small {
  color: var(--muted);
  font-weight: 850;
}

.plan-price span {
  line-height: 1.35;
}

.plan-original,
.plan-discount {
  display: block;
  width: fit-content;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 900;
}

.plan-original {
  color: var(--muted);
}

.plan-original s {
  color: #6b7890;
  text-decoration-thickness: 2px;
}

.plan-discount {
  padding: 5px 9px;
  color: #7a5200;
  background: #fff4dc;
  border: 1px solid rgba(245, 173, 36, 0.36);
  border-radius: 999px;
}

.upgrade-plan p {
  margin: 0 0 8px;
  line-height: 1.55;
}

.plan-feature-list {
  display: grid;
  gap: 7px;
  margin: 12px 0 16px;
  padding: 0;
  list-style: none;
}

.plan-feature-list li {
  display: grid;
  gap: 1px;
  padding-left: 18px;
}

.plan-feature-list li.plan-feature-heading {
  margin-top: 2px;
  padding-left: 0;
}

.plan-feature-list li.plan-feature-heading::before {
  display: none;
}

.plan-feature-list strong {
  color: var(--ink-strong);
  font-size: 12px;
  font-weight: 950;
}

.plan-feature-list span {
  color: #4b5c73;
  font-size: 12.5px;
  line-height: 1.38;
}

.upgrade-plan button {
  width: 100%;
  min-height: 40px;
  margin-top: auto;
  color: #ffffff;
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.upgrade-plan.featured button {
  background: linear-gradient(135deg, var(--teal), var(--blue));
}

.upgrade-plan button.selected {
  background: var(--blue);
}

.upgrade-plan button.lower-plan:disabled {
  color: #64748b;
  background: #e2e8f0;
  box-shadow: none;
  cursor: not-allowed;
}

.fee-reference-plan .plan-feature-list {
  margin-bottom: 0;
}

.renewal-dialog-panel {
  width: min(640px, 100%);
}

.checkout-confirmation-dialog {
  z-index: 90;
  align-items: center;
}

.checkout-confirmation-panel {
  width: min(680px, 100%);
}

.checkout-confirmation-detail {
  display: grid;
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.checkout-confirmation-detail div {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  padding: 12px 14px;
  background: #f8fbff;
}

.checkout-confirmation-detail div + div {
  border-top: 1px solid var(--line);
}

.checkout-confirmation-detail .projected-expiry {
  background: #ecfbf8;
}

.checkout-confirmation-detail dt {
  color: var(--muted);
  font-weight: 800;
}

.checkout-confirmation-detail dd {
  margin: 0;
  color: var(--ink-strong);
  font-weight: 900;
}

.checkout-confirmation-detail .projected-expiry dd {
  color: #0f766e;
  font-size: 1.08rem;
}

.checkout-confirmation-note {
  margin: 0 0 18px;
  padding: 12px 14px;
  color: #40526d;
  background: #fff8e8;
  border: 1px solid rgba(245, 173, 36, 0.42);
  border-radius: 8px;
  line-height: 1.65;
}

.checkout-confirmation-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.payment-result-panel {
  width: min(660px, 100%);
  max-height: calc(100dvh - 40px);
  overflow: auto;
}

.payment-result-panel[data-payment-status="paid"] {
  border-top: 4px solid #0f9f9b;
}

.payment-result-panel[data-payment-status="failed"] {
  border-top: 4px solid #dc5a4f;
}

.payment-result-detail {
  display: grid;
  gap: 0;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.payment-result-detail div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 12px 14px;
  background: #f7fbff;
}

.payment-result-detail div + div {
  border-top: 1px solid var(--line);
}

.payment-result-detail dt {
  color: var(--muted);
  font-weight: 800;
}

.payment-result-detail dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-strong);
  font-weight: 900;
}

.payment-result-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.promo-dialog-panel {
  width: min(620px, 100%);
}

.promo-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.promo-form label {
  display: grid;
  gap: 7px;
  color: #172846;
  font-size: 13px;
  font-weight: 900;
}

.promo-form input {
  min-height: 48px;
  border: 1px solid #cfdbe8;
  border-radius: 8px;
  padding: 0 14px;
  font: inherit;
  color: var(--ink-strong);
  background: #ffffff;
}

.promo-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.promo-actions .primary-action,
.promo-actions .secondary-action {
  min-width: 150px;
}

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

.renewal-actions button {
  min-height: 42px;
}

.admin-app {
  max-width: 1500px;
  margin: 18px auto 42px;
  padding: 0 clamp(18px, 4vw, 42px);
}

.admin-shell {
  display: grid;
  gap: 18px;
}

.admin-hero,
.admin-card,
.admin-metric {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
}

.admin-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
}

.admin-hero h1 {
  margin: 0 0 10px;
  color: var(--ink-strong);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
}

.admin-hero p:last-child {
  max-width: 820px;
  margin: 0;
  color: #4b5c73;
  line-height: 1.8;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-tabs button {
  min-height: 40px;
  padding: 9px 14px;
  color: #344159;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
}

.admin-tabs button.active {
  color: #ffffff;
  background: var(--ink);
  border-color: var(--ink);
}

.admin-loading {
  padding: 12px 14px;
  color: var(--blue-dark);
  background: #eef8ff;
  border: 1px solid #d7e6fa;
  border-radius: 8px;
  font-weight: 850;
}

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

.admin-metric {
  min-height: 124px;
  padding: 18px;
}

.admin-metric span,
.admin-metric small {
  display: block;
  color: var(--muted);
}

.admin-metric span {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 850;
}

.admin-metric strong {
  display: block;
  color: var(--ink-strong);
  font-size: clamp(1.55rem, 3vw, 2.3rem);
  line-height: 1.15;
}

.admin-metric small {
  margin-top: 8px;
  font-size: 12px;
}

.admin-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.admin-manage-grid {
  grid-template-columns: minmax(280px, 0.36fr) minmax(0, 1fr);
}

.admin-card {
  min-width: 0;
  padding: 20px;
}

.admin-card h2 {
  margin: 0 0 16px;
  color: var(--ink-strong);
  font-size: 19px;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-form label,
.admin-filter-row label {
  display: block;
}

.admin-form .admin-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.admin-form .admin-check-row input {
  width: 18px;
  min-height: 18px;
}

.admin-form .admin-check-row span {
  margin: 0;
  font-size: 13px;
}

.admin-form label > span,
.admin-filter-row label > span {
  display: block;
  margin-bottom: 7px;
  color: #344159;
  font-size: 12px;
  font-weight: 850;
}

.admin-form input,
.admin-form select,
.admin-form textarea,
.admin-filter-row input,
.admin-filter-row select,
.admin-actions select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.admin-actions select {
  min-width: 150px;
  min-height: 36px;
  font-size: 13px;
  font-weight: 850;
}

.admin-form textarea {
  resize: vertical;
}

.admin-form-wide,
.admin-form button {
  grid-column: 1 / -1;
}

.admin-form-single {
  grid-template-columns: 1fr;
}

.admin-email-note {
  margin-top: 18px;
}

.admin-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

.admin-user-table {
  min-width: 840px;
  table-layout: fixed;
}

.admin-user-table:not(.admin-user-table-compact) th:nth-child(1),
.admin-user-table:not(.admin-user-table-compact) td:nth-child(1) {
  width: 26%;
}

.admin-user-table:not(.admin-user-table-compact) th:nth-child(2),
.admin-user-table:not(.admin-user-table-compact) td:nth-child(2) {
  width: 10%;
}

.admin-user-table:not(.admin-user-table-compact) th:nth-child(3),
.admin-user-table:not(.admin-user-table-compact) td:nth-child(3),
.admin-user-table:not(.admin-user-table-compact) th:nth-child(4),
.admin-user-table:not(.admin-user-table-compact) td:nth-child(4),
.admin-user-table:not(.admin-user-table-compact) th:nth-child(5),
.admin-user-table:not(.admin-user-table-compact) td:nth-child(5) {
  width: 13%;
}

.admin-user-table:not(.admin-user-table-compact) th:nth-child(6),
.admin-user-table:not(.admin-user-table-compact) td:nth-child(6) {
  width: 25%;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.admin-table th {
  color: #344159;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

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

.admin-table td span,
.admin-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-user-table td:first-child {
  overflow-wrap: anywhere;
}

.admin-user-table:not(.admin-user-table-compact) td:nth-child(3),
.admin-user-table:not(.admin-user-table-compact) td:nth-child(4),
.admin-user-table:not(.admin-user-table-compact) td:nth-child(5) {
  line-height: 1.55;
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-actions {
  white-space: nowrap;
}

.admin-user-table .admin-actions {
  min-width: 0;
  white-space: normal;
}

.admin-action-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  width: 100%;
  min-width: 0;
}

.admin-action-controls select,
.admin-action-controls button {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
}

.admin-actions button {
  min-height: 34px;
  margin: 0 5px 5px 0;
  padding: 7px 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
}

.admin-actions button:hover:not(:disabled) {
  color: var(--blue);
  background: #edf7ff;
}

.admin-pill {
  width: fit-content;
  padding: 5px 9px;
  color: #255171;
  background: #edf7ff;
  border: 1px solid #d7e6fa;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.admin-pill.success,
.admin-pill.paid {
  color: #0d6b68;
  background: var(--mint);
  border-color: rgba(15, 159, 155, 0.28);
}

.admin-pill.trial,
.admin-pill.pending {
  color: #7a5200;
  background: #fff9ec;
  border-color: rgba(245, 173, 36, 0.35);
}

.admin-pill.canceled,
.admin-pill.disabled {
  color: #7b2b22;
  background: #fff0ed;
  border-color: rgba(229, 100, 78, 0.32);
}

.admin-stack {
  display: grid;
  gap: 10px;
}

.admin-usage-row,
.admin-performance-row {
  display: grid;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: #f7fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-usage-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-usage-row span,
.admin-performance-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-usage-row b,
.admin-performance-row b {
  color: var(--ink-strong);
  font-size: 20px;
}

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

.operations-toolbar h2,
.operations-toolbar p {
  margin-bottom: 0;
}

.operations-toolbar .auth-notice {
  grid-column: 1 / -1;
  margin: 0;
}

.operations-worker small {
  display: block;
  max-width: 680px;
  margin-top: 5px;
  color: #8a3a32;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.operations-worker .admin-pill {
  font-size: 12px;
}

.worker-token-tool {
  min-width: 0;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.worker-token-heading h3 {
  margin: 0 0 4px;
  color: var(--ink-strong);
  font-size: 16px;
}

.worker-token-heading p,
.worker-token-tool > p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.worker-token-tool label {
  display: block;
  margin-bottom: 7px;
  color: #344159;
  font-size: 12px;
  font-weight: 850;
}

.worker-token-value {
  display: flex;
  gap: 8px;
  min-width: 0;
  margin-bottom: 10px;
}

.worker-token-value input {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  padding: 9px 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font: 12px ui-monospace, SFMono-Regular, Consolas, monospace;
}

.worker-token-value button {
  flex: none;
}

.worker-token-value button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.worker-token-status:not(:empty) {
  margin-top: 10px;
  color: #0d6b68;
  font-weight: 700;
}

.worker-token-status.error {
  color: #a43f38;
}

.question-quality-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-filter-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 0.3fr);
  gap: 14px;
}

.admin-search-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-search-form label {
  min-width: 0;
}

.admin-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.admin-search-results button {
  padding: 11px 12px;
  text-align: left;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
}

.admin-search-results button.active {
  border-color: rgba(15, 159, 155, 0.55);
  background: rgba(15, 159, 155, 0.08);
}

.admin-search-results strong,
.admin-search-results span {
  display: block;
}

.admin-search-results span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.admin-performance-row {
  grid-template-columns: minmax(0, 1fr) minmax(100px, 0.7fr) 50px;
  margin-bottom: 10px;
}

.admin-progress {
  height: 9px;
  overflow: hidden;
  background: #e8eef6;
  border-radius: 999px;
}

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

.practice-app {
  max-width: 1500px;
  margin: 18px auto 42px;
  padding: 0 clamp(18px, 4vw, 42px);
}

.practice-hero,
.analysis-hero,
.practice-runner {
  display: grid;
  gap: 18px;
}

.practice-hero {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  align-items: start;
  padding: 26px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.practice-hero h1,
.analysis-hero h1 {
  margin: 0 0 12px;
  color: var(--ink-strong);
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.15;
}

.practice-hero p,
.analysis-hero p {
  max-width: 720px;
  margin: 0;
  color: #4b5c73;
  line-height: 1.85;
}

.practice-card,
.performance-panel,
.weakness-panel,
.weakness-material-panel,
.learning-map,
.review-panel,
.practice-progress,
.practice-question {
  padding: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
}

.practice-card label,
.practice-card fieldset {
  display: block;
  margin: 0 0 15px;
  padding: 0;
  border: 0;
}

.practice-card label > span,
.practice-card legend {
  display: block;
  margin-bottom: 7px;
  color: #344159;
  font-size: 12px;
  font-weight: 850;
}

.practice-card select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}

.practice-card .is-disabled {
  opacity: 0.55;
}

.primary-action,
.practice-toolbar button,
.section-title-row button {
  min-height: 40px;
  padding: 9px 15px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), #1586d5);
  border: 0;
  border-radius: 8px;
  box-shadow: 0 12px 26px rgba(36, 87, 214, 0.22);
  font-weight: 850;
}

.practice-error {
  margin: 12px 0 0;
  padding: 10px 12px;
  color: #7b2b22;
  background: #fff0ed;
  border: 1px solid rgba(229, 100, 78, 0.32);
  border-radius: 8px;
}

.practice-runner {
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
}

.practice-progress {
  position: sticky;
  top: 92px;
}

.practice-progress h2 {
  margin: 0 0 14px;
  color: var(--ink-strong);
  font-size: 22px;
}

.progress-bar,
.meter {
  height: 9px;
  overflow: hidden;
  background: #e8eef6;
  border-radius: 999px;
}

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

.practice-stats {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 16px 0;
  color: var(--muted);
}

.practice-stats strong {
  color: var(--ink-strong);
  font-size: 22px;
}

.difficulty-pill {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.difficulty-pill.easy {
  color: #0d6b68;
  background: var(--mint);
}

.difficulty-pill.medium {
  color: #255171;
  background: #edf7ff;
}

.difficulty-pill.hard {
  color: #7b2b22;
  background: #fff0ed;
}

.question-jump {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
  margin-top: 18px;
}

.question-jump button {
  min-height: 34px;
  color: var(--muted);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 850;
}

.question-jump button.active {
  color: #ffffff;
  background: var(--ink);
}

.question-jump button.answered:not(.active) {
  color: #0d6b68;
  background: var(--mint);
  border-color: rgba(15, 159, 155, 0.28);
}

.practice-choice-list {
  list-style: none;
}

.practice-choice-list li {
  margin: 0;
}

.practice-choice {
  width: 100%;
  text-align: left;
}

.practice-choice.selected {
  background: rgba(223, 248, 245, 0.9);
  border-color: rgba(15, 159, 155, 0.48);
  box-shadow: inset 4px 0 0 var(--teal);
}

.practice-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.analysis-layout {
  display: grid;
  gap: 18px;
}

.analysis-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 24px 26px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

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

.performance-panel h2,
.weakness-panel h2,
.learning-map h2,
.review-panel h2,
.dashboard-map h3 {
  margin: 0 0 14px;
  color: var(--ink-strong);
  font-size: 18px;
}

.performance-panel article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 46px;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.performance-panel article:last-child {
  border-bottom: 0;
}

.performance-panel article div:first-child {
  display: grid;
  gap: 2px;
}

.performance-panel strong {
  color: var(--ink-strong);
}

.performance-panel span,
.performance-panel em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.weakness-list,
.recommendation-list,
.next-step-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.weakness-list article,
.recommendation-list article,
.next-step-list article {
  padding: 14px;
  background: #f7fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.weakness-list strong,
.recommendation-list strong,
.next-step-list strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-strong);
}

.weakness-list span,
.recommendation-list span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.weakness-list p,
.recommendation-list p,
.next-step-list p {
  margin: 6px 0 0;
  color: #4b5c73;
  font-size: 13px;
  line-height: 1.7;
}

.weakness-material-panel {
  display: grid;
  gap: 16px;
}

.weakness-material-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.weakness-material-header h2 {
  margin-bottom: 8px;
}

.weakness-material-header p:not(.learning-kicker) {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.weakness-status {
  flex: none;
  padding: 7px 10px;
  color: #0d5f5a;
  background: #e8faf7;
  border: 1px solid #9ee4dc;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.weakness-status.failed {
  color: #9a3412;
  background: #fff4ed;
  border-color: #fed7aa;
}

.weakness-status.completed {
  color: #0d6b38;
  background: #eefcf3;
  border-color: #b8e8c8;
}

.weakness-progress {
  display: grid;
  gap: 8px;
}

.weakness-progress > div {
  height: 10px;
  overflow: hidden;
  background: #e8eef6;
  border-radius: 999px;
}

.weakness-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  border-radius: inherit;
}

.weakness-progress strong {
  color: var(--ink);
  font-size: 13px;
}

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

.weakness-actions a,
.weakness-actions button,
.weakness-material-list a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  color: #ffffff;
  background: var(--ink);
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.weakness-actions a:first-child {
  color: #12335f;
  background: #eef6ff;
  border: 1px solid #bfdbfe;
}

.weakness-material-list {
  display: grid;
  gap: 10px;
}

.weakness-material-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  background: #f7fbff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.weakness-item-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.weakness-item-actions button {
  min-height: 38px;
  padding: 8px 12px;
  color: #12335f;
  background: #ffffff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  font-weight: 900;
}

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

.weakness-material-list span,
.weakness-material-list em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.6;
}

.materials-hero,
.materials-report-card,
.materials-empty {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
}

.materials-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: clamp(22px, 4vw, 34px);
}

.materials-hero h1 {
  margin: 0 0 10px;
  color: var(--ink-strong);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
}

.materials-hero p {
  max-width: 820px;
  margin: 0;
  color: #4b5c73;
  line-height: 1.8;
}

.materials-hero button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 14px;
  color: #1550ba;
  background: #eef5ff;
  border: 1px solid #c8dcff;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.materials-report-grid {
  display: grid;
  gap: 14px;
}

.materials-report-card {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 3vw, 26px);
}

.materials-report-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.materials-report-card h2 {
  margin: 0 0 7px;
  color: var(--ink-strong);
  font-size: 22px;
}

.materials-report-card header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.weakness-material-list.compact {
  max-height: 430px;
  overflow: auto;
  padding-right: 2px;
}

.materials-empty {
  display: grid;
  gap: 6px;
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

.materials-empty strong {
  color: var(--ink-strong);
  font-size: 20px;
}

.materials-empty.error {
  color: #9a3412;
  background: #fff7ed;
  border-color: #fed7aa;
}

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

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

.map-summary article {
  padding: 15px;
  background: #eef8ff;
  border: 1px solid #d7e6fa;
  border-radius: 8px;
}

.map-summary span,
.map-summary strong {
  display: block;
}

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

.map-summary strong {
  color: var(--ink-strong);
  font-size: 26px;
  font-weight: 900;
}

.dashboard-map {
  margin-top: 18px;
}

.dashboard-map .performance-panel {
  margin: 0 0 16px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

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

.review-card {
  padding: 15px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
}

.review-card.wrong {
  border-left-color: var(--danger);
}

.review-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.review-card header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.review-card p {
  margin: 0 0 10px;
  color: #344159;
  line-height: 1.75;
}

.review-answer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.review-answer span {
  padding: 6px 9px;
  color: #344159;
  background: #f7fbff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.review-card a {
  color: var(--blue);
  font-weight: 850;
  text-decoration: none;
}

.tutor-open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  margin-left: 10px;
  padding: 8px 13px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  border: 0;
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(15, 159, 155, 0.2);
  font-size: 13px;
  font-weight: 850;
}

.tutor-panel {
  margin-top: 14px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid rgba(15, 159, 155, 0.24);
  border-left: 5px solid var(--teal);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
}

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

.tutor-header h3 {
  margin: 0;
  color: var(--ink-strong);
  font-size: 18px;
}

.tutor-header span {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: #0d6b68;
  background: var(--mint);
  border: 1px solid rgba(15, 159, 155, 0.24);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.tutor-block {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.tutor-block:first-of-type {
  border-top: 0;
}

.tutor-block strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink-strong);
}

.tutor-block p,
.tutor-block li {
  color: #344159;
  line-height: 1.8;
}

.tutor-block ol,
.tutor-block ul {
  margin: 0;
  padding-left: 22px;
}

.tutor-block.diagnosis {
  padding: 14px;
  background: #fff8e4;
  border: 1px solid rgba(245, 173, 36, 0.34);
  border-radius: 8px;
}

.tutor-block.concept {
  padding: 14px;
  background: #eef8ff;
  border: 1px solid #d7e6fa;
  border-radius: 8px;
}

.tutor-confirm-choices {
  display: grid;
  gap: 9px;
  margin: 12px 0;
}

.tutor-confirm-choices button {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-height: 48px;
  padding: 9px 12px;
  text-align: left;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tutor-confirm-choices button.selected {
  background: rgba(223, 248, 245, 0.9);
  border-color: rgba(15, 159, 155, 0.44);
  box-shadow: inset 4px 0 0 var(--teal);
}

.tutor-confirm-choices span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--blue-dark);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-weight: 900;
}

.tutor-confirm-choices p {
  margin: 0;
}

.tutor-submit {
  margin-top: 2px;
}

.tutor-result {
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: 8px;
}

.tutor-result.passed {
  color: #0d6b68;
  background: var(--mint);
  border: 1px solid rgba(15, 159, 155, 0.25);
}

.tutor-result.retry {
  color: #7b2b22;
  background: #fff0ed;
  border: 1px solid rgba(229, 100, 78, 0.3);
}

.tutor-result strong,
.tutor-result span {
  display: block;
}

.tutor-result p {
  margin: 6px 0;
}

.floating-tutor {
  position: fixed;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 99999;
  font-size: 0.95rem;
  pointer-events: none;
}

.floating-tutor-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 176px;
  min-height: 62px;
  padding: 10px 16px 10px 10px;
  color: #ffffff;
  text-align: left;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  border: 0;
  border-radius: 999px;
  box-shadow: 0 18px 42px rgba(15, 31, 53, 0.3);
  cursor: pointer;
  pointer-events: auto;
}

.floating-tutor-button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

.floating-tutor-icon {
  width: 46px;
  height: 46px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  background: #ffffff;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.65);
}

.floating-tutor-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 2px;
}

.floating-tutor-label {
  display: grid;
  gap: 1px;
}

.floating-tutor-label strong {
  font-size: 0.98rem;
  font-weight: 900;
}

.floating-tutor-label small {
  font-size: 0.78rem;
  font-weight: 750;
  opacity: 0.92;
}

.floating-tutor-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(180px, 1fr) auto auto;
  width: min(420px, calc(100vw - 28px));
  max-height: min(820px, calc(100dvh - 36px));
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(15, 31, 53, 0.28);
  pointer-events: auto;
}

.floating-tutor-resize-handle {
  position: relative;
  height: 14px;
  background: #101d33;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
}

.floating-tutor-resize-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 5px;
  width: 52px;
  height: 4px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.42);
  border-radius: 999px;
}

body.is-resizing-floating-tutor {
  cursor: ns-resize;
  user-select: none;
}

.floating-tutor-panel header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  color: #ffffff;
  background: #101d33;
}

.floating-tutor-panel header span,
.floating-tutor-panel header strong {
  display: block;
}

.floating-tutor-panel header span {
  color: #8af2e8;
  font-size: 0.78rem;
  font-weight: 900;
}

.floating-tutor-panel header strong {
  margin-top: 3px;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  font-size: 1.35rem;
  cursor: pointer;
}

.floating-tutor-context {
  padding: 12px 16px;
  background: #f5f8fb;
  border-bottom: 1px solid var(--line);
}

.floating-tutor-context span {
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 900;
}

.floating-tutor-context p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.floating-tutor-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px 16px;
  overflow-y: auto;
  background: #ffffff;
}

.floating-tutor-message {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.65;
}

.floating-tutor-message span {
  display: block;
  margin-bottom: 3px;
  font-size: 0.75rem;
  font-weight: 900;
}

.floating-tutor-message p {
  margin: 0;
  white-space: pre-wrap;
}

.floating-tutor-message strong {
  font-weight: 950;
}

.floating-tutor-message mjx-container {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

.floating-tutor-message.assistant {
  justify-self: start;
  color: var(--ink);
  background: #f4f8fb;
  border: 1px solid var(--line);
}

.floating-tutor-message.user {
  justify-self: end;
  color: #ffffff;
  background: #2563d8;
}

.floating-tutor-message.is-loading p {
  color: var(--muted);
}

.floating-tutor-error {
  margin: 0 16px 10px;
  padding: 9px 10px;
  color: #8a2d1f;
  background: #fff0ed;
  border: 1px solid rgba(229, 100, 78, 0.26);
  border-radius: 8px;
  font-weight: 800;
}

.floating-tutor-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--line);
}

.floating-tutor-form textarea {
  width: 100%;
  resize: none;
  line-height: 1.55;
}

.floating-tutor-form button {
  align-self: end;
  min-width: 74px;
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 220px minmax(260px, 0.42fr) minmax(0, 1fr);
  }

  .brand-logo {
    width: 150px;
  }
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 100dvh;
    align-items: center;
    padding: 22px 0;
  }

  .login-visual {
    display: none;
  }

  .login-card {
    width: min(100% - 28px, 430px);
    align-self: center;
  }

  .topbar {
    position: static;
    flex-direction: column;
    align-items: flex-start;
  }

  .paper-title,
  .topbar-actions,
  .user-menu {
    width: 100%;
  }

  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .upgrade-account-button {
    width: 100%;
  }

  .user-menu {
    justify-content: space-between;
  }

  .access-banner {
    align-items: flex-start;
    flex-direction: column;
    margin: 14px 12px 0;
  }

  .promo-inline-button {
    width: 100%;
    margin-left: 0;
  }

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

  .welcome-app,
  .materials-app {
    padding: 0 12px;
  }

  .welcome-hero,
  .access-compare {
    grid-template-columns: 1fr;
  }

  .welcome-feature-grid,
  .upgrade-plan-grid {
    grid-template-columns: 1fr;
  }

  .admin-app {
    padding: 0 12px;
  }

  .admin-hero {
    display: block;
  }

  .admin-hero .secondary-action {
    margin-top: 14px;
  }

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

  .admin-two-column,
  .admin-manage-grid,
  .admin-filter-row,
  .admin-search-form {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
    margin: 0 12px 28px;
  }

  .practice-app {
    padding: 0 12px;
  }

  .materials-hero,
  .materials-report-card > header {
    flex-direction: column;
  }

  .notification-wrap,
  .notification-button {
    width: 100%;
  }

  .notification-panel {
    left: 0;
    right: auto;
    width: 100%;
  }

  .practice-hero,
  .practice-runner,
  .analysis-hero,
  .analysis-grid {
    grid-template-columns: 1fr;
  }

  .practice-progress {
    position: static;
  }

  .filters,
  .question-browser {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .question-list {
    max-height: 360px;
    height: auto;
  }

  .question-detail {
    padding: 24px 18px 44px;
  }

  .detail-header {
    flex-direction: column;
  }

  .detail-meta {
    justify-content: flex-start;
  }

  .illustrated-header {
    flex-direction: column;
  }

  .illustrated-header a {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .login-shell {
    padding: 14px 0;
  }

  .login-card {
    width: min(100% - 20px, 430px);
    padding: 22px;
  }

  .login-card-header {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
  }

  .login-card-header img {
    width: min(220px, 100%);
  }

  .login-card-actions,
  .login-home-button,
  .login-reference-button {
    width: 100%;
  }

  .login-card h1 {
    font-size: clamp(2rem, 10vw, 2.45rem);
  }

  .login-copy {
    margin-bottom: 16px;
    line-height: 1.65;
  }

  .login-card label {
    margin-bottom: 13px;
  }

  .trial-note {
    margin-top: 14px;
    padding: 12px;
  }

  .topbar {
    padding: 12px 14px;
  }

  .brand {
    align-items: flex-start;
  }

  .brand-logo {
    width: 118px;
    height: 38px;
  }

  .summary {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .audio-row,
  .choice {
    grid-template-columns: 1fr;
  }

  .choice-label {
    align-self: start;
  }

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

  .weakness-material-header,
  .notification-item,
  .weakness-material-list article {
    align-items: flex-start;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .weakness-status,
  .notification-item-actions,
  .notification-item-actions a,
  .notification-item-actions button,
  .weakness-actions a,
  .weakness-actions button,
  .weakness-material-list a,
  .weakness-item-actions,
  .weakness-item-actions button {
    width: 100%;
  }

  .mode-switcher {
    padding: 0 14px;
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-metrics,
  .admin-form {
    grid-template-columns: 1fr;
  }

  .operations-toolbar,
  .welcome-quota-summary {
    grid-template-columns: 1fr;
  }

  .operations-toolbar .primary-action {
    width: 100%;
  }

  .worker-token-heading,
  .worker-token-value {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .worker-token-heading button,
  .worker-token-value button {
    width: 100%;
  }

  .admin-card,
  .admin-hero,
  .admin-metric {
    padding: 16px;
  }

  .admin-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .performance-panel article {
    grid-template-columns: 1fr;
  }

  .map-summary {
    grid-template-columns: 1fr;
  }

  .learning-tabs button {
    width: 100%;
  }

  .illustrated-explanation {
    padding: 14px;
  }

  .illustrated-explanation iframe {
    height: 680px;
  }

  .score-result header {
    display: block;
  }

  .floating-tutor {
    right: 10px;
    bottom: 10px;
  }

  .floating-tutor-panel {
    width: calc(100vw - 20px);
    height: auto !important;
    max-height: calc(100dvh - 20px);
  }

  .floating-tutor-resize-handle {
    display: none;
  }

  .floating-tutor-form {
    grid-template-columns: 1fr;
  }

  .floating-tutor-form button {
    width: 100%;
  }

  .welcome-copy h1 {
    font-size: clamp(2rem, 9vw, 2.7rem);
  }

  .welcome-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .welcome-actions button,
  .secondary-action {
    width: 100%;
  }

  .upgrade-dialog {
    padding: 12px;
  }

  .upgrade-dialog-panel {
    max-height: calc(100dvh - 24px);
    overflow: auto;
    padding: 18px;
  }

  .upgrade-dialog-panel header {
    display: block;
  }

  .upgrade-dialog-panel header .icon-button {
    margin-top: 12px;
  }

  .payment-result-detail div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .checkout-confirmation-detail div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .checkout-confirmation-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .checkout-confirmation-actions button {
    width: 100%;
  }

  .payment-result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .payment-result-actions button {
    width: 100%;
  }
}
