/* AI Traffic Tracker (/tools/ai-traffic-tracker/): builds on the shared tl-* / sv-* styles in tools.css */
.at-app { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.at-test { grid-column: 1 / -1; }
.at-presets { margin: 0 0 6px; align-items: center; }
.at-count { margin-left: auto; font-variant-numeric: tabular-nums; }
.at-region { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #868e96; margin: 12px 0 4px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.at-group-btn { border: 0; background: none; padding: 2px 0; font: inherit; font-size: 12px; font-weight: 600; text-transform: none; letter-spacing: 0; color: #3b5bdb; cursor: pointer; }
.at-group-btn:hover { text-decoration: underline; }
.at-group-btn:focus-visible { outline: 2px solid #3b5bdb; outline-offset: 2px; border-radius: 4px; }
.at-app ul.at-src-list { list-style: none; margin: 0 !important; padding: 0; }
.at-app .at-src-list li.at-src { margin: 0 !important; padding: 7px 0; border-bottom: 1px dashed #f1f3f5; }
.at-src-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; cursor: pointer; font-size: 13px; }
.at-src-head input, .at-check input { accent-color: #3b5bdb; width: 15px; height: 15px; margin: 0; cursor: pointer; flex: none; }
.at-src-name { font-weight: 600; color: #212529; }
.at-src-doms { margin: 3px 0 0 23px; display: flex; flex-wrap: wrap; gap: 3px 10px; }
.at-dom { font: 11.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #495057; word-break: break-all; }
.at-ev {
    display: inline-block; font-style: normal; font-size: 10.5px; font-weight: 700; line-height: 16px; padding: 0 6px;
    border-radius: 99px; white-space: nowrap; font-family: inherit;
}
.at-dom .at-ev { margin-left: 3px; padding: 0 4px; font-size: 9.5px; line-height: 14px; vertical-align: 1px; }
.at-ev-A { background: #ebfbee; color: #2b8a3e; }
.at-ev-B { background: #e7f5ff; color: #1971c2; }
.at-ev-D { background: #fff3bf; color: #a35f00; }
.at-ref { font-size: 11px; color: #868e96; }
.at-ref-utm { color: #2b8a3e; }
.at-ref-part { color: #a35f00; }
.at-src-note { margin: 2px 0 0 23px; font-size: 12px; color: #495057; }
.at-src-note summary { cursor: pointer; color: #3b5bdb; font-size: 12px; width: max-content; }
.at-app .at-src-note p { margin: 4px 0 0 !important; line-height: 1.6; }
.at-app p.at-google { font-size: 12.5px; line-height: 1.6; color: #495057; background: #f8f9fa; border-radius: 8px; padding: 8px 10px; margin: 12px 0 0 !important; }
.at-check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #495057; cursor: pointer; }
.at-check input { margin-top: 3px; }

.at-out .sv-panel-head { flex-wrap: wrap; gap: 6px; }
.at-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: rgba(30, 58, 138, .06); border-radius: 12px; margin-bottom: 12px; }
.at-tab {
    border: 0; background: none; padding: 5px 10px; border-radius: 9px; font-size: 13px; font-weight: 600; color: #475569; cursor: pointer;
}
.at-tab:hover { color: #1e3a8a; }
.at-tab:focus-visible { outline: 2px solid #3b5bdb; outline-offset: 1px; }
.at-tab.is-active { background: #fff; color: #1e3a8a; box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 4px 12px -6px rgba(15, 23, 42, .15); }
.at-app ol.at-steps { margin: 0 0 10px 1.3em !important; padding: 0; font-size: 13.5px; line-height: 1.7; color: #343a40; }
.at-app ol.at-steps li { margin: 0 0 6px !important; }
.at-code-wrap { position: relative; margin: 0 0 12px; }
.at-code-label { font-size: 12px; color: #868e96; margin-bottom: 4px; padding-right: 64px; }
.at-code-label .is-bad { color: #c92a2a; font-weight: 600; }
.at-copy { position: absolute; top: 0; right: 0; }
.at-app pre.at-code {
    margin: 0; padding: 10px 12px; max-height: 340px; overflow: auto; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px;
    font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #212529; white-space: pre-wrap; word-break: break-all;
}
.at-code-wrap:not(:has(.at-code-label)) pre.at-code { margin-top: 30px; }
.at-app pre.at-code code { background: none; color: inherit; padding: 0; font-size: inherit; white-space: inherit; }
.at-app ul.at-facts { list-style: none; margin: 14px 0 0 !important; padding: 10px 0 0; border-top: 1px solid #f1f3f5; }
.at-app .at-facts li { display: flex; gap: 8px; align-items: baseline; font-size: 12.5px; line-height: 1.6; color: #495057; margin: 0 0 6px !important; }
.at-app p.at-ref-line { font-size: 12px; margin: -6px 0 12px !important; }

.at-test-input { min-height: 180px; }
.at-test-summary { margin-top: 10px; }
.at-table-wrap { overflow-x: auto; }
.at-app table.at-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 0 !important; }
.at-app table.at-table th, .at-app table.at-table td {
    border: 0 !important; border-bottom: 1px solid #f1f3f5 !important; padding: 7px 6px !important; text-align: left; vertical-align: top;
}
.at-app table.at-table thead th { font-size: 12px; color: #868e96; font-weight: 600; white-space: nowrap; }
.at-td-in code { word-break: break-all; }
.at-td-in { max-width: 320px; }
.at-td-rec { font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #495057; word-break: break-all; }
.at-table tr.is-hit td:first-child { box-shadow: inset 3px 0 0 #2b8a3e; }
.at-table tr.is-warn td:first-child { box-shadow: inset 3px 0 0 #f08c00; }
.at-table tr.is-amb td:first-child { box-shadow: inset 3px 0 0 #adb5bd; }
.at-table tr.is-miss td:first-child { box-shadow: inset 3px 0 0 #e9ecef; }

@media screen and (max-width: 960px) {
    .at-app { grid-template-columns: minmax(0, 1fr); }
}
@media screen and (max-width: 600px) {
    /* Stack the tester table into cards so it fits a 375px screen without sideways scrolling */
    .at-app table.at-table thead { display: none; }
    .at-app table.at-table, .at-app table.at-table tbody, .at-app table.at-table tr, .at-app table.at-table td { display: block; width: 100%; }
    .at-app table.at-table tr { padding: 6px 0 6px 10px; border-bottom: 1px solid #e9ecef; }
    .at-app table.at-table td { border: 0 !important; padding: 2px 0 !important; max-width: none; }
    .at-app table.at-table td:nth-child(4)::before, .at-app table.at-table td:nth-child(5)::before {
        content: attr(data-label); font-size: 11.5px; color: #868e96; margin-right: 6px;
    }
    .at-table tr td:first-child { box-shadow: none !important; }
    .at-table tr.is-hit { box-shadow: inset 3px 0 0 #2b8a3e; }
    .at-table tr.is-warn { box-shadow: inset 3px 0 0 #f08c00; }
    .at-table tr.is-amb { box-shadow: inset 3px 0 0 #adb5bd; }
    .at-table tr.is-miss { box-shadow: inset 3px 0 0 #e9ecef; }
}
