/* Entity Consistency Checker (ec-*). Loaded by the tool page only; shared controls come from tools.css. */
.ec-app { font-size: 14px; line-height: 1.5; color: #343a40; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
.ec-app * { box-sizing: border-box; }
.ec-examples { margin: 0 0 12px; }
.ec-examples .sv-btn { white-space: normal; height: auto; min-height: 32px; padding: 4px .8em; text-align: left; }
.ec-src { margin-bottom: 10px; }
.ec-src-line { display: flex; gap: 6px; align-items: center; }
.ec-src-line .sv-text { flex: 1; min-width: 0; height: 34px; }
.ec-src-n {
    flex: none; width: 22px; height: 22px; border-radius: 50%; background: rgba(59, 91, 219, .1); color: #1e3a8a;
    font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}
.ec-remove { width: 32px; padding: 0; font-size: 16px; color: #868e96; }
.ec-code { margin-top: 6px; min-height: 140px; }
.ec-code[hidden] { display: none; }
.ec-src-status { font-size: 12px; color: #868e96; margin: 3px 0 0 28px; min-height: 0; word-break: break-word; }
.ec-src-status:empty { display: none; }
.ec-src-status.is-ok { color: #2b8a3e; }
.ec-src-status.is-warn { color: #e67700; }
.ec-src-status.is-bad { color: #c92a2a; }
.ec-src-status.is-busy::before {
    content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px;
    border: 2px solid #91a7ff; border-top-color: transparent; border-radius: 50%; animation: ec-spin .8s linear infinite;
}
@keyframes ec-spin { to { transform: rotate(360deg); } }
.ec-note { margin-top: 10px !important; }
.sv-help.is-bad:empty { display: none; }
.ec-empty { color: #64748b; text-align: center; padding: 2.5rem 1rem; margin: 0 !important; }

.ec-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: #495057; margin-bottom: 10px; }
.ec-count { display: inline-flex; align-items: center; gap: 4px; }
.ec-tabs { margin-bottom: 12px; }
.ec-pane[hidden] { display: none; }
.ec-tools { margin: 0 0 8px; justify-content: flex-end; }

.ec-app ul.ec-issues { list-style: none; margin: 0 !important; padding: 0; }
.ec-app .ec-issues > li { margin: 0 0 6px !important; border: 1px solid #e9ecef; border-radius: 10px; background: #fff; }
.ec-issue summary {
    display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; padding: 8px 26px 8px 10px; cursor: pointer; list-style: none; font-size: 13px; line-height: 1.55;
    position: relative;
}
.ec-issue summary::-webkit-details-marker { display: none; }
.ec-issue summary::after { content: '▸'; position: absolute; right: 10px; top: 8px; color: #adb5bd; transition: transform .15s; }
.ec-issue details[open] summary::after { transform: rotate(90deg); }
.ec-issue summary:focus-visible { outline: 2px solid #3b5bdb; outline-offset: -2px; border-radius: 10px; }
.ec-issue .sv-msg { flex: 1 1 260px; }
.ec-issue code, .ec-meta code, .ec-role code { font-size: 11.5px; padding: 0 4px; word-break: break-all; }
.ec-issue-body { padding: 0 12px 10px; font-size: 13px; color: #495057; }
.ec-app .ec-issue-body p { margin: 0 0 6px !important; }
.ec-lv {
    flex: none; font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 99px; line-height: 18px; white-space: nowrap; cursor: help;
    border: 1px solid #dee2e6; color: #495057; background: #fff;
}
.ec-lv-A { border-color: #8ce99a; color: #2b8a3e; background: #ebfbee; }
.ec-lv-B { border-color: #a5d8ff; color: #1971c2; background: #e7f5ff; }
.ec-lv-C { border-color: #ffd8a8; color: #d9480f; background: #fff4e6; }
.ec-lv-D { border-color: #dee2e6; color: #495057; background: #f8f9fa; }
.ec-lv-spec { border-style: dashed; color: #5f3dc4; border-color: #b197fc; }
.ec-meta { font-size: 12px; color: #64748b; }
.ec-meta a { text-decoration: underline; }

.ec-code-wrap { position: relative; margin: 6px 0 8px; }
.ec-code-wrap .ec-copy { position: absolute; top: 6px; right: 6px; height: 26px; font-size: 12px; z-index: 1; }
.ec-app pre.ec-pre {
    margin: 0; max-height: 360px; overflow: auto; padding: 10px 12px; padding-right: 64px; font-size: 11.5px; line-height: 1.5;
    background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; white-space: pre; color: #343a40;
}
.ec-app pre.ec-pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.ec-app pre.ec-pre-plain { padding-right: 12px; margin-bottom: 6px; }

.ec-entity { border: 1px solid #e9ecef; border-radius: 12px; padding: 12px; margin: 0 0 12px; background: #fff; }
.ec-app .ec-entity-title { font-size: 15px; margin: 0 0 4px !important; color: #111827; }
.ec-entity-id { font-size: 11.5px; color: #3b5bdb; word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; margin-bottom: 8px; }
.ec-table-wrap { overflow-x: auto; margin-bottom: 8px; -webkit-overflow-scrolling: touch; }
.ec-app table.ec-matrix { border-collapse: collapse; font-size: 12px; margin: 0 !important; min-width: 100%; }
.ec-app table.ec-matrix th, .ec-app table.ec-matrix td {
    border: 0 !important; border-bottom: 1px solid #f1f3f5 !important; padding: 6px 8px !important; text-align: left; vertical-align: top;
    min-width: 150px; max-width: 280px; word-break: break-word;
}
.ec-app table.ec-matrix tbody th { min-width: 110px; font-weight: 400; position: sticky; left: 0; background: #fff; }
.ec-app table.ec-matrix thead th { color: #495057; font-weight: 600; }
.ec-th-page { font-size: 12px; }
.ec-th-path { font-size: 11px; color: #868e96; font-weight: 400; }
.ec-app table.ec-matrix tr.is-diff td, .ec-app table.ec-matrix tr.is-diff th { background: #fff9db; }
.ec-app ul.ec-cell-list { margin: 0 !important; padding-left: 1.1em; }
.ec-app .ec-cell-list li { margin: 0 !important; }
.ec-dim { color: #adb5bd; }
.ec-link { display: inline-block; font-size: 11.5px; padding: 0 8px; border-radius: 99px; margin: 2px 2px 0 0; }
.ec-link.is-ok { background: #ebfbee; color: #2b8a3e; }
.ec-link.is-no { background: #fff3bf; color: #e67700; }

.ec-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: #495057; margin: 0 0 8px; }
.ec-key { display: inline-block; width: 22px; height: 0; border-top: 2px solid #3b5bdb; vertical-align: middle; margin-right: 6px; }
.ec-key.is-ref { border-top: 2px dashed #868e96; }
.ec-key.is-bad { border-top-color: #e03131; }
.ec-graph-wrap { overflow-x: auto; border: 1px solid #e9ecef; border-radius: 12px; background: #fbfcfe; padding: 8px; }
.ec-svg { display: block; width: 100%; min-width: 560px; height: auto; }
.ec-edge { fill: none; stroke-width: 2; }
.ec-edge.is-def { stroke: #4c6ef5; }
.ec-edge.is-ref { stroke: #868e96; stroke-dasharray: 5 4; }
.ec-edge.is-bad { stroke: #e03131; }
.ec-gpage rect { fill: #fff; stroke: #ced4da; }
.ec-gent rect { fill: #edf2ff; stroke: #91a7ff; }
.ec-gent.is-warn rect { fill: #fff9db; stroke: #fcc419; }
.ec-gent.is-ghost rect { fill: #f8f9fa; stroke: #adb5bd; stroke-dasharray: 5 4; }
.ec-gent[data-ent] { cursor: pointer; }
.ec-gent[data-ent]:hover rect, .ec-gent[data-ent]:focus rect { stroke: #3b5bdb; stroke-width: 2; }
.ec-gent:focus { outline: none; }
.ec-gt1 { font-size: 12.5px; font-weight: 700; fill: #212529; }
.ec-gt2 { font-size: 11px; fill: #64748b; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.ec-page-rec { border: 1px solid #e9ecef; border-radius: 10px; padding: 8px 12px; margin: 0 0 8px; background: #fff; }
.ec-page-rec summary { cursor: pointer; font-weight: 600; font-size: 13px; }
.ec-app .ec-role { font-size: 13px; color: #495057; margin: 8px 0 4px !important; }
.ec-app ul.ec-notes { margin: 0 0 8px 1.2em !important; font-size: 12.5px; color: #e67700; }

@media screen and (max-width: 960px) {
    .ec-app { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .ec-src-status.is-busy::before { animation: none; } .ec-issue summary::after { transition: none; } }
