:root {
  --ink: #162033;
  --muted: #657080;
  --line: #dce2ea;
  --surface: #ffffff;
  --surface-2: #f9fbfc;
  --bg: #eef2f5;
  --nav: #19324d;
  --primary: #0f766e;
  --primary-dark: #0b5e58;
  --danger: #dc2626;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #e7eef2 0, #f7f8fa 360px), var(--bg);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

button:hover {
  transform: translateY(-1px);
}

.app {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, #dfe9ee, #f9fbfc);
}

.login-box,
.panel,
.card,
.study-box,
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-box {
  width: min(430px, 100%);
  padding: 28px;
  display: grid;
  gap: 12px;
  box-shadow: 0 18px 50px rgba(22, 32, 51, 0.12);
}

.brand {
  margin: 0;
  font-size: clamp(32px, 8vw, 48px);
  line-height: 1;
}

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

.small {
  font-size: 13px;
}

.header,
.topline,
.row,
.actions,
.nav,
.form-row,
.word-row,
.setting-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.header,
.topline,
.setting-row {
  justify-content: space-between;
}

.header {
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(220, 226, 234, 0.9);
  border-radius: 8px;
  padding: 14px;
  backdrop-filter: blur(12px);
}

.logo {
  font-size: 24px;
  font-weight: 800;
}

.nav {
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(220, 226, 234, 0.9);
  border-radius: 8px;
  padding: 6px;
}

.nav button {
  padding: 10px 14px;
  border-radius: 8px;
  background: transparent;
  color: #263445;
  font-weight: 800;
}

.nav button.active {
  background: var(--nav);
  color: #fff;
  box-shadow: 0 8px 18px rgba(25, 50, 77, 0.18);
}

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

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  background: linear-gradient(135deg, rgba(25, 50, 77, 0.97), rgba(15, 118, 110, 0.94));
  color: white;
  border-radius: 8px;
  padding: clamp(20px, 4vw, 34px);
  overflow: hidden;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.05;
}

.hero p {
  margin: 0;
  color: #dbe8ed;
}

.eyebrow {
  margin: 0 0 8px;
  color: #b6f4ea;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-meter {
  min-width: 150px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
}

.hero-meter strong {
  display: block;
  font-size: 42px;
  line-height: 1;
}

.hero-meter span {
  color: #dbe8ed;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}

.card,
.panel,
.study-box,
.stat {
  padding: 16px;
  box-shadow: 0 10px 26px rgba(22, 32, 51, 0.07);
}

.card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.card:hover,
.panel:hover,
.stat:hover {
  box-shadow: 0 16px 34px rgba(22, 32, 51, 0.1);
}

.card h3,
.panel h2,
.panel h3 {
  margin: 0;
}

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

.progress-bar {
  height: 100%;
  background: #22a06b;
}

.button-primary {
  background: linear-gradient(180deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.2);
}

.button-secondary {
  background: #eaf0f4;
  color: #1c2c3e;
}

.button-danger {
  background: #fee2e2;
  color: #991b1b;
}

.button-primary,
.button-secondary,
.button-danger,
.button-ghost {
  border-radius: 8px;
  padding: 10px 14px;
  font-weight: 800;
  min-height: 42px;
}

.button-ghost {
  background: transparent;
  border: 1px solid #cbd3dd;
  color: #263445;
}

input,
textarea {
  width: 100%;
  border: 1px solid #cbd3dd;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(15, 118, 110, 0.16);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.form-row > input {
  flex: 1 1 170px;
}

.form-row > .short {
  flex: 0 0 76px;
}

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

.word-row {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.word-row input {
  flex: 1 1 180px;
}

.select-word {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  background: #eef7f5;
  color: #0b5e58;
  padding: 8px 10px;
  font-weight: 800;
  white-space: nowrap;
}

.select-word input {
  width: 18px;
  height: 18px;
}

.study-box {
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
  min-height: 420px;
  align-content: center;
}

.study-box-clickable {
  cursor: pointer;
}

.answer-form {
  display: grid;
  justify-items: center;
  gap: 14px;
  width: 100%;
}

.prompt {
  font-size: clamp(34px, 10vw, 64px);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.hint {
  color: var(--muted);
  font-size: clamp(22px, 5vw, 30px);
  letter-spacing: 0;
}

.answer {
  max-width: 520px;
  text-align: center;
  font-size: 20px;
}

.feedback {
  font-weight: 800;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}

.answer-result,
.correct-answer {
  width: min(520px, 100%);
  border-radius: 8px;
  padding: 14px 16px;
}

.answer-result {
  border: 2px solid;
}

.answer-result-good {
  background: #ecfdf3;
  border-color: #22a06b;
  color: #11623f;
}

.answer-result-bad {
  background: #fff1f2;
  border-color: #dc2626;
  color: #991b1b;
}

.answer-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.answer-value,
.correct-answer-value {
  font-size: clamp(24px, 6vw, 38px);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.correct-answer {
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.correct-answer-value {
  color: var(--ink);
}

.feedback-note {
  color: var(--muted);
  font-weight: 800;
}

.study-top {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: #eaf0f4;
  color: #263445;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 800;
}

.status-dot {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 8px;
}

.stat strong {
  display: block;
  font-size: 28px;
}

.status-strip {
  display: flex;
  height: 14px;
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: #dde4ec;
}

.status-strip span {
  min-width: 3px;
}

.empty-strip {
  min-height: 14px;
}

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

.status-row {
  display: grid;
  grid-template-columns: minmax(120px, 170px) 1fr auto;
  gap: 12px;
  align-items: center;
}

.status-track {
  height: 10px;
  border-radius: 999px;
  background: #e5e8ed;
  overflow: hidden;
}

.status-track div {
  height: 100%;
  border-radius: inherit;
}

.notice {
  margin-bottom: 16px;
  border: 1px solid #f1c36d;
  background: #fff7e6;
  color: #6f4600;
  border-radius: 8px;
  padding: 12px 14px;
  font-weight: 700;
}

.switch {
  width: 52px;
  height: 30px;
  border-radius: 15px;
  background: #cbd3dd;
  padding: 3px;
}

.switch span {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
}

.switch.on {
  background: var(--primary);
}

.switch.on span {
  transform: translateX(22px);
}

.empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 640px) {
  .app {
    padding: 12px;
  }

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

  .nav button,
  .button-primary,
  .button-secondary,
  .button-danger,
  .button-ghost {
    flex: 1 1 auto;
  }

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

  .hero-meter {
    width: 100%;
  }

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

  .status-track {
    grid-column: 1 / -1;
  }
}
