/* Phrasebook — this feature's styles. Use the tokens from style.css
   (--bg --surface --text --muted --line --accent --on-accent --user --ja --danger
   --high --mid --low --poor --font --font-ja --mono); never redefine them. */

.bk { padding-top: 12px; }

/* ---------- the strip at the top: what he has, and the way into it ---------- */

.bk-crumb { margin: 0 4px 10px; font-size: 13px; }
.bk-crumb a { color: var(--accent); font-weight: 600; text-decoration: none; }
.bk-crumb i { margin-left: 7px; font-family: var(--font-ja); font-style: normal; font-size: 11px; font-weight: 400; color: var(--muted); }

.bk-tally { margin: 0 4px 10px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.bk-tally b { font-size: 16px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bk-tally i { margin-left: 7px; font-family: var(--font-ja); font-style: normal; font-size: 11px; }

/* Five counts and five filters are the same five things, so they are one control.
   minmax(0,1fr) and not 1fr: a long label must shrink, never widen the page. */
.bk-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 0 0 12px; }
.bk-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-height: 64px;
  padding: 8px 2px 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bk-chip b { font-size: 19px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.bk-chip span { font-size: 10px; font-weight: 700; letter-spacing: .01em; color: var(--muted); }
.bk-chip i { font-family: var(--font-ja); font-style: normal; font-size: 10px; line-height: 1.3; color: var(--muted); }
.bk-chip.zero b { color: var(--muted); font-weight: 600; }
.bk-chip.on { border-color: transparent; background: var(--accent); color: var(--on-accent); }
.bk-chip.on b, .bk-chip.on span, .bk-chip.on i { color: inherit; }
.bk-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 359px) { .bk-chip span { font-size: 9px; } }

.bk-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  padding: 13px 16px;
  border-radius: 16px;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
}
.bk-cta:active { filter: brightness(.94); }
.bk-cta-text { flex: 1; min-width: 0; }
.bk-cta-main { display: block; font-size: 16px; font-weight: 700; }
.bk-cta-main i { margin-left: 8px; font-family: var(--font-ja); font-style: normal; font-size: 12px; font-weight: 400; opacity: .8; }
.bk-cta-sub { display: block; margin-top: 2px; font-family: var(--font-ja); font-size: 12px; line-height: 1.45; opacity: .85; }
.bk-cta-go { flex: none; font-size: 22px; line-height: 1; opacity: .8; }

/* ---------- one theme, then the phrases under it ---------- */

.bk-group { margin: 0 0 20px; }
.bk-theme {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 4px 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
}
.bk-theme a, .bk-theme > span { min-width: 0; color: inherit; text-decoration: none; overflow-wrap: anywhere; }
.bk-theme i { margin-left: 7px; font-family: var(--font-ja); font-style: normal; font-size: 11px; font-weight: 400; }
.bk-theme b { margin-left: auto; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }

.bk-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.bk-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
.bk-item.is-due { border-color: var(--accent); }

.bk-row { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; }
.bk-open {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.bk-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
/* The phrase is the thing he is learning: it gets the size, everything else explains it. */
.bk-en { display: block; font-size: 19px; font-weight: 600; line-height: 1.32; overflow-wrap: anywhere; }
.bk-ja {
  display: block;
  margin-top: 3px;
  font-family: var(--font-ja);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.bk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; margin-top: 9px; font-size: 11px; color: var(--muted); }
.bk-lv { padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; font-weight: 700; letter-spacing: .02em; }
.bk-lv.is-new { border-color: var(--accent); color: var(--accent); }
.bk-lv.is-known { border-color: var(--high); color: var(--high); }
.bk-when.now { font-weight: 700; color: var(--accent); }
.bk-uses { font-family: var(--font-ja); }
/* The score and the ▶ share the right edge: keeping the score out of .bk-meta is what
   holds the state read-out to one line on a 375px screen. */
.bk-side { flex: none; display: flex; flex-direction: column; align-items: center; gap: 7px; }
.bk-best { font-size: 13px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.bk-best.none { font-weight: 600; color: var(--muted); }
.bk-vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- unfolded: where the phrase came from, and how it has gone ---------- */

.bk-detail { padding: 13px 14px 14px; border-top: 1px solid var(--line); }
.bk-q { margin: 7px 0 0; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.bk-q-ja { margin: 4px 0 0; font-family: var(--font-ja); font-size: 12px; line-height: 1.6; color: var(--muted); }
.bk-gone { margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.bk-gone i { display: block; margin-top: 3px; font-family: var(--font-ja); font-style: normal; font-size: 12px; }

.bk-chat {
  display: block;
  margin-top: 12px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
}
.bk-chat b { display: block; font-size: 14px; font-weight: 600; color: var(--accent); overflow-wrap: anywhere; }
.bk-chat i { display: block; margin-top: 2px; font-family: var(--font-ja); font-style: normal; font-size: 11px; color: var(--muted); }

.bk-facts { margin-top: 14px; border-top: 1px solid var(--line); }
.bk-fact { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.bk-fact:last-child { padding-bottom: 0; border-bottom: 0; }
.bk-fact > span:first-child { color: var(--muted); font-weight: 700; letter-spacing: .02em; }
.bk-fact > span:last-child { text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.bk-fact i { margin-left: 7px; font-family: var(--font-ja); font-style: normal; font-weight: 400; }

/* ---------- nothing under this filter, and nothing in the book at all ---------- */

.bk-none { padding: 30px 12px 34px; text-align: center; color: var(--muted); }
.bk-none p { margin: 0 0 14px; font-size: 14px; }
.bk-none b { color: var(--text); }
.bk-none i { margin-left: 6px; font-family: var(--font-ja); font-style: normal; font-weight: 400; color: var(--muted); }
.bk-clear {
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.bk-empty-head { margin: 0 0 12px; font-size: 18px; font-weight: 700; color: var(--text); }
.bk-empty-note { margin: 0 0 22px; font-size: 14px; line-height: 1.6; }
.bk-empty-head i, .bk-empty-note i {
  display: block;
  margin-top: 4px;
  font-family: var(--font-ja);
  font-style: normal;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--muted);
}
