@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;650;700&display=swap");

:root {
  --bg: #f1ece0;
  --surface: #faf7ef;
  --text: #171717;
  --muted: #777773;
  --line: #deded9;
  --line-strong: #cfcfc8;
  --green: #dff4e7;
  --green-border: #91cda8;
  --red: #ffe3e1;
  --red-border: #e9a19b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.08);
  --radius: 18px;
  --grid-size: 28px;
  --grid-major: 140px;
  --grid-minor-line: rgba(120, 98, 62, .09);
  --grid-major-line: rgba(120, 98, 62, .16);
  --cursor-glow: rgba(82, 220, 255, .16);
  --cursor-glow-strong: rgba(82, 220, 255, .08);
  --font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  margin: 0;
}

body {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% -10%, rgba(255,251,240,.7), transparent 42%),
    linear-gradient(var(--grid-major-line) 1px, transparent 1px) 0 0 / var(--grid-major) var(--grid-major),
    linear-gradient(90deg, var(--grid-major-line) 1px, transparent 1px) 0 0 / var(--grid-major) var(--grid-major),
    linear-gradient(var(--grid-minor-line) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size),
    linear-gradient(90deg, var(--grid-minor-line) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color .35s ease, color .35s ease;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(420px circle at var(--cursor-x, 50%) var(--cursor-y, 20%), var(--cursor-glow), transparent 68%),
    radial-gradient(180px circle at var(--cursor-x, 50%) var(--cursor-y, 20%), var(--cursor-glow-strong), transparent 72%);
  opacity: 0;
  transition: opacity .25s ease;
}

body.cursor-glow-visible::before { opacity: 1; }

.app-shell, .toast, dialog {
  position: relative;
  z-index: 1;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1b1b;
  --surface: #292a2a;
  --text: #f5f7f7;
  --muted: #969b9c;
  --line: #515556;
  --line-strong: #686d6e;
  --green: #1d3429;
  --green-border: #4c8a67;
  --red: #3a2424;
  --red-border: #9a5650;
  --shadow: 0 28px 80px rgba(0, 0, 0, .34);
  --grid-minor-line: rgba(190, 215, 220, .045);
  --grid-major-line: rgba(190, 215, 220, .085);
  --cursor-glow: rgba(73, 221, 255, .17);
  --cursor-glow-strong: rgba(73, 221, 255, .09);
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 50% -12%, rgba(74, 77, 77, .24), transparent 40%),
    radial-gradient(circle at 50% 42%, rgba(39, 43, 43, .34), transparent 62%),
    linear-gradient(var(--grid-major-line) 1px, transparent 1px) 0 0 / var(--grid-major) var(--grid-major),
    linear-gradient(90deg, var(--grid-major-line) 1px, transparent 1px) 0 0 / var(--grid-major) var(--grid-major),
    linear-gradient(var(--grid-minor-line) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size),
    linear-gradient(90deg, var(--grid-minor-line) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size),
    var(--bg);
}

html[data-theme="dark"] .card-face {
  background: linear-gradient(145deg, #2b2c2c 0%, #272828 100%);
  border-color: #747879;
  box-shadow: 0 24px 70px rgba(0,0,0,.32);
}

html[data-theme="dark"] .card-front {
  background: linear-gradient(145deg, #303131 0%, #282929 100%);
}

html[data-theme="dark"] .flashcard:hover .card-front {
  border-color: #858a8b;
}

html[data-theme="dark"] .dictionary-definition { color: #d0d3d3; }
html[data-theme="dark"] .dictionary-example,
html[data-theme="dark"] .dictionary-list { color: #b7bbbb; }
html[data-theme="dark"] .dictionary-section-label { color: #858a8b; }
html[data-theme="dark"] .card-shortcut { color: #858a8b; }
html[data-theme="dark"] #note-input::placeholder { color: #777c7d; }
html[data-theme="dark"] .word-dot { background: #565a5b; }
html[data-theme="dark"] .word-dot.is-current { background: #e9eeee; }
html[data-theme="dark"] .word-dot.status-red { background: #c66d66; }
html[data-theme="dark"] .word-dot.status-green { background: #6fbc8d; }
html[data-theme="dark"] kbd {
  border-color: #505556;
  background: #303131;
  color: #d7dada;
}
html[data-theme="dark"] .empty-icon { background: var(--surface); }
html[data-theme="dark"] .help-dialog { box-shadow: 0 30px 100px rgba(0,0,0,.55); }
html[data-theme="dark"] .help-dialog::backdrop { background: rgba(0,0,0,.58); }
html[data-theme="dark"] .shortcut-list > div { color: #c4c8c8; }
html[data-theme="dark"] .toast {
  background: rgba(43,44,44,.96);
  color: #dfe3e3;
  box-shadow: 0 14px 38px rgba(0,0,0,.38);
}
html[data-theme="dark"] .button-secondary,
html[data-theme="dark"] .icon-button,
html[data-theme="dark"] .nav-button,
html[data-theme="dark"] .speaker-button {
  background: rgba(255,255,255,.045);
}
html[data-theme="dark"] .button-primary { background: #f1f3f3; color: #181919; border-color: #f1f3f3; }

button, input, textarea, select { font: inherit; }
button, label { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.app-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 24px 0 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 52px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.03);
}

.brand h1 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 650;
  letter-spacing: -.01em;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

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

.theme-toggle {
  width: 68px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.theme-toggle-track {
  position: relative;
  display: block;
  width: 68px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ecece8;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #faf7ef;
  box-shadow: 0 2px 7px rgba(0,0,0,.18);
  transition: transform .28s cubic-bezier(.2,.8,.2,1), background .25s ease, box-shadow .25s ease;
}

.theme-icon {
  position: absolute;
  top: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 34px;
  height: 32px;
  color: #777a78;
  transition: color .25s ease, opacity .25s ease;
}

.theme-icon-sun { left: 0; }
.theme-icon-moon { right: 0; }

.theme-icon svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-toggle:hover .theme-toggle-track { border-color: var(--line-strong); }
.theme-toggle:focus-visible { outline: 2px solid rgba(72, 213, 247, .8); outline-offset: 4px; border-radius: 999px; }

html[data-theme="dark"] .theme-toggle-track {
  background: #111313;
  border-color: #45494a;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.02);
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(34px);
  background: #2f3232;
  box-shadow: 0 2px 8px rgba(0,0,0,.45), 0 0 14px rgba(71,214,244,.13);
}

html[data-theme="dark"] .theme-icon-sun { color: #5d6263; }
html[data-theme="dark"] .theme-icon-moon { color: #d7fbff; }

.import-button, .button-primary, .button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  user-select: none;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.button-primary {
  background: var(--text);
  color: white;
  border: 1px solid var(--text);
}

.button-secondary {
  background: rgba(250,247,239,.65);
  border: 1px solid var(--line);
}

.import-button input { display: none; }

.import-button:hover, .button-primary:hover, .button-secondary:hover,
.icon-button:hover, .nav-button:hover, .text-button:hover {
  transform: translateY(-1px);
}

.icon-button, .nav-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(250,247,239,.65);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.icon-button {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 14px;
}

.empty-state {
  min-height: calc(100vh - 120px);
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  padding: 30px 0 80px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #faf7ef;
  color: var(--muted);
  font-size: 22px;
  box-shadow: 0 8px 30px rgba(0,0,0,.04);
}

.empty-state h2 {
  max-width: 550px;
  margin: 0;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.02;
  letter-spacing: -.055em;
  font-weight: 650;
}

.empty-state p {
  max-width: 480px;
  margin: 18px 0 26px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.empty-state .empty-hint {
  margin: 18px 0 0;
  font-size: 11px;
}

.learning-view { padding-top: 48px; }

.day-toolbar {
  display: grid;
  grid-template-columns: 42px auto 42px 42px 1fr;
  align-items: center;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto 32px;
}

.nav-button {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 18px;
}

.nav-button:disabled {
  opacity: .35;
  cursor: not-allowed;
  transform: none;
}

.shuffle-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(250,247,239,.65);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.shuffle-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  color: var(--text);
}

.shuffle-button.is-active {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

html[data-theme="dark"] .shuffle-button {
  background: rgba(255,255,255,.045);
}

html[data-theme="dark"] .shuffle-button.is-active {
  background: #f1f3f3;
  border-color: #f1f3f3;
  color: #181919;
}

.day-picker-wrap {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 8px;
  justify-content: center;
  min-width: 120px;
}

.day-picker-wrap label {
  color: var(--muted);
  font-size: 11px;
}

#day-select {
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 4px 18px 4px 2px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

.day-stats {
  justify-self: end;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.dot { margin: 0 5px; }

.card-stage {
  display: grid;
  place-items: center;
  perspective: 1400px;
  touch-action: pan-y;
}

.flashcard {
  position: relative;
  width: min(680px, 88vw);
  aspect-ratio: 1.65 / 1;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  perspective: 1400px;
  user-select: none;
  outline: none;
}

.card-inner {
  position: absolute;
  inset: 0;
  display: block;
  transform-style: preserve-3d;
  transition: transform .62s cubic-bezier(.2,.75,.25,1);
}

.flashcard.is-flipped .card-inner { transform: rotateY(180deg); }

.card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  text-align: left;
}

.card-front {
  align-items: center;
  justify-content: center;
  text-align: center;
}

.card-back { transform: rotateY(180deg); }

.secondary-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.secondary-panel[hidden] {
  display: none;
}

.dictionary-panel {
  gap: 18px;
}

.dictionary-header {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 42px;
}

.dictionary-word-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dictionary-word {
  overflow-wrap: anywhere;
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1;
  letter-spacing: -.045em;
  font-weight: 650;
}

.speaker-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(250,247,239,.7);
  color: var(--muted);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, color .16s ease, background .16s ease;
}

.speaker-button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  color: var(--text);
  background: var(--surface);
}

.speaker-button:active {
  transform: translateY(0);
}

.speaker-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dictionary-pos {
  color: var(--muted);
  font-size: 11px;
  font-style: italic;
  line-height: 1.3;
}

.dictionary-definition {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 92%;
  color: #4e4d49;
  font-size: clamp(13px, 1.65vw, 16px);
  line-height: 1.55;
}

.dictionary-section-label {
  color: #9a9993;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.dictionary-example {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 92%;
  color: #5d5c57;
  font-size: clamp(12px, 1.55vw, 14px);
  line-height: 1.55;
}

.dictionary-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: auto;
  padding-top: 4px;
}

.dictionary-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: #5d5c57;
  font-size: 11px;
  line-height: 1.55;
}

.dictionary-footer {
  position: absolute;
  right: clamp(24px, 5vw, 46px);
  bottom: 22px;
  left: clamp(24px, 5vw, 46px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  pointer-events: none;
}

.flashcard.status-red .card-front {
  background: var(--red);
  border-color: var(--red-border);
}

.flashcard.status-green .card-front {
  background: var(--green);
  border-color: var(--green-border);
}

.status-badge {
  position: absolute;
  top: 18px;
  right: 20px;
  min-height: 20px;
  color: rgba(0,0,0,.48);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.word {
  max-width: 90%;
  overflow-wrap: anywhere;
  font-size: clamp(34px, 6vw, 70px);
  line-height: .98;
  letter-spacing: -.055em;
  font-weight: 600;
}

.back-label, .card-footer {
  color: var(--muted);
  font-size: 11px;
}

.back-label {
  letter-spacing: .04em;
  text-transform: uppercase;
}

.back-word {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: clamp(20px, 2.8vw, 28px);
  line-height: 1.2;
  letter-spacing: -.025em;
  font-weight: 700;
}

.card-footer {
  position: absolute;
  right: clamp(24px, 5vw, 46px);
  bottom: 22px;
  left: clamp(24px, 5vw, 46px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.card-shortcut {
  color: #aaa9a3;
  letter-spacing: .04em;
}

#note-input {
  flex: 1;
  width: 100%;
  min-height: 100px;
  margin: 18px 0 45px;
  padding: 0;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font-size: clamp(17px, 2.2vw, 22px);
  line-height: 1.55;
}

#note-input::placeholder { color: #aaa9a3; }

.word-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  max-width: 760px;
  margin: 26px auto 0;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: color .16s ease, transform .16s ease;
}

.text-button:hover { color: var(--text); }

.text-button:disabled {
  opacity: .3;
  cursor: not-allowed;
  transform: none;
}

.word-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 80px;
}

.word-dot {
  width: 4px;
  height: 4px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d0d0cb;
  cursor: pointer;
  transition: width .2s ease, background .2s ease;
}

.word-dot.is-current {
  width: 18px;
  background: #333;
}

.word-dot.status-red { background: #d96d65; }
.word-dot.status-green { background: #6db789; }

.keyboard-hint {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 25px;
  color: #999892;
  font-size: 10px;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  margin-right: 4px;
  padding: 0 4px;
  border: 1px solid #d8d8d2;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #faf7ef;
  color: #55544f;
  font-size: 9px;
  font-weight: 650;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 10;
  transform: translate(-50%, 18px);
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(250,247,239,.94);
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
  color: #4e4d49;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.help-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 100px rgba(0,0,0,.18);
}

.help-dialog::backdrop {
  background: rgba(20,20,18,.25);
  backdrop-filter: blur(5px);
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.help-dialog h2 {
  margin: 0 0 25px;
  font-size: 22px;
  letter-spacing: -.03em;
}

.shortcut-list {
  display: grid;
  gap: 10px;
}

.shortcut-list > div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #55544f;
  font-size: 12px;
}

.shortcut-list kbd {
  margin: 0;
  flex: 0 0 28px;
}

.dialog-note {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

@media (max-width: 700px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 16px;
  }

  .brand p { display: none; }

  .theme-toggle, .theme-toggle-track { width: 62px; }
  html[data-theme="dark"] .theme-toggle-thumb { transform: translateX(28px); }

  .learning-view { padding-top: 34px; }

  .day-toolbar {
    grid-template-columns: 40px 1fr 40px 40px;
    margin-bottom: 25px;
  }

  .day-stats {
    grid-column: 1 / -1;
    justify-self: center;
    margin-top: 2px;
  }

  .flashcard {
    width: 94vw;
    aspect-ratio: .92 / 1;
  }

  .card-face {
    padding: 28px;
    border-radius: 18px;
  }

  .word {
    max-width: 96%;
    font-size: clamp(36px, 12vw, 62px);
  }

  .word-navigation {
    gap: 8px;
    justify-content: space-between;
  }

  .dictionary-panel {
    gap: 14px;
  }

  .dictionary-word {
    font-size: clamp(28px, 10vw, 44px);
  }

  .dictionary-definition {
    max-width: 100%;
    font-size: 13px;
  }

  .dictionary-example {
    max-width: 100%;
    font-size: 12px;
  }

  .dictionary-lists {
    gap: 14px;
  }

  .dictionary-list {
    font-size: 10px;
  }

  .word-dots {
    max-width: 100px;
    overflow: hidden;
  }

  .keyboard-hint { display: none; }

  .empty-state {
    min-height: calc(100vh - 90px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}


/* Account and feature navigation additions; the original flashcard layout is retained. */
.site-nav { display:flex; align-items:center; gap:14px; margin-left:auto; }
.site-nav a { color:var(--muted); text-decoration:none; font-size:12px; font-weight:600; }
.site-nav a:hover { color:var(--text); }
.account-button { white-space:nowrap; max-width:180px; overflow:hidden; text-overflow:ellipsis; }
.default-note-wrap { margin:10px 0 12px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:rgba(120,120,120,.045); }
.default-note-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.04em; text-transform:uppercase; }
.default-note-text { margin:7px 0 0; color:var(--text); font-size:12px; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; }
.personal-note-label { display:block; margin:8px 0 6px; color:var(--muted); font-size:10px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; }
.small-text-button { min-height:22px; padding:0 5px; font-size:10px; }
.account-dialog { width:min(440px,calc(100% - 28px)); }
.account-intro { color:var(--muted); font-size:13px; line-height:1.6; }
.account-form { display:grid; gap:9px; margin-top:18px; }
.account-form label { font-size:12px; font-weight:600; }
.account-form input { width:100%; min-height:42px; border:1px solid var(--line-strong); border-radius:10px; background:var(--surface); color:var(--text); padding:9px 11px; }
.account-form button { margin-top:8px; min-height:42px; }
.account-error { color:#bd4139; font-size:12px; line-height:1.5; margin:3px 0; }
.account-switch { display:flex; flex-wrap:wrap; align-items:center; gap:6px; color:var(--muted); font-size:12px; margin:18px 0 0; }
.account-switch .text-button { min-height:24px; }
.account-dialog #sign-out-button { margin-top:14px; }
.account-dialog .text-button { border:0; background:transparent; color:var(--text); font-weight:650; cursor:pointer; }
html[data-theme="dark"] .account-form input { border-color:var(--line-strong); }
.feature-page { max-width:900px; margin:50px auto 0; }
.feature-header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:24px; }
.feature-header h2 { margin:0; font-size:clamp(28px,4vw,42px); letter-spacing:-.045em; }
.feature-header p { color:var(--muted); font-size:13px; line-height:1.6; }
.feature-card { border:1px solid var(--line); background:var(--surface); border-radius:16px; padding:18px; margin:12px 0; }
.feature-word { font-size:21px; font-weight:700; letter-spacing:-.025em; }
.feature-muted { color:var(--muted); font-size:12px; line-height:1.6; }
.feature-actions { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:16px; }
.feature-actions button, .feature-actions a { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:0 13px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--text); text-decoration:none; font-size:12px; font-weight:600; cursor:pointer; }
.feature-actions .button-primary { background:var(--text); color:var(--bg); border-color:var(--text); }
.feature-empty { border:1px dashed var(--line-strong); border-radius:16px; padding:38px 18px; text-align:center; color:var(--muted); }
.feature-empty h3 { color:var(--text); margin:0 0 8px; }
.stat-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.stat-card { padding:16px; border:1px solid var(--line); background:var(--surface); border-radius:14px; }
.stat-card span { display:block; color:var(--muted); font-size:12px; }
.stat-card strong { display:block; margin-top:10px; font-size:28px; letter-spacing:-.04em; }
.progress-track { height:8px; background:var(--line); border-radius:99px; overflow:hidden; margin:10px 0; }
.progress-fill { height:100%; background:#39815d; border-radius:99px; }
.game-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:20px; }
.game-option { min-height:52px; padding:12px; text-align:left; border:1px solid var(--line); border-radius:12px; background:var(--surface); color:var(--text); cursor:pointer; }
.game-option:hover:not(:disabled) { border-color:var(--line-strong); transform:translateY(-1px); }
.game-option:disabled { cursor:default; opacity:.8; }
.game-option.is-correct { border-color:var(--green-border); background:var(--green); }
.game-option.is-wrong { border-color:var(--red-border); background:var(--red); }
@media (max-width:760px) {
  .topbar { flex-wrap:wrap; gap:12px; }
  .site-nav { order:3; width:100%; justify-content:space-between; margin:0; padding:5px 0; }
  .top-actions { margin-left:auto; }
  .account-button { max-width:110px; }
  .stat-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:480px) {
  .site-nav { gap:8px; }
  .site-nav a { font-size:11px; }
  .feature-page { margin-top:30px; }
  .game-options { grid-template-columns:1fr; }
  .feature-header { flex-direction:column; }
}

.account-dialog [hidden] { display: none !important; }