/* aiwa-counter-tools.css — the pieces the sentence, word frequency and symbol counters add on top
   of aiwa-counter.css. Everything those three share with the word counter is already there; this
   file is only what is genuinely new to them. */

/* ---------- sentence list, also used for the frequency tool's concordance ---------- */

.sc-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.sc-row { margin: 0; }
.sc-row button {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: baseline; gap: 10px;
  width: 100%; padding: 8px 10px; border: 1px solid transparent; border-left: 3px solid #dfe5e1;
  border-radius: 9px; background: transparent; font: inherit; font-size: 12.8px; line-height: 1.5;
  color: var(--aiwa-text); text-align: left; cursor: pointer;
  transition: background-color 130ms var(--aiwa-ease), border-color 130ms var(--aiwa-ease);
}
.sc-row button:hover { background: var(--aiwa-bg); border-color: var(--aiwa-line); border-left-color: var(--aiwa-brand); }
.sc-row button:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.45); outline-offset: 1px; }
.sc-row .sc-n { color: #8a958e; font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
.sc-row .sc-text { min-width: 0; overflow-wrap: anywhere; }
.sc-row .sc-text mark { padding: 0 2px; border-radius: 3px; background: #dff0e5; color: inherit; font-weight: 700; }
.sc-row .sc-meta { flex: 0 0 auto; white-space: nowrap; color: var(--aiwa-muted); font-size: 11.5px; font-weight: 600; }
.sc-row .sc-meta b { color: var(--aiwa-ink); font-weight: 760; font-variant-numeric: tabular-nums; }
.sc-flag { display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 750; letter-spacing: 0.03em; text-transform: uppercase; }
.sc-row.is-warn { }
.sc-row.is-warn button { border-left-color: #e0a23b; }
.sc-row.is-warn .sc-flag { background: #fdf2dd; color: #8a5a07; }
.sc-row.is-bad button { border-left-color: #d92d20; }
.sc-row.is-bad .sc-flag { background: #fdecea; color: #b42318; }
.sc-row.is-short button { border-left-color: #cfe6d7; }
.sc-row.is-short .sc-flag { background: #eaf4ee; color: var(--aiwa-brand-dark); }
.sc-plain { margin: 0; padding: 0 0 0 16px; display: grid; gap: 5px; font-size: 12.5px; color: var(--aiwa-text); }
.sc-plain b { color: var(--aiwa-ink); font-weight: 750; }

/* ---------- word frequency controls ---------- */

.wf-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; }
.wf-min, .wf-sort { display: inline-flex; align-items: center; gap: 5px; color: var(--aiwa-muted); font-size: 11.5px; font-weight: 650; }
.wf-min input { width: 58px; min-height: 30px; padding: 3px 8px; border: 1px solid var(--aiwa-line); border-radius: 8px; background: #fff; font: inherit; font-size: 12.5px; font-weight: 700; color: var(--aiwa-ink); text-align: right; }
.wf-sort select { min-height: 30px; padding: 2px 6px; border: 1px solid var(--aiwa-line); border-radius: 8px; background: #fff; font: inherit; font-size: 12px; font-weight: 650; color: var(--aiwa-text); }
.wf-min input:focus, .wf-sort select:focus { outline: 0; border-color: var(--aiwa-brand); box-shadow: 0 0 0 3px rgba(19, 122, 61, 0.15); }
.wf-list { margin-top: 8px; max-height: 60vh; overflow: auto; scrollbar-width: thin; }
.wf-chips { display: flex; flex-wrap: wrap; gap: 4px; max-height: 220px; overflow: auto; padding: 2px; scrollbar-width: thin; }
.wf-chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 26px; padding: 2px 8px;
  border: 1px solid var(--aiwa-line); border-radius: 999px; background: #fff;
  font: inherit; font-size: 11.5px; font-weight: 650; color: var(--aiwa-muted); cursor: pointer;
}
.wf-chip:hover { border-color: #d92d20; color: #b42318; }
.wf-chip span { font-size: 12px; opacity: 0.6; }
.wf-chip.is-off { border-color: #cfe6d7; background: var(--aiwa-brand-soft); color: var(--aiwa-brand-dark); }
.wf-chip.is-off:hover { border-color: var(--aiwa-brand); color: var(--aiwa-brand-dark); }

/* ---------- symbol table ---------- */

.sy-table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 8px; }
.sy-table th, .sy-table td { padding: 6px 8px; border-top: 1px solid #eef1ef; text-align: left; }
.sy-table thead th { border-top: 0; color: var(--aiwa-muted); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.sy-table .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 750; color: var(--aiwa-ink); }
.sy-table td { color: var(--aiwa-text); }
.sy-char { font-size: 16px; font-weight: 650; color: var(--aiwa-ink); }
.sy-cp { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 11.5px; color: var(--aiwa-muted); }
.sy-ghost { font-size: 11px; font-style: normal; font-weight: 650; color: #8a958e; }
.sy-hidden { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.sy-hidden li { display: grid; grid-template-columns: auto auto auto 1fr; align-items: baseline; gap: 6px; font-size: 12.5px; }
.sy-hidden li b { font-weight: 750; color: var(--aiwa-ink); }
.sy-hidden li code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 11px; color: var(--aiwa-muted); }
.sy-hidden li i { font-style: normal; font-weight: 750; color: #b42318; font-variant-numeric: tabular-nums; }
.sy-hidden li span { grid-column: 1 / -1; color: var(--aiwa-muted); font-size: 11.5px; line-height: 1.45; }
.sy-warn { border-color: #f0c9c4; background: #fffaf9; }

/* ---------- shared bits ---------- */

.tc-pill { font-variant-numeric: tabular-nums; }
.counter-page .gc-stats > span.wc-foot-stat { display: inline !important; }

@media (max-width: 900px) {
  .sc-row button { grid-template-columns: 22px minmax(0, 1fr); }
  .sc-row .sc-meta { grid-column: 2; }
  .wf-list { max-height: none; }
}

/* ---------- dark ---------- */

html[data-theme="dark"] .sc-row button { border-left-color: #2b352e; color: var(--aiwa-ink); }
html[data-theme="dark"] .sc-row button:hover { background: #1a221d; border-color: var(--aiwa-line); border-left-color: var(--aiwa-brand); }
html[data-theme="dark"] .sc-row .sc-text mark { background: #1f3b2a; color: #d9efe1; }
html[data-theme="dark"] .sc-row.is-warn .sc-flag { background: #3a2f18; color: #e9c47c; }
html[data-theme="dark"] .sc-row.is-bad .sc-flag { background: #3a1f1c; color: #f3a9a0; }
html[data-theme="dark"] .sc-row.is-short .sc-flag { background: #1c2b22; color: #9ad4b2; }
html[data-theme="dark"] .wf-min input, html[data-theme="dark"] .wf-sort select, html[data-theme="dark"] .wf-chip { background: var(--aiwa-card); border-color: var(--aiwa-line); color: var(--aiwa-ink); }
html[data-theme="dark"] .wf-chip.is-off { background: #16281e; border-color: #2c4a38; color: #9ad4b2; }
html[data-theme="dark"] .sy-table th, html[data-theme="dark"] .sy-table td { border-top-color: #242e28; }
html[data-theme="dark"] .sy-warn { background: #241a19; border-color: #4a2c28; }
