:root {
  color-scheme: light;
  --bg: #f5f7f3;
  --ink: #17211d;
  --muted: #64706b;
  --line: #d7ded9;
  --panel: #ffffff;
  --accent: #1f7a63;
  --accent-dark: #155443;
  --gold: #b77a18;
  --blue: #2b5c8a;
  --shadow: 0 18px 50px rgba(35, 48, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background:
    linear-gradient(135deg, rgba(31, 122, 99, 0.08), transparent 32%),
    linear-gradient(315deg, rgba(183, 122, 24, 0.08), transparent 34%),
    var(--bg);
  color: var(--ink);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 10px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
}

.site-nav,
.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 32px;
}

.page-view {
  display: block;
}

.landing-page {
  display: grid;
  gap: 28px;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 20px;
  margin-bottom: 18px;
}

.nav-button {
  min-height: 40px;
  padding: 0 12px;
  border-color: var(--line);
  background: var(--panel);
  color: var(--muted);
}

.nav-button:hover,
.nav-button.active {
  border-color: rgba(31, 122, 99, 0.35);
  background: #e9f4ef;
  color: var(--accent-dark);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  line-height: 1.05;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

.landing-hero {
  display: grid;
  min-height: min(640px, calc(100vh - 95px));
  grid-template-columns: minmax(300px, 1fr) minmax(280px, 0.85fr);
  align-items: center;
  gap: 32px;
  padding: 46px 0 34px;
}

.hero-copy {
  display: grid;
  gap: 18px;
}

.hero-copy h1 {
  max-width: 820px;
  font-size: clamp(2.3rem, 5vw, 5rem);
}

.hero-copy p:not(.eyebrow) {
  max-width: 690px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.secondary-button {
  border-color: #cad8d2;
  background: #ffffff;
  color: var(--accent-dark);
}

.secondary-button:hover {
  background: #edf5f2;
}

.hero-board {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.65)),
    #ffffff;
  box-shadow: var(--shadow);
}

.hero-card {
  display: grid;
  gap: 7px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.hero-card span {
  font-size: 1.15rem;
  font-weight: 900;
}

.hero-card small {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.5;
}

.hero-card.strong {
  background: #e9f4ef;
}

.hero-card.accent {
  background: #f8f0e3;
}

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

.feature-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 190px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.feature-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.seo-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(300px, 1fr);
  gap: 24px;
  padding: 26px 0 6px;
  border-top: 1px solid var(--line);
}

.seo-section h2 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  line-height: 1.15;
}

.seo-section p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

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

.faq-item {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.faq-item h2 {
  margin-bottom: 10px;
}

.faq-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.controls {
  display: grid;
  grid-template-columns:
    auto minmax(112px, 135px)
    auto minmax(128px, 155px)
    auto minmax(128px, 155px)
    auto;
  align-items: center;
  column-gap: 6px;
  row-gap: 10px;
  justify-content: start;
}

.controls label,
.checkbox-control,
.search-controls label {
  color: var(--muted);
  font-weight: 700;
}

input,
select,
button,
textarea {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

input[type="checkbox"] {
  width: 18px;
  min-height: 18px;
  accent-color: var(--accent);
}

input,
select,
textarea {
  width: 100%;
  padding: 0 36px 0 12px;
  background: var(--panel);
  color: var(--ink);
}

textarea {
  min-height: 250px;
  padding: 14px;
  resize: vertical;
  line-height: 1.6;
}

.step-controls {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
}

.checkbox-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.word-position {
  min-width: 58px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}

.search-controls {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(220px, 360px) auto;
  justify-content: end;
  align-items: center;
  gap: 10px;
}

button {
  padding: 0 16px;
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.status-text {
  grid-column: 1 / -1;
  justify-self: end;
  min-height: 20px;
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.status-text.error {
  color: #a33d2b;
}

button:hover {
  background: var(--accent-dark);
}

.study-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
  min-height: calc(100vh - 155px);
}

.hidden {
  display: none !important;
}

.panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.count {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef5f2;
  color: var(--accent-dark);
  font-size: 0.83rem;
  font-weight: 800;
}

.vocab-list {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.ghost-button {
  min-height: 34px;
  padding: 0 10px;
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.ghost-button:hover {
  background: #f2f5f8;
  color: var(--ink);
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-item {
  min-height: 34px;
  padding: 0 10px;
  border-color: #dbe4ea;
  background: #f7fafb;
  color: #26445f;
  font-size: 0.86rem;
  font-weight: 800;
}

.history-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.history-view {
  min-height: calc(100vh - 155px);
}

.history-content {
  display: grid;
  gap: 24px;
  padding: 18px;
}

.history-content h3 {
  margin-bottom: 12px;
  font-size: 0.92rem;
  text-transform: uppercase;
}

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

.batch-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.batch-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 750;
}

.batch-words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.word-button {
  display: grid;
  width: 100%;
  min-height: 74px;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.word-button:hover,
.word-button.active {
  border-color: rgba(31, 122, 99, 0.35);
  background: #eef7f4;
}

.word-main {
  display: grid;
  gap: 5px;
}

.word {
  font-size: 1.05rem;
  font-weight: 850;
}

.phonetic {
  color: var(--blue);
  font-size: 0.93rem;
  font-weight: 700;
}

.level-tag {
  justify-self: end;
  padding: 6px 9px;
  border-radius: 999px;
  background: #f7efe2;
  color: #7a4b08;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.detail-content {
  padding: 24px;
}

.detail-title {
  margin-bottom: 6px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
}

.detail-phonetic {
  margin-bottom: 18px;
  color: var(--blue);
  font-size: 1.1rem;
  font-weight: 800;
}

.translation {
  display: inline-flex;
  margin-bottom: 22px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #e9f4ef;
  color: var(--accent-dark);
  font-size: 1.15rem;
  font-weight: 850;
}

.detail-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.detail-section h3 {
  margin-bottom: 8px;
  font-size: 0.92rem;
  text-transform: uppercase;
}

.language-label {
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 10px;
  border-radius: 999px;
  background: #f2f5f8;
  color: #26445f;
  font-weight: 750;
}

.example {
  margin-bottom: 0;
  padding-left: 16px;
  border-left: 4px solid var(--gold);
  color: #28342f;
  font-size: 1.05rem;
  line-height: 1.65;
}

.translated-example {
  border-left-color: var(--accent);
}

.empty-state {
  display: grid;
  min-height: 420px;
  align-content: center;
  justify-items: center;
  text-align: center;
  color: var(--muted);
}

.empty-state h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 1.35rem;
}

.empty-state p {
  max-width: 410px;
  line-height: 1.6;
}

.empty-visual {
  display: grid;
  width: 104px;
  height: 104px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid rgba(31, 122, 99, 0.25);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(31, 122, 99, 0.14), transparent),
    #ffffff;
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 2.4rem;
  font-weight: 800;
}

.translator-layout {
  display: grid;
  gap: 18px;
}

.translator-heading {
  display: grid;
  gap: 8px;
  max-width: 780px;
  padding-top: 16px;
}

.translator-heading h1 {
  font-size: clamp(2rem, 4vw, 4rem);
}

.translator-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(280px, 1fr);
  gap: 14px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.language-controls {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(170px, 210px));
  justify-content: space-between;
  column-gap: 8px;
  row-gap: 10px;
}

.language-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.language-controls label:last-child {
  justify-self: end;
}

.translation-box {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.box-header {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.translation-box textarea {
  border: 0;
  border-radius: 0;
}

.translation-actions {
  display: grid;
  align-content: center;
  gap: 10px;
}

.translation-output {
  padding: 16px;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.75;
  white-space: pre-wrap;
}

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

.translation-notes {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.translation-notes h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
}

.translation-notes ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.ielts-feedback {
  display: grid;
  grid-column: 3;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.ielts-feedback h2 {
  font-size: 0.95rem;
  text-transform: uppercase;
}

.ielts-feedback p {
  margin-bottom: 0;
  line-height: 1.65;
}

.ielts-feedback ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.corrected-sentence {
  padding: 12px;
  border-left: 4px solid var(--accent);
  background: #eef7f4;
  color: var(--ink);
  font-weight: 750;
}

@media (max-width: 760px) {
  .site-header {
    width: min(100% - 20px, 1180px);
    align-items: stretch;
    flex-direction: column;
  }

  .site-nav {
    display: grid;
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 16px;
  }

  .toolbar,
  .study-grid,
  .landing-hero,
  .feature-grid,
  .seo-section,
  .faq-grid,
  .translator-panel {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    min-height: auto;
    padding-top: 18px;
  }

  .toolbar {
    display: grid;
    align-items: stretch;
  }

  .top-nav {
    justify-content: stretch;
  }

  .nav-button {
    flex: 1;
  }

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

  .step-controls {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
  }

  .search-controls {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .status-text {
    justify-self: start;
    margin-top: 0;
  }

  .translation-actions {
    display: flex;
  }

  .language-controls {
    grid-template-columns: 1fr;
  }

  .ielts-feedback {
    grid-column: 1;
  }

  .study-grid {
    min-height: auto;
  }

  .word-button {
    grid-template-columns: 1fr;
  }

  .level-tag {
    justify-self: start;
  }
}
