/* ── Implementation Status ─────────────────────────────────────── */
:root {
    --impl-pseudo:    #6b7280;
    --impl-js:        #ef4444;
    --impl-cloomc:    #c084fc;
    --impl-installed: #22c55e;
    --impl-tested:    #38bdf8;
    --impl-released:  #f1f5f9;
}

.impl-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.impl-dot-pseudo    { background: var(--impl-pseudo); }
.impl-dot-js        { background: var(--impl-js);        box-shadow: 0 0 4px var(--impl-js); }
.impl-dot-cloomc    { background: var(--impl-cloomc);    box-shadow: 0 0 4px var(--impl-cloomc); }
.impl-dot-installed { background: var(--impl-installed); box-shadow: 0 0 4px var(--impl-installed); }
.impl-dot-tested    { background: var(--impl-tested);    box-shadow: 0 0 5px var(--impl-tested); }
.impl-dot-released  { background: var(--impl-released);  box-shadow: 0 0 5px var(--impl-released); }

/* abs-item: columns — boot-entry btn | name | profile badge | status dot */
.abs-item {
    grid-template-columns: auto 1fr auto auto;
}
.abs-item-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    justify-self: center;
    align-self: center;
}

/* Legend strip */
.impl-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 5px 8px;
    background: rgba(255,255,255,0.025);
    border: 1px solid var(--border);
    border-radius: 5px;
    margin-bottom: 7px;
    font-size: 0.6rem;
    line-height: 1;
}
.impl-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    white-space: nowrap;
}
.impl-legend-swatch {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Status select in method panel */
.impl-status-select {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 10px;
    border: 1px solid;
    background: transparent;
    cursor: pointer;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    outline: none;
    transition: opacity 0.15s;
    margin-left: auto;
}
.impl-status-select:hover { opacity: 0.75; }
.impl-status-select option {
    background: #1a1a2e;
    color: #eaeaea;
    text-transform: none;
    font-weight: normal;
    font-size: 0.75rem;
}
.impl-status-pseudo    { color: var(--impl-pseudo);    border-color: var(--impl-pseudo); }
.impl-status-js        { color: var(--impl-js);        border-color: var(--impl-js); }
.impl-status-cloomc    { color: var(--impl-cloomc);    border-color: var(--impl-cloomc); }
.impl-status-installed { color: var(--impl-installed); border-color: var(--impl-installed); }
.impl-status-tested    { color: var(--impl-tested);    border-color: var(--impl-tested); }
.impl-status-released  { color: var(--impl-released);  border-color: var(--impl-released); }

/* Badge inside method tab chip */
.abs-method-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 6px;
    padding: 1px 5px 1px 4px;
    border-radius: 8px;
    border: 1px solid currentColor;
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: pointer;
    vertical-align: middle;
    white-space: nowrap;
    line-height: 1.4;
    transition: opacity 0.15s;
}
.abs-method-status-badge:hover { opacity: 0.8; }
.abs-method-status-badge-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.abs-method-status-badge-pseudo    { color: var(--impl-pseudo); }
.abs-method-status-badge-js        { color: var(--impl-js); }
.abs-method-status-badge-cloomc    { color: var(--impl-cloomc); }
.abs-method-status-badge-installed { color: var(--impl-installed); }
.abs-method-status-badge-tested    { color: var(--impl-tested); }
.abs-method-status-badge-released  { color: var(--impl-released); }

/* Compile-state badge (•Pseudo / •Compiled / •Error) on method tabs and history rows */
.abs-compile-state-badge {
    display: inline-block;
    margin-left: 5px;
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    vertical-align: middle;
    white-space: nowrap;
    padding: 1px 4px;
    border-radius: 6px;
    pointer-events: none;
    line-height: 1.4;
}
.abs-compile-state-pseudo   { color: #9ca3af; background: rgba(156,163,175,0.12); border: 1px solid rgba(156,163,175,0.25); }
.abs-compile-state-compiled { color: #4ade80; background: rgba(74,222,128,0.12); border: 1px solid rgba(74,222,128,0.3); }
.abs-compile-state-error    { color: #f87171; background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.3); }

/* Compiled metadata line */
.abs-compiled-meta {
    font-size: 0.62rem;
    color: #4ade80;
    margin: 4px 0 2px;
    font-style: italic;
}

/* Compile error block */
.abs-compile-error-block {
    margin: 4px 0;
    padding: 6px 8px;
    background: rgba(248,113,113,0.08);
    border: 1px solid rgba(248,113,113,0.25);
    border-radius: 4px;
}
.abs-compile-error-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: #f87171;
    display: block;
    margin-bottom: 4px;
}
.abs-compile-error-pre {
    margin: 0;
    font-size: 0.62rem;
    color: #fca5a5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* LUMP assembly toolbar */
.abs-lump-assemble-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    background: rgba(74,222,128,0.05);
    border: 1px solid rgba(74,222,128,0.2);
    border-top: none;
    border-radius: 0 0 4px 4px;
    font-size: 0.65rem;
}
.abs-lump-assemble-ready   { color: #4ade80; font-weight: 600; }
.abs-lump-assemble-partial { color: #9ca3af; }
.abs-lump-assemble-btn {
    margin-left: auto;
    font-size: 0.6rem;
    padding: 2px 7px;
    background: rgba(74,222,128,0.15);
    color: #4ade80;
    border: 1px solid rgba(74,222,128,0.4);
    border-radius: 4px;
    cursor: pointer;
}
.abs-lump-assemble-btn:hover { background: rgba(74,222,128,0.25); }
.abs-lump-export-btn {
    font-size: 0.6rem;
    padding: 2px 7px;
    background: rgba(96,165,250,0.12);
    color: #60a5fa;
    border: 1px solid rgba(96,165,250,0.35);
    border-radius: 4px;
    cursor: pointer;
}
.abs-lump-export-btn:hover { background: rgba(96,165,250,0.22); }
.abs-lump-import-btn {
    margin-left: auto;
    font-size: 0.6rem;
    padding: 2px 7px;
    background: rgba(167,139,250,0.12);
    color: #a78bfa;
    border: 1px solid rgba(167,139,250,0.35);
    border-radius: 4px;
    cursor: pointer;
}
.abs-lump-import-btn:hover { background: rgba(167,139,250,0.22); }

/* Method panel action buttons row */
.abs-method-panel-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.abs-generate-btn {
    font-size: 0.6rem;
    padding: 2px 6px;
    background: rgba(192,132,252,0.12);
    color: #c084fc;
    border: 1px solid rgba(192,132,252,0.35);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}
.abs-generate-btn:hover { background: rgba(192,132,252,0.22); }

/* Version history panel */
.abs-method-history-details {
    margin-top: 6px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 4px;
    overflow: hidden;
}
.abs-method-history-summary {
    font-size: 0.62rem;
    color: var(--text-secondary);
    padding: 4px 8px;
    cursor: pointer;
    background: rgba(255,255,255,0.03);
    user-select: none;
    list-style: none;
}
.abs-method-history-summary:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.abs-method-history-list {
    padding: 2px 0;
}
.abs-method-history-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    font-size: 0.6rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.abs-method-history-ver  { color: #6b7280; font-variant-numeric: tabular-nums; min-width: 20px; }
.abs-method-history-ts   { color: #9ca3af; min-width: 110px; }
.abs-method-history-lang { color: #6b7280; min-width: 60px; }
.abs-method-history-restore {
    margin-left: auto;
    font-size: 0.58rem;
    padding: 1px 6px;
    background: rgba(255,255,255,0.06);
    color: #9ca3af;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
}
.abs-method-history-restore:hover { background: rgba(255,255,255,0.12); color: var(--text-primary); }
.abs-method-history-src-details {
    margin: 0 8px 4px;
}
.abs-method-history-pre {
    font-size: 0.55rem;
    max-height: 100px;
    overflow-y: auto;
    margin: 2px 0 0;
    background: rgba(0,0,0,0.2);
    padding: 4px;
    border-radius: 3px;
}

/* Floating status dropdown (appended to body) */
.abs-status-dropdown {
    position: fixed;
    z-index: 9999;
    background: #1b2d45;
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.55);
    min-width: 160px;
    padding: 4px 0;
    font-size: 0.72rem;
}
.abs-status-dropdown-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.1s;
    white-space: nowrap;
    color: var(--text-secondary);
}
.abs-status-dropdown-option:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
.abs-status-dropdown-option.current { background: rgba(255,255,255,0.04); }
.abs-status-dropdown-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Boot Sequence Code section */
.abs-boot-code-section .abs-detail-label {
    color: var(--impl-installed);
    border-bottom-color: var(--impl-installed);
}
.abs-boot-code-desc {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-style: italic;
}
.abs-boot-code-desc code {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-style: normal;
    color: var(--church-gold);
    font-size: 0.68rem;
}
.abs-boot-code-pre {
    border-left: 3px solid var(--impl-installed) !important;
}

/* ── Tools View ─────────────────────────────────────────────────────────── */
.tools-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: 1100px;
    margin: 0 auto;
    height: 100%;
    box-sizing: border-box;
    align-content: start;
}
@media (max-width: 760px) {
    .tools-layout { grid-template-columns: 1fr; }
}
.tools-panel {
    background: var(--panel-bg, #10101e);
    border: 1px solid var(--border, #1e2040);
    border-radius: 10px;
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.tools-panel-header {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    border-bottom: 1px solid var(--border, #1e2040);
    padding-bottom: 0.9rem;
}
.tools-panel-icon {
    font-size: 1.8rem;
    line-height: 1;
    flex-shrink: 0;
}
.tools-panel-title {
    font-family: Georgia, serif;
    font-size: 1.05rem;
    color: var(--church-gold, #daa520);
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.tools-panel-sub {
    font-size: 0.72rem;
    color: var(--text-secondary, #888);
}
/* Stat grid */
.tools-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
}
.tools-stat-card {
    background: var(--sim-bg, #08080f);
    border: 1px solid var(--border, #1e2040);
    border-radius: 7px;
    padding: 0.6rem 0.4rem;
    text-align: center;
}
.tools-stat-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--church-gold, #daa520);
    line-height: 1.2;
}
.tools-stat-label {
    font-size: 0.62rem;
    color: var(--text-secondary, #888);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}
/* Phase list */
.tools-phases { display: flex; flex-direction: column; gap: 0.4rem; }
.tools-phase {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.78rem;
    padding: 0.35rem 0.5rem;
    border-radius: 5px;
    background: var(--sim-bg, #08080f);
}
.tools-phase-num {
    width: 1.4em; height: 1.4em;
    border-radius: 50%;
    background: var(--church-gold, #daa520);
    color: #000;
    font-weight: 700;
    font-size: 0.72rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.tools-phase-name {
    color: #e2e8f0;
    font-weight: 600;
    min-width: 5.5em;
}
.tools-phase-desc { color: var(--text-secondary, #888); }
/* Action row */
.tools-action-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.2rem;
}
.tools-last-run {
    font-size: 0.72rem;
    color: var(--text-secondary, #888);
    font-style: italic;
}
/* Buttons */
.tools-btn {
    border: none;
    border-radius: 7px;
    padding: 0.55rem 1.1rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}
.tools-btn:active { transform: scale(0.97); }
.tools-btn-primary {
    background: var(--church-gold, #daa520);
    color: #000;
}
.tools-btn-primary:hover { opacity: 0.88; }
.tools-btn-secondary {
    background: #1e2040;
    color: #e2e8f0;
    border: 1px solid #38bdf8;
}
.tools-btn-secondary:hover { background: #28305a; }
/* GitHub cards */
.tools-gh-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem;
}
.tools-gh-card {
    background: var(--sim-bg, #08080f);
    border: 1px solid var(--border, #1e2040);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.tools-gh-card-icon {
    font-size: 1.5rem;
    color: #38bdf8;
}
.tools-gh-card-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: #e2e8f0;
}
.tools-gh-card-desc {
    font-size: 0.72rem;
    color: var(--text-secondary, #888);
    line-height: 1.5;
    flex: 1;
}
.tools-gh-note {
    font-size: 0.7rem;
    color: var(--text-secondary, #888);
    border-top: 1px solid var(--border, #1e2040);
    padding-top: 0.7rem;
    line-height: 1.5;
}
.tools-link-btn {
    background: none;
    border: none;
    color: #38bdf8;
    cursor: pointer;
    font-size: inherit;
    padding: 0;
    text-decoration: underline;
}

/* ── Tools GC Phase Cards ───────────────────────────────────────────────── */
.tools-panel-header {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}
.tgc-run-btn {
    margin-left: auto;
    padding: 0.4rem 0.9rem;
    font-size: 0.78rem;
    flex-shrink: 0;
}
.tgc-run-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.tgc-phase-cards {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.tgc-card {
    border: 1px solid var(--border, #1e2040);
    border-radius: 7px;
    overflow: hidden;
    transition: border-color 0.3s, background 0.3s;
    background: var(--sim-bg, #08080f);
}
.tgc-card[data-state="idle"] {
    border-color: #1e2040;
    opacity: 0.65;
}
.tgc-card[data-state="running"] {
    border-color: var(--church-gold, #daa520);
    opacity: 1;
    animation: tgcPulse 0.6s ease-in-out infinite alternate;
}
.tgc-card[data-state="done"] {
    border-color: #22c55e;
    opacity: 1;
    animation: none;
}
.tgc-card[data-state="error"] {
    border-color: #ef4444;
    opacity: 1;
}
@keyframes tgcPulse {
    from { box-shadow: 0 0 0 0 rgba(218,165,32,0.0); }
    to   { box-shadow: 0 0 8px 2px rgba(218,165,32,0.35); }
}
.tgc-card-hdr {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.7rem;
}
.tgc-card-num {
    width: 1.5em; height: 1.5em;
    border-radius: 50%;
    background: #1e2040;
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: background 0.3s, color 0.3s;
}
.tgc-card[data-state="running"] .tgc-card-num {
    background: var(--church-gold, #daa520);
    color: #000;
}
.tgc-card[data-state="done"] .tgc-card-num {
    background: #22c55e;
    color: #000;
}
.tgc-card[data-state="error"] .tgc-card-num {
    background: #ef4444;
    color: #fff;
}
.tgc-card-title-col {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    flex: 1;
    min-width: 0;
}
.tgc-card-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: #e2e8f0;
}
.tgc-card-static-desc {
    font-size: 0.68rem;
    color: var(--text-secondary, #888);
}
.tgc-card-badge {
    font-size: 0.78rem;
    font-weight: 700;
    min-width: 2em;
    text-align: right;
    flex-shrink: 0;
    color: #22c55e;
    transition: color 0.3s;
}
.tgc-card[data-state="running"] .tgc-card-badge { color: var(--church-gold, #daa520); }
.tgc-card[data-state="error"]   .tgc-card-badge { color: #ef4444; font-size: 0.62rem; }
.tgc-card-report {
    padding: 0 0.7rem 0.5rem 2.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.tgc-card-report:empty { display: none; }
.tgc-line {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.67rem;
    color: #a0aec0;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-all;
}

/* ── GC View (standalone page) ──────────────────────────────────────────── */
.gc-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.2rem 1.4rem 1rem;
    gap: 1rem;
    box-sizing: border-box;
    overflow: hidden;
}
.gc-topbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border, #1e2040);
    padding-bottom: 0.9rem;
}
.gc-topbar-left { flex: 1; min-width: 0; }
.gc-title {
    font-family: Georgia, serif;
    font-size: 1.1rem;
    color: var(--church-gold, #daa520);
    font-weight: 600;
}
.gc-sub {
    font-size: 0.72rem;
    color: var(--text-secondary, #888);
    margin-top: 0.2rem;
}
.gc-topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}
.gc-stat-grid {
    grid-template-columns: repeat(4, auto) !important;
    gap: 0.5rem !important;
}
/* Horizontal phase cards — override the previous flex-column */
#gc .tgc-phase-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.8rem;
    flex: 1;
    min-height: 0;
    align-items: stretch;
}
#gc .tgc-card {
    display: flex;
    flex-direction: column;
}
#gc .tgc-card-report {
    flex: 1;
    overflow-y: auto;
    padding-left: 0.7rem;
    padding-bottom: 0.6rem;
}
.gc-last-run {
    font-size: 0.72rem;
    color: var(--text-secondary, #888);
    font-style: italic;
    flex-shrink: 0;
    text-align: right;
}

/* ── GitHub View (standalone page) ─────────────────────────────────────── */
.github-layout {
    padding: 1.5rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.gh-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.gh-header-left { flex: 1; }
.gh-refresh-btn {
    background: transparent;
    border: 1px solid var(--border, #1e2040);
    color: var(--text-secondary, #888);
    font-size: 1.2rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gh-refresh-btn:hover { border-color: var(--church-gold, #daa520); color: var(--church-gold, #daa520); }
.gh-refresh-btn.spinning { animation: gh-spin 0.8s linear infinite; }
@keyframes gh-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.gh-repos-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.gh-repo-card {
    background: var(--panel-bg, #10101e);
    border: 1px solid var(--border, #1e2040);
    border-radius: 10px;
    padding: 1.2rem 1.4rem;
    transition: border-color 0.2s;
}
.gh-repo-card:hover { border-color: var(--church-gold, #daa520); }
.gh-repo-name {
    font-size: 1rem;
    font-weight: 700;
    color: #e2e8f0;
    margin-bottom: 0.3rem;
}
.gh-repo-name a {
    color: #38bdf8;
    text-decoration: none;
}
.gh-repo-name a:hover { text-decoration: underline; }
.gh-repo-desc {
    font-size: 0.78rem;
    color: var(--text-secondary, #888);
    line-height: 1.5;
    margin-bottom: 0.7rem;
}
.gh-repo-stats {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.gh-stat {
    font-size: 0.75rem;
    color: var(--text-secondary, #888);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.gh-stat-val { color: #e2e8f0; font-weight: 600; }
.gh-stat-icon { font-size: 0.85rem; }

.gh-section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.gh-section-panel {
    background: var(--panel-bg, #10101e);
    border: 1px solid var(--border, #1e2040);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    min-height: 200px;
    max-height: 380px;
    overflow-y: auto;
}
.gh-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--church-gold, #daa520);
    margin-bottom: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.gh-loading-placeholder {
    font-size: 0.8rem;
    color: var(--text-secondary, #888);
    font-style: italic;
    padding: 1rem 0;
}

.gh-commit-item {
    display: flex;
    gap: 0.6rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    align-items: flex-start;
}
.gh-commit-item:last-child { border-bottom: none; }
.gh-commit-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--border, #1e2040);
}
.gh-commit-info { flex: 1; min-width: 0; }
.gh-commit-msg {
    font-size: 0.78rem;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gh-commit-msg a { color: #e2e8f0; text-decoration: none; }
.gh-commit-msg a:hover { color: #38bdf8; }
.gh-commit-meta {
    font-size: 0.68rem;
    color: var(--text-secondary, #888);
    margin-top: 0.15rem;
}
.gh-commit-sha {
    font-family: 'Fira Mono', monospace;
    color: #38bdf8;
    font-size: 0.68rem;
}

.gh-contributors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.gh-contributor {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border, #1e2040);
    border-radius: 20px;
    padding: 0.3rem 0.7rem 0.3rem 0.3rem;
    transition: border-color 0.2s;
    text-decoration: none;
}
.gh-contributor:hover { border-color: #38bdf8; }
.gh-contributor-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--border, #1e2040);
}
.gh-contributor-name {
    font-size: 0.72rem;
    color: #e2e8f0;
    font-weight: 500;
}
.gh-contributor-count {
    font-size: 0.65rem;
    color: var(--text-secondary, #888);
}

.gh-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.gh-quick-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    color: #38bdf8;
    text-decoration: none;
    background: rgba(56,189,248,0.06);
    border: 1px solid rgba(56,189,248,0.15);
    border-radius: 6px;
    padding: 0.35rem 0.7rem;
    transition: all 0.2s;
}
.gh-quick-link:hover {
    background: rgba(56,189,248,0.12);
    border-color: #38bdf8;
}

.gh-actions-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}
.gh-full-card {
    background: var(--panel-bg, #10101e);
    border: 1px solid var(--border, #1e2040);
    border-radius: 10px;
    padding: 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: border-color 0.2s;
}
.gh-full-card:hover { border-color: #38bdf8; }
.gh-full-icon {
    font-size: 1.6rem;
    color: #38bdf8;
    line-height: 1;
}
.gh-full-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #e2e8f0;
}
.gh-full-desc {
    font-size: 0.78rem;
    color: var(--text-secondary, #888);
    line-height: 1.5;
    flex: 1;
}
.gh-full-btn {
    align-self: flex-start;
    margin-top: 0.3rem;
}
.gh-footer-message {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary, #888);
    line-height: 1.7;
    padding: 1rem 2rem 0.5rem;
    font-style: italic;
}
.gh-get-started-link {
    color: var(--church-gold, #daa520);
    font-weight: 700;
    font-style: normal;
    text-decoration: none;
    font-size: 0.95rem;
}
.gh-get-started-link:hover { text-decoration: underline; }
.editor-patch-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    background: rgba(200,155,60,0.1);
    border: 1px solid rgba(200,155,60,0.3);
    border-radius: 6px;
    margin-bottom: 0.3rem;
}
.editor-patch-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--church-gold, #daa520);
    margin-right: 0.3rem;
    white-space: nowrap;
}
.editor-patch-btn {
    font-size: 0.72rem !important;
    padding: 0.2rem 0.6rem !important;
    border: 1px solid var(--border, #1e2040) !important;
    background: var(--panel-bg, #10101e) !important;
    color: #e2e8f0 !important;
    border-radius: 4px !important;
    cursor: pointer;
    white-space: nowrap;
}
.editor-patch-btn:hover { border-color: var(--church-gold, #daa520) !important; color: var(--church-gold, #daa520) !important; }
.editor-patch-btn-fpga { color: #4ade80 !important; }
.editor-patch-btn-fpga:hover { color: #22c55e !important; border-color: #22c55e !important; }
.editor-patch-btn-close {
    font-size: 0.72rem !important;
    padding: 0.15rem 0.45rem !important;
    background: transparent !important;
    border: 1px solid var(--border, #1e2040) !important;
    color: var(--text-secondary, #888) !important;
    border-radius: 4px !important;
    cursor: pointer;
}
.editor-patch-btn-close:hover { border-color: #e74c3c !important; color: #e74c3c !important; }
.mtbf-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.03em;
    white-space: nowrap;
    font-family: 'JetBrains Mono', monospace;
}
.mtbf-red     { background: #3a1111; color: #f87171; border: 1px solid #7f1d1d; }
.mtbf-amber   { background: #3a2a0a; color: #fbbf24; border: 1px solid #78350f; }
.mtbf-green   { background: #0a3a1a; color: #4ade80; border: 1px solid #14532d; }
.mtbf-unknown { background: #1c1c2a; color: #9ca3af; border: 1px solid #374151; }
@media (max-width: 768px) {
    .gh-repos-row, .gh-section-grid, .gh-actions-row { grid-template-columns: 1fr; }
}

#trace.view.active {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}
.trace-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.75rem;
    background: var(--bg-secondary, #1a1a2e);
    border-bottom: 1px solid var(--border, #333);
    flex-shrink: 0;
}
.trace-title {
    font-weight: bold;
    font-size: 0.95rem;
    color: var(--text-primary, #e0e0e0);
}
.trace-row-count {
    font-size: 0.82rem;
    color: var(--text-secondary, #888);
}
.trace-clear-btn {
    margin-left: auto;
    background: #c0392b;
    color: #fff;
    border: none;
    font-size: 0.78rem;
    padding: 0.2rem 0.7rem;
    border-radius: 3px;
    cursor: pointer;
}
.trace-clear-btn:hover { background: #e74c3c; }
.trace-table-wrap {
    flex: 1;
    overflow: auto;
    position: relative;
}
.trace-table {
    border-collapse: collapse;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.72rem;
    width: max-content;
    min-width: 100%;
}
.trace-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}
.trace-table th {
    background: var(--bg-secondary, #1a1a2e);
    color: var(--text-secondary, #aaa);
    padding: 0.25rem 0.4rem;
    text-align: left;
    white-space: nowrap;
    border-bottom: 2px solid var(--border, #444);
    font-weight: 600;
    font-size: 0.7rem;
}
.trace-table td {
    padding: 0.2rem 0.4rem;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-primary, #d0d0d0);
}
.trace-table tbody tr:hover {
    background: rgba(255,255,255,0.04);
}
.trace-row-skipped td {
    opacity: 0.35;
}
.trace-row-highlighted {
    background: rgba(232, 160, 80, 0.15) !important;
    outline: 1px solid rgba(232, 160, 80, 0.5);
    animation: trace-highlight-fade 2s ease-out forwards;
}
@keyframes trace-highlight-fade {
    0%   { background: rgba(232, 160, 80, 0.35); outline-color: rgba(232, 160, 80, 0.9); }
    100% { background: rgba(232, 160, 80, 0.08); outline-color: rgba(232, 160, 80, 0.25); }
}
.trace-gatelog-back {
    display: inline-block;
    margin-right: 0.45em;
    padding: 1px 6px;
    font-size: 0.7rem;
    font-family: inherit;
    line-height: 1.4;
    color: rgba(232, 160, 80, 0.95);
    background: rgba(232, 160, 80, 0.12);
    border: 1px solid rgba(232, 160, 80, 0.4);
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    vertical-align: middle;
    transition: background 0.15s, border-color 0.15s;
}
.trace-gatelog-back:hover {
    background: rgba(232, 160, 80, 0.25);
    border-color: rgba(232, 160, 80, 0.7);
}
.trace-fault-label {
    display: inline-block;
    margin-right: 0.45em;
    padding: 1px 6px;
    font-size: 0.7rem;
    font-family: inherit;
    line-height: 1.4;
    color: rgba(220, 80, 80, 0.95);
    background: rgba(220, 80, 80, 0.12);
    border: 1px solid rgba(220, 80, 80, 0.4);
    border-radius: 3px;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    animation: trace-fault-label-fade 5s ease-out forwards;
}
.trace-fault-label:hover {
    background: rgba(220, 80, 80, 0.22);
    border-color: rgba(220, 80, 80, 0.7);
    animation: none;
    opacity: 1;
}
.trace-fault-label:hover::after {
    content: ' \00d7';
    font-weight: bold;
}
@keyframes trace-fault-label-fade {
    0%   { opacity: 1; }
    60%  { opacity: 1; }
    100% { opacity: 0.25; }
}
.trace-td-changed {
    color: #f1c40f !important;
    font-weight: bold;
}
.trace-th-desc { min-width: 180px; }
.trace-th-step { min-width: 36px; }
.trace-th-pc { min-width: 40px; }
.trace-th-op { min-width: 50px; }
.trace-th-cond { min-width: 30px; }
.trace-th-dst { min-width: 30px; }
.trace-th-src { min-width: 30px; }

#version-tag {
    position: fixed;
    bottom: 4px;
    right: 8px;
    font-size: 10px;
    color: #555;
    font-family: 'Courier New', monospace;
    pointer-events: none;
    z-index: 1;
}

.gh-sync-status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.9rem;
    background: #0d0d12;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    font-size: 0.82rem;
    flex-wrap: wrap;
}
.gh-sync-label {
    color: var(--text-secondary, #888);
    white-space: nowrap;
}
.gh-sync-badge {
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    white-space: nowrap;
}
.gh-sync-badge.ok     { background: #1a3a1a; color: #4caf50; border: 1px solid #2d5a2d; }
.gh-sync-badge.fail   { background: #3a1a1a; color: #ef5350; border: 1px solid #5a2d2d; }
.gh-sync-badge.unknown{ background: #2a2a1a; color: #aaa;    border: 1px solid #3a3a2a; }
.gh-sync-meta {
    color: var(--text-secondary, #888);
    font-family: monospace;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gh-sync-refresh-btn {
    margin-left: auto;
    flex-shrink: 0;
}

.devices-layout {
    padding: 1.2rem;
    max-width: 900px;
    margin: 0 auto;
}
.dev-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.2rem;
    flex-wrap: nowrap;
}
.dev-header-left { flex: 1; min-width: 0; }
#devTabActionsDevices,
#devTabActionsLaunch {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    white-space: nowrap;
}
/* ── Device live-notification toasts ──────────────────────────────────────── */
.device-toast-container {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.6rem;
    z-index: 10000;
    pointer-events: none;
}

.device-toast {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: #1a1a2e;
    border: 1px solid #3a3a5a;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    min-width: 260px;
    max-width: 340px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.5);
    pointer-events: all;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s, transform 0.3s;
}
.device-toast.device-toast-visible {
    opacity: 1;
    transform: translateY(0);
}
.device-toast.device-toast-new {
    border-color: rgba(218,165,32,0.45);
    background: linear-gradient(135deg, #1a1400, #1a1a2e 60%);
}
.device-toast-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}
.device-toast-body {
    flex: 1;
    min-width: 0;
}
.device-toast-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #d0d0e8;
    margin-bottom: 0.15rem;
}
.device-toast-name {
    font-size: 0.78rem;
    color: var(--church-gold, #daa520);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.device-toast-sub {
    font-size: 0.72rem;
    color: #5de28a;
    margin-top: 0.1rem;
}
.device-toast-go {
    background: var(--church-gold, #daa520);
    color: #0a0a1a;
    border: none;
    border-radius: 5px;
    padding: 0.3rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    white-space: nowrap;
    transition: background 0.15s;
}
.device-toast-go:hover { background: #f0c030; }
.device-toast-close {
    background: transparent;
    border: none;
    color: #666;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0 0.2rem;
    flex-shrink: 0;
    line-height: 1;
}
.device-toast-close:hover { color: #aaa; }

/* ── Newcomer banner inside device card ──────────────────────────────────── */
.dev-newcomer-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.9rem;
    background: linear-gradient(90deg, rgba(218,165,32,0.10), rgba(218,165,32,0.04));
    border-bottom: 1px solid rgba(218,165,32,0.2);
    font-size: 0.82rem;
    color: #b0b0c8;
}
.dev-newcomer-icon { font-size: 1.1rem; flex-shrink: 0; }
.dev-newcomer-text strong { color: var(--church-gold, #daa520); }
.dev-newcomer-abstr {
    color: #5de28a;
    font-weight: 600;
    margin-left: 0.25rem;
}
.dev-newcomer-btn {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.78rem;
    color: var(--church-gold, #daa520);
    text-decoration: none;
    border: 1px solid rgba(218,165,32,0.35);
    border-radius: 14px;
    padding: 0.2rem 0.65rem;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.dev-newcomer-btn:hover {
    background: rgba(218,165,32,0.12);
    border-color: rgba(218,165,32,0.6);
}

/* ─────────────────────────────────────────────────────────────────────────── */
.dev-grid {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.dev-empty {
    color: #888;
    font-style: italic;
    padding: 2rem 1rem;
    text-align: center;
}
.dev-entry {
    border: 1px solid #2e2e2e;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s;
}
.dev-entry:has(.dev-row-open) { border-color: var(--church-gold, #daa520); }
.dev-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    background: var(--panel-bg, #1a1a2a);
    user-select: none;
    transition: background 0.15s;
}
.dev-row:hover { background: #222238; }
.dev-row-open { background: #1e1e30; }
.dev-row-name {
    font-weight: 600;
    color: var(--church-gold, #daa520);
    font-size: 0.92rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dev-status-chip {
    font-size: 0.75rem;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 600;
    flex-shrink: 0;
}
.chip-online { background: #1a3a1a; color: #4caf50; }
.chip-offline { background: #2a2a2a; color: #888; }
.dev-chevron {
    font-size: 0.65rem;
    color: #666;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.dev-row-open .dev-chevron { transform: rotate(90deg); }
.dev-detail {
    display: none;
    padding: 0.7rem 1rem;
    background: #111120;
    border-top: 1px solid #2e2e2e;
}
.dev-detail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem 1.5rem;
    margin-bottom: 0.65rem;
}
.dev-detail-item {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: 0.8rem;
}
.dev-detail-label {
    color: #666;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.dev-detail-val {
    color: #ccc;
    font-family: monospace;
    font-size: 0.82rem;
}
.dev-detail-footer {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}
.dev-detail-label-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: default;
}
.dev-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.dev-status-dot.online { background: #4caf50; box-shadow: 0 0 5px #4caf5080; }
.dev-status-dot.offline { background: #555; }
.dev-badge {
    display: inline-block;
    font-size: 0.68rem;
    padding: 1px 7px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    flex-shrink: 0;
}
.dev-badge-full { background: #2d4a22; color: #8bc34a; }
.dev-badge-iot { background: #1a3a4a; color: #4fc3f7; }
.dev-badge-official { background: #2e4a1e; color: #66bb6a; border: 1px solid #4a7a2e; }
.dev-badge-custom { background: #4a3a1a; color: #ffb74d; border: 1px solid #7a5a2e; }
.dev-fault-badge { background: #5a1a1a; color: #ef5350; border: 1px solid #8a2222; border-radius: 4px; padding: 0 0.3rem; font-size: 0.7rem; font-weight: 600; margin-left: 0.3rem; }
.dev-fw-badge {
    display: inline-block;
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 9px;
    font-weight: 700;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    margin-left: 0.3rem;
    font-family: monospace;
}
.dev-fw-badge-v1 { background: #242424; color: #777; border: 1px solid #3a3a3a; }
.dev-fw-badge-v2 { background: #3a2e00; color: #daa520; border: 1px solid #7a6500; }
.dev-fault-count-link {
    background: none;
    border: 1px solid #8a2222;
    border-radius: 4px;
    color: #ef5350;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 1px 7px;
    text-decoration: none;
    transition: background 0.15s;
}
.dev-fault-count-link:hover { background: #5a1a1a; color: #ff7043; }
.dev-fault-count-none { color: #555; font-size: 0.8rem; }
.dev-tunnel-badge { background: #1a3a2a; color: #4caf50; border: 1px solid #2e7a4e; border-radius: 4px; padding: 0 0.35rem; font-size: 0.7rem; font-weight: 600; margin-left: 0.35rem; letter-spacing: 0.02em; transition: background 0.4s, color 0.4s, border-color 0.4s; }
.dev-tunnel-badge-offline { background: #2a1a1a; color: #9e9e9e; border: 1px solid #4a3a3a; border-radius: 4px; padding: 0 0.35rem; font-size: 0.7rem; font-weight: 600; margin-left: 0.35rem; letter-spacing: 0.02em; transition: background 0.4s, color 0.4s, border-color 0.4s; }
.dev-tunnel-badge-pending { background: #2a2a1a; color: #bdbdbd; border: 1px solid #4a4a2e; border-radius: 4px; padding: 0 0.35rem; font-size: 0.7rem; font-weight: 600; margin-left: 0.35rem; letter-spacing: 0.02em; transition: background 0.4s, color 0.4s, border-color 0.4s; }
.dev-label-input {
    background: transparent;
    border: 1px solid #444;
    border-radius: 4px;
    color: #ccc;
    padding: 2px 6px;
    font-size: 0.82rem;
    width: 150px;
}
.dev-label-input:focus { border-color: var(--church-gold, #daa520); outline: none; }
.dev-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}
.dev-action-btn {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #ccc;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.dev-action-btn:hover { background: #333; border-color: var(--church-gold, #daa520); color: #fff; }
.dev-action-btn.dev-action-disabled { opacity: 0.4; cursor: not-allowed; }
.dev-deploy-all-btn {
    background: #2d4a22;
    border: 1px solid #4caf50;
    color: #8bc34a;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.dev-deploy-all-btn:hover { background: #3a5a2e; color: #fff; }
.dev-deploy-status {
    font-size: 0.78rem;
    margin-top: 4px;
    font-weight: 600;
}
.dev-deploy-deploying { color: #ffb74d; }
.dev-deploy-success { color: #4caf50; }
.dev-deploy-failed { color: #ef5350; }
.deploy-program-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #ccc;
    transition: background 0.15s;
}
.deploy-program-option:hover { background: #2a2a2a; }
.deploy-program-option input[type="radio"] { accent-color: var(--church-gold, #daa520); }
.deploy-program-list { border: 1px solid #333; border-radius: 4px; padding: 0.3rem; }
.dev-fault-log-btn {
    background: #3a1a1a;
    border: 1px solid #8a2222;
    color: #ef5350;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.dev-fault-log-btn:hover { background: #4a2222; color: #fff; }
.fault-log-container { font-size: 0.85rem; max-height: 60vh; overflow-y: auto; }
.fault-log-title { font-weight: 700; color: var(--church-gold, #daa520); margin-bottom: 0.5rem; font-size: 0.9rem; }
.fault-log-empty { color: #888; font-style: italic; padding: 0.5rem 0; }
.fault-mtbf-table, .fault-events-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.fault-mtbf-table th, .fault-events-table th {
    text-align: left;
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid #444;
    color: #aaa;
    font-weight: 600;
}
.fault-mtbf-table td, .fault-events-table td {
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid #2a2a2a;
}
.fault-addr { font-family: monospace; color: #7dd3fc; }
.fault-loc { font-family: monospace; color: #e8b84a; }
.fault-count { text-align: center; }
.fault-mtbf { font-weight: 600; }
.fault-ts { color: #888; font-size: 0.78rem; }
.fault-dev { color: #aaa; }
.mtbf-cell-green { color: #4ade80; }
.mtbf-cell-amber { color: #fbbf24; }
.mtbf-cell-red { color: #ef5350; }

/* ── Reliability dashboard panel ────────────────────────────── */
.rel-panel {
    padding: 0.5rem 0.75rem;
}
.rel-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.rel-sort-label {
    color: #888;
    font-size: 0.8rem;
    font-weight: 600;
}
.rel-sort-btn {
    background: none;
    border: 1px solid #444;
    border-radius: 4px;
    color: #888;
    font-size: 0.78rem;
    padding: 3px 10px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.rel-sort-btn:hover { background: #1e1e30; color: #ccc; border-color: #666; }
.rel-sort-btn.active {
    background: #1e1e30;
    color: var(--church-gold, #daa520);
    border-color: var(--church-gold, #daa520);
}
.rel-board-filter {
    background: #141420;
    border: 1px solid #444;
    border-radius: 4px;
    color: #ccc;
    font-size: 0.8rem;
    padding: 3px 8px;
    cursor: pointer;
}
.rel-table-wrap {
    overflow-x: auto;
}
.rel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}
.rel-table th {
    text-align: left;
    padding: 0.35rem 0.6rem;
    border-bottom: 1px solid #444;
    color: #aaa;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.rel-table th:hover { color: #ddd; }
.rel-table th .rel-th-sort { color: var(--church-gold, #daa520); margin-left: 3px; font-size: 0.7rem; }
.rel-table td {
    padding: 0.28rem 0.6rem;
    border-bottom: 1px solid #1e1e2a;
    vertical-align: middle;
}
.rel-table tr:hover td { background: #131320; }
.rel-td-abstr { color: #e8b84a; font-weight: 600; }
.rel-td-board { color: #888; font-size: 0.78rem; }
.rel-td-mnemonic { font-family: monospace; color: #7dd3fc; }
.rel-td-slot { color: #666; font-size: 0.78rem; text-align: center; }
.rel-td-faults { text-align: center; color: #ccc; }
.rel-td-mtbf { font-weight: 700; text-align: right; }
.rel-td-mtbf.mtbf-green { color: #4ade80; }
.rel-td-mtbf.mtbf-amber { color: #fbbf24; }
.rel-td-mtbf.mtbf-red   { color: #ef5350; }
.rel-td-mtbf.mtbf-none  { color: #555; font-style: italic; font-weight: normal; }
.rel-empty {
    color: #888;
    font-style: italic;
    padding: 1.5rem 0.5rem;
    text-align: center;
}
.rel-legend {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    font-size: 0.78rem;
    color: #777;
    flex-wrap: wrap;
}
.rel-legend-item { display: flex; align-items: center; gap: 0.3rem; }
.rel-legend-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.rel-legend-dot.green { background: #4ade80; }
.rel-legend-dot.amber { background: #fbbf24; }
.rel-legend-dot.red   { background: #ef5350; }

/* ── Devices view tab strip ─────────────────────────────────── */
.dev-view-tabs {
    display: flex;
    gap: 2px;
    margin-top: 6px;
}
.dev-view-tab {
    background: none;
    border: 1px solid #333;
    border-radius: 4px 4px 0 0;
    color: #888;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 14px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.dev-view-tab:hover { background: #1e1e30; color: #ccc; border-color: #555; }
.dev-view-tab.active {
    background: #1e1e30;
    color: var(--church-gold, #daa520);
    border-color: var(--church-gold, #daa520);
    border-bottom-color: #1e1e30;
}

/* ── Launch Readiness checklist ─────────────────────────────── */
.launch-test-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
}
.launch-progress-bar-wrap {
    padding: 0.6rem 0.8rem 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.launch-progress-track {
    flex: 1;
    height: 6px;
    background: #222;
    border-radius: 3px;
    overflow: hidden;
}
.launch-progress-fill {
    height: 100%;
    background: #4caf50;
    border-radius: 3px;
    transition: width 0.4s;
}
.launch-progress-label {
    font-size: 0.78rem;
    color: #aaa;
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}
.launch-test-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.55rem 0.8rem;
    border-bottom: 1px solid #1e1e1e;
    transition: background 0.12s;
}
.launch-test-row:last-child { border-bottom: none; }
.launch-test-row:hover { background: #131320; }
.launch-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}
.launch-dot-notrun { background: #444; }
.launch-dot-passing { background: #4caf50; box-shadow: 0 0 4px #4caf5080; }
.launch-dot-failing { background: #ef5350; box-shadow: 0 0 4px #ef535080; }
.launch-test-body { flex: 1; min-width: 0; }
.launch-test-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.launch-test-id {
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    color: #888;
    flex-shrink: 0;
}
.launch-test-name {
    font-weight: 700;
    font-size: 0.88rem;
    color: #e0e0e0;
}
.launch-badge-auto {
    font-size: 0.65rem;
    font-weight: 700;
    background: #1a3a4a;
    color: #4fc3f7;
    border: 1px solid #2a5a6a;
    border-radius: 3px;
    padding: 0 5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.launch-test-desc {
    font-size: 0.77rem;
    color: #777;
    margin-top: 2px;
    line-height: 1.4;
}
.launch-test-notes {
    font-size: 0.72rem;
    color: #5a8a5a;
    margin-top: 3px;
    font-style: italic;
}
.launch-test-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    align-items: flex-end;
}
.launch-status-chip {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    white-space: nowrap;
}
.launch-chip-notrun { background: #252525; color: #888; border: 1px solid #333; }
.launch-chip-passing { background: #1a3a1a; color: #8bc34a; border: 1px solid #3a6a1a; }
.launch-chip-failing { background: #3a1a1a; color: #ef5350; border: 1px solid #6a1a1a; }
.launch-set-btn {
    font-size: 0.68rem;
    padding: 2px 7px;
    border-radius: 3px;
    border: 1px solid #333;
    background: #1a1a2a;
    color: #aaa;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    white-space: nowrap;
}
.launch-set-btn:hover { background: #252535; border-color: #555; color: #ddd; }
.dev-launch-reset-btn {
    background: #3a1a1a;
    border: 1px solid #6a2222;
    color: #ef9a9a;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.dev-launch-reset-btn:hover { background: #4a2222; color: #fff; }

/* ── GT View ────────────────────────────────────────────────────────────── */
.gtv-panel {
    padding: 1.25rem 1.5rem;
    max-width: 860px;
    margin: 0 auto;
}
.gtv-panel-title {
    color: var(--church-gold);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0.2rem;
}
.gtv-panel-sub {
    color: var(--text-secondary);
    font-size: 0.78rem;
    margin-bottom: 1rem;
}
.gtv-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
}
.gtv-summary {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 1.1rem;
    padding: 0.4rem 0.7rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    border-left: 3px solid var(--church-gold);
}
.gtv-empty { color: var(--text-secondary); font-style: italic; padding: 1rem 0; }
.gtv-section {
    margin-bottom: 1.2rem;
}
.gtv-section-hdr {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
    flex-wrap: wrap;
}
.gtv-type-pill {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    white-space: nowrap;
    font-family: monospace;
}
.gtv-count {
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    min-width: 1.5rem;
    text-align: center;
}
.gtv-desc {
    font-size: 0.75rem;
    color: #6b7280;
    font-style: italic;
}
.gtv-none {
    color: #4b5563;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    font-style: italic;
}
.gtv-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.gtv-item {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 5px;
    overflow: hidden;
}
.gtv-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.7rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.12s;
    flex-wrap: wrap;
}
.gtv-row:hover { background: var(--bg-secondary); }
.gtv-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    min-width: 8rem;
}
.gtv-perms {
    font-family: monospace;
    font-size: 0.8rem;
    min-width: 4rem;
}
.gtv-hex {
    font-family: monospace;
    font-size: 0.78rem;
    color: rgba(206, 145, 120, 0.85);
}
.gtv-chevron {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}
.gtv-popdown {
    display: none;
    border-top: 1px solid var(--border);
    padding: 0.5rem 0.85rem;
    background: #0f1929;
}
.gtv-popdown.gtv-open { display: block; }
.gtv-src {
    font-size: 0.8rem;
    color: #93c5fd;
    padding: 0.18rem 0;
    font-family: monospace;
}
.gtv-src-none {
    color: #4b5563;
    font-style: italic;
    font-family: sans-serif;
}

/* ── Live Call-Home Log panel ───────────────────────────────────────────── */
.callhome-log-panel {
    margin: 0 0 1.2rem;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    background: #0d0d12;
    overflow: hidden;
}
.callhome-log-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.8rem;
    background: #161622;
    border-bottom: 1px solid #2a2a3a;
}
.callhome-log-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #c8a84b;
    letter-spacing: 0.03em;
    flex: 0 0 auto;
}
.callhome-machine-select {
    background: #0d0d12;
    border: 1px solid #374151;
    border-radius: 4px;
    color: #c8a84b;
    font-size: 0.75rem;
    font-family: 'Courier New', Courier, monospace;
    padding: 0.1rem 0.4rem;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 26ch;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}
.callhome-machine-select:hover { border-color: #c8a84b55; }
.callhome-machine-select:focus { border-color: #c8a84b; }
.callhome-machine-select option { background: #111118; color: #d1d5db; }
.callhome-log-subtitle {
    font-size: 0.7rem;
    color: #eceef3;
    flex: 1;
}
.callhome-log-clear-btn {
    background: none;
    border: 1px solid #374151;
    border-radius: 4px;
    color: #eceef3;
    font-size: 0.68rem;
    padding: 0.1rem 0.5rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.callhome-log-clear-btn:hover { color: #d1d5db; border-color: #6b7280; }

/* Column header row */
.callhome-log-col-heads {
    display: grid;
    grid-template-columns: 6ch 1.2ch 14ch 12ch 4ch 6ch 13ch 9ch;
    gap: 0.6rem;
    padding: 0.25rem 0.8rem;
    background: #111118;
    border-bottom: 1px solid #2a2a3a;
    font-size: 0.72rem;
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #eceef3;
    position: sticky;
    top: 0;
    z-index: 1;
}

.callhome-log-entries {
    max-height: 220px;
    overflow-y: auto;
    padding: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.72rem;
    border-top: 2px solid #c8a84b33;
    box-shadow: inset 0 2px 8px #00000055;
}
.callhome-log-entries::-webkit-scrollbar { width: 8px; }
.callhome-log-entries::-webkit-scrollbar-track { background: transparent; }
.callhome-log-entries::-webkit-scrollbar-thumb { background: #2a2a3a; border-radius: 3px; }
.callhome-log-empty {
    padding: 0.6rem 0.8rem;
    color: #4b5563;
    font-style: italic;
    font-family: sans-serif;
    font-size: 0.75rem;
}
.callhome-log-row {
    display: grid;
    grid-template-columns: 6ch 1.2ch 14ch 12ch 4ch 6ch 13ch 9ch;
    gap: 0.6rem;
    align-items: center;
    padding: 0.2rem 0.8rem;
    border-bottom: 1px solid #111118;
    transition: background 0.1s;
}
.callhome-log-row:hover { background: #161622; }

.chlog-time      { color: #eceef3; }
.chlog-time-fault { color: #ef4444; }
.chlog-dot-ok    { color: #22c55e; }
.chlog-dot-fault { color: #ef4444; }
.chlog-board     { color: #c8a84b; font-weight: 600; }
.chlog-ctx       { color: #eceef3; font-size: 0.68rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chlog-uid       { color: #818cf8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chlog-nia       { color: #eceef3; }
.chlog-fw        { color: #eceef3; }
.chlog-boot      { color: #eceef3; text-align: right; }
.chlog-fault     { white-space: nowrap; overflow: hidden; }
.chlog-fault-val    { color: #ef4444; }
.chlog-ok-dash      { color: #6b7280; }
.chlog-recovery-tag {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #f59e0b;
    border: 1px solid #f59e0b88;
    border-radius: 3px;
    padding: 0 3px;
    vertical-align: middle;
    margin-left: 3px;
    line-height: 1.4;
}
.chlog-type      { }
.chlog-type-ch   { color: #9ca3af; font-size: 0.65rem; }
.chlog-type-reg  { color: #22c55e; font-size: 0.65rem; }
.callhome-log-row.nia-row-active { background: #1a1a28; border-left: 2px solid #c8a84b55; }

/* Plain UART text lines interleaved in the callhome log — same grid as callhome rows */
.callhome-uart-row {
    display: grid;
    grid-template-columns: 6ch 1.2ch 14ch 12ch 4ch 6ch 13ch 9ch;
    gap: 0.6rem;
    align-items: center;
    padding: 0.2rem 0.8rem;
    border-bottom: 1px solid #0d0d12;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.72rem;
    background: #080810;
}
.callhome-uart-row:hover { background: #0f0f1a; }
.callhome-uart-row .uart-ts   { color: #eceef3; }
.callhome-uart-row .uart-text {
    grid-column: 2 / -1;
    color: #eceef3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── UART Console (standalone panel — kept for future use) ───────────────── */
.uart-log-panel {
    margin: 0 0 1.2rem;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    background: #0d0d12;
    overflow: hidden;
}
.uart-log-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.8rem;
    background: #161622;
    border-bottom: 1px solid #2a2a3a;
}
.uart-log-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #818cf8;
    letter-spacing: 0.03em;
    flex: 0 0 auto;
}
.uart-log-subtitle {
    font-size: 0.7rem;
    color: #4b5563;
    flex: 1;
}
.uart-log-clear-btn {
    background: none;
    border: 1px solid #374151;
    border-radius: 4px;
    color: #6b7280;
    font-size: 0.68rem;
    padding: 0.1rem 0.5rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.uart-log-clear-btn:hover { color: #d1d5db; border-color: #6b7280; }
.uart-log-entries {
    max-height: 200px;
    overflow-y: auto;
    padding: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.72rem;
    border-top: 2px solid #818cf833;
    box-shadow: inset 0 2px 8px #00000055;
}
.uart-log-entries::-webkit-scrollbar { width: 8px; }
.uart-log-entries::-webkit-scrollbar-track { background: transparent; }
.uart-log-entries::-webkit-scrollbar-thumb { background: #2a2a3a; border-radius: 3px; }
.uart-log-empty {
    padding: 0.6rem 0.8rem;
    color: #4b5563;
    font-style: italic;
    font-family: sans-serif;
    font-size: 0.75rem;
}
.uart-log-line {
    display: flex;
    gap: 1rem;
    padding: 0.18rem 0.8rem;
    border-bottom: 1px solid #111118;
    white-space: pre;
}
.uart-log-line:hover { background: #161622; }
.uart-ts        { color: #eceef3; flex: 0 0 auto; }
.uart-text      { color: #eceef3; flex: 1; overflow: hidden; text-overflow: ellipsis; }
.uart-text-boot { color: #ef4444; font-weight: 700; }
.uart-text-init { color: #f59e0b; }
.callhome-uart-row .uart-text-boot { color: #ef4444; font-weight: 700; }
.callhome-uart-row .uart-text-init { color: #f59e0b; }

/* ── NIA Disassembly Panel ───────────────────────────────────────────────── */
/* ── Callhome Row Detail Modals ────────────────────────────────────────── */
.chlog-modal {
    position: fixed;
    z-index: 9999;
    min-width: 520px;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: #0d1117;
    border: 1px solid #c8a84b55;
    border-radius: 7px;
    box-shadow: 0 10px 40px #00000099, 0 0 0 1px #c8a84b1a;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.71rem;
    overflow: hidden;
    animation: chlog-modal-in 0.14s ease;
}
.chlog-modal .nia-disasm-body {
    overflow-y: auto;
    flex: 1;
}
.callhome-filter-btn {
    background: none;
    border: 1px solid #374151;
    border-radius: 4px;
    color: #eceef3;
    font-size: 0.68rem;
    padding: 0.1rem 0.5rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    margin-left: 0.35rem;
}
.callhome-filter-btn:hover { color: #c8a84b; border-color: #c8a84b55; }
.callhome-filter-btn.active { color: #c8a84b; border-color: #c8a84b; font-weight: 700; }
@keyframes chlog-modal-in {
    from { opacity: 0; transform: scale(0.96) translateY(-6px); }
    to   { opacity: 1; transform: scale(1)    translateY(0);    }
}
.chlog-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.65rem 0.35rem 0.85rem;
    background: #161d2a;
    border-bottom: 1px solid #c8a84b44;
    cursor: grab;
    user-select: none;
}
.chlog-modal-header:active { cursor: grabbing; }
.chlog-modal-title {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.chlog-modal-machine {
    color: #c8a84b;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chlog-modal-ts {
    color: #eceef3;
    font-size: 0.65rem;
    flex-shrink: 0;
}
.chlog-modal-close {
    background: none;
    border: 1px solid #374151;
    border-radius: 3px;
    color: #eceef3;
    font-size: 0.65rem;
    padding: 0.05rem 0.35rem;
    cursor: pointer;
    margin-left: 0.55rem;
    flex-shrink: 0;
    transition: color 0.12s, border-color 0.12s;
}
.chlog-modal-close:hover { color: #fff; border-color: #c8a84b; }
.chlog-modal-body {
    padding: 0.55rem 0.85rem 0.45rem;
    border-bottom: 1px solid #1e2535;
}
.chlog-modal-petname {
    color: #eceef3;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin-bottom: 0.3rem;
}
.chlog-modal-ctx-card {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
}
.chlog-modal-ctx-cell {
    flex: 1;
    background: #111820;
    border: 1px solid #1e2535;
    border-radius: 5px;
    padding: 0.25rem 0.5rem;
    min-width: 0;
}
.chlog-modal-ctx-label {
    color: #b8bfcc;
    font-size: 0.59rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.12rem;
    white-space: nowrap;
}
.chlog-modal-ctx-val {
    color: #c8a84b;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chlog-modal-spotlight {
    background: #1a1200;
    border: 1px solid #c8a84b44;
    border-left: 3px solid #c8a84b;
    border-radius: 4px;
    padding: 0.35rem 0.6rem;
    margin-bottom: 0.45rem;
}
.chlog-modal-spotlight-mnemonic {
    color: #daa520;
    font-size: 0.73rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chlog-modal-spotlight-role {
    color: #8a6e1a;
    font-size: 0.67rem;
    font-weight: 400;
}
.chlog-modal-spotlight-english {
    color: #d4d8e2;
    font-size: 0.67rem;
    margin-top: 0.18rem;
    line-height: 1.45;
    white-space: normal;
}
.chlog-modal-fw {
    color: #b8bfcc;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.64rem;
}
.chlog-modal-fault {
    margin-top: 0.3rem;
}

.nia-disasm-panel {
    background: #111820;
    border-left: 3px solid #c8a84b44;
    border-bottom: 1px solid #2a2a3a;
    margin: 0;
    padding: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.71rem;
    animation: nia-panel-in 0.12s ease;
}
@keyframes nia-panel-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.nia-disasm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.8rem;
    background: #161d2a;
    border-bottom: 1px solid #2a2a3a;
    color: #94a3b8;
    font-size: 0.69rem;
    letter-spacing: 0.02em;
}
.nia-disasm-triple { flex: 1; }
.nia-val { color: #c8a84b; font-weight: 600; }
.nia-disasm-close {
    background: none;
    border: 1px solid #374151;
    border-radius: 3px;
    color: #6b7280;
    font-size: 0.65rem;
    padding: 0.05rem 0.35rem;
    cursor: pointer;
    margin-left: 0.6rem;
    transition: color 0.12s, border-color 0.12s;
}
.nia-disasm-close:hover { color: #d1d5db; border-color: #6b7280; }
.nia-disasm-body { padding: 0.2rem 0; }
.nia-disasm-row {
    display: grid;
    grid-template-columns: 2.5ch 6ch 9ch 1fr auto;
    gap: 0.5rem;
    padding: 0.12rem 0.8rem;
    color: #b0b8c8;
    border-bottom: 1px solid #0d0d1200;
    line-height: 1.4;
}
.nia-disasm-row:hover { background: #151e2a; color: #6b7280; }
.nia-disasm-current {
    background: #2a1e00;
    border-left: 3px solid #daa520;
    padding-left: calc(0.8rem - 3px);
    color: #daa520;
    font-weight: 600;
}
.nia-disasm-current:hover { background: #2f2200; }
.nia-no-data { opacity: 0.38; }
.nia-nodata-sep {
    text-align: center;
    color: #374151;
    font-size: 0.63rem;
    padding: 0.18rem 0.8rem;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #1e2535;
    margin-bottom: 0.1rem;
}
.nia-col-rel   { color: inherit; text-align: right; }
.nia-col-addr  { color: #374151; }
.nia-disasm-current .nia-col-addr { color: #b8860b; }
.nia-col-hex   { color: #334155; letter-spacing: 0.04em; }
.nia-disasm-current .nia-col-hex  { color: #92681a; }
.nia-col-text  { color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nia-col-role  { color: #5a4a1a; font-size: 0.63rem; white-space: nowrap; align-self: center; }
.nia-disasm-current .nia-col-role { color: #8a6e1a; }
.nia-disasm-desc {
    padding: 0.18rem 0.8rem 0.22rem calc(0.8rem + 2.5ch + 0.5rem);
    background: #1e1500;
    color: #a07830;
    font-size: 0.67rem;
    font-family: system-ui, sans-serif;
    font-style: italic;
    border-left: 3px solid #daa52055;
    border-bottom: 1px solid #2a1e00;
    line-height: 1.45;
}
.nia-row-has-desc {
    cursor: pointer;
}
.nia-row-has-desc:hover {
    background: #1a1200;
}
.nia-row-expanded {
    background: #1e1500;
    border-left: 2px solid #c8a84b;
    box-shadow: inset 2px 0 6px #c8a84b18;
}
.nia-row-pinned {
    background: #1e1500;
    border-left: 3px solid #c8922a;
    box-shadow: inset 2px 0 8px rgba(200, 146, 42, 0.10);
}
.nia-row-has-desc::after {
    content: '\25b8';
    float: right;
    color: #5a4010;
    font-size: 0.6rem;
    margin-right: 0.3rem;
    align-self: center;
    line-height: 1;
}
.nia-row-expanded::after {
    content: '\25be';
    color: #a07830;
}

/* ── Callhome popup — narrow-screen (parent mode on phone) ──────────────── */
@media (max-width: 540px) {
    .chlog-modal {
        min-width: min(96vw, 520px);
        max-width: 96vw;
    }
    .chlog-modal-ctx-card {
        flex-direction: column;
    }
    .nia-disasm-row {
        grid-template-columns: 2.5ch 9ch 1fr auto;
    }
    .nia-col-hex { display: none; }
}

/* ── Download & Flash card (ti60ConnectPanel) ───────────────────────────── */
.ti60-dl-flash-card {
    background: #0b1320;
    border: 1px solid #1e3a5f;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: .82rem;
}
.ti60-dl-flash-loading {
    color: #64748b;
    font-size: .8rem;
}
.ti60-dl-flash-spinner {
    margin-right: 4px;
}
.ti60-dl-flash-present,
.ti60-dl-flash-absent {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.ti60-dl-flash-badge {
    font-size: 1.4rem;
    flex-shrink: 0;
}
.ti60-dl-flash-badge-grey {
    filter: grayscale(1) opacity(.6);
}
.ti60-dl-flash-info {
    flex: 1;
    min-width: 0;
}
.ti60-dl-flash-title {
    color: #4ade80;
    font-weight: 700;
    font-size: .85rem;
    line-height: 1.3;
}
.ti60-dl-flash-meta {
    color: #64748b;
    font-size: .74rem;
    margin-top: 2px;
}
.ti60-dl-flash-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.ti60-dl-flash-btn {
    padding: .35rem .85rem;
    border-radius: 5px;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
    color: #c4b5fd;
    background: #1e1a40;
    transition: background .15s;
}
.ti60-dl-flash-btn:hover:not([disabled]) {
    background: #2d2760;
}
.ti60-dl-flash-btn-dl {
    background: #166534;
    color: #4ade80;
}
.ti60-dl-flash-btn-dl:hover {
    background: #1a7a3e;
}
.ti60-dl-flash-btn-flash {
    background: #1a2a50;
    color: #93c5fd;
}
.ti60-dl-flash-btn-flash:hover {
    background: #243566;
}
@media (max-width: 540px) {
    .ti60-dl-flash-present,
    .ti60-dl-flash-absent {
        flex-direction: column;
        align-items: flex-start;
    }
}
