/* Words collection, You page trackers and achievements, and the quiet
   achievement note on the after-solve summary. Calm by design: no motion,
   no badges that shout; an earned milestone is marked with a tick. */

/* ------------------------------------------------------------------ words */
/* Words stays quick at 70,000+ found words: a summary with the most found, a
   breakdown by length and first letter, a search over found words, the latest
   finds, and a letter's or a length's words a page at a time. */
.words .search-field { position: relative; }
.words .search-field > svg { position: absolute; left: 16px; top: 17px; color: var(--ink-faint); pointer-events: none; }
.words .search { width: 100%; padding-left: 46px; padding-right: 48px; }
.words .search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.words .search-clear {
  position: absolute; right: 4px; top: 4px; display: grid; place-items: center;
  width: 44px; height: 44px; color: var(--ink-soft); border-radius: 8px;
}
.words .search-clear[hidden] { display: none; }
.words-search { display: flex; flex-direction: column; gap: 10px; }
.words .words-count { margin: 0; font-variant-numeric: tabular-nums; }
.words .words-count.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.words .words-count[hidden], .words .word-rows[hidden], .words-explore[hidden] { display: none; }
.words-explore { display: flex; flex-direction: column; gap: 28px; }
.words-none { display: flex; flex-direction: column; gap: 2px; padding: 14px 2px; }
.words-none strong { font-size: 16px; color: var(--ink); }

.word-enum { font-family: inherit; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--ink-faint); white-space: nowrap; }

.words .words-overview, .words .words-breakdown { display: flex; flex-direction: column; gap: 14px; padding: 18px 16px 20px; }
.words-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.words-total { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 0 10px; }
.words-total:first-child { padding-left: 0; }
.words-total + .words-total { border-left: 1px solid var(--hairline); }
.words-total strong { font-size: 24px; line-height: 30px; font-weight: 750; letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.words-total span { font-size: 13px; line-height: 1.4; color: var(--ink-soft); }
.wb-title { font-size: 15px; line-height: 1.4; font-weight: 700; letter-spacing: -.01em; color: var(--ink); margin: 0; }
.wb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.words-breakdown .wb-head:has(.words-all) { align-items: center; min-height: 32px; }
.words-breakdown .wb-head + .len-chart { margin-top: -4px; }
.words .words-all { text-transform: none; text-decoration: none; color: var(--ink); font-variant-numeric: tabular-nums; }

/* Recent finds: a wrap of chips, each opening its word. */
.word-chips { gap: 8px; }
.words .word-chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 6px 12px;
  text-transform: none; text-decoration: none; color: var(--ink); font-size: 14px; font-weight: 600;
}
.word-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (hover: hover) { .words .word-chip:hover { border-color: var(--accent); } }

/* Most found: a short bar list under the totals, one hue, the count in ink
   beside each bar. */
.most-seen { display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.most-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.most-row {
  display: grid; grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr) 3rem; align-items: center; gap: 10px;
  min-height: 40px; color: var(--ink); text-decoration: none; border-radius: 8px;
}
.most-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.most-track { height: 8px; border-radius: 4px; background: var(--well); box-shadow: inset 0 1px 0 var(--well-shade); overflow: hidden; }
.most-track > span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.most-n { font-size: 13px; color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums; }
.most-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* By length: a column per length, its count above and the length below.
   Each is a link; one chosen leaves the others faint. */
.len-chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; height: 148px; }
.len-bar {
  display: grid; grid-template-rows: 18px minmax(0, 1fr) 22px; align-items: end; justify-items: stretch;
  min-width: 0; padding: 0; color: inherit; text-decoration: none; border-radius: 6px;
}
.len-n { font-size: 11px; line-height: 18px; color: var(--ink-soft); text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.len-col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center;
  border-bottom: 1px solid var(--hairline); }
.len-fill { display: block; width: min(100%, 22px); border-radius: 4px 4px 0 0; background: var(--accent); }
.len-l { font-size: 12px; line-height: 22px; color: var(--ink-soft); text-align: center; font-variant-numeric: tabular-nums; }
.len-bar.dim .len-fill { opacity: .28; }
.len-bar.is-empty .len-l { color: var(--ink-faint); }
.len-bar.on .len-l, .len-bar.on .len-n { color: var(--ink); font-weight: 700; }
.len-bar.on .len-col { border-bottom-color: var(--ink); }
.len-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* First letter: two rows of thirteen keys, each with a slim bar at its foot
   for how many words start with it (the busiest letter's spans the key). */
.az-strip { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 4px; }
.az-key {
  position: relative; display: grid; place-items: center; min-height: 40px; min-width: 0; padding: 0 0 5px; border-radius: 8px;
  background: var(--tile-2, var(--card-2)); color: var(--ink); font-size: 13px; font-weight: 700; text-decoration: none;
}
.az-heat {
  position: absolute; left: 5px; bottom: 5px; height: 3px; max-width: calc(100% - 10px); border-radius: 2px;
  background: var(--accent); opacity: .7; pointer-events: none;
}
.az-key.is-empty { background: transparent; color: var(--ink-faint); opacity: .45; font-weight: 500; }
.az-key.on { background: var(--ink); color: var(--app-bg); }
.az-key.on .az-heat { background: var(--app-bg); opacity: .5; }
.az-key:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (hover: hover) { a.az-key:not(.on):hover { color: var(--accent); } }

/* A list of words: a row per word, its count at the end. */
.word-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.word-rows > li + li { border-top: 1px solid var(--hairline); }
.word-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; align-items: center;
  min-height: 56px; padding: 8px 2px; color: var(--ink); text-decoration: none;
}
.word-row-name { font-size: 16px; line-height: 1.4; font-weight: 700; overflow-wrap: anywhere; }
.word-row-meta { grid-row: 2; font-size: 13px; line-height: 1.4; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.word-row-n {
  grid-column: 2; grid-row: 1 / 3; min-width: 2.75rem; padding: 4px 8px; border-radius: 8px; text-align: center;
  background: var(--well); box-shadow: inset 0 1px 0 var(--well-shade);
  font-size: 13px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums;
}
.word-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
@media (hover: hover) { .word-row:hover .word-row-name, .most-row:hover .most-name { color: var(--accent); } }

/* Previous / page / Next under a letter's list. */
.words-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.words-pager .btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; text-decoration: none; }
.words-pager .btn:last-child { justify-self: end; }
.words-pager .btn:first-child { justify-self: start; }
.words-pager .is-off { opacity: .35; pointer-events: none; }
.words-pager-at { font-variant-numeric: tabular-nums; }

/* One word */
.words .word-page-sub { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -8px 0 0; font-size: 14px; color: var(--ink-soft); }
.word-page .words-totals { padding: 16px; }
.word-page .words-total strong { font-size: 20px; line-height: 28px; }
.word-page .word-page-from { margin: -6px 0 0; }
.word-page-from .link { font-size: inherit; }

/* Looking a word up: Wikipedia first, the dictionary beside it. */
.lookup-links { display: flex; flex-wrap: wrap; gap: 10px; }
.lookup-links .lookup-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; font-size: 14px; text-decoration: none; }
.lookup-links .lookup-link svg { color: var(--ink-faint); }
.lookup-links .lookup-link.primary svg { color: inherit; }
.lookup-links.compact .lookup-wiki { color: var(--accent); }
.lookup-links.compact .lookup-wiki svg { color: var(--accent); }
.lookup-links.compact { gap: 6px; flex-wrap: nowrap; }
.lookup-links.compact .lookup-link { min-height: 36px; padding: 0 10px; font-size: 13px; }

/* What our server keeps for a word: the opening of its Wikipedia article and
   its dictionary senses, each crediting its source, above the links. */
.word-lookup-details:empty { display: none; }
.lookup-details { display: flex; flex-direction: column; gap: 10px; }
.lookup-card {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--hairline); border-radius: var(--ui-radius-card, 10px);
}
.lookup-card-label {
  margin: 0; font-size: 12px; line-height: 1.4; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-faint);
}
.lookup-card-title { margin: 0; font-size: 16px; line-height: 1.35; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.lookup-extract { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink); }
.lookup-senses { margin: 0; padding: 0 0 0 1.25em; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.5; color: var(--ink); }
.lookup-senses li::marker { color: var(--ink-faint); font-size: 13px; }
.lookup-senses:has(> li:only-child) { list-style: none; padding-left: 0; }
.lookup-pos { margin-right: 6px; font-style: italic; color: var(--ink-soft); }
.lookup-inflection { margin: 0; font-size: 14px; line-height: 1.5; font-style: italic; color: var(--ink-soft); }
.lookup-source { margin: 2px 0 0; font-size: 13px; line-height: 1.5; color: var(--ink-faint); }
.lookup-source a { color: var(--ink-soft); text-decoration: underline; text-underline-offset: 2px; }
.lookup-source a.lookup-credit { color: var(--accent); font-weight: 600; }
.lookup-source a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@media (min-width: 700px) {
  .len-chart { height: 168px; }
  .az-strip { grid-template-columns: repeat(26, minmax(0, 1fr)); }
}

/* Keywords by category: a category's found keywords, each to look up. */
.kw-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.kw-rows > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 56px; padding: 8px 0; }
.kw-rows > li + li { border-top: 1px solid var(--hairline); }
.kw-name { font-size: 16px; line-height: 1.4; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.kw-name .word-enum { margin-left: 4px; }
a.mastery-row { color: inherit; text-decoration: none; }
a.mastery-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.profile a.mastery-row { grid-template-columns: 48px minmax(0, 1fr) 18px; }
.profile a.mastery-row .mastery-go { grid-column: 3; grid-row: 1 / 3; align-self: center; color: var(--ink-faint); display: flex; }
@media (hover: hover) { .profile a.mastery-row:hover .mastery-category { color: var(--accent); } }
.keyword-list .kw-rows { margin-top: 4px; }

/* --------------------------------------------------------------- trackers */
.profile .secondary-stats.trackers { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; }
.profile .secondary-stats.trackers .stat:nth-child(3n + 1) { padding-left: 0; border-left: 0; }
.profile .secondary-stats.trackers .stat-v,
.profile .secondary-stats.trackers .stat:last-child .stat-v { font-size: 18px; line-height: 24px; letter-spacing: -.01em; }

/* ----------------------------------------------------------- achievements */
.ach-preview .sec-head > .muted { font-variant-numeric: tabular-nums; }
.ach-rows { display: flex; flex-direction: column; }
.ach-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 8px;
  align-items: center; padding: 12px 0;
}
.ach-row + .ach-row { border-top: 1px solid var(--hairline); }
.ach-badge {
  grid-row: 1 / 3; align-self: start; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: var(--card-2); color: var(--ink-faint);
}
.ach-row.is-earned .ach-badge { background: var(--ui-learn-tint, var(--card-2)); color: var(--themed); }
.ach-copy { display: flex; flex-direction: column; min-width: 0; }
.ach-name { font-size: 15px; font-weight: 700; line-height: 1.35; color: var(--ink); }
.ach-desc { font-size: 13px; line-height: 1.45; color: var(--ink-soft); }
.ach-new {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; vertical-align: 1px;
  font-size: 11px; font-weight: 600; line-height: 1.5; color: var(--themed); border: 1px solid currentColor;
}
.ach-frac { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ach-row.is-earned .ach-frac { color: var(--themed); }
.ach-track { grid-column: 2 / 4; height: 4px; border-radius: 2px; background: var(--card-2); overflow: hidden; }
.ach-track > span { display: block; height: 100%; border-radius: inherit; background: var(--themed); }
.ach-row.is-earned .ach-track { display: none; }
.achievements-detail .mastery-summary { display: flex; align-items: baseline; gap: 10px; }

