:root {
  --bg: #000000;
  --panel: #111111;
  --line: #2b2b2b;
  --line2: #3a3a3a;
  --text: #efefef;
  --muted: #a1a1a1;
  --btn: #1a1a1a;
  --btn2: #252525;
  --red: #c25555;
  --green: #4ca869;
  --blue: #4a77d0;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Arial, Helvetica, sans-serif; }
.shell { min-height: 100%; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; gap: 18px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: rgba(0,0,0,.96); }
.topbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brand { font-size: 22px; font-weight: 700; padding: 8px 8px 8px 4px; }
.nav { border: 1px solid var(--line2); background: var(--btn); color: var(--muted); border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 700; cursor: pointer; }
.nav:hover { background: var(--btn2); color: var(--text); }
.nav.active { background: #303030; color: var(--text); border-color: #3e3e3e; }
.mode-nav { min-width: 110px; }
.main { flex: 1; overflow: auto; padding: 26px 24px 40px; }
.view { display: none; }
.view.active { display: block; }

.page-header, .study-screen-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin: 0 auto 18px; width: min(1160px, 100%); }
.page-header.compact { margin-bottom: 14px; }
.page-header.centered, .centered-status { width: min(920px, 100%); }
.centered-status { margin: 0 auto 12px; color: var(--muted); min-height: 22px; }
h1, h2 { margin: 0 0 6px; font-size: 34px; }
h2 { font-size: 32px; }
p { margin: 0; color: var(--muted); }

.deck-home { position: relative; width: min(920px, 100%); margin: 0 auto; }
.practice-left-rail {
  position: absolute;
  left: -48px;
  top: 0;
  display: flex;
  justify-content: center;
}
.practice-left-rail .footer-action {
  width: 34px;
  min-height: 39px;
  padding: 10px 0;
  overflow: hidden;
  white-space: nowrap;
}
.deck-table-card { border: 1px solid var(--line); background: var(--panel); border-radius: 16px; overflow: visible; }
.deck-grid { display: grid; grid-template-columns: minmax(260px, 1fr) 86px 86px 94px 94px 250px; gap: 10px; align-items: center; }
.deck-table-head { padding: 16px 18px; color: var(--muted); font-size: 14px; font-weight: 700; border-bottom: 1px solid var(--line); }
.deck-row { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.batch-row, .selected-pool-row { position: relative; }
.deck-row:last-child { border-bottom: 0; }
.row-title { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.row-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.deck-num { color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.practice-row-actions { position: relative; }
.row-actions-head { min-height: 1px; }

.small-btn, .footer-action, .show-btn { border: 1px solid var(--line2); background: var(--btn); color: var(--text); border-radius: 10px; padding: 10px 13px; cursor: pointer; font-size: 14px; }
.small-btn:hover, .footer-action:hover, .show-btn:hover { background: var(--btn2); }
.footer-action.primary { border-color: var(--blue); }
.footer-action.danger { border-color: var(--red); color: #e09a9a; }
.deck-footer-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.footer-toggle {
  border: 1px solid var(--line2);
  background: var(--btn);
  color: var(--muted);
  border-radius: 10px;
  padding: 10px 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  min-height: 39px;
}
.footer-toggle:hover { background: var(--btn2); color: var(--text); }
.footer-toggle:has(input:checked) {
  border-color: var(--blue);
  color: var(--text);
  background: #141a24;
}
.spawn-toggle {
  gap: 8px;
}
.footer-select {
  border: 1px solid var(--line2);
  background: #0d0d0d;
  color: var(--text);
  border-radius: 8px;
  padding: 5px 8px;
  min-height: 28px;
  font: inherit;
  font-weight: 700;
}
.popup-toggle {
  gap: 10px;
}
.popup-threshold {
  width: 56px;
  min-width: 56px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line2);
  border-radius: 8px;
  background: #0d0d0d;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: center;
  appearance: textfield;
}
.popup-threshold::-webkit-outer-spin-button,
.popup-threshold::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.study-screen { width: min(920px, 100%); margin: 0 auto; }
.study-top-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-pill { border: 1px solid var(--line2); background: #0f0f0f; color: var(--muted); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.mini-pill b { color: var(--text); }
.study-deck-name { color: var(--muted); text-align: center; margin: 8px 0 12px; font-size: 13px; }
.study-wrap { width: min(700px, 100%); margin: 0 auto; }
.study-card, .study-answer { border: 1px solid var(--line2); background: #0b0b0b; border-radius: 12px; min-height: 420px; padding: 32px 26px; display: flex; align-items: center; justify-content: center; text-align: center; overflow-wrap: anywhere; }
.study-answer { min-height: 250px; margin-top: 14px; }
.drill-nav-row {
  display: flex;
  justify-content: flex-start;
  margin-top: 12px;
}
.drill-nav-row .small-btn {
  min-width: 72px;
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 8px;
}
.drill-nav-row .small-btn:disabled {
  opacity: .45;
  cursor: default;
}
.anki-face, .anki-answer { width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.face-context { color: #cbcbcb; font-size: clamp(20px, 2.4vw, 30px); line-height: 1.45; font-weight: 500; }
.face-main { font-size: clamp(56px, 7vw, 92px); line-height: 1.15; font-weight: 700; }
.answer-line { width: 100%; font-size: clamp(24px, 3vw, 40px); line-height: 1.35; }
.answer-label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.answer-sentence { width: 100%; padding-top: 4px; border-top: 1px solid #232323; }
.jp { font-family: "Yu Gothic", "Meiryo", "Noto Sans JP", Arial, sans-serif; }
.audio-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.sound-btn { border: 1px solid var(--line2); background: #131313; color: var(--text); border-radius: 999px; padding: 9px 12px; font-size: 13px; cursor: pointer; }
.sound-btn:hover { background: #1f1f1f; }
.show-btn { width: 100%; margin-top: 12px; padding: 14px 16px; font-size: 16px; }
.grade-row { display: grid; gap: 10px; margin-top: 12px; }
.grade-row.two { grid-template-columns: 1fr 1fr; }
.grade { border: 1px solid var(--line2); border-radius: 10px; color: var(--text); background: #161616; min-height: 62px; display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; cursor: pointer; font-weight: 700; }
.grade small { color: var(--muted); font-weight: 400; }
.grade:hover { filter: brightness(1.1); }
.miss { border-color: var(--red); background: #281111; }
.know { border-color: var(--green); background: #102212; }
.hidden { display: none !important; }

.search { width: min(420px, 100%); background: #101010; color: var(--text); border: 1px solid var(--line2); border-radius: 10px; padding: 12px 13px; outline: none; }
.search:focus { border-color: #5a5a5a; }
.deck-filter { background: #101010; color: var(--text); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; min-width: 240px; outline: none; }
.deck-filter:focus { border-color: #5a5a5a; }
.sort-filter { min-width: 150px; }
.toolbar {
  position: sticky;
  top: 62px;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 auto 12px;
  width: min(1160px, 100%);
  padding: 10px;
  background: rgba(0,0,0,.96);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px #0008;
}

.sticky-count {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 0;
  padding: 6px 4px;
  font-size: 13px;
  white-space: nowrap;
}
.sticky-count b { color: var(--text); }

.toggle { color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 6px; }
.batch-include-toggle {
  border: 1px solid var(--line2);
  background: #0d0d0d;
  border-radius: 8px;
  padding: 6px 8px;
  white-space: nowrap;
  min-height: 30px;
  width: fit-content;
  margin-top: 8px;
  font-size: 12px;
}
.batch-include-toggle:hover { color: var(--text); background: #181818; }
.batch-include-toggle:has(input:checked) {
  border-color: var(--blue);
  color: var(--text);
  background: #111827;
}
.batch-check-toggle {
  position: absolute;
  left: -48px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: #101010;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: transparent;
  flex: 0 0 auto;
}
.batch-check-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.batch-check-toggle span { font-size: 17px; font-weight: 800; line-height: 1; }
.batch-check-toggle:hover { background: #181818; border-color: #4b4b4b; }
.batch-check-toggle:has(input:checked) {
  border-color: var(--blue);
  background: #13305a;
  color: #dbeafe;
}
.batch-check-toggle:has(input:disabled) {
  opacity: .35;
  cursor: not-allowed;
}
.batch-gear-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 90;
  min-width: 150px;
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line2);
  border-radius: 10px;
  background: #0d0d0d;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
}
.batch-gear-menu .small-btn { width: 100%; text-align: left; }
.rows { width: min(1160px, 100%); margin: 0 auto; border: 1px solid var(--line); background: var(--panel); border-radius: 12px; overflow: visible; }
#batchCardRows,
#browserRows {
  width: min(1160px, 100%);
  margin: 0 auto;
}
.card-row { border-bottom: 1px solid var(--line); padding: 12px 14px; display: grid; grid-template-columns: 28px minmax(180px, 1.1fr) minmax(180px, 1fr) minmax(176px, 210px); gap: 12px; align-items: center; }
.card-row:last-child { border-bottom: 0; }
.pill { color: var(--muted); border: 1px solid var(--line2); background: #101010; border-radius: 999px; padding: 6px 9px; font-size: 12px; white-space: nowrap; }
.check { width: 18px; height: 18px; accent-color: #888; }

.stat-grid { width: min(1160px, 100%); margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat-card, .note-box { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 16px; }
.stat-card span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.stat-card b { font-size: 28px; }
.note-box { width: min(1160px, 100%); margin: 10px auto 0; display: grid; gap: 8px; }
.note-box b { color: var(--text); }
.data-panel {
  width: min(920px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  padding: 16px;
}
.data-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.data-stat {
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  border-radius: 0;
  padding: 10px 0;
}
.data-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}
.data-stat b {
  font-size: 24px;
}
.data-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.personalization-panel {
  width: min(920px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 16px;
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.theme-choice {
  border: 1px solid var(--line2);
  background: var(--btn);
  color: var(--text);
  border-radius: 6px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
}
.theme-choice:hover {
  background: var(--btn2);
}
.theme-choice.active {
  border-color: var(--accent);
  background: var(--accent-surface);
}
.custom-theme-choice {
  position: relative;
}
.custom-theme-choice input {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid #ffffff33;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}
.custom-theme-choice input::-webkit-color-swatch-wrapper {
  padding: 0;
}
.custom-theme-choice input::-webkit-color-swatch {
  border: 0;
  border-radius: 3px;
}
.theme-swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid #ffffff33;
}
.theme-swatch.forest { background: #81b64c; }
.theme-swatch.blue { background: #5b96ee; }
.theme-swatch.violet { background: #9b7cf6; }
.theme-swatch.amber { background: #d69a2d; }
.theme-swatch.rose { background: #d96a7b; }
.status { color: var(--muted); }

.goal-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, .66);
  z-index: 35;
}
.goal-popup-card {
  width: min(460px, 100%);
  border: 1px solid var(--line2);
  border-radius: 14px;
  background: #0d0d0d;
  padding: 20px 20px 18px;
  box-shadow: 0 18px 60px #000b;
  display: grid;
  gap: 14px;
  justify-items: start;
}
.goal-popup-title {
  font-size: 20px;
  font-weight: 700;
}
.goal-popup-body {
  color: var(--muted);
  line-height: 1.45;
}
.goal-popup .footer-action {
  min-width: 86px;
}
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #181818; color: var(--text); border: 1px solid var(--line2); border-radius: 10px; padding: 10px 13px; box-shadow: 0 12px 40px #0009; z-index: 30; }
img { max-width: 100%; height: auto; }

@media (max-width: 980px) {
  .deck-grid { grid-template-columns: minmax(180px, 1fr) 64px 78px 82px 82px 180px; }
  .card-row { grid-template-columns: 28px minmax(120px, 1fr) minmax(120px, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .topbar, .page-header, .study-screen-top { flex-direction: column; }
  .topbar-group.right { width: 100%; }
  .mode-nav { min-width: 0; }
  .deck-grid { grid-template-columns: 1fr; gap: 6px; }
  .deck-table-head { display: none; }
  .row-actions { justify-content: flex-start; }
  .study-card, .study-answer { min-height: 320px; }
  .grade-row.two { grid-template-columns: 1fr 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
}


.deck-settings-panel {
  margin: -2px 0 12px;
  padding: 14px 18px 16px;
  border: 1px solid var(--line);
  border-top: 0;
  background: #0d0d0d;
  border-radius: 0 0 14px 14px;
}

.spawn-panel {
  width: min(920px, 100%);
  margin: 0 auto;
  border-radius: 6px;
}

.spawn-grid {
  align-items: flex-start;
}

.deck-settings-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.deck-settings-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
}

.setting-item {
  min-width: 180px;
}

.deck-filter {
  background: #101010;
  color: var(--text);
  border: 1px solid var(--line2);
  border-radius: 10px;
  padding: 10px 12px;
}


.accuracy-badge {
  background: var(--acc-bg, #101010);
  border-color: var(--acc-border, var(--line2));
  color: var(--acc-text, var(--muted));
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.accuracy-badge.no-data {
  background: #101010;
  border-color: var(--line2);
  color: var(--muted);
}
.mini-accuracy {
  display: inline-block;
  min-width: 82px;
  text-align: center;
  color: var(--acc-text, var(--muted));
  border: 1px solid var(--acc-border, var(--line2));
  background: var(--acc-bg, #101010);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.accuracy-cell { display: flex; justify-content: center; }

.badge-stack {
  position: relative;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.plain-stat {
  color: #d8d8d8;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.batch-card-row .badge-stack,
#browserRows .card-row .badge-stack {
  position: static;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(76px, 1fr) 82px;
  grid-auto-rows: min-content;
  align-items: center;
  justify-items: start;
  column-gap: 10px;
  row-gap: 3px;
}

.batch-card-row,
#browserRows .card-row {
  position: relative;
}

.batch-card-row .remove-card-from-library-batch,
#browserRows .remove-card-from-batch {
  grid-column: 2;
  grid-row: 1 / span 3;
  justify-self: stretch;
  align-self: center;
  margin-top: 0;
  min-height: 38px;
}

@media (max-width: 1240px) {
  #batchCardRows,
  #browserRows {
    width: min(1160px, 100%);
    margin: 0 auto;
  }

  .batch-card-row .badge-stack,
  #browserRows .card-row .badge-stack {
    position: static;
    width: auto;
    display: flex;
    justify-content: flex-end;
  }
}

.recency-badge {
  background: var(--rec-bg, #101010);
  border-color: var(--rec-border, var(--line2));
  color: var(--rec-text, var(--muted));
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.recency-badge.no-data {
  background: #101010;
  border-color: var(--line2);
  color: var(--muted);
}

.mini-recency {
  display: inline-block;
  min-width: 64px;
  text-align: center;
  color: var(--rec-text, var(--muted));
  border: 1px solid var(--rec-border, var(--line2));
  background: var(--rec-bg, #101010);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.recency-cell { display: flex; justify-content: center; }


.batch-row {
  background: linear-gradient(90deg, rgba(74, 119, 208, 0.18), rgba(17, 17, 17, 0.55));
  border-bottom-color: #3d4f7a;
}

.batch-row .row-title::before {
  content: "● ";
  color: #7fa2ff;
}

.batch-sticky {
  border-color: #4a77d0;
  color: #dbe6ff;
}

.batch-btn {
  border-color: #4a77d0;
}

.mini-pill.active-batch {
  border-color: #4a77d0;
  background: #111827;
  color: #dbe6ff;
}


.active-batch-row {
  outline: 1px solid #7fa2ff;
  box-shadow: inset 0 0 0 1px rgba(127,162,255,.25);
}

.active-batch-row .row-sub::after {
  content: " · active";
  color: #dbe6ff;
}


/* Fix deck action buttons getting clipped on narrower screens. */
.deck-home {
  width: min(1080px, 100%);
}

.deck-grid {
  grid-template-columns: minmax(240px, 1fr) 82px 82px 104px 104px minmax(190px, 240px);
}

.row-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  justify-content: stretch;
  align-items: center;
}

.row-actions .toggle {
  grid-column: 1 / -1;
  justify-self: start;
}

.row-actions .small-btn {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  font-size: 13px;
}

.batch-row .row-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.batch-row .row-actions .small-btn {
  min-width: 0;
}

.deck-table-card {
  overflow-x: auto;
}

/* Browse now shows which cards are already inside batches. */
.in-batch-card {
  background: linear-gradient(90deg, rgba(60, 110, 190, 0.16), transparent 34%);
}

.batch-preview {
  min-height: 18px;
  margin-top: 5px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 12px;
}

.batch-membership-label,
.batch-membership-more {
  color: var(--muted);
}

.batch-membership-badge {
  display: inline-flex;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #3568b7;
  background: rgba(65, 120, 210, 0.18);
  color: #dbe9ff;
  border-radius: 999px;
  padding: 3px 7px;
}

@media (max-width: 980px) {
  .deck-grid {
    grid-template-columns: minmax(180px, 1fr) 64px 78px 90px 90px 176px;
  }
}

@media (max-width: 760px) {
  .deck-grid {
    grid-template-columns: 1fr;
  }

  .row-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}


/* Batch viewing/options updates */
.scope-sticky.active-batch,
.batch-sticky.active-batch {
  border-color: #3568b7;
  background: rgba(65, 120, 210, 0.18);
  color: #dbe9ff;
}

.batch-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.batch-actions .options-batch {
  grid-column: 1 / -1;
}

.batch-options-panel {
  border-color: #315fa8;
  background: #0b1018;
}

.batch-options-note {
  margin-top: 10px;
}

.danger-btn {
  border-color: var(--red) !important;
  color: #ffb8b8 !important;
}


/* Practice-page redesign: no source deck rows, just Selected + batches. */
.deck-home {
  width: min(1080px, 100%);
}

.deck-grid {
  grid-template-columns: minmax(260px, 1fr) 90px 110px 110px minmax(220px, 300px);
}

.selected-pool-row {
  background: rgba(74, 119, 208, 0.08);
}

.selected-pool-row .row-title {
  color: #dbe9ff;
}

.batch-row.active-batch-row {
  box-shadow: none;
}

@media (max-width: 980px) {
  .deck-grid {
    grid-template-columns: minmax(180px, 1fr) 70px 90px 90px 190px;
  }
}

@media (max-width: 760px) {
  .deck-grid {
    grid-template-columns: 1fr;
  }
}


/* Practice page: only selected + batches, no source-deck clutter. */
.deck-home { width: min(1080px, 100%); }
.deck-grid { grid-template-columns: minmax(260px, 1fr) 90px 110px 110px minmax(220px, 300px) !important; }
.deck-table-head.deck-grid > div:nth-child(3) { display: block; }
.selected-pool-row { background: transparent; }
.selected-pool-row .row-title { color: var(--text); }

/* Remove the old blue glow/active-batch styling. */
.batch-row,
.active-batch-row,
.in-batch-card {
  background: transparent !important;
  border-bottom-color: var(--line) !important;
  outline: none !important;
  box-shadow: none !important;
}
.batch-row .row-title::before { content: none !important; }
.active-batch-row .row-sub::after { content: none !important; }
.mini-pill.active-batch {
  border-color: var(--line2) !important;
  background: #0f0f0f !important;
  color: var(--muted) !important;
}
.batch-sticky { border-color: var(--line2) !important; color: var(--muted) !important; }
.batch-btn { border-color: var(--line2) !important; }

.remove-card-from-batch {
  padding: 6px 8px !important;
  font-size: 12px !important;
  border-color: var(--red) !important;
  color: #e09a9a !important;
}

@media (max-width: 980px) {
  .deck-grid { grid-template-columns: minmax(180px, 1fr) 70px 90px 90px 190px !important; }
}
@media (max-width: 760px) {
  .deck-grid { grid-template-columns: 1fr !important; }
}


/* Batches tab */
.batch-library-wrap {
  width: min(1160px, 100%);
  margin: 0 auto 18px;
}
.batch-library-card {
  overflow-x: auto;
}
.batch-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 90px 110px 110px minmax(220px, 300px);
  gap: 10px;
  align-items: center;
}
.batch-library-row {
  cursor: default;
}
.selected-batch-library-row {
  background: rgba(255,255,255,0.045);
  box-shadow: none !important;
}
.batch-cards-header {
  margin-top: 18px;
}
.batch-actions .small-btn,
.remove-card-from-library-batch,
.remove-card-from-batch {
  min-width: 0;
}
.active-batch-row,
.batch-row,
.selected-pool-row {
  box-shadow: none !important;
}
.active-batch-row {
  background: transparent !important;
  border-color: var(--line) !important;
}
.danger-btn {
  border-color: var(--red) !important;
  color: #e09a9a !important;
}

@media (max-width: 980px) {
  .batch-grid { grid-template-columns: minmax(180px, 1fr) 70px 90px 90px 190px; }
}
@media (max-width: 760px) {
  .batch-grid { grid-template-columns: 1fr; }
}


/* User-requested: no blue glow / no active batch styling on Practice rows. */
.batch-row,
.batch-row.active-batch-row,
.selected-pool-row {
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  border-bottom-color: var(--line) !important;
}

.batch-row .row-title::before,
.active-batch-row .row-sub::after {
  content: none !important;
}

.mini-pill.active-batch {
  border-color: var(--line2) !important;
  background: #0f0f0f !important;
  color: var(--muted) !important;
}


/* Requested cleanup: nav is Practice / Batches / Decks only, no stats page. */
.topbar-group.right { display: none !important; }

.deck-grid.practice-grid-simple,
.practice-pool-row {
  grid-template-columns: minmax(260px, 1fr) 90px minmax(140px, 220px) !important;
}

.practice-pool-row {
  align-items: center;
}

.practice-row-actions {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 10px !important;
}

.practice-row-actions .small-btn {
  width: auto !important;
}

.play-btn {
  min-width: 54px !important;
  border-color: #258b39 !important;
  background: #103d1b !important;
  color: #d8ffe0 !important;
  font-size: 18px !important;
  font-weight: 800 !important;
}

.play-btn:hover {
  background: #165524 !important;
}

.gear-btn {
  min-width: 44px !important;
  font-size: 18px !important;
}

.add-deck-header-btn {
  margin-top: 12px;
  width: fit-content;
}

.deck-table-head.deck-grid > div:nth-child(3) {
  text-align: right;
}

@media (max-width: 760px) {
  .deck-grid.practice-grid-simple,
  .practice-pool-row {
    grid-template-columns: 1fr !important;
  }

  .practice-row-actions {
    justify-content: flex-start !important;
  }
}


/* Fix: Practice keeps accuracy, selected has no plus, buttons live on the right. */
.deck-grid.practice-grid-simple,
.practice-pool-row {
  grid-template-columns: minmax(260px, 1fr) 90px 110px minmax(120px, 180px) !important;
}

.practice-row-actions {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 10px !important;
}

.practice-row-actions .small-btn {
  width: auto !important;
}

.play-btn {
  min-width: 54px !important;
  border-color: #258b39 !important;
  background: #103d1b !important;
  color: #d8ffe0 !important;
  font-size: 18px !important;
  font-weight: 800 !important;
}

.play-btn:hover {
  background: #165524 !important;
}

.gear-btn {
  min-width: 44px !important;
  font-size: 18px !important;
}

/* Fix: Batches page now matches Browse structure. */
.batch-toolbar {
  position: sticky;
  top: 65px;
  z-index: 15;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(10,10,10,.96);
  border-radius: 12px;
}

#batchLibrarySelect {
  min-width: 260px;
}

#batchLibraryCount {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-mini-accuracy {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  margin-left: 6px;
}

#batchOptionsPanel {
  width: min(1160px, 100%);
  margin: 0 auto 12px;
}

.play-inline-btn {
  border-color: #258b39 !important;
  background: #103d1b !important;
  color: #d8ffe0 !important;
}

.batch-card-row {
  background: var(--panel) !important;
}

.selected-pool-row {
  background: transparent !important;
}

.selected-pool-row .row-title {
  color: var(--text) !important;
}

@media (max-width: 760px) {
  .deck-grid.practice-grid-simple,
  .practice-pool-row {
    grid-template-columns: 1fr !important;
  }
  .batch-check-toggle {
    position: static;
    transform: none;
    margin: 0 0 8px;
  }
}


/* Badge consistency: every accuracy badge has the same shape/size. */
.accuracy-badge,
.mini-accuracy,
.pill.accuracy-badge,
.inline-mini-accuracy {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 64px !important;
  height: 26px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  border: 1px solid var(--acc-border, var(--line2)) !important;
  background: var(--acc-bg, #101010) !important;
  color: var(--acc-text, var(--muted)) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
}

.accuracy-badge.no-data {
  font-weight: 600 !important;
}

/* Cleaner Decks/Browse toolbar: keep the same actions, hide the chaos inside one menu. */
.browse-toolbar {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(10,10,10,.96);
}

.toolbar-main-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.browse-toolbar .deck-filter {
  min-width: 260px;
}

.primary-action {
  border-color: var(--blue) !important;
}

.actions-menu {
  position: relative;
}

.actions-menu summary {
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line2);
  background: var(--btn);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px;
  user-select: none;
}

.actions-menu summary::-webkit-details-marker {
  display: none;
}

.actions-menu[open] summary {
  background: var(--btn2);
}

.actions-menu-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 50;
  min-width: 220px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line2);
  border-radius: 12px;
  background: #0d0d0d;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
}

.actions-menu-panel .small-btn {
  width: 100%;
  text-align: left;
}

.selected-only-toggle {
  width: fit-content;
  margin-left: 2px;
}

.scope-sticky {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 760px) {
  .browse-toolbar .deck-filter {
    min-width: 0;
    width: 100%;
  }

  .actions-menu {
    width: 100%;
  }

  .actions-menu summary {
    width: 100%;
  }

  .actions-menu-panel {
    position: static;
    margin-top: 8px;
  }
}


/* Fix: Practice page shows Accuracy + Trained + actions. */
.deck-grid.practice-grid-simple,
.practice-pool-row {
  grid-template-columns: minmax(260px, 1fr) 76px 112px 96px 104px minmax(76px, 120px) !important;
}

.add-batch-select {
  min-width: 190px !important;
}

#addSelectedToBatch:disabled {
  opacity: .45;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .deck-grid.practice-grid-simple,
  .practice-pool-row {
    grid-template-columns: 1fr !important;
  }
}

/* Selectable interface shape; the true-black canvas stays unchanged. */
:root {
  --radius-control: 7px;
  --radius-panel: 9px;
  --radius-pill: 7px;
}

:root[data-shape="flat"] {
  --radius-control: 0px;
  --radius-panel: 0px;
  --radius-pill: 2px;
}

:root[data-shape="soft"] {
  --radius-control: 7px;
  --radius-panel: 9px;
  --radius-pill: 7px;
}

:root[data-shape="bubbly"] {
  --radius-control: 11px;
  --radius-panel: 14px;
  --radius-pill: 999px;
}

:root[data-shape="pill"] {
  --radius-control: 999px;
  --radius-panel: 18px;
  --radius-pill: 999px;
}

.topbar {
  padding: 10px 18px !important;
}

.nav,
.small-btn,
.footer-action,
.show-btn,
.grade,
.sound-btn,
.voice-btn,
.voice-start,
.deck-filter,
.search,
.footer-toggle,
.theme-choice,
.actions-menu summary,
.voice-play-menu summary,
.batch-include-toggle,
.batch-btn,
.add-deck-header-btn,
.selected-only-toggle,
.pick-btn {
  border-radius: var(--radius-control) !important;
  transition: background-color .14s ease, border-color .14s ease, transform .14s ease;
}

.nav:hover,
.small-btn:hover,
.footer-action:hover,
.show-btn:hover,
.sound-btn:hover,
.voice-btn:hover,
.voice-start:hover,
.theme-choice:hover,
.actions-menu summary:hover,
.voice-play-menu summary:hover {
  transform: translateY(-1px);
}

:root[data-shape="flat"] .nav:hover,
:root[data-shape="flat"] .small-btn:hover,
:root[data-shape="flat"] .footer-action:hover,
:root[data-shape="flat"] .show-btn:hover,
:root[data-shape="flat"] .sound-btn:hover,
:root[data-shape="flat"] .voice-btn:hover,
:root[data-shape="flat"] .voice-start:hover,
:root[data-shape="flat"] .theme-choice:hover,
:root[data-shape="flat"] .shape-choice:hover {
  transform: none;
}

.nav:active,
.small-btn:active,
.footer-action:active,
.show-btn:active,
.sound-btn:active,
.voice-btn:active,
.voice-start:active,
.theme-choice:active {
  transform: translateY(0);
}

.deck-table-card,
.rows,
.data-panel,
.personalization-panel,
.study-card,
.study-answer,
.note-box,
.stat-card,
.home-tile,
.deck-settings-panel,
.browse-options-panel,
.batch-add-panel,
.batch-options-panel,
.actions-menu-panel,
.voice-play-panel,
.batch-gear-menu {
  border-radius: var(--radius-panel) !important;
  overflow: hidden;
}

.toolbar,
.browse-toolbar,
.batch-toolbar {
  border-radius: var(--radius-panel) !important;
  padding: 10px 12px !important;
  border: 1px solid #242424 !important;
}

#cardsView .browse-toolbar,
#batchesView .batch-toolbar {
  border: 1px solid #242424 !important;
}

.deck-table-head {
  border-radius: var(--radius-panel) var(--radius-panel) 0 0 !important;
}

.batch-check-toggle,
.practice-left-rail .footer-action,
.theme-swatch {
  border-radius: var(--radius-control) !important;
}

/* Final bindings for the remaining Personalization options. */
:root {
  --surface-panel: #000000;
  --surface-control: #050505;
  --surface-line: #242424;
  --surface-shadow: none;
  --row-space: 12px;
  --control-space: 10px;
  --panel-space: 16px;
  --study-height: 420px;
  --ui-font: Arial, "Yu Gothic UI", "Meiryo", sans-serif;
}

:root[data-surface="black"] {
  --surface-panel: #000000;
  --surface-control: #050505;
  --surface-line: #242424;
  --surface-shadow: none;
}

:root[data-surface="soft"] {
  --surface-panel: #080808;
  --surface-control: #101010;
  --surface-line: #303030;
  --surface-shadow: none;
}

:root[data-surface="raised"] {
  --surface-panel: #090909;
  --surface-control: #121212;
  --surface-line: #353535;
  --surface-shadow: 0 10px 26px rgba(0, 0, 0, .55);
}

:root[data-density="compact"] {
  --row-space: 7px;
  --control-space: 7px;
  --panel-space: 12px;
  --study-height: 350px;
}

:root[data-density="balanced"] {
  --row-space: 12px;
  --control-space: 10px;
  --panel-space: 16px;
  --study-height: 420px;
}

:root[data-density="roomy"] {
  --row-space: 18px;
  --control-space: 13px;
  --panel-space: 22px;
  --study-height: 500px;
}

:root[data-type="clean"] {
  --ui-font: Arial, "Yu Gothic UI", "Meiryo", sans-serif;
}

:root[data-type="rounded"] {
  --ui-font: "Trebuchet MS", "Yu Gothic UI", "Meiryo", sans-serif;
}

:root[data-type="mono"] {
  --ui-font: Consolas, "Yu Gothic UI", "Meiryo", monospace;
}

body,
button,
input,
select,
textarea {
  font-family: var(--ui-font) !important;
}

.deck-table-card,
.rows,
.data-panel,
.personalization-panel,
.study-card,
.study-answer,
.note-box,
.stat-card,
.home-tile,
.deck-settings-panel,
.browse-options-panel,
.batch-add-panel,
.batch-options-panel,
.actions-menu-panel,
.voice-play-panel,
.batch-gear-menu {
  background: var(--surface-panel) !important;
  border-color: var(--surface-line) !important;
  box-shadow: var(--surface-shadow) !important;
}

.small-btn,
.footer-action,
.show-btn,
.grade,
.sound-btn,
.voice-btn,
.voice-start,
.deck-filter,
.search,
.footer-toggle,
.theme-choice,
.shape-choice,
.style-choice,
.actions-menu summary,
.voice-play-menu summary,
.batch-include-toggle,
.batch-btn,
.add-deck-header-btn,
.selected-only-toggle,
.pick-btn {
  background: var(--surface-control) !important;
}

.deck-row,
.card-row {
  padding-top: var(--row-space) !important;
  padding-bottom: var(--row-space) !important;
  background: var(--surface-panel) !important;
  border-color: var(--surface-line) !important;
}

.small-btn,
.footer-action,
.show-btn,
.deck-filter,
.search,
.footer-toggle,
.theme-choice,
.shape-choice,
.style-choice {
  padding-top: var(--control-space) !important;
  padding-bottom: var(--control-space) !important;
}

.personalization-panel,
.data-panel,
.note-box,
.stat-card,
.home-tile {
  padding: var(--panel-space) !important;
}

.study-card,
.study-answer {
  min-height: var(--study-height) !important;
}

:root[data-surface="raised"] .home-tile,
:root[data-surface="raised"] .study-card,
:root[data-surface="raised"] .study-answer,
:root[data-surface="raised"] .stat-card,
:root[data-surface="raised"] .theme-choice,
:root[data-surface="raised"] .shape-choice,
:root[data-surface="raised"] .style-choice {
  box-shadow: var(--surface-shadow) !important;
}

.style-choice.active {
  border-color: var(--accent) !important;
  background: var(--accent-surface) !important;
}

/* Microlearn */
.microlearn-panel {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: var(--panel-space);
  display: grid;
  gap: 16px;
  background: var(--surface-panel);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-panel);
  box-shadow: var(--surface-shadow);
}

.microlearn-options {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 12px;
}

.microlearn-option {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.microlearn-option .deck-filter {
  width: 100%;
  min-width: 0;
}

.micro-count-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.micro-count-choice {
  min-height: 40px;
  padding: 8px 12px;
  color: var(--text);
  background: var(--surface-control);
  border: 1px solid var(--line2);
  border-radius: var(--radius-control);
  cursor: pointer;
  font-weight: 800;
}

.micro-count-choice:hover {
  background: var(--btn2);
}

.micro-count-choice.active {
  color: var(--accent-text);
  background: var(--accent-surface);
  border-color: var(--accent);
}

.microlearn-preview {
  min-height: 54px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  background: var(--surface-control);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius-control);
}

.microlearn-preview b {
  color: var(--text);
  font-size: 18px;
}

.microlearn-start {
  width: 100%;
  min-height: 46px;
  justify-content: center;
}

.microlearn-history {
  display: grid;
  gap: 6px;
}

.micro-history-row {
  min-height: 42px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px 64px;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--surface-line);
}

.micro-history-row b,
.micro-history-row span:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.micro-complete {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.micro-complete span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.micro-complete b {
  font-size: clamp(38px, 8vw, 72px);
}

.micro-complete strong {
  color: var(--accent);
  font-size: 22px;
}

@media (max-width: 760px) {
  .microlearn-options {
    grid-template-columns: 1fr;
  }
}

.mini-pill,
.pill,
.mini-accuracy,
.mini-recency,
.attempts-badge,
.mini-attempts,
.plain-stat.attempts-badge,
.accuracy-badge,
.inline-mini-accuracy,
.recency-badge,
.plain-stat.accuracy-badge,
.plain-stat.recency-badge {
  border-radius: var(--radius-pill) !important;
}

.home-grid {
  gap: 12px;
}

.home-tile {
  padding: 16px;
  background: #050505 !important;
}

.study-card,
.study-answer {
  background: #050505 !important;
}

.toast {
  border-radius: var(--radius-pill) !important;
  padding-inline: 16px;
}

.personalization-panel {
  display: grid;
  gap: 22px;
}

.personalization-group {
  display: grid;
  gap: 10px;
}

.personalization-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.shape-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.shape-choice {
  min-height: 52px;
  border: 1px solid var(--line2);
  background: #050505;
  color: var(--text);
  border-radius: var(--radius-control);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
  transition: background-color .14s ease, border-color .14s ease, transform .14s ease;
}

.shape-choice:hover {
  background: #0d0d0d;
  transform: translateY(-1px);
}

.shape-choice.active {
  border-color: var(--accent);
  background: var(--accent-surface);
}

.shape-preview {
  width: 34px;
  height: 22px;
  flex: 0 0 auto;
  border: 2px solid var(--accent);
  background: #000;
}

.shape-preview.flat { border-radius: 0; }
.shape-preview.soft { border-radius: 6px; }
.shape-preview.bubbly { border-radius: 10px; }
.shape-preview.pill-shape { border-radius: 999px; }

.style-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 10px;
}

.style-choice {
  min-height: 48px;
  border: 1px solid var(--line2);
  background: #050505;
  color: var(--text);
  border-radius: var(--radius-control);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
}

.style-choice:hover {
  background: #0d0d0d;
}

.style-choice.active {
  border-color: var(--accent);
  background: var(--accent-surface);
}

.surface-preview {
  width: 34px;
  height: 22px;
  border: 1px solid #484848;
  border-radius: var(--radius-control);
}

.surface-preview.black { background: #000; }
.surface-preview.soft-surface { background: #0b0b0b; }
.surface-preview.raised {
  background: #0b0b0b;
  box-shadow: 0 4px 8px #000;
}

.type-clean { font-family: Arial, Helvetica, sans-serif; }
.type-rounded { font-family: "Trebuchet MS", "Yu Gothic UI", sans-serif; }
.type-mono { font-family: Consolas, "Yu Gothic UI", monospace; }

@media (max-width: 760px) {
  .topbar {
    padding-inline: 10px !important;
  }

  .shape-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .style-option-grid {
    grid-template-columns: 1fr;
  }
}

/* Saved practice sessions */
.session-panel {
  width: min(1160px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  background: #000000;
}

.session-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(120px, 1fr) 70px 90px minmax(170px, 1fr) minmax(150px, auto);
  gap: 14px;
  align-items: center;
}

.session-list-head {
  min-height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.session-row {
  min-height: 58px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.session-row:last-child { border-bottom: 0; }
.session-row > div { min-width: 0; overflow-wrap: anywhere; }

.session-current {
  margin-left: 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.session-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.session-actions .small-btn {
  min-width: 68px;
  border-radius: 2px;
}

.session-actions .danger {
  border-color: var(--red);
  color: #ff8080;
}

.session-empty {
  padding: 28px 14px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 760px) {
  .session-list-head { display: none; }
  .session-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
  }
  .session-row > div:nth-child(2),
  .session-row > div:nth-child(3),
  .session-row > div:nth-child(4),
  .session-row > div:nth-child(5) {
    color: var(--muted);
    font-size: 12px;
  }
  .session-actions {
    grid-column: 2;
    grid-row: 1 / span 3;
    flex-direction: column;
  }
}


.batch-add-panel {
  width: min(1160px, 100%);
  margin: 0 auto 12px;
}

.browse-options-panel {
  width: min(1160px, 100%);
  margin: -2px auto 12px;
  border-top: 1px solid var(--line);
  border-radius: 12px;
}

.batch-add-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.batch-add-controls .deck-filter {
  min-width: 260px;
}

.batch-add-check:disabled {
  opacity: .35;
  cursor: not-allowed;
}


/* Batches > Add from deck: explicit check / cross pick buttons. */
.pick-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pick-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: #141414;
  color: var(--muted);
  cursor: pointer;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.pick-btn:hover:not(:disabled) {
  background: #202020;
  color: var(--text);
}

.pick-yes.active,
.pick-yes:hover:not(:disabled) {
  border-color: #258b39;
  background: #103d1b;
  color: #d8ffe0;
}

.pick-no.active,
.pick-no:hover:not(:disabled) {
  border-color: #a84545;
  background: #321111;
  color: #ffd6d6;
}

.pick-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.picked-to-add-card {
  background: linear-gradient(90deg, rgba(37, 139, 57, .14), transparent 34%);
}

.pick-status {
  color: #d8ffe0;
  font-size: 12px;
}


/* Batches -> Add from deck: check/cross are vertical and instant. */
.pick-buttons.vertical {
  display: flex !important;
  flex-direction: column !important;
  gap: 6px !important;
  align-items: center !important;
  justify-content: center !important;
}

.pick-buttons.vertical .pick-btn {
  width: 32px;
  height: 28px;
  padding: 0;
}

.pick-btn:disabled {
  opacity: .32;
  cursor: not-allowed;
}

.pick-yes:not(:disabled) {
  border-color: #258b39;
  color: #d8ffe0;
}

.pick-no:not(:disabled) {
  border-color: #a94444;
  color: #ffd6d6;
}


/* Batch membership badges are shown in both Decks and Batches -> Add from deck. */
.batch-preview:empty {
  display: none;
}

.batch-preview {
  margin-top: 6px;
}


/* New empty batch support. */
#batchNewEmpty { white-space: nowrap; }
.practice-batch:disabled, .practice-batch-panel:disabled { opacity: .35; cursor: not-allowed; }


/* Voice controls in Practice */
.voice-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 8px;
}

.voice-btn {
  border: 1px solid var(--line2);
  background: #111;
  color: var(--text);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.voice-btn:hover {
  background: #181818;
}

.voice-status {
  min-height: 22px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 0 auto 10px;
}

.voice-status.ok { color: #b8f7c2; }
.voice-status.bad { color: #ffb5b5; }
.voice-status.listening { color: #d8e6ff; }


/* Voice mic sequence buttons */
.voice-row {
  gap: 8px;
}
.voice-btn {
  min-width: 0;
}
@media (max-width: 760px) {
  .voice-row {
    flex-direction: column;
  }
  .voice-btn {
    width: 100%;
  }
}

/* Voice options from the Practice play button */
.voice-play-menu {
  position: relative;
  display: inline-block;
}

.voice-play-menu summary {
  list-style: none;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line2);
  background: #111;
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  user-select: none;
}

.voice-play-menu summary::-webkit-details-marker {
  display: none;
}

.voice-play-menu[open] summary {
  background: #181818;
  border-color: #333;
}

.voice-play-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 80;
  min-width: 210px;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line2);
  border-radius: 12px;
  background: #0d0d0d;
  box-shadow: 0 16px 40px rgba(0,0,0,.55);
}

.voice-start {
  border: 1px solid var(--line2);
  background: #111;
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.voice-start:hover {
  background: #181818;
}

.voice-start:disabled {
  opacity: .35;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .voice-play-panel {
    right: auto;
    left: 0;
  }
}


.primary-voice {
  border-color: #258b39 !important;
  background: #103d1b !important;
  color: #d8ffe0 !important;
}

.voice-btn:disabled {
  opacity: .55;
  cursor: wait;
}

/* Keep Practice voice menus visible outside the table rows. */
.deck-home,
.deck-table-card,
#deckList,
.practice-pool-row,
.practice-row-actions {
  overflow: visible !important;
}

.voice-play-menu[open] {
  z-index: 120;
}

/* Flatter Practice surface */
.deck-table-card,
.rows,
.toolbar,
.data-panel,
.study-card,
.study-answer,
.note-box,
.stat-card {
  border-radius: 6px !important;
  box-shadow: none !important;
}

.deck-table-card,
.rows {
  background: #0f0f0f !important;
}

.deck-row {
  min-height: 72px;
}

.selected-pool-row,
.batch-row,
.batch-row.active-batch-row,
.active-batch-row {
  background: #0f0f0f !important;
  outline: none !important;
  box-shadow: none !important;
}

.row-sub:empty {
  display: none;
}

.small-btn,
.footer-action,
.show-btn,
.deck-filter,
.search,
.footer-toggle,
.mini-pill,
.voice-play-menu summary,
.voice-start,
.actions-menu summary,
.voice-play-panel,
.batch-gear-menu {
  border-radius: 6px !important;
  box-shadow: none !important;
}

.mini-accuracy,
.mini-recency,
.pill {
  border-radius: 6px !important;
  min-width: 78px;
}

.batch-check-toggle {
  border-radius: 6px !important;
  background: #0a0a0a !important;
  border-color: #343434 !important;
  color: transparent !important;
  box-shadow: none !important;
}

.batch-check-toggle span {
  font-size: 0 !important;
}

.batch-check-toggle:has(input:checked) {
  background: #182746 !important;
  border-color: #5f8eea !important;
}

.batch-check-toggle:has(input:checked)::after {
  content: "";
  width: 12px;
  height: 7px;
  border-left: 2px solid #e6efff;
  border-bottom: 2px solid #e6efff;
  transform: rotate(-45deg) translateY(-1px);
}

.batch-check-toggle:hover {
  background: #141414 !important;
  border-color: #555 !important;
}

.practice-left-rail .footer-action {
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 6px !important;
  background: #0a0a0a !important;
  border-color: #5f8eea !important;
  color: transparent !important;
  position: relative;
}

.practice-left-rail .footer-action::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 10px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 10px solid #e6efff;
}

.practice-left-rail .footer-action:hover {
  background: #121a2a !important;
}

/* Chess.com-inspired tone: warm charcoal, flat controls, green action accents. */
:root {
  --bg: #1f1f1c;
  --panel: #292825;
  --line: #3c3a36;
  --line2: #4d4a45;
  --btn: #302f2b;
  --btn2: #393733;
  --green: #81b64c;
  --blue: #81b64c;
  --accent: #81b64c;
  --accent-strong: #5c7f34;
  --accent-surface: #2f3f24;
  --accent-text: #f4ffe8;
}

:root[data-theme="blue"] {
  --accent: #5b96ee;
  --accent-strong: #315f9f;
  --accent-surface: #22334c;
  --accent-text: #eef5ff;
  --blue: #5b96ee;
}

:root[data-theme="violet"] {
  --accent: #9b7cf6;
  --accent-strong: #6348ac;
  --accent-surface: #342b4a;
  --accent-text: #f4f0ff;
  --blue: #9b7cf6;
}

:root[data-theme="amber"] {
  --accent: #d69a2d;
  --accent-strong: #8c641d;
  --accent-surface: #49361c;
  --accent-text: #fff5df;
  --blue: #d69a2d;
}

:root[data-theme="rose"] {
  --accent: #d96a7b;
  --accent-strong: #92404d;
  --accent-surface: #4b252d;
  --accent-text: #fff0f3;
  --blue: #d96a7b;
}

body,
.topbar,
.toolbar {
  background: var(--bg) !important;
}

.deck-table-card,
.rows,
.data-panel,
.study-card,
.study-answer {
  background: var(--panel) !important;
}

.deck-table-head,
.deck-row,
.card-row {
  border-color: var(--line) !important;
}

.batch-check-toggle:has(input:checked) {
  background: var(--accent-strong) !important;
  border-color: var(--accent) !important;
}

.batch-check-toggle:has(input:checked)::after {
  border-color: var(--accent-text) !important;
}

.practice-left-rail .footer-action {
  border-color: var(--accent) !important;
  background: var(--accent-surface) !important;
}

.practice-left-rail .footer-action::after {
  border-left-color: var(--accent-text) !important;
}

.practice-left-rail .footer-action:hover,
.footer-action.primary:hover,
.small-btn.primary-action:hover,
.play-inline-btn:hover {
  background: var(--accent-strong) !important;
}

.footer-toggle:has(input:checked),
.nav.active {
  border-color: var(--accent) !important;
  background: var(--accent-surface) !important;
}

.footer-action.primary,
.small-btn.primary-action,
.play-inline-btn,
.batch-btn,
.add-deck-header-btn,
.search:focus,
.deck-filter:focus {
  border-color: var(--accent) !important;
}

.footer-toggle input,
.toggle input,
.check {
  accent-color: var(--accent);
}

.mini-accuracy.accuracy-badge,
.mini-recency.recency-badge {
  border-width: 1px !important;
}

/* True-black ultra-flat pass */
:root {
  --bg: #000000;
  --panel: #000000;
  --line: #242424;
  --line2: #383838;
  --btn: #0a0a0a;
  --btn2: #111111;
}

html,
body,
.shell,
.main,
.topbar,
.toolbar,
.deck-table-card,
.rows,
.deck-row,
.selected-pool-row,
.batch-row,
.study-card,
.study-answer,
.data-panel,
.personalization-panel,
.deck-settings-panel,
.batch-gear-menu,
.voice-play-panel,
.actions-menu-panel {
  background: #000000 !important;
  box-shadow: none !important;
}

.deck-table-card,
.rows,
.toolbar,
.data-panel,
.personalization-panel,
.study-card,
.study-answer,
.small-btn,
.footer-action,
.show-btn,
.deck-filter,
.search,
.footer-toggle,
.mini-pill,
.mini-accuracy,
.mini-recency,
.pill,
.batch-check-toggle,
.voice-play-menu summary,
.voice-start,
.theme-choice,
.actions-menu summary {
  border-radius: 2px !important;
  box-shadow: none !important;
}

.deck-table-card,
.rows {
  border-color: #242424 !important;
}

.deck-table-head {
  padding-top: 12px !important;
  padding-bottom: 12px !important;
  background: #050505 !important;
}

.deck-row {
  min-height: 64px !important;
  padding-top: 12px !important;
  padding-bottom: 12px !important;
}

.deck-home {
  margin-top: 0 !important;
}

.centered-status {
  min-height: 0 !important;
  margin-bottom: 8px !important;
}

.mini-accuracy {
  min-width: 92px !important;
}

.deck-table-head.deck-grid > div {
  text-align: center;
}

.deck-table-head.deck-grid > div:first-child {
  text-align: left;
}

.deck-num,
.accuracy-cell,
.recency-cell {
  justify-content: center !important;
  text-align: center !important;
}

.topbar {
  border-bottom-color: #242424 !important;
}

/* Apply the same true-black flat system across every page. */
.page-header,
.study-screen-top {
  margin-bottom: 12px !important;
}

.page-header.no-title {
  justify-content: flex-end !important;
  margin-bottom: 10px !important;
}

.page-header h1,
.study-screen-top h2 {
  font-size: 26px !important;
  line-height: 1.15 !important;
}

.page-header p,
.study-screen-top p,
.row-sub,
.deck-settings-title,
.batch-options-note {
  color: #b6b6b6 !important;
}

.toolbar,
.browse-toolbar,
.batch-toolbar,
.deck-settings-panel,
.browse-options-panel,
.batch-add-panel,
.batch-options-panel,
.actions-menu-panel,
.voice-play-panel,
.batch-gear-menu {
  border-color: #242424 !important;
  background: #000000 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.toolbar,
.browse-toolbar,
.batch-toolbar {
  position: static !important;
  padding: 8px 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-radius: 0 !important;
}

.data-panel,
.personalization-panel,
.rows,
.deck-table-card,
.study-card,
.study-answer,
.note-box,
.stat-card {
  border-color: #242424 !important;
  background: #000000 !important;
  border-radius: 0 !important;
}

.data-stat {
  border-color: #242424 !important;
}

.card-row,
.deck-row,
.batch-library-row,
.in-batch-card,
.picked-to-add-card {
  background: #000000 !important;
  border-color: #242424 !important;
}

.small-btn,
.footer-action,
.show-btn,
.grade,
.sound-btn,
.voice-btn,
.voice-start,
.deck-filter,
.search,
.footer-toggle,
.theme-choice,
.actions-menu summary,
.voice-play-menu summary,
.batch-include-toggle,
.mini-pill,
.pill,
.mini-accuracy,
.mini-recency {
  background: #050505 !important;
  border-color: #383838 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.small-btn:hover,
.footer-action:hover,
.show-btn:hover,
.sound-btn:hover,
.voice-btn:hover,
.voice-start:hover,
.theme-choice:hover,
.actions-menu summary:hover,
.voice-play-menu summary:hover,
.footer-toggle:hover {
  background: #0d0d0d !important;
}

.nav {
  border-radius: 0 !important;
  box-shadow: none !important;
}

.theme-swatch,
.custom-theme-choice input,
.batch-check-toggle,
.practice-left-rail .footer-action {
  border-radius: 0 !important;
}

.miss {
  background: #120000 !important;
  border-color: #5c2424 !important;
}

.know {
  background: #001200 !important;
  border-color: #275c27 !important;
}

.toast {
  background: #000000 !important;
  border-color: #383838 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.accuracy-badge:not(.no-data),
.mini-accuracy.accuracy-badge:not(.no-data),
.pill.accuracy-badge:not(.no-data),
.inline-mini-accuracy.accuracy-badge:not(.no-data) {
  background: var(--acc-bg) !important;
  border-color: #000000 !important;
  color: #000000 !important;
}

.recency-badge:not(.no-data),
.mini-recency.recency-badge:not(.no-data),
.pill.recency-badge:not(.no-data) {
  background: var(--rec-bg) !important;
  border-color: #000000 !important;
  color: #000000 !important;
}

.accuracy-badge,
.mini-accuracy,
.pill.accuracy-badge,
.inline-mini-accuracy,
.recency-badge,
.mini-recency,
.pill.recency-badge,
.plain-stat.accuracy-badge,
.plain-stat.recency-badge {
  width: 104px !important;
  min-width: 104px !important;
  max-width: 104px !important;
  height: 26px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  font-variant-numeric: tabular-nums !important;
  border-radius: 2px !important;
}

/* Decks page cleanup */
#cardsView {
  width: min(1160px, 100%);
  margin: 0 auto;
}

#cardsView .deck-search-header,
#cardsView .browse-toolbar,
#browserRows {
  width: 100% !important;
}

#cardsView .deck-search-header {
  margin-bottom: 8px !important;
  padding: 0 !important;
}

#cardsView .deck-search-header .search {
  width: min(420px, 100%) !important;
}

#cardsView .browse-toolbar {
  display: grid !important;
  gap: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: #000000 !important;
}

.browse-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 0;
  border-top: 1px solid #242424;
}

.deck-action-row {
  justify-content: flex-end;
  border-bottom: 1px solid #242424;
}

.deck-control-row .scope-sticky {
  margin-left: auto;
}

#cardsView .add-deck-header-btn {
  margin: 0 !important;
  min-width: 92px;
}

#cardsView .deck-filter {
  min-width: 0 !important;
  height: 38px;
}

#deckFilter {
  width: 260px;
}

#addToBatchSelect {
  width: 220px;
}

#cardsView .selected-only-toggle {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid #383838;
  background: #050505;
  color: #efefef;
  margin: 0 !important;
}

#cardsView .sticky-count {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#browserRows {
  margin-top: 12px !important;
}

#browserRows .card-row {
  grid-template-columns: 32px minmax(240px, 1.05fr) minmax(320px, 1.35fr) 210px !important;
  min-height: 72px;
  padding: 12px 14px !important;
}

#browserRows .card-row .badge-stack {
  justify-content: start !important;
}

@media (max-width: 900px) {
  .browse-row {
    flex-wrap: wrap;
  }

  .deck-control-row .scope-sticky {
    margin-left: 0;
  }

  #deckFilter,
  #addToBatchSelect,
  #cardsView .deck-search-header .search {
    width: 100% !important;
  }
}

/* Make Decks and Batches read as the same interface. */
#cardsView,
#batchesView {
  width: min(1160px, 100%);
  margin: 0 auto;
}

#cardsView .page-header,
#batchesView .page-header,
#cardsView .toolbar,
#batchesView .toolbar,
#browserRows,
#batchCardRows {
  width: 100% !important;
}

#cardsView .page-header,
#batchesView .page-header {
  padding: 0 !important;
  margin-bottom: 10px !important;
}

#cardsView .search,
#batchesView .search {
  width: min(420px, 100%) !important;
}

#cardsView .browse-toolbar,
#batchesView .batch-toolbar {
  min-height: 58px;
  border-top: 1px solid #242424 !important;
  border-bottom: 1px solid #242424 !important;
  margin-bottom: 12px !important;
}

#batchesView .batch-toolbar {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

#batchesView .batch-toolbar .sticky-count {
  margin-right: auto;
}

#cardsView .deck-action-row,
#cardsView .deck-control-row,
#batchesView .batch-toolbar {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#browserRows,
#batchCardRows {
  margin-top: 12px !important;
}

#browserRows .card-row,
#batchCardRows .card-row {
  grid-template-columns: 36px minmax(260px, 1.05fr) minmax(360px, 1.35fr) 232px !important;
  min-height: 88px;
  padding: 14px 14px !important;
}

#browserRows .card-row > .badge-stack,
#batchCardRows .card-row > .badge-stack {
  display: grid !important;
  grid-template-columns: 104px 96px !important;
  grid-auto-rows: 26px !important;
  align-items: center !important;
  justify-content: end !important;
  justify-items: stretch !important;
  gap: 3px 12px !important;
  width: 100% !important;
}

#browserRows .card-row .accuracy-badge,
#browserRows .card-row .recency-badge,
#batchCardRows .card-row .accuracy-badge,
#batchCardRows .card-row .recency-badge {
  grid-column: 1 !important;
}

#browserRows .card-row .remove-card-from-batch,
#batchCardRows .card-row .remove-card-from-library-batch {
  grid-column: 2 !important;
  grid-row: 1 / span 4 !important;
  align-self: center !important;
  width: 82px !important;
  height: 38px !important;
}

#browserRows .card-check {
  justify-self: center;
}

#browserRows .check {
  width: 18px;
  height: 18px;
}

#cardsView .sticky-count,
#batchesView .sticky-count {
  gap: 4px;
}

#cardsView .row-title,
#batchesView .row-title {
  line-height: 1.25;
}

/* Practice home tiles */
.home-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.home-tile {
  border: 1px solid #242424;
  background: #000000;
  min-height: 118px;
  padding: 12px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 6px;
}

.home-label {
  color: #b6b6b6;
  font-size: 12px;
  font-weight: 700;
}

.home-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.home-meta {
  color: #b6b6b6;
  font-size: 12px;
  line-height: 1.35;
}

.home-tile .footer-action {
  width: fit-content;
  min-width: 116px;
}

.home-tile .footer-action:disabled {
  opacity: .45;
  cursor: default;
}

@media (max-width: 760px) {
  .home-grid {
    grid-template-columns: 1fr;
  }
}

/* Attempts display */
.attempts-badge,
.mini-attempts,
.plain-stat.attempts-badge {
  width: 104px !important;
  min-width: 104px !important;
  max-width: 104px !important;
  height: 26px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums !important;
  color: #efefef !important;
  background: #050505 !important;
  border: 1px solid #383838 !important;
  border-radius: 2px !important;
  white-space: nowrap !important;
}

.deck-grid.practice-grid-simple,
.practice-pool-row {
  grid-template-columns: minmax(260px, 1fr) 76px 112px 112px 112px minmax(76px, 120px) !important;
}

#browserRows .card-row > .badge-stack,
#batchCardRows .card-row > .badge-stack {
  grid-auto-rows: 26px !important;
}

#browserRows .card-row .attempts-badge,
#batchCardRows .card-row .attempts-badge {
  grid-column: 1 !important;
}

@media (max-width: 760px) {
  .deck-grid.practice-grid-simple,
  .practice-pool-row {
    grid-template-columns: 1fr !important;
  }
}

/* Final shape binding: intentionally last so the user's choice wins. */
.nav,
.small-btn,
.footer-action,
.show-btn,
.grade,
.sound-btn,
.voice-btn,
.voice-start,
.deck-filter,
.search,
.footer-toggle,
.theme-choice,
.shape-choice,
.actions-menu summary,
.voice-play-menu summary,
.batch-include-toggle,
.batch-btn,
.add-deck-header-btn,
.selected-only-toggle,
.pick-btn {
  border-radius: var(--radius-control) !important;
}

.deck-table-card,
.rows,
.data-panel,
.personalization-panel,
.study-card,
.study-answer,
.note-box,
.stat-card,
.home-tile,
.deck-settings-panel,
.browse-options-panel,
.batch-add-panel,
.batch-options-panel,
.actions-menu-panel,
.voice-play-panel,
.batch-gear-menu,
.toolbar,
.browse-toolbar,
.batch-toolbar {
  border-radius: var(--radius-panel) !important;
}

.mini-pill,
.pill,
.mini-accuracy,
.mini-recency,
.attempts-badge,
.mini-attempts,
.plain-stat.attempts-badge,
.accuracy-badge,
.inline-mini-accuracy,
.recency-badge,
.plain-stat.accuracy-badge,
.plain-stat.recency-badge,
.toast {
  border-radius: var(--radius-pill) !important;
}

.batch-check-toggle,
.practice-left-rail .footer-action,
.theme-swatch {
  border-radius: var(--radius-control) !important;
}

/* Final surface, density, and typography binding. */
body,
button,
input,
select,
textarea {
  font-family: var(--ui-font) !important;
}

.deck-table-card,
.rows,
.data-panel,
.personalization-panel,
.study-card,
.study-answer,
.note-box,
.stat-card,
.home-tile,
.deck-settings-panel,
.browse-options-panel,
.batch-add-panel,
.batch-options-panel,
.actions-menu-panel,
.voice-play-panel,
.batch-gear-menu {
  background: var(--surface-panel) !important;
  border-color: var(--surface-line) !important;
  box-shadow: var(--surface-shadow) !important;
}

.small-btn,
.footer-action,
.show-btn,
.grade,
.sound-btn,
.voice-btn,
.voice-start,
.deck-filter,
.search,
.footer-toggle,
.theme-choice,
.shape-choice,
.style-choice,
.actions-menu summary,
.voice-play-menu summary,
.batch-include-toggle,
.batch-btn,
.add-deck-header-btn,
.selected-only-toggle,
.pick-btn {
  background: var(--surface-control) !important;
}

.deck-row,
.card-row {
  padding-top: var(--row-space) !important;
  padding-bottom: var(--row-space) !important;
  background: var(--surface-panel) !important;
  border-color: var(--surface-line) !important;
}

.small-btn,
.footer-action,
.show-btn,
.deck-filter,
.search,
.footer-toggle,
.theme-choice,
.shape-choice,
.style-choice {
  padding-top: var(--control-space) !important;
  padding-bottom: var(--control-space) !important;
}

.personalization-panel,
.data-panel,
.note-box,
.stat-card,
.home-tile {
  padding: var(--panel-space) !important;
}

.study-card,
.study-answer {
  min-height: var(--study-height) !important;
}

.style-choice.active {
  border-color: var(--accent) !important;
  background: var(--accent-surface) !important;
}
