:root {
  --ink: #182026;
  --muted: #607080;
  --line: #d8e0e5;
  --paper: #f7faf8;
  --panel: #ffffff;
  --teal: #0d7c74;
  --teal-dark: #075f59;
  --yellow: #f0b429;
  --coral: #d95f45;
  --blue: #315f9a;
  --shadow: 0 18px 45px rgba(24, 32, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(13, 124, 116, 0.1), transparent 340px),
    var(--paper);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  padding: 20px 0 14px;
}

.site-footer {
  padding: 30px 0;
  color: var(--muted);
  font-size: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: white;
  background: var(--teal);
  border-radius: 8px;
  font-weight: 800;
}

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

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.top-nav a {
  position: relative;
  min-width: 72px;
  padding: 9px 12px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.top-nav a[aria-current="page"] {
  color: var(--ink);
  background: white;
  box-shadow: 0 4px 16px rgba(24, 32, 38, 0.08);
}

.top-nav a.daily-word-unseen::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 8px;
  width: 9px;
  height: 9px;
  background: #d92525;
  border: 2px solid white;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(217, 37, 37, 0.12);
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 28px;
  align-items: stretch;
  min-height: 480px;
  padding: 42px 0 20px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

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

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

h1 {
  max-width: 690px;
  margin-bottom: 18px;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  font-size: 30px;
  line-height: 1.1;
}

h3 {
  font-size: 20px;
}

.hero-text {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions,
.admin-topline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.button,
.mini-button,
.tab,
.admin-nav,
.text-button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

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

.button.primary:hover {
  background: var(--teal-dark);
}

.button.secondary {
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}

.button.full {
  width: 100%;
}

.scoreboard,
.auth-card,
.admin-sidebar,
.admin-content,
.activity-card,
.progress-panel,
.student-preview {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.scoreboard {
  align-self: center;
  overflow: hidden;
}

.scoreboard-header {
  padding: 22px;
  color: white;
  background: linear-gradient(135deg, var(--teal), var(--blue));
}

.scoreboard-header span,
.scoreboard-header strong {
  display: block;
}

.scoreboard-header span {
  opacity: 0.86;
  font-size: 14px;
}

.scoreboard-header strong {
  font-size: 28px;
}

.leaderboard-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px;
  list-style: none;
}

.leaderboard-list li,
.table-like div,
.activity-list div {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 12px;
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.leaderboard-list span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: white;
  background: var(--coral);
  border-radius: 8px;
  font-weight: 800;
}

.leaderboard-list em,
.table-like em {
  color: var(--muted);
  font-style: normal;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 22px 0;
}

.activity-card {
  padding: 22px;
}

.activity-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  color: white;
  background: var(--blue);
  border-radius: 8px;
  font-weight: 800;
}

.activity-card:nth-child(2) .activity-icon {
  background: var(--yellow);
  color: var(--ink);
}

.activity-card:nth-child(3) .activity-icon {
  background: var(--coral);
}

.activity-card p,
.split-band p,
.auth-intro p {
  color: var(--muted);
}

.mini-button {
  width: 100%;
  min-height: 42px;
  color: var(--ink);
  background: #edf5f3;
  border-radius: 8px;
  font-weight: 800;
}

.split-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: center;
  padding: 48px 0;
}

.progress-panel {
  padding: 24px;
}

.progress-panel div {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
}

progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
}

progress::-webkit-progress-bar {
  background: #e5ecea;
}

progress::-webkit-progress-value {
  background: var(--teal);
}

.auth-layout {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 420px);
  gap: 32px;
  align-items: center;
  min-height: calc(100vh - 150px);
  padding: 42px 0;
}

.auth-intro h1 {
  font-size: clamp(38px, 6vw, 64px);
}

.student-preview {
  display: grid;
  gap: 4px;
  max-width: 440px;
  margin-top: 26px;
  padding: 20px;
}

.student-preview span,
.student-preview small {
  color: var(--muted);
}

.student-preview strong {
  font-size: 22px;
}

.auth-card {
  padding: 22px;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  background: #edf5f3;
  border-radius: 8px;
}

.tab {
  min-height: 42px;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
  font-weight: 800;
}

.tab.active {
  color: var(--ink);
  background: white;
}

.account-form,
.inline-form,
.settings-grid {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.demo-note {
  margin-top: 18px;
  padding: 14px;
  color: var(--muted);
  background: #fff9e8;
  border: 1px solid #f4dc9c;
  border-radius: 8px;
  font-size: 14px;
}

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

.daily-layout {
  padding: 42px 0;
}

.daily-hero {
  padding-top: 26px;
}

.daily-hero h1 {
  font-size: clamp(38px, 6vw, 62px);
}

.daily-hero p {
  color: var(--muted);
  font-size: 18px;
}

.daily-reminder {
  display: grid;
  gap: 4px;
  margin-top: 24px;
  padding: 16px;
  color: var(--ink);
  background: #fff9e8;
  border: 1px solid #f4dc9c;
  border-radius: 8px;
}

.daily-reminder strong {
  color: var(--teal-dark);
}

.daily-reminder span {
  color: var(--muted);
}

.daily-card {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.daily-card-top,
.word-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.word-level {
  padding: 5px 10px;
  color: var(--ink);
  background: #fff9e8;
  border: 1px solid #f4dc9c;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.word-heading {
  margin: 26px 0;
}

.word-heading h2 {
  margin-bottom: 4px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 0.95;
}

.word-heading p {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  text-transform: capitalize;
}

.word-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.word-detail-grid article,
.native-note,
.practice-box {
  padding: 16px;
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.word-detail-grid span,
.native-note strong {
  display: block;
  margin-bottom: 8px;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.word-detail-grid p,
.native-note p {
  margin-bottom: 0;
}

.word-detail-grid small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.native-note,
.practice-box,
.sentence-checker {
  margin-top: 14px;
}

.practice-box h3,
.sentence-checker h3 {
  margin-bottom: 12px;
}

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

.practice-list div {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.practice-list strong {
  font-weight: 700;
}

.practice-list span {
  color: var(--muted);
  font-size: 14px;
}

.sentence-checker {
  padding: 16px;
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sentence-checker p {
  color: var(--muted);
}

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

textarea {
  width: 100%;
  resize: vertical;
  min-height: 96px;
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.sentence-feedback {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  font-weight: 800;
}

.sentence-feedback.working,
.sentence-feedback.success,
.sentence-feedback.warning {
  display: block;
}

.sentence-feedback.working {
  color: var(--blue);
  background: #edf4ff;
  border: 1px solid #cfe0f7;
}

.sentence-feedback.success {
  color: var(--teal-dark);
  background: #e3f3f0;
  border: 1px solid #bde2dc;
}

.sentence-feedback.warning {
  color: #7a4a00;
  background: #fff9e8;
  border: 1px solid #f4dc9c;
}

.admin-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 22px;
  align-items: start;
  padding: 34px 0;
}

.admin-sidebar,
.admin-content {
  padding: 20px;
}

.admin-sidebar {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 10px;
}

.admin-sidebar h1 {
  margin-bottom: 12px;
  font-size: 30px;
  line-height: 1.05;
}

.admin-nav {
  min-height: 44px;
  padding: 10px 12px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border-radius: 8px;
  font-weight: 800;
}

.admin-nav.active {
  color: white;
  background: var(--teal);
}

.admin-content {
  min-width: 0;
}

.admin-topline {
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.admin-topline h2 {
  margin: 4px 0 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  color: var(--teal-dark);
  background: #e3f3f0;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

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

.stats-grid article {
  padding: 16px;
  background: #f8fbfa;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stats-grid span,
.stats-grid strong {
  display: block;
}

.stats-grid span {
  color: var(--muted);
  font-size: 14px;
}

.stats-grid strong {
  font-size: 30px;
}

.admin-panel {
  padding-top: 8px;
}

.section-subtitle {
  margin-top: 24px;
}

.table-like,
.activity-list {
  display: grid;
  gap: 10px;
}

.table-like div {
  grid-template-columns: 1fr auto auto;
}

.inline-form {
  grid-template-columns: minmax(180px, 1fr) 160px 120px auto;
  align-items: end;
  margin-bottom: 18px;
}

.settings-grid {
  max-width: 520px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

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

.hidden {
  display: none !important;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  max-width: min(340px, calc(100% - 36px));
  padding: 12px 14px;
  color: white;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 850px) {
  .site-header,
  .site-footer,
  .hero-actions,
  .admin-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
  }

  .top-nav a {
    flex: 1;
    min-width: 0;
  }

  .hero-shell,
  .section-grid,
  .split-band,
  .auth-layout,
  .daily-layout,
  .admin-layout,
  .stats-grid,
  .inline-form,
  .word-detail-grid {
    grid-template-columns: 1fr;
  }

  .hero-shell {
    min-height: auto;
    padding-top: 28px;
  }

  h1 {
    font-size: 42px;
  }

  .admin-sidebar {
    position: static;
  }
}

@media (max-width: 520px) {
  main,
  .site-header,
  .site-footer {
    width: min(100% - 20px, 1120px);
  }

  .leaderboard-list li,
  .activity-list div,
  .table-like div {
    grid-template-columns: 1fr;
  }

  .hero-actions .button,
  .admin-topline .button {
    width: 100%;
  }
}
