/* Extra workspace and embedded conjugation drill styles */
:root {
  --conj-c0: var(--accent-green, #10b981);
  --conj-c1: var(--accent-amber, #f59e0b);
  --conj-c2: var(--accent-orange, #f97316);
  --conj-c3: var(--error, #ef4444);
  --conj-c4: var(--text-muted, #8b949e);
}

#extraModal {
  overflow-y: auto;
}

.extra-modal-content {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 0 48px;
}

.extra-header {
  margin-bottom: 24px;
}

.extra-title {
  margin: 0 0 6px;
  font: 700 28px/1.2 var(--font-emphasis);
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.extra-subtitle {
  margin: 0;
  color: var(--text-secondary);
  font: 15px/1.5 var(--font-reading);
}

.extra-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 380px));
  gap: 16px;
  margin-top: 20px;
}

.extra-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  border: 1px solid var(--border-color);
  border-radius: 18px;
  background: var(--bg-card);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.extra-card:hover:not(:disabled) {
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.extra-card:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.extra-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--bg-tertiary);
  color: var(--accent-primary);
}

.extra-card-icon svg {
  width: 26px;
  height: 26px;
}

.extra-card-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.extra-card-copy strong {
  display: block;
  font: 700 17px/1.3 var(--font-emphasis);
  color: var(--text-primary);
}

.extra-card-copy small {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font: 13px/1.4 var(--font-reading);
}

.extra-card-arrow {
  flex: 0 0 auto;
  color: var(--text-muted);
  font: 600 20px/1 var(--font-reading);
  transition: transform .15s ease, color .15s ease;
}

.extra-card:hover:not(:disabled) .extra-card-arrow {
  color: var(--accent-primary);
  transform: translateX(3px);
}

/* ── Embedded Conjugations View ────────────────────────────── */
.extra-conjugations-view {
  width: 100%;
  --c0: var(--conj-c0);
  --c1: var(--conj-c1);
  --c2: var(--conj-c2);
  --c3: var(--conj-c3);
  --c4: var(--conj-c4);
}

.extra-conjugations-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.extra-conjugations-title {
  margin: 0;
  font: 700 24px/1.2 var(--font-emphasis);
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.extra-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 18px;
  line-height: 1;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}

.extra-close-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.extra-close-btn:active {
  transform: scale(0.95);
}

.extra-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 14px/1.4 var(--font-reading);
  color: var(--accent-primary);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background-color .15s ease, color .15s ease;
}

.extra-back-btn:hover {
  background: var(--bg-tertiary);
}

.extra-conjugations-view .tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
}

.extra-conjugations-view .tab {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}

.extra-conjugations-view .tab.is-active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.extra-conjugations-view .tab[disabled] {
  opacity: .4;
  cursor: default;
}

.extra-conjugations-view .screen {
  display: none;
}

.extra-conjugations-view .screen.is-active {
  display: block;
}

.extra-conjugations-view .stack {
  display: grid;
  gap: 12px;
  max-width: 680px;
  margin: 0 auto;
}

.extra-conjugations-view .setup-intro {
  margin: 4px 0 14px;
}

.extra-conjugations-view .setup-intro h1 {
  margin: 0;
  font: 700 24px/1.2 var(--font-emphasis);
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.extra-conjugations-view .setup-intro p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font: 14.5px/1.5 var(--font-reading);
}

.extra-conjugations-view .section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
}

.extra-conjugations-view .section > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  font-size: 14.5px;
  color: var(--text-primary);
}

.extra-conjugations-view .section > summary::-webkit-details-marker {
  display: none;
}

.extra-conjugations-view .section > summary::after {
  content: "\203A";
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform .15s ease;
  flex: none;
}

.extra-conjugations-view .section[open] > summary::after {
  transform: rotate(-90deg);
}

.extra-conjugations-view .section[open] > summary {
  border-bottom: 1px solid var(--border-color);
}

.extra-conjugations-view .section-name {
  font-weight: 600;
  font-size: 14.5px;
  flex: none;
  color: var(--text-primary);
}

.extra-conjugations-view .section-state {
  flex: 1;
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.extra-conjugations-view .section-body {
  padding: 14px 16px 16px;
}

.extra-conjugations-view .section-body-nested {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.extra-conjugations-view .section-body-nested .section {
  background: var(--bg-secondary);
}

.extra-conjugations-view .field {
  margin-top: 14px;
}

.extra-conjugations-view .field-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.extra-conjugations-view .hint {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.45;
}

.extra-conjugations-view .hint.centred {
  text-align: center;
  margin-top: 12px;
}

.extra-conjugations-view select,
.extra-conjugations-view input[type="search"] {
  width: 100%;
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
}

.extra-conjugations-view input[type="range"] {
  width: 100%;
  accent-color: var(--accent-primary);
}

.extra-conjugations-view .checks {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.extra-conjugations-view .checks-inline {
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.extra-conjugations-view .check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
  user-select: none;
  color: var(--text-primary);
}

.extra-conjugations-view .check:has(input:checked) {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
}

.extra-conjugations-view .check input {
  accent-color: var(--accent-blue, #3b82f6);
  margin: 0;
}

.extra-conjugations-view .check-name {
  flex: 1;
}

.extra-conjugations-view .check-count {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.extra-conjugations-view .check.is-empty {
  opacity: .45;
}

.extra-conjugations-view .swatch {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
}

.extra-conjugations-view .mood-group {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.extra-conjugations-view .mood-group[open] {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.12);
}

.extra-conjugations-view .mood-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
  transition: background-color 0.15s ease;
}

.extra-conjugations-view .mood-head::-webkit-details-marker {
  display: none;
}

.extra-conjugations-view .mood-head:hover {
  background: rgba(255, 255, 255, 0.05);
}

.extra-conjugations-view .mood-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.extra-conjugations-view .mood-chevron {
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  color: var(--text-muted, #71717a);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.15s ease;
}

.extra-conjugations-view .mood-group[open] .mood-chevron {
  transform: rotate(90deg);
  color: var(--text-primary, #ffffff);
}

.extra-conjugations-view .mood-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary, #ffffff);
}

.extra-conjugations-view .mood-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted, #a1a1aa);
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 7px;
  border-radius: 9999px;
  letter-spacing: 0.01em;
}

.extra-conjugations-view .mood-toggle-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 12px;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: lowercase;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #d4d4d8;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.extra-conjugations-view .mood-toggle-pill:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  color: #ffffff;
}

.extra-conjugations-view .mood-toggle-pill:active {
  transform: scale(0.95);
}

.extra-conjugations-view .mood-body {
  padding: 0 14px 12px 14px;
}

.extra-conjugations-view .compound-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  flex: none;
}

.extra-conjugations-view .pattern-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.extra-conjugations-view .mood-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 9999px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary, #a1a1aa);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.extra-conjugations-view .mood-more:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.extra-conjugations-view button.linkish {
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--text-secondary, #a1a1aa);
  cursor: pointer;
  padding: 2px 0;
  transition: color 0.15s ease;
}

.extra-conjugations-view button.linkish:hover {
  color: var(--text-primary, #ffffff);
}

.extra-conjugations-view .summary {
  position: static;
  margin-top: 0;
  margin-bottom: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 18px;
  align-items: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.extra-conjugations-view .summary-main {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.extra-conjugations-view .summary-count {
  font-family: var(--font-emphasis);
  font-size: 30px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.extra-conjugations-view .summary-unit {
  color: var(--text-muted);
  font-size: 14px;
}

.extra-conjugations-view .summary-detail {
  grid-column: 1;
  grid-row: 2;
  font-size: 13px;
  color: var(--text-secondary);
}

/* The bar is tappable (it reveals its key). The transparent borders enlarge
   the hit area without making the visible bar any thicker. */
.extra-conjugations-view .summary-bar {
  grid-column: 1 / -1;
  display: flex;
  height: 6px;
  box-sizing: content-box;
  border-block: 5px solid transparent;
  margin-block: -5px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-secondary);
  background-clip: padding-box;
  cursor: pointer;
}

.extra-conjugations-view .summary-bar span {
  display: block;
}

.extra-conjugations-view .summary-bar .bar-known { background: #22c55e; }
.extra-conjugations-view .summary-bar .bar-learning { background: #f5a623; }
.extra-conjugations-view .summary-bar .bar-missed { background: #ef4444; }

.extra-conjugations-view .summary-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.extra-conjugations-view .summary-actions [hidden] {
  display: none;
}

/* The bar's key, shown when the bar is tapped */
.extra-conjugations-view .summary-progress {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.extra-conjugations-view .summary-progress[hidden] {
  display: none;
}

.extra-conjugations-view .legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.extra-conjugations-view .legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}
.extra-conjugations-view .legend-dot.dot-known { background: #22c55e; }
.extra-conjugations-view .legend-dot.dot-learning { background: #f5a623; }
.extra-conjugations-view .legend-dot.dot-missed { background: #ef4444; }
.extra-conjugations-view .legend-dot.dot-new {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

.extra-conjugations-view button.primary,
.extra-conjugations-view button.secondary,
.extra-conjugations-view button.ghost {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: 9px;
  padding: 9px 18px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: opacity .15s ease, background-color .15s ease;
}

.extra-conjugations-view button.primary,
.extra-conjugations-view #start {
  background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 10px rgba(225, 29, 72, 0.3);
  transition: all 0.15s ease;
}

.extra-conjugations-view button.primary:hover:not([disabled]),
.extra-conjugations-view #start:hover:not([disabled]) {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.45);
  transform: translateY(-1px);
}

.extra-conjugations-view button.primary[disabled],
.extra-conjugations-view #start[disabled] {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #71717a);
  border-color: transparent;
  box-shadow: none;
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.extra-conjugations-view button.secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.extra-conjugations-view button.ghost {
  background: none;
  color: var(--text-secondary);
}

/* Drill Screen */
.extra-conjugations-view .drill-wrap {
  max-width: 560px;
  margin: 0 auto;
}

.extra-conjugations-view .drill-head {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}

.extra-conjugations-view .drill-progress {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.extra-conjugations-view .card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 34px 24px;
  text-align: center;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.extra-conjugations-view .card:hover {
  border-color: var(--border-light, var(--text-muted));
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.18);
}

.extra-conjugations-view .card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

/* Person → tense: one linked prompt ("translate this person into this tense") */
.extra-conjugations-view .card-cue {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.extra-conjugations-view .card-arrow {
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
}

/* ── Tense: set exactly like the person it pairs with ── */
.extra-conjugations-view .card-tense {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.extra-conjugations-view .card-tense-name {
  font-family: var(--font-emphasis);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Mood tag: only shown for a non-indicative mood when moods are mixed */
.extra-conjugations-view .card-mood-pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}
.extra-conjugations-view .card-mood-pill[data-mood*="subj"] {
  color: #c084fc;
  border-color: rgba(167, 139, 250, 0.45);
  background: rgba(167, 139, 250, 0.12);
}
.extra-conjugations-view .card-mood-pill[data-mood*="imp"] {
  color: var(--accent-amber);
  border-color: rgba(245, 166, 35, 0.45);
  background: rgba(245, 166, 35, 0.12);
}

/* The clue line. Sits with the tense as card metadata */
.extra-conjugations-view .card-clue {
  font-family: var(--font-reading);
  font-size: 12.5px;
  letter-spacing: .03em;
  color: var(--clue-colour, var(--text-muted));
  padding: 4px 12px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  display: inline-block;
  margin: 0 auto;
}

/* `display: inline-block` above would otherwise beat [hidden] and leave an
   empty padded pill (a stub oval) on the card whenever there is no clue. */
.extra-conjugations-view .card-clue[hidden] {
  display: none;
}

/* ── Prompt section: Subject & Verb ── */
.extra-conjugations-view .card-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 4px 0;
}

.extra-conjugations-view .card-subject-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.extra-conjugations-view .card-subject-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.extra-conjugations-view .card-person {
  font-family: var(--font-emphasis);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.extra-conjugations-view .card-verb {
  font-family: var(--font-emphasis);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-primary);
}

.extra-conjugations-view .card-verb.is-clued #card-headword {
  color: var(--clue-colour, inherit);
}

.extra-conjugations-view .card-translation {
  display: block;
  font-family: var(--font-reading);
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ── Answer section ── */
.extra-conjugations-view .card-answer {
  border-top: 1px solid var(--border-color);
  margin-top: 10px;
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* `display: flex` above would otherwise beat the [hidden] attribute and show
   the answer before the card is tapped. */
.extra-conjugations-view .card-answer[hidden] {
  display: none;
}

.extra-conjugations-view .card-form {
  font-family: var(--font-emphasis);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-primary);
}

.extra-conjugations-view .form-ending {
  color: var(--ending-colour, inherit);
}

.extra-conjugations-view .card-form .form-stem {
  opacity: .88;
  font-weight: 600;
}

.extra-conjugations-view .card-chips {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.extra-conjugations-view .chip {
  font-size: 12px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.extra-conjugations-view .chip-action {
  font-family: inherit;
  border: 1px solid var(--border-color);
  cursor: pointer;
  color: var(--accent-primary);
  background: transparent;
}

/* Icon-only tools (full table, example sentences), one line under the pill */
.extra-conjugations-view .card-tools {
  flex-basis: 100%;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.extra-conjugations-view .card-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}

.extra-conjugations-view .card-tool:hover,
.extra-conjugations-view .card-tool[aria-expanded="true"] {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
}

.extra-conjugations-view .card-examples {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
  text-align: left;
}

.extra-conjugations-view .card-example {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-secondary);
}

.extra-conjugations-view .card-example-target {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.4;
}

.extra-conjugations-view .card-example-target mark {
  background: none;
  color: var(--accent-primary);
  font-weight: 650;
}

.extra-conjugations-view .card-example-english {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.35;
}

.extra-conjugations-view .grade {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}

.extra-conjugations-view .grade[hidden] {
  display: none;
}

.extra-conjugations-view .grade button {
  flex: 1;
  max-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.extra-conjugations-view .grade kbd {
  opacity: .7;
  font: inherit;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.1);
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 1px 5px;
}

.extra-conjugations-view .grade-hit {
  background: var(--conj-c0) !important;
  color: #fff !important;
  border-color: transparent !important;
}

.extra-conjugations-view .grade-hit kbd {
  background: rgba(255, 255, 255, .2);
  border-color: rgba(255, 255, 255, .4);
  color: #fff;
  opacity: 1;
}

.extra-conjugations-view .grade-miss {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

.extra-conjugations-view .done {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
}

.extra-conjugations-view .done[hidden],
.extra-conjugations-view .card[hidden] {
  display: none;
}

.extra-conjugations-view .done h2 {
  margin: 0;
  font: 700 22px/1.2 var(--font-emphasis);
  color: var(--text-primary);
}

.extra-conjugations-view .done-score {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.extra-conjugations-view .done-missed {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  text-align: left;
  display: grid;
  gap: 4px;
}

.extra-conjugations-view .done-missed li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--bg-secondary);
  font-size: 14px;
  color: var(--text-primary);
}

.extra-conjugations-view .done-missed .done-prompt {
  color: var(--text-secondary);
}

.extra-conjugations-view .done-missed b {
  font-family: var(--font-emphasis);
  color: var(--conj-c3);
}

.extra-conjugations-view .done-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 20px;
}

.extra-conjugations-view .done-actions [hidden] {
  display: none;
}

/* Tables Screen */
.extra-conjugations-view .tables-wrap {
  max-width: 760px;
  margin: 0 auto;
}

.extra-conjugations-view .tables-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding-left: 0;
  font-size: 15px;
}

.extra-conjugations-view .lookup {
  display: flex;
  gap: 8px;
}

.extra-conjugations-view .lookup input[type="search"] {
  flex: 2;
}

.extra-conjugations-view .lookup select {
  flex: 1;
  min-width: 0;
}

.extra-conjugations-view .results {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.extra-conjugations-view .results button {
  font: inherit;
  font-size: 13px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
}

.extra-conjugations-view .results button.is-active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.extra-conjugations-view .paradigm {
  margin-top: 22px;
}

.extra-conjugations-view .paradigm h3 {
  margin: 0 0 2px;
  font-size: 20px;
  font-family: var(--font-emphasis);
  color: var(--text-primary);
}

.extra-conjugations-view .paradigm .sub {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 14px;
}

.extra-conjugations-view .ptable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 10px;
}

.extra-conjugations-view .ptable caption {
  text-align: left;
  font-size: 12px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 0 5px;
}

.extra-conjugations-view .ptable td,
.extra-conjugations-view .ptable th {
  border-top: 1px solid var(--border-color);
  padding: 6px 8px;
  text-align: left;
  font-weight: 400;
  color: var(--text-primary);
}

.extra-conjugations-view .ptable th {
  color: var(--text-muted);
  font-size: 13px;
  width: 40%;
}

.extra-conjugations-view .ptable td b {
  font-weight: 600;
  font-family: var(--font-emphasis);
}

.extra-conjugations-view .ptable td .form-stem {
  opacity: .62;
  color: var(--text-primary);
}

.extra-conjugations-view .legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 16px;
}

.extra-conjugations-view .legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.extra-conjugations-view .pdot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: 8px;
  vertical-align: middle;
  background: var(--text-muted);
}

.extra-conjugations-view .pdot.is-known {
  background: var(--conj-c0);
}

.extra-conjugations-view .pdot.is-learning {
  background: var(--conj-c1);
}

.extra-conjugations-view .pdot.is-missed {
  background: var(--conj-c3);
}

@media (max-width: 640px) {
  .extra-options-grid {
    grid-template-columns: 1fr;
  }
  .extra-conjugations-view .summary {
    grid-template-columns: 1fr;
  }
  .extra-conjugations-view .summary-main,
  .extra-conjugations-view .summary-detail,
  .extra-conjugations-view .summary-actions {
    grid-column: 1;
    grid-row: auto;
  }
  .extra-conjugations-view .summary-actions {
    justify-content: stretch;
    margin-top: 12px;
  }
  .extra-conjugations-view .summary-actions button {
    flex: 1;
  }
}

@media (min-width: 900px) {
  .extra-conjugations-view .card {
    min-height: 440px;
    padding: 46px 36px;
    gap: 22px;
  }
  .extra-conjugations-view .card-tense-name { font-size: 34px; }
  .extra-conjugations-view .card-subject-label { font-size: 12px; }
  .extra-conjugations-view .card-person { font-size: 34px; }
  .extra-conjugations-view .card-verb { font-size: 44px; }
  .extra-conjugations-view .card-translation { font-size: 17px; }
  .extra-conjugations-view .card-form { font-size: 52px; }
}

/* ── Embedded Song Picker View ────────────────────────────── */
.extra-song-picker-view {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.extra-song-picker-topbar {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-color);
}

.extra-song-search-wrap {
  margin-bottom: 16px;
}

.extra-song-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.extra-search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.extra-song-search-input {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 42px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font: 14.5px/1.4 var(--font-reading);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.extra-song-search-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.extra-clear-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.extra-clear-btn:hover {
  color: var(--text-primary);
}

.extra-spotify-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(30, 215, 96, 0.08);
  border: 1px solid rgba(30, 215, 96, 0.25);
  border-radius: 12px;
  margin-bottom: 18px;
}

.extra-spotify-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.extra-spotify-banner-icon {
  color: #1ed760;
  flex-shrink: 0;
}

.extra-spotify-banner-title {
  font: 500 13.5px/1.4 var(--font-reading);
  color: var(--text-primary);
}

.extra-spotify-action-btn {
  padding: 6px 14px;
  font: 600 13px/1.4 var(--font-reading);
  border-radius: 999px;
  background: #1ed760;
  color: #000;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s ease, transform .15s ease;
}

.extra-spotify-action-btn:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.extra-spotify-tray {
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.extra-spotify-tray-inner {
  display: flex;
  gap: 8px;
}

.extra-spotify-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font: 14px/1.4 var(--font-reading);
  outline: none;
}

.extra-spotify-input:focus {
  border-color: var(--accent-primary);
}

.extra-spotify-submit-btn {
  padding: 0 18px;
  height: 40px;
  border-radius: 8px;
  background: var(--accent-primary);
  color: #fff;
  font: 600 13.5px/1.4 var(--font-reading);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s ease;
}

.extra-spotify-submit-btn:hover {
  opacity: 0.9;
}

.extra-songs-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.extra-song-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.extra-song-item:hover {
  border-color: var(--accent-primary);
  background: var(--bg-secondary);
  transform: translateX(2px);
}

.extra-song-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.extra-song-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  flex-shrink: 0;
}

.extra-song-item-title {
  font: 600 14.5px/1.3 var(--font-reading);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.extra-song-item-artist {
  font: 13px/1.4 var(--font-reading);
  color: var(--text-secondary);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.extra-song-item-arrow {
  color: var(--text-muted);
  font: 600 18px/1 var(--font-reading);
  flex-shrink: 0;
  transition: transform .15s ease, color .15s ease;
}

.extra-song-item:hover .extra-song-item-arrow {
  transform: translateX(3px);
  color: var(--accent-primary);
}

.extra-songs-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-secondary);
  font: 14px/1.5 var(--font-reading);
}

/* One exit: the close button. Title on the left, close on the right. */
.extra-conjugations-topbar { gap: 12px; }
.extra-conjugations-title { margin-right: auto; }

/* An active drill is ONE surface: the progress count and the close button sit
   in its top row, and the card inside is flat (no box within a box).
   On desktop it sizes compactly to fit completely within the viewport without scrolling. */
#extraModal:has(.extra-conjugations-view.is-drilling) {
  padding: 16px 24px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
#extraModal:has(.extra-conjugations-view.is-drilling) > .modal-content {
  max-width: 760px;
  width: 100%;
  padding-bottom: 0;
  margin: auto;
}
.extra-conjugations-view.is-drilling {
  position: relative;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  max-height: calc(100dvh - 36px);
  padding: 0 24px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
}
.extra-conjugations-view.is-drilling .extra-conjugations-title { display: none; }
.extra-conjugations-view.is-drilling .extra-conjugations-topbar {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  margin: 0;
  padding: 0;
  border: 0;
}
.extra-conjugations-view.is-drilling #extraConjugationsContainer {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.extra-conjugations-view.is-drilling #screen-drill.is-active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.extra-conjugations-view.is-drilling .drill-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 0;
}
.extra-conjugations-view.is-drilling .drill-head {
  height: 44px;
  margin: 0;
  padding: 0 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.extra-conjugations-view.is-drilling .card {
  min-height: 0;
  padding: 16px 4px 12px;
  gap: 12px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.extra-conjugations-view.is-drilling .card:hover {
  border: 0;
  box-shadow: none;
}
.extra-conjugations-view.is-drilling .card-prompt {
  margin: 2px 0;
  gap: 8px;
}
.extra-conjugations-view.is-drilling .card-cue {
  gap: 6px 10px;
}
.extra-conjugations-view.is-drilling .card-person {
  font-size: 24px;
}
.extra-conjugations-view.is-drilling .card-tense-name {
  font-size: 24px;
}
.extra-conjugations-view.is-drilling .card-verb {
  font-size: 28px;
}
.extra-conjugations-view.is-drilling .card-translation {
  font-size: 14px;
  margin-top: 2px;
}
.extra-conjugations-view.is-drilling .card-answer {
  margin-top: 6px;
  padding-top: 10px;
  gap: 6px;
}
.extra-conjugations-view.is-drilling .card-form {
  font-size: 32px;
}
.extra-conjugations-view.is-drilling .card-chips {
  margin-top: 4px;
}
.extra-conjugations-view.is-drilling .card-examples {
  margin: 6px 0 0;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}
.extra-conjugations-view.is-drilling .card-example {
  padding: 8px 10px;
}
.extra-conjugations-view.is-drilling .card-example-target {
  font-size: 14px;
}
.extra-conjugations-view.is-drilling .card-example-english {
  font-size: 12.5px;
}
.extra-conjugations-view.is-drilling .grade {
  margin-top: 10px;
  margin-bottom: 2px;
}
.extra-conjugations-view.is-drilling .grade button {
  padding: 10px 18px;
  font-size: 14.5px;
}
@media (max-width: 640px) {
  #extraModal:has(.extra-conjugations-view.is-drilling) {
    padding: 0 !important;
    display: block !important;
  }
  #extraModal:has(.extra-conjugations-view.is-drilling) > .modal-content {
    max-width: none;
    width: 100%;
    height: 100%;
  }
  .extra-conjugations-view.is-drilling {
    min-height: 100dvh;
    max-height: none;
    padding: env(safe-area-inset-top) 16px calc(16px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .extra-conjugations-view.is-drilling .extra-conjugations-topbar {
    top: calc(10px + env(safe-area-inset-top));
  }
  .extra-conjugations-view.is-drilling .drill-head {
    height: 48px;
  }
  .extra-conjugations-view.is-drilling .card {
    flex: 1;
    justify-content: center;
  }
}
