/* ============================================================
   Vocabulary cards — app.css
   Warm paper, hairline rules, quiet type. Dark green is the
   primary colour; muted gold is the only highlight.
   ============================================================ */

:root {
  --paper:      #EFE7D6;
  --paper-deep: #E6DCC6;
  --card:       #FBF7EE;
  --field:      #F4EDDE;
  --line:       #DCD1B9;
  --line-soft:  #E7DDC8;

  --ink:        #23201A;
  --ink-2:      #55503F;
  --ink-faint:  #8C8574;

  --green:      #1F4A38;
  --green-deep: #16372A;
  --green-soft: #E2EAE2;
  --gold:       #C08F34;
  --gold-soft:  #F3E7C9;
  --clay:       #B06A3C;

  --radius:     14px;
  --radius-sm:  10px;
  --shadow:     0 1px 2px rgba(35, 32, 26, .05), 0 12px 28px rgba(35, 32, 26, .07);
  --shadow-sm:  0 1px 2px rgba(35, 32, 26, .06), 0 4px 12px rgba(35, 32, 26, .05);

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* , *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
h1, h2, h3 { margin: 0; font-weight: 500; }
p, figure, ol, ul { margin: 0; }

a { color: var(--green); text-underline-offset: 3px; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; border-radius: 4px; }

::selection { background: var(--gold-soft); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.wrap {
  width: 100%;
  max-width: 1060px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* ------------------------------------------------------------ labels */
.label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}

.rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
}
.rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ------------------------------------------------------------ top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(239, 231, 214, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  flex-wrap: wrap;
  padding-block: 12px;
}

.mark {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}
.mark img { width: 30px; height: 30px; border-radius: 8px; }
.mark strong {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  letter-spacing: .01em;
  line-height: 1.1;
  display: block;
}
.mark span { display: block; }

/* ------------------------------------------------------------ search */
.search { position: relative; flex: 1 1 320px; min-width: 0; max-width: 460px; }
.search__field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 6px 6px 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search__field:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 74, 56, .1);
}
.search__field svg { flex: none; color: var(--ink-faint); }
.search input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
  padding: 7px 0;
}
.search input:focus { outline: none; }
.search input::placeholder { color: var(--ink-faint); }

.suggest {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + 8px);
  z-index: 50;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 320px;
  overflow-y: auto;
}
.suggest[hidden] { display: none; }
.suggest button {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.suggest button:hover, .suggest button.is-active { background: var(--field); }
.suggest b { font-weight: 500; }
.suggest small {
  color: var(--ink-faint);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  font: 500 14px/1 var(--sans);
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn--primary { background: var(--green); color: #F6F2E7; }
.btn--primary:hover { background: var(--green-deep); }
.btn--gold { background: var(--gold); color: #2A2008; }
.btn--gold:hover { background: #A97D2A; color: #FBF7EE; }
.btn--quiet { background: var(--card); border-color: var(--line); color: var(--ink-2); }
.btn--quiet:hover { border-color: var(--ink-faint); color: var(--ink); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-faint); }
.btn--ghost:hover { color: var(--clay); }
.btn--sm { padding: 7px 13px; font-size: 13px; }

/* ------------------------------------------------------------ card */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #FCF9F2, #F8F3E7);
}
.card__bar .label { margin-right: auto; }
.counter {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .12em;
  background: var(--ink);
  color: #F6F2E7;
  padding: 4px 9px;
  border-radius: 6px;
}

.card__body {
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 28px;
  padding: 26px 28px 24px;
}
@media (max-width: 720px) {
  .card__body { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 20px; }
}

/* --- left rail: picture --- */
.plate {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--field);
}
.plate img { width: 100%; aspect-ratio: 8 / 5; object-fit: cover; }
.plate figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  background: var(--card);
}
.plate figcaption em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  flex: none;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.tag--state { background: var(--green-soft); border-color: #C7D6C7; color: var(--green); }
.tag--gold  { background: var(--gold-soft); border-color: #E4D2A6; color: #7A5A12; }

/* --- right: the word --- */
.head { margin-bottom: 18px; }
.word {
  font-family: var(--serif);
  font-size: clamp(34px, 5.6vw, 50px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.01em;
  word-break: break-word;
}
.head__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 8px;
  color: var(--ink-faint);
  font-size: 13.5px;
}
.head__meta .pos { font-style: italic; color: var(--clay); }
.head__meta .pron { font-family: var(--mono); font-size: 12.5px; }

.meaning {
  background: var(--field);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 15.5px;
  color: var(--ink);
  margin-bottom: 26px;
}

/* --- parts --- */
.parts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  gap: 10px;
  margin-bottom: 8px;
}
.part {
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 13px 12px;
  min-width: 0;
}
.part__value {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.25;
  color: var(--green);
  word-break: break-word;
  margin-top: 2px;
}
.part__gloss {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  margin-top: 3px;
}
.part--prefix .part__value { color: var(--clay); }
.part--suffix .part__value { color: var(--gold); }
.part--none {
  grid-column: 1 / -1;
  font-size: 13.5px;
  color: var(--ink-faint);
  background: transparent;
  border-style: dashed;
}
.note {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 0 0 24px;
}

/* --- examples --- */
.examples { list-style: none; margin: 0 0 22px; padding: 0; counter-reset: ex; }
.examples li {
  counter-increment: ex;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 14.5px;
}
.examples li:last-child { border-bottom: 1px solid var(--line-soft); }
.examples li::before {
  content: "0" counter(ex);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--ink-faint);
  padding-top: 3px;
}
.examples mark {
  background: var(--gold-soft);
  color: inherit;
  border-radius: 3px;
  padding: 0 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.actions .spacer { flex: 1; }

/* ------------------------------------------------------------ empty */
.empty {
  text-align: center;
  padding: 54px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(251, 247, 238, .5);
}
.empty h2 { font-family: var(--serif); font-size: 26px; margin-bottom: 6px; }
.empty p { color: var(--ink-faint); max-width: 44ch; margin: 0 auto 18px; }

/* ------------------------------------------------------------ collection */
.section { padding-block: 34px; }
.section__head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.section__head h2 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  margin-right: auto;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.segmented button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 6px 14px;
  font: 500 13px/1 var(--sans);
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.segmented button sup {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
  color: var(--ink-faint);
  top: -.1em;
}
.segmented button[aria-pressed="true"] { background: var(--ink); color: #F6F2E7; }
.segmented button[aria-pressed="true"] sup { color: rgba(246, 242, 231, .6); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 214px), 1fr));
  gap: 14px;
}

.mini {
  display: flex;
  flex-direction: column;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.mini:hover {
  border-color: var(--ink-faint);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.mini[aria-current="true"] { border-color: var(--green); box-shadow: 0 0 0 2px rgba(31, 74, 56, .12); }
.mini img { width: 100%; aspect-ratio: 8 / 5; object-fit: cover; }
.mini__body { padding: 11px 13px 13px; border-top: 1px solid var(--line-soft); }
.mini__word {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.2;
  word-break: break-word;
}
.mini__meaning {
  font-size: 12.5px;
  color: var(--ink-faint);
  line-height: 1.5;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mini__foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 9px;
}
.mini__foot em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ------------------------------------------------------------ footer */
.foot {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-block: 22px 40px;
  color: var(--ink-faint);
  font-size: 12.5px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

/* ------------------------------------------------------------ dialog */
dialog.sheet {
  width: min(700px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(35, 32, 26, .24);
}
dialog.sheet::backdrop { background: rgba(35, 32, 26, .38); backdrop-filter: blur(2px); }

.sheet__head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: linear-gradient(180deg, #FCF9F2, #F8F3E7);
  border-bottom: 1px solid var(--line-soft);
}
.sheet__head h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  margin-right: auto;
}
.sheet__body { padding: 20px; overflow-y: auto; }
.sheet__foot {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 8px;
  padding: 13px 20px;
  background: var(--field);
  border-top: 1px solid var(--line-soft);
}
.sheet__foot .spacer { flex: 1; }

.icon-btn {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  width: 30px; height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  flex: none;
}
.icon-btn:hover { border-color: var(--ink-faint); color: var(--ink); }

/* ------------------------------------------------------------ form */
.field { margin-bottom: 14px; min-width: 0; }
.field > .label { display: block; margin-bottom: 5px; }
.field .hint { display: block; font-size: 12px; color: var(--ink-faint); margin-top: 4px; }

.input, .textarea, .select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.textarea { min-height: 62px; resize: vertical; line-height: 1.6; }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  background: var(--card);
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 74, 56, .1);
}
.row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr));
}

.picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 96px), 1fr));
  gap: 8px;
}
.picker label { position: relative; display: block; cursor: pointer; }
.picker input { position: absolute; opacity: 0; width: 0; height: 0; }
.picker span {
  display: block;
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  transition: border-color .15s ease;
}
.picker img { aspect-ratio: 8/5; object-fit: cover; width: 100%; }
.picker em {
  display: block;
  font-style: normal;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-faint);
  padding: 4px 2px;
  border-top: 1px solid var(--line-soft);
  background: var(--card);
}
.picker input:checked + span { border-color: var(--green); box-shadow: 0 0 0 2px rgba(31, 74, 56, .15); }
.picker input:focus-visible + span { border-color: var(--clay); }

.form-msg { font-size: 13px; color: var(--clay); min-height: 20px; margin-top: 4px; }

/* ------------------------------------------------------------ toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 150%);
  background: var(--ink);
  color: #F6F2E7;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  z-index: 100;
  transition: transform .28s cubic-bezier(.2, .9, .3, 1.1);
  max-width: calc(100vw - 28px);
  text-align: center;
}
.toast.is-visible { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

/* ------------------------------------------------------------ clickable word parts */
.linkish {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-bottom: 1px dashed currentColor;
}
.linkish:hover { color: var(--clay); }

.card__body--single { display: block; }

/* ------------------------------------------------------------ chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-2);
}
button.chip { cursor: pointer; transition: border-color .15s ease, color .15s ease, background-color .15s ease; }
button.chip:hover { background: var(--card); border-color: var(--ink-faint); color: var(--ink); }
.chip--syn { background: var(--green-soft); border-color: #C7D6C7; color: var(--green); }
button.chip--syn:hover { background: #D6E3D6; border-color: var(--green); color: var(--green); }
.chip--ant { background: #F6EAE1; border-color: #E4CDBB; color: #8A4E24; }
button.chip--ant:hover { background: #EFDDD0; border-color: var(--clay); color: #8A4E24; }

/* ------------------------------------------------------------ word family */
.family {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 0 24px;
  margin: 0 0 22px;
  padding: 0;
  max-width: 700px;
}
.family li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line-soft);
}
.family em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  flex: none;
  width: 76px;
}
.family__word {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.3;
  color: var(--green);
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  word-break: break-word;
}
button.family__word:hover { color: var(--clay); text-decoration: underline; text-underline-offset: 3px; }
.family__word.is-current { color: var(--ink); cursor: default; }

/* ------------------------------------------------------------ common phrases */
.phrases { list-style: none; margin: 0 0 22px; padding: 0; }
.phrases li {
  position: relative;
  padding: 7px 0 7px 20px;
  font-size: 14.5px;
  border-bottom: 1px solid var(--line-soft);
}
.phrases li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 9px;
  height: 1.5px;
  background: var(--gold);
}
.phrases mark {
  background: var(--gold-soft);
  color: inherit;
  border-radius: 3px;
  padding: 0 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ------------------------------------------------------------ synonyms / antonyms */
.relations {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  margin-bottom: 22px;
}
.relation {
  background: var(--field);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 11px 13px 13px;
}
.relation > .label { display: block; margin-bottom: 8px; }

/* ------------------------------------------------------------ affix tag in suggestions */
.suggest .pill {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--gold-soft);
  color: #7A5A12;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 4px;
}

.card__body--single > .chips { margin-bottom: 22px; }

/* ------------------------------------------------------------ known / familiar / unknown */
.status { margin-top: 14px; }
.status > .label { display: block; margin-bottom: 6px; }
.status__set {
  display: flex;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.status__pick {
  flex: 1 1 0;
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  padding: 8px 4px;
  font: 500 11.5px/1.25 var(--sans);
  color: var(--ink-2);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.status__pick:last-child { border-right: 0; }
.status__pick:hover { background: rgba(35, 32, 26, .06); color: var(--ink); }
.status__pick[aria-pressed="true"] { color: #FBF7EE; }
.status__pick--unknown[aria-pressed="true"]  { background: var(--clay); }
.status__pick--familiar[aria-pressed="true"] { background: var(--gold); color: #2A2008; }
.status__pick--known[aria-pressed="true"]    { background: var(--green); }

.mini .dot { background: var(--ink-faint); }
.mini--unknown .dot  { background: var(--clay); }
.mini--familiar .dot { background: var(--gold); }
.mini--known .dot    { background: var(--green); }

/* ------------------------------------------------------------ extra information */
.extra {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 258px), 1fr));
  margin-bottom: 22px;
}
.extra__block {
  background: var(--field);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 11px 13px 5px;
}
.extra__block > .label { display: block; margin-bottom: 3px; }
.extra__block .phrases { margin-bottom: 0; }
.extra__block .phrases li { font-size: 13.5px; padding: 5px 0 5px 17px; }
.extra__block .phrases li::before { top: 14px; width: 8px; }
.extra__block .phrases li:last-child { border-bottom: 0; }

/* ------------------------------------------------------------ the card sits on a deck */
.card-stack { position: relative; margin-bottom: 18px; }
.card-stack > .card { position: relative; z-index: 2; }
.card-stack::before,
.card-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  pointer-events: none;
}
.card-stack::before { transform: translate(8px, 8px); opacity: .7; z-index: 1; }
.card-stack::after  { transform: translate(16px, 16px); opacity: .4; z-index: 0; }

/* ------------------------------------------------------------ the collection, fanned out */
.deck {
  display: flex;
  flex-wrap: wrap;
  row-gap: 20px;
  padding-left: 48px;
}
.deck .mini {
  flex: 0 0 212px;
  margin-left: -48px;
  position: relative;
  z-index: 1;
  box-shadow: -7px 0 14px rgba(35, 32, 26, .07);
}
/* keep the text inside the strip the next card does not cover */
.deck .mini__body { padding-right: 58px; }
.deck .mini:hover .mini__body,
.deck .mini:focus-visible .mini__body,
.deck .mini[aria-current="true"] .mini__body { padding-right: 13px; }
.deck .mini:hover,
.deck .mini:focus-visible,
.deck .mini[aria-current="true"] {
  transform: translateY(-8px);
  z-index: 6;
  box-shadow: var(--shadow);
}
.deck .mini[aria-current="true"] { z-index: 7; }

/* five filters do not fit one pill on a narrow screen: let them stand alone */
@media (max-width: 560px) {
  .segmented { background: transparent; border-color: transparent; padding: 0; gap: 6px; }
  .segmented button { border: 1px solid var(--line); background: var(--card); }
  .segmented button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); }
}

@media (max-width: 700px) {
  .deck { padding-left: 0; row-gap: 12px; }
  .deck .mini { flex: 1 1 100%; margin-left: 0; box-shadow: none; }
  .deck .mini__body { padding-right: 13px; }
  .deck .mini:hover, .deck .mini:focus-visible, .deck .mini[aria-current="true"] { transform: none; }
}
