:root {
  color-scheme: light;
  --ink: #17212b;
  --ink-soft: #667085;
  --paper: #f6f7f8;
  --surface: #ffffff;
  --surface-soft: #f2f4f7;
  --line: #e1e6ea;
  --brand: #176b63;
  --brand-dark: #10534d;
  --brand-soft: #e8f2f0;
  --accent: #c56b3d;
  --accent-soft: #f8eee8;
  --yellow: #c8a94f;
  --yellow-soft: #f7f4ea;
  --danger: #b3474f;
  --danger-soft: #fbeef0;
  --success: #287a55;
  --success-soft: #eaf4ee;
  --shadow: 0 16px 36px rgba(16, 24, 40, 0.1);
  --shadow-soft: 0 4px 14px rgba(16, 24, 40, 0.06);
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 12px;
  --radius-sm: 8px;
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--brand-dark);
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--ink-soft);
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand);
  color: white;
  font-weight: 900;
  box-shadow: none;
}

.app-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 8px clamp(16px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.header-actions,
.nav-list,
.button-row,
.toolbar,
.status-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.site-header .header-actions,
.teacher-nav > .btn {
  margin-left: auto;
}

.page {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(30px, 5vw, 64px) 0 72px;
}

.page.narrow {
  width: min(680px, calc(100% - 36px));
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  margin-top: 0;
  letter-spacing: -0.035em;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(1.9rem, 3.8vw, 3.35rem);
  line-height: 1.08;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.3rem, 2.3vw, 1.8rem);
  line-height: 1.15;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

p {
  line-height: 1.7;
}

.muted {
  color: var(--ink-soft);
}

.small {
  font-size: 0.86rem;
}

.home-shell {
  min-height: 100vh;
  display: grid;
  background: var(--paper);
}

.home-simple {
  width: min(640px, calc(100% - 32px));
  display: grid;
  place-content: center;
  gap: 34px;
  margin: auto;
  padding: 48px 0;
}

.home-simple h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
  text-align: center;
}

.home-entry-actions {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.home-entry-button {
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: -0.025em;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.home-entry-button.student {
  width: min(100%, 480px);
  min-height: 104px;
  padding: 24px;
  background: var(--brand);
  color: white;
  font-size: 1.55rem;
  box-shadow: var(--shadow-soft);
}

.home-entry-button.teacher {
  min-height: 42px;
  padding: 9px 15px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.home-entry-button.student:hover,
.home-entry-button.student:focus-visible {
  background: var(--brand-dark);
  box-shadow: var(--shadow);
}

.home-entry-button.teacher:hover,
.home-entry-button.teacher:focus-visible {
  border-color: #b8c0c8;
  background: var(--surface-soft);
  color: var(--ink);
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
  background-repeat: no-repeat;
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
}

select:disabled {
  color: var(--ink-soft);
  background-color: var(--surface-soft);
  cursor: not-allowed;
}

.home-entry-button:active {
  transform: translateY(2px);
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 780;
  text-decoration: none;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.student-card:focus-visible,
.mission-card:focus-visible {
  outline: 3px solid rgba(23, 107, 99, 0.28);
  outline-offset: 2px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.btn-primary {
  background: var(--brand);
  color: white;
  box-shadow: 0 4px 12px rgba(23, 107, 99, 0.14);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-dark);
}

.btn-accent {
  background: var(--accent);
  color: #331b0d;
}

.btn-soft {
  border-color: var(--line);
  background: var(--surface-soft);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-soft);
}

.btn-danger {
  border-color: #efc4c7;
  background: var(--danger-soft);
  color: var(--danger);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-small {
  min-height: 36px;
  padding: 7px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
}

.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}

.panel,
.auth-card,
.question-card,
.mission-card,
.stat-card,
.class-card,
.review-card {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel,
.auth-card {
  border-radius: var(--radius-xl);
}

.auth-wrap {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 90px);
}

.auth-card {
  width: min(100%, 520px);
  padding: clamp(24px, 6vw, 42px);
}

.student-code-card h1 {
  font-size: clamp(1.75rem, 2.6vw, 2.3rem);
  line-height: 1.12;
}

.auth-card .brand-mark {
  margin-bottom: 28px;
}

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

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

.field {
  display: grid;
  gap: 8px;
}

.field label,
.field-label {
  font-size: 0.9rem;
  font-weight: 780;
}

.field-hint {
  margin: -2px 0 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

input,
textarea,
select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #bfd0cd;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
  color: #8ca09f;
}

.class-code-input {
  text-align: center;
  font-size: 1.6rem;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.form-error {
  padding: 11px 13px;
  border: 1px solid #efc4c7;
  border-radius: 10px;
  background: var(--danger-soft);
  color: #8f3238;
  font-size: 0.9rem;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.step-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--line);
}

.step-dot.active {
  width: 28px;
  background: var(--brand);
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.student-card {
  min-height: 118px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.student-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
  box-shadow: var(--shadow-soft);
}

.student-number {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 1.05rem;
  font-weight: 900;
}

.student-name {
  max-width: 100%;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 760;
  text-align: center;
}

.student-cards-heading h1 {
  font-size: clamp(1.55rem, 2.6vw, 2.15rem);
}

.student-welcome,
.page-heading,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.student-welcome h1,
.page-heading h1 {
  margin-bottom: 4px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.student-welcome p,
.page-heading p,
.section-heading p {
  margin: 0;
}

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

.mission-card {
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 22px;
  border-radius: var(--radius-lg);
  text-align: left;
}

button.mission-card {
  cursor: pointer;
}

.mission-card.featured {
  border-color: #b8d6d1;
  background: var(--brand-soft);
}

.mission-card h3 {
  margin: 14px 0 8px;
  font-size: 1.22rem;
}

.mission-card p {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.mission-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
}

.pill,
.status-badge,
.count-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: fit-content;
  border-radius: 999px;
  font-weight: 760;
  white-space: nowrap;
}

.pill {
  min-height: 28px;
  padding: 5px 10px;
  background: var(--surface-soft);
  color: var(--brand-dark);
  font-size: 0.75rem;
}

.pill.accent {
  background: var(--accent-soft);
  color: #8a430e;
}

.status-badge {
  min-height: 28px;
  padding: 5px 10px;
  background: #edf1f0;
  color: #4b5f61;
  font-size: 0.76rem;
}

.status-badge.approved,
.status-badge.closed {
  background: var(--success-soft);
  color: var(--success);
}

.status-badge.submitted,
.status-badge.published {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.status-badge.changes_requested {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-badge.draft {
  background: var(--yellow-soft);
  color: #7d5b08;
}

.banner {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin-bottom: 22px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.banner.warning {
  border-color: #efc4c7;
  background: var(--danger-soft);
}

.banner.success {
  border-color: #bcdcc9;
  background: var(--success-soft);
}

.banner-icon {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: white;
  font-weight: 900;
}

.banner p {
  margin: 2px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.editor-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.editor-aside {
  position: sticky;
  top: 96px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.progress-ring {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  margin: 8px auto 20px;
  border-radius: 50%;
  background: conic-gradient(var(--brand) var(--progress, 0%), var(--brand-soft) 0);
}

.progress-ring::before {
  content: "";
  width: 78px;
  height: 78px;
  grid-area: 1 / 1;
  border-radius: 50%;
  background: white;
}

.progress-ring strong {
  z-index: 1;
  grid-area: 1 / 1;
  color: var(--brand-dark);
  font-size: 1.25rem;
}

.save-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.save-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #98aaa8;
}

.save-state.saving .save-dot {
  background: var(--accent);
  animation: pulse 900ms infinite alternate;
}

.save-state.saved .save-dot {
  background: var(--success);
}

.save-state.error .save-dot {
  background: var(--danger);
}

@keyframes pulse {
  to { opacity: 0.25; }
}

.question-list {
  display: grid;
  gap: 18px;
}

.question-card {
  padding: clamp(20px, 4vw, 30px);
  border-radius: var(--radius-lg);
}

.question-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.question-index {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.question-index span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand);
  color: white;
}

.answer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}

.answer-legend {
  display: flex;
  align-items: center;
  gap: 10px;
}

.answer-guide {
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 760;
}

.answer-field {
  position: relative;
}

.answer-field .answer-text {
  min-height: 66px;
  padding: 13px 14px 13px 50px;
  resize: vertical;
}

.answer-check {
  position: absolute;
  z-index: 2;
  top: 21px;
  left: 12px;
  width: 24px;
  min-height: 24px;
  height: 24px;
  margin: 0;
  transform: none;
  accent-color: var(--success);
  cursor: pointer;
}

.answer-field:has(.answer-check:checked) .answer-text {
  border-color: var(--success);
  background: var(--success-soft);
}

.editor-actions {
  position: sticky;
  z-index: 20;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.teacher-shell {
  min-height: 100vh;
}

.teacher-nav {
  position: sticky;
  z-index: 40;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 60px;
  padding: 10px clamp(16px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
}

.nav-list {
  flex-wrap: nowrap;
}

.nav-item {
  min-height: 40px;
  padding: 9px 13px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font-weight: 760;
  cursor: pointer;
}

.nav-item.active {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.stat-card {
  min-height: 132px;
  padding: 20px;
  border-radius: var(--radius-md);
}

.stat-card small {
  color: var(--ink-soft);
  font-weight: 700;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 2.25rem;
  line-height: 1;
}

.stat-card.accent {
  border-color: #c8ddd9;
  background: var(--brand-soft);
}

.teacher-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 14px 15px;
  border-bottom: 1px solid #e6eeec;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 820;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #fbfdfc;
}

.clickable-row {
  cursor: pointer;
}

.clickable-row:hover td {
  background: var(--brand-soft);
}

.clickable-row:focus-visible {
  outline: 3px solid rgba(23, 107, 99, 0.28);
  outline-offset: -3px;
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:hover {
  border-color: #8fbab4;
  background: #fbfdfd;
}

.clickable-card:focus-visible {
  outline: 3px solid rgba(23, 107, 99, 0.28);
  outline-offset: 2px;
}

.side-panel > .field-hint {
  margin: 9px 0 4px;
}

.table-title {
  font-weight: 800;
}

.table-sub {
  display: block;
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

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

.mission-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.3fr) repeat(4, minmax(80px, 0.45fr)) auto;
  gap: 14px;
  align-items: center;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.mission-row:hover {
  border-color: #9ebfbb;
}

.count-chip {
  min-height: 34px;
  padding: 7px 10px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.count-chip strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-weight: 740;
  cursor: pointer;
}

.filter-tab.active {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

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

.class-card {
  padding: 22px;
  border-radius: var(--radius-lg);
}

.class-card.active {
  border-color: #b8d6d1;
  background: var(--brand-soft);
}

.class-card p {
  margin: 7px 0 18px;
  color: var(--ink-soft);
}

.detail-summary {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, minmax(100px, 0.45fr));
  gap: 14px;
  margin-bottom: 24px;
}

.detail-title-card,
.detail-stat {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.detail-title-card h2 {
  margin: 10px 0 6px;
}

.detail-title-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.detail-stat small {
  color: var(--ink-soft);
  font-weight: 700;
}

.detail-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 1.8rem;
}

.side-panel {
  position: sticky;
  top: 96px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.side-panel hr {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.side-panel .btn {
  width: 100%;
  margin-top: 8px;
}

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

.translation-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.translation-toolbar > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.translation-toolbar small {
  color: var(--ink-soft);
}

.review-card {
  padding: 20px;
  border-radius: 16px;
}

.review-card h3 {
  display: flex;
  gap: 10px;
}

.review-card ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.review-answer {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  font-size: 0.9rem;
}

.review-answer.correct {
  border-color: #a6d1b7;
  background: var(--success-soft);
  color: #1f6847;
  font-weight: 760;
}

.translation-result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 12px;
  background: #eef7f5;
}

.translation-result > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 0.78rem;
}

.translation-result h4 {
  margin: 0 0 12px;
  font-size: 1rem;
  line-height: 1.5;
}

.translation-result ol {
  margin: 0;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 34px;
  border: 1px dashed #b9ccca;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.empty-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 1.4rem;
  font-weight: 900;
}

.empty-state p {
  max-width: 420px;
  margin: 0 0 18px;
  color: var(--ink-soft);
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(13, 37, 40, 0.46);
  backdrop-filter: blur(5px);
}

.modal {
  width: min(100%, 620px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.2);
}

.modal.wide {
  width: min(100%, 840px);
}

.mission-modal {
  width: min(100%, 700px);
  overflow: hidden;
}

.modal-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.modal-head h2 {
  margin-bottom: 3px;
  font-size: 1.45rem;
}

.modal-head p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.modal-body {
  padding: 24px;
}

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

.mission-modal .modal-head {
  align-items: center;
  padding: 20px 26px;
  background: var(--surface);
}

.mission-modal .modal-head h2 {
  margin: 0;
  font-size: 1.35rem;
}

.mission-modal .icon-btn {
  width: 38px;
  height: 38px;
  border: 0;
  background: var(--surface-soft);
}

.mission-modal .modal-body {
  max-height: calc(100vh - 122px);
  overflow-y: auto;
  padding: 26px;
}

.mission-form,
.mission-main-fields {
  display: grid;
}

.mission-form {
  gap: 22px;
}

.mission-main-fields {
  gap: 16px;
}

.mission-form .field {
  gap: 7px;
}

.mission-form .field > label {
  color: #344054;
  font-size: 0.84rem;
  font-weight: 760;
}

.mission-form input,
.mission-form textarea,
.mission-form select {
  border-color: #d4dce2;
  background-color: #fff;
}

.mission-form textarea {
  min-height: 92px;
}

.select-control {
  position: relative;
}

.select-control::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 18px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #667085;
  border-bottom: 2px solid #667085;
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}

.select-control select {
  min-height: 50px;
  padding: 0 48px 0 14px;
  background-image: none;
  cursor: pointer;
}

.select-control select:disabled {
  cursor: not-allowed;
}

.select-control:has(select:disabled)::after {
  opacity: 0.45;
}

.optional-label {
  margin-left: 5px;
  color: #98a2b3;
  font-size: 0.74rem;
  font-weight: 650;
}

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

.mission-setting {
  align-content: start;
  min-height: 126px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.mission-setting input,
.mission-setting select {
  background-color: var(--surface);
}

.number-field {
  position: relative;
}

.number-field input {
  padding-right: 58px;
}

.number-field > span {
  position: absolute;
  top: 50%;
  right: 34px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.mission-toggle {
  position: relative;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: #344054;
  font-size: 0.9rem;
  font-weight: 760;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.mission-toggle:hover {
  border-color: #b5c7c4;
}

.mission-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
}

.mission-toggle i {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cbd3d9;
  transition: background 140ms ease;
}

.mission-toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.2);
  transition: transform 140ms ease;
}

.mission-toggle:has(input:checked) {
  border-color: #a9cbc6;
  background: var(--brand-soft);
}

.mission-toggle input:checked + i {
  background: var(--brand);
}

.mission-toggle input:checked + i::after {
  transform: translateX(18px);
}

.mission-toggle input:focus-visible + i {
  outline: 3px solid rgba(23, 107, 99, 0.28);
  outline-offset: 3px;
}

.mission-modal-actions {
  margin: 0 -26px -26px;
  padding: 18px 26px 22px;
  border-top: 1px solid var(--line);
  background: #fafbfc;
}

.mission-modal-actions .btn {
  min-width: 96px;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100% - 36px));
}

.toast {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow);
  line-height: 1.5;
  animation: toast-in 180ms ease-out;
}

.toast.error {
  border-color: #efc4c7;
  background: var(--danger-soft);
  color: #823239;
}

.toast.success {
  border-color: #bcdcc9;
  background: var(--success-soft);
  color: #1f6847;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
}

@media (max-width: 980px) {
  .mission-grid,
  .class-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .mission-row {
    grid-template-columns: minmax(190px, 1.5fr) repeat(2, minmax(80px, 0.5fr)) auto;
  }

  .mission-row .hide-tablet {
    display: none;
  }

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

  .detail-title-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .site-header,
  .teacher-nav {
    min-height: 64px;
    padding: 9px 14px;
  }

  .teacher-nav {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .teacher-nav .nav-list {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    flex: 0 0 auto;
  }

  .page {
    width: min(100% - 24px, 1180px);
    padding-top: 28px;
  }

  .mission-grid,
  .class-grid,
  .form-grid.two,
  .answer-grid,
  .review-card ol {
    grid-template-columns: 1fr;
  }

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

  .student-card {
    min-height: 102px;
  }

  .student-welcome,
  .page-heading,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .editor-shell,
  .teacher-layout {
    grid-template-columns: 1fr;
  }

  .editor-aside,
  .side-panel {
    position: static;
  }

  .editor-aside {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
  }

  .progress-ring {
    width: 82px;
    height: 82px;
    margin: 0;
  }

  .progress-ring::before {
    width: 60px;
    height: 60px;
  }

  .mission-row {
    grid-template-columns: 1fr auto;
  }

  .mission-row .count-chip {
    display: none;
  }

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

  .detail-title-card {
    grid-column: 1 / -1;
  }

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

  .editor-actions .button-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .editor-actions .btn {
    width: 100%;
  }
}

@media (max-width: 430px) {
  .home-simple {
    width: min(100% - 28px, 640px);
    gap: 28px;
    padding: 36px 0;
  }

  .home-simple h1 {
    padding: 0;
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .home-entry-actions {
    padding: 0;
    gap: 10px;
  }

  .home-entry-button.student {
    min-height: 92px;
    padding: 20px;
    font-size: 1.35rem;
  }

  .home-entry-button.teacher {
    width: auto;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.84rem;
  }

  .header-actions .header-label,
  .teacher-nav .header-label {
    display: none;
  }

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

  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-card {
    min-height: 112px;
    padding: 16px;
  }

  .stat-card strong {
    font-size: 1.8rem;
  }

  .modal-backdrop {
    padding: 0;
    align-items: end;
  }

  .modal,
  .modal.wide {
    width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
  }

  .mission-modal .modal-head {
    padding: 17px 18px;
  }

  .mission-modal .modal-body {
    max-height: calc(92vh - 72px);
    padding: 20px 18px;
  }

  .mission-setting-grid,
  .mission-toggle-grid {
    grid-template-columns: 1fr;
  }

  .mission-setting {
    min-height: auto;
  }

  .mission-modal-actions {
    margin: 0 -18px -20px;
    padding: 16px 18px 18px;
  }

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

  th,
  td {
    padding: 12px 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
