/* ============================================================
   ltc-lab.css — LTC Modelling Lab dashboard revamp
   Scope: body.ltc-revamp
   v2026-07-22-ltc
   ============================================================ */

/* ── Light theme tokens ───────────────────────────────────── */
:root:not([data-theme="dark"]) body.ltc-revamp {
    --ltc-page-bg:      #f6f8fc;
    --ltc-card-bg:      #ffffff;
    --ltc-tile-bg:      #f0f4fa;
    --ltc-topbar-bg:    #ffffff;
    --ltc-hairline:     #e6ebf2;
    --ltc-text:         #0f1b2d;
    --ltc-muted:        #64748b;
    --ltc-accent:       #0b5fea;
    --ltc-link:         #006cef;
    --ltc-green:        #12a150;
    --ltc-pipe-supply:  #337eea;
    --ltc-pipe-return:  #e5484d;
    --ltc-radial-track: #eef2f7;
    --ltc-shadow:       0 1px 4px rgba(11,95,234,.08), 0 4px 16px rgba(15,27,45,.07);
    --ltc-shadow-sm:    0 1px 3px rgba(15,27,45,.06);
    --ltc-badge-bg:     rgba(11,95,234,.08);
    --ltc-badge-text:   #0b5fea;
    --ltc-sens-bar-bg:  #e6ebf2;
    --ltc-kpi-good-bg:  rgba(18,161,80,.07);
}

/* ── Dark theme tokens ────────────────────────────────────── */
[data-theme="dark"] body.ltc-revamp {
    --ltc-page-bg:      #0d1720;
    --ltc-card-bg:      #0c141d;
    --ltc-tile-bg:      #111a25;
    --ltc-topbar-bg:    #060e18;
    --ltc-hairline:     rgba(255,255,255,.08);
    --ltc-text:         #e6eef8;
    --ltc-muted:        #7f92a8;
    --ltc-accent:       #036cf2;
    --ltc-link:         #4c8dff;
    --ltc-green:        #34d399;
    --ltc-pipe-supply:  #4c8dff;
    --ltc-pipe-return:  #f26d72;
    --ltc-radial-track: rgba(255,255,255,.08);
    --ltc-shadow:       0 1px 4px rgba(0,0,0,.3), 0 4px 20px rgba(0,0,0,.4);
    --ltc-shadow-sm:    0 1px 3px rgba(0,0,0,.25);
    --ltc-badge-bg:     rgba(3,108,242,.18);
    --ltc-badge-text:   #4c8dff;
    --ltc-sens-bar-bg:  rgba(255,255,255,.10);
    --ltc-kpi-good-bg:  rgba(52,211,153,.08);
}

/* ── Reset page bg ────────────────────────────────────────── */
body.ltc-revamp {
    background: var(--ltc-page-bg);
    color: var(--ltc-text);
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Dashboard 3-column grid ──────────────────────────────── */
body.ltc-revamp .ltc-dashboard {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    grid-template-rows: auto;
    gap: 12px;
    padding: 12px 14px 24px;
    align-items: start;
    min-height: calc(100vh - 60px);
}

/* ── Rail shared ──────────────────────────────────────────── */
body.ltc-revamp .ltc-left-rail,
body.ltc-revamp .ltc-right-rail {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

/* ── Rail card ────────────────────────────────────────────── */
body.ltc-revamp .ltc-rail-card {
    background: var(--ltc-card-bg);
    border: 1px solid var(--ltc-hairline);
    border-radius: 10px;
    padding: 14px 14px 16px;
    box-shadow: var(--ltc-shadow-sm);
}

/* ── Rail header ──────────────────────────────────────────── */
body.ltc-revamp .ltc-rail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

body.ltc-revamp .ltc-rail-title {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: var(--ltc-muted);
}

/* ── Reset button ─────────────────────────────────────────── */
body.ltc-revamp .ltc-reset-btn {
    background: none;
    border: 1px solid var(--ltc-hairline);
    border-radius: 6px;
    padding: 3px 9px;
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.62rem;
    color: var(--ltc-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
body.ltc-revamp .ltc-reset-btn:hover {
    border-color: var(--ltc-accent);
    color: var(--ltc-accent);
}

/* ── Section label ────────────────────────────────────────── */
body.ltc-revamp .ltc-section-label {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.60rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ltc-muted);
    margin-bottom: 10px;
}
body.ltc-revamp .ltc-muted {
    opacity: 0.72;
}

/* ════════════════════════════════════════════════════════════
   SLIDER ROWS
   ════════════════════════════════════════════════════════════ */
body.ltc-revamp .ltc-primary-sliders {
    margin-bottom: 16px;
}

body.ltc-revamp .ltc-slider-row {
    margin-bottom: 12px;
}

body.ltc-revamp .ltc-slider-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

body.ltc-revamp .ltc-slider-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--ltc-text);
}

body.ltc-revamp .ltc-slider-value-box {
    display: flex;
    align-items: center;
    gap: 3px;
}

body.ltc-revamp .ltc-slider-numbox {
    width: 54px;
    padding: 2px 5px;
    background: var(--ltc-tile-bg);
    border: 1px solid var(--ltc-hairline);
    border-radius: 5px;
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.72rem;
    color: var(--ltc-text);
    text-align: right;
    outline: none;
    transition: border-color 0.15s;
}
body.ltc-revamp .ltc-slider-numbox:focus {
    border-color: var(--ltc-accent);
}

body.ltc-revamp .ltc-slider-unit {
    font-size: 0.62rem;
    color: var(--ltc-muted);
    white-space: nowrap;
}

/* range track + thumb */
body.ltc-revamp .ltc-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: linear-gradient(
        to right,
        var(--ltc-accent) 0%,
        var(--ltc-accent) var(--range-pct, 50%),
        var(--ltc-radial-track) var(--range-pct, 50%),
        var(--ltc-radial-track) 100%
    );
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
body.ltc-revamp .ltc-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ltc-accent);
    border: 2px solid var(--ltc-card-bg);
    box-shadow: 0 0 0 1px var(--ltc-accent);
    cursor: pointer;
    transition: transform 0.12s;
}
body.ltc-revamp .ltc-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
body.ltc-revamp .ltc-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--ltc-accent);
    border: 2px solid var(--ltc-card-bg);
    box-shadow: 0 0 0 1px var(--ltc-accent);
    cursor: pointer;
}

/* ════════════════════════════════════════════════════════════
   ARCHITECTURE PRESET CARDS
   ════════════════════════════════════════════════════════════ */
body.ltc-revamp .ltc-arch-preset-section {
    margin-bottom: 14px;
}

body.ltc-revamp .ltc-arch-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

body.ltc-revamp .ltc-arch-card {
    background: var(--ltc-tile-bg);
    border: 1px solid var(--ltc-hairline);
    border-radius: 8px;
    padding: 8px 5px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
body.ltc-revamp .ltc-arch-card:hover {
    border-color: var(--ltc-accent);
}
body.ltc-revamp .ltc-arch-card.ltc-arch-active {
    background: var(--ltc-badge-bg);
    border-color: var(--ltc-accent);
    box-shadow: 0 0 0 1px var(--ltc-accent);
}

body.ltc-revamp .ltc-arch-icon {
    font-size: 1.1rem;
    margin-bottom: 3px;
    line-height: 1;
}

body.ltc-revamp .ltc-arch-name {
    font-size: 0.61rem;
    font-weight: 600;
    color: var(--ltc-text);
    line-height: 1.2;
}

body.ltc-revamp .ltc-arch-sub {
    font-size: 0.56rem;
    color: var(--ltc-muted);
    margin-top: 1px;
}

/* ── Other params collapse ────────────────────────────────── */
body.ltc-revamp .ltc-other-params {
    margin-bottom: 14px;
}

body.ltc-revamp .ltc-collapse-btn {
    background: none;
    border: 1px solid var(--ltc-hairline);
    border-radius: 6px;
    padding: 6px 10px;
    width: 100%;
    text-align: left;
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.05em;
    color: var(--ltc-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: border-color 0.15s, color 0.15s;
}
body.ltc-revamp .ltc-collapse-btn:hover {
    border-color: var(--ltc-accent);
    color: var(--ltc-text);
}

body.ltc-revamp .ltc-chevron {
    margin-left: auto;
    transition: transform 0.2s;
}
body.ltc-revamp .ltc-collapse-btn.open .ltc-chevron {
    transform: rotate(180deg);
}

body.ltc-revamp .ltc-other-params-body {
    padding-top: 10px;
    font-size: 0.71rem;
    color: var(--ltc-muted);
}

/* ── Run section ──────────────────────────────────────────── */
body.ltc-revamp .ltc-run-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

body.ltc-revamp .ltc-run-btn {
    background: var(--ltc-accent);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 10px 0;
    width: 100%;
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}
body.ltc-revamp .ltc-run-btn:hover {
    opacity: 0.88;
}
body.ltc-revamp .ltc-run-btn:active {
    transform: scale(0.98);
}

body.ltc-revamp .ltc-last-run {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.60rem;
    color: var(--ltc-muted);
    text-align: center;
}

/* ════════════════════════════════════════════════════════════
   CENTER COLUMN
   ════════════════════════════════════════════════════════════ */
body.ltc-revamp .ltc-center-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* breadcrumb */
body.ltc-revamp .ltc-breadcrumb {
    font-size: 0.68rem;
    color: var(--ltc-muted);
    margin-bottom: 2px;
}

/* title row */
body.ltc-revamp .ltc-title-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

body.ltc-revamp .ltc-page-title {
    font-size: 1.22rem;
    font-weight: 700;
    color: var(--ltc-text);
    line-height: 1.2;
    flex: 1 1 auto;
    margin: 0;
}

body.ltc-revamp .ltc-edu-badge {
    flex-shrink: 0;
    background: var(--ltc-badge-bg);
    color: var(--ltc-badge-text);
    border: 1px solid currentColor;
    border-radius: 5px;
    padding: 3px 8px;
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.60rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    white-space: nowrap;
    margin-top: 4px;
    opacity: 0.9;
}

body.ltc-revamp .ltc-subtitle {
    font-size: 0.80rem;
    color: var(--ltc-muted);
    line-height: 1.45;
    margin-top: -4px;
}

/* ── System Overview card ─────────────────────────────────── */
body.ltc-revamp .ltc-overview-card {
    background: var(--ltc-card-bg);
    border: 1px solid var(--ltc-hairline);
    border-radius: 10px;
    padding: 12px 14px 14px;
    box-shadow: var(--ltc-shadow-sm);
}

body.ltc-revamp .ltc-overview-label {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    color: var(--ltc-green);
    font-weight: 600;
    margin-bottom: 10px;
}

/* ── Schematic SVG wrapper ────────────────────────────────── */
body.ltc-revamp .ltc-schematic {
    width: 100%;
    overflow-x: auto;
}
body.ltc-revamp .ltc-schematic svg {
    width: 100%;
    min-width: 480px;
    height: auto;
    display: block;
}

/* SVG flow animation */
@keyframes ltc-flow-dash {
    to { stroke-dashoffset: -26; }
}
@media (prefers-reduced-motion: no-preference) {
    body.ltc-revamp .ltc-flow-supply {
        stroke-dasharray: 8 5;
        animation: ltc-flow-dash 1.2s linear infinite;
    }
    body.ltc-revamp .ltc-flow-return {
        stroke-dasharray: 8 5;
        animation: ltc-flow-dash 1.5s linear infinite reverse;
    }
}

/* ── KPI strip ────────────────────────────────────────────── */
body.ltc-revamp .ltc-kpi-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

body.ltc-revamp .ltc-kpi-card {
    background: var(--ltc-card-bg);
    border: 1px solid var(--ltc-hairline);
    border-radius: 8px;
    padding: 10px 10px 8px;
    text-align: center;
    box-shadow: var(--ltc-shadow-sm);
}
body.ltc-revamp .ltc-kpi-card.ltc-kpi-good {
    background: var(--ltc-kpi-good-bg);
    border-color: rgba(18,161,80,.22);
}
[data-theme="dark"] body.ltc-revamp .ltc-kpi-card.ltc-kpi-good {
    border-color: rgba(52,211,153,.2);
}

body.ltc-revamp .ltc-kpi-label {
    font-size: 0.60rem;
    color: var(--ltc-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

body.ltc-revamp .ltc-kpi-value {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ltc-text);
    line-height: 1;
    word-break: break-all;
}
body.ltc-revamp .ltc-kpi-value.ltc-kpi-green {
    color: var(--ltc-green);
}

body.ltc-revamp .ltc-kpi-unit {
    font-size: 0.58rem;
    color: var(--ltc-muted);
    margin-top: 2px;
}

/* ════════════════════════════════════════════════════════════
   TABS
   ════════════════════════════════════════════════════════════ */
body.ltc-revamp .ltc-tabs-bar {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--ltc-hairline);
    padding-bottom: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
body.ltc-revamp .ltc-tabs-bar::-webkit-scrollbar { display: none; }

body.ltc-revamp .ltc-tab-btn {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 8px 14px 7px;
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ltc-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
    position: relative;
    top: 1px;
}
body.ltc-revamp .ltc-tab-btn:hover {
    color: var(--ltc-text);
}
body.ltc-revamp .ltc-tab-btn.ltc-tab-active {
    color: var(--ltc-accent);
    border-bottom-color: var(--ltc-accent);
}

/* tab panels */
body.ltc-revamp .ltc-tab-panel {
    padding-top: 14px;
}

/* ════════════════════════════════════════════════════════════
   RESULTS TAB
   ════════════════════════════════════════════════════════════ */
body.ltc-revamp .ltc-results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 200px;
    gap: 10px;
    margin-bottom: 14px;
}

body.ltc-revamp .ltc-res-card {
    background: var(--ltc-card-bg);
    border: 1px solid var(--ltc-hairline);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: var(--ltc-shadow-sm);
}

body.ltc-revamp .ltc-res-card-title {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.60rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ltc-muted);
    margin-bottom: 10px;
    font-weight: 600;
}

body.ltc-revamp .ltc-res-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 4px 0;
    border-bottom: 1px solid var(--ltc-hairline);
    gap: 8px;
}
body.ltc-revamp .ltc-res-row:last-child {
    border-bottom: none;
}

body.ltc-revamp .ltc-res-lbl {
    font-size: 0.68rem;
    color: var(--ltc-muted);
    flex-shrink: 0;
}

body.ltc-revamp .ltc-res-val {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ltc-text);
    text-align: right;
}

/* Power donut card */
body.ltc-revamp .ltc-donut-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
body.ltc-revamp .ltc-donut-svg {
    width: 120px;
    height: 120px;
}
body.ltc-revamp .ltc-donut-legend {
    width: 100%;
}
body.ltc-revamp .ltc-donut-legend-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
}
body.ltc-revamp .ltc-donut-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}
body.ltc-revamp .ltc-donut-lbl {
    font-size: 0.58rem;
    color: var(--ltc-muted);
    flex: 1;
}
body.ltc-revamp .ltc-donut-val {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.60rem;
    color: var(--ltc-text);
}

/* Temperature profile */
body.ltc-revamp .ltc-results-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

body.ltc-revamp .ltc-temp-profile-card {
    background: var(--ltc-card-bg);
    border: 1px solid var(--ltc-hairline);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: var(--ltc-shadow-sm);
}

body.ltc-revamp .ltc-temp-profile-svg {
    width: 100%;
    height: 120px;
    display: block;
}

/* Energy balance table */
body.ltc-revamp .ltc-energy-table {
    background: var(--ltc-card-bg);
    border: 1px solid var(--ltc-hairline);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: var(--ltc-shadow-sm);
}

body.ltc-revamp .ltc-etable {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.72rem;
}
body.ltc-revamp .ltc-etable thead th {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.60rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ltc-muted);
    text-align: left;
    padding: 4px 8px 6px;
    border-bottom: 1px solid var(--ltc-hairline);
}
body.ltc-revamp .ltc-etable tbody td {
    padding: 5px 8px;
    border-bottom: 1px solid var(--ltc-hairline);
    color: var(--ltc-text);
}
body.ltc-revamp .ltc-etable tbody tr:last-child td {
    border-bottom: none;
}
body.ltc-revamp .ltc-etable .ltc-mono {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.72rem;
}
body.ltc-revamp .ltc-etable .ltc-etotal {
    font-weight: 700;
    color: var(--ltc-accent);
}

/* ════════════════════════════════════════════════════════════
   RIGHT RAIL — COMPLIANCE
   ════════════════════════════════════════════════════════════ */
body.ltc-revamp .ltc-pass-pill {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.60rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--ltc-green);
    border: 1px solid var(--ltc-green);
    border-radius: 4px;
    padding: 2px 7px;
}
body.ltc-revamp .ltc-pass-pill.ltc-fail {
    color: var(--ltc-pipe-return);
    border-color: var(--ltc-pipe-return);
}

body.ltc-revamp .ltc-compliance-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.ltc-revamp .ltc-comp-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

body.ltc-revamp .ltc-comp-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.ltc-revamp .ltc-comp-name {
    font-size: 0.68rem;
    color: var(--ltc-text);
}

body.ltc-revamp .ltc-comp-score {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ltc-accent);
}

body.ltc-revamp .ltc-comp-bar-track {
    width: 100%;
    height: 3px;
    background: var(--ltc-sens-bar-bg);
    border-radius: 2px;
    overflow: hidden;
}

body.ltc-revamp .ltc-comp-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--ltc-accent);
    transition: width 0.4s ease;
}
body.ltc-revamp .ltc-comp-bar-fill.ltc-bar-good {
    background: var(--ltc-green);
}
body.ltc-revamp .ltc-comp-bar-fill.ltc-bar-warn {
    background: #f59e0b;
}
body.ltc-revamp .ltc-comp-bar-fill.ltc-bar-bad {
    background: var(--ltc-pipe-return);
}

/* ════════════════════════════════════════════════════════════
   RIGHT RAIL — DESIGN STATUS RADIAL
   ════════════════════════════════════════════════════════════ */
body.ltc-revamp .ltc-design-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

body.ltc-revamp .ltc-radial-wrap {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

body.ltc-revamp .ltc-radial-svg {
    width: 120px;
    height: 120px;
}

body.ltc-revamp .ltc-radial-track {
    stroke: var(--ltc-radial-track);
}

body.ltc-revamp .ltc-radial-bar {
    stroke: var(--ltc-accent);
    stroke-dasharray: 0 301.6;
    transition: stroke-dasharray 0.6s ease;
}

body.ltc-revamp .ltc-radial-pct {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    font-weight: 700;
    fill: var(--ltc-text);
    dominant-baseline: central;
}

body.ltc-revamp .ltc-radial-label {
    font-size: 7px;
    fill: var(--ltc-muted);
    dominant-baseline: central;
}

body.ltc-revamp .ltc-design-grade {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--ltc-accent);
    margin-top: -4px;
}

body.ltc-revamp .ltc-sub-bars {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.ltc-revamp .ltc-sub-bar-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

body.ltc-revamp .ltc-sub-bar-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

body.ltc-revamp .ltc-sub-bar-lbl {
    font-size: 0.66rem;
    color: var(--ltc-muted);
}

body.ltc-revamp .ltc-sub-bar-val {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.66rem;
    color: var(--ltc-text);
}

body.ltc-revamp .ltc-sub-bar-track {
    width: 100%;
    height: 3px;
    background: var(--ltc-sens-bar-bg);
    border-radius: 2px;
    overflow: hidden;
}

body.ltc-revamp .ltc-sub-bar-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--ltc-accent);
    transition: width 0.4s ease;
}

/* ════════════════════════════════════════════════════════════
   RIGHT RAIL — SENSITIVITY
   ════════════════════════════════════════════════════════════ */
body.ltc-revamp .ltc-sens-label {
    font-size: 0.65rem;
    color: var(--ltc-muted);
    margin-bottom: 10px;
}

body.ltc-revamp .ltc-sens-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.ltc-revamp .ltc-sens-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

body.ltc-revamp .ltc-sens-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

body.ltc-revamp .ltc-sens-name {
    font-size: 0.66rem;
    color: var(--ltc-text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body.ltc-revamp .ltc-sens-delta {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.64rem;
    color: var(--ltc-pipe-return);
    flex-shrink: 0;
}
body.ltc-revamp .ltc-sens-delta.ltc-pos {
    color: var(--ltc-green);
}

body.ltc-revamp .ltc-sens-track {
    width: 100%;
    height: 4px;
    background: var(--ltc-sens-bar-bg);
    border-radius: 2px;
    overflow: hidden;
}

body.ltc-revamp .ltc-sens-fill {
    height: 100%;
    border-radius: 2px;
    background: var(--ltc-pipe-return);
    transition: width 0.4s ease;
}
body.ltc-revamp .ltc-sens-fill.ltc-pos {
    background: var(--ltc-green);
}

/* ════════════════════════════════════════════════════════════
   RIGHT RAIL — SCENARIO INFO
   ════════════════════════════════════════════════════════════ */
body.ltc-revamp .ltc-scenario-card {
    border-top: 3px solid var(--ltc-accent);
}

body.ltc-revamp .ltc-scenario-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

body.ltc-revamp .ltc-scenario-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid var(--ltc-hairline);
}
body.ltc-revamp .ltc-scenario-item:last-child {
    border-bottom: none;
}

body.ltc-revamp .ltc-scenario-key {
    font-size: 0.67rem;
    color: var(--ltc-muted);
}

body.ltc-revamp .ltc-scenario-val {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.68rem;
    color: var(--ltc-text);
    font-weight: 600;
    text-align: right;
}

body.ltc-revamp .ltc-scenario-note {
    font-size: 0.63rem;
    color: var(--ltc-muted);
    line-height: 1.4;
    font-style: italic;
}

/* ════════════════════════════════════════════════════════════
   DETAILED HOST (existing engine output moved here)
   ════════════════════════════════════════════════════════════ */
body.ltc-revamp #ltcDetailedHost {
    /* engine output unstyled, just contained */
    min-height: 200px;
}

/* ════════════════════════════════════════════════════════════
   RESPONSIVE: collapse below 1024px
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1280px) {
    body.ltc-revamp .ltc-dashboard {
        grid-template-columns: 260px 1fr 260px;
    }
    body.ltc-revamp .ltc-kpi-strip {
        grid-template-columns: repeat(3, 1fr);
    }
    body.ltc-revamp .ltc-results-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1024px) {
    body.ltc-revamp .ltc-dashboard {
        grid-template-columns: 240px 1fr;
        grid-template-areas:
            "left center"
            "right right";
    }
    body.ltc-revamp .ltc-left-rail  { grid-area: left; }
    body.ltc-revamp .ltc-center-col { grid-area: center; }
    body.ltc-revamp .ltc-right-rail {
        grid-area: right;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    body.ltc-revamp .ltc-kpi-strip {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    body.ltc-revamp .ltc-dashboard {
        grid-template-columns: 1fr;
        grid-template-areas:
            "center"
            "left"
            "right";
        padding: 8px 10px 20px;
    }
    body.ltc-revamp .ltc-right-rail {
        grid-template-columns: 1fr;
    }
    body.ltc-revamp .ltc-kpi-strip {
        grid-template-columns: repeat(2, 1fr);
    }
    body.ltc-revamp .ltc-results-grid {
        grid-template-columns: 1fr;
    }
    body.ltc-revamp .ltc-results-bottom {
        grid-template-columns: 1fr;
    }
    body.ltc-revamp .ltc-arch-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    body.ltc-revamp .ltc-page-title {
        font-size: 1.0rem;
    }
    body.ltc-revamp .ltc-tab-btn {
        font-size: 0.56rem;
        padding: 7px 9px 6px;
    }
}

/* ── Topbar (mockup match): center nav + right action cluster ───────────── */
body.ltc-revamp .navbar {
    background: var(--ltc-topbar-bg);
    border-bottom: 1px solid var(--ltc-hairline);
}
body.ltc-revamp .navbar .nav-container {
    display: flex;
    align-items: center;
    gap: 18px;
}
body.ltc-revamp .navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}
/* Center nav */
body.ltc-revamp .ltc-nav-center {
    display: flex;
    align-items: center;
    gap: 26px;
    margin: 0 auto;
}
body.ltc-revamp .ltc-nav-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--ltc-muted);
    text-decoration: none;
    padding: 6px 2px;
    position: relative;
    transition: color .15s;
    white-space: nowrap;
}
body.ltc-revamp .ltc-nav-link:hover { color: var(--ltc-text); }
body.ltc-revamp .ltc-nav-link-active { color: var(--ltc-text); }
body.ltc-revamp .ltc-nav-link-active::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -14px;
    height: 2px;
    background: var(--ltc-accent);
    border-radius: 2px;
}
/* Right action cluster */
body.ltc-revamp .ltc-nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
body.ltc-revamp .ltc-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border: 1px solid var(--ltc-hairline);
    border-radius: 9px;
    background: var(--ltc-card-bg);
    color: var(--ltc-muted);
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, color .15s, border-color .15s;
}
body.ltc-revamp .ltc-nav-icon:hover { color: var(--ltc-text); border-color: var(--ltc-accent); }
body.ltc-revamp .ltc-nav-btn {
    font-size: 13px;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 9px;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid var(--ltc-hairline);
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
body.ltc-revamp .ltc-nav-btn-outline {
    background: var(--ltc-card-bg);
    color: var(--ltc-text);
}
body.ltc-revamp .ltc-nav-btn-outline:hover { border-color: var(--ltc-accent); color: var(--ltc-accent); }
body.ltc-revamp .ltc-nav-btn-primary {
    background: var(--ltc-accent);
    color: #fff;
    border-color: var(--ltc-accent);
    box-shadow: 0 1px 3px rgba(11,95,234,.28);
}
body.ltc-revamp .ltc-nav-btn-primary:hover { filter: brightness(1.06); }
/* Desktop replaces the legacy back-links with the center nav */
@media (min-width: 981px) {
    body.ltc-revamp .navbar .nav-links .nav-back { display: none !important; }
}
/* Mobile: hide the injected desktop nav/actions; keep brand + hamburger + theme + auth */
@media (max-width: 980px) {
    body.ltc-revamp .ltc-nav-center,
    body.ltc-revamp .ltc-nav-actions { display: none !important; }
}

/* ── SYSTEM OVERVIEW: reference P&ID render + live-wired temp chips ──────── */
body.ltc-revamp .ltc-pid { position: relative; width: 100%; line-height: 0; }
body.ltc-revamp .ltc-pid-img { width: 100%; height: auto; display: block; border-radius: 8px; }
body.ltc-revamp .ltc-pid-chip {
    position: absolute;
    font-size: clamp(9px, 1.05vw, 13px);
    font-weight: 700;
    letter-spacing: .01em;
    padding: 1px 7px;
    border-radius: 5px;
    white-space: nowrap;
    line-height: 1.5;
    background: var(--ltc-card-bg);
}
body.ltc-revamp .ltc-pid-supply { color: var(--ltc-pipe-supply); left: 30.5%; top: 3%; }
body.ltc-revamp .ltc-pid-return { color: var(--ltc-pipe-return); left: 42.5%; top: 27%; }

/* ── Compliance rows: green-check + status (reference match) ─────────────── */
body.ltc-revamp .ltc-comp-row {
    display: flex; flex-direction: row; align-items: center; gap: 9px;
    padding: 7px 0; border-bottom: 1px solid var(--ltc-hairline);
}
body.ltc-revamp .ltc-comp-row:last-child { border-bottom: none; }
body.ltc-revamp .ltc-comp-check {
    width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--ltc-green); color: #fff; font-size: 9px;
}
body.ltc-revamp .ltc-comp-check-fail { background: #f59e0b; }
body.ltc-revamp .ltc-comp-name { font-size: 13px; color: var(--ltc-text); flex: 1; }
body.ltc-revamp .ltc-comp-status { font-size: 12px; color: var(--ltc-muted); font-weight: 500; }
body.ltc-revamp .ltc-comp-status-fail { color: #f59e0b; }
body.ltc-revamp #ltcDesignGrade { color: var(--ltc-green); font-weight: 700; }

/* ── Brand: light hex mark (reference) ─────────────────────────────────── */
body.ltc-revamp .nav-brand .brand-icon.ltc-brand-hex {
    background: var(--ltc-badge-bg) !important;
    color: var(--ltc-accent) !important;
    box-shadow: none !important;
}
/* ── DESIGN STATUS: ring-left + Design Score/grade right (reference) ─────── */
body.ltc-revamp .ltc-design-top {
    display: flex; align-items: center; gap: 16px; margin-bottom: 14px;
}
body.ltc-revamp .ltc-radial-wrap { width: 92px; height: 92px; flex-shrink: 0; margin: 0; }
body.ltc-revamp .ltc-radial-svg { width: 92px; height: 92px; display: block; }
body.ltc-revamp .ltc-radial-pct { font-size: 26px; font-weight: 700; fill: var(--ltc-text); }
body.ltc-revamp .ltc-design-scorelbl { font-size: 12px; color: var(--ltc-muted); margin-bottom: 3px; }
body.ltc-revamp .ltc-design-grade { font-size: 22px; font-weight: 700; color: var(--ltc-green); line-height: 1.05; }

/* ── TEMPERATURE PROFILE (reference: dot-marked lines + legend) ─────────── */
body.ltc-revamp .ltc-tp-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px; flex-wrap: wrap; gap: 6px;
}
body.ltc-revamp .ltc-tp-legend { display: flex; gap: 16px; }
body.ltc-revamp .ltc-tp-leg {
    font-size: 11px; color: var(--ltc-muted);
    display: inline-flex; align-items: center; gap: 6px;
}
body.ltc-revamp .ltc-tp-leg::before {
    content: ""; width: 16px; height: 3px; border-radius: 2px; display: inline-block;
}
body.ltc-revamp .ltc-tp-sup::before { background: var(--ltc-pipe-supply); }
body.ltc-revamp .ltc-tp-ret::before { background: var(--ltc-pipe-return); }
body.ltc-revamp .ltc-temp-profile-svg { width: 100%; height: auto; display: block; }

/* ── Micro-interactions: tab entrance, boot stagger, focus-visible ──────── */
@keyframes ltc-tab-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
body.ltc-revamp .ltc-tab-anim { animation: ltc-tab-in .28s ease both; }

@keyframes ltc-card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
body.ltc-revamp.ltc-booting .ltc-kpi-card,
body.ltc-revamp.ltc-booting .ltc-overview-card,
body.ltc-revamp.ltc-booting .ltc-rail-card { animation: ltc-card-in .5s ease both; }
body.ltc-revamp.ltc-booting .ltc-overview-card { animation-delay: .03s; }
body.ltc-revamp.ltc-booting .ltc-kpi-card:nth-child(1) { animation-delay: .06s; }
body.ltc-revamp.ltc-booting .ltc-kpi-card:nth-child(2) { animation-delay: .10s; }
body.ltc-revamp.ltc-booting .ltc-kpi-card:nth-child(3) { animation-delay: .14s; }
body.ltc-revamp.ltc-booting .ltc-kpi-card:nth-child(4) { animation-delay: .18s; }
body.ltc-revamp.ltc-booting .ltc-kpi-card:nth-child(5) { animation-delay: .22s; }
body.ltc-revamp.ltc-booting .ltc-kpi-card:nth-child(6) { animation-delay: .26s; }
body.ltc-revamp.ltc-booting .ltc-right-rail .ltc-rail-card:nth-child(2) { animation-delay: .10s; }
body.ltc-revamp.ltc-booting .ltc-right-rail .ltc-rail-card:nth-child(3) { animation-delay: .16s; }
body.ltc-revamp.ltc-booting .ltc-right-rail .ltc-rail-card:nth-child(4) { animation-delay: .22s; }

/* KPI value tint pulse on change */
body.ltc-revamp .ltc-kpi-value { transition: color .2s ease; }

/* Focus-visible (WCAG 2.4.7) */
body.ltc-revamp .ltc-tab-btn:focus-visible,
body.ltc-revamp .ltc-run-btn:focus-visible,
body.ltc-revamp .ltc-reset-btn:focus-visible,
body.ltc-revamp .ltc-collapse-btn:focus-visible,
body.ltc-revamp .ltc-nav-btn:focus-visible,
body.ltc-revamp .ltc-nav-icon:focus-visible,
body.ltc-revamp .ltc-nav-link:focus-visible,
body.ltc-revamp .ltc-arch-card:focus-visible,
body.ltc-revamp .ltc-slider-numbox:focus-visible,
body.ltc-revamp .ltc-range:focus-visible {
    outline: 2px solid var(--ltc-accent);
    outline-offset: 2px;
    border-radius: 6px;
}
body.ltc-revamp .ltc-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(11,95,234,.30); }
body.ltc-revamp .ltc-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(11,95,234,.30); }

@media (prefers-reduced-motion: reduce) {
    body.ltc-revamp .ltc-tab-anim,
    body.ltc-revamp.ltc-booting .ltc-kpi-card,
    body.ltc-revamp.ltc-booting .ltc-overview-card,
    body.ltc-revamp.ltc-booting .ltc-rail-card { animation: none; }
}

/* ── Sensitivity tornado (two-directional, engine-computed) ─────────────── */
body.ltc-revamp .ltc-tornado { margin-top: 10px; display: flex; flex-direction: column; gap: 9px; }
body.ltc-revamp .ltc-tor-row { display: grid; grid-template-columns: 160px 1fr 128px; align-items: center; gap: 10px; }
body.ltc-revamp .ltc-tor-lbl { font-size: 12px; color: var(--ltc-text); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.ltc-revamp .ltc-tor-track { position: relative; height: 16px; background: var(--ltc-tile-bg); border-radius: 4px; }
body.ltc-revamp .ltc-tor-zero { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--ltc-muted); opacity: .5; }
body.ltc-revamp .ltc-tor-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 3px;
    background: linear-gradient(90deg, var(--ltc-pipe-supply), var(--ltc-pipe-return)); transition: left .3s ease, width .3s ease; }
body.ltc-revamp .ltc-tor-val { font-size: 11px; color: var(--ltc-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
body.ltc-revamp .ltc-tornado-card { margin-bottom: 12px; }
@media (max-width: 640px) { body.ltc-revamp .ltc-tor-row { grid-template-columns: 96px 1fr; } body.ltc-revamp .ltc-tor-val { display: none; } }

/* ── FLOW operating-scenario replay ─────────────────────────────────────── */
body.ltc-revamp .ltc-scenario-card { margin-bottom: 12px; }
body.ltc-revamp .ltc-scenario-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
body.ltc-revamp .ltc-scenario-btn {
    font-size: 12px; font-weight: 600; padding: 7px 13px; border-radius: 8px; cursor: pointer;
    background: var(--ltc-tile-bg); color: var(--ltc-text); border: 1px solid var(--ltc-hairline);
    transition: background .15s, border-color .15s, color .15s;
}
body.ltc-revamp .ltc-scenario-btn:hover { border-color: var(--ltc-accent); }
body.ltc-revamp .ltc-scenario-btn.active { background: var(--ltc-accent); color: #fff; border-color: var(--ltc-accent); }
body.ltc-revamp .ltc-scenario-readout { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
body.ltc-revamp .ltc-scenario-metric { background: var(--ltc-tile-bg); border: 1px solid var(--ltc-hairline); border-radius: 8px; padding: 9px 11px; display: flex; flex-direction: column; gap: 3px; }
body.ltc-revamp .ltc-scenario-metric span { font-size: 11px; color: var(--ltc-muted); }
body.ltc-revamp .ltc-scenario-metric b { font-size: 17px; color: var(--ltc-text); font-variant-numeric: tabular-nums; }
body.ltc-revamp .ltc-scenario-delta { font-size: 11px; font-weight: 700; }
body.ltc-revamp .ltc-scenario-delta.up { color: var(--ltc-pipe-return); }
body.ltc-revamp .ltc-scenario-delta.down { color: var(--ltc-green); }
@media (max-width: 640px) { body.ltc-revamp .ltc-scenario-readout { grid-template-columns: repeat(2, 1fr); } }

/* ── Power-breakdown donut: center total + per-slice % ──────────────────── */
body.ltc-revamp .ltc-donut-ring { position: relative; flex-shrink: 0; }
body.ltc-revamp .ltc-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
body.ltc-revamp .ltc-donut-center b { font-size: 15px; font-weight: 700; color: var(--ltc-text); line-height: 1; }
body.ltc-revamp .ltc-donut-center span { font-size: 9px; color: var(--ltc-muted); margin-top: 2px; }
body.ltc-revamp .ltc-donut-pct { color: var(--ltc-muted); font-weight: 500; margin-left: 2px; }

/* ── REPORT scenario compare (A/B) ──────────────────────────────────────── */
body.ltc-revamp .ltc-compare-card { margin-bottom: 12px; }
body.ltc-revamp .ltc-compare-actions { display: flex; gap: 8px; margin: 10px 0; }
body.ltc-revamp .ltc-compare-table { margin-top: 6px; }
body.ltc-revamp .ltc-cmp-row { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 8px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--ltc-hairline); font-size: 13px; font-variant-numeric: tabular-nums; }
body.ltc-revamp .ltc-cmp-row:last-child { border-bottom: none; }
body.ltc-revamp .ltc-cmp-row span:not(.ltc-cmp-lbl) { text-align: right; color: var(--ltc-text); }
body.ltc-revamp .ltc-cmp-lbl { color: var(--ltc-muted); }
body.ltc-revamp .ltc-cmp-head span { font-size: 11px; color: var(--ltc-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
body.ltc-revamp .ltc-cmp-d.up { color: var(--ltc-pipe-return); font-weight: 700; }
body.ltc-revamp .ltc-cmp-d.down { color: var(--ltc-green); font-weight: 700; }
@media (max-width: 640px) { body.ltc-revamp .ltc-cmp-row { grid-template-columns: 1.4fr 1fr 1fr; } body.ltc-revamp .ltc-cmp-row span:nth-child(2){display:none} body.ltc-revamp .ltc-cmp-head span:nth-child(2){display:none} }

/* ── ONE-APP consolidation: hide old page chrome ────────────────────────── */
body.ltc-revamp .hero,
body.ltc-revamp .legal-disclaimer-wrap,
body.ltc-revamp #architecture,
body.ltc-revamp #calculator > .section-header,
body.ltc-revamp #calculator > .workspace-toolbar { display: none !important; }
/* After relocation the old shells are empty — remove them from flow. */
body.ltc-consolidated #calculator { padding: 0 !important; margin: 0 !important; }
body.ltc-consolidated .calculator-layout { display: none !important; }
/* Relocated analytical blocks: fit the dashboard card language. */
body.ltc-revamp .ltc-tab-panel > div > .feature-block,
body.ltc-revamp .ltc-tab-panel > div > .model-block,
body.ltc-revamp .ltc-tab-panel > div > .control-block,
body.ltc-revamp .ltc-tab-panel > div > .logic-seq-block,
body.ltc-revamp .ltc-tab-panel > div > .pipeline-block,
body.ltc-revamp .ltc-tab-panel > div > .fullmap-block,
body.ltc-revamp .ltc-tab-panel > div > .flow-block,
body.ltc-revamp .ltc-tab-panel > div > .target-block,
body.ltc-revamp .ltc-tab-panel > div > .trace-block,
body.ltc-revamp .ltc-tab-panel > div > .sensitivity-block,
body.ltc-revamp .ltc-tab-panel > div > .method-block {
    background: var(--ltc-card-bg);
    border: 1px solid var(--ltc-hairline);
    border-radius: 10px;
    box-shadow: var(--ltc-shadow-sm);
    margin: 0 0 12px;
    padding: 14px 16px;
}
body.ltc-revamp .ltc-tab-panel .output-quickbar,
body.ltc-revamp .ltc-tab-panel .result-grid { margin-bottom: 12px; }
/* Old input panel inside OTHER PARAMETERS: neutralize its card chrome. */
body.ltc-revamp #ltcOtherParamsBody .calc-input-panel {
    background: none; border: none; box-shadow: none; padding: 0; max-height: none;
}

/* ── SVG P&ID (atlas symbols; theme-aware) ──────────────────────────────── */
body.ltc-revamp .ltc-pid-svg { width: 100%; height: auto; display: block; color: var(--ltc-text); }
body.ltc-revamp .ltc-pid-supply { fill: none; stroke: var(--ltc-pipe-supply); stroke-width: 3; }
body.ltc-revamp .ltc-pid-return { fill: none; stroke: var(--ltc-pipe-return); stroke-width: 3; }
body.ltc-revamp .ltc-pid-fill-supply { fill: var(--ltc-pipe-supply); }
body.ltc-revamp .ltc-pid-fill-return { fill: var(--ltc-pipe-return); }
body.ltc-revamp .ltc-pid-svg .ltc-flow-supply,
body.ltc-revamp .ltc-pid-svg .ltc-flow-return { stroke-dasharray: 9 6; }

/* ── Tab leads + accordion sections (intuitiveness pass) ────────────────── */
body.ltc-revamp .ltc-tab-lead {
    font-size: 13px; color: var(--ltc-muted); margin: 10px 2px 14px; line-height: 1.55;
}
body.ltc-revamp .ltc-tab-btn i { font-size: 11px; margin-right: 5px; opacity: .75; }
body.ltc-revamp .ltc-acc {
    background: var(--ltc-card-bg); border: 1px solid var(--ltc-hairline);
    border-radius: 10px; box-shadow: var(--ltc-shadow-sm); margin: 0 0 10px; overflow: hidden;
}
body.ltc-revamp .ltc-acc-head {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    background: none; border: none; cursor: pointer; padding: 13px 16px;
    font-size: 13px; font-weight: 600; color: var(--ltc-text); text-align: left;
    transition: background .15s;
}
body.ltc-revamp .ltc-acc-head:hover { background: var(--ltc-tile-bg); }
body.ltc-revamp .ltc-acc-head:focus-visible { outline: 2px solid var(--ltc-accent); outline-offset: -2px; }
body.ltc-revamp .ltc-acc-chev { color: var(--ltc-muted); transition: transform .2s; font-size: 12px; }
body.ltc-revamp .ltc-acc.open .ltc-acc-chev { transform: rotate(180deg); }
body.ltc-revamp .ltc-acc-body { padding: 0 16px 14px; }
/* Inside an accordion the legacy block loses its own card chrome (no double frame) */
body.ltc-revamp .ltc-acc-body > .feature-block,
body.ltc-revamp .ltc-acc-body > .model-block,
body.ltc-revamp .ltc-acc-body > .control-block,
body.ltc-revamp .ltc-acc-body > .logic-seq-block,
body.ltc-revamp .ltc-acc-body > .pipeline-block,
body.ltc-revamp .ltc-acc-body > .fullmap-block,
body.ltc-revamp .ltc-acc-body > .flow-block,
body.ltc-revamp .ltc-acc-body > .target-block,
body.ltc-revamp .ltc-acc-body > .trace-block,
body.ltc-revamp .ltc-acc-body > .sensitivity-block,
body.ltc-revamp .ltc-acc-body > .method-block,
body.ltc-revamp .ltc-acc-body > .explorer-block {
    background: none !important; border: none !important; box-shadow: none !important;
    margin: 0 !important; padding: 0 !important;
}

/* ── Input taxonomy: DESIGN / AUTO / TUNE ───────────────────────────────── */
body.ltc-revamp .ltc-flow-guide {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: 10.5px; color: var(--ltc-muted); margin: -4px 0 12px;
}
body.ltc-revamp .ltc-flow-guide b {
    display: inline-flex; width: 15px; height: 15px; border-radius: 50%;
    background: var(--ltc-badge-bg); color: var(--ltc-accent);
    align-items: center; justify-content: center; font-size: 9.5px; margin-right: 3px;
}
body.ltc-revamp .ltc-fg-sep { opacity: .5; }
body.ltc-revamp .ltc-tier-sec { margin: 14px 0 4px; }
body.ltc-revamp .ltc-tier-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
body.ltc-revamp .ltc-tier-num {
    width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: #fff; background: var(--ltc-accent);
}
body.ltc-revamp .ltc-tier-auto .ltc-tier-num { background: var(--ltc-green); }
body.ltc-revamp .ltc-tier-tune .ltc-tier-num { background: #f59e0b; }
body.ltc-revamp .ltc-tier-title { font-size: 12px; font-weight: 700; color: var(--ltc-text); text-transform: uppercase; letter-spacing: .05em; }
body.ltc-revamp .ltc-tier-desc { font-size: 11px; color: var(--ltc-muted); margin: 0 0 8px 26px; line-height: 1.45; }
body.ltc-revamp .ltc-tier-chip {
    display: inline-block; font-size: 8.5px; font-weight: 700; letter-spacing: .06em;
    padding: 1px 6px; border-radius: 4px; margin-left: 6px; vertical-align: 1px; white-space: nowrap;
}
body.ltc-revamp .ltc-chip-design { background: var(--ltc-badge-bg); color: var(--ltc-accent); }
body.ltc-revamp .ltc-chip-auto { background: var(--ltc-kpi-good-bg); color: var(--ltc-green); }
body.ltc-revamp .ltc-chip-tune { background: rgba(245,158,11,.14); color: #d97706; }
[data-theme="dark"] body.ltc-revamp .ltc-chip-tune { color: #fbbf24; }
body.ltc-revamp .ltc-tier-chip.ltc-chip-overridden { background: rgba(245,158,11,.18); color: #d97706; outline: 1px solid rgba(245,158,11,.5); }
[data-theme="dark"] body.ltc-revamp .ltc-tier-chip.ltc-chip-overridden { color: #fbbf24; }
body.ltc-revamp .ltc-auto-reset {
    background: none; border: 1px solid var(--ltc-hairline); border-radius: 4px;
    font-size: 10px; padding: 0 5px; margin-left: 5px; cursor: pointer; color: var(--ltc-muted);
}
body.ltc-revamp .ltc-auto-reset:hover { color: var(--ltc-accent); border-color: var(--ltc-accent); }
/* Firmness: numeric columns align */
body.ltc-revamp .result-card .value, body.ltc-revamp .diag-value,
body.ltc-revamp .quick-kpi .v { font-variant-numeric: tabular-nums; }

/* Tier grids inside the narrow left rail: single column, readable labels */
body.ltc-revamp #ltcOtherParamsBody .ltc-tier-grid { display: grid; grid-template-columns: 1fr !important; gap: 10px; }
body.ltc-revamp #ltcOtherParamsBody .input-group label {
    display: block; font-size: 11px; font-weight: 600; letter-spacing: .02em;
    line-height: 1.5; margin-bottom: 4px; color: var(--ltc-text);
}
body.ltc-revamp #ltcOtherParamsBody .input-group input,
body.ltc-revamp #ltcOtherParamsBody .input-group select { width: 100%; box-sizing: border-box; }
body.ltc-revamp #ltcOtherParamsBody .input-hint { font-size: 10.5px; line-height: 1.45; }

/* ── Polish round: run stamp, preset dots, KPI hover, slider feedback ───── */
body.ltc-revamp .ltc-run-ok { color: var(--ltc-green); font-weight: 700; }
body.ltc-revamp .ltc-preset-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--ltc-green); margin-left: 4px; vertical-align: 1px;
    box-shadow: 0 0 0 2px var(--ltc-kpi-good-bg); cursor: help;
}
body.ltc-revamp .ltc-kpi-card { transition: transform .16s ease, box-shadow .16s ease; }
body.ltc-revamp .ltc-kpi-card:hover { transform: translateY(-2px); box-shadow: var(--ltc-shadow); }
body.ltc-revamp .ltc-slider-numbox.ltc-just-edited { border-color: var(--ltc-accent); box-shadow: 0 0 0 3px rgba(11,95,234,.15); }
@media (prefers-reduced-motion: reduce) { body.ltc-revamp .ltc-kpi-card { transition: none; } }

/* ── MODEL VALIDATION card (band bars + value markers) ──────────────────── */
body.ltc-revamp .ltc-valid-list { display: flex; flex-direction: column; gap: 11px; }
body.ltc-revamp .ltc-valid-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
body.ltc-revamp .ltc-valid-lbl { font-size: 11.5px; color: var(--ltc-text); }
body.ltc-revamp .ltc-valid-val { font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
body.ltc-revamp .ltc-valid-val.ok { color: var(--ltc-green); }
body.ltc-revamp .ltc-valid-val.warn { color: #d97706; }
[data-theme="dark"] body.ltc-revamp .ltc-valid-val.warn { color: #fbbf24; }
body.ltc-revamp .ltc-valid-track { position: relative; height: 8px; background: var(--ltc-tile-bg); border-radius: 4px; }
body.ltc-revamp .ltc-valid-band { position: absolute; top: 0; bottom: 0; background: var(--ltc-kpi-good-bg); border: 1px solid var(--ltc-green); border-radius: 4px; opacity: .85; }
body.ltc-revamp .ltc-valid-marker { position: absolute; top: -3px; width: 3px; height: 14px; border-radius: 2px; transform: translateX(-50%); transition: left .3s ease; }
body.ltc-revamp .ltc-valid-marker.ok { background: var(--ltc-green); }
body.ltc-revamp .ltc-valid-marker.warn { background: #f59e0b; }
body.ltc-revamp .ltc-valid-range { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--ltc-muted); margin-top: 2px; }

/* ── Validation fix-suggestion chips ────────────────────────────────────── */
body.ltc-revamp .ltc-valid-fix { display: flex; gap: 6px; margin-top: 5px; flex-wrap: wrap; }
body.ltc-revamp .ltc-fix-chip {
    font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 6px; cursor: pointer;
    background: rgba(245,158,11,.10); color: #b45309; border: 1px solid rgba(245,158,11,.4);
    transition: background .15s, color .15s;
}
[data-theme="dark"] body.ltc-revamp .ltc-fix-chip { color: #fbbf24; }
body.ltc-revamp .ltc-fix-chip:hover { background: rgba(245,158,11,.2); }
body.ltc-revamp .ltc-fix-chip:focus-visible { outline: 2px solid var(--ltc-accent); outline-offset: 1px; }

/* ── RZ TRACE: indicator + popover (DCMOC pattern, LTC palette) ─────────── */
body.ltc-revamp .ltc-traceable { cursor: pointer; position: relative; }
body.ltc-revamp .ltc-traceable .ltc-kpi-value,
body.ltc-revamp .ltc-kpi-card.ltc-traceable .ltc-kpi-value {
    text-decoration: underline dotted rgba(245,158,11,.7) 1.5px; text-underline-offset: 3px;
}
body.ltc-revamp .ltc-kpi-card.ltc-traceable::after {
    content: "ƒx"; position: absolute; top: 6px; right: 8px;
    font-size: 8.5px; font-weight: 700; padding: 1px 4px; border-radius: 4px;
    background: rgba(245,158,11,.14); color: #b45309;
}
[data-theme="dark"] body.ltc-revamp .ltc-kpi-card.ltc-traceable::after { color: #fbbf24; }
body.ltc-revamp .ltc-pid-node { cursor: pointer; }
body.ltc-revamp .ltc-pid-node:hover rect[stroke] { stroke: var(--ltc-accent); stroke-width: 2.2; }
body.ltc-revamp .ltc-pid-chipval { fill: var(--ltc-accent); }
body.ltc-revamp .ltc-trace-pop {
    position: fixed; top: 84px; right: 24px; width: 380px; max-width: calc(100vw - 32px);
    max-height: 72vh; overflow: auto; z-index: 100050; display: none;
    background: var(--ltc-card-bg); border: 1px solid var(--ltc-hairline); border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.28); padding: 14px 16px;
}
body.ltc-revamp .ltc-trace-pop.open { display: block; animation: ltc-tab-in .18s ease; }
body.ltc-revamp .ltc-trace-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
body.ltc-revamp .ltc-trace-val { font-size: 22px; font-weight: 800; color: var(--ltc-text); line-height: 1.1; font-variant-numeric: tabular-nums; }
body.ltc-revamp .ltc-trace-lbl { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ltc-muted); margin-top: 2px; }
body.ltc-revamp .ltc-trace-prov { margin-left: auto; font-size: 8.5px; font-weight: 700; letter-spacing: .04em; padding: 3px 7px; border-radius: 5px; white-space: nowrap; }
body.ltc-revamp .ltc-trace-prov.engine { background: var(--ltc-kpi-good-bg); color: var(--ltc-green); }
body.ltc-revamp .ltc-trace-prov.input { background: var(--ltc-badge-bg); color: var(--ltc-accent); }
body.ltc-revamp .ltc-trace-prov.derived { background: var(--ltc-tile-bg); color: var(--ltc-muted); }
body.ltc-revamp .ltc-trace-x { background: none; border: none; font-size: 18px; color: var(--ltc-muted); cursor: pointer; line-height: 1; padding: 0 2px; }
body.ltc-revamp .ltc-trace-crumbs { font-size: 10.5px; color: var(--ltc-muted); margin-bottom: 8px; }
body.ltc-revamp .ltc-trace-crumb { background: none; border: none; color: var(--ltc-accent); cursor: pointer; font-size: 10.5px; padding: 0; text-decoration: underline dotted; }
body.ltc-revamp .ltc-trace-desc { font-size: 12px; color: var(--ltc-text); line-height: 1.5; margin: 0 0 8px; }
body.ltc-revamp .ltc-trace-formula { font-size: 11px; color: var(--ltc-muted); background: var(--ltc-tile-bg); border: 1px solid var(--ltc-hairline); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; line-height: 1.5; }
body.ltc-revamp .ltc-trace-deps-lbl { font-size: 9px; font-weight: 700; letter-spacing: .08em; color: var(--ltc-muted); margin-bottom: 6px; }
body.ltc-revamp .ltc-trace-deps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
body.ltc-revamp .ltc-trace-pill {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1px; cursor: pointer;
    background: var(--ltc-tile-bg); border: 1px solid var(--ltc-hairline); border-radius: 8px; padding: 6px 10px;
    transition: border-color .15s, background .15s;
}
body.ltc-revamp .ltc-trace-pill:hover { border-color: var(--ltc-accent); }
body.ltc-revamp .ltc-trace-pill b { font-size: 12px; color: var(--ltc-text); font-variant-numeric: tabular-nums; }
body.ltc-revamp .ltc-trace-pill span { font-size: 9.5px; color: var(--ltc-muted); }
body.ltc-revamp .ltc-trace-impact { font-size: 10.5px; color: var(--ltc-muted); font-style: italic; margin: 0 0 10px; }
body.ltc-revamp .ltc-trace-actions { display: flex; gap: 8px; }
body.ltc-revamp .ltc-trace-actions button {
    font-size: 11px; font-weight: 600; padding: 6px 10px; border-radius: 7px; cursor: pointer;
    border: 1px solid var(--ltc-hairline); background: var(--ltc-card-bg); color: var(--ltc-text);
}
body.ltc-revamp .ltc-trace-actions button:hover { border-color: var(--ltc-accent); color: var(--ltc-accent); }

/* ── Custom steppers; hide ugly native spinners ─────────────────────────── */
body.ltc-revamp input[type="number"]::-webkit-inner-spin-button,
body.ltc-revamp input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
body.ltc-revamp input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
body.ltc-revamp .ltc-step-btn {
    width: 22px; height: 24px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
    background: var(--ltc-tile-bg); border: 1px solid var(--ltc-hairline); border-radius: 6px;
    color: var(--ltc-muted); font-size: 13px; font-weight: 700; cursor: pointer; line-height: 1;
    transition: color .12s, border-color .12s, background .12s;
}
body.ltc-revamp .ltc-step-btn:hover { color: var(--ltc-accent); border-color: var(--ltc-accent); }
body.ltc-revamp .ltc-step-btn:active { background: var(--ltc-badge-bg); }
body.ltc-revamp .ltc-step-wrap { display: flex; align-items: center; gap: 5px; }
body.ltc-revamp .ltc-step-wrap input { flex: 1; min-width: 0; }
@media (max-width: 768px) { body.ltc-revamp .ltc-step-btn { width: 32px; height: 32px; } }

/* ── Modelling diagrams: essentials first — sub-lines de-emphasized, detail on click ── */
body.ltc-revamp .model-block text[id$="Sub"],
body.ltc-revamp .control-block text[id$="Sub"] { opacity: .45; font-size: 90%; }
body.ltc-revamp [data-block-popup] { cursor: pointer; }
body.ltc-revamp .model-block text[data-block-popup]:hover,
body.ltc-revamp .control-block text[data-block-popup]:hover { opacity: 1; fill: var(--ltc-accent); }

/* ── Trace indicator FIX (was invisible: class sat on value, CSS on card) ── */
body.ltc-revamp .ltc-kpi-card.ltc-traceable { position: relative; cursor: pointer; }
body.ltc-revamp .ltc-kpi-card.ltc-traceable .ltc-kpi-value {
    text-decoration: underline dotted rgba(245,158,11,.75) 1.5px; text-underline-offset: 4px;
}
body.ltc-revamp .ltc-kpi-card.ltc-traceable:focus-visible { outline: 2px solid var(--ltc-accent); outline-offset: 2px; }
body.ltc-revamp i.ltc-fx {
    font-style: normal; font-size: 8px; font-weight: 700; padding: 1px 4px; border-radius: 4px;
    background: rgba(245,158,11,.14); color: #b45309; margin-left: 5px; vertical-align: 2px;
}
[data-theme="dark"] body.ltc-revamp i.ltc-fx { color: #fbbf24; }
body.ltc-revamp .ltc-res-val.ltc-traceable { cursor: pointer; }
body.ltc-revamp .ltc-res-val.ltc-traceable:hover { color: var(--ltc-accent); }

/* ── DETAILED grid trace badge via ::after (engine setText survives) ────── */
body.ltc-revamp .result-card .value.ltc-traceable { cursor: pointer; }
body.ltc-revamp .result-card .value.ltc-traceable::after {
    content: "ƒx"; font-size: 8px; font-weight: 700; padding: 1px 4px; border-radius: 4px;
    background: rgba(245,158,11,.14); color: #b45309; margin-left: 5px; vertical-align: 2px;
}
[data-theme="dark"] body.ltc-revamp .result-card .value.ltc-traceable::after { color: #fbbf24; }
body.ltc-revamp .result-card .value.ltc-traceable:hover { color: var(--ltc-accent); }
body.ltc-revamp .ltc-valid-val.ltc-traceable { cursor: pointer; text-decoration: underline dotted rgba(245,158,11,.6) 1px; text-underline-offset: 3px; }
