/* LEXI — calm, editorial learning workspace */
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/SourceSans3VF-Upright.ttf.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --card: #ffffff;
  --card-soft: #fafbfc;
  --ink: #17191f;
  --muted: #777e89;
  --line: #e7e9ed;
  --blue: #2864dc;
  --blue-dark: #1f50b5;
  --soft: #edf3ff;
  --green: #edf7f0;
  --red: #c64e53;
  --shadow: 0 12px 34px rgba(25, 35, 52, .045), 0 1px 2px rgba(25, 35, 52, .035);
  --shadow-hover: 0 18px 42px rgba(25, 35, 52, .075), 0 2px 5px rgba(25, 35, 52, .04);
  --radius: 20px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background .22s ease, color .22s ease;
}
body.dark {
  color-scheme: dark;
  --bg: #0c0d10;
  --card: #15171b;
  --card-soft: #191b20;
  --ink: #f3f2f6;
  --muted: #92939d;
  --line: #292b32;
  --blue: #b49af4;
  --blue-dark: #c5b3fb;
  --soft: #282331;
  --green: #1d3028;
  --red: #f08b91;
  --shadow: 0 14px 38px rgba(0, 0, 0, .18), 0 1px 2px rgba(0, 0, 0, .2);
  --shadow-hover: 0 20px 46px rgba(0, 0, 0, .32), 0 2px 5px rgba(0, 0, 0, .2);
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
::selection { background: rgba(75, 122, 221, .18); }

/* Top bar */
.top {
  position: sticky;
  z-index: 20;
  top: 0;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 5vw, 76px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 91%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}
.brand {
  color: var(--ink);
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -1.1px;
  line-height: 1;
  text-decoration: none;
}
.brand span { color: var(--blue); }
.top-actions { display: flex; align-items: center; gap: 16px; }
.demo, .pill {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 10px;
  border: 1px solid color-mix(in srgb, var(--blue) 12%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 8%, var(--card));
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .45px;
}

/* Main application frame and navigation */
.shell {
  width: min(100%, 1580px);
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: clamp(34px, 4.2vw, 68px);
  margin: 0 auto;
  padding: 42px clamp(24px, 4vw, 64px) 54px;
}
.nav {
  position: sticky;
  top: 96px;
  align-self: start;
  height: calc(100vh - 125px);
  min-height: 510px;
  display: flex;
  flex-direction: column;
  padding: 6px 0 0;
}
.navlabel, .eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .42px;
  line-height: 1.3;
  text-transform: uppercase;
}
.navlabel { padding: 10px 14px 18px; }
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 43px;
  margin: 2px 0;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.nav a.active {
  border-color: var(--line);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(20, 30, 50, .025);
}
.nav a:hover:not(.active) {
  background: color-mix(in srgb, var(--card) 68%, transparent);
  color: var(--ink);
}
.nav i {
  display: inline-flex;
  width: 28px;
  flex: 0 0 28px;
  align-items: center;
  color: #9097a3;
  font-size: 17px;
  font-style: normal;
  font-weight: 400;
}
.nav a.active i { color: var(--blue); }
.navfoot {
  margin-top: auto;
  padding: 16px 13px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.navfoot b { color: var(--ink); font-weight: 600; }
.content { min-width: 0; }

/* Page introductions */
.welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 5px 0 32px;
}
.welcome h1 {
  margin: 7px 0 3px;
  color: var(--ink);
  font-size: clamp(30px, 3vw, 39px);
  font-weight: 650;
  letter-spacing: -1.15px;
  line-height: 1.12;
}
.welcome p, .panel p { color: var(--muted); }
.welcome p { margin: 8px 0 0; font-size: 15px; }

/* Buttons and common surfaces */
.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 41px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 11px color-mix(in srgb, var(--blue) 19%, transparent);
}
.primary:hover { transform: translateY(-1px); background: var(--blue-dark); }
body.dark .primary { color: #17131f; box-shadow: 0 4px 14px rgba(180, 154, 244, .13); }
.secondary {
  border-color: var(--line);
  background: var(--card);
  color: var(--ink);
}
.secondary:hover { border-color: color-mix(in srgb, var(--blue) 36%, var(--line)); background: var(--card-soft); }
.quiet {
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.quiet:hover { background: color-mix(in srgb, var(--card) 75%, transparent); color: var(--ink); }
.danger:hover { color: var(--red); }
.linkbtn { display: inline-flex; }
.panel {
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

/* Overview and statistics */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.stats article {
  min-width: 0;
  padding: 21px 22px 19px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.stats article:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.stats span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
}
.stats strong {
  display: block;
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 35px;
  font-weight: 650;
  letter-spacing: -1.1px;
  line-height: 1.12;
}
.stats small, .wordrow span, .collection-word span { color: var(--muted); }
.stats small { display: block; margin-top: 6px; font-size: 12px; }
.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(270px, 1fr);
  gap: 16px;
}
.grid .panel h2 { margin: 9px 0 10px; font-size: 20px; font-weight: 650; letter-spacing: -.35px; }
.bars {
  height: 155px;
  display: flex;
  align-items: end;
  gap: 14px;
  padding: 13px 6px 4px;
  margin-top: 12px;
}
.bars div {
  height: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  gap: 9px;
}
.bars i {
  width: min(38px, 76%);
  min-height: 5px;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #c2d8f8 0%, #9dbde9 100%);
}
.bars div:nth-child(3) i { background: linear-gradient(180deg, #6797e7 0%, #3474d5 100%); }
.bars small { color: var(--muted); font-size: 11px; }
body.dark .bars i { background: linear-gradient(180deg, #51456b, #30283f); }
body.dark .bars div:nth-child(3) i { background: linear-gradient(180deg, #c4adff, #8c70d4); }
.wordrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 2px;
  border-top: 1px solid var(--line);
}

/* Forms, inputs and feedback */
.formpanel { max-width: 790px; }
.formpanel form, .authcard form { display: grid; gap: 14px; }
label {
  display: grid;
  gap: 7px;
  margin: 12px 0;
  color: var(--muted);
  font-size: 13px;
}
input, textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: var(--card-soft);
  color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: color-mix(in srgb, var(--blue) 65%, var(--line));
  background: var(--card);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 12%, transparent);
}
textarea { resize: vertical; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.inline { display: inline; }
.success, .toast {
  margin: 12px 0;
  padding: 12px 15px;
  border: 1px solid color-mix(in srgb, #4d9b70 16%, transparent);
  border-radius: 11px;
  background: var(--green);
  color: var(--ink);
}
.error { border-color: color-mix(in srgb, var(--red) 18%, transparent); background: color-mix(in srgb, var(--red) 9%, var(--card)); color: var(--red); }
.muted { color: var(--muted); }

/* Sign-in */
.auth {
  width: min(1120px, calc(100% - 40px));
  min-height: calc(100vh - 68px);
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: clamp(35px, 7vw, 90px);
  margin: 0 auto;
  padding: 48px 20px;
}
.hero h1 {
  margin: 17px 0;
  font-size: clamp(48px, 6vw, 70px);
  font-weight: 650;
  letter-spacing: -3.2px;
  line-height: .99;
}
.hero em { color: var(--blue); font-style: normal; }
.hero p { max-width: 410px; color: var(--muted); font-size: 17px; }
.authcard { padding: 34px; }
.authcard h2 { margin: 0 0 8px; font-size: 24px; font-weight: 650; letter-spacing: -.5px; }
.authcard form { margin: 18px 0; }
.authcard details { padding: 13px 0; border-top: 1px solid var(--line); color: var(--muted); }
.authcard summary { cursor: pointer; color: var(--ink); }

/* Collections */
.collections-page { display: grid; gap: 22px; }
.collections-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 31px 33px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(115deg, var(--card) 0%, var(--card-soft) 100%);
  box-shadow: var(--shadow);
}
.collections-hero h2 { margin: 8px 0 5px; font-size: 29px; font-weight: 650; letter-spacing: -.8px; }
.collections-hero p { margin: 0; color: var(--muted); }
.create-collection span { margin-left: 8px; font-size: 19px; line-height: 0; }
.collection-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.collection-search { display: flex; align-items: center; gap: 8px; }
.search-field { position: relative; margin: 0; }
.search-field span { position: absolute; top: 8px; left: 13px; color: var(--muted); font-size: 21px; }
.search-field input { width: 300px; padding-left: 37px; background: var(--card); }
.quiet-link { padding: 8px; color: var(--muted); text-decoration: none; }
.collection-total { color: var(--muted); font-size: 13px; }
.collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.collection-card {
  min-height: 183px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.collection-card:hover, .collection-card.is-open { transform: translateY(-2px); border-color: color-mix(in srgb, var(--blue) 28%, var(--line)); box-shadow: var(--shadow-hover); }
.collection-card-main {
  flex: 1;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: start;
  gap: 11px;
  padding: 19px;
  color: var(--ink);
  text-decoration: none;
}
.collection-card-icon {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--soft);
  color: var(--blue);
  font-size: 17px;
}
.collection-card h3 { margin: 0 0 4px; font-size: 16px; font-weight: 650; letter-spacing: -.15px; }
.collection-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.word-count { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.word-count small { display: block; color: var(--muted); font-size: 10px; font-weight: 600; text-align: right; }
.collection-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  padding: 5px 9px;
  border-top: 1px solid var(--line);
}
.collection-card-actions form { margin: 0; }
.collection-empty, .detail-empty {
  padding: 52px 25px;
  border: 1px dashed var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card) 64%, transparent);
  text-align: center;
}
.empty-icon { margin-bottom: 8px; color: var(--blue); font-size: 27px; }
.collection-empty h3, .detail-empty h3 { margin: 4px 0; font-size: 20px; font-weight: 650; }
.collection-empty p, .detail-empty p { max-width: 410px; margin: 5px auto 18px; color: var(--muted); }
.collection-detail { padding: 29px; }
.collection-detail-head, .detail-meta { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.back-link { color: var(--blue); font-size: 13px; text-decoration: none; }
.detail-title { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.detail-title h2 { margin: 0; font-size: 27px; font-weight: 650; letter-spacing: -.7px; }
.detail-title p { margin: 2px 0; color: var(--muted); }
.detail-meta { margin-top: 22px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.collection-words { margin-top: 7px; }
.collection-word { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 4px; border-bottom: 1px solid var(--line); }
.collection-word b, .collection-word span { display: block; }
.collection-word small { max-width: 44%; color: var(--muted); text-align: right; }

/* Dialogs */
.app-modal {
  width: min(510px, calc(100% - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 26px 80px rgba(12, 18, 30, .22);
}
.app-modal::backdrop { background: rgba(15, 20, 30, .42); backdrop-filter: blur(5px); }
.app-modal form { padding: 26px; }
.modal-header { display: flex; align-items: start; justify-content: space-between; gap: 15px; }
.modal-header h2 { margin: 5px 0; font-size: 23px; font-weight: 650; letter-spacing: -.45px; }
.modal-x { font-size: 25px; line-height: 1; }
.optional { font-size: 11px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

/* Learning, flashcards, games and quizzes */
.experience { display: grid; gap: 18px; }
.experience-top { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.experience-top h2 { margin: 5px 0 3px; font-size: 29px; font-weight: 650; letter-spacing: -.8px; }
.experience-top p { margin: 0; color: var(--muted); }
.collection-picker { width: 220px; margin: 0; font-size: 12px; }
.collection-picker select { margin-top: 5px; background: var(--card); }
.experience-app {
  min-height: 470px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}
.experience-learn .experience-app { background: linear-gradient(145deg, var(--card), color-mix(in srgb, var(--green) 40%, var(--card))); }
.experience-flashcards .experience-app { background: linear-gradient(145deg, var(--card), color-mix(in srgb, var(--soft) 42%, var(--card))); }
.experience-games .experience-app { background: linear-gradient(145deg, var(--card), color-mix(in srgb, #fff4df 30%, var(--card))); }
.experience-quizzes .experience-app { background: linear-gradient(145deg, var(--card), color-mix(in srgb, #eee9ff 34%, var(--card))); }
body.dark .experience-games .experience-app { background: linear-gradient(145deg, var(--card), #211e1a); }
body.dark .experience-quizzes .experience-app { background: linear-gradient(145deg, var(--card), #211e29); }
.session-head { width: 100%; display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; color: var(--muted); font-size: 13px; }
.progress-track { width: 100%; height: 6px; overflow: hidden; border-radius: 99px; background: var(--soft); }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .22s ease; }
.learning-card, .flashcard {
  width: min(620px, 100%);
  min-height: 275px;
  display: grid;
  place-items: center;
  padding: 38px 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(145deg, var(--card), color-mix(in srgb, var(--soft) 32%, var(--card)));
  box-shadow: var(--shadow);
}
.learning-card h3, .flashcard .flash-front, .flashcard .flash-back { margin: 0; font-size: 40px; font-weight: 650; letter-spacing: -1px; }
.learning-card p { color: var(--muted); font-size: 18px; }
.session-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 21px; }
.flashcard { position: relative; cursor: pointer; perspective: 800px; }
.flashcard-inner { width: 100%; min-height: 190px; display: grid; place-items: center; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.flashcard.is-flipped .flashcard-inner { transform: rotateY(180deg); }
.flash-side { grid-area: 1 / 1; backface-visibility: hidden; }
.flash-back { transform: rotateY(180deg); color: var(--blue); }
.flash-hint { margin-top: 12px; color: var(--muted); font-size: 12px; }
.game-choice-grid { width: min(680px, 100%); display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 11px; }
.game-choice-grid button {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.game-choice-grid button:hover { transform: translateY(-1px); border-color: var(--blue); }
.game-choice-grid button.correct { border-color: #65b583; background: var(--green); }
.game-choice-grid button.incorrect { border-color: #e78383; background: color-mix(in srgb, #fee9e9 60%, var(--card)); }
.game-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.game-tabs button.active { border-color: var(--blue); background: var(--blue); color: #fff; }
body.dark .game-tabs button.active { color: #17131f; }
.match-grid { width: min(680px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.match-column { display: grid; align-content: start; gap: 8px; }
.match-button { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--card); color: var(--ink); font-weight: 600; }
.match-button.selected { outline: 2px solid var(--blue); color: var(--blue); }
.match-button.matched { visibility: hidden; }
.score-line { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.quiz-question { margin: 12px 0 24px; font-size: 32px; font-weight: 650; letter-spacing: -.8px; }
.quiz-result { margin: 10px; font-size: 44px; font-weight: 650; letter-spacing: -1.3px; }
.empty-practice h3 { margin: 6px; font-size: 21px; font-weight: 650; }
.empty-practice p { color: var(--muted); }

/* Small refinements and accessibility */
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (max-width: 1050px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); gap: 28px; padding: 32px 26px 44px; }
  .stats { gap: 10px; }
  .stats article { padding: 18px; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { display: block; padding: 24px 20px 38px; }
  .nav { position: static; height: auto; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; margin: 0 0 26px; padding: 0; }
  .navlabel, .navfoot { display: none; }
  .nav a { min-height: 40px; justify-content: flex-start; padding: 8px 10px; font-size: 13px; }
  .nav i { width: 23px; flex-basis: 23px; font-size: 16px; }
  .grid { grid-template-columns: 1fr; }
  .auth { min-height: auto; grid-template-columns: 1fr; gap: 24px; margin: 3vh auto; }
  .hero h1 { font-size: 52px; }
  .experience-top, .collection-detail-head, .collections-hero { align-items: flex-start; flex-direction: column; }
  .collection-picker { width: 100%; }
}
@media (max-width: 560px) {
  .top { height: 62px; padding: 0 17px; }
  .shell { padding: 19px 15px 30px; }
  .welcome { align-items: flex-start; flex-direction: column; gap: 16px; margin-bottom: 23px; }
  .welcome h1 { font-size: 30px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stats article { padding: 15px; border-radius: 14px; }
  .stats strong { font-size: 29px; }
  .panel { padding: 20px; border-radius: 17px; }
  .fields, .collection-grid, .game-choice-grid, .match-grid { grid-template-columns: 1fr; }
  .collection-toolbar, .collection-search { align-items: stretch; flex-direction: column; }
  .search-field input { width: 100%; }
  .collection-total { display: none; }
  .collection-card-main { grid-template-columns: 38px minmax(0, 1fr); }
  .word-count { grid-column: 2; text-align: left; }
  .word-count small { display: inline; margin-left: 3px; text-align: left; }
  .collection-word { align-items: flex-start; flex-direction: column; }
  .collection-word small { max-width: none; text-align: left; }
  .experience-app { min-height: 390px; padding: 22px 14px; }
  .learning-card, .flashcard { min-height: 235px; padding: 26px 15px; }
  .learning-card h3, .flashcard .flash-front, .flashcard .flash-back { font-size: 31px; }
  .quiz-question { font-size: 27px; }
  .auth { width: calc(100% - 24px); padding: 30px 6px; }
  .hero h1 { font-size: 46px; }
  .authcard { padding: 23px; }
}

/* LEXI visual system — one layout for both themes */
:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --card: #ffffff;
  --card-soft: #fafbfc;
  --ink: #202124;
  --muted: #737984;
  --line: #e7e9ed;
  --blue: #315fce;
  --blue-dark: #244eae;
  --soft: #edf2fb;
  --green: #edf7f0;
  --red: #bf454d;
  --shadow: 0 8px 26px rgba(25, 35, 52, .045);
  --shadow-hover: 0 14px 32px rgba(25, 35, 52, .075);
  --radius: 18px;
}

/* Use a native system typeface: crisp, familiar and not dependent on a webfont. */
body {
  font-family: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
*, *::before, *::after { text-transform: none !important; }

body.dark {
  color-scheme: dark;
  --bg: #101114;
  --card: #191a1f;
  --card-soft: #1e2026;
  --ink: #f2f2f4;
  --muted: #a0a2ab;
  --line: #2c2e35;
  --blue: #b8a0ee;
  --blue-dark: #c7b5f5;
  --soft: #282431;
  --green: #1d3027;
  --red: #f08e94;
  --shadow: 0 10px 28px rgba(0, 0, 0, .18);
  --shadow-hover: 0 16px 36px rgba(0, 0, 0, .28);
  background: var(--bg);
}

/* Header */
.top {
  position: sticky;
  z-index: 30;
  top: 0;
  height: 70px;
  padding: 0 clamp(22px, 5vw, 76px);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(170%) blur(18px);
  -webkit-backdrop-filter: saturate(170%) blur(18px);
}
.brand {
  font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -1px;
}
.demo, .pill {
  border: 1px solid color-mix(in srgb, var(--blue) 17%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 8%, var(--card));
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

/* Shared page geometry. The light and dark themes use the same layout rules. */
.shell {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: min(1320px, calc(100% - 64px));
  min-height: calc(100vh - 70px);
  margin: 0 auto;
  padding: 0 0 58px;
}
.nav {
  position: sticky;
  z-index: 20;
  top: 70px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: auto;
  min-height: 68px;
  margin: 0 0 28px;
  padding: 11px 0;
  overflow-x: auto;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: color-mix(in srgb, var(--bg) 91%, transparent);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.navlabel {
  display: block;
  flex: 0 0 auto;
  margin: 0 8px 0 0;
  padding: 0 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}
.nav a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 40px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}
.nav a:hover { color: var(--ink); background: var(--card); border-color: var(--line); box-shadow: none; }
.nav a.active {
  color: var(--blue);
  background: var(--card);
  border-color: var(--line);
  box-shadow: 0 2px 7px rgba(20, 28, 42, .035);
}
.nav i { flex: 0 0 22px; width: 22px; color: var(--muted); font-size: 16px; }
.nav a.active i { color: var(--blue); }
.navfoot { display: none; }
.content { width: 100%; max-width: 1120px; margin: 0 auto; }

/* Main heading and dashboard */
.welcome {
  align-items: flex-end;
  gap: 24px;
  margin: 14px 0 30px;
}
.welcome h1 {
  margin: 5px 0 0;
  color: var(--ink);
  font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif;
  font-size: clamp(32px, 3vw, 41px);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -1.15px;
}
.welcome p { margin: 8px 0 0; color: var(--muted); font-size: 15px; }
.eyebrow, .stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
}
.primary, .secondary {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
}
.primary { box-shadow: 0 3px 10px color-mix(in srgb, var(--blue) 16%, transparent); }
.primary:hover { box-shadow: 0 5px 14px color-mix(in srgb, var(--blue) 20%, transparent); }
body.dark .primary { color: #18151f; }
.stats { gap: 14px; margin-bottom: 17px; }
.stats article {
  min-height: 118px;
  padding: 21px 22px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
  box-shadow: 0 2px 9px rgba(20, 28, 42, .025);
}
.stats strong { margin: 8px 0 1px; color: var(--ink); font-size: 31px; font-weight: 650; letter-spacing: -.8px; }
.stats small, .bars small, .wide > small { color: var(--muted); font-size: 12px; }
.grid { grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); gap: 17px; }
.panel {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.panel h2 { margin: 8px 0 13px; color: var(--ink); font-size: 20px; font-weight: 650; letter-spacing: -.3px; }
.panel p { color: var(--muted); }
.bars { height: 166px; gap: 18px; padding: 12px 3px 3px; }
.bars div { gap: 9px; }
.bars i { width: min(34px, 75%); border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #a9c2ee 0%, #5b8cde 100%); }
body.dark .bars i { background: linear-gradient(180deg, #b7a0e9 0%, #775bb0 100%); }
body.dark .bars div:nth-child(3) i { background: linear-gradient(180deg, #d0bfff 0%, #987bd2 100%); }

/* Collection, forms and learning components use the same surfaces in both themes. */
.collections-hero { background: linear-gradient(135deg, var(--card), var(--card-soft)); border-color: var(--line); }
.collection-card, .collection-detail, .app-modal { background: var(--card); border-color: var(--line); }
.collection-card { border-radius: 16px; box-shadow: 0 2px 9px rgba(20, 28, 42, .025); }
.collection-card:hover, .collection-card.is-open { box-shadow: var(--shadow-hover); }
.collection-card-icon { background: var(--soft); color: var(--blue); }
.collection-detail, .app-modal { border-radius: 19px; }
.app-modal { color: var(--ink); }
input, textarea, select { background: var(--card-soft); color: var(--ink); border-color: var(--line); }
body.dark input, body.dark textarea, body.dark select { background: #121318; border-color: #343640; color: var(--ink); }
.secondary { background: var(--soft); color: var(--blue); }
body.dark .secondary { background: #2b2735; color: #d2c2f5; }
.primary { background: var(--blue); color: #fff; }
body.dark .primary { background: #a98be2; color: #17131f; }
.primary:hover { background: var(--blue-dark); }
body.dark .primary:hover { background: #b99fe9; }

/* Dark theme is colour-only: no layout, dimensions, navigation or positioning changes. */
body.dark .top { background: color-mix(in srgb, var(--card) 94%, transparent); border-bottom-color: var(--line); }
body.dark .nav { background: color-mix(in srgb, var(--bg) 91%, transparent); border-bottom-color: var(--line); }
body.dark .nav a:hover { background: #202128; border-color: #30323b; color: var(--ink); }
body.dark .nav a.active { background: #25222e; border-color: #393246; color: #d4c2f7; }
body.dark .nav a.active i { color: #d4c2f7; }
body.dark .stats article, body.dark .panel, body.dark .collection-card { background: var(--card); border-color: var(--line); box-shadow: var(--shadow); }
body.dark .collection-card:hover, body.dark .collection-card.is-open { border-color: #514565; }
body.dark .collection-card-icon { background: #2b2635; color: #c9b4f4; }
body.dark .app-modal { background: var(--card); color: var(--ink); }
body.dark .app-modal::backdrop { background: rgba(0, 0, 0, .62); }
body.dark .learning-card, body.dark .flashcard { border-color: var(--line); background: linear-gradient(145deg, var(--card), #211e29); }
body.dark .game-choice-grid button, body.dark .match-button { background: var(--card); color: var(--ink); border-color: var(--line); }
body.dark .game-choice-grid button:hover { border-color: var(--blue); color: var(--blue); }
body.dark .collection-empty, body.dark .detail-empty { background: color-mix(in srgb, var(--card) 75%, transparent); border-color: var(--line); }

/* Responsive layout stays identical between light and dark themes. */
@media (max-width: 1050px) {
  .shell { width: calc(100% - 48px); }
  .content { max-width: 100%; }
  .nav { gap: 3px; }
  .nav a { padding-inline: 9px; font-size: 13px; }
}
@media (max-width: 820px) {
  .shell { display: block; width: calc(100% - 36px); padding-bottom: 38px; }
  .nav {
    position: sticky;
    top: 70px;
    display: flex;
    flex-direction: row;
    align-items: center;
    min-height: 56px;
    height: auto;
    margin: 0 0 22px;
    padding: 8px 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
  }
  .navlabel, .navfoot { display: none; }
  .nav a { flex: 0 0 auto; width: auto; min-height: 39px; padding: 8px 10px; font-size: 13px; }
  .nav i { width: 20px; flex-basis: 20px; font-size: 15px; }
  .welcome { align-items: flex-start; }
  .grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .top { height: 62px; }
  .nav { top: 62px; }
  .shell { width: calc(100% - 30px); padding-bottom: 28px; }
  .welcome { flex-direction: column; align-items: flex-start; margin: 13px 0 22px; }
  .welcome h1 { font-size: 30px; letter-spacing: -.65px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .stats article { min-height: 105px; padding: 15px; }
  .stats strong { font-size: 28px; }
  .panel { padding: 20px; border-radius: 17px; }
  .fields, .collection-grid, .game-choice-grid, .match-grid { grid-template-columns: 1fr; }
  .collection-toolbar, .collection-search { align-items: stretch; flex-direction: column; }
  .search-field input { width: 100%; }
  .collection-total { display: none; }
  .collection-card-main { grid-template-columns: 38px minmax(0, 1fr); }
  .word-count { grid-column: 2; text-align: left; }
  .word-count small { display: inline; margin-left: 3px; text-align: left; }
  .collection-word { align-items: flex-start; flex-direction: column; }
  .collection-word small { max-width: none; text-align: left; }
  .experience-app { min-height: 390px; padding: 22px 14px; }
  .learning-card, .flashcard { min-height: 235px; padding: 26px 15px; }
  .learning-card h3, .flashcard .flash-front, .flashcard .flash-back { font-size: 31px; }
  .quiz-question { font-size: 27px; }
  .auth { width: calc(100% - 24px); padding: 30px 6px; }
  .hero h1 { font-size: 46px; }
  .authcard { padding: 23px; }
}


/* Centered workspace geometry and Font Awesome SVG icon treatment */
.shell {
  width: min(1000px, calc(100% - 48px));
  min-height: calc(100vh - 70px);
  margin-inline: auto;
  padding: 0 0 56px;
}
.nav {
  position: sticky;
  top: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 11px;
  width: 100%;
  min-height: 0;
  height: auto;
  margin: 0 auto 28px;
  padding: 17px 0 15px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.navlabel {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.35;
  text-align: center;
}
.nav-links {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}
.nav a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  margin: 0;
  padding: 8px 13px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--card); border-color: var(--line); }
.nav a.active { color: var(--blue); background: var(--card); border-color: var(--line); box-shadow: 0 2px 8px rgba(20, 28, 42, .04); }
.nav-icon, .icon-inline, .button-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.nav-icon { width: 17px; height: 17px; color: currentColor; }
.fa-icon { display: block; width: 1em; height: 1em; fill: currentColor; }
.nav-icon .fa-icon { width: 15px; height: 15px; }
.navfoot { display: none; }
.content {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}
.welcome {
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  margin: 12px 0 28px;
}
.welcome > div { min-width: 0; }
.welcome h1 { max-width: 760px; }
.welcome .primary { flex: 0 0 auto; gap: 10px; }
.welcome .primary .fa-icon { width: 13px; height: 13px; }
.theme-toggle {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
}
.theme-toggle:hover { background: var(--card-soft); color: var(--ink); }
.theme-toggle .fa-icon { width: 16px; height: 16px; }
.signout-button { display: inline-flex; align-items: center; gap: 8px; }
.signout-button .fa-icon { width: 14px; height: 14px; }
.formpanel { width: min(100%, 760px); margin: 0 auto; }
.experience { width: 100%; }
.experience-top { align-items: center; }
.collection-card-icon .fa-icon { width: 17px; height: 17px; }
.empty-icon { display: flex; align-items: center; justify-content: center; }
.empty-icon .fa-icon { width: 25px; height: 25px; }
.icon-inline .fa-icon { width: 13px; height: 13px; }
.search-field span { display: flex; align-items: center; justify-content: center; top: 0; bottom: 0; }
.search-field span .fa-icon { width: 15px; height: 15px; }
.modal-x { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; padding: 0; }
.modal-x .fa-icon { width: 14px; height: 14px; }

/* Keep the same centred composition in both themes; only colour tokens change. */
body.dark .nav { background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom-color: var(--line); }
body.dark .nav a { color: var(--muted); }
body.dark .nav a:hover { background: var(--card); border-color: var(--line); color: var(--ink); }
body.dark .nav a.active { background: var(--card-soft); border-color: var(--line); color: var(--blue); }
body.dark .nav a.active .nav-icon { color: var(--blue); }

@media (max-width: 820px) {
  .shell { width: calc(100% - 36px); }
  .nav { top: 70px; gap: 9px; margin-bottom: 22px; padding: 13px 0 11px; }
  .nav-links { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding: 0 0 3px; scrollbar-width: thin; }
  .nav a { min-height: 40px; padding: 8px 11px; }
  .content { max-width: 100%; }
  .formpanel { width: min(100%, 760px); }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 28px); padding-bottom: 30px; }
  .nav { top: 62px; }
  .navlabel { font-size: 11px; }
  .nav-links { gap: 4px; }
  .nav a { gap: 6px; min-height: 38px; padding: 7px 9px; font-size: 13px; }
  .nav-icon { width: 15px; height: 15px; }
  .nav-icon .fa-icon { width: 14px; height: 14px; }
  .welcome { align-items: flex-start; }
  .welcome .primary { align-self: flex-start; }
  .formpanel { margin-inline: auto; }
}


/* LEXI typography refinement: humanist, restrained, and consistent across the app. */
@font-face {
  font-family: "Source Sans 3";
  src: url("fonts/SourceSans3VF-Upright.ttf.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
}

html, body, body button, body input, body textarea, body select {
  font-family: "Source Sans 3", Arial, sans-serif !important;
  font-synthesis: none;
}

/* Avoid the overly geometric display face and exaggerated tracking. */
.hero h1,
.welcome h1,
.authcard h2,
.collections-hero h2,
.experience-top h2,
.brand {
  font-family: "Source Sans 3", Arial, sans-serif !important;
  font-weight: 600;
  letter-spacing: -0.9px;
  font-synthesis: none;
}

.hero h1 {
  font-size: clamp(48px, 6vw, 70px);
  line-height: 1.04;
  letter-spacing: -1.35px;
  font-weight: 600;
}

.hero .eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.hero p {
  font-family: "Source Sans 3", Arial, sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
}

.authcard h2 {
  font-size: 23px;
  font-weight: 600;
  letter-spacing: -0.45px;
}

.authcard button, .primary, .secondary {
  font-family: "Source Sans 3", Arial, sans-serif;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}


/* Landing page refinement — quiet editorial layout, shared by both themes. */
.auth-landing {
  position: relative;
  isolation: isolate;
  width: min(1240px, calc(100% - 72px));
  min-height: calc(100svh - 70px);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(370px, .82fr);
  align-items: center;
  gap: clamp(54px, 8vw, 126px);
  margin: 0 auto;
  padding: clamp(54px, 8vh, 88px) 0 clamp(58px, 8vh, 94px);
}
.auth-landing::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: min(54vw, 690px);
  aspect-ratio: 1;
  right: -10%;
  top: 5%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--blue) 8%, transparent) 0%, color-mix(in srgb, var(--blue) 3%, transparent) 42%, transparent 72%);
  filter: blur(8px);
}
.auth-hero { min-width: 0; padding: 10px 0 16px; }
.hero-kicker { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: .01em; }
.hero-kicker-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 5px color-mix(in srgb, var(--blue) 12%, transparent); }
.auth-hero h1 {
  max-width: 720px;
  margin: 25px 0 20px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: clamp(62px, 6.4vw, 88px);
  font-weight: 500;
  letter-spacing: -.052em;
  line-height: .99;
  text-wrap: balance;
}
.auth-hero h1 em { color: var(--blue); font-style: normal; font-weight: 500; }
.auth-hero .auth-lead { max-width: 470px; margin: 0; color: var(--muted); font-size: 19px; line-height: 1.65; }
.auth-benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; margin-top: 47px; max-width: 650px; }
.auth-benefit { min-width: 0; display: flex; align-items: flex-start; gap: 10px; }
.auth-benefit-icon { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 11px; color: var(--blue); background: color-mix(in srgb, var(--card) 78%, transparent); }
.auth-benefit-icon .fa-icon { width: 15px; height: 15px; }
.auth-benefit strong, .auth-benefit small { display: block; }
.auth-benefit strong { margin: 1px 0 3px; color: var(--ink); font-size: 13px; font-weight: 650; line-height: 1.25; }
.auth-benefit small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.auth-quiet-note { display: flex; align-items: center; gap: 9px; margin-top: 43px; color: var(--muted); font-size: 12px; }
.auth-quiet-note span { width: 25px; height: 1px; background: var(--line); }
.auth-side { position: relative; width: 100%; max-width: 470px; justify-self: end; }
.auth-orbit { position: absolute; z-index: -1; border: 1px solid color-mix(in srgb, var(--blue) 13%, transparent); border-radius: 50%; pointer-events: none; }
.auth-orbit-one { width: 170px; height: 170px; top: -58px; right: -38px; }
.auth-orbit-two { width: 94px; height: 94px; top: -20px; right: 0; border-color: color-mix(in srgb, var(--blue) 10%, transparent); }
.authcard {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: clamp(29px, 3.2vw, 42px);
  border: 1px solid var(--line);
  border-radius: 25px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  box-shadow: 0 24px 70px rgba(21, 28, 42, .08), 0 2px 8px rgba(21, 28, 42, .035);
  backdrop-filter: blur(16px);
}
body.dark .authcard { box-shadow: 0 28px 80px rgba(0, 0, 0, .28), 0 2px 8px rgba(0, 0, 0, .18); }
.authcard::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, transparent, var(--blue), transparent); opacity: .72; }
.authcard-mark-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.authcard-mark { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid color-mix(in srgb, var(--blue) 24%, var(--line)); border-radius: 13px; color: var(--ink); background: var(--soft); font-size: 17px; font-weight: 700; letter-spacing: -.06em; }
.authcard-mark span { color: var(--blue); }
.authcard-kicker { color: var(--muted); font-size: 12px; font-weight: 600; }
.authcard h2 { margin: 0 0 10px; color: var(--ink); font-family: "Source Sans 3", Arial, sans-serif !important; font-size: 30px; font-weight: 600; letter-spacing: -.7px; line-height: 1.15; }
.authcard-intro { max-width: 340px; margin: 0 0 27px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.auth-preview-row { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: color-mix(in srgb, var(--bg) 72%, var(--card)); font-size: 13px; }
.auth-preview-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #7da98d; box-shadow: 0 0 0 4px color-mix(in srgb, #7da98d 14%, transparent); }
.auth-demo-form { margin: 0 !important; }
.auth-demo-action, .auth-main-action { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; padding: 0 17px; border-radius: 13px; font-size: 14px; }
.auth-demo-action { border: 1px solid color-mix(in srgb, var(--blue) 20%, var(--line)); background: var(--soft); color: var(--blue); }
.auth-demo-action span, .auth-main-action span { font-size: 18px; line-height: 1; transition: transform .18s ease; }
.auth-demo-action:hover span, .auth-main-action:hover span { transform: translateX(3px); }
.authcard-foot { margin-top: 17px; color: var(--muted); font-size: 11px; text-align: center; }
.auth-side-caption { display: flex; align-items: center; justify-content: center; gap: 11px; margin-top: 22px; color: var(--muted); font-size: 12px; }
.auth-caption-line { width: 22px; height: 1px; background: var(--line); }
.auth-login-form { gap: 10px !important; margin: 0 0 18px !important; }
.auth-login-form label { margin: 0; color: var(--muted); font-size: 13px; }
.auth-login-form input, .auth-register input { min-height: 46px; border-radius: 12px; background: var(--bg); }
.auth-register { padding-top: 15px !important; border-top: 1px solid var(--line); }
.auth-register summary { padding: 3px 0; font-size: 13px; font-weight: 600; }
.auth-register form { gap: 8px; margin: 14px 0 3px !important; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 13px; color: var(--muted); font-size: 11px; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }

@media (max-width: 900px) {
  .auth-landing { width: min(720px, calc(100% - 44px)); min-height: auto; grid-template-columns: 1fr; gap: 42px; padding: 76px 0 64px; }
  .auth-side { max-width: 560px; justify-self: center; }
  .auth-hero h1 { font-size: clamp(56px, 10vw, 76px); }
  .auth-benefits { max-width: 100%; margin-top: 34px; }
  .auth-quiet-note { margin-top: 28px; }
}
@media (max-width: 560px) {
  .auth-landing { width: calc(100% - 36px); gap: 32px; padding: 50px 0 40px; }
  .auth-hero h1 { margin: 20px 0 15px; font-size: clamp(48px, 14vw, 64px); }
  .auth-hero .auth-lead { font-size: 16px; }
  .auth-benefits { grid-template-columns: 1fr; gap: 13px; margin-top: 28px; }
  .auth-benefit { align-items: center; }
  .auth-quiet-note { margin-top: 24px; }
  .authcard { padding: 26px 22px; border-radius: 21px; }
  .authcard-mark-row { margin-bottom: 25px; }
  .authcard h2 { font-size: 26px; }
  .auth-orbit-one { right: -24px; }
}


/* Header wordmark refinement */
.top {
  min-height: 74px;
}
.brand {
  display: inline-flex;
  align-items: baseline;
  font-size: 31px;
  font-weight: 700;
  letter-spacing: -1.45px;
  line-height: 1;
}
.brand span {
  margin-left: 1px;
}
@media (max-width: 560px) {
  .top { min-height: 66px; }
  .brand { font-size: 28px; }
}

/* Account access page: a focused, complete sign-in and registration experience. */
.auth-landing {
  width: min(1180px, calc(100% - 64px));
  min-height: calc(100svh - 74px);
  grid-template-columns: minmax(0, 1.02fr) minmax(390px, .84fr);
  align-items: center;
  gap: clamp(52px, 7vw, 104px);
  padding: clamp(48px, 7vh, 78px) 0;
}
.auth-landing::before { display: none; }
.auth-hero { padding: 0; }
.auth-hero h1 { margin: 22px 0 18px; font-size: clamp(58px, 6vw, 80px); }
.auth-hero .auth-lead { max-width: 440px; font-size: 18px; line-height: 1.58; }
.auth-benefits { margin-top: 38px; gap: 14px; }
.auth-quiet-note { margin-top: 34px; }
.auth-side { max-width: 460px; justify-self: center; }
.authcard {
  padding: clamp(28px, 3vw, 38px);
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 22px 60px rgba(20, 26, 38, .09);
  backdrop-filter: none;
}
body.dark .authcard { box-shadow: 0 24px 64px rgba(0, 0, 0, .28); }
.authcard::before { display: none; }
.authcard-heading { margin-bottom: 22px; }
.authcard-eyebrow { margin-bottom: 10px; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0; }
.authcard h2 { margin: 0 0 8px; font-size: 30px; font-weight: 650; letter-spacing: -.7px; line-height: 1.18; }
.authcard-intro { max-width: 360px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.auth-alert { margin: 0 0 18px; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--red) 28%, var(--line)); border-radius: 11px; color: var(--red); background: color-mix(in srgb, var(--red) 7%, var(--card)); font-size: 12px; line-height: 1.45; }
.auth-alert-info { color: var(--muted); border-color: var(--line); background: var(--bg); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin: 22px 0 21px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.auth-tabs button { min-height: 39px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .16s ease, color .16s ease, box-shadow .16s ease; }
.auth-tabs button.is-active { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(20, 28, 40, .12); }
.auth-tabs button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.auth-form, .auth-form form { display: grid; gap: 13px; }
.auth-form[hidden], [data-auth-panel][hidden] { display: none !important; }
.auth-form label { display: grid; gap: 7px; margin: 0; color: var(--ink); font-size: 12px; font-weight: 600; }
.auth-form input { width: 100%; min-height: 47px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 14px; outline: none; }
.auth-form input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.auth-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 13%, transparent); }
.auth-main-action { justify-content: center; gap: 12px; min-height: 49px; margin-top: 5px; border-radius: 10px; font-size: 14px; }
.auth-main-action span { font-size: 17px; }
.auth-divider { margin: 20px 0 15px; font-size: 11px; }
.auth-demo-action { justify-content: center; min-height: 45px; background: transparent; border: 1px solid var(--line); color: var(--muted); }
.auth-demo-action:hover { background: var(--soft); color: var(--ink); }
.auth-demo-action span { margin-left: 8px; }
.authcard-foot { margin: 15px 0 0; font-size: 11px; line-height: 1.4; }
.auth-side-caption, .auth-orbit { display: none !important; }
@media (max-width: 900px) {
  .auth-landing { width: min(650px, calc(100% - 40px)); min-height: auto; grid-template-columns: 1fr; gap: 34px; padding: 54px 0 50px; }
  .auth-side { width: 100%; max-width: 520px; justify-self: center; }
  .auth-hero h1 { font-size: clamp(54px, 9vw, 72px); }
  .auth-benefits { max-width: 100%; }
}
@media (max-width: 560px) {
  .auth-landing { width: calc(100% - 32px); gap: 27px; padding: 38px 0 32px; }
  .auth-hero h1 { margin: 18px 0 13px; font-size: clamp(45px, 13vw, 60px); }
  .auth-hero .auth-lead { font-size: 16px; }
  .auth-benefits { grid-template-columns: 1fr; gap: 12px; margin-top: 25px; }
  .auth-benefit { align-items: center; }
  .auth-quiet-note { margin-top: 22px; }
  .authcard { padding: 25px 21px; border-radius: 18px; }
  .authcard h2 { font-size: 26px; }
}

/* Auth entrance and tab transitions — restrained, quick and accessible. */
@keyframes auth-hero-arrive {
  from { opacity: 0; transform: translate3d(0, 22px, 0); filter: blur(5px); }
  to { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
}
@keyframes auth-card-arrive {
  from { opacity: 0; transform: translate3d(0, 18px, 0) scale(.985); filter: blur(4px); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); filter: blur(0); }
}
@keyframes auth-panel-arrive {
  from { opacity: 0; transform: translate3d(0, 10px, 0); filter: blur(2px); }
  to { opacity: 1; transform: translate3d(0, 0, 0); filter: blur(0); }
}
@keyframes auth-tab-glide {
  from { opacity: .75; }
  to { opacity: 1; }
}

/* Lift the editorial copy while keeping the account card in its current column. */
.auth-landing {
  align-items: center;
}
.auth-hero {
  position: relative;
  align-self: center;
  top: -58px;
  transform: none;
}
.auth-side {
  align-self: center;
}

/* Initial page entrance. The card and copy arrive with a subtle stagger. */
.auth-motion-ready .auth-hero {
  animation: auth-hero-arrive .72s cubic-bezier(.2,.72,.22,1) both;
}
.auth-motion-ready .auth-side {
  animation: auth-card-arrive .78s .12s cubic-bezier(.2,.72,.22,1) both;
}
.auth-motion-ready .authcard-heading { animation: auth-hero-arrive .6s .2s both; }
.auth-motion-ready .auth-benefit { animation: auth-hero-arrive .55s both; }
.auth-motion-ready .auth-benefit:nth-child(1) { animation-delay: .2s; }
.auth-motion-ready .auth-benefit:nth-child(2) { animation-delay: .28s; }
.auth-motion-ready .auth-benefit:nth-child(3) { animation-delay: .36s; }

/* The selected tab glides between the two options. */
.auth-tabs {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.auth-tabs::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 2px);
  border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line));
  border-radius: 9px;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(16, 24, 40, .07);
  transform: translateX(0);
  transition: transform .36s cubic-bezier(.22,.8,.22,1), background .2s ease, border-color .2s ease;
}
.auth-tabs[data-active-mode="register"]::before {
  transform: translateX(100%);
}
.auth-tabs button {
  position: relative;
  z-index: 1;
  background: transparent !important;
  box-shadow: none !important;
  transition: color .22s ease, opacity .22s ease;
}
.auth-tabs button:not(.is-active) { opacity: .72; }
.auth-tabs button.is-active { color: var(--ink); opacity: 1; }
[data-auth-panel].is-entering {
  animation: auth-panel-arrive .34s cubic-bezier(.2,.72,.22,1) both;
}
.auth-main-action {
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.auth-main-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--blue) 20%, transparent);
}
.auth-form input {
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

@media (max-width: 900px) {
  .auth-hero { top: 0; transform: none; }
}
@media (max-width: 560px) {
  .auth-hero { top: 0; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .auth-hero { top: 0; transform: none; }
}

/* Smooth horizontal account switcher: login and registration share one viewport. */
.authcard {
  overflow: hidden;
}
.auth-tabs {
  margin: 18px 0 16px;
}
.auth-tabs::before {
  transition: transform 760ms cubic-bezier(.22,.72,.18,1), background-color 420ms ease, border-color 420ms ease;
}
.auth-panels-viewport {
  width: 100%;
  height: auto;
  overflow: hidden;
  position: relative;
  transition: height 720ms cubic-bezier(.22,.72,.18,1);
  will-change: height;
  contain: layout paint;
}
.auth-panel-track {
  display: flex;
  align-items: flex-start;
  width: 200%;
  transform: translate3d(0,0,0);
  transition: transform 780ms cubic-bezier(.22,.72,.18,1);
  will-change: transform;
}
.auth-panel-track[data-active-mode="register"] {
  transform: translate3d(-50%,0,0);
}
.auth-panel {
  display: block;
  flex: 0 0 50%;
  width: 50%;
  min-width: 0;
  margin: 0;
  padding: 0;
  opacity: 1;
  transition: opacity 460ms ease;
}
.auth-panel[aria-hidden="true"] {
  pointer-events: none;
}
.auth-panel-track[data-active-mode="login"] [data-auth-panel="register"],
.auth-panel-track[data-active-mode="register"] [data-auth-panel="login"] {
  opacity: .72;
}
.auth-form {
  gap: 10px;
  margin: 0;
}
.auth-form label {
  gap: 6px;
}
.auth-form input {
  min-height: 44px;
}
.auth-main-action {
  min-height: 46px;
  margin-top: 3px;
}
.auth-divider {
  margin: 15px 0 11px;
}
.authcard-foot {
  margin-top: 12px;
}

/* Keep registration compact enough for normal desktop viewports without an inner scrollbar. */
@media (min-width: 901px) and (max-height: 900px) {
  .auth-landing {
    min-height: calc(100svh - 66px);
    padding-top: clamp(22px, 3vh, 34px);
    padding-bottom: clamp(22px, 3vh, 34px);
    gap: clamp(42px, 5vw, 76px);
  }
  .authcard {
    padding: clamp(22px, 2.4vh, 28px);
  }
  .authcard-heading { margin-bottom: 16px; }
  .authcard h2 { font-size: 28px; }
  .authcard-intro { font-size: 13px; line-height: 1.45; }
  .auth-alert { margin-bottom: 12px; padding: 9px 11px; }
  .auth-tabs { margin: 14px 0 13px; }
  .auth-tabs button { min-height: 36px; }
  .auth-form { gap: 8px; }
  .auth-form label { gap: 5px; font-size: 11px; }
  .auth-form input { min-height: 41px; padding: 9px 12px; font-size: 13px; }
  .auth-main-action { min-height: 43px; }
  .auth-divider { margin: 12px 0 9px; }
  .auth-demo-action { min-height: 41px; }
  .authcard-foot { margin-top: 10px; font-size: 10px; }
}
@media (max-width: 900px) {
  .auth-landing { padding-top: 38px; padding-bottom: 34px; }
  .auth-hero { top: 0; }
}
@media (max-width: 560px) {
  .auth-panels-viewport { transition-duration: 620ms; }
  .auth-panel-track { transition-duration: 680ms; }
  .authcard { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-panels-viewport,
  .auth-panel-track,
  .auth-tabs::before,
  .auth-panel { transition-duration: .01ms !important; }
}



/* ======================================================================
   LEXI · Signed-in workspace
   A single quiet, editorial design language shared by every app section.
   Colour tokens change between themes; geometry and rhythm do not.
   ====================================================================== */
:root {
  --bg: #f7f6f3;
  --card: #ffffff;
  --card-soft: #fbfaf8;
  --ink: #242229;
  --muted: #77727f;
  --line: #e9e5ed;
  --blue: #8166b5;
  --blue-dark: #6d539d;
  --soft: #f1edf8;
  --green: #edf6f0;
  --red: #bd5962;
  --shadow: 0 10px 30px rgba(35, 27, 46, .045), 0 1px 2px rgba(35, 27, 46, .035);
  --shadow-hover: 0 18px 42px rgba(35, 27, 46, .09), 0 3px 8px rgba(35, 27, 46, .035);
  --radius: 21px;
}
body.dark {
  --bg: #101012;
  --card: #19191e;
  --card-soft: #1e1d23;
  --ink: #f1eff4;
  --muted: #a29eaa;
  --line: #2d2b34;
  --blue: #b99fe9;
  --blue-dark: #c9b5f2;
  --soft: #2a2434;
  --green: #1d3027;
  --red: #eb9298;
  --shadow: 0 12px 34px rgba(0, 0, 0, .19), 0 1px 2px rgba(0, 0, 0, .16);
  --shadow-hover: 0 20px 48px rgba(0, 0, 0, .32), 0 3px 9px rgba(0, 0, 0, .18);
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.58;
  letter-spacing: 0;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
body.dark { background: var(--bg); }

/* Header: deliberately understated, like the sign-in screen. */
.top {
  height: 68px;
  padding-inline: clamp(22px, 5vw, 76px);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border-color: var(--line);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 65%, transparent);
}
.brand {
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif !important;
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -1.15px;
  line-height: 1;
}
.brand span { color: var(--blue); }
.top-actions { gap: 13px; }
.demo, .pill {
  min-height: 29px;
  padding: 5px 11px;
  border-color: color-mix(in srgb, var(--blue) 23%, var(--line));
  border-radius: 999px;
  background: var(--soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}
.theme-toggle {
  width: 39px;
  height: 39px;
  border-color: var(--line);
  background: color-mix(in srgb, var(--card) 75%, transparent);
  transition: transform .45s cubic-bezier(.2,.7,.2,1), background .35s ease, border-color .35s ease;
}
.theme-toggle:hover { transform: rotate(12deg); }
.signout-button { min-height: 38px; padding-inline: 11px; border-radius: 10px; }

/* A centred workspace rail and one shared content width. */
.shell {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: min(1180px, calc(100% - 64px));
  min-height: calc(100vh - 68px);
  margin: 0 auto;
  padding: 0 0 68px;
}
.nav {
  position: sticky;
  z-index: 18;
  top: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 13px;
  width: 100%;
  min-height: 89px;
  height: auto;
  margin: 0 auto 37px;
  padding: 15px 0 17px;
  overflow: visible;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}
.navlabel {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: 1.25;
  text-align: center;
  text-transform: none !important;
}
.nav-links {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}
.nav a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 41px;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: color .35s ease, background .35s ease, border-color .35s ease, transform .35s cubic-bezier(.2,.7,.2,1);
}
.nav a:hover { color: var(--ink); background: var(--card); border-color: var(--line); transform: translateY(-1px); box-shadow: none; }
.nav a.active {
  color: var(--ink);
  background: var(--card);
  border-color: color-mix(in srgb, var(--blue) 23%, var(--line));
  box-shadow: 0 3px 12px color-mix(in srgb, var(--blue) 8%, transparent);
}
.nav-icon {
  display: inline-flex;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  line-height: 0;
  transition: color .3s ease, transform .3s ease;
}
.nav a:hover .nav-icon { color: var(--blue); transform: translateY(-1px); }
.nav a.active .nav-icon { color: var(--blue); }
.nav-icon .fa-icon { width: 15px; height: 15px; }
.nav-text { white-space: nowrap; }
.navfoot { display: none; }
.content {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  min-width: 0;
}

/* Page heading: editorial serif title echoes the landing page. */
.welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin: 5px 0 33px;
  animation: lexi-page-in .72s cubic-bezier(.2,.7,.2,1) both;
}
.welcome > div { min-width: 0; }
.welcome .eyebrow,
.experience-top .eyebrow,
.collections-hero .eyebrow,
.panel .eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none !important;
}
.welcome h1 {
  max-width: 780px;
  margin: 8px 0 4px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: clamp(35px, 4vw, 47px);
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1.08;
}
.welcome p { margin: 9px 0 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.welcome .primary { flex: 0 0 auto; gap: 10px; min-height: 46px; padding-inline: 19px; }
.welcome .primary .fa-icon { width: 14px; height: 14px; }

/* Buttons, form controls and shared surfaces. */
.primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  transition: transform .38s cubic-bezier(.2,.7,.2,1), background .38s ease, color .38s ease, border-color .38s ease, box-shadow .38s ease;
}
.primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 5px 16px color-mix(in srgb, var(--blue) 19%, transparent);
}
.primary:hover { transform: translateY(-2px); background: var(--blue-dark); box-shadow: 0 9px 22px color-mix(in srgb, var(--blue) 22%, transparent); }
body.dark .primary { color: #211a2c; }
.secondary { border-color: var(--line); background: var(--soft); color: var(--blue); }
.secondary:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--blue) 38%, var(--line)); background: color-mix(in srgb, var(--soft) 70%, var(--card)); }
.quiet { border-radius: 10px; transition: color .3s ease, background .3s ease, transform .3s ease; }
.quiet:hover { background: var(--soft); color: var(--ink); }
.panel {
  padding: clamp(23px, 2.5vw, 31px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: border-color .4s ease, background .4s ease, box-shadow .4s ease;
}
.panel h2 { margin: 8px 0 13px; color: var(--ink); font-size: 22px; font-weight: 650; letter-spacing: -.35px; line-height: 1.25; }
.panel p { color: var(--muted); }
input, textarea, select {
  min-height: 45px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-soft);
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}
textarea { min-height: 120px; line-height: 1.5; }
input:focus, textarea:focus, select:focus { border-color: color-mix(in srgb, var(--blue) 58%, var(--line)); outline: 0; box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 13%, transparent); }
label { color: var(--muted); font-size: 13px; font-weight: 600; }
.success, .toast { padding: 13px 16px; border: 1px solid color-mix(in srgb, #6eaa86 24%, var(--line)); border-radius: 13px; background: var(--green); color: var(--ink); }
.error { border-color: color-mix(in srgb, var(--red) 27%, var(--line)); background: color-mix(in srgb, var(--red) 9%, var(--card)); color: var(--red); }

/* Dashboard and statistics. */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 18px;
}
.stats article {
  position: relative;
  min-width: 0;
  min-height: 132px;
  overflow: hidden;
  padding: 21px 23px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, var(--card), color-mix(in srgb, var(--card-soft) 68%, var(--card)));
  box-shadow: var(--shadow);
  animation: lexi-card-in .72s cubic-bezier(.2,.7,.2,1) both;
  transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s ease, border-color .4s ease;
}
.stats article:nth-child(2) { animation-delay: .06s; }
.stats article:nth-child(3) { animation-delay: .12s; }
.stats article:nth-child(4) { animation-delay: .18s; }
.stats article::after {
  content: "";
  position: absolute;
  top: -38px;
  right: -34px;
  width: 110px;
  height: 110px;
  border: 1px solid color-mix(in srgb, var(--blue) 12%, transparent);
  border-radius: 50%;
  pointer-events: none;
}
.stats article:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--blue) 28%, var(--line)); box-shadow: var(--shadow-hover); }
.stats span { display: block; color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none !important; }
.stats strong { display: block; margin: 10px 0 2px; color: var(--ink); font-size: 38px; font-weight: 650; letter-spacing: -1.4px; line-height: 1; }
.stats small { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; }
.grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(300px, .82fr); gap: 18px; }
.grid .panel { min-height: 278px; animation: lexi-card-in .8s cubic-bezier(.2,.7,.2,1) .12s both; }
.grid .panel:nth-child(2) { animation-delay: .2s; }
.grid .panel h2 { margin: 10px 0 12px; font-size: 23px; }
.grid .panel p { margin: 0 0 19px; font-size: 15px; }
.bars { height: 166px; display: flex; align-items: end; gap: clamp(12px, 2vw, 21px); padding: 14px 6px 2px; }
.bars div { height: 100%; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 9px; }
.bars i { width: min(36px, 72%); min-height: 8px; border-radius: 9px 9px 4px 4px; background: linear-gradient(180deg, color-mix(in srgb, var(--blue) 65%, white), var(--blue)); box-shadow: 0 4px 12px color-mix(in srgb, var(--blue) 16%, transparent); transition: height .7s cubic-bezier(.2,.7,.2,1); }
.bars small { color: var(--muted); font-size: 12px; }
.wide > small { color: var(--muted); font-size: 12px; }

/* Collections: calmer cards, stronger hierarchy, consistent modals. */
.collections-page { display: grid; gap: 23px; animation: lexi-page-in .65s cubic-bezier(.2,.7,.2,1) both; }
.collections-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(25px, 3vw, 37px);
  border: 1px solid var(--line);
  border-radius: 23px;
  background: linear-gradient(125deg, var(--card), color-mix(in srgb, var(--soft) 48%, var(--card)));
  box-shadow: var(--shadow);
}
.collections-hero h2 { margin: 8px 0 7px; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: clamp(26px, 3vw, 35px); font-weight: 500; letter-spacing: -.035em; line-height: 1.14; }
.collections-hero p { max-width: 530px; margin: 0; color: var(--muted); font-size: 15px; }
.create-collection { flex: 0 0 auto; }
.collection-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.collection-search { display: flex; align-items: center; gap: 9px; }
.search-field { position: relative; margin: 0; }
.search-field span { position: absolute; inset: 0 auto 0 13px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.search-field span .fa-icon { width: 16px; height: 16px; }
.search-field input { width: min(330px, 36vw); padding-left: 40px; background: var(--card); }
.collection-total { color: var(--muted); font-size: 13px; }
.collection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.collection-card {
  min-width: 0;
  min-height: 188px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  animation: lexi-card-in .65s cubic-bezier(.2,.7,.2,1) both;
  transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s ease, border-color .4s ease;
}
.collection-card:hover, .collection-card.is-open { transform: translateY(-3px); border-color: color-mix(in srgb, var(--blue) 34%, var(--line)); box-shadow: var(--shadow-hover); }
.collection-card-main { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: start; gap: 13px; flex: 1; padding: 21px; color: var(--ink); text-decoration: none; }
.collection-card-icon { display: grid; width: 40px; height: 40px; place-items: center; border: 1px solid color-mix(in srgb, var(--blue) 17%, var(--line)); border-radius: 13px; background: var(--soft); color: var(--blue); }
.collection-card-icon .fa-icon { width: 17px; height: 17px; }
.collection-card h3 { margin: 1px 0 5px; color: var(--ink); font-size: 17px; font-weight: 650; letter-spacing: -.2px; }
.collection-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.word-count { color: var(--ink); font-size: 17px; font-weight: 650; letter-spacing: -.4px; white-space: nowrap; }
.word-count small { display: block; color: var(--muted); font-size: 11px; font-weight: 500; text-align: right; }
.collection-card-actions { display: flex; align-items: center; justify-content: flex-end; gap: 5px; padding: 8px 12px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--card-soft) 72%, var(--card)); }
.collection-card-actions form { margin: 0; }
.collection-card-actions .quiet { min-height: 32px; padding: 6px 10px; font-size: 13px; }
.collection-empty, .detail-empty { padding: 55px 26px; border: 1px dashed color-mix(in srgb, var(--blue) 25%, var(--line)); border-radius: 21px; background: color-mix(in srgb, var(--card) 78%, transparent); text-align: center; }
.empty-icon { display: flex; align-items: center; justify-content: center; margin-bottom: 12px; color: var(--blue); }
.empty-icon .fa-icon { width: 30px; height: 30px; }
.collection-empty h3, .detail-empty h3 { margin: 5px 0 7px; color: var(--ink); font-size: 22px; font-weight: 650; }
.collection-empty p, .detail-empty p { max-width: 440px; margin: 0 auto 20px; color: var(--muted); }
.collection-detail { padding: clamp(22px, 3vw, 34px); }
.collection-detail-head, .detail-meta { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.back-link { color: var(--blue); font-size: 13px; font-weight: 600; text-decoration: none; }
.back-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.detail-title { display: flex; align-items: center; gap: 13px; margin-top: 12px; }
.detail-title h2 { margin: 0; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 500; letter-spacing: -.04em; }
.detail-title p { margin: 4px 0 0; color: var(--muted); }
.detail-meta { margin-top: 24px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.collection-words { margin-top: 7px; }
.collection-word { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 5px; border-bottom: 1px solid var(--line); }
.collection-word b, .collection-word span { display: block; }
.collection-word b { color: var(--ink); font-size: 16px; font-weight: 650; }
.collection-word span { color: var(--muted); font-size: 14px; }
.collection-word small { max-width: 44%; color: var(--muted); text-align: right; }

/* Add vocabulary: focused form area with a clear start and finish. */
.formpanel { width: min(100%, 790px); max-width: 790px; margin: 8px auto 0; padding: clamp(25px, 3vw, 38px); }
.formpanel > .eyebrow { color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none !important; }
.formpanel h2 { margin: 8px 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 30px; font-weight: 500; letter-spacing: -.035em; }
.formpanel > p { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.formpanel form { display: grid; gap: 16px; }
.formpanel label { display: grid; gap: 7px; margin: 0; color: var(--ink); font-size: 13px; font-weight: 600; }
.formpanel .fields { gap: 15px; }
.formpanel button.primary { justify-self: start; min-width: 180px; margin-top: 3px; }

/* Practice modes share the same frame, while each activity gets room to breathe. */
.experience { display: grid; width: 100%; gap: 19px; animation: lexi-page-in .65s cubic-bezier(.2,.7,.2,1) both; }
.experience-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.experience-top h2 { margin: 7px 0 4px; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: clamp(29px, 3.3vw, 38px); font-weight: 500; letter-spacing: -.04em; line-height: 1.12; }
.experience-top p { max-width: 620px; margin: 0; color: var(--muted); font-size: 15px; }
.collection-picker { width: min(250px, 35%); margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.collection-picker select { width: 100%; margin-top: 6px; background: var(--card); }
.experience-app {
  position: relative;
  min-height: 490px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(25px, 4vw, 48px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--blue) 7%, transparent), transparent 52%), var(--card);
  box-shadow: var(--shadow);
}
.experience-app > * { animation: lexi-card-in .52s cubic-bezier(.2,.7,.2,1) both; }
.experience-learn .experience-app { background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, #9bbf9e 10%, transparent), transparent 54%), var(--card); }
.experience-flashcards .experience-app { background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, var(--blue) 9%, transparent), transparent 54%), var(--card); }
.experience-games .experience-app { background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, #d5b27d 10%, transparent), transparent 54%), var(--card); }
.experience-quizzes .experience-app { background: radial-gradient(ellipse at 50% 0%, color-mix(in srgb, #a897ce 10%, transparent), transparent 54%), var(--card); }
.session-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.progress-track { width: 100%; height: 6px; margin-bottom: 27px; overflow: hidden; border-radius: 99px; background: var(--soft); }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--blue); transition: width .65s cubic-bezier(.2,.7,.2,1); }
.learning-card, .flashcard {
  width: min(700px, 100%);
  min-height: 285px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 15px;
  padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: 23px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--card) 92%, var(--soft)), var(--card));
  box-shadow: 0 14px 36px color-mix(in srgb, var(--ink) 5%, transparent);
  text-align: center;
}
.learning-card h3, .flashcard .flash-front, .flashcard .flash-back { margin: 0; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: clamp(36px, 4vw, 52px); font-weight: 500; letter-spacing: -.04em; line-height: 1.12; }
.learning-card .eyebrow { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.learning-card p { margin: 4px 0 0; color: var(--muted); font-size: 17px; }
.session-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 23px; }
.flashcard { position: relative; cursor: pointer; perspective: 1000px; outline: none; }
.flashcard:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 60%, transparent); outline-offset: 4px; }
.flashcard-inner { width: 100%; min-height: 200px; display: grid; place-items: center; transform-style: preserve-3d; transition: transform .72s cubic-bezier(.2,.7,.2,1); }
.flashcard.is-flipped .flashcard-inner { transform: rotateY(180deg); }
.flash-side { grid-area: 1 / 1; backface-visibility: hidden; }
.flash-back { transform: rotateY(180deg); color: var(--blue) !important; }
.flash-hint { margin: 13px 0 0; color: var(--muted); font-size: 13px; }
.game-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 23px; }
.game-tabs button { min-width: 132px; }
.score-line { margin: 0 0 15px; color: var(--muted); font-size: 14px; text-align: center; }
.game-choice-grid { width: min(700px, 100%); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.game-choice-grid button, .match-button {
  min-height: 58px;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  transition: transform .35s ease, border-color .35s ease, background .35s ease, box-shadow .35s ease;
}
.game-choice-grid button:hover, .match-button:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); box-shadow: var(--shadow); }
.game-choice-grid button.correct { border-color: #6eaa86; background: color-mix(in srgb, var(--green) 72%, var(--card)); }
.game-choice-grid button.incorrect { border-color: color-mix(in srgb, var(--red) 50%, var(--line)); background: color-mix(in srgb, var(--red) 8%, var(--card)); }
.game-choice-grid button:disabled { cursor: default; opacity: .82; }
.match-grid { width: min(760px, 100%); display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.match-column { display: grid; align-content: start; gap: 10px; }
.match-button { width: 100%; text-align: center; }
.match-button.selected { border-color: var(--blue); background: var(--soft); color: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 12%, transparent); }
.match-button.matched { visibility: hidden; }
.quiz-question { margin: 10px 0 25px; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 3.4vw, 42px); font-weight: 500; letter-spacing: -.04em; text-align: center; }
.quiz-result { margin: 12px 0; color: var(--blue); font-family: Georgia, "Times New Roman", serif; font-size: 54px; font-weight: 500; letter-spacing: -.04em; }
.empty-practice { width: min(560px, 100%); margin: auto; padding: 24px; text-align: center; }
.empty-practice .eyebrow { color: var(--muted); text-transform: none !important; }
.empty-practice h3 { margin: 9px 0; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 29px; font-weight: 500; letter-spacing: -.035em; }
.empty-practice p { margin: 0 0 20px; color: var(--muted); }

/* Settings and dialogs follow the same component language. */
.content > .panel:not(.experience-app):not(.formpanel) { max-width: 100%; }
.app-modal {
  width: min(540px, calc(100% - 28px));
  max-height: min(85vh, 760px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 23px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(0,0,0,.28);
}
.app-modal::backdrop { background: rgba(12, 10, 16, .54); backdrop-filter: blur(7px); }
.app-modal form { display: grid; gap: 13px; padding: clamp(23px, 4vw, 34px); }
.modal-header { margin-bottom: 4px; }
.modal-header h2 { font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 500; letter-spacing: -.035em; }
.modal-x { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); }
.modal-x:hover { background: var(--soft); color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 9px; }
.optional { color: var(--muted); font-size: 12px; font-weight: 400; }

/* Calm motion on page entry and on interaction, without exaggerated movement. */
@keyframes lexi-page-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes lexi-card-in { from { opacity: 0; transform: translateY(10px) scale(.995); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .shell *, .shell *::before, .shell *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Responsive layouts preserve the same hierarchy and centred rhythm. */
@media (max-width: 1050px) {
  .shell { width: min(100% - 44px, 1180px); }
  .nav-links { gap: 4px; }
  .nav a { padding-inline: 10px; }
  .content { max-width: 100%; }
  .collection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .shell { display: block; width: calc(100% - 36px); padding-bottom: 42px; }
  .nav { position: sticky; top: 68px; min-height: 78px; gap: 10px; margin-bottom: 26px; padding: 12px 0; }
  .nav-links { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding: 0 0 4px; scrollbar-width: thin; }
  .nav-links::-webkit-scrollbar { height: 4px; }
  .nav a { min-height: 39px; padding: 8px 11px; }
  .welcome { align-items: flex-start; }
  .welcome .primary { align-self: flex-start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: 1fr; }
  .grid .panel { min-height: 0; }
  .experience-top { align-items: flex-start; flex-direction: column; }
  .collection-picker { width: min(100%, 360px); }
  .collections-hero { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 560px) {
  .top { height: 62px; padding-inline: 17px; }
  .brand { font-size: 25px; }
  .shell { width: calc(100% - 28px); padding-bottom: 30px; }
  .nav { top: 62px; min-height: 72px; margin-bottom: 22px; }
  .navlabel { font-size: 11px; }
  .nav a { min-height: 37px; padding: 7px 9px; gap: 6px; font-size: 13px; }
  .nav-icon { width: 15px; height: 15px; flex-basis: 15px; }
  .nav-icon .fa-icon { width: 14px; height: 14px; }
  .welcome { flex-direction: column; align-items: flex-start; gap: 15px; margin: 9px 0 24px; }
  .welcome h1 { font-size: 35px; }
  .welcome p { font-size: 14px; }
  .stats { gap: 9px; }
  .stats article { min-height: 112px; padding: 15px; border-radius: 16px; }
  .stats strong { margin-top: 9px; font-size: 31px; }
  .stats small { font-size: 12px; }
  .panel { padding: 19px; border-radius: 17px; }
  .grid { gap: 12px; }
  .bars { height: 138px; gap: 9px; }
  .bars i { width: min(27px, 70%); }
  .collection-grid, .game-choice-grid, .match-grid, .fields { grid-template-columns: 1fr; }
  .collection-toolbar, .collection-search { align-items: stretch; flex-direction: column; }
  .search-field input { width: 100%; }
  .collection-total { display: none; }
  .collection-card-main { grid-template-columns: 40px minmax(0,1fr); }
  .word-count { grid-column: 2; justify-self: start; }
  .word-count small { display: inline; margin-left: 4px; }
  .collection-detail-head, .detail-meta { align-items: flex-start; flex-direction: column; }
  .collection-word { align-items: flex-start; flex-direction: column; }
  .collection-word small { max-width: none; text-align: left; }
  .formpanel { margin-top: 0; }
  .formpanel button.primary { width: 100%; }
  .experience-app { min-height: 430px; padding: 21px 14px; }
  .learning-card, .flashcard { min-height: 240px; padding: 27px 15px; }
  .learning-card h3, .flashcard .flash-front, .flashcard .flash-back { font-size: 34px; }
  .session-actions { gap: 8px; }
  .session-actions button { flex: 1 1 auto; }
  .quiz-question { font-size: 29px; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions button { flex: 1 1 auto; }
}

/* Photo vocabulary import: camera/upload, local crop and erase editor. */
.add-page-panel { width: min(100%, 900px); max-width: 900px; }
.add-page-intro { max-width: 690px; }
.photo-import-panel {
  margin: 26px 0 25px;
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--card-soft), color-mix(in srgb, var(--soft) 28%, var(--card)));
}
.photo-import-head { display: flex; align-items: flex-start; gap: 15px; }
.photo-import-mark {
  width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--blue);
}
.photo-import-mark .fa-icon { width: 19px; height: 19px; }
.photo-import-heading h3 { margin: 3px 0 5px; color: var(--ink); font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.photo-import-heading p { margin: 0; max-width: 660px; color: var(--muted); font-size: 14px; }
.photo-upload-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 19px; }
.photo-action {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 9px;
  min-height: 42px; margin: 0 !important; padding: 10px 15px;
  border: 1px solid var(--line); border-radius: 11px; color: var(--ink); cursor: pointer;
  background: var(--card); font-size: 13px !important; font-weight: 650 !important;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.photo-action:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); }
.photo-action .fa-icon { width: 15px; height: 15px; color: var(--blue); }
.photo-action-camera { display: none !important; }
.photo-file-input { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.photo-file-input:focus-visible + label,
.photo-action:has(+ .photo-file-input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--blue) 45%, transparent); outline-offset: 3px; }
.photo-privacy-note { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.photo-editor { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.photo-editor[hidden] { display: none !important; }
.photo-editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.photo-tool-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.photo-tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px;
  padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.photo-tool .fa-icon { width: 13px; height: 13px; }
.photo-tool:hover { border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); color: var(--ink); }
.photo-tool.is-active { background: var(--soft); border-color: color-mix(in srgb, var(--blue) 35%, var(--line)); color: var(--blue); }
.photo-tool:disabled { opacity: .38; cursor: not-allowed; }
.photo-tool.photo-remove:hover { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }
.photo-brush-control { display: inline-flex !important; align-items: center; gap: 10px !important; margin: 0 !important; color: var(--muted) !important; font-size: 12px !important; font-weight: 600 !important; }
.photo-brush-control[hidden] { display: none !important; }
.photo-brush-control input { width: 118px; margin: 0; padding: 0; accent-color: var(--blue); }
.photo-editor-hint { margin: 13px 0 10px; color: var(--muted); font-size: 12px; }
.photo-stage {
  position: relative; width: 100%; min-height: 80px; overflow: auto; padding: 8px;
  border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--bg) 84%, #777 16%);
  text-align: center; touch-action: pan-y;
}
.photo-stage canvas { display: block; width: 100%; height: auto; max-width: 100%; margin: 0 auto; border-radius: 6px; cursor: crosshair; touch-action: none; }
.photo-crop-selection {
  position: absolute; z-index: 2; border: 2px dashed var(--blue); background: transparent;
  box-shadow: 0 0 0 9999px rgba(8, 12, 22, .42); pointer-events: none;
}
.photo-crop-selection[hidden] { display: none !important; }
.photo-editor-actions { display: flex; justify-content: flex-end; gap: 9px; flex-wrap: wrap; margin-top: 13px; }
.photo-editor-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.photo-editor-actions .fa-icon { width: 14px; height: 14px; }
.photo-editor-actions button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.photo-status { min-height: 19px; margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.photo-status.is-error { color: var(--red); }
.photo-status.is-success { color: #32845a; }
.photo-form-divider { display: flex; align-items: center; gap: 13px; margin: 0 0 17px; color: var(--muted); font-size: 12px; }
.photo-form-divider::before, .photo-form-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.vocabulary-entry-form { display: grid; gap: 15px; }
.vocabulary-entry-form .fields { gap: 15px; }
.vocabulary-entry-form label { margin: 0; }
.photo-bulk-hint { margin: -8px 0 0; color: var(--muted); font-size: 12px; }
.photo-bulk-hint strong { color: var(--ink); font-weight: 650; }
body.dark .photo-import-panel { background: linear-gradient(145deg, var(--card), #201d28); border-color: var(--line); }
body.dark .photo-import-mark, body.dark .photo-action, body.dark .photo-tool { background: #17181e; border-color: #343640; color: var(--ink); }
body.dark .photo-action .fa-icon { color: #c4a9f2; }
body.dark .photo-tool.is-active { background: #2b2635; border-color: #55466c; color: #d4c2f7; }
body.dark .photo-stage { background: #101116; border-color: #343640; }
body.dark .photo-status.is-success { color: #8ed3a8; }
@media (hover: none) and (pointer: coarse) {
  .photo-action-camera { display: inline-flex !important; }
}
@media (max-width: 700px) {
  .photo-import-head { gap: 11px; }
  .photo-import-mark { width: 40px; height: 40px; flex-basis: 40px; }
  .photo-editor-toolbar { align-items: flex-start; }
  .photo-history-tools { width: 100%; }
  .photo-brush-control { margin-left: auto !important; }
  .photo-editor-actions { display: grid; grid-template-columns: 1fr; }
  .photo-editor-actions button { width: 100%; }
  .photo-upload-actions .photo-action { flex: 1 1 150px; }
  .photo-stage { max-height: 58vh; overflow: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .photo-action, .photo-tool { transition: none; }
}

/* Vocabulary builder refresh: clear hierarchy, balanced columns, and explicit translation alternatives. */
.add-page-layout {
  width: min(100%, 1080px);
  margin: 14px auto 48px;
  animation: add-page-arrive .65s cubic-bezier(.2,.7,.2,1) both;
}
.add-page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 4px 0 26px;
}
.add-page-header .eyebrow { margin-bottom: 7px; font-size: 12px; letter-spacing: .01em; text-transform: none; }
.add-page-header h1 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 4vw, 46px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -.045em;
}
.add-page-header p { max-width: 620px; margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.add-page-aside {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
}
.add-page-aside-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb,var(--blue) 13%,transparent); }
.add-workspace-grid { display: grid; grid-template-columns: minmax(0,.88fr) minmax(0,1.12fr); align-items: start; gap: 18px; }
.add-workspace-grid > * { min-width: 0; }
.add-card-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.add-card-kicker span { color: var(--muted); font-weight: 600; letter-spacing: 0; }
.photo-import-panel {
  height: 100%;
  margin: 0;
  padding: clamp(21px,2.5vw,28px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(155deg,var(--card),color-mix(in srgb,var(--soft) 35%,var(--card)));
  box-shadow: 0 12px 34px rgba(20,25,40,.045);
}
.photo-import-head { align-items: flex-start; gap: 14px; }
.photo-import-mark { width: 48px; height: 48px; flex-basis: 48px; border-radius: 15px; background: var(--soft); color: var(--blue); }
.photo-import-heading h2 { margin: 1px 0 7px; color: var(--ink); font-size: 22px; font-weight: 650; letter-spacing: -.035em; line-height: 1.2; }
.photo-import-heading p { max-width: 430px; font-size: 13px; line-height: 1.6; }
.photo-upload-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 24px; }
.photo-action {
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 13px;
  width: 100%;
  min-height: 68px;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  text-align: left;
  transition: transform .28s cubic-bezier(.2,.7,.2,1), border-color .28s ease, background .28s ease, box-shadow .28s ease;
}
.photo-action:hover { transform: translateY(-2px); border-color: color-mix(in srgb,var(--blue) 45%,var(--line)); box-shadow: 0 9px 20px rgba(40,45,70,.07); }
.photo-action-icon { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); color: var(--blue); }
.photo-action-icon .fa-icon { width: 17px; height: 17px; }
.photo-action > span:last-child { display: grid; gap: 3px; }
.photo-action strong { color: var(--ink); font-size: 13px; font-weight: 650; }
.photo-action small { color: var(--muted); font-size: 11px; font-weight: 400; }
.photo-privacy-note { display: flex; align-items: center; gap: 8px; margin: 16px 1px 0; font-size: 11px; line-height: 1.5; }
.privacy-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #6da783; box-shadow: 0 0 0 4px color-mix(in srgb,#6da783 13%,transparent); }
.add-entry-card { padding: clamp(21px,2.5vw,28px); border-radius: 20px; box-shadow: 0 12px 34px rgba(20,25,40,.045); }
.vocabulary-entry-form { display: grid; gap: 16px; }
.add-entry-heading { margin: -5px 0 3px; }
.add-entry-heading h2 { margin: 0 0 6px; color: var(--ink); font-family: Georgia,"Times New Roman",serif; font-size: 25px; font-weight: 500; letter-spacing: -.035em; }
.add-entry-heading p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.add-single-fields { display: grid; grid-template-columns: minmax(0,.86fr) minmax(0,1.14fr); gap: 12px; }
.vocabulary-entry-form label { display: grid; gap: 7px; margin: 0; color: var(--ink); font-size: 12px; font-weight: 650; }
.vocabulary-entry-form input,
.vocabulary-entry-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.vocabulary-entry-form input { min-height: 45px; padding: 10px 12px; }
.vocabulary-entry-form textarea { min-height: 180px; max-height: 560px; padding: 13px; line-height: 1.65; resize: vertical; overflow-y: auto; scrollbar-gutter: stable; }
.vocabulary-entry-form textarea#bulk { min-height: 180px; max-height: 560px; transition: height .22s ease, border-color .2s ease, box-shadow .2s ease; }
.vocabulary-entry-form input:focus,
.vocabulary-entry-form textarea:focus { border-color: color-mix(in srgb,var(--blue) 60%,var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb,var(--blue) 12%,transparent); outline: 0; }
.vocabulary-entry-form input::placeholder,
.vocabulary-entry-form textarea::placeholder { color: color-mix(in srgb,var(--muted) 78%,transparent); }
.field-help { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.45; }
.add-example-label { margin-top: -1px !important; }
.add-entry-divider { display: flex; align-items: center; gap: 12px; margin: 1px 0 0; color: var(--muted); font-size: 11px; }
.add-entry-divider::before,.add-entry-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.add-bulk-label { gap: 8px !important; }
.photo-bulk-hint { margin: -8px 0 0; font-size: 11px; line-height: 1.5; }
.add-form-footer { display: flex; align-items: center; gap: 13px; flex-wrap: wrap; margin-top: 2px; }
.add-form-footer .primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 185px; min-height: 46px; border-radius: 12px; }
.add-form-footer .primary span { font-size: 16px; transition: transform .2s ease; }
.add-form-footer .primary:hover span { transform: translateX(3px); }
.add-form-footer small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.photo-editor { margin-top: 22px; padding-top: 19px; }
.photo-editor-toolbar { align-items: center; }
.photo-stage { border-radius: 14px; }
body.dark .photo-import-panel { background: linear-gradient(155deg,var(--card),#201d28); border-color: var(--line); }
body.dark .photo-action { background: #17181e; border-color: #343640; }
body.dark .photo-action-icon { background: #282333; border-color: #41384f; color: #c9aaf6; }
body.dark .add-page-aside { background: var(--card); }
body.dark .add-entry-card { background: var(--card); }

/* Multiple alternative meanings stay attached to one vocabulary entry. */
.translation-values { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; max-width: 100%; }
.translation-values.is-pending { color: var(--muted); font-size: 15px; line-height: 1.5; }
.translation-chip { display: inline-flex; align-items: center; max-width: 100%; padding: 7px 11px; border: 1px solid color-mix(in srgb,var(--blue) 18%,var(--line)); border-radius: 999px; background: color-mix(in srgb,var(--soft) 72%,var(--card)); color: var(--ink); font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.translation-chip.is-empty { color: var(--muted); font-weight: 400; }
.learning-card .translation-values { margin-top: 12px; }
.flashcard .flash-back.translation-values { display: flex; align-content: center; align-items: center; justify-content: center; gap: 8px; }
.collection-translation-list { display: flex !important; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.collection-translation-list i { display: inline-flex; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--soft); color: var(--muted); font-size: 11px; font-style: normal; line-height: 1.3; }
@keyframes add-page-arrive { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 980px) {
  .add-page-layout { width: min(100%, 790px); }
  .add-workspace-grid { grid-template-columns: 1fr; }
  .photo-import-panel { height: auto; }
  .photo-upload-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .add-page-layout { margin-top: 2px; }
  .add-page-header { display: block; margin-bottom: 18px; }
  .add-page-aside { margin-top: 13px; }
  .add-workspace-grid { gap: 13px; }
  .add-single-fields { grid-template-columns: 1fr; }
  .photo-upload-actions { grid-template-columns: 1fr; }
  .add-form-footer { display: grid; grid-template-columns: 1fr; }
  .add-form-footer .primary { width: 100%; }
  .vocabulary-entry-form textarea#bulk { max-height: 58vh; }
  .photo-import-panel,.add-entry-card { padding: 20px; border-radius: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  .add-page-layout { animation: none; }
  .photo-action,.vocabulary-entry-form input,.vocabulary-entry-form textarea { transition: none; }
}

/* Flashcards use the same clear sans-serif typeface as the rest of the learning interface. */
.flashcard .flash-front,
.flashcard .flash-back,
.flashcard .translation-chip {
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-style: normal;
  letter-spacing: 0;
}


/* Flashcard polish: remove the oversized focus ring and make card text easier to read. */
.flashcard,
.flashcard:focus,
.flashcard:focus-visible {
  outline: none !important;
  border: 0 !important;
  box-shadow: none !important;
}

.flashcard .flash-front,
.flashcard .flash-back {
  font-size: clamp(48px, 5.2vw, 68px) !important;
  line-height: 1.16;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.flashcard .flash-back.translation-values {
  gap: 12px;
}

.flashcard .translation-chip {
  font-size: clamp(23px, 2.65vw, 32px) !important;
  line-height: 1.22;
  font-weight: 600;
  padding: 11px 18px;
  letter-spacing: -0.01em;
}

@media (max-width: 700px) {
  .flashcard .flash-front,
  .flashcard .flash-back {
    font-size: clamp(38px, 8vw, 52px) !important;
  }
  .flashcard .translation-chip {
    font-size: clamp(21px, 5vw, 26px) !important;
    padding: 9px 14px;
  }
}

/* Consistent answer feedback for every practice mode. */
.game-choice-grid button,
.match-button,
.session-actions button {
  position: relative;
  transform-origin: center;
  transition: background-color .24s ease, border-color .24s ease, color .24s ease,
              box-shadow .24s ease, opacity .24s ease, transform .24s ease;
}

.game-choice-grid button,
.match-button {
  animation: lexi-answer-enter .46s cubic-bezier(.2,.72,.2,1) both;
  animation-delay: calc(var(--choice-index, 0) * 55ms);
}

.game-choice-grid button.correct,
.match-button.correct,
.session-actions button.correct {
  color: #fff !important;
  background: #218653 !important;
  border-color: #218653 !important;
  box-shadow: 0 7px 22px rgba(33,134,83,.24) !important;
  opacity: 1 !important;
}

.game-choice-grid button.incorrect,
.match-button.incorrect,
.session-actions button.incorrect {
  color: #fff !important;
  background: #c6404d !important;
  border-color: #c6404d !important;
  box-shadow: 0 7px 22px rgba(198,64,77,.22) !important;
  opacity: 1 !important;
}

.game-choice-grid button.is-muted,
.match-button.is-muted {
  opacity: .42 !important;
  filter: saturate(.45);
  transform: scale(.985);
}

.game-choice-grid button:disabled,
.match-button:disabled,
.session-actions button:disabled {
  cursor: default;
}

.game-choice-grid button:disabled:not(.correct):not(.incorrect),
.match-button:disabled:not(.correct):not(.incorrect) {
  opacity: .48;
}

.match-button.correct,
.match-button.incorrect {
  pointer-events: none;
}

.match-button.matched {
  visibility: hidden;
  opacity: 0;
  transform: scale(.94);
  transition: opacity .32s ease, transform .32s ease, visibility 0s linear .32s;
}

.answer-pop { animation: lexi-answer-pop .42s cubic-bezier(.18,.8,.25,1.12) both !important; }
.answer-shake { animation: lexi-answer-shake .42s ease both !important; }

.answer-feedback-line {
  width: fit-content;
  max-width: min(100%, 680px);
  margin: 17px auto 0;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  animation: lexi-feedback-in .36s cubic-bezier(.2,.72,.2,1) both;
}
.answer-feedback-line.is-correct {
  color: #1c8751;
  background: color-mix(in srgb, #218653 13%, var(--card));
  border-color: color-mix(in srgb, #218653 42%, var(--line));
}
.answer-feedback-line.is-incorrect {
  color: #d45460;
  background: color-mix(in srgb, #c6404d 12%, var(--card));
  border-color: color-mix(in srgb, #c6404d 40%, var(--line));
}

.quiz-question { animation: lexi-question-in .5s cubic-bezier(.2,.72,.2,1) both; }
.session-head, .progress-track { animation: lexi-feedback-in .4s ease both; }
.learning-card.feedback-correct,
.flashcard.feedback-correct {
  border-color: color-mix(in srgb, #218653 55%, var(--line));
  box-shadow: 0 12px 34px rgba(33,134,83,.14);
}
.learning-card.feedback-incorrect,
.flashcard.feedback-incorrect {
  border-color: color-mix(in srgb, #c6404d 55%, var(--line));
  box-shadow: 0 12px 34px rgba(198,64,77,.13);
}

@keyframes lexi-answer-enter {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes lexi-answer-pop {
  0% { transform: scale(.97); }
  58% { transform: scale(1.035); }
  100% { transform: scale(1); }
}
@keyframes lexi-answer-shake {
  0%,100% { transform: translateX(0); }
  22% { transform: translateX(-5px); }
  48% { transform: translateX(4px); }
  72% { transform: translateX(-2px); }
}
@keyframes lexi-feedback-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes lexi-question-in {
  from { opacity: 0; transform: translateY(11px); filter: blur(3px); }
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}
@media (prefers-reduced-motion: reduce) {
  .game-choice-grid button, .match-button, .session-actions button,
  .answer-pop, .answer-shake, .answer-feedback-line,
  .quiz-question, .session-head, .progress-track {
    animation: none !important;
    transition: none !important;
  }
}


/* Game round completion: a clear, balanced result screen instead of a loose text block. */
.game-completion {
  position: relative;
  isolation: isolate;
  width: min(760px, 100%);
  margin: auto;
  padding: clamp(28px, 4.8vw, 52px) clamp(20px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 25px;
  background:
    radial-gradient(ellipse at 50% -12%, color-mix(in srgb, var(--blue) 16%, transparent), transparent 58%),
    linear-gradient(155deg, var(--card-soft), var(--card));
  box-shadow: var(--shadow-hover);
  text-align: center;
  animation: game-completion-enter .72s cubic-bezier(.18,.72,.2,1) both;
}
.game-completion::before,
.game-completion::after {
  position: absolute;
  z-index: -1;
  content: "";
  border: 1px solid color-mix(in srgb, var(--blue) 17%, transparent);
  border-radius: 50%;
  pointer-events: none;
}
.game-completion::before { width: 310px; height: 310px; top: -220px; left: calc(50% - 155px); }
.game-completion::after { width: 240px; height: 240px; top: -184px; left: calc(50% - 120px); }
.completion-seal {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid color-mix(in srgb, #31956a 35%, var(--line));
  border-radius: 20px;
  background: color-mix(in srgb, #31956a 13%, var(--card));
  color: #48a879;
  font-size: 30px;
  font-weight: 650;
  box-shadow: 0 9px 25px rgba(49,149,106,.10);
  animation: completion-seal-in .7s .12s cubic-bezier(.18,.8,.25,1.25) both;
}
.completion-kicker {
  color: var(--blue);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .015em;
}
.completion-title {
  margin: 8px 0 7px;
  color: var(--ink);
  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(27px, 3.6vw, 36px);
  font-weight: 650;
  letter-spacing: -.035em;
  line-height: 1.12;
}
.completion-description {
  max-width: 480px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.completion-score-card {
  min-width: 190px;
  margin: 25px 0 19px;
  padding: 15px 25px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--card) 86%, var(--soft));
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 4%, transparent);
  animation: completion-score-in .58s .18s cubic-bezier(.18,.72,.2,1) both;
}
.completion-score-number {
  color: var(--ink);
  font-size: clamp(42px, 5vw, 54px);
  font-weight: 650;
  letter-spacing: -.055em;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}
.completion-score-label { margin-top: 3px; color: var(--muted); font-size: 12px; }
.completion-stats {
  width: min(570px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  animation: game-completion-enter .64s .23s cubic-bezier(.18,.72,.2,1) both;
}
.completion-stat {
  min-width: 0;
  padding: 13px 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--card) 92%, transparent);
}
.completion-stat span { color: var(--muted); font-size: 12px; }
.completion-stat strong { color: var(--ink); font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.completion-actions {
  margin-top: 23px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  animation: game-completion-enter .64s .3s cubic-bezier(.18,.72,.2,1) both;
}
.completion-actions button { min-width: 150px; min-height: 45px; }
.completion-replay { box-shadow: 0 8px 20px color-mix(in srgb, var(--blue) 19%, transparent); }
.completion-switch { background: var(--card); }
@keyframes game-completion-enter {
  from { opacity: 0; transform: translateY(15px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes completion-seal-in {
  0% { opacity: 0; transform: translateY(9px) scale(.72) rotate(-9deg); }
  68% { opacity: 1; transform: translateY(0) scale(1.07) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes completion-score-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 600px) {
  .game-completion { padding: 28px 16px; border-radius: 20px; }
  .completion-seal { width: 54px; height: 54px; border-radius: 17px; margin-bottom: 14px; }
  .completion-score-card { margin: 20px 0 14px; }
  .completion-stats { gap: 7px; }
  .completion-stat { padding: 11px 5px; }
  .completion-stat span { font-size: 11px; }
  .completion-stat strong { font-size: 19px; }
  .completion-actions { width: 100%; }
  .completion-actions button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .game-completion, .completion-seal, .completion-score-card, .completion-stats, .completion-actions { animation: none !important; }
}

/* Language selector: settings preference panel */
.settings-language-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px;
  margin: 22px 0 4px;
  max-width: 720px;
}
.settings-language-form label {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--ink);
  font-weight: 600;
}
.settings-language-form select {
  min-height: 48px;
  background: var(--card);
}
.settings-language-form .field-help {
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
}
.settings-language-form .primary { min-height: 48px; white-space: nowrap; }
@media (max-width: 620px) {
  .settings-language-form { grid-template-columns: 1fr; }
  .settings-language-form .primary { width: 100%; }
}


/* Theme control: Font Awesome moon in light mode, sun in dark mode. */
.theme-toggle .theme-icon{display:inline-flex;align-items:center;justify-content:center}
.theme-toggle .theme-icon-sun{display:none}
body.dark .theme-toggle .theme-icon-moon{display:none}
body.dark .theme-toggle .theme-icon-sun{display:inline-flex}
.theme-toggle .theme-icon .fa-icon{width:17px;height:17px}


/* Multilingual study-set metadata and language selectors. */
.study-language-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:start}
.study-language-fields label,.study-set-fields label{min-width:0}
.study-language-fields select:disabled{opacity:.72;cursor:not-allowed;background:var(--soft)}
.study-set-language{grid-column:2 / 4;display:inline-flex;align-items:center;gap:7px;justify-self:start;margin-top:7px;padding:5px 9px;border:1px solid var(--line);border-radius:999px;background:var(--soft);color:var(--muted);font-size:11px;font-weight:650;line-height:1.25}
.study-set-meta{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:9px;color:var(--muted);font-size:12px}
.study-set-meta>span{display:inline-flex;align-items:center;gap:5px;padding:5px 9px;border:1px solid var(--line);border-radius:999px;background:var(--soft)}
.study-set-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px}
.study-set-fields label:last-child{grid-column:1 / -1}
@media(max-width:760px){.study-language-fields{grid-template-columns:1fr}.study-set-language{grid-column:1}.study-set-fields{grid-template-columns:1fr}.study-set-fields label:last-child{grid-column:auto}}


/* Translation sprint: per-question countdown and pre-round settings. */
.sprint-setup {
  width: min(700px, 100%);
  margin: auto;
  padding: clamp(25px, 4vw, 42px);
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--blue) 7%, var(--card)), var(--card) 66%);
  box-shadow: var(--shadow);
  text-align: center;
}
.sprint-setup-kicker { color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.sprint-setup-title { margin: 8px 0 7px; color: var(--ink); font-size: clamp(25px, 3vw, 32px); font-weight: 650; letter-spacing: -.035em; }
.sprint-setup-copy { max-width: 490px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.sprint-time-label { align-self: flex-start; width: min(470px, 100%); margin: 27px auto 10px; color: var(--ink); font-size: 13px; font-weight: 650; text-align: left; }
.sprint-time-options { width: min(470px, 100%); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.sprint-time-option {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.sprint-time-option:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--blue) 50%, var(--line)); }
.sprint-time-option.is-selected { border-color: var(--blue); background: var(--soft); color: var(--blue); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 14%, transparent); }
.sprint-setup-note { margin: 13px 0 21px; color: var(--muted); font-size: 12px; }
.sprint-start { min-width: 210px; min-height: 48px; }
.sprint-status { width: min(700px, 100%); display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -5px 0 15px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.sprint-score, .sprint-streak { padding: 7px 11px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--card) 90%, transparent); }
.sprint-timer { width: min(700px, 100%); margin: 0 0 22px; }
.sprint-timer-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.sprint-timer-value { color: var(--ink); font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; transition: color .18s ease; }
.sprint-timer-track { height: 10px; overflow: hidden; border-radius: 99px; background: var(--soft); box-shadow: inset 0 1px 2px rgba(0,0,0,.08); }
.sprint-timer-track i { display: block; width: 100%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #62a77d, #8abf91); transform-origin: left center; transition: background .2s ease; }
.sprint-timer.is-urgent .sprint-timer-value { color: #d97743; }
.sprint-timer.is-urgent .sprint-timer-track i { background: linear-gradient(90deg, #d99b52, #dc744b); }
.sprint-timer.is-expired .sprint-timer-value { color: #cf4b58; }
.sprint-timer.is-expired .sprint-timer-track i { background: #cf4b58; }
.sprint-question { margin: 8px 0 24px; text-align: center; }
.sprint-choice-grid { width: min(700px, 100%); }
.sprint-choice-grid.is-timeout { animation: sprint-timeout-shake .34s ease both; }
.completion-stats.is-sprint-results { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@keyframes sprint-timeout-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
@media (max-width: 640px) {
  .sprint-setup { padding: 23px 16px; }
  .sprint-time-options { gap: 6px; }
  .sprint-time-option { min-height: 52px; font-size: 15px; }
  .sprint-status { font-size: 12px; }
  .completion-stats.is-sprint-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .sprint-time-option, .sprint-choice-grid.is-timeout { animation: none !important; transition: none !important; }
}

/* Audit fixes: vocabulary row management and truthful activity data. */
.collection-word{gap:18px;align-items:flex-start}.collection-word-copy{min-width:0;flex:1}.collection-word-actions{display:flex;align-items:flex-start;gap:10px;flex-shrink:0}.word-edit-details{position:relative}.word-edit-details>summary{cursor:pointer;color:var(--blue);font-size:13px;list-style:none}.word-edit-details>summary::-webkit-details-marker{display:none}.word-edit-form{position:absolute;z-index:20;right:0;top:26px;width:min(340px,calc(100vw - 48px));padding:16px;background:var(--card);border:1px solid var(--line);border-radius:14px;box-shadow:var(--shadow)}.word-edit-form label{margin:8px 0}.word-edit-form input{background:var(--bg)}.collection-word-actions form{margin:0}.activity-summary{font-size:13px;color:var(--muted);margin:8px 0 4px}.activity-day{position:relative}.activity-day .activity-value{font-size:11px;color:var(--muted);min-height:16px}.activity-day.is-today .activity-value{color:var(--blue)}.activity-day.is-today i{background:linear-gradient(180deg,#8f72d5,#6c4bb6)}.activity-day i{min-height:0}.statistics-detail{margin-top:18px}.statistics-footnote{color:var(--muted);font-size:12px;margin-top:14px}.review-sync-pending{font-size:12px;color:var(--muted);background:var(--soft);border-radius:10px;padding:10px 12px;margin-top:12px}

/* Two-factor authentication settings and sign-in challenge */
.twofa-settings{margin-top:8px;display:grid;gap:18px}
.twofa-settings-heading{display:flex;align-items:center;gap:14px}
.twofa-settings-icon,.twofa-login-icon{width:46px;height:46px;display:grid;place-items:center;border-radius:14px;background:var(--soft);color:var(--blue);font-size:19px;flex:0 0 auto}
.twofa-settings-heading h3{margin:0;font-size:19px;letter-spacing:-.25px}
.twofa-settings-heading p,.twofa-method-card p,.twofa-recovery-box p,.twofa-login-panel p{margin:4px 0 0;color:var(--muted);font-size:13px;line-height:1.55}
.twofa-methods{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.twofa-method-card{min-width:0;border:1px solid var(--line);border-radius:16px;background:color-mix(in srgb,var(--card) 92%,var(--soft));padding:18px;display:grid;align-content:start;gap:14px}
.twofa-method-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.twofa-method-top strong{font-size:15px}
.twofa-status{font-size:11px;font-weight:700;border-radius:999px;padding:5px 9px;white-space:nowrap}
.twofa-status.is-enabled{background:var(--green);color:#167346}
.twofa-status.is-disabled{background:var(--soft);color:var(--muted)}
.twofa-email-address{display:inline-block;color:var(--ink);font-weight:600;margin-top:5px;overflow-wrap:anywhere}
.twofa-action-form,.twofa-confirm-form,.twofa-disable-form,.twofa-regenerate-form{display:grid;gap:10px}
.twofa-action-form small{color:var(--muted);line-height:1.45}
.twofa-settings label,.twofa-login-form label{display:grid;gap:6px;margin:0;color:var(--muted);font-size:12px}
.twofa-settings input,.twofa-settings select,.twofa-login-form input,.twofa-login-form select{min-height:42px}
.twofa-setup-box{display:grid;justify-items:start;gap:12px}
.twofa-setup-box canvas{width:220px!important;height:220px!important;max-width:100%;border:8px solid #fff;border-radius:12px;background:#fff;box-shadow:0 4px 18px rgba(20,30,50,.08)}
.twofa-secret-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:9px 11px;border:1px solid var(--line);border-radius:10px;background:var(--bg)}
.twofa-secret-row code{font-size:13px;letter-spacing:1px;color:var(--ink);overflow-wrap:anywhere}
.twofa-recovery-box{border:1px solid color-mix(in srgb,#269b67 35%,var(--line));background:color-mix(in srgb,var(--green) 32%,var(--card));border-radius:15px;padding:17px;display:grid;gap:12px}
.twofa-recovery-box h4{margin:0;font-size:16px}
.twofa-recovery-codes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.twofa-recovery-codes code{display:block;background:var(--card);border:1px solid var(--line);border-radius:8px;padding:9px 10px;text-align:center;color:var(--ink);font-size:13px}
.twofa-recovery-manage{border-top:1px solid var(--line);padding-top:15px;display:grid;gap:12px}
.twofa-recovery-manage>span{font-size:13px;color:var(--muted)}
.twofa-regenerate-form{max-width:480px;grid-template-columns:repeat(2,minmax(0,1fr));align-items:end}
.twofa-regenerate-form button{grid-column:1/-1;justify-self:start}
.twofa-login-panel{display:grid;gap:14px;padding-top:8px}
.twofa-login-icon{width:54px;height:54px;font-size:22px}
.twofa-login-panel h3{font-size:22px;letter-spacing:-.45px;margin:0}
.twofa-login-form{display:grid;gap:13px}
.twofa-inline-action{margin-top:8px;text-align:center}
.twofa-inline-action .quiet{font-size:13px}
@media(max-width:760px){.twofa-methods{grid-template-columns:1fr}.twofa-regenerate-form{grid-template-columns:1fr}.twofa-recovery-codes{grid-template-columns:1fr 1fr}}
@media(max-width:420px){.twofa-recovery-codes{grid-template-columns:1fr}.twofa-method-top{flex-direction:column}}

/* Local authenticator QR setup layout. */
.twofa-manual-key{display:grid;gap:8px;margin-top:12px}
.twofa-qr-fallback{font-size:13px;color:var(--muted);margin:8px 0}
