/* Vocabulary pages: deck filters, word badges, phrasal-verb index (docs/VOCAB-EXPANSION.md). RTL page, LTR English chunks. */
.vfilter { display: grid; gap: 8px; margin-block-end: 18px; }
.vf-row { display: flex; align-items: center; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-block: 2px; -webkit-overflow-scrolling: touch; }
.vf-row::-webkit-scrollbar { display: none; }
.vf-k { flex: none; font-size: var(--fs-xs); color: var(--ink-3, var(--ink-2)); min-inline-size: 3.2em; }
.vchip { flex: none; display: inline-flex; align-items: center; min-block-size: 36px; padding: 2px 13px; border-radius: 999px; font-size: var(--fs-sm);
  text-decoration: none; color: var(--ink-2); background: var(--paper-2); border: 1px solid var(--hair); white-space: nowrap; }
.vchip.on { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.lvl-chip { direction: ltr; font-variant-numeric: tabular-nums; }
@media (hover: hover) and (pointer: fine) { .vchip:not(.on):hover { color: var(--ink); border-color: var(--ink-3, var(--ink-2)); } }
@media (pointer: coarse) { .vchip { min-block-size: 40px; } }
.vf-foot { margin: 0; }
.vf-search { display: flex; gap: 8px; align-items: center; }
.vf-search input[type=search] { flex: 1; min-inline-size: 0; min-block-size: 44px; padding: 4px 12px; border-radius: 10px; border: 1px solid var(--hair); background: var(--card); color: var(--ink); font-size: 16px; }
.dg-situations { --h: #0f6d8a; } .dg-ielts { --h: #6b3fa0; } .dg-advanced { --h: #2f4f9f; } .dg-idioms { --h: #a1471d; }

.wmeta { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; }
.rtag { display: inline-flex; align-items: center; padding: 0 8px; border-radius: 999px; font-size: var(--fs-xs); line-height: 1.9; border: 1px solid var(--hair); color: var(--ink-2); background: var(--paper-2); }
.r-informal { color: #9a3b12; border-color: color-mix(in srgb, #9a3b12 35%, var(--hair)); background: color-mix(in srgb, #9a3b12 8%, transparent); }
.r-formal, .r-academic { color: #2f4f9f; border-color: color-mix(in srgb, #2f4f9f 35%, var(--hair)); background: color-mix(in srgb, #2f4f9f 8%, transparent); }
.u-speaking, .u-writing, .u-both { direction: ltr; }
.g-sep, .g-insep, .g-int { color: #07756d; border-color: color-mix(in srgb, #07756d 35%, var(--hair)); background: color-mix(in srgb, #07756d 8%, transparent); }
/* the tag inks are picked for a light card: lighter twins in the dark theme (they were about 2.5:1 on a dark card) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .r-informal { color: #f2a47c; border-color: color-mix(in srgb, #f2a47c 40%, transparent); background: color-mix(in srgb, #f2a47c 12%, transparent); }
  :root:not([data-theme="light"]) :is(.r-formal, .r-academic) { color: #a9bcff; border-color: color-mix(in srgb, #a9bcff 40%, transparent); background: color-mix(in srgb, #a9bcff 12%, transparent); }
  :root:not([data-theme="light"]) :is(.g-sep, .g-insep, .g-int) { color: #5ed3c8; border-color: color-mix(in srgb, #5ed3c8 40%, transparent); background: color-mix(in srgb, #5ed3c8 12%, transparent); }
}
:root[data-theme="dark"] .r-informal { color: #f2a47c; border-color: color-mix(in srgb, #f2a47c 40%, transparent); background: color-mix(in srgb, #f2a47c 12%, transparent); }
:root[data-theme="dark"] :is(.r-formal, .r-academic) { color: #a9bcff; border-color: color-mix(in srgb, #a9bcff 40%, transparent); background: color-mix(in srgb, #a9bcff 12%, transparent); }
:root[data-theme="dark"] :is(.g-sep, .g-insep, .g-int) { color: #5ed3c8; border-color: color-mix(in srgb, #5ed3c8 40%, transparent); background: color-mix(in srgb, #5ed3c8 12%, transparent); }
.wsense { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); font-style: italic; }
.wformal { margin: 0; }
.deck-intro { margin-block: 10px 4px; font-size: var(--fs-sm); line-height: 1.9; }
.wc-other { font-size: var(--fs-sm); }
.wc-other summary { cursor: pointer; color: var(--ink-2); min-block-size: 32px; display: flex; align-items: center; }
.wc-other ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.wc-other li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }

.pvindex, .pv-senses { list-style: none; margin: 0; padding: 0; }
.pvindex { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); }
.pvrow { padding: 10px 12px; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--hair); display: grid; gap: 6px; align-content: start; }
.pv-verb { font-size: var(--fs-lg); }
.pv-senses { display: grid; gap: 4px; }
.pv-sense { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; padding: 4px 0; min-block-size: 36px; text-decoration: none; color: inherit; }
@media (pointer: coarse) { .pv-sense { min-block-size: 44px; align-content: center; } .wc-other summary { min-block-size: 44px; } }
.pv-fa { font-weight: 600; color: var(--teal); }
@media (max-width: 480px) { .vf-k { display: none; } }

/* card pictures (Word.art_url, learn/pictures.py): drawn on white, so a light rounded tile in both themes */
.wc-art { inline-size: 48px; block-size: 48px; flex: none; box-sizing: border-box; padding: 3px; border-radius: 12px;
  background: #f7f6fb; object-fit: contain; }

/* a deck added or removed: the page comes back to its card (decks.html back=#d-slug), clear of the sticky header */
.deckc { scroll-margin-block-start: 96px; }

/* deck page: «مرور همین دسته» / «افزودن به مرور» / «حذف از مرور» under the title */
.deck-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-block-start: 10px; }
.deck-acts-note { margin: 6px 0 0; }
/* the sticky jump bar on /vocab/: its tint was see-through, so deck titles scrolled across its labels */
.seg-tabs.deck-jump { background: color-mix(in srgb, var(--paper) 86%, transparent); -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px); box-shadow: 0 0 0 1px var(--hair), 0 6px 16px -12px rgb(20 18 43 / 0.4); }

/* the deck meter: «یادگرفته» (light) with its «تثبیت‌شده» part (full colour) on top, and the same two words on the cards */
.dm-row { flex-wrap: wrap; gap: 0 8px; justify-content: flex-start; }
.dm-row > span { white-space: nowrap; }
.dm-row > :nth-child(2) { margin-inline-start: auto; }  /* on one line: the count at the other end, as before */
@media (max-width: 560px) { .dm-row { justify-content: space-between; } .dm-row > :nth-child(2) { margin-inline-start: 0; } }
.deck-meter .bar { position: relative; }
.deck-meter .bar > i { background: color-mix(in srgb, var(--h) 55%, var(--card)); }
.deck-meter .bar > i.solid { position: absolute; inset: 0; background: var(--h); }
.dm-help { margin: -6px 0 14px; }
.wc-stage { flex: none; }

/* a locked Plus deck: the sample link sits above the card's stretched title link, like the forms do */
.deckc .deck-sample { position: relative; z-index: 1; justify-self: start; }
.wordcards { scroll-margin-block-start: 96px; }

/* Long pages on a phone (docs/VOCAB-REVIEW-AUDIT.md, U6): a compact row per word that opens, deck groups behind their headings.
   Each fold is an empty <details> whose next sibling is the content, all of it in the HTML: `details:not([open]) + content` hides
   it, on narrow screens only. Wide screens (and print) have no fold: the details is not displayed and the content is as it was.
   A link to #w-12, #g-ielts or #d-slug opens its fold without a script (:target); vocab.js then keeps the details in step and
   lets the browser's "find in page" look inside closed folds (html.vfold, hidden="until-found"). */
.wc-more, .dg-more, .pv-more { display: none; }
.wc-body, .wc-body[hidden] { display: contents !important; }
.deck-grid[hidden] { display: grid !important; content-visibility: visible; }
.wcard, .pvrow { scroll-margin-block-start: 96px; }
@media screen and (max-width: 640px) {
  :is(.wc-more, .dg-more, .pv-more) { display: block; }
  :is(.wc-more, .dg-more, .pv-more) > summary { list-style: none; box-sizing: border-box; block-size: 100%; min-block-size: 44px; display: flex;
    align-items: center; justify-content: flex-end; gap: 8px; cursor: pointer; border-radius: var(--r-md); color: var(--ink-2); -webkit-tap-highlight-color: transparent; }
  :is(.wc-more, .dg-more, .pv-more) > summary::-webkit-details-marker { display: none; }
  :is(.wc-more, .dg-more, .pv-more) > summary .ic { flex: none; inline-size: 18px; block-size: 18px; transition: transform var(--dur-2) var(--ease-std); }
  :is(.wc-more, .dg-more, .pv-more)[open] > summary .ic { transform: rotate(180deg); }

  /* a word: picture | word over meaning | ✓ | play | chevron; the summary lies under the play button, over the rest */
  .wordcards { gap: 6px; }
  .wcard { position: relative; grid-template-columns: auto minmax(0, 1fr) auto auto 26px; grid-template-rows: auto auto; gap: 0; align-items: center; padding: 6px 10px; }
  .wc-head { display: contents; }
  .wc-head > .wc-art { grid-area: 1 / 1 / 3 / 2; inline-size: 40px; block-size: 40px; margin-inline-end: 10px; }
  .wc-head > .grow { grid-area: 1 / 2; align-self: end; line-height: 1.45; min-inline-size: 0; overflow-wrap: anywhere; }
  .wcard > .wc-fa { grid-area: 2 / 2; align-self: start; margin: 0; line-height: 1.6; }
  .wc-head > .wc-stage { grid-area: 1 / 3 / 3 / 4; margin-inline-start: 6px; padding-inline: 4px; }
  .wc-stage > span { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .wc-head > .play-btn { grid-area: 1 / 4 / 3 / 5; position: relative; z-index: 2; margin-inline-start: 6px; }
  .wcard > .wc-more { grid-area: 1 / 1 / 3 / 6; align-self: stretch; z-index: 1; }
  .wcard > .wc-body { grid-column: 1 / -1; display: grid !important; gap: 6px; padding-block: 8px 4px; }
  .wcard > .wc-more:not([open]) + .wc-body { display: none !important; }
  /* a closed row is word, meaning, play: the grammar label and the phonetics come with the rest; the dictionary link works once open */
  .wcard:has(> .wc-more:not([open])) .grow > small { display: none; }
  .wcard:has(> .wc-more[open]) .wc-dict { position: relative; z-index: 2; }

  /* a deck group: the summary lies over the whole heading */
  .deck-group { grid-template-columns: minmax(0, 1fr); gap: 0; margin-block-end: 12px; }
  .deck-group > .dg-head { grid-area: 1 / 1; padding-block: 8px; padding-inline-end: 92px; }
  .deck-group > .dg-more { grid-area: 1 / 1; align-self: stretch; z-index: 1; }
  .deck-group > .deck-grid { margin-block: 10px 14px; }
  .deck-group > .dg-more:not([open]) + .deck-grid:not(.mine) { display: none !important; }
  .deck-group > .dg-more:not([open]) + .deck-grid.mine > .deckc:not(.on) { display: none; }  /* a folded group keeps the learner's own decks */
  .dg-n { font-size: var(--fs-xs); }

  /* a phrasal verb: verb, its first meaning, the number of meanings */
  .pvindex { gap: 6px; }
  .pvrow { grid-template-columns: fit-content(42%) minmax(0, 1fr) 72px; gap: 0 10px; align-items: center; padding: 4px 10px; }
  .pvrow > .pv-verb { grid-area: 1 / 1; font-size: var(--fs-base); overflow-wrap: anywhere; }
  .pvrow > .pv-more { grid-area: 1 / 1 / 2 / 4; align-self: stretch; z-index: 1; }
  .pv-n { font-size: var(--fs-xs); }
  .pvrow > .pv-senses, .pvrow > .pv-senses > li { min-inline-size: 0; max-inline-size: 100%; }
  .pv-more:not([open]) + .pv-senses .pv-sense > .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }  /* a Plus deck's verb: one line */
  .pv-more:not([open]) + .pv-senses .pv-sense .ic { display: inline-block; vertical-align: -2px; inline-size: 14px; block-size: 14px; }
  .pvrow > .pv-senses { grid-column: 1 / -1; position: relative; z-index: 2; }  /* above the summary: a meaning links to its deck */
  .pvrow > .pv-more:not([open]) + .pv-senses { grid-area: 1 / 2; justify-self: start; }
  .pv-more:not([open]) + .pv-senses > li:nth-child(n + 2), .pv-more:not([open]) + .pv-senses :is(.lvl, .en, .rtag) { display: none; }

  /* an anchor opens its fold (until vocab.js takes over) */
  html:not(.vfold) .wcard:target > .wc-more + .wc-body { display: grid !important; }
  html:not(.vfold) .deck-group:target > .dg-more + .deck-grid { display: grid !important; }
  html:not(.vfold) .deck-group:has(:target) > .dg-more + .deck-grid { display: grid !important; }
  html:not(.vfold) .deck-group:target > .dg-more + .deck-grid > .deckc { display: grid !important; }
  html:not(.vfold) .deck-group:has(:target) > .dg-more + .deck-grid > .deckc { display: grid !important; }
  /* with vocab.js: a closed fold is skipped by the painter but not by "find in page" */
  html.vfold .wcard > .wc-more:not([open]) + .wc-body[hidden] { display: grid !important; content-visibility: hidden; padding: 0; }
  html.vfold .deck-group > .dg-more:not([open]) + .deck-grid:not(.mine)[hidden] { display: grid !important; content-visibility: hidden; margin: 0; }
}
@media (prefers-reduced-motion: reduce) { :is(.wc-more, .dg-more, .pv-more) > summary .ic { transition: none; } }
html[data-motion="0"] :is(.wc-more, .dg-more, .pv-more) > summary .ic { transition: none; }

.vocab-hero { --vocab-wash: color-mix(in srgb, var(--accent-soft) 76%, var(--card)); position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: clamp(20px, 4vw, 40px); margin-block-end: 18px; border: 1px solid var(--hair); border-radius: 26px; background: radial-gradient(ellipse at top left, var(--vocab-wash), transparent 70%), var(--card); }
.vocab-hero h1 { margin-block: 0 6px; }
.vocab-hero p { margin-block: 0 16px; }
.vocab-hero-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.vocab-hero-mark { display: grid; place-items: center; inline-size: clamp(56px, 12vw, 118px); aspect-ratio: 1; border-radius: 28%; background: var(--accent-soft); color: var(--accent-ink); transform: rotate(-8deg); }
.vocab-hero-mark .ic { inline-size: 54%; block-size: 54%; }
.vocab-deck-hero { display: block; }
.vocab-deck-hero .deck-intro { margin-block: 12px; }
.vocab-deck-hero .deck-intro p:last-child { margin-block-end: 0; }
.vocab-join, .vocab-filters { padding: 14px 16px; border: 1px solid var(--hair); border-radius: 18px; background: var(--card); }
.vocab-join { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-block-end: 14px; }
.vocab-join p, .vocab-filters h2 { margin: 0; }
.vocab-filters { margin-block: 12px; scroll-margin-block-start: calc(var(--safe-t, 0px) + 88px); }
.vocab-filters h2, .vocab-word-title { font-size: var(--fs-lg); }
.vocab-filters .vfilter { margin-block: 10px 0; }
.vocab-filters :is(.vchip, .filter-chip, select) { min-block-size: 44px; }
.vocab-catalog .deckc { align-content: start; border-radius: 20px; }
.vocab-catalog .deck-labels { justify-content: start; flex-wrap: wrap; gap: 8px; }
.vocab-catalog .deck-labels > :last-child:not(.lvl) { margin-inline-start: auto; }
.deck-seat { display: grid; place-items: center; inline-size: 34px; block-size: 34px; border-radius: 11px; color: var(--accent-ink); background: var(--accent-soft); }
.vocab-read { margin-block-start: 24px; }
.vocab-detail .wcard { border-radius: 18px; }
@media (max-width: 540px) {
  .vocab-hero:not(.vocab-deck-hero) { grid-template-columns: minmax(0, 1fr); }
  .vocab-hero-mark { display: none; }
  .vocab-hero-actions .btn { flex: 1 0 auto; }
}
