.hero {
  padding:28px 0;
}

.hero h1 {
  font-size:32px;
}

.topbar {
  padding-bottom:22px;
}

.library-nav {
  display:flex;
  gap:6px;
  border-bottom:1px solid var(--line);
  margin-bottom:24px;
  padding-bottom:12px;
}

.library-nav button {
  background:transparent;
  border-color:transparent;
  min-width:110px;
}

.library-nav button[aria-current=page] {
  background:#302943;
  color:#dfd3ff;
  border-color:#594778;
}

.library-nav button:hover {
  background:#24283a;
}

.manual {
  margin:0 0 28px;
  border-color:#514367;
  background:linear-gradient(120deg,#211d32,var(--card));
}

.manual h2 {
  font-size:20px;
  margin-bottom:4px;
}

.manual .note {
  margin-bottom:18px;
}

.manual form input {
  flex:1;
  min-width:0;
}

.manual form button {
  white-space:nowrap;
}

.manual .status {
  margin-bottom:0;
  overflow-wrap:anywhere;
}

.entry-word {
  overflow-wrap:anywhere;
}

.entry .row {
  align-items:start;
}

.entry .row>div {
  min-width:0;
}

.entry .danger {
  flex-shrink:0;
}

button:disabled {
  cursor:default;
}

.study-panel {
  max-width:820px;
  margin:0 auto;
}

.study-setup {
  padding:32px;
}

.study-setup h2,.study-summary h2 {
  font-size:28px;
  letter-spacing:-.5px;
}

.study-options {
  display:grid;
  grid-template-columns:170px minmax(0,1fr);
  gap:20px;
}

.study-options label:last-child {
  grid-column:1/-1;
}

.study-options .row {
  gap:8px;
}

.study-setup .status:empty {
  display:none;
}

.study-empty {
  padding:18px;
  border:1px dashed #635180;
  border-radius:12px;
  color:#dfd3ff;
}

.study-run-header {
  margin-bottom:14px;
  color:var(--muted);
}

#studyProgress {
  width:100%;
  height:7px;
  accent-color:var(--accent);
  margin-bottom:24px;
  border:0;
  border-radius:20px;
  overflow:hidden;
}

#studyProgress::-webkit-progress-bar {
  background:var(--line);
}

#studyProgress::-webkit-progress-value {
  background:var(--accent);
  transition:width .2s;
}

.study-card {
  padding:32px;
  text-align:center;
  min-height:390px;
}

.study-card .eyebrow {
  margin:0;
  font-size:10px;
  letter-spacing:1.5px;
}

.study-card #studyTask {
  margin:32px 0 10px;
  font-size:14px;
}

#studyPrompt {
  font-size:clamp(28px,5vw,42px);
  line-height:1.25;
  overflow-wrap:anywhere;
  letter-spacing:-.7px;
  margin-bottom:32px;
}

.study-choices {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.study-choice {
  display:flex;
  text-align:left;
  align-items:center;
  gap:12px;
  min-height:64px;
  overflow-wrap:anywhere;
}

.study-choice>span:last-child {
  min-width:0;
}

.choice-number {
  display:grid;
  place-items:center;
  flex-shrink:0;
  width:27px;
  height:27px;
  border:1px solid #51556a;
  border-radius:8px;
  color:var(--muted);
  font-size:12px;
}

.study-typing {
  display:flex;
  gap:10px;
}

.study-typing input {
  min-width:0;
}

.study-feedback {
  margin-top:24px;
  border:1px solid;
  padding:18px;
  text-align:left;
  border-radius:12px;
  overflow-wrap:anywhere;
}

.study-feedback.correct,.study-choice.correct {
  background:#192f2b;
  border-color:#497c65;
  color:#b9e5bd;
  opacity:1;
}

.study-feedback.incorrect,.study-choice.incorrect {
  background:#332630;
  border-color:#925665;
  color:#ffd1d6;
  opacity:1;
}

.study-feedback p {
  font-size:20px;
  margin:8px 0 0;
}

.study-feedback .note {
  font-size:14px;
  color:inherit;
  opacity:.85;
}

.study-actions {
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:12px;
  margin-top:24px;
}

.study-actions:has(>[hidden]:only-child) {
  display:none;
}

.study-hint {
  margin:22px 0 0;
  font-size:12px;
}

.study-summary {
  text-align:center;
  padding:36px;
}

.study-summary-score {
  font-size:64px;
  font-weight:650;
  color:var(--accent);
  letter-spacing:-3px;
  margin:20px 0;
}

.study-review {
  list-style:none;
  padding:0;
  text-align:left;
  margin:28px 0 0;
  max-height:440px;
  overflow:auto;
}

.study-review:empty {
  display:none;
}

.study-review-row {
  display:grid;
  gap:6px;
  padding:16px 0;
  border-top:1px solid var(--line);
  overflow-wrap:anywhere;
}

.study-summary h2:focus {
  outline:none;
}

@media(max-width:600px) {
  .shell {
    padding:20px 16px;
  }
  .hero {
    align-items:center;
  }
  .hero h1 {
    font-size:26px;
  }
  .hero .eyebrow {
    font-size:9px;
    letter-spacing:1px;
  }
  .hero p {
    font-size:13px;
  }
  .count {
    font-size:30px;
  }
  .count-label {
    max-width:90px;
  }
  .library-nav button {
    min-width:0;
    flex:1;
    padding:10px;
  }
  .manual,.study-setup,.study-card,.study-summary {
    padding:20px;
  }
  .manual form {
    flex-wrap:wrap;
  }
  .manual form input {
    flex-basis:100%;
  }
  .manual form button {
    flex:1;
  }
  .study-options {
    grid-template-columns:1fr;
  }
  .study-options label:last-child {
    grid-column:auto;
  }
  .study-choices {
    grid-template-columns:1fr;
  }
  .study-typing {
    flex-direction:column;
  }
  .study-card .row {
    gap:8px;
  }
  .study-card .eyebrow {
    font-size:9px;
  }
  .study-summary-score {
    font-size:52px;
  }
  .toolbar {
    flex-wrap:wrap;
  }
  .toolbar input {
    flex-basis:100%;
  }
}

@media(prefers-reduced-motion:reduce) {
  #studyProgress::-webkit-progress-value {
    transition:none;
  }
}
/* Account controls share the same conflict UI with the mobile app. */
.sync-panel { margin:0 0 26px; }
.sync-panel > summary { font-size:15px; font-weight:600; }
.sync-panel[open] > summary { margin-bottom:16px; }
.sync-panel .stack { max-width:620px; }
.sync-steps { margin:0; font-size:14px; color:#d5d7e8; }
.sync-server { margin:0; }
.sync-server[open] summary { margin-bottom:10px; }
.sync-actions { margin-top:16px; flex-wrap:wrap; }
.sync-actions #syncNow { min-width:200px; padding:12px 22px; }
#syncMessage { margin:12px 0 0; font-size:14px; }
#syncUnlinkNote { margin:10px 0 0; }
.sync-conflict { border-top:1px solid var(--line); padding-top:18px; margin-top:18px; }
.sync-conflict .row { flex-wrap:wrap; }
