:root {
  color-scheme: light;
  --ink: #1d2433;
  --muted: #667085;
  --line: #d9e2ec;
  --panel: #ffffff;
  --paper: #f7f9fb;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --ok: #047857;
  --bad: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.topbar {
  align-items: center;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 24px;
}

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

.brand-mark {
  display: block;
  flex-shrink: 0;
  height: 36px;
  width: 36px;
}

.brand-name {
  font-size: 17px;
  letter-spacing: -0.01em;
}

.topbar nav {
  align-items: center;
  display: flex;
  gap: 16px;
}

.topbar nav a,
.logout button {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

.logout {
  margin: 0;
}

.page {
  margin: 0 auto;
  max-width: 1120px;
  padding: 32px 24px 64px;
}

.public-hero {
  align-items: center;
  display: grid;
  gap: 36px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  min-height: 62vh;
}

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

.public-hero h1 {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 18px;
  max-width: 760px;
}

.hero-copy {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.5;
  margin: 0;
  max-width: 620px;
}

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

.demo-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(29, 36, 51, 0.12);
  display: grid;
  gap: 14px;
  padding: 28px;
}

.demo-label {
  color: var(--ok);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.demo-card strong {
  font-size: 34px;
}

.demo-card p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.demo-review {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  padding-top: 14px;
}

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

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

.feature-grid article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.feature-grid h2 {
  font-size: 20px;
  margin-bottom: 10px;
}

.feature-grid p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.hero-meta {
  color: var(--muted);
  font-size: 14px;
  margin: 18px 0 0;
}

.demo-pron {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

.demo-pron span {
  color: var(--muted);
  font-size: 13px;
}

.home-section-title {
  font-size: 26px;
  margin: 0 0 18px;
}

.home-section-head {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}

.home-section-link {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.home-section-link:hover {
  text-decoration: underline;
}

.home-steps {
  margin-top: 56px;
}

.home-steps-list {
  counter-reset: step;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-steps-list li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.home-steps-list h3 {
  font-size: 18px;
  margin: 12px 0 8px;
}

.home-steps-list p {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.home-step-num {
  align-items: center;
  background: var(--accent);
  border-radius: 50%;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.home-featured {
  margin-top: 56px;
}

.home-featured-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 4px;
}

.home-entry-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: inherit;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.home-entry-card:hover {
  border-color: var(--accent);
  box-shadow: 0 16px 36px rgba(29, 36, 51, 0.12);
  transform: translateY(-2px);
}

.home-entry-image {
  background: var(--paper);
  display: block;
}

.home-entry-image img {
  display: block;
  height: auto;
  width: 100%;
}

.home-entry-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.home-entry-term {
  font-size: 20px;
  font-weight: 800;
}

.home-entry-def {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.home-categories {
  margin-top: 56px;
}

.home-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-category-chip {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-weight: 700;
  gap: 8px;
  padding: 10px 16px;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.home-category-chip:hover {
  background: #eef4ff;
  border-color: var(--accent);
}

.home-category-count {
  background: var(--paper);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
}

.home-cta {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 56px;
  padding: 40px 32px;
  text-align: center;
}

.home-cta h2 {
  margin: 0 0 10px;
}

.home-cta p {
  color: var(--muted);
  margin: 0 auto 22px;
  max-width: 520px;
}

h1,
h2 {
  letter-spacing: 0;
  margin: 0 0 16px;
}

.dashboard-grid,
.word-detail {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 380px;
  margin-bottom: 36px;
}

.stats {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 180px));
}

.stat,
.add-word,
.auth-panel,
.review-card,
.example {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.stat {
  display: block;
  padding: 20px;
  text-decoration: none;
}

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

.stat span,
.muted,
.word-card span,
.status {
  color: var(--muted);
}

.add-word,
.auth-panel,
.review-card {
  padding: 24px;
}

.stacked-form p,
.add-word {
  display: grid;
  gap: 10px;
}

input {
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
  width: 100%;
}

.primary,
.button {
  align-items: center;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  text-decoration: none;
}

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

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

.button.secondary:hover {
  background: #eef2f6;
}

.section-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 24px 0 16px;
}

.word-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.word-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  overflow: hidden;
  padding-bottom: 14px;
  text-decoration: none;
}

.word-card img,
.image-placeholder {
  aspect-ratio: 4 / 3;
  background: #eef2f6;
  object-fit: contain;
  width: 100%;
}

.image-placeholder {
  align-items: center;
  background: #e6eef8;
  color: #174ea6;
  display: flex;
  font-size: 64px;
  font-weight: 800;
  justify-content: center;
}

.word-card div {
  display: grid;
  gap: 4px;
  padding: 0 14px;
}

.card-status {
  font-size: 13px;
  line-height: 1.35;
}

.card-meaning {
  color: var(--muted);
  display: -webkit-box;
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.35;
  overflow: hidden;
}

.word-card-progress {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.word-card .word-card-box {
  background: color-mix(in srgb, var(--accent) 12%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
}

.word-card .word-card-due {
  background: color-mix(in srgb, var(--bad) 12%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--bad) 30%, var(--line));
  border-radius: 999px;
  color: var(--bad);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
}

.card-status.processing {
  color: var(--muted);
}

.card-status.complete,
.fetch-status.complete {
  color: var(--ok);
}

.card-status.partial,
.fetch-status.partial {
  color: #93370d;
}

.card-status.failed,
.fetch-status.failed {
  color: var(--bad);
}

.fetch-status {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  line-height: 1.35;
  margin: 0 0 14px;
  padding: 10px 12px;
}

.fetch-status.complete {
  background: #ecfdf3;
  border-color: #abefc6;
}

.fetch-status.partial {
  background: #fffaeb;
  border-color: #fedf89;
}

.fetch-status.failed {
  background: #fef3f2;
  border-color: #fecdca;
}

.hero-image {
  border-radius: 8px;
  max-width: 100%;
  width: 100%;
}

.image-credit {
  font-size: 13px;
  margin-top: 8px;
}

.missing-image {
  align-items: center;
  aspect-ratio: 1 / 1;
  background: #eef2f6;
  border: 1px dashed var(--line);
  border-radius: 8px;
  display: grid;
  justify-items: center;
  padding: 24px;
  text-align: center;
}

.image-preview-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  margin-bottom: 28px;
}

.image-preview {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  display: grid;
  gap: 8px;
  overflow: hidden;
  padding: 8px;
  text-decoration: none;
}

.image-preview.selected {
  border-color: var(--accent);
}

.image-preview img {
  aspect-ratio: 1 / 1;
  background: #eef2f6;
  border-radius: 6px;
  object-fit: contain;
  width: 100%;
}

.image-preview div {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.image-preview span {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.image-preview a {
  color: var(--muted);
  font-size: 13px;
}

.pill {
  background: #e9f7ef;
  border-radius: 999px;
  color: var(--ok);
  display: inline-flex;
  padding: 6px 10px;
}

.examples,
.card-list {
  display: grid;
  gap: 12px;
}

.example,
.review-row {
  padding: 16px;
}

.blank {
  color: var(--accent-dark);
  font-weight: 700;
}

.review-row {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.review-shell,
.empty-state {
  display: grid;
  min-height: 60vh;
  place-items: center;
}

.review-card {
  max-width: 620px;
  width: 100%;
}

.review-image {
  background: #eef2f6;
  border-radius: 8px;
  display: block;
  margin-bottom: 18px;
  max-height: 420px;
  object-fit: contain;
  width: 100%;
}

.sentence {
  font-size: 28px;
  line-height: 1.35;
}

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

.message {
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.message.success {
  background: #ecfdf3;
  color: var(--ok);
}

.message.error {
  background: #fef3f2;
  color: var(--bad);
}

.message.warning {
  background: #fffaeb;
  color: #93370d;
}

.message.processing {
  background: #eef4ff;
  color: #1849a9;
}

.form-error {
  color: var(--bad);
}

@media (max-width: 760px) {
  .topbar,
  .topbar nav,
  .section-title,
  .review-row {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .public-hero,
  .feature-grid,
  .home-steps-list,
  .home-featured-grid {
    grid-template-columns: 1fr;
  }

  .public-hero {
    min-height: auto;
  }

  .home-steps,
  .home-featured,
  .home-categories,
  .home-cta,
  .feature-grid {
    margin-top: 40px;
  }

  .public-hero h1 {
    font-size: 42px;
  }
}


.auth-divider {
  align-items: center;
  color: var(--muted);
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr auto 1fr;
  margin: 16px 0;
}

.auth-divider::before,
.auth-divider::after {
  background: var(--line);
  content: "";
  height: 1px;
}

.social-login-form {
  margin: 0 0 8px;
}

.button.google {
  background: #e8f0fe;
  border: 1px solid #c6dafc;
  border-radius: 4px;
  box-shadow: none;
  color: #1a73e8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  gap: 12px;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.button.google:hover {
  background: #d2e3fc;
  border-color: #4285f4;
  box-shadow: 0 1px 2px rgba(26, 115, 232, 0.24);
  color: #174ea6;
}

.button.google:focus-visible {
  border-color: #4285f4;
  outline: 2px solid rgba(66, 133, 244, 0.35);
  outline-offset: 1px;
}

.google-icon {
  flex-shrink: 0;
  height: 22px;
  width: 22px;
}
