:root {
  color-scheme: light;
  --ink: #071a43;
  --muted: #667592;
  --subtle: #8a97ad;
  --blue: #1477ff;
  --blue-dark: #0757d5;
  --teal: #14c8c4;
  --green: #12b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --violet: #7c3aed;
  --line: rgba(28, 89, 165, 0.14);
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: rgba(255, 255, 255, 0.94);
  --shadow: 0 24px 70px rgba(42, 97, 180, 0.14);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

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

body {
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 12%, rgba(20, 200, 196, 0.22), transparent 24%),
    radial-gradient(circle at 86% 18%, rgba(20, 119, 255, 0.18), transparent 28%),
    linear-gradient(135deg, #f8fcff 0%, #eff7ff 42%, #eefbff 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  pointer-events: none;
}

body::before {
  left: 14%;
  right: 7%;
  top: 15%;
  height: 42%;
  border: 2px dashed rgba(20, 119, 255, 0.12);
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 120px 0 0;
  transform: rotate(-5deg);
}

body::after {
  left: -8%;
  right: -8%;
  bottom: -18%;
  height: 36%;
  background:
    linear-gradient(100deg, transparent 0 16%, rgba(20, 119, 255, 0.14) 17%, transparent 18% 34%, rgba(20, 200, 196, 0.12) 35%, transparent 36%),
    linear-gradient(180deg, rgba(20, 119, 255, 0.16), rgba(20, 200, 196, 0.08));
  border-radius: 50% 50% 0 0;
}

body[data-page="mode"],
body[data-page="challenge"] {
  background:
    linear-gradient(90deg, rgba(248, 252, 255, 0.78) 0%, rgba(248, 252, 255, 0.7) 52%, rgba(248, 252, 255, 0.18) 100%),
    var(--app-background-image, url("/assets/background.png")) center / cover fixed no-repeat;
}

body[data-page="mode"]::before,
body[data-page="mode"]::after,
body[data-page="challenge"]::before,
body[data-page="challenge"]::after {
  display: none;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  cursor: pointer;
}

svg {
  width: 1em;
  height: 1em;
  display: inline-block;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  grid-template-rows: 78px minmax(0, 1fr);
  grid-template-areas:
    "top top"
    "side main";
  transition: grid-template-columns 0.2s ease;
}

.user-topbar {
  position: sticky;
  top: 0;
  z-index: 25;
}

.user-side-nav {
  position: sticky;
  top: 78px;
  align-self: start;
  height: calc(100vh - 78px);
  overflow-y: auto;
}

.app-shell.is-sidebar-collapsed {
  grid-template-columns: 84px minmax(0, 1fr);
}

body[data-page="trainer"] .app-shell { grid-template-rows: 64px minmax(0, 1fr); }

.side-nav {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px 18px 84px;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(18px);
}

.topbar-brand {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  border-radius: 16px;
  color: var(--blue-dark);
  font-size: 18px;
  font-weight: 950;
  white-space: nowrap;
}

.topbar-brand svg {
  width: 36px;
  height: 36px;
}

.side-nav nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border-radius: 14px;
  color: #30415f;
  font-weight: 850;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-item:hover,
.nav-item.active {
  color: var(--blue-dark);
  background: linear-gradient(135deg, rgba(20, 119, 255, 0.13), rgba(20, 200, 196, 0.11));
}

.nav-item:hover {
  transform: translateX(2px);
}

.side-nav-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: fixed;
  z-index: 30;
  left: 18px;
  bottom: 22px;
  width: 216px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--blue-dark);
  font-weight: 850;
  white-space: nowrap;
  transition: left 0.2s ease, width 0.2s ease, background 0.16s ease, color 0.16s ease;
}

.side-nav-toggle:hover {
  color: var(--blue-dark);
  background: linear-gradient(135deg, rgba(20, 119, 255, 0.13), rgba(20, 200, 196, 0.11));
}

.side-nav-toggle:focus-visible {
  outline: 3px solid rgba(20, 119, 255, 0.28);
  outline-offset: 2px;
}

.side-nav-toggle svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}

.app-shell.is-sidebar-collapsed .side-nav {
  padding: 22px 14px 84px;
}

.app-shell.is-sidebar-collapsed .side-nav-toggle {
  left: 14px;
  width: 56px;
  gap: 4px;
  font-size: 14px;
}

.app-shell.is-sidebar-collapsed .nav-item {
  justify-content: center;
  gap: 0;
  padding-left: 0;
  padding-right: 0;
}

.app-shell.is-sidebar-collapsed .nav-item span {
  display: none;
}

.app-shell.is-sidebar-collapsed .nav-item:hover {
  transform: none;
}

.app-shell.is-sidebar-collapsed .side-nav-toggle svg {
  transform: rotate(180deg);
}

.topbar {
  grid-area: top;
  display: grid;
  grid-template-columns: minmax(204px, 252px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
}

.topbar.has-flow-back {
  grid-template-columns: minmax(204px, 252px) auto minmax(0, 1fr) auto;
}

.trainer-topbar { grid-template-columns: minmax(0, 1fr) auto; min-height: 64px; padding: 7px 20px; }
.trainer-topbar .topbar-brand { min-height: 42px; gap: 8px; padding: 0; font-size: 16px; }
.trainer-topbar .topbar-brand svg { width: 30px; height: 30px; }
.trainer-topbar .topbar-actions { grid-column: auto; justify-self: end; }

.user-flow-topbar {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.evaluator-topbar {
  grid-template-columns: minmax(204px, 252px) minmax(0, 1fr);
}

.evaluator-topbar .topbar-actions {
  grid-column: 2;
  justify-self: end;
}

.topbar.assessment-workspace-topbar {
  grid-template-columns: minmax(204px, 252px) minmax(0, 1fr);
}

.assessment-workspace-topbar .topbar-actions {
  grid-column: 2;
  justify-self: end;
}

.user-flow-topbar .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--blue-dark);
  font-size: 30px;
  line-height: 1;
}

.user-flow-topbar .brand strong,
.user-flow-topbar .brand span {
  display: block;
}

.user-flow-topbar .brand strong {
  font-size: 22px;
  line-height: 1.1;
  font-weight: 950;
}

.user-flow-topbar .brand span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.user-flow-topbar .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--blue-dark);
  background: rgba(255, 255, 255, 0.8);
  font: inherit;
  font-weight: 900;
  white-space: nowrap;
}

.topbar > div:not(.topbar-actions) strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 950;
}

.topbar > div:not(.topbar-actions) span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.top-link,
.device-chip,
.user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--blue-dark);
  font-weight: 900;
  white-space: nowrap;
}

.user-chip span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}

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

.account-menu { position: relative; }
.account-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--blue-dark);
  font: inherit;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}
.account-menu-trigger > svg { width: 18px; height: 18px; }
.account-menu-trigger > .account-menu-caret { display: block; width: 14px; height: 14px; flex: 0 0 14px; transition: transform 0.16s ease; }
.account-menu-trigger[aria-expanded="true"] .account-menu-caret { transform: rotate(180deg); }
.account-menu-trigger:focus-visible,
.account-menu-logout:focus-visible { outline: 3px solid rgba(20, 119, 255, .3); outline-offset: 2px; }
.account-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 112px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.account-menu-logout { display: inline-flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; min-height: 36px; padding: 0 10px; border: 0; border-radius: 8px; color: #b42318; background: transparent; font: inherit; font-size: 13px; font-weight: 850; text-align: left; white-space: nowrap; cursor: pointer; }
.account-menu-logout svg { width: 16px; height: 16px; flex: 0 0 16px; }
.account-menu-logout:hover:not(:disabled) { background: #fff1f0; }
.account-menu-logout:disabled { opacity: .65; cursor: wait; }

.material-page-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.material-page-controls button {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  color: var(--blue-dark);
  background: transparent;
  font: inherit;
  font-weight: 900;
}

.material-page-controls button:hover:not(:disabled) { background: rgba(20, 119, 255, 0.11); }
.material-page-controls button:disabled { color: var(--line); cursor: not-allowed; }

.flow-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
}

.flow-back:hover,
.flow-back:focus-visible {
  color: var(--blue-dark);
}

.flow-back svg {
  width: 18px;
  height: 18px;
}

.device-chip > svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

button.device-chip {
  appearance: none;
  cursor: pointer;
}

button.device-chip.is-connected {
  color: #047857;
  border-color: rgba(18, 185, 129, 0.36);
  background: rgba(18, 185, 129, 0.12);
}

button.device-chip.is-disconnected {
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.36);
  background: rgba(239, 68, 68, 0.1);
}

button.device-chip.is-busy {
  cursor: wait;
  opacity: 0.72;
}

.app-main {
  grid-area: main;
  min-width: 0;
  padding: clamp(22px, 3vw, 42px);
}

.page-heading {
  max-width: 820px;
  margin-bottom: 24px;
}

body[data-page="mode"] .page-heading,
body[data-page="challenge"] .page-heading {
  max-width: 700px;
  padding: 24px 26px;
  border: 1px solid rgba(28, 89, 165, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 18px 44px rgba(42, 97, 180, 0.1);
  backdrop-filter: blur(12px);
}

body[data-page="mode"] .entry-grid,
body[data-page="challenge"] .challenge-route {
  max-width: 1120px;
}

body[data-page="challenge"] .app-main {
  padding-top: clamp(18px, 2.4vw, 34px);
}

body[data-page="challenge"] .page-heading {
  position: relative;
  min-height: 178px;
  display: grid;
  align-content: center;
  overflow: hidden;
}

body[data-page="challenge"] .page-heading::before {
  content: "";
  position: absolute;
  right: 28px;
  top: 20px;
  width: min(48%, 460px);
  height: 126px;
  background:
    radial-gradient(circle at 80% 18%, rgba(245, 158, 11, 0.9) 0 10px, transparent 11px),
    radial-gradient(circle at 55% 48%, rgba(20, 119, 255, 0.75) 0 12px, transparent 13px),
    linear-gradient(160deg, transparent 0 30%, rgba(20, 119, 255, 0.16) 31% 58%, transparent 59%);
  clip-path: polygon(0 64%, 15% 48%, 28% 58%, 42% 26%, 56% 42%, 68% 12%, 82% 36%, 100% 24%, 100% 100%, 0 100%);
  opacity: 0.72;
}

body[data-page="challenge"] .page-heading::after {
  content: "";
  position: absolute;
  right: 54px;
  top: 58px;
  width: min(42%, 390px);
  height: 70px;
  border-top: 10px solid rgba(255, 255, 255, 0.92);
  border-radius: 55% 45% 0 0;
  transform: rotate(-9deg);
  box-shadow: 0 -2px 0 rgba(20, 119, 255, 0.08);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  color: #071a43;
  font-size: clamp(36px, 5vw, 72px);
  line-height: 1.05;
  letter-spacing: 0;
}

.page-heading p,
.hero-copy p,
.feature-card p,
.material-form p,
.result-card > span {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.65;
}

.hero-panel,
.split-panel,
.result-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 28px;
  align-items: center;
  padding: clamp(28px, 4vw, 56px);
}

.hero-panel::before,
.hero-panel::after,
.tablet-vector::before,
.tablet-vector::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.hero-panel::before {
  width: 420px;
  height: 420px;
  right: -120px;
  top: -150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 200, 196, 0.23), transparent 65%);
}

.hero-panel::after {
  left: 34%;
  right: 7%;
  bottom: 18%;
  height: 80px;
  border-bottom: 2px dashed rgba(20, 119, 255, 0.16);
  border-radius: 50%;
  transform: rotate(-8deg);
}

.hero-copy {
  position: relative;
  z-index: 2;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0 14px;
}

.primary-action,
.secondary-action {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  border-radius: 14px;
  font-weight: 950;
}

.primary-action {
  background: linear-gradient(135deg, var(--blue), var(--teal));
  color: #fff;
  box-shadow: 0 16px 30px rgba(20, 119, 255, 0.22);
}

.primary-action:disabled { opacity: .65; cursor: wait; transform: none; box-shadow: none; }

[data-action="connect-device"] > svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.secondary-action {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  color: var(--blue-dark);
}

.status-line {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.app-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  box-shadow: 0 30px 90px rgba(7, 26, 67, 0.22);
}

.app-dialog::backdrop {
  background: rgba(7, 26, 67, 0.28);
  backdrop-filter: blur(4px);
}

.subject-form {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.subject-form header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.subject-form header strong {
  font-size: 22px;
  font-weight: 950;
}

.dialog-icon-button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(20, 119, 255, 0.1);
  color: var(--blue-dark);
  font-size: 24px;
  font-weight: 900;
}

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

.subject-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.subject-field:first-child {
  grid-column: 1 / -1;
}

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

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.dialog-actions > [hidden] {
  display: none !important;
}

.device-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.device-form header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.device-form header strong {
  display: block;
  font-size: 22px;
  font-weight: 950;
}

.device-form header p,
.device-dialog-tip {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.6;
}

.device-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(20, 119, 255, 0.24);
  border-radius: 14px;
  background: rgba(20, 119, 255, 0.06);
  color: var(--blue-dark);
}

.device-option > svg {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--blue);
}

.device-option span {
  display: grid;
  gap: 4px;
}

.device-option strong {
  font-size: 17px;
  font-weight: 950;
}

.device-option small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.status-line.show {
  color: #047857;
}

.hero-visual {
  position: relative;
  z-index: 1;
  min-height: 320px;
  display: grid;
  place-items: center;
}

.tablet-vector {
  position: relative;
  width: min(100%, 470px);
  aspect-ratio: 1.45;
  border: 14px solid transparent;
  border-radius: 42px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, var(--blue), var(--teal)) border-box;
  box-shadow: 0 28px 60px rgba(20, 119, 255, 0.24);
  transform: rotate(4deg);
}

.tablet-vector::before {
  inset: 14%;
  border: 2px dashed rgba(20, 119, 255, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 49%, rgba(20, 119, 255, 0.18) 50%, transparent 51%),
    linear-gradient(transparent 49%, rgba(20, 119, 255, 0.18) 50%, transparent 51%);
}

.tablet-vector::after {
  width: 62px;
  height: 8px;
  left: 50%;
  bottom: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(-50%);
}

.tablet-icon {
  position: absolute;
  width: 84px;
  height: 84px;
  right: 18px;
  top: -28px;
  color: var(--blue);
  transform: rotate(26deg);
}

.writing-line {
  position: absolute;
  width: 38%;
  height: 8px;
  left: 31%;
  top: 53%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--blue));
}

.writing-dot {
  position: absolute;
  width: 30px;
  height: 30px;
  left: 48%;
  top: 39%;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 12px rgba(20, 200, 196, 0.16);
}

.entry-grid {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.assess-panel {
  width: min(100%, 1120px);
}

.assess-switch {
  display: inline-flex;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel-strong);
  box-shadow: 0 10px 28px rgba(42, 97, 180, 0.08);
}

.assess-switch button {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.assess-switch button.is-active {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 14px rgba(20, 119, 255, 0.22);
}

.assessment-records-list {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.practice-records-scroll-card {
  width: 100%;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.assessment-records-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

.assessment-subject-search {
  min-width: min(100%, 360px);
  display: flex;
  align-items: center;
  gap: 9px;
  margin-right: auto;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.assessment-subject-search:focus-within {
  border-color: rgba(20, 119, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(20, 119, 255, 0.13);
}

.assessment-subject-search svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  color: var(--blue-dark);
}

.assessment-subject-search input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #071a43;
  font: inherit;
  font-size: 14px;
  font-weight: 720;
}

.assessment-subject-search button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.assessment-subject-search button:hover {
  background: var(--blue-dark);
}

.assessment-subject-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.assessment-subject-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  max-height: 640px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
  scrollbar-color: rgba(20, 119, 255, 0.42) transparent;
  scrollbar-width: thin;
}

.assessment-record-date-group > .assessment-subject-grid {
  max-height: none;
  overflow: visible;
  overscroll-behavior: auto;
  padding-right: 0;
  scrollbar-width: auto;
}

.assessment-subject-grid::-webkit-scrollbar {
  width: 8px;
}

.assessment-subject-grid::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: rgba(20, 119, 255, 0.42);
  background-clip: padding-box;
}

.assessment-search-empty {
  padding: 32px 18px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  color: var(--muted);
  font-weight: 760;
  text-align: center;
}

.assessment-subject-group {
  display: flex;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: 0 16px 38px rgba(42, 97, 180, 0.08);
}

.assessment-subject-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.assessment-subject-heading h2 {
  margin: 2px 0 3px;
  color: #071a43;
  font-size: 20px;
  overflow-wrap: anywhere;
}

.assessment-id-heading {
  display: flex;
  align-items: center;
  gap: 6px;
}

.assessment-id-edit {
  display: inline-grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  padding: 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.assessment-id-edit:hover,
.assessment-id-edit:focus-visible {
  border-color: var(--line);
  background: #f3f7ff;
  color: var(--blue);
}

.assessment-id-edit svg {
  width: 17px;
  height: 17px;
}

.assessment-subject-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.assessment-subject-actions > .secondary-action,
.assessment-subject-actions .assessment-subject-delete {
  min-height: 36px;
  padding: 9px 12px;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.assessment-subject-actions .assessment-subject-delete {
  border: 1px solid rgba(180, 35, 24, 0.32);
  background: #fff;
  color: #b42318;
  cursor: pointer;
}

.assessment-subject-actions .assessment-subject-delete:hover:not(:disabled) {
  border-color: #b42318;
  background: #fff4f2;
}

.assessment-subject-actions > .assessment-resume-writing {
  border-color: #16a34a;
  background: #16a34a;
  color: #fff;
}

.assessment-subject-actions > .assessment-resume-writing:hover {
  border-color: #15803d;
  background: #15803d;
  color: #fff;
}

.assessment-subject-summary p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.assessment-record-scroll {
  margin-top: 8px;
}

.assessment-report-session {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(28, 89, 165, 0.12);
  border-radius: 12px;
  background: rgba(248, 252, 255, 0.72);
}

.assessment-report-session-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: #486581;
  font-size: 13px;
  font-weight: 800;
}

.assessment-record-items {
  display: grid;
  gap: 6px;
  padding-right: 6px;
}

.assessment-record-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 10px;
  border: 1px solid transparent;
  border-radius: 13px;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.assessment-record-item:hover {
  border-color: rgba(20, 119, 255, 0.18);
  background: rgba(20, 119, 255, 0.055);
}

.assessment-record-item strong,
.assessment-record-item span,
.assessment-record-item small {
  display: block;
}

.assessment-record-item strong {
  color: #071a43;
  font-size: 14px;
  line-height: 1.45;
}

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

.assessment-record-item small {
  max-width: 250px;
  margin-top: 2px;
  overflow: hidden;
  color: #8090a6;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.assessment-page-badge {
  display: inline-block !important;
  margin: 0 0 0 5px !important;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(20, 119, 255, 0.1);
  color: var(--blue-dark) !important;
  font-size: 11px !important;
  font-weight: 850;
}

.assessment-preview-link {
  flex: 0 0 auto;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.assessment-record-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
}

.assessment-record-actions .danger-link {
  padding: 0;
  border: 0;
  background: transparent;
  color: #b42318;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.assessment-record-actions .danger-link:hover:not(:disabled) {
  text-decoration: underline;
}

.assessment-report-section {
  display: grid;
  gap: 9px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.assessment-report-section h3 {
  margin: 0;
  color: #536b8e;
  font-size: 13px;
  font-weight: 900;
}

.assessment-report-items {
  display: grid;
  gap: 8px;
}

.assessment-report-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(20, 119, 255, 0.16);
  border-radius: 12px;
  background: rgba(20, 119, 255, 0.04);
}

.assessment-report-card strong,
.assessment-report-card span,
.assessment-report-card small {
  display: block;
}

.assessment-report-card strong {
  color: #071a43;
  font-size: 14px;
}

.assessment-report-status,
.assessment-report-card small {
  margin-top: 2px;
  color: #a05a00;
  font-size: 12px;
  font-weight: 750;
}

.assessment-report-status.is-complete {
  color: #15803d;
}

.assessment-report-card small {
  color: var(--muted);
  font-weight: 650;
}

.assessment-report-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid rgba(20, 119, 255, 0.22);
  border-radius: 9px;
  background: #fff;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

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

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

.four-up {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-card,
.level-card,
.metric-card,
.record-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: 0 16px 38px rgba(42, 97, 180, 0.1);
}

.feature-card {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.feature-card:hover,
.level-card:hover,
.primary-action:hover:not(:disabled),
.secondary-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 50px rgba(20, 119, 255, 0.16);
}

.feature-card strong {
  color: #071a43;
  font-size: 26px;
  font-weight: 950;
}

.feature-card small {
  color: var(--muted);
  font-size: 16px;
  font-weight: 850;
}

.card-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  font-size: 28px;
}

.blue {
  background: linear-gradient(135deg, var(--blue), #65a7ff);
}

.teal {
  background: linear-gradient(135deg, var(--teal), #12b981);
}

.amber {
  background: linear-gradient(135deg, var(--amber), #facc15);
}

.violet {
  background: linear-gradient(135deg, var(--violet), #a78bfa);
}

.accent {
  background: linear-gradient(135deg, rgba(20, 200, 196, 0.14), rgba(255, 255, 255, 0.94));
}

.warm {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.94));
}

.challenge-route {
  --challenge-stage-height: 214px;
  --challenge-level-width: 192px;
  display: grid;
  gap: 22px;
  margin-top: 20px;
}

.challenge-stage {
  --stage-color: var(--blue);
  --stage-color-dark: var(--blue-dark);
  --stage-soft: rgba(20, 119, 255, 0.12);
  --stage-panel-start: #eaf3ff;
  --stage-panel-end: #cfe3ff;
  --stage-panel-text: #0f4aa8;
  --stage-panel-subtext: #2860b7;
  min-height: var(--challenge-stage-height);
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: stretch;
  border: 1px solid color-mix(in srgb, var(--stage-color) 24%, transparent);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 18px 48px rgba(42, 97, 180, 0.1);
  overflow: visible;
}

.challenge-stage.theme-teal {
  --stage-color: var(--teal);
  --stage-color-dark: #078b87;
  --stage-soft: rgba(20, 200, 196, 0.14);
  --stage-panel-start: #e4fbf8;
  --stage-panel-end: #bef3ec;
  --stage-panel-text: #04746f;
  --stage-panel-subtext: #0f8d86;
}

.challenge-stage.theme-amber {
  --stage-color: var(--amber);
  --stage-color-dark: #a16207;
  --stage-soft: rgba(245, 158, 11, 0.15);
  --stage-panel-start: #fff6d7;
  --stage-panel-end: #ffe5a3;
  --stage-panel-text: #a15d05;
  --stage-panel-subtext: #bd7209;
}

.stage-panel {
  position: relative;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 24px;
  overflow: hidden;
  color: var(--stage-panel-text);
  border-radius: 24px 0 0 24px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.7), transparent 18%),
    linear-gradient(135deg, var(--stage-panel-start), var(--stage-panel-end));
}

.stage-panel::before,
.stage-panel::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.stage-panel::before {
  width: 150px;
  height: 80px;
  right: -24px;
  bottom: -26px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--stage-color) 13%, transparent);
}

.stage-panel::after {
  width: 68px;
  height: 68px;
  right: 18px;
  bottom: 18px;
  border: 2px dashed color-mix(in srgb, var(--stage-color) 28%, transparent);
  border-radius: 22px;
  transform: rotate(-14deg);
}

.stage-panel span {
  position: relative;
  z-index: 1;
  font-size: 28px;
  font-weight: 950;
  line-height: 1.1;
}

.stage-panel strong {
  position: relative;
  z-index: 1;
  color: var(--stage-panel-subtext);
  font-size: 15px;
  font-weight: 850;
}

.stage-track {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--level-count), minmax(0, 1fr));
  align-items: center;
  gap: 14px;
  padding: 22px 52px 22px 24px;
}

.stage-track::after {
  content: "";
  position: absolute;
  right: -24px;
  top: 50%;
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-left: 24px solid var(--stage-color);
  filter: drop-shadow(0 6px 8px color-mix(in srgb, var(--stage-color) 22%, transparent));
  transform: translateY(-50%);
}

.stage-line {
  position: absolute;
  left: 16px;
  right: -18px;
  top: 50%;
  z-index: 0;
  width: calc(100% + 2px);
  height: 76px;
  color: var(--stage-color);
  opacity: 0.62;
  transform: translateY(-50%);
}

.stage-line path {
  fill: none;
  stroke: currentColor;
  stroke-width: 10;
  stroke-linecap: round;
}

.level-card {
  position: relative;
  z-index: 1;
  display: block;
  width: min(100%, var(--challenge-level-width));
  justify-self: center;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: transparent;
  box-shadow: none;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.level-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--stage-color) 36%, transparent);
  outline-offset: 2px;
}

.level-card:hover {
  filter: drop-shadow(0 18px 24px color-mix(in srgb, var(--stage-color) 20%, transparent));
}

.level-card.is-final {
  filter: drop-shadow(0 12px 22px rgba(245, 158, 11, 0.28));
}

.level-card-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.level-card-fallback {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.split-panel {
  max-width: 1080px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 28px;
  align-items: center;
  padding: clamp(26px, 4vw, 46px);
}

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

#practice-entry-panel > .practice-panel {
  margin-top: 24px;
}

.material-form {
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.material-form label {
  color: #071a43;
  font-size: 18px;
  font-weight: 950;
}

.practice-entry-stack {
  display: grid;
  gap: 28px;
  align-content: start;
}

.practice-material-search {
  width: 100%;
  justify-self: start;
  display: grid;
  gap: 14px;
}

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

.practice-material-search .text-field {
  min-width: 0;
  min-height: 48px;
}

.practice-material-search .text-field input {
  font-size: 20px;
}

.practice-material-search .primary-action {
  white-space: nowrap;
}

.practice-material-search > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.practice-task-module {
  display: grid;
  gap: 14px;
}

.practice-task-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
}

.practice-task-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.practice-task-heading .eyebrow {
  margin-bottom: 4px;
}

.practice-task-heading h2 {
  margin: 0;
  color: #071a43;
  font-size: 20px;
  font-weight: 950;
}

.practice-task-count,
.practice-task-status,
.practice-task-code {
  font-size: 12px;
  font-weight: 850;
}

.practice-task-count {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(20, 119, 255, 0.1);
  color: var(--blue-dark);
  white-space: nowrap;
}

.practice-task-list,
.practice-task-cards {
  display: grid;
  gap: 10px;
}

.practice-task-list {
  max-height: 50vh;
  overflow-y: auto;
}

body[data-page="practice"],
body[data-page="study"],
body[data-page="practice"] .practice-task-list,
body[data-page="practice"] .practice-records-scroll-card {
  scrollbar-color: #d4d4d4 #f9fafb;
  scrollbar-width: auto;
}

body[data-page="practice"]::-webkit-scrollbar,
body[data-page="study"]::-webkit-scrollbar,
body[data-page="practice"] .practice-task-list::-webkit-scrollbar,
body[data-page="practice"] .practice-records-scroll-card::-webkit-scrollbar {
  width: 20px;
  height: 20px;
}

body[data-page="practice"]::-webkit-scrollbar-track,
body[data-page="study"]::-webkit-scrollbar-track,
body[data-page="practice"] .practice-task-list::-webkit-scrollbar-track,
body[data-page="practice"] .practice-records-scroll-card::-webkit-scrollbar-track {
  background: #f9fafb;
}

body[data-page="practice"]::-webkit-scrollbar-thumb,
body[data-page="study"]::-webkit-scrollbar-thumb,
body[data-page="practice"] .practice-task-list::-webkit-scrollbar-thumb,
body[data-page="practice"] .practice-records-scroll-card::-webkit-scrollbar-thumb {
  border: 5px solid #f9fafb;
  border-radius: 999px;
  background: #d4d4d4;
  background-clip: padding-box;
}

.practice-task-date-group {
  display: grid;
  gap: 8px;
}

.practice-task-date-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.practice-task-date-group h3 {
  margin: 0;
  color: #536b8e;
  font-size: 13px;
  font-weight: 900;
}

.practice-task-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(20, 119, 255, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.76);
}

.practice-record-date-group {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
}

.practice-record-date-group > .practice-task-date-heading > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.practice-record-card {
  justify-content: flex-start;
}

.practice-record-card > img {
  width: 88px;
  height: 66px;
  flex: 0 0 88px;
  object-fit: cover;
  border-radius: 10px;
  background: #fff;
}

.practice-record-card-main {
  min-width: 0;
  flex: 1 1 auto;
}

.practice-record-card-main small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.practice-record-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.practice-record-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid rgba(20, 119, 255, 0.22);
  border-radius: 10px;
  background: #fff;
  color: var(--blue-dark);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.practice-record-action svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.practice-record-action:hover:not(:disabled) {
  background: rgba(20, 119, 255, 0.06);
}

.practice-record-action.is-danger {
  border-color: rgba(220, 38, 38, 0.2);
  color: #b42318;
}

.practice-record-action.is-danger:hover:not(:disabled) {
  background: #fff4f2;
}

.practice-record-action:disabled {
  color: var(--muted);
  cursor: wait;
}

.practice-task-card-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.practice-task-card-main strong,
.practice-task-card-main p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.practice-task-card-main strong {
  color: #071a43;
  font-size: 15px;
}

.practice-task-card-main p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.practice-task-code {
  color: var(--blue-dark);
}

.practice-task-status {
  color: #64748b;
}

.practice-task-status.is-complete {
  color: #15803d;
}

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

.practice-task-download,
.practice-date-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.practice-task-download svg,
.practice-date-download svg {
  width: 17px;
  height: 17px;
}

.practice-task-download {
  box-sizing: border-box;
  width: 118px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid rgba(20, 119, 255, 0.22);
  border-radius: 10px;
  background: #fff;
}

.practice-task-open {
  box-sizing: border-box;
  width: 118px;
  min-height: 40px;
  padding: 0 10px;
  font-size: 13px;
  white-space: nowrap;
}

.practice-date-download {
  padding: 6px 0;
}

.report-main {
  display: grid;
  align-content: start;
}

.report-panel {
  width: min(100%, 1080px);
}

.report-task-filename {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-field {
  min-height: 58px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border: 1px solid rgba(20, 119, 255, 0.24);
  border-radius: 14px;
  background: #fff;
  color: var(--blue);
}

.text-field input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #071a43;
  font-size: 24px;
  font-weight: 950;
}

.workspace-shell .app-main {
  padding: 20px;
}

.workspace-layout {
  min-height: calc(100vh - 78px);
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(420px, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: stretch;
}

.live-panel,
.writing-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.live-panel {
  min-width: 0;
  padding: 18px;
  overflow: auto;
}

.writing-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px;
}

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

.writing-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.writing-toolbar strong {
  display: block;
  color: #071a43;
  font-size: 20px;
  font-weight: 950;
}

.assessment-version-picker {
  position: relative;
  display: inline-flex;
  flex: 0 1 auto;
}

.assessment-version-picker[hidden] {
  display: none !important;
}

.assessment-version-trigger {
  min-height: 38px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #071a43;
  font: inherit;
  font-size: 20px;
  font-weight: 950;
  white-space: nowrap;
}

.assessment-version-trigger:disabled {
  cursor: wait;
  opacity: 0.6;
}

.assessment-version-trigger:focus-visible,
.assessment-version-option:focus-visible {
  outline: 3px solid rgba(20, 119, 255, 0.28);
  outline-offset: 2px;
}

.assessment-version-caret {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  transition: transform 0.16s ease;
}

.assessment-version-trigger[aria-expanded="true"] .assessment-version-caret {
  transform: rotate(180deg);
}

.assessment-version-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 40;
  min-width: 100%;
  width: max-content;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.assessment-version-options[hidden] {
  display: none;
}

.assessment-version-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #071a43;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  text-align: left;
  white-space: nowrap;
}

.assessment-version-option:hover,
.assessment-version-option[aria-selected="true"] {
  background: #eff6ff;
  color: var(--blue-dark);
}

.flow-assess .workspace-material-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.flow-assess .workspace-material-heading .assessment-version-picker {
  flex: 0 1 auto;
}

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

.live-status {
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  text-align: right;
}

.live-status.saved {
  color: #047857;
}

.save-progress {
  position: absolute;
  z-index: 40;
  left: 50%;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: min(290px, calc(100% - 32px));
  padding: 14px 16px;
  margin: 0;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
  color: #1d4ed8;
  font-size: 14px;
  font-weight: 850;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.save-progress[hidden] {
  display: none;
}

.save-progress-track {
  position: relative;
  display: block;
  width: min(240px, 44vw);
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.save-progress-track span {
  position: absolute;
  top: 0;
  left: 0;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #60a5fa, #2563eb);
  animation: save-progress-slide 1.1s ease-in-out infinite;
}

.trainer-operation-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
}

.trainer-operation-progress[hidden] {
  display: none;
}

.trainer-operation-progress .save-progress-track {
  width: min(180px, 42vw);
  height: 6px;
}

@keyframes save-progress-slide {
  from { transform: translateX(-110%); }
  to { transform: translateX(260%); }
}

@media (prefers-reduced-motion: reduce) {
  .save-progress-track span {
    animation: none;
    transform: translateX(68%);
  }
}

.workspace-flash {
  position: fixed;
  z-index: 100;
  left: 50%;
  top: 50%;
  max-width: min(360px, calc(100vw - 40px));
  padding: 14px 22px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.92);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
  color: #fff;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -42%) scale(0.96);
  visibility: hidden;
}

.workspace-flash.is-visible {
  visibility: visible;
  animation: workspace-flash var(--workspace-flash-duration, 2000ms) ease both;
}

.workspace-flash.is-info { background: rgba(15, 23, 42, 0.92); }
.workspace-flash.is-improvement { background: rgba(5, 150, 105, 0.94); }
.workspace-flash.is-attention { background: rgba(194, 65, 12, 0.95); }
.workspace-flash.is-error { background: rgba(185, 28, 28, 0.96); }

@keyframes workspace-flash {
  0% { opacity: 0; transform: translate(-50%, -42%) scale(0.96); }
  12%, 78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -54%) scale(0.98); }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-flash.is-visible { animation: none; opacity: 1; transform: translate(-50%, -50%); }
}

.auto-calibrate-action {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid rgba(20, 119, 255, 0.22);
  border-radius: 12px;
  background: #fff;
  color: var(--blue-dark);
  font-weight: 950;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(20, 119, 255, 0.1);
}

.auto-calibrate-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  box-shadow: none;
}

.material-page-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(20, 119, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 18px rgba(20, 119, 255, 0.08);
}

.material-page-controls[hidden] {
  display: none;
}

.material-page-controls button {
  min-height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(20, 119, 255, 0.1);
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.material-page-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.material-page-controls span {
  min-width: 42px;
  color: #071a43;
  font-size: 12px;
  font-weight: 950;
  text-align: center;
}

.flow-assess .writing-toolbar-actions {
  flex-wrap: nowrap;
}

.flow-assess .writing-toolbar-actions .live-status {
  order: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-assess .writing-toolbar-actions .material-page-controls {
  order: 1;
  flex: 0 0 auto;
}

.material-stage {
  position: relative;
  width: 100%;
  min-height: 0;
  display: grid;
  place-items: center;
}

.material-paper {
  position: relative;
  isolation: isolate;
  --material-aspect-ratio: 1.4142857143;
  width: min(100%, calc((100vh - 230px) * var(--material-aspect-ratio)));
  max-height: 100%;
  aspect-ratio: var(--material-aspect-ratio);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
}

.material-paper::before {
  content: none;
}

.material-paper::after {
  content: none;
}

.material-paper.has-template {
  outline: 0;
  background: transparent;
}

.material-paper.has-template::before,
.material-paper.has-template::after {
  content: none;
}

/* The full A2/A5 PNG is the PDF's internal 95% A4 reference frame. */
.material-paper.has-a4-frame-reference::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  box-shadow: inset 0 0 0 2px #000;
}

.material-overlay,
.material-prompt,
#board {
  position: absolute;
  inset: 0;
}

.material-overlay {
  pointer-events: none;
  z-index: 1;
}

.material-template-transform,
.material-template-image {
  position: absolute;
  inset: 0;
}

.material-template-transform {
  display: block;
  visibility: visible;
}

.material-template-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.6;
  user-select: none;
  -webkit-user-drag: none;
}

.material-overlay.is-calibrating .material-template-image {
  opacity: 0.58;
}

.material-calibration-targets {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.material-calibration-frame {
  position: absolute;
  z-index: 1;
  left: var(--frame-left);
  top: var(--frame-top);
  width: calc(var(--frame-right) - var(--frame-left));
  height: calc(var(--frame-bottom) - var(--frame-top));
  box-sizing: border-box;
  border: 1px solid #000;
  pointer-events: none;
}

.material-calibration-target {
  position: absolute;
  left: calc(var(--target-u) * 100%);
  top: calc(var(--target-v) * 100%);
  width: 1.683502%;
  height: 2.380952%;
  box-sizing: border-box;
  border: 2px solid #c62828;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%);
}

.material-calibration-target > span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14%;
  height: 14%;
  border-radius: 50%;
  background: #d32f2f;
  transform: translate(-50%, -50%);
}

.material-overlay.is-calibrating .material-calibration-target {
  opacity: 0.42;
}

.material-calibration-target.is-calibration-target-complete {
  animation: none !important;
  border-color: #2e7d32;
  background: rgba(46, 125, 50, 0.12);
  box-shadow: 0 0 0 5px rgba(46, 125, 50, 0.18);
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.material-calibration-target.is-calibration-target-complete > span {
  background: #2e7d32;
}

.material-calibration-target.is-calibration-target-pending {
  animation: calibration-target-breathe 1.25s ease-in-out infinite;
  animation-delay: var(--calibration-delay, 0s);
  border-color: #c62828;
  box-shadow: 0 0 0 9px rgba(198, 40, 40, 0.3), 0 0 22px rgba(198, 40, 40, 0.48);
  opacity: 1;
}

.material-calibration-target.is-calibration-target-pending > span {
  background: #d32f2f;
}

.material-calibration-message {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: rgba(183, 28, 28, 0.9);
  font-size: clamp(22px, 3vw, 38px);
  font-weight: 950;
  letter-spacing: 0.12em;
  opacity: 0;
  text-shadow: 0 2px 14px rgba(255, 235, 238, 0.92);
}

.material-overlay.is-calibration-message-complete .material-calibration-message {
  color: rgba(27, 94, 32, 0.9);
  text-shadow: 0 2px 14px rgba(232, 245, 233, 0.92);
}

.material-overlay.is-calibration-message-visible .material-calibration-message {
  animation: calibration-message-fade 2.2s ease both;
}

@keyframes calibration-target-breathe {
  0%, 100% {
    opacity: 0.48;
    transform: translate(-50%, -50%) scale(0.82);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 0 13px rgba(198, 40, 40, 0.18), 0 0 28px rgba(198, 40, 40, 0.58);
    transform: translate(-50%, -50%) scale(1.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .material-calibration-target.is-calibration-target-pending,
  .material-overlay.is-calibration-message-visible .material-calibration-message {
    animation: none;
  }
}

@keyframes calibration-message-fade {
  0% { opacity: 0; transform: scale(0.96); }
  18%, 62% { opacity: 0.86; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.03); }
}

.material-overlay.is-calibration-targets-hidden .material-calibration-targets {
  visibility: hidden;
}

.material-overlay.is-template-hidden .material-template-transform,
.material-overlay.is-template-hidden .material-template-image {
  opacity: 0;
  visibility: hidden;
}

.watermark-pen {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 120px;
  height: 120px;
  color: rgba(20, 119, 255, 0.16);
  transform: translate(-50%, -50%) rotate(-12deg);
}

.material-prompt {
  display: grid;
  place-items: center;
  padding-top: 120px;
  color: rgba(7, 26, 67, 0.38);
  font-weight: 850;
  text-align: center;
  pointer-events: none;
}

#board {
  z-index: 10;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  background: transparent;
  opacity: 1;
  visibility: visible;
}

#board.is-writing {
  cursor: crosshair;
}

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

.control-action {
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 16px;
  color: #fff;
  font-weight: 950;
}

.control-action svg {
  width: 22px;
  height: 22px;
}

.control-action:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.start-action {
  background: linear-gradient(135deg, #10b981, #14c8c4);
}

.pause-action {
  background: linear-gradient(135deg, #f59e0b, #facc15);
}

.save-action {
  background: linear-gradient(135deg, var(--blue), #65a7ff);
}

.reset-action {
  background: linear-gradient(135deg, #ef4444, #fb7185);
}

.info-card,
.metric-panel,
.feedback-panel,
.timer-card,
.hint-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.info-card,
.metric-panel,
.feedback-panel,
.timer-card,
.hint-card {
  padding: 16px;
}

.info-card h2,
.metric-panel h2,
.feedback-panel h2,
.hint-card h2 {
  margin: 0 0 12px;
  color: #071a43;
  font-size: 18px;
  font-weight: 950;
}

.material-code-control {
  display: flex;
  gap: 6px;
}

.material-code-input {
  width: 100%;
  height: 36px;
  border: 1px solid rgba(20, 119, 255, 0.22);
  border-radius: 8px;
  background: #fff;
  color: #071a43;
  padding: 0 10px;
  font-size: 14px;
  font-weight: 950;
}

.material-code-control .material-code-input {
  min-width: 0;
  flex: 1;
}

.material-code-confirm {
  min-width: 52px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  padding: 0 10px;
  background: #1477ff;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.material-code-confirm:hover:not(:disabled) {
  background: #075fdf;
}

.material-code-input:disabled,
.material-code-confirm:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.assessment-subject-card-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0 0 12px;
}

.assessment-subject-card-heading h2 {
  margin: 0;
}

.assessment-new-task-button {
  min-height: 34px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: #fff;
  color: var(--blue);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.assessment-new-task-button:hover:not(:disabled) {
  background: #eff6ff;
}

.assessment-new-task-button:focus-visible {
  outline: 3px solid rgba(20, 119, 255, 0.28);
  outline-offset: 2px;
}

.assessment-new-task-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.metric-panel,
.feedback-panel,
.hint-card,
.timer-card {
  margin-top: 14px;
}

.metric-table {
  display: grid;
  gap: 8px;
}

.metric-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid rgba(20, 119, 255, 0.12);
  border-radius: 12px;
  background: #fff;
}

.metric-row span {
  color: #071a43;
  font-weight: 850;
}

.metric-row strong {
  color: var(--blue);
  font-size: 24px;
  font-weight: 950;
}

.hint-card ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  color: #071a43;
  font-weight: 760;
}

.level-info {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.level-info .card-icon {
  width: 52px;
  height: 52px;
  font-size: 25px;
  border-radius: 16px;
}

.level-info p {
  margin: 0;
  color: #071a43;
  font-weight: 850;
  line-height: 1.7;
}

.level-info strong {
  color: var(--blue);
}

.assessment-summary-card p {
  margin: 0;
  color: #071a43;
  font-weight: 850;
  line-height: 1.7;
}

.assessment-summary-card strong {
  color: var(--blue);
}

.timer-card {
  display: grid;
  gap: 10px;
  place-items: center;
  color: var(--amber);
}

.timer-card span {
  color: #071a43;
  font-size: 18px;
  font-weight: 950;
}

.timer-card strong {
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1;
}

.feedback-panel > p {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.feedback-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(0, 1.4fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 7px 10px;
  border: 1px solid rgba(20, 119, 255, 0.1);
  border-radius: 10px;
  background: rgba(248, 251, 255, 0.86);
  color: #071a43;
  font-size: 13px;
  font-weight: 850;
}

.feedback-label {
  min-width: 0;
}

.feedback-value {
  min-width: 0;
  color: #071a43;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.feedback-status {
  min-width: 72px;
  padding: 5px 7px;
  border-radius: 7px;
  color: #53657f;
  background: rgba(83, 101, 127, 0.08);
  font-style: normal;
  text-align: center;
  white-space: nowrap;
}

.feedback-comparison {
  grid-column: 1 / -1;
  min-width: 0;
  color: #667993;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.feedback-comparison:empty {
  display: none;
}

.feedback-signal-row {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid rgba(20, 119, 255, 0.08);
  border-radius: 11px;
  background: rgba(246, 249, 253, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.feedback-signal-label {
  color: #111827;
  font-size: 12px;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.feedback-signal-status {
  min-width: 0;
  padding: 4px 3px;
  border-radius: 8px;
  color: #8290a8;
  background: rgba(154, 169, 188, 0.12);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
  transition: color 160ms ease, background 160ms ease;
}

.feedback-signal-status:empty {
  visibility: hidden;
}

.feedback-signal-row[data-feedback-tone="info"] .feedback-signal-status {
  color: #0878ee;
  background: rgba(31, 152, 255, 0.1);
}

.feedback-signal-row[data-feedback-tone="attention"] .feedback-signal-status {
  color: #b45309;
  background: rgba(255, 203, 87, 0.22);
}

.feedback-signal-row[data-feedback-tone="band-low"] .feedback-signal-status {
  color: #0878ee;
  background: rgba(31, 152, 255, 0.1);
}

.feedback-signal-row[data-feedback-tone="band-mid"] .feedback-signal-status {
  color: #187a4f;
  background: rgba(83, 189, 130, 0.14);
}

.feedback-signal-row[data-feedback-tone="band-high"] .feedback-signal-status {
  color: #b45309;
  background: rgba(255, 203, 87, 0.22);
}

@media (max-width: 480px) {
  .feedback-signal-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .feedback-signal-status {
    padding: 2px 0;
  }
}

.challenge-feedback-panel {
  padding: 14px 12px 13px;
  border-color: rgba(38, 129, 255, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(45, 110, 186, 0.08);
}

.feedback-heading {
  display: grid;
  grid-template-columns: auto minmax(24px, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.feedback-heading h2 {
  margin: 0;
  font-size: 18px;
  white-space: nowrap;
}

.feedback-heading-line {
  height: 1px;
  background: rgba(20, 119, 255, 0.18);
}

.feedback-heading-icon {
  width: 92px;
  height: 48px;
  display: block;
  color: #1477ff;
}

.challenge-feedback-panel #feedback-list {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.challenge-feedback-panel .feedback-row {
  box-sizing: border-box;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 10px;
  row-gap: 3px;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid rgba(20, 119, 255, 0.08);
  border-radius: 11px;
  background: rgba(246, 249, 253, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  font-size: 12px;
}

.challenge-feedback-panel .feedback-label {
  white-space: nowrap;
  color: #111827;
  font-size: 12px;
  font-weight: 800;
}

.challenge-feedback-panel .feedback-value {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.challenge-feedback-panel .feedback-status {
  display: none;
}

.challenge-feedback-panel .feedback-comparison {
  grid-column: 1 / -1;
  display: block;
  position: static;
  width: 100%;
  min-width: 0;
  margin: 0;
  color: #74849a;
  font-size: 9px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.challenge-feedback-panel .feedback-comparison:not(:empty) {
  min-height: 2.6em;
}

.challenge-feedback-panel .feedback-heading {
  gap: 7px;
}

.challenge-feedback-panel .feedback-heading h2 {
  font-size: 16px;
}

.challenge-feedback-panel .feedback-heading-icon {
  width: 36px;
  height: 26px;
}

.workspace-unified-layout .live-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-unified-layout .challenge-side-card,
.workspace-unified-layout .challenge-feedback-panel {
  box-sizing: border-box;
  width: 100%;
  margin-top: 0;
  padding: 14px;
  border: 1px solid rgba(38, 129, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(45, 110, 186, 0.08);
}

.workspace-unified-layout .challenge-feedback-panel {
  padding: 14px 12px 13px;
}

.workspace-unified-layout .challenge-live-metrics-card h2 {
  margin: 0;
  color: #071a43;
  font-size: 18px;
  font-weight: 950;
}

.workspace-unified-layout .challenge-live-metrics-card .metric-table {
  gap: 6px;
  margin-top: 14px;
}

.workspace-unified-layout .challenge-live-metrics-card .metric-row {
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  gap: 8px;
  padding: 0 7px 0 10px;
  border: 1px solid rgba(20, 119, 255, 0.08);
  border-radius: 11px;
  background: rgba(246, 249, 253, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
  font-size: 13px;
}

.workspace-unified-layout .challenge-live-metrics-card .metric-row span {
  color: #111827;
  font-size: 13px;
  font-weight: 850;
}

.workspace-unified-layout .challenge-live-metrics-card .metric-row strong {
  font-size: 13px;
  font-weight: 900;
}

.workspace-unified-layout .challenge-material-card,
.workspace-unified-layout .challenge-level-card {
  min-height: 104px;
}

.challenge-hint-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
}

.challenge-hint-heading svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #f4a000;
}

.challenge-hint-heading h2 {
  margin: 0;
  color: #071a43;
  font-size: 15px;
  font-weight: 900;
}

.challenge-hint-card ul {
  gap: 6px;
  color: #24334d;
  font-size: 13px;
  font-weight: 740;
  line-height: 1.5;
}

.challenge-hint-card li::marker {
  color: #f4a000;
}

.assessment-operation-guide ol {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 20px;
  color: #24334d;
  font-size: 13px;
  font-weight: 740;
  line-height: 1.5;
}

.assessment-operation-guide li {
  overflow-wrap: anywhere;
}

.assessment-operation-guide li::marker {
  color: var(--blue);
  font-weight: 900;
}

.child-writing-cue {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #9fc9ff;
  border-radius: 13px;
  background: #eef7ff;
  color: #174a80;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.55;
  transition: opacity 120ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.child-writing-cue.is-transitioning {
  opacity: 0;
}

.child-writing-cue[data-tone="improvement"] {
  border-color: #8cdbb3;
  background: #edfff4;
  color: #17613f;
}

.child-writing-cue[data-tone="attention"] {
  border-color: #f2c878;
  background: #fff7df;
  color: #875400;
}

.child-writing-cue-heading {
  display: flex;
  align-items: center;
  gap: 8px;
}

.child-writing-cue-label {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #cfe6ff;
  color: #145caa;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.35;
}

.child-writing-cue-message.is-initial {
  font-weight: 950;
}

.child-writing-cue-voice-toggle {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  padding: 5px;
  border: 1px solid rgba(20, 92, 170, 0.2);
  border-radius: 50%;
  background: #fff;
  color: #52708f;
  cursor: pointer;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.child-writing-cue-voice-toggle:hover,
.child-writing-cue-voice-toggle:focus-visible {
  border-color: #1477ff;
  color: #145caa;
}

.child-writing-cue-voice-toggle.is-enabled {
  border-color: #1477ff;
  background: #e5f1ff;
  color: #145caa;
}

.child-writing-cue-voice-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.child-writing-cue-voice-toggle svg {
  width: 18px;
  height: 18px;
  display: block;
}

.child-writing-cue[data-tone="improvement"] .child-writing-cue-label {
  background: #c9f2d8;
  color: #17613f;
}

.child-writing-cue[data-tone="attention"] .child-writing-cue-label {
  background: #ffe5a7;
  color: #875400;
}

@media (prefers-reduced-motion: reduce) {
  .feedback-signal-status,
  .child-writing-cue {
    transition: none;
  }
}

.feedback-footnote {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 0 3px;
  color: #536b8e;
  font-size: 12px;
  font-weight: 760;
  line-height: 1.45;
}

.feedback-footnote svg {
  width: 20px;
  height: 20px;
  color: #1477ff;
  flex: 0 0 auto;
}

.records-list {
  display: grid;
  gap: 14px;
}

.record-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
}

.record-row img {
  width: 132px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.record-meta strong,
.record-meta span,
.record-meta small {
  display: block;
}

.record-meta strong {
  font-size: 18px;
  font-weight: 950;
}

.record-meta span,
.record-meta small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 760;
}

.record-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.record-actions a,
.record-actions button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue-dark);
  font: inherit;
  font-weight: 950;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.record-actions button {
  color: #dc2626;
}

.record-actions button:disabled {
  color: var(--muted);
  cursor: wait;
}

@media (max-width: 640px) {
  .practice-record-card {
    flex-wrap: wrap;
  }

  .practice-record-card-main {
    min-width: 0;
    flex: 1 1 calc(100% - 102px);
  }

  .practice-record-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .record-row {
    grid-template-columns: minmax(72px, 100px) minmax(0, 1fr);
    gap: 12px;
  }

  .record-row img {
    width: 100%;
  }

  .record-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

.empty-state {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  color: var(--muted);
  font-weight: 850;
}

.management-main {
  display: grid;
  gap: 22px;
  align-content: start;
}

.management-panel {
  display: none;
  gap: 22px;
}

.management-panel.is-active {
  display: grid;
  animation: management-panel-in 0.18s ease-out;
}

.management-tab-nav .nav-item {
  text-align: left;
}

@keyframes management-panel-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.management-grid {
  display: grid;
  gap: 18px;
}

.management-grid.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.material-management-grid { align-items: start; }

.management-card {
  display: grid;
  gap: 16px;
  padding: clamp(20px, 2.2vw, 28px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-strong);
  box-shadow: var(--shadow-soft);
}

.management-card h2 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 950; }
.management-card > p,
.management-card p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.6; }

.management-section-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.management-section-heading > div { display: grid; gap: 5px; }

.management-form {
  display: grid;
  gap: 14px;
}

.management-form label {
  display: grid;
  gap: 7px;
  color: #30415f;
  font-size: 14px;
  font-weight: 900;
}

.management-form input,
.management-form select,
.management-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: rgba(255, 255, 255, .88);
  font: inherit;
}

.management-form textarea {
  min-height: 96px;
  padding-top: 10px;
  padding-bottom: 10px;
  resize: vertical;
}

.file-picker {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, .88);
}

.management-form .file-picker-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  min-height: 100%;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.file-picker-button {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-right: 1px solid var(--line);
  background: rgba(20, 119, 255, .08);
  color: var(--blue-dark);
  font-weight: 900;
}

.file-picker-name {
  min-width: 0;
  padding: 0 12px;
  overflow: hidden;
  color: var(--muted);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker:focus-within { border-color: rgba(20, 119, 255, .65); box-shadow: 0 0 0 3px rgba(20, 119, 255, .12); }

.material-file-editor {
  display: grid;
  gap: 6px;
  max-height: 224px;
  overflow: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.material-file-editor-heading,
.material-file-editor-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(128px, 1fr) minmax(128px, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.material-file-editor-heading.report-file-editor-heading,
.material-file-editor-row.report-file-editor-row { grid-template-columns: minmax(0, 1fr) auto; }
.material-file-editor-heading { color: var(--muted); font-size: 13px; font-weight: 900; }
.material-file-editor-row strong { min-width: 0; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.material-file-editor-row input { min-height: 38px; }
.material-file-editor-delete { min-height: 38px; padding: 0 10px; border: 1px solid #f2c6c2; border-radius: 9px; color: #b42318; background: #fff6f5; font: inherit; font-size: 13px; font-weight: 850; cursor: pointer; }
.material-file-editor-delete:hover { background: #ffebe9; }
.material-upload-panel { display: grid; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.material-control-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px; background: rgba(20, 119, 255, .04); font-size: 14px; }
.material-panel-title { margin: 0; color: #30415f; font-size: inherit; font-weight: 900; white-space: nowrap; }
.material-control-row > .file-picker,
.material-control-row > select { min-width: 0; min-height: 42px; font-size: inherit; }
.material-file-editor,
.material-recipient-list { padding: 12px 14px 14px; border-top: 1px solid var(--line); background: #fff; }
.material-recipient-list { display: grid; gap: 6px; }
.material-recipient-list-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; padding: 0 10px; border-radius: 9px; color: var(--ink); background: rgb(255 255 255 / 60%); font-size: 13px; font-weight: 800; }
.material-recipient-list-item button { padding: 0; border: 0; color: #b42318; background: transparent; font: inherit; font-size: 13px; font-weight: 850; cursor: pointer; }
.material-recipient-empty { margin: 2px 0; color: var(--muted); font-size: 13px; font-weight: 750; }
.management-form select[multiple] { min-height: 132px; padding: 6px; }
.management-form input:focus,
.management-form select:focus,
.management-form textarea:focus { border-color: rgba(20, 119, 255, .65); box-shadow: 0 0 0 3px rgba(20, 119, 255, .12); }

.generator-catalog,
.generator-studio { gap: 20px; }
.generator-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.generator-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px 16px;
  min-height: 188px;
  padding: clamp(18px, 2vw, 25px);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: inherit;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 5px 14px rgb(15 23 42 / 4%);
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}
.generator-card > svg { width: 38px; height: 38px; padding: 10px; border-radius: 12px; color: var(--blue-dark); background: rgba(20, 119, 255, .1); }
.generator-card-copy { display: grid; align-content: start; gap: 8px; }
.generator-card-copy strong { color: var(--ink); font-size: 18px; font-weight: 950; }
.generator-card-copy span { color: var(--muted); font-size: 14px; font-weight: 750; line-height: 1.6; }
.generator-card-cta { display: inline-flex; grid-column: 1 / -1; align-items: center; gap: 7px; color: var(--blue-dark); font-size: 14px; font-weight: 900; }
.generator-card-cta svg { width: 16px; height: 16px; transform: rotate(180deg); }
.generator-card:hover { border-color: rgba(20, 119, 255, .42); background: linear-gradient(135deg, rgba(20, 119, 255, .1), rgba(20, 200, 196, .08)); box-shadow: 0 12px 24px rgb(15 23 42 / 10%); transform: translateY(-2px); }
.generator-card:focus-visible { outline: 3px solid rgba(20, 119, 255, .3); outline-offset: 3px; }
.app-shell.generator-page-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr); grid-template-areas: "top" "main"; }
.app-shell.generator-page-shell .generator-page-topbar { position: sticky; top: 0; z-index: 25; grid-template-columns: auto minmax(0, 1fr); min-height: 64px; padding: 10px 20px; }
.generator-page-back { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; color: var(--blue-dark); background: rgba(255, 255, 255, .8); }
.generator-page-back { justify-self: start; }
.generator-page-back:hover { border-color: rgba(20, 119, 255, .42); background: rgba(20, 119, 255, .1); }
.generator-page-back:focus-visible { outline: 3px solid rgba(20, 119, 255, .3); outline-offset: 2px; }
.generator-page-back svg { width: 18px; height: 18px; }
.generator-topbar-actions { display: flex; align-items: center; gap: 8px; }
.generator-topbar-actions .primary-action,
.generator-topbar-actions .secondary-action { min-height: 38px; padding: 0 14px; }
.generator-topbar-actions .generator-download { white-space: nowrap; }
.generator-page-main { grid-area: main; display: grid; align-content: stretch; min-height: 0; padding: 16px clamp(16px, 2.4vw, 30px); }
.generator-page-main .generator-studio { min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.generator-studio-grid { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); min-height: calc(100dvh - 96px); gap: 14px; align-items: stretch; }
.generator-settings,
.generator-preview { min-width: 0; padding: clamp(16px, 2vw, 24px); border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .58); }
.generator-settings { max-height: calc(100dvh - 96px); overflow-y: auto; }
.generator-preview { min-height: 0; }
.generator-field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.generator-choice { display: flex; flex-wrap: wrap; gap: 9px 14px; margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.generator-choice legend { padding: 0 4px; color: #30415f; font-size: 14px; font-weight: 900; }
.generator-choice label,
.generator-check { display: inline-flex !important; align-items: center; gap: 7px; color: #30415f; font-size: 13px !important; font-weight: 800 !important; cursor: pointer; }
.generator-font-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.generator-font-option { display: grid; gap: 5px; min-width: 0; }
.generator-font-option p,
.generator-disabled-notice { margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.55; }
.generator-disabled-notice { flex-basis: 100%; color: #92400e; }
.generator-disabled-notice[hidden] { display: none !important; }
.generator-choice:disabled { opacity: .58; }
.generator-choice:disabled label { cursor: not-allowed; }
.generator-choice .generator-choice-select { display: grid !important; flex-basis: 100%; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.generator-choice-select select { min-height: 40px; }
.generator-choice > .generator-tuning { flex-basis: 100%; width: 100%; padding-top: 0; border-top: 0; }
.generator-choice .generator-choice-select[hidden],
.generator-choice > .generator-tuning[hidden] { display: none !important; }
.generator-choice input,
.generator-check input { width: auto !important; min-height: auto !important; margin: 0; padding: 0 !important; }
.generator-tuning { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.generator-tuning > p,
.generator-notice { margin: 0; color: var(--muted); font-size: 12px !important; font-weight: 750 !important; line-height: 1.5; }
.generator-tuning-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.generator-tuning-row { display: grid !important; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .72); }
.generator-tuning-row strong { min-width: 28px; color: var(--ink); font-size: 20px; text-align: center; }
.generator-tuning-row.generator-check { grid-template-columns: auto auto minmax(0, 1fr); }
.generator-tuning-list .generator-tuning-row { gap: 8px; padding: 6px 8px; font-size: 12px !important; }
.generator-tuning-list .generator-tuning-row strong { min-width: 24px; font-size: 18px; }
.generator-tuning-list .generator-tuning-row select { font-size: 12px; }
.shape-memory-entry-list { display: grid; gap: 10px; }
.shape-memory-entry { display: grid; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .72); }
.shape-memory-entry-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #30415f; font-size: 13px; font-weight: 900; }
.shape-memory-entry-actions { display: inline-flex; gap: 6px; }
.shape-memory-entry-action { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 9px; color: var(--blue-dark); background: #fff; font: inherit; font-size: 20px; font-weight: 700; line-height: 1; cursor: pointer; }
.shape-memory-entry-action:hover { border-color: rgba(20, 119, 255, .42); background: rgba(20, 119, 255, .08); }
.shape-memory-entry-action.is-remove { color: #b42318; }
.shape-memory-entry-action.is-remove:hover { border-color: rgba(220, 38, 38, .3); background: #fff6f5; }
.shape-memory-entry-fields { display: grid; grid-template-columns: auto repeat(2, minmax(0, 1fr)); gap: 7px; align-items: center; }
.shape-memory-entry-fields > span { color: #30415f; font-size: 13px; font-weight: 850; white-space: nowrap; }
.shape-memory-entry-slot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px; align-items: center; min-width: 0; }
.shape-memory-entry-slot > input { min-width: 0; min-height: 38px; text-align: center; }
.shape-memory-visibility-toggle { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.shape-memory-visibility-toggle input { width: auto; min-height: auto; margin: 0; padding: 0; }
.shape-memory-character-input { font-size: 18px; font-weight: 800; }
.generator-route-description { margin: -2px 0 2px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.generator-pen-difficulty[hidden] { display: none !important; }
.generator-result-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 38px; margin-bottom: 8px; }
.generator-result-actions p { min-width: 0; margin: 0; overflow: hidden; color: var(--blue-dark); font-size: 12px; font-weight: 850; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.generator-license { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.6; }
.generator-license a { color: var(--blue-dark); font-weight: 850; text-decoration: underline; text-underline-offset: 2px; }
.generator-warnings { display: grid; gap: 6px; margin: 0 0 8px; padding: 0; color: #92400e; font-size: 12px; font-weight: 750; list-style: none; }
.generator-warnings:empty { display: none; }
.generator-warnings li { padding: 8px 10px; border: 1px solid rgba(245, 158, 11, .25); border-radius: 10px; background: rgba(255, 251, 235, .78); }
.generator-preview-pages { display: grid; gap: 14px; max-height: calc(100dvh - 170px); overflow-y: auto; padding: 4px; background: #f1f5f9; }
.generator-preview-pages:empty { display: none; }
.generator-preview-pages img { display: block; width: min(100%, 920px); margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 8px 18px rgb(15 23 42 / 10%); }

.inline-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.inline-actions .primary-action,
.inline-actions .secondary-action { min-height: 40px; padding: 0 15px; }
.date-range { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.management-status {
  display: none;
  padding: 12px 15px;
  border: 1px solid rgba(20, 119, 255, .2);
  border-radius: 12px;
  color: var(--blue-dark);
  background: rgba(222, 242, 255, .78);
  font-weight: 850;
}

.management-status.show { display: block; }
.management-status.is-error { border-color: rgba(220, 38, 38, .2); color: #b42318; background: rgba(254, 226, 226, .78); }

.management-list { display: grid; gap: 10px; }
.management-list.compact { max-height: 360px; overflow: auto; padding-right: 3px; }

.management-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, .72);
}

.management-row > div:first-child { min-width: 0; display: grid; gap: 4px; }
.management-row strong { color: var(--ink); font-size: 15px; font-weight: 950; }
.management-row span,
.management-row small { color: var(--muted); font-size: 13px; font-weight: 750; line-height: 1.45; }
.management-row-links { display: flex; flex: 0 0 auto; flex-wrap: wrap; gap: 10px; }
.management-row-links a,
.management-row-links button { padding: 0; color: var(--blue-dark); background: transparent; font: inherit; font-size: 13px; font-weight: 900; }
.management-row-links button:hover,
.management-row-links a:hover { text-decoration: underline; }
.management-row-links .danger-link { color: #b42318; }
.management-row .assessment-pdf-status.is-error { color: #b42318; }
.management-row-links button:disabled { opacity: .6; cursor: wait; }
.management-empty { padding: 20px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); font-weight: 800; text-align: center; }

.trainer-material-preview-dialog { width: min(980px, calc(100vw - 32px)); height: min(900px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); }
.trainer-material-preview-form { display: grid; height: 100%; grid-template-rows: auto minmax(0, 1fr); }
.trainer-material-preview-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.trainer-material-preview-header h2 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 950; }
.trainer-material-preview-header p { margin: 5px 0 0; color: var(--muted); font-size: 13px; font-weight: 750; }
.trainer-material-preview-pages { display: grid; min-height: 0; gap: 16px; overflow-y: auto; padding: 20px 24px 24px; background: #f1f5f9; }
.trainer-material-preview-pages img { display: block; width: min(100%, 880px); margin: 0 auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 8px 18px rgb(15 23 42 / 10%); }

.role-badge { display: inline-flex; margin-left: 6px; padding: 3px 7px; border-radius: 999px; font-size: 11px; font-weight: 900; vertical-align: middle; }
.role-admin { color: #6d28d9; background: #ede9fe; }
.role-trainer { color: #075985; background: #e0f2fe; }
.role-user { color: #0f766e; background: #ccfbf1; }
.role-evaluator { color: #9a3412; background: #ffedd5; }
.report-row { min-height: 82px; }
.report-list { max-width: 980px; }

.delete-account-form { display: grid; gap: 14px; padding: 26px; }
.delete-account-form h2 { margin: 0; color: #7f1d1d; font-size: 22px; font-weight: 950; }
.delete-account-form p { margin: 0; color: #4b5563; font-weight: 750; line-height: 1.6; }
.assessment-profile-form h2 { color: #071a43; }
.assessment-profile-form label { display: grid; gap: 6px; color: #334155; font-size: 13px; font-weight: 850; }
.assessment-profile-form input { width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; color: #071a43; font: inherit; }
.assessment-profile-form input:focus { outline: 2px solid rgba(20, 119, 255, .28); border-color: var(--blue); }
.evaluator-report-kind { margin-top: 12px; }
.evaluator-report-kind h4 { margin: 0 0 8px; color: #486581; font-size: 14px; }
.delete-account-warning { padding: 12px 14px; border: 1px solid rgba(220, 38, 38, .18); border-radius: 12px; color: #991b1b !important; background: rgba(254, 226, 226, .7); }
.danger-action { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; border-radius: 14px; color: #fff; background: #dc2626; font: inherit; font-weight: 900; }
.danger-action:hover:not(:disabled) { background: #b91c1c; transform: translateY(-1px); }
.danger-action:disabled { opacity: .65; cursor: wait; }

.result-main {
  display: grid;
  place-items: center;
}

.result-card {
  width: min(760px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 42px;
  text-align: center;
}

.result-card h1 {
  font-size: clamp(30px, 4vw, 52px);
}

.result-feedback-summary {
  width: min(620px, 100%);
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
}

.result-feedback-summary h2 {
  margin: 0;
  color: #071a43;
  font-size: 18px;
}

#result-feedback-list {
  display: grid;
  gap: 7px;
}

.feedback-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

/* The application is desktop-only. Keep the writing workspace in one coherent
   composition through the supported 150% browser-zoom viewport. */
@media (min-width: 840px) and (max-width: 1280px) {
  .workspace-shell {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .workspace-shell .side-nav {
    padding: 22px 14px 84px;
  }

  .workspace-shell .nav-item {
    justify-content: center;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .workspace-shell .nav-item span,
  .workspace-shell .side-nav-toggle {
    display: none;
  }

  .workspace-shell .app-main {
    padding: 12px;
  }

  .workspace-shell .workspace-layout {
    grid-template-columns: minmax(150px, 220px) minmax(320px, 1fr) minmax(150px, 220px);
    gap: 10px;
  }

  .workspace-shell .live-left {
    grid-column: 1;
  }

  .workspace-shell .writing-card {
    grid-column: 2;
    grid-row: 1;
  }

  .workspace-shell .live-right {
    grid-column: 3;
  }

  .workspace-shell .writing-card {
    gap: 12px;
    padding: 14px;
  }
}

@media (max-width: 1180px) {
  .three-up,
  .four-up {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .challenge-stage {
    min-height: 0;
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .stage-track {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    row-gap: 24px;
  }

  .stage-line {
    opacity: 0.26;
  }
}

@media (max-width: 1450px) and (min-width: 1181px) {
  .live-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .subject-fields {
    grid-template-columns: 1fr;
  }
}
