/* Isolated mastery surfaces; inherit both Nanani and Reader theme tokens. */
#knownLemas.vocab-mastery-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  width: 100%;
  flex-shrink: 0;
  margin: 3px 0 11px;
  padding: 13px 14px 12px;
  border: 1px solid var(--sidebar-input-border);
  border-radius: 16px;
  background: linear-gradient(135deg, var(--sidebar-input-bg), transparent), var(--sidebar-item-hover);
  color: var(--sidebar-ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
  position: relative;
  isolation: isolate;
  box-shadow: 0 6px 19px #00000012;
  transition: transform .36s cubic-bezier(.2,.8,.2,1.25), border-color .25s, box-shadow .3s;
}
#knownLemas.vocab-mastery-card:hover {
  transform: scale(1.02);
  border-color: var(--accent-2);
  box-shadow: 0 10px 30px #0002, 0 0 20px color-mix(in srgb, var(--accent) 16%, transparent);
}
#knownLemas.vocab-mastery-card:active { transform: scale(.99); }
#knownLemas:focus-visible, .vm-dialog :focus-visible { outline: 3px solid var(--accent-2); outline-offset: 4px; }
.vm-card-top { display: flex; align-items: center; gap: 6px; font: 600 9px/1.3 var(--font-brand); letter-spacing: .08em; color: var(--sidebar-muted); }
.vocab-mastery-card .es-flag { width: 13px; height: 9px; }
.vm-card-arrow { margin-left: auto; font-size: 15px; color: var(--sidebar-ink); line-height: 1; }
.vm-card-main { display: flex; gap: 13px; align-items: center; margin: 10px 0 4px; }
.vm-mini-ring { position: relative; width: 54px; height: 54px; flex: 0 0 54px; }
.vm-gauge { width: 100%; height: 100%; overflow: visible; transform: rotate(-90deg); }
.vm-gauge-track { fill: none; stroke: currentColor; opacity: .12; stroke-width: 6; }
.vm-gauge-fill { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 1.2s cubic-bezier(.16,1,.3,1); }
.vm-stop-start { stop-color: var(--accent); }
.vm-stop-end { stop-color: var(--accent-2); }
.vm-mini-star { position: absolute; inset: 0; display: grid; place-items: center; color: var(--accent-2); font-size: 20px; }
.vm-card-total { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.vm-card-total strong { font: 700 clamp(22px, 2.4vw, 30px)/1 var(--font-brand); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.vm-card-total > span { color: var(--sidebar-muted); font-size: 11px; }
.vm-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vm-badge { flex: 0 1 auto; border: 1px solid var(--sidebar-input-border); background: var(--sidebar-input-bg); padding: 3px 6px; border-radius: 5px; font-size: 10px; line-height: 1.3; }
.vm-card-stat { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 1px; }
.vm-card-stat > strong { font: 600 15px/1.1 var(--font-brand); font-variant-numeric: tabular-nums; color: var(--sidebar-ink); }
.vm-card-caption { font-size: 11px; line-height: 1.2; color: var(--sidebar-muted); text-align: right; margin: 0; }
#knownLemas.vm-celebrate { animation: vm-glow 1.3s ease-out; }
@keyframes vm-glow { 25% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 24%, transparent), 0 0 35px color-mix(in srgb, var(--accent) 40%, transparent); } }
.vm-dialog {
  box-sizing: border-box;
  width: min(800px, calc(100vw - 32px));
  max-height: min(92dvh, 1100px);
  padding: 30px;
  margin: auto;
  border: 1px solid var(--line-strong);
  border-radius: 26px;
  color: var(--ink);
  background: var(--panel);
  font-family: var(--sans);
  box-shadow: 0 32px 100px #0005;
  overflow-y: auto;
  overscroll-behavior: contain;
}
[data-theme="reader"] .vm-dialog {
  border-color: var(--line);
  box-shadow: 0 20px 40px -15px rgba(26, 21, 64, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}
.vm-dialog[open] { animation: vm-enter .35s cubic-bezier(.16,1,.3,1); }
.vm-dialog::backdrop { background: #100c24a6; backdrop-filter: blur(8px); }
@keyframes vm-enter { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.vm-dialog * { box-sizing: border-box; }
.vm-dialog h2, .vm-dialog h3, .vm-dialog p { margin: 0; }
.vm-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.vm-eyebrow { font: 600 10px/1.5 var(--font-brand); letter-spacing: .11em; text-transform: uppercase; color: var(--muted); }
.vm-modal-head h2 { margin-top: 5px; font: 600 clamp(22px, 3vw, 29px)/1.2 var(--font-brand); letter-spacing: -.045em; }
.vm-close { flex-shrink: 0; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: var(--hover-bg); font: 24px/1 var(--sans); cursor: pointer; }
.vm-hero { display: grid; grid-template-columns: 175px 1fr; align-items: center; gap: 28px; padding: 27px 0; }
.vm-hero-ring { position: relative; width: 175px; height: 175px; }
.vm-hero-number { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; }
.vm-hero-number strong { font: 700 32px/1 var(--font-brand); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.vm-hero-number > span { font-size: 11px; color: var(--muted); }
.vm-hero-copy h3 { font: 700 28px/1.2 var(--font-brand); margin: 6px 0 9px; letter-spacing: -.03em; }
.vm-hero-copy h3 span { font-weight: 400; font-size: 22px; }
.vm-hero-copy > p:not(.vm-eyebrow) { font-size: 13px; line-height: 1.6; color: var(--muted); }
.vm-level-track { height: 5px; background: var(--line); border-radius: 8px; margin: 14px 0 7px; overflow: hidden; }
.vm-level-track > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .7s ease; }
.vm-next-level { font-size: 11px; color: var(--muted); }
.vm-family { background: color-mix(in srgb, var(--accent) 7%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); border-radius: 16px; padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.vm-family .vm-eyebrow { color: var(--ink); }
.vm-equation { display: flex; align-items: center; gap: 18px; margin: 10px 0 6px !important; }
.vm-equation strong { font: 700 30px/1.1 var(--font-brand); letter-spacing: -.04em; }
.vm-equation > span { color: var(--muted); font-size: 22px; }
.vm-family-label, .vm-family-note { font-size: 11px; line-height: 1.65; color: var(--muted); }
.vm-curve-section { margin-top: 26px; }
.vm-section-head h3 { font: 600 17px/1.35 var(--font-brand); letter-spacing: -.02em; }
.vm-section-head p { font-size: 12px; line-height: 1.5; color: var(--muted); margin-top: 4px; }
#vmChart { margin: 16px 0 0; }
#vmChart svg { width: 100%; display: block; overflow: visible; }
.vm-grid { stroke: var(--line); stroke-dasharray: 3 5; }
.vm-axis { fill: var(--muted); font: 11px var(--sans); }
.vm-curve-line { stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; fill: none; }
.vm-today-dot { fill: var(--accent); stroke: var(--panel); stroke-width: 3; }
.vm-explore-dot { fill: var(--panel); stroke: var(--ink); stroke-width: 2; }
.vm-explore-line { stroke: var(--muted); stroke-dasharray: 3 4; opacity: .5; }
.vm-explore-label { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; font-size: 11px; color: var(--muted); }
.vm-explore-label output { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
#vmExplore { width: 100%; padding: 0; height: 22px; cursor: pointer; accent-color: var(--accent); }
.vm-chart-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 11px; margin-top: 3px; }
.vm-chart-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; }
.vm-chart-legend > span + span i { background: transparent; border: 1px solid var(--ink); }
.vm-grammar { margin-top: 25px; padding-top: 22px; border-top: 1px solid var(--line); }
.vm-bars { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; }
.vm-bar-row { display: grid; grid-template-columns: 75px 1fr 32px; align-items: center; gap: 10px; font-size: 12px; }
.vm-bar-row strong { font-size: 11px; text-align: right; font-variant-numeric: tabular-nums; }
.vm-bar-track { height: 6px; background: var(--line); border-radius: 5px; overflow: hidden; }
.vm-bar-track > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .7s ease; }
.vm-bar-row:nth-child(2) .vm-bar-track > span { background: var(--good); }
.vm-bar-row:nth-child(3) .vm-bar-track > span { background: var(--new); }
.vm-bar-row:nth-child(4) .vm-bar-track > span { background: var(--muted); }
.vm-method { margin-top: 22px; font-size: 11px; line-height: 1.7; color: var(--muted); }
.vm-method summary { cursor: pointer; width: fit-content; }
.vm-method p { margin-top: 8px; max-width: 66ch; }
.vm-footer { display: flex; justify-content: flex-end; margin-top: 22px; }
.vm-footer button { display: flex; align-items: center; gap: 22px; border-radius: 12px; }
@media (prefers-reduced-motion: no-preference) {
  .vocab-mastery-card:hover .vm-stop-end, .vm-dialog[open] .vm-stop-end { animation: vm-gradient 4s ease-in-out infinite alternate; }
  @keyframes vm-gradient { from { stop-color: var(--accent-2); } to { stop-color: var(--new); } }
}
@media (max-width: 560px) {
  .vm-dialog { padding: 22px 18px; border-radius: 20px; max-height: 94dvh; }
  .vm-hero { grid-template-columns: 110px 1fr; gap: 16px; }
  .vm-hero-ring { width: 110px; height: 110px; }
  .vm-hero-number strong { font-size: 23px; }
  .vm-hero-copy h3 { font-size: 24px; }
  .vm-hero-copy h3 span { font-size: 17px; }
  .vm-family { grid-template-columns: 1fr; gap: 12px; padding: 17px; }
  .vm-bars { grid-template-columns: 1fr; }
  .vm-footer button { width: 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  #knownLemas.vocab-mastery-card, .vm-dialog, .vm-dialog *, .vocab-mastery-card * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  #knownLemas.vocab-mastery-card:hover { transform: none; }
}
