/* === Link resets === */
.etym-chip, .etym-ref, .az-bar-letter { text-decoration: none; }

/* === Hero heading emphasis === */
.hero-heading b { font-weight: 700; }
.hero-heading-accent { color: var(--accent); font-weight: 400; }

/* === Study session extras === */
.knew-count { font-weight: 700; color: var(--ink); margin-left: 3px; }
/* results-list kept for legacy; new results use .results-nope-list */

/* === Account extras === */
.info-row-top { border-bottom: 1px solid var(--line-2); }
.btn-self-start { align-self: flex-start; }
.btn-logout { align-self: flex-start; color: var(--muted); }

/* === Progress fill (initial state; JS updates width) === */
#progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width 300ms ease; }

/* === Page layouts === */
.page-content { padding: 30px; display: flex; flex-direction: column; gap: 30px; }
.page-content-sm { padding: 30px; display: flex; flex-direction: column; gap: 12px; }
.page-content .ad-banner,
.page-content #ad-banner-bottom { margin: 0; }
.page-content-sm .ad-banner,
.page-content-sm #ad-banner-bottom { margin: 0; margin-top: 18px; }

/* === Hero carousel === */
.hero { border-radius: var(--r-xl); border: 1px solid var(--line); overflow: hidden; position:relative; background: linear-gradient(115deg, var(--paper) 0%, var(--paper) 58%, var(--accent-soft) 130%); }
/* Grid stack: all slides same cell = same height always */
.hero-slides { display: grid; }
.hero-slide { grid-area: 1/1; visibility: hidden; display: flex; flex-direction: column; padding: 28px 28px 14px; position: relative; overflow: hidden; }
.hero-slide-active { visibility: visible; }
.hero-slide-inner { /* transparent — .hero provides the background */ }
.hero-slide-ad { /* transparent — .hero provides the background */ }
.hero-dots { display: flex; justify-content: center; gap: 6px; padding: 8px 0 16px; }
.hero-watermark { position: absolute; right: -10px; top: -90px; font-size: 280px; line-height: 1; color: var(--accent); opacity: .06; pointer-events: none; font-family: var(--serif); font-style: italic; }
.hero-watermark-sm { position: absolute; right: -10px; top: -60px; font-size: 220px; line-height: 1; color: var(--accent); opacity: .05; pointer-events: none; font-family: var(--serif); font-style: italic; }
.hero-inner { position: relative; z-index: 1; }
.hero-ad-inner { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.hero-brand { display: inline-flex; margin-bottom: 16px; text-decoration: none; font-size: 1.3rem; letter-spacing: -0.02em; }
.hero-date { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .08em; margin-bottom: 10px; }
.hero-heading { margin: 0 0 20px; font-size: 26px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.3; }
.hero-vs-row { display: flex; align-items: center; justify-content: center; gap: 14px; }
.hero-btn-amgi { text-decoration: none; padding: 10px 26px; border-radius: 12px; border: 1.5px solid var(--line); color: var(--ink-2); font-size: 20px; font-weight: 700; background: var(--paper); }
.hero-btn-ihae { text-decoration: none; padding: 10px 26px; border-radius: 12px; border: 1.5px solid var(--accent); color: var(--accent); font-size: 20px; font-weight: 700; background: var(--paper); }
.hero-vs-badge { width: 36px; height: 36px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-style: italic; font-size: 14px; }
.hero-ad-label { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .08em; }
.hero-ad-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); line-height: 1.25; }
.hero-ad-desc { font-size: 14px; line-height: 1.5; margin: 0; color: var(--muted); }
.hero-ad-cta-btn { display: inline-block; background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; padding: 10px 26px; border-radius: 999px; text-decoration: none; border: 1.5px solid var(--accent); transition: background 120ms ease, border-color 120ms ease, transform 120ms ease; align-self: center; margin-top: auto; }
.hero-check-heading { margin: 0 0 20px; font-size: 24px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.3; color: var(--ink); }
.hero-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.hero-checklist li { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--ink); line-height: 1.4; }
.hero-checklist li::before { content: '✓'; flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 700; line-height: 22px; text-align: center; display: inline-block; }
.hero-dot { height: 7px; border-radius: 999px; cursor: pointer; transition: width 200ms ease, background 200ms ease; }

/* === Quick links === */
.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quick-link { display: flex; align-items: center; justify-content: center; gap: 9px; text-decoration: none; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); border-radius: 16px; padding: 22px 16px; font-size: 17px; font-weight: 600; }
.quick-link-full { grid-column: 1 / -1; }
.quick-link-disabled { color: var(--muted-2); opacity: .5; }

/* === Today's word card === */
.today-word { text-decoration: none; }
.today-word-card { padding: 32px; background: linear-gradient(155deg, var(--accent) 0%, var(--accent-ink) 100%); color: #fff; border-color: transparent; box-shadow: var(--shadow-md); }
.today-word-label { font-family: var(--mono); font-size: 11px; opacity: .75; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 14px; }
.today-word-term { font-size: 40px; font-weight: 500; letter-spacing: -0.02em; line-height: 1; margin-bottom: 8px; }
.today-word-dot { font-family: var(--serif); color: rgba(255,255,255,.65); }
.today-word-pron { font-family: var(--mono); font-size: 12px; opacity: .65; margin-bottom: 12px; }
.today-word-meaning { font-size: 15px; line-height: 1.5; opacity: .95; }
.today-word-desc { font-size: 14px; line-height: 1.5; opacity: .75; margin-top: 10px; }

/* === Word detail page === */
/* === List button + popup === */
.list-btn-wrap { position: relative; }
.list-btn { cursor: pointer; }
.list-popup {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 10px;
  z-index: 300;
}
.list-popup-header { font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; padding: 4px 6px 8px; }
.list-popup-loading { font-size: 13px; color: var(--muted); padding: 8px 6px; }
.gate-msg { font-size: 13px; line-height: 1.5; padding: 8px 6px; margin: 0; color: var(--ink); }
.gate-msg a { color: var(--accent); }
.list-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: var(--r-sm); cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.list-item:hover { background: var(--line-2); }
.list-item input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); flex-shrink: 0; }
.list-divider { height: 1px; background: var(--line-2); margin: 6px 0; }
.new-list-row { display: flex; gap: 6px; padding: 2px 0 2px; }
.new-list-input { flex: 1; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 10px; font-size: 13px; font-family: inherit; background: var(--paper); color: var(--ink); outline: none; }
.new-list-input:focus { border-color: var(--accent); }
.new-list-btn { appearance: none; border: none; background: var(--accent); color: #fff; border-radius: var(--r-sm); padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.new-list-btn:hover { background: var(--accent-ink); }
.new-list-btn:disabled { opacity: .5; cursor: default; }

.word-nav-row { display: flex; align-items: center; justify-content: space-between; }
.word-back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); text-decoration: none; font-weight: 500; }
.word-back-link:hover { color: var(--ink); }
.word-header-card { padding: 24px 22px; }
.word-title-row { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.word-title { margin: 0; font-size: clamp(32px, 10vw, 52px); font-weight: 700; letter-spacing: -0.03em; line-height: 1; word-break: break-word; color: var(--accent); flex: 1; min-width: 0; }
.word-audio-btn { flex-shrink: 0; width: 44px; height: 44px; border-radius: var(--r-md); border: none; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background 120ms ease; }
.word-audio-btn:hover { background: var(--line); }
.word-pron { font-family: var(--mono); font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.word-meaning { font-size: 17px; line-height: 1.6; color: var(--ink); margin-bottom: 14px; }
.word-pos-tag { display: inline-flex; align-items: center; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--accent-ink); background: var(--accent-soft); border-radius: 8px; padding: 3px 10px; }
.etym-card { padding: 18px 22px; }
.etym-notes { font-size: 13px; color: var(--muted); margin: 0 0 12px; line-height: 1.5; }
.etym-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.etym-desc-divider { border: none; border-top: 1px solid var(--line-2); margin: 0; }
.desc-card { padding: 20px 22px; line-height: 1.7; }
.desc-card img { width: 100% !important; display: block !important; box-shadow: none !important; margin-left: 0 !important; margin-right: 0 !important; margin-bottom: 0 !important; border-radius: var(--r-md); }
.youtube-card { padding: 0; overflow: hidden; border-radius: var(--r-lg); }
.youtube-wrap { position: relative; padding-bottom: 56.25%; height: 0; }
.youtube-wrap iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.related-card { padding: 18px 22px; }
.section-label { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.related-heading { font-size: 18px; font-weight: 700; color: var(--ink); margin: 0 0 14px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* === Morpheme pages === */
.morpheme-header-card { padding: 24px 22px; }
.morpheme-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.morpheme-title { margin: 0; font-size: clamp(28px, 8vw, 44px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--accent); }
.morpheme-title-suffix { font-family: var(--sans); font-style: normal; color: var(--ink); font-size: 18px; font-weight: 600; letter-spacing: -0.01em; align-self: flex-end; padding-bottom: 6px; flex-shrink: 0; }
.morpheme-image { width: 100%; border-radius: var(--r-md); }
.morpheme-notes { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }

/* === Dictionary/search page === */
.dict-eyebrow { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }
.dict-heading { margin: 0 0 16px; font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }

/* === Search autocomplete dropdown === */
.search-suggest-dropdown {
  position: absolute;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  list-style: none;
  margin: 0; padding: 4px;
  z-index: 1000;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}
.search-suggest-dropdown li {
  padding: 9px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
}
.search-suggest-dropdown li:hover,
.search-suggest-dropdown li.active { background: var(--line-2); color: var(--ink); }
.results-label { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 12px; }
.results-card { overflow: hidden; }
.result-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; text-decoration: none; color: inherit; }
.result-row + .result-row { border-top: 1px solid var(--line-2); }
.result-word { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.result-meaning { font-family: inherit; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-arrow { flex-shrink: 0; color: var(--muted); }

/* === Letter page === */
.letter-heading-row { display: flex; align-items: baseline; gap: 12px; }
.letter-char { font-family: var(--serif); font-size: clamp(36px, 8vw, 52px); color: var(--accent); line-height: 1; font-style: italic; }
.letter-sub { font-size: 13px; color: var(--muted); }
.letter-count { margin-left: auto; font-size: 13px; color: var(--muted); font-weight: 600; }

.word-list { display: flex; flex-direction: column; gap: 8px; }
.word-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
}
.word-card:hover { border-color: var(--accent); }
.word-card-top { display: flex; align-items: center; gap: 10px; }
.word-card-word { font-weight: 700; font-size: 15px; color: var(--ink); flex: 1; min-width: 0; }
.word-card-audio {
  flex-shrink: 0;
  background: var(--accent-soft);
  border: none;
  border-radius: var(--r-md);
  padding: 7px;
  display: inline-flex;
  align-items: center;
  color: var(--accent-ink);
  cursor: pointer;
  transition: background 120ms ease;
}
.word-card-audio:hover { background: var(--line); }
.word-card-meaning { font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.pos-inline {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: text-bottom;
}

.load-sentinel { width: 100%; height: 40px; display: flex; justify-content: center; align-items: center; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 600ms linear infinite; display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Study session === */
.study-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 10; }
.study-bar-exit { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); text-decoration: none; flex-shrink: 0; white-space: nowrap; }
.study-bar-center { flex: 1; min-width: 0; text-align: center; }
.study-bar-title-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 4px; }
.study-bar-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.study-bar-counter { font-size: 12px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.study-bar-prog { height: 4px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.study-bar-knew { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); flex-shrink: 0; white-space: nowrap; }
.study-page { padding: 16px; display: flex; flex-direction: column; gap: 16px; min-height: calc(100vh - 57px); }
.flashcard { min-height: 300px; border-radius: var(--r-xl); box-shadow: var(--shadow-lg); padding: 32px 28px; display: flex; flex-direction: column; cursor: pointer; margin-bottom: 16px; }
.flashcard-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.flashcard-hint { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.flashcard-front { display: flex; flex-direction: column; flex: 1; justify-content: center; align-items: center; text-align: center; padding-bottom: 40px; }
.flashcard-term { font-size: clamp(36px, 10vw, 56px); font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-bottom: 16px; word-break: break-word; }
.fc-pos-badge { font-family: var(--mono); font-size: 12px; font-weight: 600; background: var(--line-2); color: var(--ink-2); border-radius: 8px; padding: 3px 10px; }
.fc-audio-btn { appearance: none; border: none; background: transparent; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; padding: 0; margin-top: 4px; }
.flashcard-spacer { flex: 1; }
.flashcard-example { font-size: 16px; color: var(--muted); line-height: 1.5; font-style: italic; font-family: var(--serif); }
.flashcard-back { flex-direction: column; flex: 1; justify-content: center; align-items: center; text-align: center; }
.flashcard-back-label { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.flashcard-meaning { font-size: 28px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 20px; color: var(--accent-ink); }
.flashcard-divider { margin-bottom: 16px; }
.flashcard-example-label { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }
.flashcard-example-back { font-size: 16px; line-height: 1.5; }
.study-actions { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.study-btn-nope { min-width: 130px; justify-content: center; border-color: var(--bad); color: var(--bad); }
.study-btn-knew { min-width: 130px; justify-content: center; }
.study-btn-nav { min-width: 72px; justify-content: center; }
.study-kbd { text-align: center; font-size: 12px; color: var(--muted-2); display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.study-kbd-sep { color: var(--line); }
.study-empty { text-align: center; padding: 60px 0; color: var(--muted); }
.study-empty p { margin-bottom: 16px; }
/* Results screen */
.study-results { }
.results-header { padding: 32px 20px 20px; text-align: center; }
.results-breadcrumb { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 16px; }
.results-heading { font-size: 38px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; margin: 0 0 12px; }
.results-heading-dot { color: var(--accent); }
.results-sub { font-size: 15px; color: var(--muted); margin: 0; }
.results-stats-card { display: flex; align-items: center; padding: 24px; gap: 0; }
.results-ring-wrap { position: relative; width: 96px; height: 96px; flex-shrink: 0; margin-right: 20px; }
.results-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.results-ring-bg { fill: none; stroke: var(--line-2); stroke-width: 10; }
.results-ring-fill { fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 301.6; stroke-dashoffset: 301.6; transition: stroke-dashoffset 700ms ease; }
.results-ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.results-pct { font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1; }
.results-pct-unit { font-size: 11px; color: var(--muted); margin-top: 1px; }
.results-stat { flex: 1; text-align: center; }
.results-stat-num { font-size: 34px; font-weight: 700; line-height: 1; }
.results-stat-denom { font-size: 17px; color: var(--muted); font-weight: 400; }
.results-stat-num--knew { color: var(--accent); }
.results-stat-num--nope { color: #c04030; }
.results-stat-label { font-size: 12px; color: var(--muted); margin-top: 5px; }
.results-stat-divider { width: 1px; height: 44px; background: var(--line); flex-shrink: 0; }
.results-review-card { padding: 20px 20px 16px; }
.results-review-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.results-review-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.results-review-count { color: var(--accent); }
.results-retry-btn { font-size: 13px; padding: 7px 13px; display: inline-flex; align-items: center; gap: 5px; }
.results-nope-list { display: flex; flex-direction: column; gap: 8px; }
.results-nope-row { display: flex; align-items: center; gap: 16px; padding: 13px 16px; border: 1px solid var(--line); border-radius: var(--r-md); }
.results-nope-term { font-size: 15px; font-weight: 600; color: var(--ink); flex-shrink: 0; min-width: 90px; }
.results-nope-meaning { font-size: 13px; color: var(--muted); }
.results-actions { display: flex; gap: 10px; justify-content: center; padding: 8px 0 16px; flex-wrap: wrap; }

/* === Account page === */
.account-page { padding: 16px 16px 40px; display: flex; flex-direction: column; gap: 14px; }
.account-header { /* container */ }
.account-eyebrow { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }
.account-heading { margin: 0 0 4px; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.account-sub { margin: 0; font-size: 14px; color: var(--muted); }
.info-card { padding: 20px 22px; }
.info-card-label { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.info-rows { /* container */ }
.info-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.info-row + .info-row { border-top: 1px solid var(--line-2); }
.info-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--line-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.info-field-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.info-field-value { font-size: 14px; font-weight: 500; }
.form-card { padding: 20px 22px; }
.form-card-label { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.form-flash { font-size: 13px; margin: 0 0 12px; }
.form-flash-error { color: var(--bad); }
.form-flash-success { color: var(--accent); }
.form-row-inline { display: flex; gap: 10px; align-items: flex-end; }
.form-row-inline > :first-child { flex: 1; }
.form-stack { display: flex; flex-direction: column; gap: 12px; }
.form-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

/* === Auth pages === */
.auth-heading { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.auth-card { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.auth-card form { display: flex; flex-direction: column; gap: 16px; }
.auth-submit { width: 100%; justify-content: center; margin-top: 4px; }
.auth-links { text-align: center; font-size: 14px; color: var(--muted); }
.auth-links a { color: var(--muted); text-decoration: none; }
.auth-links a:hover { color: var(--ink); }
.auth-error { font-size: 14px; color: var(--bad); margin: 0; }
.auth-success { font-size: 14px; color: var(--accent); margin: 0; }
.auth-hint { font-size: 12px; color: var(--muted); margin: 0; }
.input-with-hint { display: flex; flex-direction: column; gap: 6px; }
.field-group { display: flex; flex-direction: column; gap: 4px; }
.field-error { font-size: 13px; color: var(--bad); min-height: 0; }
.field-error:empty { display: none; }
.input.input-error { border-color: var(--bad); }

/* === Nav divider === */
.nav-sep { width: 1px; height: 16px; background: var(--line); }

/* === Ad banners (non-hero) === */
.ad-wrap { margin: 0 16px; }
.ad-slide { display: none; }
.ad-slide.active { display: flex; flex-direction: column; flex: 1; }
.ad-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 0 24px 16px; margin-top: auto; }
.ad-heading { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); line-height: 1.2; }
.ad-body { font-size: 13px; line-height: 1.4; max-width: 480px; color: var(--muted); }
.ad-footer { position: relative; min-height: 72px; padding: 12px 16px; }
.ad-banner { margin: 16px 16px 0; border: 1px solid var(--line); position: relative; background: var(--paper); border-radius: var(--r-xl); overflow: hidden; animation: adIn 300ms ease both; display: flex; flex-direction: column; aspect-ratio: 16/9; }
.ad-banner[data-link]:not([data-link=""]) { cursor: pointer; }
.ad-cta { display: inline-block; border: none; background: var(--accent); color: #fff; font-size: 13px; font-weight: 600; padding: 8px 22px; border-radius: 999px; text-decoration: none; transition: background 120ms ease, transform 120ms ease; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); white-space: nowrap; }
/* === Ad banner overrides === */
#ad-banner-top { margin-top: 0; }

#splash { position:fixed; inset:0; z-index:9999; background:var(--paper); display:flex; align-items:center; justify-content:center; transition:opacity 0.8s ease; }
#splash img { height:20vh; width:auto; }

/* === Wordlist detail page === */
.wl-detail-breadcrumb { font-size:13px; color:var(--muted); margin-bottom:6px; }
.wl-detail-header-row { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.wl-detail-title { margin:0; font-size:clamp(22px,6vw,32px); font-weight:700; letter-spacing:-0.02em; flex:1; }
.wl-detail-actions { display:flex; gap:10px; flex-shrink:0; padding-top:4px; }
.wl-detail-list { padding:0; overflow:hidden; }
.wl-detail-divider { border:none; border-top:1px solid var(--line-2); margin:0; }
.wl-detail-word-row { display:block; padding:20px 24px; text-decoration:none; color:inherit; transition:background 100ms; }
.wl-detail-word-row:hover { background:var(--paper-2); }
.wl-detail-word { font-size:18px; font-weight:700; color:var(--ink); margin-bottom:4px; }
.wl-detail-pron { font-size:13px; color:var(--muted); margin-bottom:6px; }
.wl-detail-meaning { font-size:14px; color:var(--ink-2); line-height:1.7; }

/* === Carousel arrows === */
.carousel-arrow { position:absolute; top:50%; transform:translateY(-50%); background:transparent; border:none; border-radius:50%; width:32px; height:32px; display:flex; align-items:center; justify-content:center; font-size:30px; color:var(--ink); cursor:pointer; z-index:2; animation:arrow-float 1.8s ease-in-out infinite; padding:0; line-height:1; opacity:0.1; }
.carousel-arrow:hover { opacity:0.5; color:var(--accent); background:transparent; }
.carousel-arrow-prev { left:8px; animation-delay:0s; }
.carousel-arrow-next { right:8px; animation-delay:0.9s; }
.hero-carousel-arrow { top: 70%; width: 60px; height: 60px; }
@keyframes arrow-float { 0%,100% { transform:translateY(-50%); } 50% { transform:translateY(calc(-50% - 4px)); } }

/* === Nav component === */
.nav-controls { display: flex; align-items: center; gap: 6px; position: relative; }
.nav-drop { position: absolute; top: calc(100% + 12px); right: 0; z-index: 50; width: 220px; padding: 8px; box-shadow: var(--shadow-lg); }
.nav-divider { margin: 6px 4px; }
.nav-menu.nav-menu-active { color: var(--accent); }
.nav-btn-dim { opacity: .35; }

/* === Search bar === */
.search-bar { position: relative; margin-bottom: 0; }
.search-bar-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; z-index: 1; }
.search-bar-input { padding-left: 40px; }

/* === Flashcard display states === */
.flashcard-front { display: flex; }
.flashcard-front.hidden { display: none; }
.flashcard-back { display: flex; }
.flashcard-back.hidden { display: none; }

/* === Study results === */
.study-page-flush { min-height: 0; }
.results-stack { display: flex; flex-direction: column; gap: 16px; }
.results-score-card { display: flex; align-items: center; padding: 24px; gap: 0; }
.results-ring-wrap { position: relative; width: 96px; height: 96px; flex-shrink: 0; margin-right: 20px; }
.results-ring-svg { transform: rotate(-90deg); }
.results-ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.results-pct-num { font-size: 20px; font-weight: 700; color: var(--ink); line-height: 1; }
.results-pct-unit { font-size: 11px; color: var(--muted); margin-top: 1px; }
.results-score-col { flex: 1; text-align: center; }
.results-score-num { font-size: 34px; font-weight: 700; line-height: 1; color: var(--accent); }
.results-score-num-fail { font-size: 34px; font-weight: 700; line-height: 1; color: #c04030; }
.results-score-denom { font-size: 17px; color: var(--muted); font-weight: 400; }
.results-score-label { font-size: 12px; color: var(--muted); margin-top: 5px; }
.results-vdivider { width: 1px; height: 44px; background: var(--line); flex-shrink: 0; }
.results-review-card-pad { padding: 20px 20px 16px; }
.results-review-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.results-review-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.results-review-count { color: var(--accent); }
.btn-retry { font-size: 13px; padding: 7px 13px; display: inline-flex; align-items: center; gap: 5px; }
.results-nope-list { display: flex; flex-direction: column; gap: 8px; }
.results-actions { display: flex; gap: 10px; justify-content: center; padding: 4px 0 8px; flex-wrap: wrap; }
.results-nope-row { display: flex; align-items: center; gap: 16px; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-2); }
.results-nope-term { font-size: 15px; font-weight: 600; color: var(--ink); flex-shrink: 0; min-width: 90px; }
.results-nope-meaning { font-size: 13px; color: var(--muted); }

/* === Wordbook === */
.wb-mine-card { text-decoration: none; color: inherit; }
.wb-loading { color: #aaa; font-size: 13px; padding: 16px 0; }
.wb-error { color: #e74c3c; font-size: 13px; }
.wb-empty { color: #aaa; font-size: 13px; }

/* === Wordlist detail === */
.wl-empty-msg { color: var(--muted); font-size: 14px; padding: 20px 0; text-align: center; }

/* === Pages component classes === */
.hero-search { padding: 44px 28px 40px; }
.hero-accent-span { color: var(--accent); }
.search-no-results { color: var(--muted); font-size: 14px; padding: 20px 0; }
.search-result-flex { flex: 1; min-width: 0; }
.search-result-title { flex: 1; font-weight: 600; font-size: 15px; }
.contact-form { padding: 26px 24px; display: flex; flex-direction: column; gap: 18px; width: 100%; }
.contact-max { max-width: 560px; }
.contact-head { margin-bottom: 26px; }
.contact-meta-center { justify-content: center; }
.contact-textarea { resize: vertical; min-height: 130px; line-height: 1.5; font-family: inherit; }
.contact-banner { padding: 14px 18px; border-radius: var(--r-lg); font-size: 14px; margin-bottom: 20px; }
.contact-banner-ok { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid var(--accent); }
.contact-banner-err { background: #fdecea; color: #7a1e1e; border: 1px solid #e57373; }
.guide-steps { display: flex; flex-direction: column; gap: 14px; margin-bottom: 34px; }
.guide-step-text { min-width: 0; }
.guide-cta-row { display: flex; gap: 16px; justify-content: center; align-items: flex-end; flex-wrap: wrap; }
.guide-book-note-link { color: var(--accent); font-weight: 600; text-decoration: none; }
.guide-book-note-link:hover { text-decoration: underline; }
.business-section { margin-top: 34px; }
.business-section-title { margin: 0 0 12px; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.business-section-body { margin: 0 0 16px; font-size: 14.5px; line-height: 1.72; color: var(--ink-2); }
.business-email { color: var(--accent-ink); font-weight: 500; }
.chip-sm { font-size: 11px; }
.legal-body-gap { gap: 28px; }
.legal-contact-link { font-weight: 500; }
.refund-list-col { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.idiom-meaning { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; line-height: 1.3; }
.idiom-divider { margin: 14px 0; }
.morpheme-image-bottom { margin-bottom: 12px; }
.morpheme-image-flush { margin-bottom: 0; }

/* === Toast notifications === */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: var(--ink);
    color: var(--bg);
    padding: 10px 18px;
    border-radius: var(--r-md);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    white-space: nowrap;
    z-index: 999;
}
.toast.toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
