﻿:root {
  --bg: #e7e2db;
  --bg-soft: #f6f3ef;
  --panel: rgba(248, 244, 239, 0.9);
  --panel-dark: #23272e;
  --signup: #9f8c78;
  --signup-text: #f8f4ef;
  --text: #181818;
  --muted: #625d58;
  --line: rgba(27, 26, 24, 0.12);
  --shadow: 0 24px 80px rgba(28, 24, 20, 0.12);
  --slate: #363d44;
  --brown: #8d7969;
  --nav-1: #d9d1c6;
  --nav-2: #c9c0b5;
  --nav-3: #bbb2a8;
  --nav-4: #aaa198;
  --nav-5: #e7ddd0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Quicksand", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(141, 121, 105, 0.14), transparent 28%),
    radial-gradient(circle at top right, rgba(54, 61, 68, 0.12), transparent 30%),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
}

.page {
  position: relative;
  width: 100%;
  margin: 0;
  overflow: hidden;
}

.ambient {
  position: fixed;
  inset: auto;
  pointer-events: none;
  z-index: 0;
  filter: blur(16px);
  opacity: 0.8;
}

.ambient-a {
  top: 92px;
  right: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.32), rgba(167, 149, 132, 0.18) 42%, transparent 68%);
}

.ambient-b {
  left: -120px;
  top: 380px;
  width: 360px;
  height: 360px;
  border-radius: 46% 54% 61% 39% / 45% 47% 53% 55%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.24), rgba(107, 116, 125, 0.16) 45%, transparent 72%);
}

.topbar,
.card,
.resource-card,
.faq-item,
.pill-row,
.toolbar-card,
.topic-card,
.table-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px 20px;
  background: var(--panel-dark);
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 34px rgba(23, 24, 27, 0.16);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.topbar::after {
  content: "";
  position: absolute;
  left: -12%;
  top: 36%;
  width: 56%;
  height: 72px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
  filter: blur(24px);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #f3eee8;
  font-weight: 700;
  flex: 0 0 auto;
  margin-right: 6px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #4a525b, #67717c);
  color: white;
}

.topbar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 520px);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 8px;
}

.topbar-nav::-webkit-scrollbar { display: none; }

.topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 9px 12px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  flex: 0 0 auto;
  color: rgba(243, 239, 234, 0.84);
}

.topbar-item:hover,
.topbar-item.is-active {
  background: rgba(255, 255, 255, 0.06);
  color: #f5efe8;
}

.topbar-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  margin-left: auto;
}

.auth-link,
.auth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  border: none;
  font: inherit;
  cursor: pointer;
}

.auth-link {
  color: rgba(243, 239, 234, 0.84);
}

.auth-button {
  background: var(--signup);
  color: var(--signup-text);
}

.icon {
  width: 20px;
  height: 20px;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 0.76rem;
}

.tone-1 { color: var(--nav-1); }
.tone-2 { color: var(--nav-2); }
.tone-3 { color: var(--nav-3); }
.tone-4 { color: var(--nav-4); }
.tone-5 { color: var(--nav-5); }

.content-shell {
  position: relative;
  z-index: 1;
  width: min(80%, 1320px);
  margin: 0 auto;
}

.site-footer {
  margin-top: 84px;
  width: 100%;
  background: var(--panel-dark);
  color: rgba(241, 236, 229, 0.92);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 -18px 34px rgba(23, 24, 27, 0.12);
}

.footer-accent {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.footer-inner {
  padding-top: 48px;
  padding-bottom: 34px;
}

.footer-content {
  width: min(94%, 1720px);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 0.8fr;
  gap: 36px;
  padding-bottom: 34px;
}

.footer-brand {
  display: grid;
  align-content: start;
  gap: 18px;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  color: #f3eee8;
  text-decoration: none;
  font-weight: 700;
}

.footer-brand p {
  margin: 0;
  max-width: 30ch;
  color: rgba(227, 219, 210, 0.82);
}

.footer-socials {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-social {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(243, 238, 232, 0.88);
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.footer-social:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.footer-social svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.footer-col {
  display: grid;
  align-content: start;
  gap: 12px;
}

.footer-col h3 {
  margin: 0 0 6px;
  font-size: 1.08rem;
  color: #f3eee8;
}

.footer-col a,
.footer-col span {
  color: rgba(223, 214, 205, 0.8);
  text-decoration: none;
  font-weight: 600;
}

.footer-col a:hover {
  color: #ffffff;
}

.footer-bottom {
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(210, 201, 193, 0.78);
  font-size: 0.92rem;
  font-weight: 600;
  flex-wrap: wrap;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  padding: 48px 4px 28px;
  align-items: center;
  position: relative;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.liquid-band {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 14px 26px rgba(51, 45, 40, 0.08);
  backdrop-filter: blur(18px);
  color: #4d5359;
  font-size: 0.92rem;
  font-weight: 700;
}

.liquid-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(159, 140, 120, 0.95), rgba(103, 113, 124, 0.95));
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.28);
}

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

.hero-primary,
.hero-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 164px;
  padding: 12px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.hero-primary {
  background: var(--panel-dark);
  color: #f7f3ee;
  box-shadow: 0 18px 28px rgba(35, 39, 46, 0.18);
}

.hero-secondary {
  color: #2b2f35;
  border: 1px solid rgba(35, 39, 46, 0.12);
  background: rgba(255, 255, 255, 0.56);
}

.glass-card {
  position: relative;
  overflow: hidden;
}

.glass-wave {
  position: absolute;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.88;
  pointer-events: none;
}

.glass-wave-a {
  top: -18px;
  right: -46px;
  width: 210px;
  height: 110px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.14));
  transform: rotate(-11deg);
}

.glass-wave-b {
  bottom: 8px;
  left: 18px;
  width: 180px;
  height: 86px;
  background: linear-gradient(90deg, rgba(167, 149, 132, 0.14), rgba(255, 255, 255, 0.42), rgba(107, 116, 125, 0.08));
  transform: rotate(9deg);
}

.eyebrow {
  margin: 0 0 14px;
  color: #50565c;
  font-size: 0.92rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1, h2, h3 { margin: 0; line-height: 1.08; }

h1 {
  font-size: clamp(2.8rem, 6vw, 5rem);
  letter-spacing: -0.04em;
  max-width: 11ch;
}

p, li {
  color: var(--muted);
  line-height: 1.75;
}

.card,
.toolbar-card,
.topic-card,
.table-card {
  border-radius: 28px;
  padding: 24px;
  backdrop-filter: blur(18px);
}

.stat-grid,
.resource-grid,
.section-grid-3,
.feature-grid {
  display: grid;
  gap: 18px;
}

.stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
.resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.section-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.mini-stat strong {
  display: block;
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.pill-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 6px;
  padding: 18px 20px;
  border-radius: 24px;
  font-weight: 600;
}

.pill-row span::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  margin-right: 9px;
  background: var(--brown);
}

.section { padding-top: 76px; }

.section-head {
  max-width: 760px;
  margin-bottom: 24px;
}

.section-head h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.03em;
}

.mini-kicker {
  margin: 0 0 8px;
  color: #6d6258;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  font-weight: 700;
}

.compact-card {
  min-height: 172px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.34)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.4), transparent 48%);
}

.filters,
.level-row,
.topic-row,
.vocab-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-btn,
.level-btn,
.topic-btn,
.state-btn {
  border: 1px solid rgba(18, 27, 45, 0.12);
  background: rgba(255, 255, 255, 0.56);
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.filter-btn.active,
.level-btn.is-active,
.topic-btn.is-active,
.state-btn.is-active {
  background: var(--panel-dark);
  color: white;
  border-color: transparent;
}

.resource-card {
  border-radius: 24px;
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.resource-card::after {
  content: "";
  position: absolute;
  top: -18px;
  right: -18px;
  width: 120px;
  height: 70px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.08));
  filter: blur(14px);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.meta span,
.vocab-meta span,
.vocab-summary span {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(141, 121, 105, 0.12);
  color: #6e6156;
  font-size: 0.84rem;
  font-weight: 700;
}

.resource-card a {
  display: inline-flex;
  margin-top: 14px;
  color: #232a31;
  font-weight: 700;
  text-decoration: none;
}

.vocab-shell {
  display: grid;
  gap: 18px;
}

.grammar-shell,
.grammar-content,
.grammar-lessons,
.grammar-lesson-body {
  display: grid;
  gap: 18px;
}

.listening-shell,
.listening-content,
.listening-lessons,
.listening-lesson-body {
  display: grid;
  gap: 18px;
}

.grammar-toolbar {
  gap: 18px;
}

.grammar-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.grammar-flow span,
.grammar-group-count {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(35, 39, 46, 0.08);
  color: #514b46;
  font-size: 0.84rem;
  font-weight: 700;
}

.grammar-group {
  display: grid;
  gap: 14px;
}

.listening-group {
  display: grid;
  gap: 14px;
}

.grammar-group-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.listening-group-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.grammar-group-head h3 {
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.listening-group-head h3 {
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}

.grammar-lesson {
  border: 1px solid rgba(18, 27, 45, 0.1);
  border-radius: 24px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.4)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.36), transparent 42%);
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(26, 23, 20, 0.08);
}

.listening-lesson {
  border: 1px solid rgba(18, 27, 45, 0.1);
  border-radius: 24px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0.4)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.36), transparent 42%);
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(26, 23, 20, 0.08);
}

.grammar-lesson summary {
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  cursor: pointer;
}

.listening-lesson summary {
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  cursor: pointer;
}

.grammar-lesson summary::-webkit-details-marker {
  display: none;
}

.listening-lesson summary::-webkit-details-marker {
  display: none;
}

.grammar-lesson summary h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.listening-lesson summary h3 {
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.grammar-lesson summary p {
  margin: 0;
}

.listening-lesson summary p {
  margin: 0;
}

.grammar-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(35, 39, 46, 0.08);
  color: #3d434a;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.listening-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.listening-summary-meta span:first-child {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(35, 39, 46, 0.08);
  color: #3d434a;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.listening-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(35, 39, 46, 0.08);
  color: #3d434a;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.grammar-lesson[open] .grammar-open {
  background: var(--panel-dark);
  color: #f8f4ef;
}

.listening-lesson[open] .listening-open {
  background: var(--panel-dark);
  color: #f8f4ef;
}

.grammar-lesson-body {
  padding: 0 24px 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.listening-lesson-body {
  padding: 0 24px 24px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grammar-panel {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(18, 27, 45, 0.08);
  background: rgba(255, 255, 255, 0.5);
}

.listening-panel {
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(18, 27, 45, 0.08);
  background: rgba(255, 255, 255, 0.5);
}

.listening-transcript {
  grid-column: 1 / -1;
}

.listening-lines {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.grammar-pattern {
  font-weight: 700;
  color: #2a2f35;
}

.grammar-list {
  margin: 0;
  padding-left: 18px;
}

.topic-card {
  display: grid;
  gap: 14px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.38)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.4), transparent 40%);
}

.search-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(18, 27, 45, 0.12);
  background: rgba(255, 255, 255, 0.78);
  font: inherit;
  color: var(--text);
}

.table-card {
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.42)),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.36), transparent 42%);
}

.vocab-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1320px;
}

.vocab-table th,
.vocab-table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(18, 27, 45, 0.08);
  vertical-align: top;
}

.vocab-table th {
  color: #40464d;
  font-size: 0.95rem;
}

.word-main {
  font-weight: 700;
  color: var(--text);
}

.word-gender {
  color: var(--brown);
  font-weight: 700;
}

.ipa {
  font-family: "Times New Roman", serif;
  color: #414141;
  white-space: nowrap;
}

.status-stack,
.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill,
.mini-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill.is-new {
  background: rgba(80, 86, 92, 0.12);
  color: #50565c;
}

.status-pill.is-learned {
  background: rgba(101, 123, 102, 0.16);
  color: #49584a;
}

.status-pill.is-review {
  background: rgba(159, 140, 120, 0.18);
  color: #7a6350;
}

.mini-fav {
  background: rgba(35, 39, 46, 0.12);
  color: #23272e;
}

.state-btn {
  padding: 8px 11px;
  font-size: 0.84rem;
}

.speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(18, 27, 45, 0.12);
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

.empty-state {
  color: var(--muted);
  font-weight: 600;
}

.load-error {
  padding: 24px;
  border-radius: 20px;
  border: 1px dashed rgba(18, 27, 45, 0.18);
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
}

.auth-modal[hidden] {
  display: none;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 24, 28, 0.46);
  backdrop-filter: blur(18px);
}

.auth-dialog {
  position: relative;
  z-index: 1;
  width: min(940px, calc(100% - 24px));
  margin: min(8vh, 64px) auto;
  display: grid;
  grid-template-columns: 1fr 0.95fr;
  gap: 18px;
  padding: 22px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background:
    linear-gradient(160deg, rgba(246, 242, 237, 0.82), rgba(255, 255, 255, 0.42)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.48), transparent 36%);
  box-shadow: 0 32px 90px rgba(24, 20, 16, 0.24);
  backdrop-filter: blur(24px);
}

.auth-dialog-copy {
  padding: 16px 10px 16px 10px;
}

.auth-dialog-copy h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: -0.04em;
  margin-bottom: 14px;
}

.auth-card {
  position: relative;
  padding: 18px;
  border-radius: 26px;
  border: 1px solid rgba(35, 39, 46, 0.08);
  background: rgba(255, 255, 255, 0.64);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(35, 39, 46, 0.12);
  background: rgba(255, 255, 255, 0.72);
  font-size: 1.4rem;
  cursor: pointer;
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-tab {
  flex: 1;
  border: 1px solid rgba(35, 39, 46, 0.1);
  background: rgba(255, 255, 255, 0.68);
  color: #57514a;
  border-radius: 999px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-tab.is-active {
  background: var(--panel-dark);
  color: #f8f4ef;
  border-color: transparent;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-field {
  display: grid;
  gap: 8px;
  color: #4a4540;
  font-weight: 700;
}

.auth-field input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(18, 27, 45, 0.12);
  background: rgba(255, 255, 255, 0.88);
  font: inherit;
  color: var(--text);
}

.auth-submit,
.google-auth {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 50px;
  border-radius: 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-submit {
  border: none;
  background: var(--panel-dark);
  color: #f8f4ef;
  margin-top: 6px;
}

.google-auth {
  border: 1px solid rgba(18, 27, 45, 0.12);
  background: rgba(255, 255, 255, 0.82);
  color: #23272e;
}

.auth-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0;
  color: #7a7067;
  font-size: 0.88rem;
  font-weight: 700;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(35, 39, 46, 0.1);
}

.auth-divider::before {
  margin-right: 12px;
}

.auth-divider::after {
  margin-left: 12px;
}

.auth-status {
  min-height: 24px;
  margin: 14px 0 0;
  color: #615950;
  line-height: 1.5;
}

.auth-status.is-error {
  color: #a24646;
}

.auth-status.is-success {
  color: #466a52;
}

.auth-config-notice {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(159, 140, 120, 0.12);
  color: #695749;
  font-weight: 700;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #f3eee8;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.84rem;
  font-weight: 700;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-actions button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #f3eee8;
  border-radius: 999px;
  padding: 9px 14px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.sync-inline {
  margin: 0;
  color: #6a6259;
  font-weight: 600;
}

.profile-shell {
  display: grid;
  gap: 18px;
}

.profile-main {
  display: grid;
  gap: 22px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #4a525b, #67717c);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 700;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

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

@media (max-width: 980px) {
  .hero,
  .resource-grid,
  .section-grid-3,
  .pill-row,
  .feature-grid,
  .profile-grid,
  .grammar-lesson-body,
  .listening-lesson-body,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    gap: 10px;
  }

  .auth-dialog {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .content-shell { width: min(100% - 24px, 1000px); }
  .topbar { padding: 10px 12px; }
  .topbar-nav {
    position: static;
    transform: none;
    max-width: none;
    justify-content: flex-start;
    order: 3;
    width: 100%;
    padding: 0;
  }
  .topbar-auth { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-primary,
  .hero-secondary {
    width: 100%;
  }
  .profile-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .grammar-group-head,
  .grammar-lesson summary,
  .listening-group-head,
  .listening-lesson summary {
    flex-direction: column;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
}
