.zone-switch {
    display: flex;
    gap: .25rem;
    padding: .25rem;
    margin: 0 0 1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.zone-switch a {
    flex: 1;
    text-align: center;
    padding: .4rem .5rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: background .15s, color .15s;
}
.zone-switch a:hover { color: var(--text); }
.zone-switch a.on {
    background: var(--brand);
    color: #05140d;
}

.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: flex-start; justify-content: center; padding: 4vh 1rem; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(2,6,12,.7); backdrop-filter: blur(2px); }
.modal-card {
    position: relative; width: 100%; max-width: 720px; max-height: 88vh; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-body { padding: 1.1rem 1.25rem; }
.modal-sec { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); font-weight: 600; margin: 1.1rem 0 .5rem; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--border); font-size: .88rem; }
.kv span { color: var(--text-muted); }
.kv b { font-weight: 600; word-break: break-word; }
.raw {
    background: #060a10; border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: .8rem; font-family: var(--mono); font-size: .78rem; line-height: 1.5;
    max-height: 280px; overflow: auto; white-space: pre; color: var(--text-muted);
}
tbody tr.row-click:hover td { background: var(--surface-3); }

.mitre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .5rem; }
.mitre-cell {
    border-radius: var(--radius-sm); padding: .6rem .7rem;
    border: 1px solid var(--border); display: flex; flex-direction: column; gap: .3rem;
}
.mitre-cell .mitre-id { font-family: var(--mono); font-size: .8rem; }
.mitre-cell .mitre-n { font-size: 1.1rem; font-weight: 700; }
.mitre-cell--low { background: rgba(56,189,248,.08); border-color: rgba(56,189,248,.25); color: var(--low); }
.mitre-cell--medium { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.3); color: var(--med); }
.mitre-cell--high { background: rgba(251,146,60,.12); border-color: rgba(251,146,60,.35); color: var(--high); }
.mitre-cell--critical { background: rgba(251,113,133,.14); border-color: rgba(251,113,133,.4); color: var(--crit); }

.nav-group { margin: 0; }
.nav-group > summary {
    display: flex; align-items: center; gap: .6rem;
    padding: .55rem .75rem; border-radius: var(--radius-sm);
    color: var(--text-muted); font-weight: 500; cursor: pointer;
    list-style: none; user-select: none;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
    content: "›"; margin-left: auto; color: var(--text-dim);
    transition: transform .15s; font-size: 1rem; line-height: 1;
}
.nav-group[open] > summary::after { transform: rotate(90deg); }
.nav-group > summary:hover { background: var(--surface-2); color: var(--text); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 .35rem .35rem; padding-left: .6rem; border-left: 1px solid var(--border); }
.nav-sub a { padding: .45rem .7rem; font-size: .88rem; }

.lang-switch { display: flex; gap: .3rem; margin-bottom: .75rem; }
.lang-switch a {
    flex: 1; text-align: center; padding: .3rem; border-radius: 7px;
    font-size: .74rem; font-weight: 700; letter-spacing: .03em;
    color: var(--text-dim); border: 1px solid var(--border); text-decoration: none;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a.on { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }

.live-pill {
    display: none;
    align-items: center;
    gap: .5rem;
    padding: .35rem .7rem;
    border-radius: 999px;
    background: rgba(245,158,11,.1);
    border: 1px solid rgba(245,158,11,.3);
    color: var(--warn);
    font-size: .8rem;
    font-weight: 600;
}
.live-pill.on { display: inline-flex; }
.live-pill .spin {
    width: 12px; height: 12px;
    border: 2px solid rgba(245,158,11,.35);
    border-top-color: var(--warn);
    border-radius: 50%;
    animation: live-spin .7s linear infinite;
}
@keyframes live-spin { to { transform: rotate(360deg); } }
@keyframes live-blink { 50% { opacity: .25; } }

.badge--run .dot { animation: live-blink 1s ease-in-out infinite; }

.progress {
    height: 8px;
    border-radius: 999px;
    background: var(--surface-3);
    overflow: hidden;
    border: 1px solid var(--border);
}
.progress-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), var(--brand-strong));
    transition: width .5s ease;
}
.progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: .4rem;
    font-size: .8rem;
    color: var(--text-muted);
}
.progress-meta .cur { color: var(--brand-strong); font-family: var(--mono); }

.term {
    background: #060a10;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.3);
}
.term-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .55rem .8rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-size: .78rem;
    color: var(--text-muted);
}
.term-head .lights { display: flex; gap: .35rem; margin-right: .4rem; }
.term-head .lights i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.term-head .lights i:nth-child(1) { background: #f43f5e; }
.term-head .lights i:nth-child(2) { background: #f59e0b; }
.term-head .lights i:nth-child(3) { background: #22c55e; }
.term-head .live-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
    animation: live-blink 1.2s ease-in-out infinite; margin-left: auto;
}
.term-body {
    font-family: var(--mono);
    font-size: .8rem;
    line-height: 1.55;
    padding: .7rem .8rem;
    max-height: 340px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
.term-line { display: block; }
.term-line .t { color: var(--text-dim); margin-right: .6rem; }
.term-line .sig { margin-right: .5rem; }
.lv-ok    { color: var(--ok); }
.lv-fail  { color: var(--danger); }
.lv-run   { color: var(--warn); }
.lv-wait  { color: var(--accent); }
.lv-info  { color: var(--text-muted); }
.lv-muted { color: var(--text-dim); }
.term-cursor::after {
    content: "▋";
    color: var(--brand);
    animation: live-blink .9s step-end infinite;
}
.term-empty { color: var(--text-dim); }
