:root {
  --bg: #0d1224;
  --bg2: #151d38;
  --card: rgba(18, 27, 53, 0.92);
  --card-light: rgba(31, 43, 83, 0.96);
  --text: #f8fafc;
  --muted: #b4c0dd;
  --border: rgba(129, 154, 255, 0.25);
  --primary: #4f7cff;
  --primary2: #7a5cff;
  --success: #33d39f;
  --warning: #f5c451;
  --danger: #ff6b8e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(79,124,255,0.24), transparent 30%),
    radial-gradient(circle at top right, rgba(122,92,255,0.22), transparent 25%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; }
.page-shell { max-width: 1380px; margin: 0 auto; padding: 20px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.22);
  backdrop-filter: blur(8px);
}
.neon {
  background: linear-gradient(135deg, rgba(22,34,68,0.96), rgba(35,29,70,0.96));
  border-color: rgba(115, 146, 255, 0.45);
}
.hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 18px;
}
.eyebrow {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(79,124,255,0.18);
  border: 1px solid rgba(79,124,255,0.35);
  color: #dce6ff;
  margin-bottom: 10px;
}
.hero h1 { font-size: 52px; margin: 0 0 8px; }
.hero p { color: var(--muted); max-width: 780px; margin: 0; }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-pill {
  min-width: 106px;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(51, 211, 159, 0.12);
  border: 1px solid rgba(51, 211, 159, 0.32);
  text-align: center;
}
.hero-pill span { display: block; color: var(--muted); font-size: 13px; }
.hero-pill strong { font-size: 26px; }
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(51, 211, 159, 0.16);
  border: 1px solid rgba(51, 211, 159, 0.32);
  color: #d8fff2;
  font-weight: 700;
}
.badge.purple {
  background: rgba(122,92,255,0.18);
  border-color: rgba(122,92,255,0.38);
  color: #e5dcff;
}
.grid { display: grid; gap: 18px; }
.top-grid { grid-template-columns: 1.1fr 0.9fr; }
.result-grid, .library-grid { grid-template-columns: 1fr 1fr; }
.form-grid { display: grid; grid-template-columns: 1fr 220px; gap: 12px; }
.form-grid.single-gap { grid-template-columns: 1fr; margin-bottom: 12px; }
input, textarea, select {
  width: 100%;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 14px 16px;
  outline: none;
}
select option { color: #111827; }
textarea { min-height: 240px; resize: vertical; line-height: 1.5; }
button {
  border: none;
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  box-shadow: 0 10px 24px rgba(79,124,255,0.32);
}
button.secondary { background: linear-gradient(135deg, #1c2749, #2a365f); }
button.ghost {
  background: rgba(255,255,255,0.08);
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.12);
}
.small-action {
  padding: 10px 16px;
  min-height: 44px;
  width: auto;
  margin-top: 12px;
}
.label { display: block; margin: 14px 0 8px; color: #d7e1ff; font-weight: 700; }
.top-gap { margin-top: 18px; }
.interest-block { margin-top: 14px; }
.interest-chips, .badges-row { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  width: auto;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: none;
}
.chip.active {
  background: linear-gradient(135deg, rgba(79,124,255,0.28), rgba(122,92,255,0.28));
  border-color: rgba(130,162,255,0.55);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.theme-card {
  text-align: left;
  background: linear-gradient(135deg, rgba(79,124,255,0.14), rgba(122,92,255,0.14));
  border: 1px solid rgba(129,154,255,0.28);
  min-height: 110px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.theme-card.selected { outline: 2px solid rgba(255,255,255,0.35); }
.mini-badge {
  display: inline-block;
  width: fit-content;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
}
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.status { min-height: 24px; color: var(--muted); }
.stat-line, .xp-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.xp-box { margin-top: 12px; }
.progress {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
  margin-top: 10px;
}
.progress div {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--success), #63e6be);
}
.progress-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.mini-stat {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.05);
}
.mini-stat.wide { grid-column: 1 / -1; }
.mini-stat span { display: block; color: var(--muted); margin-bottom: 6px; }
.score-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}
.score-row.compact { grid-template-columns: repeat(2, 1fr); }
.score-box {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  padding: 14px;
}
.score-box span { display: block; color: var(--muted); margin-bottom: 6px; }
.score-box strong { font-size: 32px; }
.correction-item, .history-card, .essay-text, .word-box {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  border-radius: 18px;
  padding: 14px;
  margin-bottom: 12px;
}
.compact-correction summary {
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.compact-correction summary::-webkit-details-marker { display: none; }
.summary-label {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.summary-label.error { background: rgba(255,107,142,0.18); color: #ffd5df; }
.summary-label.ok { background: rgba(51,211,159,0.16); color: #d8fff2; }
.correction-body { margin-top: 12px; }
.text-error { color: #ffb8c7; }
.text-ok { color: #a2ffdc; }
.mistake-list { display: grid; gap: 10px; }
.mistake-item {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255,255,255,0.04);
}
.mistake-words { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 6px; }
.wrong { color: #ffb8c7; text-decoration: line-through; }
.right { color: #a2ffdc; }
.arrow { color: var(--muted); }
.history-card {
  width: 100%;
  text-align: left;
  box-shadow: none;
}
.history-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.history-meta, .small, .detail-empty, .breadcrumbs { color: var(--muted); }
.detail-card { min-height: 480px; }
.essay-text { line-height: 1.65; }
.breadcrumbs {
  font-size: 14px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.05);
  padding: 10px 14px;
  border-radius: 999px;
  display: inline-block;
}
@media (max-width: 1100px) {
  .top-grid, .result-grid, .library-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .hero { flex-direction: column; align-items: flex-start; }
  .hero h1 { font-size: 38px; }
  .form-grid, .score-row, .progress-grid { grid-template-columns: 1fr; }
}
