/* Chunking Strategy Comparator: page-specific styles. Shared primitives live in ai-tools.css, tools.css and ds.css. */
.ait [hidden] { display: none !important; }

/* settings: strategy rows */
.ait-check { display: flex; align-items: center; gap: 10px; min-height: 40px; font-weight: 700; color: var(--ink); cursor: pointer; }
.ait-check input[type="checkbox"], .ait-check input[type="radio"] { width: 20px; height: 20px; flex: 0 0 auto; margin: 0; accent-color: var(--m); }
.ait-fs { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.ait-fs legend { font: 850 0.98rem/1.3 var(--display); font-stretch: 105%; color: var(--ink); padding: 0; margin-bottom: 6px; }
.ait-strats { display: grid; border-top: 2px solid var(--line-2); }
.ait-strat { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 0.8fr) minmax(0, 1fr); gap: 10px 14px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ait-strat-first { min-width: 0; display: grid; gap: 6px; }
.ait-strat-name { overflow-wrap: anywhere; }
.ait-strat-field { min-width: 0; }
.ait-strat-field label { display: block; font-size: 12.5px; font-weight: 800; color: var(--ink-3); margin-bottom: 4px; }
.ait-strat-field input, .ait-strat-first select { width: 100%; min-height: 40px; max-width: 100%; }
.ait-strat-field input:disabled { background: var(--page-2); color: var(--ink-3); }
@media (max-width: 520px) {
  .ait-strat { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ait-strat-first { grid-column: 1 / -1; }
}

.ait-retr { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px 22px; align-items: start; margin: 18px 0 4px; }
.ait-retr .ait-k input { width: 100%; max-width: 140px; min-height: 40px; }
.ait-retr .hint { display: block; margin-top: 6px; }
.ait-file input[type="file"] { max-width: 100%; font-size: 14px; }

/* questions */
.ait-qlist { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 12px; }
.ait-q { border: 2px solid var(--line-2); background: #fff; padding: 12px 14px; min-width: 0; }
.ait-q .field { margin-bottom: 8px; }
.ait-q .ait-bar { margin-top: 4px; }
.ait-q .ait-meta { margin: 0 0 6px; overflow-wrap: anywhere; }
.ait-paste { margin-top: 8px; }
.ait-paste > summary { cursor: pointer; font-weight: 800; color: var(--ink); min-height: 40px; display: flex; align-items: center; }
.ait-paste textarea.short { min-height: 84px; font: 500 13.5px/1.5 var(--code); }

/* document text viewer */
.ait-doc { max-height: 380px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: #fff; border: 2px solid var(--line-2); padding: 12px 14px; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.ait-doc:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.ait-gold-sel { background: color-mix(in srgb, var(--m) 35%, #fff); color: var(--ink); box-shadow: inset 0 -3px 0 var(--m-ink); }
.ait-gold-other { text-decoration: underline dotted var(--ink-3); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.ait-empty { white-space: normal; }

/* results */
.ait-results { display: grid; gap: 18px; min-width: 0; }
.ait-results > .card { min-width: 0; }
.ait-reading { font: 850 1.2rem/1.35 var(--display); font-stretch: 105%; color: var(--ink); margin: 0 0 14px; max-width: 60ch; overflow-wrap: anywhere; }
.ait-caveat { margin-top: 14px; }
.ait-caveat ul { margin: 6px 0 0 1.1em; padding: 0; }
.ait-caveat li { margin-bottom: 4px; font-size: 14px; }
#warnings .msg { margin-bottom: 8px; }
.ait-caption { text-align: left; font-size: 13px; line-height: 1.5; color: var(--ink-3); padding: 0 0 10px; caption-side: top; }
.ait-h4 { font: 850 1rem/1.3 var(--display); color: var(--ink); margin: 18px 0 6px; }

.cmp-table th, .cmp-table td { white-space: normal; vertical-align: top; overflow-wrap: anywhere; }
.cmp-table td { font-variant-numeric: tabular-nums; }
.cmp-table th.name { font-weight: 800; color: var(--ink); background: #fff; }
.cmp-table td .ait-tag { margin-left: 4px; vertical-align: middle; }
@media (max-width: 640px) {
  .cmp-table thead { display: none; }
  .cmp-table, .cmp-table tbody, .cmp-table tr, .cmp-table th, .cmp-table td { display: block; width: 100%; }
  .cmp-table tr { border-bottom: 2px solid var(--line-2); padding: 10px 0; }
  .cmp-table th.name { padding: 4px 12px 8px; border: 0; font-size: 15px; }
  .cmp-table td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 6px 12px; border: 0; text-align: right; }
  .cmp-table td::before { content: attr(data-label); font-weight: 800; color: var(--ink-3); text-align: left; flex: 0 1 50%; }
}

/* document map */
.ait-map { display: grid; gap: 4px; }
.ait-map-row { display: grid; gap: 4px; margin-bottom: 12px; min-width: 0; }
.ait-map-label { font-size: 13.5px; color: var(--ink-2); overflow-wrap: anywhere; }
.ait-map-label b { color: var(--ink); }
.ait-map-svg { display: block; width: 100%; height: 44px; background: var(--page-2); border: 2px solid var(--line-2); }
.map-tick { fill: none; stroke: var(--ink-3); stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-gold { fill: var(--line-2); }
.map-gold-sel { fill: var(--ink); }
.map-ret { fill: color-mix(in srgb, var(--m) 40%, #fff); stroke: var(--m-ink); stroke-width: 1; vector-effect: non-scaling-stroke; cursor: default; }
.map-ret:focus { outline: none; stroke: var(--ink); stroke-width: 3; }
.ait-tip { position: fixed; z-index: 50; max-width: 290px; background: #fff; color: var(--ink); border: 2px solid var(--ink); padding: 8px 10px; font-size: 13px; line-height: 1.4; pointer-events: none; overflow-wrap: anywhere; }
#map-sr li { font-size: 13.5px; margin-bottom: 6px; color: var(--ink-2); overflow-wrap: anywhere; }

/* drill-down */
.ait-drill { border: 2px solid var(--line-2); background: #fff; padding: 10px 12px; margin-bottom: 10px; min-width: 0; }
.ait-drill > summary { cursor: pointer; font-weight: 800; color: var(--ink); min-height: 40px; display: flex; align-items: center; overflow-wrap: anywhere; }
.ait-drill[open] > summary { margin-bottom: 8px; }
.ait-chunk { border-top: 2px solid var(--line-2); padding: 10px 0 2px; }
.ait-chunk .ait-meta { margin: 0 0 4px; overflow-wrap: anywhere; }
.ait-excerpt { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; color: var(--ink-2); background: var(--page-2); padding: 8px 10px; margin: 6px 0; }
.ait-drill details > summary { cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--ink-2); min-height: 40px; display: flex; align-items: center; }
.ait-drill pre.ait-out { max-height: 320px; }
