/* llms.txt Validator & Generator (lt-*). Builds on the shared sv-* / tl-* controls in tools.css. */
.lt-tabs { display: inline-flex; gap: 4px; padding: 4px; background: rgba(30, 58, 138, .06); border-radius: 12px; margin-bottom: 12px; }
.lt-tab {
    border: 0; background: none; padding: 7px 18px; border-radius: 9px; font-size: 14px; font-weight: 600; color: #475569; cursor: pointer;
}
.lt-tab:hover { color: #1e3a8a; }
.lt-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); }
.lt-tab:focus-visible, .lt-view-tab:focus-visible, .lt-line:focus-visible, .lt-node:focus-visible { outline: 2px solid #3b5bdb; outline-offset: 1px; }

.lt-app { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; font-size: 14px; line-height: 1.5; color: #343a40; }
.lt-app * { box-sizing: border-box; }
.lt-app[hidden], .lt-gen[hidden], .lt-view[hidden] { display: none; }
.lt-app code { font-size: .92em; padding: 0 .3em; background: #f1f3f5; color: #2f4ac0; border-radius: 3px; }

/* Editor with line numbers */
.lt-editor {
    display: flex; height: 420px; min-height: 200px; resize: vertical; overflow: hidden;
    border: 1px solid #dee2e6; border-radius: 10px; background: #f8f9fb;
}
.lt-editor:focus-within { border-color: #3b5bdb; background: #fff; box-shadow: 0 0 0 3px rgba(59, 91, 219, .12); }
.lt-app .lt-gutter, .lt-app .lt-textarea {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; font-size: 12px !important; line-height: 19px !important;
    margin: 0 !important; padding: 10px 8px !important; letter-spacing: 0 !important;
}
.lt-app .lt-gutter {
    flex: none; min-width: 40px; text-align: right; color: #adb5bd; background: transparent !important; border-radius: 0;
    border-right: 1px solid rgba(15, 23, 42, .06); overflow: hidden; user-select: none; white-space: pre;
}
.lt-textarea { flex: 1; min-width: 0; border: 0; outline: none; resize: none; background: transparent; color: #212529; white-space: pre; overflow: auto; tab-size: 2; }

/* Honesty note */
.lt-honest {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 14px; border-radius: 14px;
    background: #fff9db; border: 1px solid #ffe066; color: #5c3c00; font-size: 13px; line-height: 1.65;
}
.lt-honest p { margin: 0 !important; }
.lt-honest a { color: #8a5200; text-decoration: underline; }
.lt-honest-icon {
    flex: none; width: 20px; height: 20px; border-radius: 50%; background: #f59f00; color: #fff; font-weight: 700; font-size: 13px;
    display: inline-flex; align-items: center; justify-content: center; margin-top: 1px;
}

/* Summary chips and hard checks */
.lt-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.lt-chip { font-size: 12.5px; padding: 3px 10px; border-radius: 99px; background: #f1f3f5; color: #495057; }
.lt-chip b { font-variant-numeric: tabular-nums; }
.lt-chip.sev-error { background: #ffe3e3; color: #c92a2a; }
.lt-chip.sev-warning { background: #fff3bf; color: #e67700; }
.lt-chip.sev-tip { background: #e7f5ff; color: #1971c2; }
.lt-noscore { font-size: 12px; color: #868e96; flex-basis: 100%; }
.lt-checks { border: 1px solid #e9ecef; border-radius: 10px; padding: 8px 10px; margin-bottom: 12px; }
.lt-checks-head { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #868e96; margin-bottom: 4px; }
.lt-app .lt-checks ul { list-style: none; margin: 0 !important; padding: 0; }
.lt-app .lt-checks li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0 !important; padding: 4px 0; font-size: 13px; }
.lt-checks li > span:nth-child(2) { flex: 1 1 180px; min-width: 0; }

/* Evidence badges */
.lt-ev { display: inline-block; font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 99px; line-height: 18px; white-space: nowrap; }
.lt-ev.ev-A { background: #ebfbee; color: #2b8a3e; }
.lt-ev.ev-B { background: #e7f5ff; color: #1864ab; }
.lt-ev.ev-C { background: #f3f0ff; color: #5f3dc4; }
.lt-ev.ev-D { background: #f1f3f5; color: #495057; }
.lt-app a.lt-ev-link { text-decoration: none !important; }
.lt-app a.lt-ev-link:hover .lt-ev { box-shadow: 0 0 0 1px currentColor; }

/* View tabs */
.lt-views { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid #e9ecef; margin: 0 0 10px; }
.lt-view-tab {
    border: 0; background: none; padding: 7px 10px; font-size: 13px; font-weight: 600; color: #868e96; cursor: pointer;
    border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 5px;
}
.lt-view-tab.is-active { color: #3b5bdb; border-bottom-color: #3b5bdb; }
.lt-count:not(:empty) { background: #3b5bdb; color: #fff; border-radius: 99px; font-size: 11px; padding: 0 7px; line-height: 17px; }
.lt-view { max-height: 720px; overflow: auto; }

/* Issues */
.lt-fixbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.lt-group-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #868e96; margin: 10px 0 4px; }
.lt-app ul.lt-issues { list-style: none; margin: 0 !important; padding: 0; }
.lt-app .lt-issues li.lt-issue { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 8px; margin: 0 0 2px !important; }
.lt-app .lt-issues li.lt-issue:hover { background: #f8f9fa; }
.lt-issue .sv-sev { margin-top: 1px; }
.lt-issue-body { min-width: 0; flex: 1; }
.lt-issue-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.lt-issue-title { font-size: 13.5px; word-break: break-word; }
.lt-lines { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.lt-line {
    border: 1px solid #dee2e6; background: #fff; color: #3b5bdb; border-radius: 5px; padding: 0 6px; font-size: 11.5px; line-height: 18px; cursor: pointer;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.lt-line:hover { border-color: #3b5bdb; background: #edf2ff; }
.lt-why { margin-top: 4px; }
.lt-why summary { cursor: pointer; font-size: 12.5px; color: #3b5bdb; }
.lt-app .lt-why p { margin: 6px 0 !important; font-size: 13px; color: #495057; line-height: 1.65; }
.lt-fix-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #868e96; margin: 6px 0 4px; }
.lt-app pre.lt-code {
    margin: 0 !important; max-height: 320px; overflow: auto; padding: 8px 10px !important; font-size: 12px !important; line-height: 1.55;
    background: #f8f9fa !important; border: 1px solid #e9ecef; border-radius: 6px; white-space: pre-wrap; word-break: break-all; color: #343a40;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Structure tree */
.lt-tree { font-size: 13px; }
.lt-branch { margin-left: 14px; padding-left: 12px; border-left: 1px dashed #ced4da; }
.lt-node { display: flex; gap: 8px; align-items: baseline; padding: 4px 6px; border-radius: 6px; cursor: default; min-width: 0; }
.lt-node[data-line] { cursor: pointer; }
.lt-node[data-line]:hover { background: #edf2ff; }
.lt-node-label {
    flex: none; min-width: 26px; text-align: center; font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: 4px;
    background: #f1f3f5; color: #495057; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 18px;
}
.lt-node-value { min-width: 0; word-break: break-word; }
.lt-node.is-h1 { font-size: 15px; font-weight: 700; color: #1e3a8a; }
.lt-node.is-h1 .lt-node-label { background: #1e3a8a; color: #fff; }
.lt-node.is-h2 { font-weight: 700; color: #1e3a8a; margin-top: 6px; }
.lt-node.is-h2 .lt-node-label { background: #dbe4ff; color: #1e3a8a; }
.lt-node.is-optional .lt-node-label { background: #f1f3f5; color: #868e96; }
.lt-node.is-quote .lt-node-value { color: #495057; font-style: italic; }
.lt-node.is-details .lt-node-value { color: #868e96; }
.lt-node.is-bad { background: #fff5f5; }
.lt-node.is-bad .lt-node-label { background: #ffe3e3; color: #c92a2a; }
.lt-node em { color: #c92a2a; font-style: normal; }
.lt-link-title { font-weight: 600; color: #212529; }
.lt-link-url { font-size: 11.5px; color: #3b5bdb; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.lt-link-notes { display: block; font-size: 12px; color: #868e96; }
.lt-bad-text { color: #c92a2a; }
.lt-ref { margin-top: 14px; border-top: 1px solid #e9ecef; padding-top: 10px; }
.lt-ref summary { cursor: pointer; font-weight: 600; font-size: 13px; color: #495057; }
.lt-ref .sv-help { margin-top: 6px !important; }
.lt-ref-crash { color: #c92a2a; font-size: 13px; }

/* Links table and file info */
.lt-links-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px; }
.lt-links-head .sv-help { flex: 1 1 240px; }
.lt-table-wrap { overflow-x: auto; }
.lt-app table.lt-table, .lt-app table.lt-kv { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 0 0 10px !important; }
.lt-app table.lt-table th, .lt-app table.lt-table td, .lt-app table.lt-kv th, .lt-app table.lt-kv td {
    border: 0 !important; border-bottom: 1px solid #f1f3f5 !important; padding: 6px 6px !important; text-align: left; vertical-align: top; word-break: break-word;
}
.lt-app table.lt-table thead th { font-size: 12px; color: #868e96; font-weight: 600; }
.lt-app table.lt-kv th { width: 32%; font-weight: 600; color: #495057; }
.lt-kind { display: inline-block; font-size: 11px; padding: 0 7px; border-radius: 99px; line-height: 18px; background: #f1f3f5; color: #495057; white-space: nowrap; }
.lt-kind.k-site { background: #ebfbee; color: #2b8a3e; }
.lt-kind.k-external { background: #e7f5ff; color: #1971c2; }
.lt-kind.k-relative, .lt-kind.k-dup { background: #fff3bf; color: #e67700; }
.lt-kind.k-scheme { background: #ffe3e3; color: #c92a2a; }
.lt-file-title { font-weight: 700; font-size: 13px; color: #1e3a8a; margin: 4px 0 6px; }

/* Generator */
.lt-gen .lt-app { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.lt-import { min-height: 110px !important; }
.lt-g-sections { max-height: 75vh; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.lt-app pre.lt-g-pre { max-height: 560px; min-height: 160px; }
.lt-g-section { border: 1px solid #e9ecef; border-radius: 12px; padding: 10px; margin: 0 0 10px; background: #fff; }
.lt-g-section.is-optional { background: #f8f9fa; border-style: dashed; }
.lt-g-section-head { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.lt-g-secname { font-weight: 700; height: 32px; padding: 4px 8px !important; }
.lt-g-optional { font-weight: 700; font-size: 13px; color: #495057; }
.lt-app ul.lt-g-items { list-style: none; margin: 0 !important; padding: 0; min-height: 34px; border-radius: 8px; }
.lt-app .lt-g-items li { margin: 0 0 6px !important; }
.lt-g-item { display: flex; gap: 6px; align-items: flex-start; padding: 6px; border: 1px solid #f1f3f5; border-radius: 8px; background: #fff; }
.lt-g-item.is-dragging { opacity: .45; }
.lt-g-item.is-drop { box-shadow: inset 0 3px 0 #3b5bdb; }
.lt-g-items.is-drop { outline: 2px dashed #3b5bdb; outline-offset: 2px; }
.lt-g-handle { flex: none; cursor: grab; color: #adb5bd; font-size: 14px; line-height: 30px; padding: 0 2px; user-select: none; letter-spacing: -3px; }
.lt-g-fields { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 4px; }
.lt-g-fields .tl-input { height: 30px; padding: 4px 8px; font-size: 13px; }
.lt-g-fields [data-f=notes] { grid-column: 1 / -1; }
.lt-mono-in { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; font-size: 12px !important; }
.lt-g-item-tools { flex: none; display: flex; flex-wrap: wrap; gap: 3px; width: 128px; justify-content: flex-end; }
.lt-g-item-tools .sv-select { flex: 1 1 100%; height: 28px; font-size: 12px; min-width: 0; }
.lt-g-item-tools .sv-icon { width: 28px; height: 26px; }
.lt-g-dropzone { padding: 8px !important; text-align: center; color: #adb5bd; font-size: 12.5px; border: 1px dashed #dee2e6; border-radius: 8px; }

@media screen and (max-width: 960px) {
    .lt-app, .lt-gen .lt-app { grid-template-columns: minmax(0, 1fr); }
    .lt-g-sections { max-height: none; overflow: visible; }
    .lt-editor { height: 300px; }
    .lt-view { max-height: none; }
}
@media screen and (max-width: 600px) {
    .lt-g-item { flex-wrap: wrap; }
    .lt-g-fields { grid-template-columns: minmax(0, 1fr); flex-basis: calc(100% - 24px); }
    .lt-g-item-tools { width: 100%; justify-content: flex-start; }
    .lt-g-item-tools .sv-select { flex: 1 1 120px; }
    .lt-tab { padding: 7px 14px; }
}
