/* Dictionary (辞) — app.php #viewDict. Layout only; the decomposition tree
   brings its own .hv-* styles from styles.css.

   Everything is built from the :root tokens in styles.css (--paper, --ink,
   --hairline, --accent …), which the [data-theme=dark] block already flips —
   so there is no separate dark-mode section here and none should be added.
   Mobile is one column with the entry pushed over the results; the two-pane
   split appears at 900px. */

.dw { display: flex; flex-direction: column; min-height: 0; }

/* ── search bar ─────────────────────────────────────────────────────────── */
.dw-search { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 8px; }
.dw-field { position: relative; flex: 1 1 260px; min-width: 0; display: flex; }
.dw-input { flex: 1 1 auto; min-width: 0; font-size: 17px; font-family: var(--han);
  padding: 12px 38px 12px 14px; border: 1px solid var(--hairline); border-radius: 11px;
  background: var(--paper-raised); color: var(--ink); -webkit-appearance: none; appearance: none; }
.dw-input::placeholder { color: var(--ink-whisper); font-family: var(--serif-body); font-size: 15px; }
.dw-input:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12); }
.dw-input::-webkit-search-cancel-button { display: none; }
.dw-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent;
  color: var(--ink-whisper); font-size: 20px; line-height: 1; cursor: pointer; }
.dw-clear:hover { background: var(--paper-sunken); color: var(--ink); }

.dw-modes { display: flex; gap: 4px; flex: 0 0 auto; padding: 3px;
  background: var(--paper-sunken); border-radius: 10px; }
.dw-mode { font-size: 12.5px; font-family: var(--han); padding: 7px 11px; border: 0;
  border-radius: 8px; background: transparent; color: var(--ink-faded); cursor: pointer;
  transition: background .12s, color .12s; }
.dw-mode:hover { color: var(--ink); }
.dw-mode.on { background: var(--paper-raised); color: var(--accent); font-weight: 600;
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb), .08); }

.dw-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.dw-tool { font-size: 13px; font-family: var(--han); padding: 7px 13px;
  border: 1px solid var(--hairline); border-radius: 999px; background: var(--paper-raised);
  color: var(--ink); cursor: pointer; transition: border-color .12s, background .12s; }
.dw-tool:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), .06); }
.dw-hint { font-size: 11.5px; color: var(--ink-whisper); }
.dw-hint code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
  background: var(--paper-sunken); padding: 1px 4px; border-radius: 4px; }
@media (max-width: 620px) { .dw-hint { display: none; } }

/* ── two-pane body ──────────────────────────────────────────────────────── */
.dw-body { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 900px) {
  .dw-body { grid-template-columns: minmax(280px, 380px) 1fr; }
  .dw-list { max-height: calc(100vh - 230px); overflow-y: auto; padding-right: 4px; }
  .dw-back { display: none !important; }
}
/* On a phone the entry takes the screen; .dw-showing is set when one opens. */
@media (max-width: 899px) {
  .dw-showing .dw-list { display: none; }
  .dw:not(.dw-showing) .dw-detail { display: none; }
}

.dw-group { margin-bottom: 14px; }
.dw-group-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-whisper); font-weight: 600; padding: 0 2px 6px; }
.dw-group-n { font-weight: 400; letter-spacing: 0; }
.dw-clear-hist { border: 0; background: none; color: var(--ink-whisper); font: inherit;
  text-transform: none; letter-spacing: 0; cursor: pointer; text-decoration: underline; }
.dw-clear-hist:hover { color: var(--accent); }

.dw-row { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  padding: 9px 10px; border: 1px solid transparent; border-radius: 10px; background: none;
  color: var(--ink); cursor: pointer; font: inherit; }
.dw-row:hover, .dw-row.on { background: var(--paper-raised); border-color: var(--hairline); }
.dw-row-zh { flex: 0 0 auto; display: flex; align-items: baseline; gap: 5px; }
.dw-hz { font-family: var(--han); font-size: 21px; line-height: 1.25; }
.dw-trad { font-family: var(--han); font-size: 15px; color: var(--ink-whisper); }
.dw-row-mid { flex: 1 1 auto; min-width: 0; }
.dw-row-py { display: block; font-size: 13px; font-style: italic; }
.dw-row-g { display: block; font-size: 13px; color: var(--ink-faded); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; }
.dw-row-tags { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; padding-top: 3px; }

.dw-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.dw-chip { font-family: var(--han); font-size: 17px; padding: 7px 12px;
  border: 1px solid var(--hairline); border-radius: 10px; background: var(--paper-raised);
  color: var(--ink); cursor: pointer; }
.dw-chip:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), .06); }
.dw-blurb { font-size: 12px; color: var(--ink-whisper); line-height: 1.7; margin-top: 20px;
  padding-top: 14px; border-top: 1px solid var(--hairline); }
.dw-blurb code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: var(--paper-sunken); padding: 1px 5px; border-radius: 4px; }
.dw-src { display: block; margin-top: 4px; }
.dw-src a { color: var(--ink-faded); }

/* Ways to search — each row is a live query, so the syntax is learned by tapping. */
.dw-egs { display: flex; flex-direction: column; gap: 3px; }
.dw-eg { display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left;
  padding: 7px 9px; border: 1px solid transparent; border-radius: 9px; background: none;
  color: var(--ink); font: inherit; cursor: pointer; }
.dw-eg:hover { background: var(--paper-raised); border-color: var(--hairline); }
.dw-eg code { flex: 0 0 88px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px; background: var(--paper-sunken); padding: 3px 7px; border-radius: 5px;
  color: var(--accent); }
.dw-eg span { font-size: 12.5px; color: var(--ink-faded); }
.dw-none { color: var(--ink-whisper); font-style: italic; padding: 14px 2px; }
/* Said when a sticky Latin-only mode found nothing and the 汉字 index answered
   instead — so the lit chip and the rows below never contradict each other. */
.dw-fellback { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px;
  margin: 0 0 12px; padding: 8px 10px; border-radius: 10px;
  background: var(--paper-raised); border: 1px solid var(--hairline);
  font-size: 12.5px; color: var(--ink-faded); }
.dw-fellback b { color: var(--ink); font-weight: 600; }
.dw-fellback-set { border: 0; background: none; padding: 0; font: inherit;
  color: var(--accent); text-decoration: underline; cursor: pointer; }

/* Chinese with no dictionary headword — openable anyway, so you can still take
   it apart and make a card of it. Dashed, because it is not an entry. */
.dw-openphrase { border-style: dashed; border-color: var(--hairline); }
.dw-openphrase:hover { border-color: var(--accent); }
.dw-nohead .dw-panel-lead { margin-bottom: 10px; }

/* ── HSK level + mastery marks ──────────────────────────────────────────── */
.dw-lv { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; color: #fff;
  white-space: nowrap; letter-spacing: .02em; }
.dw-lv1 { background: var(--hsk1); } .dw-lv2 { background: var(--hsk2); }
.dw-lv3 { background: var(--hsk3); } .dw-lv4 { background: var(--hsk4); }
.dw-lv5 { background: var(--hsk5); } .dw-lv6 { background: var(--hsk6); }
.dw-st { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: 0 0 auto; }
.dw-st-known { background: var(--mastered); }
.dw-st-learning { background: var(--gold); }

/* ── entry ──────────────────────────────────────────────────────────────── */
.dw-entry { background: var(--paper-raised); border: 1px solid var(--hairline);
  border-radius: 16px; padding: 18px 20px 20px; }
.dw-back { border: 0; background: none; color: var(--ink-faded); font: inherit; font-size: 13px;
  cursor: pointer; padding: 0 0 10px; }
.dw-back:hover { color: var(--accent); }
.dw-head { display: flex; gap: 18px; align-items: flex-start; }
.dw-glyph { flex: 0 0 116px; width: 116px; height: 116px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--hairline); border-radius: 14px;
  cursor: pointer; }
.dw-glyph svg { width: 100%; height: 100%; }
.dw-glyph .cc-hint path { fill: var(--paper-sunken); }
.dw-glyph .cc-reveal { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.dw-head-meta { flex: 1 1 auto; min-width: 0; }
.dw-word { display: flex; align-items: baseline; gap: 10px; }
.dw-word .dw-hz { font-size: 40px; line-height: 1.05; }
.dw-word .dw-trad { font-size: 24px; }
.dw-py { font-size: 19px; font-style: italic; margin-top: 4px; }
.dw-syl { white-space: nowrap; }
.dw-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 11px 0 12px; }
.dw-badge { font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: var(--paper-sunken); color: var(--ink-faded); white-space: nowrap; }
.dw-badge-btn { border: 1px solid var(--hairline); cursor: pointer; font: inherit; font-size: 11.5px; }
.dw-badge-btn:hover { border-color: var(--accent); color: var(--accent); }
.dw-badge-cl b { font-family: var(--han); cursor: pointer; }
.dw-badge-cl b:hover { color: var(--accent); }
.dw-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.dw-act { font-size: 13px; padding: 8px 13px; border: 1px solid var(--hairline);
  border-radius: 9px; background: var(--paper); color: var(--ink); cursor: pointer; font-family: inherit; }
.dw-act:hover { border-color: var(--accent); color: var(--accent); }
.dw-act:disabled { opacity: .55; cursor: default; }

.dw-readings { display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  margin: 14px 0 0; padding-top: 13px; border-top: 1px solid var(--hairline); }
.dw-readings-lab { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--ink-whisper); font-weight: 600; }
.dw-reading { display: flex; align-items: baseline; gap: 7px; max-width: 100%;
  font: inherit; font-size: 13px; padding: 6px 11px; border: 1px solid var(--hairline);
  border-radius: 9px; background: var(--paper); cursor: pointer; color: var(--ink); }
.dw-reading:hover { border-color: var(--accent); }
.dw-reading b { font-style: italic; font-weight: 500; }
.dw-reading span { color: var(--ink-faded); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 260px; }

.dw-tabs { display: flex; gap: 3px; margin: 16px 0 0; border-bottom: 1px solid var(--hairline); }
.dw-tab { font-family: var(--han); font-size: 15px; padding: 9px 15px; border: 0;
  border-bottom: 2px solid transparent; background: none; color: var(--ink-faded);
  cursor: pointer; margin-bottom: -1px; }
.dw-tab:hover { color: var(--ink); }
.dw-tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.dw-tabpane { padding-top: 16px; }

/* ── senses ─────────────────────────────────────────────────────────────── */
.dw-senses { list-style: none; margin: 0; padding: 0; }
.dw-sense { display: flex; gap: 11px; padding: 7px 0; align-items: baseline; }
.dw-sense + .dw-sense { border-top: 1px solid var(--hairline); }
.dw-sense-n { flex: 0 0 20px; font-size: 12px; color: var(--ink-whisper); text-align: right;
  font-variant-numeric: tabular-nums; }
.dw-sense-body { flex: 1 1 auto; min-width: 0; }
.dw-gloss { font-size: 15.5px; line-height: 1.55; }
.dw-label { display: inline-block; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .04em; padding: 2px 7px; margin-right: 6px; border-radius: 999px;
  background: rgba(var(--gold-rgb), .16); color: var(--ink-faded); vertical-align: 2px; }
.dw-ref { font: inherit; border: 0; background: rgba(var(--accent-rgb), .07); border-radius: 6px;
  padding: 1px 6px; cursor: pointer; color: var(--ink); display: inline-flex;
  align-items: baseline; gap: 4px; }
.dw-ref:hover { background: rgba(var(--accent-rgb), .16); }
.dw-ref-zh { font-family: var(--han); }
.dw-ref-py { font-size: 11.5px; font-style: italic; color: var(--ink-whisper); }

/* ── panels shared by every tab ─────────────────────────────────────────── */
.dw-panel { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--hairline); }
.dw-panel:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.dw-panel h4 { font-size: 13px; margin: 0 0 6px; font-family: var(--han); font-weight: 600;
  color: var(--ink); }
.dw-panel h4 i { font-style: italic; font-family: var(--serif-body); color: var(--accent);
  font-weight: 400; margin-left: 4px; }
.dw-panel-lead { font-size: 12.5px; color: var(--ink-whisper); line-height: 1.55; margin: 0 0 12px; }
.dw-panel-lead b { font-family: var(--han); font-size: 15px; color: var(--ink); cursor: pointer; }
.dw-panel-lead b:hover { color: var(--accent); }
.dw-panel-lead i { font-style: italic; color: var(--accent); }

.dw-minirows { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 5px; }
.dw-mini { display: flex; align-items: baseline; gap: 7px; text-align: left; width: 100%;
  padding: 7px 9px; border: 1px solid transparent; border-radius: 9px; background: var(--paper);
  color: var(--ink); font: inherit; cursor: pointer; }
.dw-mini:hover { border-color: var(--accent); }
.dw-mini-flat { cursor: default; }
.dw-mini-flat:hover { border-color: transparent; }
.dw-mini-zh { font-family: var(--han); font-size: 18px; flex: 0 0 auto; }
.dw-mini-py { font-size: 12px; font-style: italic; flex: 0 0 auto; }
.dw-mini-g { font-size: 12px; color: var(--ink-faded); flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── in your course ─────────────────────────────────────────────────────── */
.dw-lesson { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 10px 12px; margin-bottom: 6px; border: 1px solid var(--hairline); border-radius: 10px;
  background: var(--paper); color: var(--ink); font: inherit; cursor: pointer; }
.dw-lesson:hover { border-color: var(--accent); }
.dw-lesson-zh { font-family: var(--han); font-size: 14px; color: var(--ink-faded); flex: 0 0 auto; }
.dw-lesson-t { flex: 1 1 auto; font-size: 13.5px; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.dw-lesson-st { flex: 0 0 auto; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px; background: var(--paper-sunken); color: var(--ink-whisper); }
.dw-lesson-mastered { background: rgba(var(--mastered-rgb), .16); color: var(--mastered); }
.dw-lesson-in_progress { background: rgba(var(--gold-rgb), .2); color: var(--ink-faded); }

.dw-chengyu p { font-size: 13.5px; line-height: 1.65; margin: 0 0 8px; }
.dw-cy-ex { color: var(--ink); }
.dw-cy-dv, .dw-cy-eg { color: var(--ink-faded); font-size: 12.5px; }
.dw-chengyu b { color: var(--ink-whisper); font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; margin-right: 5px; }

/* ── sentences ──────────────────────────────────────────────────────────── */
.dw-sents { display: flex; flex-direction: column; gap: 2px; }
.dw-sent { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.dw-sent:last-child { border-bottom: 0; }
.dw-sent-zh { font-family: var(--han); font-size: 17px; line-height: 1.85; }
.dw-sent-py { font-size: 12.5px; font-style: italic; color: var(--accent); margin-top: 2px; }
.dw-sent-en { font-size: 13.5px; color: var(--ink-faded); margin-top: 3px; }
.dw-more-sents { margin-top: 14px; }

/* ── modal (Reader / radicals / frequency) ──────────────────────────────── */
.dw-modal-back { position: fixed; inset: 0; background: rgba(var(--shadow-rgb), .5);
  z-index: 60; }
.dw-modal { position: fixed; z-index: 61; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(760px, calc(100vw - 28px)); max-height: min(86vh, 780px); display: flex;
  flex-direction: column; background: var(--paper-raised); border: 1px solid var(--hairline);
  border-radius: 16px; box-shadow: 0 24px 60px rgba(var(--shadow-rgb), .3); }
.dw-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 15px 18px; border-bottom: 1px solid var(--hairline); }
.dw-modal-head h3 { margin: 0; font-size: 16px; font-family: var(--han); font-weight: 600; }
.dw-modal-close { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer;
  color: var(--ink-whisper); padding: 0 4px; }
.dw-modal-close:hover { color: var(--ink); }
.dw-modal-body { padding: 16px 18px 20px; overflow-y: auto; }
body.dw-modal-open { overflow: hidden; }

/* Reader */
.dw-reader-in { width: 100%; font-family: var(--han); font-size: 16px; line-height: 1.8;
  padding: 12px 14px; border: 1px solid var(--hairline); border-radius: 11px;
  background: var(--paper); color: var(--ink); resize: vertical; }
.dw-reader-in:focus { outline: none; border-color: var(--accent); }
.dw-reader-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.dw-reader-stats { font-size: 13px; color: var(--ink-faded); }
.dw-reader-stats b { color: var(--accent); font-size: 17px; }
.dw-reader-legend { display: inline-flex; align-items: center; gap: 5px; margin-left: 10px;
  font-size: 11.5px; color: var(--ink-whisper); }
.dw-reader-legend .dw-st { margin-left: 6px; }
/* word-spacing:0 + zero padding keeps the text reading as Chinese; the word
   boundaries show through the hover highlight and the known/learning underline
   instead of through gaps, which looked like broken justification. */
.dw-reader-text { font-family: var(--han); font-size: 19px; line-height: 2.1;
  word-spacing: 0; padding: 14px; background: var(--paper);
  border: 1px solid var(--hairline); border-radius: 12px; }
.dw-tok { font: inherit; border: 0; border-bottom: 2px solid transparent; background: none;
  color: var(--ink); padding: 0; margin: 0; cursor: pointer; border-radius: 3px;
  vertical-align: baseline; }
.dw-tok:hover { background: rgba(var(--accent-rgb), .13); }
.dw-tok-known { border-bottom-color: rgba(var(--mastered-rgb), .55); }
.dw-tok-learning { border-bottom-color: rgba(var(--gold-rgb), .7); }

/* Radical picker + frequency browser */
.dw-rad-grid { max-height: 230px; overflow-y: auto; padding-right: 4px; }
.dw-rad-band { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; padding: 5px 0;
  border-bottom: 1px solid var(--hairline); }
.dw-rad-n { flex: 0 0 30px; font-size: 11px; color: var(--ink-whisper);
  font-variant-numeric: tabular-nums; }
.dw-rad { font-family: var(--han); font-size: 18px; line-height: 1; width: 38px; height: 38px;
  border: 1px solid var(--hairline); border-radius: 8px; background: var(--paper);
  color: var(--ink); cursor: pointer; }
.dw-rad:hover { border-color: var(--accent); background: rgba(var(--accent-rgb), .07); }
.dw-rad.on { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.dw-rad-out { margin-top: 16px; }
.dw-rad-out h4 { font-family: var(--han); font-size: 17px; margin: 0 0 8px; }
.dw-rad-out h4 i { font-style: italic; font-family: var(--serif-body); color: var(--accent);
  font-size: 14px; margin-left: 6px; }
.dw-rad-en { font-family: var(--serif-body); font-size: 12.5px; color: var(--ink-whisper);
  font-weight: 400; margin-left: 8px; }

.dw-freq-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 3px; }
.dw-freq-row { display: flex; align-items: baseline; gap: 8px; text-align: left; padding: 6px 8px;
  border: 1px solid transparent; border-radius: 8px; background: none; color: var(--ink);
  font: inherit; cursor: pointer; }
.dw-freq-row:hover { border-color: var(--accent); background: var(--paper); }
.dw-freq-row.on { background: rgba(var(--accent-rgb), .1); border-color: var(--accent); }
.dw-freq-n { flex: 0 0 34px; font-size: 11px; color: var(--ink-whisper); text-align: right;
  font-variant-numeric: tabular-nums; }
.dw-freq-zh { font-family: var(--han); font-size: 19px; flex: 0 0 auto; }
.dw-freq-py { font-size: 12px; font-style: italic; flex: 0 0 auto; }
.dw-freq-en { font-size: 12px; color: var(--ink-faded); flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-freq-more { margin-top: 14px; }

/* The ＋ beside a result row: build a deck out of a search without opening each
   entry. A sibling of .dw-row, never nested inside it (button-in-button is
   invalid HTML and swallows the row's own click). */
.dw-rowwrap { display: flex; align-items: stretch; gap: 2px; }
.dw-rowwrap .dw-row { flex: 1 1 auto; min-width: 0; }
.dw-row-add { flex: 0 0 auto; width: 30px; border: 1px solid transparent; border-radius: 9px;
  background: none; color: var(--ink-whisper); font-size: 15px; cursor: pointer;
  opacity: 0; transition: opacity .12s, color .12s, border-color .12s; }
.dw-rowwrap:hover .dw-row-add, .dw-row-add:focus-visible { opacity: 1; }
.dw-row-add:hover { color: var(--accent); border-color: var(--accent); }
/* Touch has no hover, so the control has to be permanently visible there. */
@media (hover: none) { .dw-row-add { opacity: .65; } }

/* ── importing a list ───────────────────────────────────────────────────── */
/* The ＋ that turns a panel's rows into flashcards. Sits beside the ↗ in a
   panel heading, so the two live at the same weight: make a picture of this,
   or take it with you. */
.dw-addall { flex: 0 0 auto; min-height: 36px; padding: 0 11px; border-radius: 10px;
  border: 1px solid var(--hairline); background: transparent; color: var(--ink-faded);
  font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap; }
.dw-addall:hover, .dw-addall:focus-visible { border-color: var(--accent); color: var(--accent); }
.dw-panel-head h5 { flex: 1 1 auto; min-width: 0; font-size: 12.5px; margin: 0;
  font-family: var(--han); font-weight: 600; color: var(--ink); }
.dw-panel-head h5 i { font-style: italic; font-family: var(--serif-body); color: var(--accent);
  font-weight: 400; margin-left: 4px; }
.dw-panel-head h5 b { font-family: var(--han); cursor: pointer; }
.dw-panel-head h5 b:hover { color: var(--accent); }

/* ── 逐字: a phrase opened character by character ────────────────────────── */
/* Each character of a word expands into the breakdown a single-character entry
   gets — strokes, what it is built from, the words it forms — without leaving
   the word you looked up. */
.dw-cx-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.dw-cxlist { display: grid; gap: 8px; }
.dw-cx { border: 1px solid var(--hairline); border-radius: 12px; background: var(--paper);
  overflow: hidden; }
.dw-cx.on { border-color: var(--accent); background: var(--paper-raised); }
.dw-cx-head { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 9px 12px; background: none; border: 0; color: var(--ink); font: inherit;
  cursor: pointer; }
.dw-cx-head:disabled { cursor: default; opacity: .7; }
.dw-cx-n { flex: 0 0 auto; font-size: 11px; color: var(--ink-whisper);
  font-variant-numeric: tabular-nums; }
.dw-cx-zh { flex: 0 0 auto; font-family: var(--han); font-size: 27px; line-height: 1.1; }
.dw-cx-mid { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.dw-cx-py { font-size: 13px; font-style: italic; }
.dw-cx-g { font-size: 12px; color: var(--ink-faded); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.dw-cx-tags { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.dw-cx-caret { flex: 0 0 auto; font-size: 11px; color: var(--ink-whisper);
  transition: transform .15s; }
.dw-cx.on .dw-cx-caret { transform: rotate(180deg); }
.dw-cx-body { padding: 4px 12px 14px; border-top: 1px solid var(--hairline); }

.dw-cx-top { display: flex; gap: 14px; align-items: flex-start; padding-top: 12px; }
.dw-cx-glyph { flex: 0 0 92px; width: 92px; height: 92px; color: var(--ink);
  background: var(--paper-raised); border: 1px solid var(--hairline); border-radius: 12px;
  cursor: pointer; }
.dw-cx.on .dw-cx-glyph { background: var(--paper); }
.dw-cx-glyph svg { width: 100%; height: 100%; }
.dw-cx-glyph .cc-hint path { fill: var(--paper-sunken); }
.dw-cx-glyph .cc-reveal { fill: none; stroke: currentColor; stroke-linecap: round;
  stroke-linejoin: round; }
.dw-cx-facts { flex: 1 1 auto; min-width: 0; }
.dw-cx-facts .dw-badges { margin: 0 0 8px; }
.dw-cx-senses { margin: 0 0 10px; padding-left: 18px; font-size: 13px; line-height: 1.6; }
.dw-cx-senses li { margin-bottom: 2px; }
.dw-cx-acts { display: flex; flex-wrap: wrap; gap: 7px; }
.dw-cx-acts .dw-act { padding: 6px 11px; font-size: 12.5px; }

.dw-cx-graphs { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px; margin-top: 16px; }
.dw-cx-graph h5 { font-size: 12.5px; margin: 0 0 8px; font-family: var(--han);
  font-weight: 600; color: var(--ink); }
.dw-cx-tree, .dw-cx-ego { border: 1px solid var(--hairline); border-radius: 12px;
  background: var(--paper-raised); padding: 10px; min-height: 90px; }
.dw-cx.on .dw-cx-tree, .dw-cx.on .dw-cx-ego { background: var(--paper); }
.dw-cx-ego { display: flex; justify-content: center; }
.dw-cx-sec { margin-top: 16px; }
.dw-cx-sec .dw-panel-head { margin-bottom: 8px; }

/* The character web on a single-character entry, same view its characters get
   inside a phrase. */
.dw-webpanel .dw-ego { display: flex; justify-content: center; }
