/* Styles only this website needs. The shared look is in kit/kit.css; this file uses its tokens only. */

/* The accent is darkened for contrast on the light theme (site.json); on the dark theme the lighter orange reads better. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --accent: #d98a3d !important; --accent-ink: #1d1206 !important; }
}
:root[data-theme="dark"] { --accent: #d98a3d !important; --accent-ink: #1d1206 !important; }

/* link buttons: no underline; the intro of a try-it box keeps a gap above its first field */
a.k-btn { display: inline-block; text-decoration: none; }
.k-try > div:first-child { margin-bottom: 16px; }

/* search results: one white card per passage on the tinted part (on the white try-it part, a grey one) */
.w5-results { display: grid; gap: 8px; margin: 12px 0; }
.w5-hit { border: 1px solid var(--edge); border-radius: 12px; padding: 10px 14px; background: var(--bg); min-width: 0; }
.k-sec.try .w5-hit { background: var(--panel-2); border-color: transparent; }
.w5-hit.right, .k-sec.try .w5-hit.right { border-color: color-mix(in srgb, var(--good) 45%, var(--edge)); background: var(--good-soft); }
.w5-hit .w5-meta { font-size: 13px; color: var(--muted); display: flex; gap: 6px 8px; flex-wrap: wrap; align-items: center; }
.w5-hit .w5-meta b { color: var(--ink); font-weight: 600; }
.w5-hit .w5-text { display: block; font-size: 14px; line-height: 1.6; white-space: pre-wrap; margin-top: 6px; overflow-wrap: anywhere; }
.w5-hit .w5-text.clip { max-height: 8em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.w5-hit p:first-child { margin-top: 0; }
.w5-hit label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.w5-hit input[type="checkbox"], .w5-hit input[type="radio"] { margin-top: 4px; width: 16px; height: 16px; flex: none; accent-color: var(--ink); }
.w5-rank {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--panel-2); color: var(--ink); font: 600 12px/1 var(--body); font-variant-numeric: tabular-nums;
}
.k-sec.try .w5-rank { background: var(--bg); }
.w5-miss { color: var(--bad); font-size: 14px; margin: 6px 0; }

/* question and setup pickers; also the three-reader comparison */
.w5-controls { display: flex; gap: 12px; flex-wrap: wrap; margin: 8px 0; }
.w5-controls > label, .w5-controls > div { flex: 1 1 220px; min-width: 0; }
.w5-controls > div ul { margin: 6px 0 0; padding-left: 20px; font-size: 14.5px; }
.w5-controls select { width: 100%; }

/* a page with its 80-word cuts marked */
.w5-doc { border: 1px solid var(--edge); border-radius: 12px; padding: 12px 16px; background: var(--bg); font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.w5-cut { background: var(--bad-soft); color: var(--bad); border-radius: 4px; padding: 1px 6px; font: 600 12px/1.6 var(--body); white-space: nowrap; }

/* bars: label, track, value */
.w5-bars { display: grid; gap: 8px; margin: 12px 0; }
.w5-bar { display: grid; grid-template-columns: minmax(110px, 220px) 1fr 52px; gap: 10px; align-items: center; font-size: 14px; }
.w5-bar .track { height: 10px; background: var(--bg); border: 1px solid var(--edge); border-radius: 999px; overflow: hidden; }
.w5-bar .fill { height: 100%; background: var(--accent); border-radius: 999px; }
.w5-bar.dropped .fill { background: var(--muted); opacity: 0.5; }
.w5-bar .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* the per-sentence marks in the answer check, and the diagnosis quiz */
.w5-choice { display: grid; gap: 4px; margin: 8px 0 0; font-size: 14.5px; }
.w5-choice label { display: flex; gap: 8px; align-items: flex-start; }
.w5-quiz { display: grid; gap: 10px; }
.w5-quiz > p { margin: 0; }
.w5-quiz .w5-hit { padding: 14px 16px; }
.w5-quiz .w5-hit > p:first-child { margin: 0 0 6px; }
.w5-quiz .w5-hit > div:nth-child(2) { font-size: 15px; }
.w5-quiz .w5-hit > div:nth-child(3) { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.w5-quiz .w5-hit > div:last-child p { margin: 10px 0 0; font-size: 15px; }
.w5-quiz button { text-align: left; line-height: 1.3; }

/* tables */
.k-table td { overflow-wrap: break-word; }
.k-table td:not(.num) { min-width: 120px; }
.k-table td.num, .k-table th.num { white-space: nowrap; }
.k-table .k-tag { white-space: nowrap; }
.k-table td:has(> .k-tag:only-child) { min-width: 0; width: 1%; white-space: nowrap; }
.k-table small { color: var(--muted); }

/* the pipeline: question, three stages, model */
.w5-pipe { display: flex; gap: 4px; align-items: stretch; margin: 18px 0 4px; }
.w5-box { flex: 1 1 0; min-width: 0; border: 1px solid var(--edge); border-radius: 12px; padding: 10px 11px; background: var(--bg); font: 600 14px/1.35 var(--body); }
.w5-k { display: block; margin-bottom: 4px; font: 600 10.5px/1.2 var(--body); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.w5-box small { display: block; margin-top: 3px; font-weight: 400; font-size: 13px; color: var(--muted); }
.w5-box.in { background: var(--panel-2); }
.w5-box.ai { border-color: color-mix(in srgb, var(--accent) 45%, var(--edge)); background: var(--accent-soft); }
.w5-arrow { align-self: center; flex: none; width: 14px; text-align: center; color: var(--muted); font-weight: 500; }
.w5-box.ai .w5-k { color: var(--accent); }
@media (max-width: 860px) {
  .w5-pipe { flex-direction: column; }
  .w5-arrow { transform: rotate(90deg); align-self: center; line-height: 1; }
}
@media (max-width: 560px) {
  .w5-bar { grid-template-columns: 1fr 52px; gap: 4px 10px; }
  .w5-bar .track { grid-column: 1 / -1; grid-row: 2; }
}
.k-out > .w5-hit { margin: 8px 0; }
@media (max-width: 600px) { .k-table td:not(.num) { min-width: 165px; } }

/* the guide shape: small print, "You are done when", numbered actions, cards shown one at a time */
.w5-small { font-size: 14px; color: var(--muted); }
.w5-done { margin: 16px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--bg); border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--edge)); }
.k-sec.you ol > li, .k-sec.note ul > li, .k-sec.why ul > li { margin-bottom: 6px; }
.w5-run { padding: 14px 16px; margin: 0 0 12px; border-radius: 12px; background: var(--panel-2); min-width: 0; }
.w5-run-head { font-weight: 600; margin-bottom: 6px; }
.w5-run .w5-hit { background: var(--bg); border-color: var(--edge); margin: 8px 0; }
.w5-run .w5-results .w5-hit { margin: 0; }
.w5-run .w5-results .w5-text { font-size: 13.5px; }
.w5-run .k-out p { margin: 12px 0 0; }
.w5-choice-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.w5-choice-row button { text-align: left; line-height: 1.3; }
.w5-choice-row button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
/* keyword search and dense search side by side */
.w5-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.w5-two h4 { margin: 0 0 2px; font: 600 14.5px/1.35 var(--body); }
.w5-two .w5-small { margin: 0 0 6px; }
@media (max-width: 720px) { .w5-two { grid-template-columns: minmax(0, 1fr); } }
.k-table details.k-more { margin: 0; padding: 4px 10px; }
.k-table details.k-more .w5-text { font-size: 14px; white-space: pre-wrap; }
.k-msg .who { text-transform: none; }
