:root {
    --bg-page: #fafaf9;
    --bg-surface: #ffffff;
    --bg-subtle: #f5f5f4;
    --bg-warm: #fefce8;
    --border: #e7e5e4;
    --border-strong: #d6d3d1;
    --text-primary: #1c1917;
    --text-secondary: #3f3f46;
    --text-muted: #52525b;
    --brand: #047857;
    --brand-dark: #065f46;
    --brand-soft: #ecfdf5;
    --brand-border: #a7f3d0;
    --copper: #b45309;
    --copper-soft: #fffbeb;
    --copper-border: #fde68a;
    --red: #b91c1c;
    --red-soft: #fef2f2;
    --red-border: #fecaca;
    --radius: 6px;
    --font-sans: "IBM Plex Sans", "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-padding-top: 84px;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.68;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.mono {
    font-family: var(--font-mono);
    font-size: 0.92em;
}

/* === Light Corporate Header === */
.utility-bar {
    background: var(--bg-subtle);
    color: var(--text-muted);
    font-size: 12px;
    border-bottom: 1px solid var(--border);
}

.utility-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 6px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.utility-bar a {
    color: var(--text-secondary);
    font-weight: 600;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-surface);
    border-top: 3px solid var(--brand);
    border-bottom: 1px solid var(--border-strong);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 18px;
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--text-primary);
    text-decoration: none;
    flex-shrink: 0;
    min-width: 0;
}

.brand-link:hover {
    text-decoration: none;
}

.brand-mark {
    width: 34px;
    height: 34px;
    background: var(--brand);
    color: #ffffff;
    border-radius: 4px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 13px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

img.brand-mark {
    width: 36px;
    height: 36px;
    background: transparent;
    border-radius: 0;
    object-fit: contain;
    display: block;
}

.brand-name {
    font-size: 15.5px;
    font-weight: 800;
    letter-spacing: -0.3px;
    line-height: 1.15;
    display: block;
    color: var(--text-primary);
}

.brand-tagline {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    font-weight: 500;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    margin-left: auto;
}

.nav-search-btn {
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    transition: border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.nav-search-btn svg {
    color: var(--brand);
    flex-shrink: 0;
}

.nav-search-btn:hover {
    border-color: var(--brand);
    color: var(--brand-dark);
    box-shadow: 0 0 0 2px rgba(4, 120, 87, 0.12);
}

.nav-search-btn kbd {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
    background: #e2e8f0;
    border: 1px solid #94a3b8;
    color: #1e293b;
}

.sidebar-search-btn {
    width: 100%;
    margin-bottom: 12px;
    border: 1.5px solid #cbd5e1;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    padding: 7px 10px;
    border-radius: 4px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.sidebar-search-btn:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.nav-link,
.nav-drop-btn {
    padding: 7px 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 4px;
    border: none;
    border-bottom: 2px solid transparent;
    background: transparent;
    font-family: inherit;
    line-height: 1.3;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.nav-link:hover,
.nav-drop-btn:hover {
    color: var(--brand-dark);
    background: var(--bg-subtle);
    text-decoration: none;
}

.nav-link.active,
.nav-drop-btn.active {
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-bottom-color: var(--brand);
}

.nav-dropdown {
    position: relative;
}

.nav-drop-caret {
    font-size: 10px;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.nav-dropdown.open .nav-drop-caret {
    transform: rotate(180deg);
}

.nav-drop-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 295px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(28, 25, 23, 0.1);
    padding: 6px;
    z-index: 90;
    flex-direction: column;
    gap: 2px;
}

.nav-dropdown.open .nav-drop-menu,
.nav-dropdown:hover .nav-drop-menu,
.nav-dropdown:focus-within .nav-drop-menu {
    display: flex;
}

.nav-drop-menu .nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 11px;
    font-size: 13px;
    border-bottom: none;
    border-radius: 4px;
}

.nav-drop-menu .nav-link.active {
    border-bottom: none;
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.part-heading {
    margin: 34px 0 6px;
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.part-tag {
    display: inline-block;
    padding: 2px 9px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    border-radius: 3px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    border: 1px solid var(--brand-border);
}

.part-tag.copper {
    background: var(--copper-soft);
    color: var(--copper);
    border-color: var(--copper-border);
}

.chapter-pager {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 12px;
    flex-wrap: wrap;
}

.pager-link {
    flex: 1 1 210px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 15px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-subtle);
    color: var(--text-primary);
    text-decoration: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.pager-link:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
    text-decoration: none;
}

.pager-link.next {
    text-align: right;
}

.pager-dir {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--brand-dark);
}

.pager-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-toggle {
    display: none;
    border: 1px solid var(--border-strong);
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* === Bright Editorial Hero === */
.corp-hero {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 42px 24px 38px;
}

.corp-hero-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.9fr);
    gap: 36px;
    align-items: center;
}

.eyebrow {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--brand);
    margin: 0 0 8px;
}

.corp-hero h1 {
    margin: 0 0 12px;
    font-size: 32px;
    line-height: 1.24;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.corp-hero p {
    margin: 0 0 20px;
    font-size: 15.5px;
    color: var(--text-secondary);
    max-width: 64ch;
}

.hero-specs {
    background: var(--bg-subtle);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 20px 22px;
}

.hero-specs h2 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--text-primary);
}

.hero-specs ul {
    margin: 0;
    padding-left: 18px;
    font-size: 13.5px;
    color: var(--text-secondary);
}

.hero-specs li {
    margin-bottom: 7px;
}

/* === Main Page Layout & Knowledge Articles === */
.page-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 26px 24px 56px;
}

.page-shell:has(#sec-cabinet.active) {
    max-width: 1580px;
    padding: 20px 24px 56px;
}

#sec-cabinet > .card.cab-studio-card {
    background: linear-gradient(180deg, #0b111d 0%, #0e1625 100%);
    border: 1px solid #253348;
    color: #e2e8f0;
    box-shadow: 0 12px 34px rgba(2, 6, 23, 0.24);
}

#sec-cabinet > .card.cab-studio-card .src-badge {
    background: rgba(14, 165, 233, 0.14);
    border-color: rgba(56, 189, 248, 0.34);
    color: #7dd3fc;
}

#sec-cabinet > .card.cab-studio-card .src-badge a {
    color: #38bdf8;
}

#sec-cabinet > .card.cab-studio-card .card-title {
    color: #f8fafc;
}

#sec-cabinet > .card.cab-studio-card .card-desc {
    color: #94a3b8;
}

#sec-cabinet > .card.cab-studio-card .val-badge {
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(52, 211, 153, 0.42);
    color: #34d399;
}

#sec-cabinet > .card.cab-studio-card .alert-ok {
    background: rgba(6, 78, 59, 0.36);
    border-color: #10b981;
    color: #d1fae5;
}

#sec-cabinet > .card.cab-studio-card .alert-warn {
    background: rgba(120, 53, 15, 0.34);
    border-color: #d97706;
    color: #fef3c7;
}

#sec-cabinet > .card.cab-studio-card .alert-bad {
    background: rgba(127, 29, 29, 0.4);
    border-color: #ef4444;
    color: #fee2e2;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.breadcrumb span {
    color: var(--text-primary);
    font-weight: 600;
}

.doc-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.doc-sidebar {
    position: sticky;
    top: 84px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 18px;
}

.sidebar-heading {
    margin: 0 0 10px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--text-muted);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-list li {
    margin-bottom: 4px;
}

.toc-list a {
    display: block;
    padding: 6px 8px;
    font-size: 13px;
    color: var(--text-secondary);
    border-radius: 4px;
    font-weight: 500;
}

.toc-list a:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
    text-decoration: none;
}

.sidebar-tools {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.doc-article {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 34px 42px;
}

.doc-article h1 {
    margin: 0 0 10px;
    font-size: 28px;
    line-height: 1.26;
    color: var(--text-primary);
    font-weight: 800;
}

.doc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12.5px;
    color: var(--text-muted);
    padding-bottom: 18px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.doc-section {
    margin-bottom: 38px;
    scroll-margin-top: 86px;
}

.doc-article h2 {
    margin: 0 0 12px;
    font-size: 20px;
    color: var(--text-primary);
    font-weight: 700;
    padding-bottom: 7px;
    border-bottom: 2px solid var(--border);
}

.doc-article h3 {
    margin: 20px 0 8px;
    font-size: 16px;
    color: var(--brand-dark);
    font-weight: 700;
}

.doc-article p {
    margin: 0 0 12px;
    color: var(--text-secondary);
    max-width: 68ch;
}

.doc-article ul,
.doc-article ol {
    margin: 0 0 14px;
    padding-left: 22px;
    color: var(--text-secondary);
    max-width: 68ch;
}

.doc-article li {
    margin-bottom: 7px;
}

/* Technical Boxes */
.doc-article,
.doc-sidebar,
.hero-specs,
.curriculum-card,
.steps-box,
.card {
    min-width: 0;
    max-width: 100%;
}

.formula-box {
    background: var(--bg-subtle);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 15px 18px;
    margin: 14px 0 18px;
    max-width: 72ch;
}

.formula-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--brand-dark);
    margin-bottom: 4px;
}

.formula-math {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 8px 0 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.formula-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    line-height: 1.65;
}

.formula-eq-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-secondary);
}

.eq-sep {
    color: var(--border-strong);
    font-weight: 400;
    user-select: none;
}

math {
    font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", "Noto Sans Math", "Times New Roman", serif;
    color: inherit;
    math-style: normal;
    font-size: 15.5px;
}

.formula-math math {
    font-size: 18px;
}

.doc-article p math,
.doc-article li math,
.data-table math {
    font-size: 15.5px;
    vertical-align: middle;
}

math mfrac > *,
math msub > *,
math msup > *,
math mmsubsup > *,
math munder > *,
math mover > *,
math munderover > *,
math msqrt > *,
math mrow,
math mtext,
math mi,
math mn,
math mo {
    font-size: 13px !important;
    math-depth: 0 !important;
}

.example-box li,
.data-table td {
    line-height: 1.75;
}

.example-box {
    background: #ffffff;
    border: 1px solid var(--brand-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin: 16px 0 22px;
    max-width: 72ch;
}

.example-box h4 {
    margin: 0 0 8px;
    font-size: 14.5px;
    font-weight: 700;
    color: var(--brand-dark);
}

.safety-callout {
    background: var(--copper-soft);
    border: 1px solid var(--copper-border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin: 16px 0;
    color: #78350f;
    font-size: 13.5px;
    max-width: 72ch;
}

.diagram-figure {
    margin: 18px 0 22px;
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 16px;
    max-width: 740px;
}

.diagram-figure svg {
    width: 100%;
    height: auto;
    display: block;
}

.diagram-caption {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--text-muted);
    text-align: center;
    font-weight: 500;
}

/* Home Curriculum Directory */
.section-heading {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
}

.section-sub {
    margin: 0 0 20px;
    font-size: 14.5px;
    color: var(--text-muted);
    max-width: 76ch;
}

.curriculum-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 36px;
}

.curriculum-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.curriculum-code {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--copper);
    letter-spacing: 0.2px;
    margin-bottom: 6px;
}

.curriculum-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

.curriculum-card p {
    margin: 0 0 14px;
    font-size: 13.5px;
    color: var(--text-secondary);
    flex: 1;
}

.curriculum-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    margin: 12px 0 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    max-width: 65ch;
}

.data-table th:last-child,
.data-table td:last-child {
    border-right: none;
}

.table-wrap > .data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table th {
    background: var(--bg-subtle);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.2px;
}

.data-table td.mono {
    font-family: var(--font-mono);
}

/* Buttons & Tool Tabs */
.btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn {
    border: 1px solid var(--border-strong);
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
    background: var(--bg-subtle);
    border-color: #a8a29e;
    text-decoration: none;
}

.btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #ffffff;
}

.btn-green {
    background: #15803d;
    border-color: #15803d;
    color: #ffffff;
}

.btn-green:hover {
    background: #166534;
    border-color: #166534;
    color: #ffffff;
}

.btn-red {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #ffffff;
}

.btn-red:hover {
    background: #991b1b;
    border-color: #991b1b;
    color: #ffffff;
}

.btn-amber {
    background: #d97706;
    border-color: #d97706;
    color: #ffffff;
}

.btn-amber:hover {
    background: #b45309;
    border-color: #b45309;
    color: #ffffff;
}

.btn-sm {
    padding: 6px 11px;
    font-size: 12.5px;
}

.pill-group {
    display: inline-flex;
    flex-wrap: wrap;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    padding: 2px;
    gap: 2px;
}

.pill-btn {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.pill-btn:hover {
    color: var(--text-primary);
}

.pill-btn.active {
    background: var(--brand);
    color: #ffffff;
}

.tool-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    gap: 4px;
}

.tab-btn {
    border: none;
    background: transparent;
    padding: 11px 16px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    text-align: left;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-subtle);
}

.tab-btn.active {
    color: var(--brand-dark);
    border-bottom-color: var(--brand);
    background: var(--brand-soft);
}

.module-section {
    display: none;
}

.module-section.active {
    display: block;
}

.grid-2 {
    display: grid;
    grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.grid-equal {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 20px;
}

.card+.card {
    margin-top: 18px;
}

.card-title {
    margin: 0 0 6px;
    font-size: 16.5px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.card-desc {
    margin: 0 0 16px;
    font-size: 13.5px;
    color: var(--text-muted);
    max-width: 65ch;
}

.src-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 700;
    background: var(--brand-soft);
    color: var(--brand-dark);
    border: 1px solid var(--brand-border);
    margin-bottom: 8px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.val-badge {
    font-family: var(--font-mono);
    color: var(--brand-dark);
    font-weight: 700;
}

input[type="number"],
input[type="text"],
select {
    width: 100%;
    padding: 8px 10px;
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 13.5px;
    font-family: var(--font-sans);
    outline: none;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(4, 120, 87, 0.14);
}

input[type="range"] {
    width: 100%;
    accent-color: var(--brand);
    cursor: pointer;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.kpi-grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.kpi {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 10px 12px;
}

.kpi-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.2px;
}

.kpi-value {
    font-size: 18px;
    font-weight: 800;
    font-family: var(--font-mono);
    color: var(--text-primary);
    margin-top: 2px;
}

.kpi-sub {
    font-size: 11.5px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.ok {
    color: var(--brand-dark);
}

.warn {
    color: var(--copper);
}

.bad {
    color: var(--red);
}

.info {
    color: var(--brand);
}

.steps-box {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 14px;
    font-size: 13px;
}

.steps-box h3,
.steps-box h4 {
    margin: 0 0 8px;
    font-size: 13.5px;
    color: var(--text-primary);
}

.step-list {
    margin: 0;
    padding-left: 18px;
    color: var(--text-secondary);
}

.step-list li {
    margin-bottom: 5px;
}

.alert {
    border-radius: 4px;
    padding: 11px 14px;
    font-size: 13px;
    margin-top: 12px;
    border: 1px solid;
}

.alert-warn {
    background: var(--copper-soft);
    border-color: var(--copper-border);
    color: #78350f;
}

.alert-ok {
    background: var(--brand-soft);
    border-color: var(--brand-border);
    color: #064e3b;
}

.alert-bad {
    background: var(--red-soft);
    border-color: var(--red-border);
    color: #7f1d1d;
}

.tag-pill {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.tag-red {
    background: var(--red-soft);
    color: var(--red);
    border: 1px solid var(--red-border);
}

.tag-amber {
    background: var(--copper-soft);
    color: var(--copper);
    border: 1px solid var(--copper-border);
}

.tag-blue {
    background: var(--brand-soft);
    color: var(--brand-dark);
    border: 1px solid var(--brand-border);
}

.tag-green {
    background: var(--brand-soft);
    color: var(--brand);
    border: 1px solid var(--brand-border);
}

.status-lamps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.lamp {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 11px;
    border-radius: 4px;
    background: var(--bg-subtle);
    border: 1px solid var(--border-strong);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.lamp-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #a8a29e;
}

.lamp.on-green {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: #064e3b;
}

.lamp.on-green .lamp-dot {
    background: var(--brand);
}

.lamp.on-amber {
    background: var(--copper-soft);
    border-color: var(--copper);
    color: #78350f;
}

.lamp.on-amber .lamp-dot {
    background: #d97706;
}

.lamp.on-blue {
    background: #ecfeff;
    border-color: #0e7490;
    color: #164e63;
}

.lamp.on-blue .lamp-dot {
    background: #0891b2;
}

.lamp.on-red {
    background: var(--red-soft);
    border-color: var(--red);
    color: #7f1d1d;
}

.lamp.on-red .lamp-dot {
    background: #dc2626;
}

/* Bright Drafting Canvas Frame (Zero Heavy Black Blocks!) */
.canvas-wrap {
    background: #ffffff;
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    padding: 8px;
    overflow: hidden;
}

.canvas-wrap canvas {
    width: 100%;
    display: block;
}

.demo-caption {
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 4px;
    background: var(--brand-soft);
    border: 1px solid var(--brand-border);
    color: #064e3b;
    font-size: 13px;
    font-weight: 600;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.drc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.drc-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 4px;
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.drc-item input {
    margin-top: 3px;
    accent-color: var(--brand);
}

/* Studio Recording Modes */
body.studio-16-9 .tool-tabs,
body.studio-16-9 .breadcrumb,
body.studio-16-9 .site-footer {
    display: none;
}

body.studio-16-9 .page-shell {
    max-width: 1180px;
    padding-top: 12px;
}

body.studio-9-16 .tool-tabs,
body.studio-9-16 .breadcrumb,
body.studio-9-16 .site-footer {
    display: none;
}

body.studio-9-16 .page-shell {
    max-width: 460px;
    padding: 10px 12px 24px;
}

body.studio-9-16 .grid-2,
body.studio-9-16 .grid-equal {
    grid-template-columns: 1fr;
}

body.studio-9-16 .kpi-grid,
body.studio-9-16 .kpi-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* === Light Corporate Footer === */
.site-footer {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border-top: 2px solid var(--border-strong);
    margin-top: 44px;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 34px 24px 26px;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 28px;
}

.site-footer h3 {
    margin: 0 0 10px;
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.1px;
    color: var(--text-primary);
}

.site-footer p,
.site-footer li {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 6px;
}

.site-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer a {
    color: var(--brand-dark);
    font-weight: 500;
}

.footer-bottom {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 24px 24px;
    border-top: 1px solid var(--border-strong);
    font-size: 12px;
    color: var(--text-muted);
}

/* === Realistic Industrial Control Cabinet & CAD Studio === */
.cab-enclosure {
    background: linear-gradient(180deg, #252c36 0%, #1d232b 100%);
    border: 2px solid #3d4856;
    border-radius: 6px;
    padding: 12px 14px 14px;
    margin-bottom: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 18px rgba(15, 23, 42, 0.14);
    color: #e2e8f0;
}

.cab-nameplate {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 6px 10px;
    padding: 0 4px 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid #364150;
    font-size: 12px;
    font-family: var(--font-mono);
    letter-spacing: 0.3px;
    color: #94a3b8;
}

.cab-nameplate-badge {
    background: #11161d;
    border: 1px solid #475569;
    padding: 3px 9px;
    border-radius: 3px;
    color: #f8fafc;
    font-weight: 700;
    white-space: nowrap;
}

.cab-panel-grid {
    display: grid;
    grid-template-columns: 1.15fr 1.15fr 1.1fr 0.9fr 1.25fr;
    gap: 10px;
}

.cab-module {
    background: #161b22;
    border: 1px solid #333e4d;
    border-radius: 4px;
    padding: 9px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.45);
}

.cab-mod-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #cbd5e1;
    background: #222a35;
    border: 1px solid #384454;
    border-radius: 2px;
    padding: 4px 7px;
    text-align: center;
}

/* DIN Rail Breakers & Hardware Switches */
.cab-din-row {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    padding: 4px 0;
    background: repeating-linear-gradient(180deg, transparent 0, transparent 22px, #2b3441 22px, #2b3441 28px, transparent 28px);
}

.din-mcb-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.din-mcb-btn:hover svg {
    filter: brightness(1.12);
}

.cab-ol-bar-wrap {
    background: #0d1218;
    border: 1px solid #303a48;
    border-radius: 3px;
    padding: 5px 7px;
}

.cab-ol-track {
    height: 6px;
    background: #1e293b;
    border-radius: 2px;
    overflow: hidden;
    margin: 4px 0 6px;
}

.cab-ol-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #10b981, #f59e0b 65%, #ef4444);
    transition: width 0.12s linear;
}

/* Recessed Digital Panel Meter */
.cab-lcd-screen {
    background: #091217;
    border: 2px solid #2d3846;
    border-radius: 3px;
    padding: 7px 9px;
    font-family: var(--font-mono);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.7);
}

.cab-meter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    color: #94a3b8;
    padding: 2px 0;
}

.cab-meter-row strong {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: #34d399;
    letter-spacing: 0.4px;
}

.cab-meter-row strong.warn {
    color: #fbbf24;
}

.cab-meter-row strong.bad {
    color: #f87171;
}

.cab-phase-switches {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.phase-sw {
    border: 1px solid #3f4c5e;
    background: #1f2732;
    color: #cbd5e1;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 4px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.phase-sw .ph-led {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
}

.phase-sw.fault {
    background: #450a0a;
    border-color: #ef4444;
    color: #fecaca;
}

.phase-sw.fault .ph-led {
    background: #ef4444;
}

/* Ø22mm Industrial Panel Operators (E-Stop, Pushbuttons, Selector, Pilot Lamps) */
.cab-op-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 4px 2px;
}

.hw-op-btn {
    background: transparent;
    border: none;
    padding: 2px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #cbd5e1;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
}

.hw-bezel {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #64748b, #1e293b 70%);
    padding: 4px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.55), inset 0 1px 1px rgba(255, 255, 255, 0.25);
    display: grid;
    place-items: center;
    transition: transform 0.08s ease;
}

.hw-op-btn:active .hw-bezel {
    transform: translateY(1px) scale(0.96);
}

.hw-cap {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.28), inset 0 -2px 4px rgba(0, 0, 0, 0.45);
    display: grid;
    place-items: center;
    font-size: 9px;
    color: #ffffff;
    font-weight: 800;
}

.hw-cap.green {
    background: radial-gradient(circle at 35% 30%, #22c55e, #15803d);
}

.hw-cap.red {
    background: radial-gradient(circle at 35% 30%, #ef4444, #991b1b);
}

.hw-cap.rotary {
    background: #1e293b;
    position: relative;
}

.hw-cap.rotary::after {
    content: "";
    width: 6px;
    height: 24px;
    background: #e2e8f0;
    border-radius: 2px;
    transform: rotate(-35deg);
    transition: transform 0.15s ease;
}

.hw-op-btn.active .hw-cap.rotary::after {
    transform: rotate(35deg);
    background: #34d399;
}

.hw-estop-collar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #facc15, #ca8a04);
    padding: 5px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
    display: grid;
    place-items: center;
}

.hw-estop-cap {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ef4444, #991b1b 75%);
    border: 2px solid #7f1d1d;
    color: #fff;
    font-size: 7.5px;
    font-weight: 900;
    display: grid;
    place-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hw-op-btn.latched .hw-estop-cap {
    transform: scale(0.88);
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.75);
    border-color: #fca5a5;
}

.hw-plate {
    background: #0d1117;
    border: 1px solid #364150;
    padding: 1px 5px;
    border-radius: 2px;
    color: #e2e8f0;
    letter-spacing: 0.3px;
}

/* Jewelled Pilot Lamps */
.hw-lamps-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 6px 2px;
}

.hw-lamp {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 10px;
}

.hw-lens {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid #64748b;
    background: #1f2937;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
}

.hw-lamp.lit-green .hw-lens {
    background: radial-gradient(circle at 38% 35%, #86efac, #16a34a 60%, #14532d);
    border-color: #cbd5e1;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.65);
}

.hw-lamp.lit-red .hw-lens {
    background: radial-gradient(circle at 38% 35%, #fca5a5, #dc2626 60%, #7f1d1d);
    border-color: #cbd5e1;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.65);
}

.hw-lamp.lit-amber .hw-lens {
    background: radial-gradient(circle at 38% 35%, #fde68a, #d97706 60%, #78350f);
    border-color: #cbd5e1;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.7);
}

/* Live Rotating Motor Card & DIN Armature Indicators */
.cab-motor-unit {
    background: #0e141b;
    border: 1px solid #303a48;
    border-radius: 4px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.cab-motor-unit.fault {
    border-color: #ef4444;
    background: #2a0f12;
}

.cab-motor-meta {
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.35;
}

.cab-coils-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.coil-flag {
    background: #0d1218;
    border: 1px solid #334155;
    border-radius: 3px;
    padding: 2px 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
}

.coil-flag.pull {
    background: #064e3b;
    border-color: #10b981;
    color: #a7f3d0;
}

.coil-flag.timer {
    background: #451a03;
    border-color: #f59e0b;
    color: #fde68a;
}

.cab-timer-tuner {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 4px;
}

.cab-timer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: #0d1523;
    border: 1px solid #334155;
    border-radius: 5px;
    padding: 4px 7px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: #fde68a;
    white-space: nowrap;
}

.cab-timer-ctrl {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.cab-timer-step {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #475569;
    border-radius: 3px;
    width: 20px;
    height: 20px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.cab-timer-step:hover {
    background: #334155;
    border-color: #f59e0b;
}

input.cab-timer-input[type="number"] {
    width: 44px;
    min-width: 0;
    height: 22px;
    background: #070b12;
    color: #fbbf24;
    border: 1px solid #475569;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    padding: 1px 3px;
}

/* AutoCAD-Style Command Toolbar, Left Tool Dock & Drafting Sheet */
.cab-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: #131922;
    border: 1px solid #2d3848;
    border-radius: var(--radius);
    margin-bottom: 8px;
    color: #e2e8f0;
}

.cab-tool-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.cab-toolbar select {
    width: auto;
    min-width: 215px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    background: #0d1218;
    color: #f8fafc;
    border-color: #38465a;
}

.cab-toolbar .btn {
    background: #1e2734;
    border-color: #364356;
    color: #e2e8f0;
    padding: 5px 9px;
    font-size: 11.5px;
}

.cab-toolbar .btn:hover {
    background: #283344;
    border-color: #52647d;
}

.cab-toolbar .btn.btn-primary,
.cab-toolbar .btn.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.cab-toolbar .pill-group {
    background: #0b1017;
    border-color: #334155;
}

.cab-toolbar .pill-btn {
    color: #94a3b8;
}

.cab-toolbar .pill-btn.active {
    background: #0284c7;
    color: #ffffff;
}

.cab-toolbar,
.cab-prop-bar,
.cab-cad-workspace,
section[id] {
    scroll-margin-top: 84px;
}

.cab-tool-divider {
    display: inline-block;
    width: 1px;
    height: 20px;
    background: #2b3749;
    margin: 0 2px;
    flex-shrink: 0;
}

.cab-toolbar .btn:disabled,
.cab-side-btn-grid .btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.cab-cad-workspace {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 304px;
    gap: 10px;
    align-items: stretch;
}

.cab-cad-workspace.palette-hidden {
    grid-template-columns: minmax(0, 1fr) 304px;
}

.cab-cad-workspace.palette-hidden .cab-stencil-dock {
    display: none;
}

/* AutoCAD Dark Add-in Left Tool Dock (Khí Cụ | Đi Dây | Mạch Mẫu) */
.cab-stencil-dock {
    background: #141a24;
    border: 1px solid #2c3748;
    border-radius: var(--radius);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    max-height: 615px;
    overflow: hidden;
}

.cab-dock-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: #0d1218;
    border-bottom: 1px solid #2b3646;
}

.cab-dock-tab {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 11.5px;
    font-weight: 700;
    padding: 8px 4px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.cab-dock-tab:hover {
    color: #f8fafc;
    background: #1a2230;
}

.cab-dock-tab.active {
    color: #38bdf8;
    background: #141a24;
    border-bottom-color: #38bdf8;
}

.cab-dock-body {
    position: relative;
    padding: 8px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cab-dock-search {
    width: 100%;
    background: #0a0f16;
    border: 1px solid #334155;
    color: #f8fafc;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.cab-dock-search:focus {
    border-color: #38bdf8;
    outline: none;
}

.cab-wire-group {
    border: 1px solid #263140;
    border-radius: 4px;
    background: #0f151f;
    overflow: hidden;
}

.cab-wire-group-hdr {
    padding: 6px 8px;
    background: #1a2332;
    font-size: 11px;
    font-weight: 700;
    color: #cbd5e1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #263140;
}

.cab-wire-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    padding: 7px;
}

.cab-wire-btn {
    border: 1px solid #334155;
    background: #1b2432;
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 5px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.cab-wire-btn:hover {
    background: #253347;
    border-color: #38bdf8;
}

.cab-wire-btn.active {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff;
}

.cab-phase-pills {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    padding: 0 7px 6px;
}

.cab-phase-pill {
    border: 1px solid #334155;
    background: #0c1118;
    color: #cbd5e1;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 2px;
    border-radius: 3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.cab-phase-pill.active {
    border-color: #ffffff;
    background: #1e293b;
    color: #ffffff;
}

.cab-phase-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.stencil-cat {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #94a3b8;
    margin: 7px 0 3px;
}

.stencil-cat:first-child {
    margin-top: 0;
}

.stencil-btn {
    width: 100%;
    text-align: left;
    background: #1b2432;
    border: 1px solid #2d3a4d;
    border-radius: 4px;
    padding: 5px 8px;
    margin-bottom: 4px;
    font-size: 11.5px;
    font-weight: 600;
    color: #e2e8f0;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.stencil-btn:hover {
    border-color: #38bdf8;
    background: #233044;
}

.stencil-btn.active {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff;
}

.preset-card-btn {
    width: 100%;
    text-align: left;
    background: #0c2238;
    border: 1px solid #1e4b75;
    border-radius: 4px;
    padding: 7px 9px;
    margin-bottom: 5px;
    cursor: pointer;
    color: #e0f2fe;
}

.preset-card-btn:hover {
    border-color: #38bdf8;
    background: #103252;
}

.preset-card-btn.active {
    border-color: #10b981;
    background: #064e3b;
}

.preset-card-btn .p-title {
    font-size: 11.5px;
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}

.preset-card-btn .p-desc {
    font-size: 10.5px;
    color: #93c5fd;
    display: block;
    line-height: 1.35;
}

.cab-prop-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    padding: 8px 12px;
    background: #0f1726;
    border: 1px solid #29364a;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 12px;
    color: #cbd5e1;
}

.cab-prop-bar input,
.cab-prop-bar select {
    background: #080d16;
    color: #f8fafc;
    border: 1px solid #36465d;
    border-radius: 5px;
    padding: 3px 7px;
    font-size: 12px;
}

#cab-prop-left {
    min-height: 36px;
    line-height: 1.35;
}

.cab-probe-readout {
    display: block;
    width: 100%;
    height: 20px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: #38bdf8;
}

.cab-canvas-stage {
    position: relative;
    background: #06090f;
    border: 1px solid #2d3848;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#cab-canvas {
    width: 100%;
    height: auto;
    display: block;
    cursor: crosshair;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.cab-lang-note {
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    font-size: 12.5px;
    font-weight: 600;
}

.cab-drag-ghost {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    transform: translate(-50%, -50%);
    padding: 6px 11px;
    border-radius: 6px;
    background: rgba(2, 132, 199, 0.94);
    border: 1.5px solid #bae6fd;
    color: #ffffff;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
    white-space: nowrap;
}

.cab-cad-statusbar {
    background: #101620;
    border-top: 1px solid #263140;
    padding: 4px 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

#cab-coord-readout {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cab-cad-statusbar button {
    background: #1e293b;
    border: 1px solid #334155;
    color: #cbd5e1;
    font-family: var(--font-mono);
    font-size: 10.5px;
    padding: 2px 7px;
    border-radius: 3px;
    cursor: pointer;
}

.cab-cad-statusbar button:hover {
    border-color: #38bdf8;
    color: #ffffff;
}

/* Responsive Scrollable Table Wrapper */
.table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 12px 0 18px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-surface);
}

.table-wrap>.data-table {
    margin: 0;
    border: none;
}

/* Project Bar (Save/Load/Import/Print) for Virtual Cabinet */
.cab-project-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    background: #101826;
    border: 1px solid #29364a;
    border-radius: var(--radius);
    margin-bottom: 8px;
    color: #cbd5e1;
}

.cab-project-bar input[type="text"],
.cab-project-bar select {
    width: auto;
    min-width: 0;
    padding: 5px 9px;
    font-size: 12.5px;
    background: #080d16;
    color: #f8fafc;
    border: 1px solid #36465d;
    border-radius: 5px;
}

.cab-project-bar .btn {
    background: #1a2434;
    border-color: #334358;
    color: #e2e8f0;
}

.cab-project-bar .btn:hover {
    background: #243146;
    border-color: #4e6280;
}

.cab-project-bar .btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.cab-project-bar .btn-red {
    background: #991b1b;
    border-color: #dc2626;
    color: #fef2f2;
}

/* Global Ctrl+K Search Modal */
.site-search-modal[hidden] {
    display: none;
}

.site-search-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 72px 16px 24px;
}

.site-search-dialog {
    width: 100%;
    max-width: 640px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.24);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 110px);
}

.site-search-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}

.site-search-head input {
    flex: 1;
    border: 1px solid var(--border-strong);
    padding: 9px 12px;
    font-size: 14px;
    border-radius: 4px;
    background: #ffffff;
}

.site-search-results {
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 9px 12px;
    border-radius: 4px;
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--text-primary);
    cursor: pointer;
}

.search-result-item:hover,
.search-result-item.selected {
    background: var(--brand-soft);
    border-color: var(--brand-border);
    text-decoration: none;
}

.search-res-meta {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--brand-dark);
}

.search-res-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-primary);
}

.search-res-snippet {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-search-foot {
    padding: 7px 14px;
    background: var(--bg-subtle);
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

/* Print Title Sheet for A4 Schematic Export */
.cab-print-sheet {
    display: none;
}

@media print {
    @page {
        size: A4 landscape;
        margin: 10mm;
    }

    body>*:not(.page-shell) {
        display: none !important;
    }

    .page-shell>*:not(#sec-cabinet),
    #sec-cabinet .card>*:not(#cab-print-sheet):not(#cab-bom-wrap):not(#cab-diag-out) {
        display: none !important;
    }

    .page-shell {
        max-width: 100%;
        padding: 0;
    }

    .card {
        border: none;
        padding: 0;
        box-shadow: none;
    }

    .cab-print-sheet {
        display: block !important;
        border: 2px solid #0f172a;
        padding: 10px;
        margin-bottom: 12px;
    }

    .cab-print-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1.5px solid #0f172a;
        padding-bottom: 6px;
        margin-bottom: 8px;
        font-size: 12px;
    }

    .cab-print-img {
        width: 100%;
        height: auto;
        display: block;
    }
}

/* === Responsive === */
@media (max-width: 1180px) {
    .cab-panel-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cab-cad-workspace,
    .cab-cad-workspace.palette-hidden {
        grid-template-columns: minmax(0, 1fr);
    }

    .cab-right-inspector {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .nav-search-btn kbd {
        display: none;
    }
}

@media (max-width: 1140px) {
    .brand-link {
        flex: 1;
        min-width: 0;
    }

    .primary-nav {
        display: none;
        width: 100%;
        order: 5;
        margin-left: 0;
        padding: 10px 0 14px;
        border-top: 1px solid var(--border);
        flex-direction: column;
        align-items: stretch;
    }

    .primary-nav.open {
        display: flex;
    }

    .nav-search-btn {
        order: 2;
    }

    .nav-drop-btn {
        width: 100%;
        justify-content: space-between;
    }

    .nav-drop-menu {
        display: flex;
        position: static;
        box-shadow: none;
        border: none;
        border-top: none;
        border-left: 2px solid var(--border-strong);
        background: transparent;
        margin: 2px 0 8px 12px;
        padding: 0 0 0 8px;
        min-width: 0;
    }

    .header-inner {
        flex-wrap: wrap;
        padding: 10px 16px;
        gap: 8px;
    }

    .nav-toggle {
        display: inline-block;
        order: 3;
    }

    .corp-hero {
        padding: 28px 16px 26px;
    }

    .corp-hero h1 {
        font-size: 26px;
    }

    .corp-hero-inner,
    .doc-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .doc-sidebar {
        position: static;
    }

    .curriculum-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .page-shell {
        padding: 16px 14px 40px;
    }

    .header-inner {
        padding: 8px 14px;
    }

    .brand-tagline {
        display: none;
    }

    .nav-search-btn kbd {
        display: none;
    }

    .cab-panel-grid,
    .curriculum-grid,
    .grid-2,
    .grid-equal,
    .footer-inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .kpi-grid-4,
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .doc-article {
        padding: 20px 15px;
    }

    .doc-article h1 {
        font-size: 22px;
    }

    .doc-article h2 {
        font-size: 17.5px;
    }

    .doc-article li:has(math),
    .doc-article p:has(math),
    .example-box,
    .safety-callout {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .formula-math math {
        font-size: 15.5px;
    }

    .card {
        padding: 14px;
    }

    .form-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .cab-toolbar select {
        min-width: 0;
        width: 100%;
    }

    .cab-project-bar input[type="text"],
    .cab-project-bar select {
        width: 100%;
    }

    #cab-prop-left {
        min-height: 96px;
        align-content: flex-start;
    }

    #cab-btn-delwire {
        display: none !important;
    }

    .utility-inner {
        flex-direction: column;
        align-items: flex-start;
        padding: 6px 14px;
    }
}

@media (max-width: 480px) {
    .brand-name {
        font-size: 13.5px;
    }

    .brand-mark {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    img.brand-mark {
        width: 30px;
        height: 30px;
    }

    .nav-search-btn,
    .nav-toggle {
        padding: 5px 8px;
        font-size: 12px;
    }
}

/* === Account System (Free vs Pro) & Feature Paywall Gates === */
.nav-account-btn {
    border: 1.5px solid #cbd5e1;
    background: #ffffff;
    color: var(--text-primary);
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.nav-account-btn:hover {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(4, 120, 87, 0.12);
}

.nav-account-btn.is-pro {
    border-color: #d97706;
    background: #fffbeb;
    color: #78350f;
}

.tier-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.35;
}

.tier-badge-free {
    background: #e2e8f0;
    color: #1e293b;
}

.tier-badge-pro {
    background: #b45309;
    color: #ffffff;
}

.pro-inline-tag {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    vertical-align: middle;
}

.pro-inline-tag.is-locked {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.pro-inline-tag.is-unlocked {
    background: #dcfce7;
    color: #065f46;
    border: 1px solid #10b981;
}

.card.pro-card-locked {
    position: relative;
}

.card.pro-card-locked .kpi-grid,
.card.pro-card-locked .alert:not(.pro-keep),
.card.pro-card-locked .form-row {
    filter: blur(2.5px);
    opacity: 0.48;
    pointer-events: none;
    user-select: none;
}

.pro-gate-banner {
    margin-top: 12px;
    padding: 12px 14px;
    background: #0f172a;
    color: #f8fafc;
    border: 1.5px solid #f59e0b;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pro-gate-left {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 1 1 260px;
}

.pro-gate-icon {
    width: 34px;
    height: 34px;
    border-radius: 6px;
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pro-gate-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #fef3c7;
    margin-bottom: 2px;
}

.pro-gate-desc {
    font-size: 12.5px;
    color: #cbd5e1;
    line-height: 1.45;
}

.account-modal[hidden] {
    display: none !important;
}

.account-modal {
    position: fixed;
    inset: 0;
    z-index: 2200;
    background: rgba(15, 23, 42, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.account-dialog {
    background: #ffffff;
    color: var(--text-primary);
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    width: 100%;
    max-width: 780px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.35);
}

.account-modal-head {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.account-modal-eyebrow {
    font-size: 12px;
    font-weight: 700;
    color: var(--brand);
}

.account-modal-head h2 {
    margin: 2px 0 0;
    font-size: 18px;
    color: var(--text-primary);
}

.account-modal-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 18px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.acc-tab-btn {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: var(--text-secondary);
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.acc-tab-btn.active {
    background: var(--brand);
    color: #ffffff;
    border-color: var(--brand);
}

.account-modal-body {
    padding: 16px 18px 20px;
}

.acc-status-strip {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 12px;
}

.acc-mode-note {
    font-size: 12px;
    color: var(--text-muted);
}

.acc-auth-switch {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.acc-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.acc-profile-card {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    margin-bottom: 14px;
}

.acc-profile-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.acc-profile-name {
    font-size: 16px;
    font-weight: 700;
}

.acc-profile-email {
    font-size: 13px;
    color: var(--text-secondary);
}

.acc-profile-meta {
    display: grid;
    gap: 4px;
    font-size: 13px;
    color: var(--text-secondary);
}

.acc-entitlement-summary h3 {
    font-size: 14px;
    margin: 0 0 8px;
}

.acc-entitlement-summary ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 6px;
    font-size: 13px;
}

.acc-plan-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.acc-plan-card {
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px 14px;
    background: #f8fafc;
}

.acc-plan-card.is-pro-plan {
    border-color: #d97706;
    background: #fffbeb;
}

.acc-plan-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.acc-plan-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.acc-plan-price span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.acc-plan-card ul {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 5px;
    font-size: 12.5px;
    line-height: 1.45;
}

.acc-checkout-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    background: #ffffff;
}

.acc-checkout-box h3 {
    margin: 0 0 10px;
    font-size: 14.5px;
}

.acc-license-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.acc-license-row input {
    flex: 1 1 220px;
}

@media (max-width: 1140px) {
    .nav-account-btn {
        order: 2;
    }
}

@media (max-width: 720px) {
    .acc-plan-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 480px) {
    .nav-account-btn {
        padding: 4px 7px;
        font-size: 12px;
        gap: 5px;
    }
    .nav-account-btn .acc-name {
        display: none;
    }
}

@media (max-width: 1320px) {
    .brand-tagline {
        display: none;
    }
    .nav-link,
    .nav-drop-btn {
        padding: 6px 8px;
        font-size: 13px;
    }
    .nav-search-btn kbd {
        display: none;
    }
    .nav-search-btn,
    .nav-account-btn {
        padding: 5px 8px;
        font-size: 12.5px;
    }
}

/* === MOBILE-FIRST FULLSCREEN CAD, FLOAT HUD, TOUCH BAR & PLC LADDER EDITOR === */
.cab-cad-workspace.cab-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: #06090f;
    padding: 6px;
    gap: 6px;
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    overflow: hidden;
}

.cab-cad-workspace.cab-fullscreen.palette-hidden {
    grid-template-columns: minmax(0, 1fr);
}

.cab-cad-workspace.cab-fullscreen .cab-right-inspector {
    display: none;
}

.cab-cad-workspace.cab-fullscreen .cab-stencil-dock {
    max-height: calc(100dvh - 14px);
}

.cab-cad-workspace.cab-fullscreen .cab-canvas-stage {
    height: calc(100dvh - 14px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.cab-cad-workspace.cab-fullscreen #cab-canvas {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100dvh - 135px);
    aspect-ratio: 1200 / 660;
    margin: auto;
    display: block;
}

@media (max-width: 960px) {
    .cab-cad-workspace.cab-fullscreen {
        grid-template-columns: minmax(0, 1fr);
    }
    .cab-cad-workspace.cab-fullscreen .cab-stencil-dock:not(.mobile-dock-overlay-off) {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: 62px;
        max-height: 46dvh;
        z-index: 9550;
        box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.75);
    }
    .cab-cad-workspace.cab-fullscreen #cab-canvas {
        max-height: calc(100dvh - 168px);
    }
}

.cab-float-hud {
    background: rgba(11, 18, 32, 0.94);
    border-bottom: 1px solid #263449;
    padding: 6px 8px;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cab-float-hud[hidden] {
    display: none;
}

.cab-float-top {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}

.cab-float-kpi {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 700;
    color: #38bdf8;
}

.cab-float-actions,
.cab-float-ops {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

.cab-float-chip {
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid #475569;
    border-radius: 5px;
    padding: 5px 9px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    min-height: 30px;
}

.cab-float-chip.on {
    background: #064e3b;
    border-color: #10b981;
    color: #a7f3d0;
}

.cab-float-chip.fault {
    background: #7f1d1d;
    border-color: #ef4444;
    color: #fecaca;
}

.cab-float-chip.exit {
    background: #334155;
    border-color: #64748b;
}

.cab-touch-bar {
    display: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 5px;
    padding: 6px;
    background: #0d1420;
    border-top: 1px solid #223045;
    -webkit-overflow-scrolling: touch;
}

.cab-touch-bar button {
    flex: 0 0 auto;
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    min-height: 36px;
    cursor: pointer;
    white-space: nowrap;
}

.cab-touch-bar button.active {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff;
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    .cab-touch-bar {
        display: flex;
    }
}

.cab-cad-workspace.cab-fullscreen .cab-touch-bar {
    display: flex;
}

/* PLC Ladder Modal */
.plc-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9800;
    background: rgba(2, 6, 23, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.plc-modal-backdrop[hidden] {
    display: none;
}

.plc-modal-box {
    width: min(860px, 100%);
    max-height: 92dvh;
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: hidden;
}

.plc-modal-header,
.plc-tpl-bar,
.plc-ed-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.plc-tpl-bar select {
    flex: 1 1 240px;
    min-width: 0;
    background: #1e293b;
    color: #f8fafc;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12.5px;
}

.plc-io-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    background: #090e1a;
    border: 1px solid #1e293b;
    border-radius: 6px;
    padding: 7px 9px;
}

.plc-io-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.plc-io-chip {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
}

.plc-io-chip.on {
    background: #064e3b;
    color: #6ee7b7;
    border-color: #10b981;
}

.plc-io-chip.q.on {
    background: #7c2d12;
    color: #fdba74;
    border-color: #f97316;
}

.plc-io-chip.t.on {
    background: #1e3a8a;
    color: #93c5fd;
    border-color: #38bdf8;
}

.plc-rungs-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 2px;
}

.plc-rung-card {
    background: #111b2e;
    border: 1px solid #263449;
    border-radius: 7px;
    padding: 8px 10px;
}

.plc-rung-card.live {
    border-color: #10b981;
}

.plc-rung-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    color: #94a3b8;
    margin-bottom: 6px;
}

.plc-rung-rail {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.plc-rail-bar {
    font-family: var(--font-mono);
    font-weight: 800;
    color: #475569;
    font-size: 16px;
}

.plc-rail-bar.live {
    color: #22c55e;
}

.plc-wire-dash {
    font-family: var(--font-mono);
    color: #475569;
    font-weight: 700;
    flex-shrink: 0;
}

.plc-wire-dash.flex {
    flex: 1;
    min-width: 12px;
    overflow: hidden;
}

.plc-wire-dash.live {
    color: #22c55e;
}

.plc-cell-btn {
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid #475569;
    border-radius: 5px;
    padding: 7px 9px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    min-height: 36px;
}

.plc-cell-btn.live {
    background: #064e3b;
    border-color: #10b981;
    color: #a7f3d0;
}

.plc-cell-btn.coil.live {
    background: #7c2d12;
    border-color: #f97316;
    color: #fed7aa;
}

.plc-cell-btn.editing {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35);
}

.plc-cell-editor {
    background: #17253b;
    border: 1px solid #38bdf8;
    border-radius: 7px;
    padding: 10px;
    font-size: 12.5px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.plc-cell-editor select,
.plc-cell-editor input {
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid #475569;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 12.5px;
}

/* === V4 AUTOLAB UPGRADE: 4-TAB DOCK, SVG GRID, LIBRARY ACCORDION, AUTO DRAW & FLOATING VOM1 === */
.cab-dock-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cab-dock-tab {
    padding: 7px 3px;
    font-size: 10.5px;
    line-height: 1.25;
}

.cab-dev-toolbar {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 7px;
}

.cab-dev-toolbar-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.cab-dev-toolbar-row select {
    flex: 1;
    min-width: 0;
    background: #0d131d;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 11px;
    font-weight: 600;
}

.cab-view-btn {
    border: 1px solid #334155;
    background: #1b2432;
    color: #cbd5e1;
    border-radius: 4px;
    padding: 4px 7px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}

.cab-view-btn.active {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff;
}

.cab-dev-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 6px;
}

.cab-dev-card {
    position: relative;
    background: #182232;
    border: 1px solid #2d3c52;
    border-radius: 6px;
    padding: 6px 5px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: grab;
    text-align: center;
    color: #e2e8f0;
    user-select: none;
    transition: border-color 0.12s ease, background 0.12s ease;
}

.cab-dev-card:hover {
    border-color: #38bdf8;
    background: #1f2d42;
}

.cab-dev-card.active {
    border-color: #38bdf8;
    background: #0c3554;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.45);
}

.cab-dev-fav {
    position: absolute;
    top: 2px;
    right: 3px;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 2px 3px;
}

.cab-dev-fav.is-fav {
    color: #fbbf24;
}

.cab-dev-svg {
    width: 46px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.cab-dev-title {
    font-size: 10.5px;
    font-weight: 700;
    line-height: 1.2;
    color: #f1f5f9;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cab-dev-spec {
    font-size: 9px;
    font-family: var(--font-mono);
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Tab 3: Library Filters & Accordion */
.cab-lib-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 6px;
}

.cab-lib-pill {
    border: 1px solid #334155;
    background: #141c28;
    color: #cbd5e1;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
}

.cab-lib-pill.active {
    background: #0284c7;
    border-color: #38bdf8;
    color: #ffffff;
}

.cab-lib-acc {
    border: 1px solid #263449;
    border-radius: 5px;
    margin-bottom: 6px;
    background: #0f1621;
    overflow: hidden;
}

.cab-lib-acc-btn {
    width: 100%;
    text-align: left;
    border: none;
    background: #172233;
    color: #93c5fd;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    cursor: pointer;
}

.cab-lib-acc-btn:hover {
    background: #1e2d44;
}

.cab-lib-acc-body {
    padding: 5px;
}

.cab-lib-acc.collapsed .cab-lib-acc-body {
    display: none;
}

.cab-lvl-badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 9.5px;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-right: 4px;
    background: #1e293b;
    color: #7dd3fc;
    border: 1px solid #334155;
}

/* Tab 4: Auto Generator */
.cab-auto-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cab-auto-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 11px;
    color: #cbd5e1;
}

.cab-auto-field label {
    font-weight: 700;
    color: #93c5fd;
}

.cab-auto-field select,
.cab-auto-field input {
    background: #0d131d;
    color: #f8fafc;
    border: 1px solid #334155;
    border-radius: 4px;
    padding: 5px 7px;
    font-size: 11.5px;
    font-weight: 600;
}

.cab-auto-check {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #e2e8f0;
    cursor: pointer;
}

.cab-auto-calc-card {
    background: #0c1420;
    border: 1px solid #263c58;
    border-radius: 6px;
    padding: 8px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: #cbd5e1;
    line-height: 1.45;
}

.cab-auto-calc-card strong {
    color: #38bdf8;
}

/* Floating Digital Multimeter Widget (VOM1 — IEC 61010-1 CAT III 600V) */
.cab-vom-float {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 210px;
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #e2e8f0;
    font-family: var(--font-mono);
    user-select: none;
}

.cab-vom-float[hidden] {
    display: none;
}

.cab-vom-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 8px;
    background: #141922;
    border: 1px solid #353e4e;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 800;
    color: #f8fafc;
    cursor: grab;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
}

.cab-vom-hdr:active {
    cursor: grabbing;
}

.cab-vom-hdr-title {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cab-vom-grip {
    color: #64748b;
    letter-spacing: -1px;
    font-size: 11px;
}

.cab-vom-hdr-actions {
    display: flex;
    gap: 3px;
}

.cab-vom-iconbtn {
    border: 1px solid #353e4e;
    background: #1f2733;
    color: #cbd5e1;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 9.5px;
    line-height: 1.25;
    cursor: pointer;
}

.cab-vom-iconbtn:hover {
    border-color: #38bdf8;
    color: #ffffff;
}

/* Outer protective rubber holster wrapping matte inner faceplate */
.cab-vom-chassis {
    background: #353a44;
    border: 1.5px solid #49505e;
    border-radius: 17px;
    padding: 7px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.cab-vom-face {
    background: #20242c;
    border: 1.5px solid #444b59;
    border-radius: 11px;
    padding: 9px 9px 7px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55);
}

.cab-vom-float.minimized .cab-vom-chassis,
.cab-vom-float.minimized .cab-vom-formula-card {
    display: none;
}

.cab-vom-lcd {
    background: #c7ceb6;
    color: #11161f;
    border: 3px solid #0e1117;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3), 0 0 0 1px #474f5e;
    border-radius: 7px;
    padding: 4px 7px 5px;
    transition: background 0.16s ease, box-shadow 0.16s ease;
}

.cab-vom-lcd.backlight {
    background: #a5e6ca;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.22), 0 0 14px rgba(52, 211, 153, 0.5);
}

.cab-vom-lcd.warn {
    background: #fca5a5;
}

.cab-vom-lcd.off {
    background: #777e6d;
    color: rgba(17, 22, 31, 0.22);
}

.cab-vom-lcd-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.35px;
    margin-bottom: 1px;
}

.cab-vom-lcd-val {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 3px;
    min-height: 36px;
}

.cab-vom-lcd-val strong.cab-vom-srval {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.cab-vom-7seg-svg {
    width: 128px;
    height: 36px;
    display: block;
    flex: 1;
}

.cab-vom-lcd-val span {
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    padding-bottom: 3px;
    font-family: Arial, sans-serif;
}

.cab-vom-bargraph {
    display: grid;
    grid-template-columns: repeat(28, minmax(0, 1fr));
    gap: 1.5px;
    margin-top: 3px;
    height: 6px;
}

.cab-vom-barseg {
    height: 100%;
    border-radius: 0.5px;
    background: rgba(17, 22, 31, 0.14);
}

.cab-vom-barseg.on {
    background: #141923;
}

.cab-vom-btns {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
}

.cab-vom-btn {
    border: 1px solid #485060;
    background: linear-gradient(180deg, #323742 0%, #262b35 100%);
    color: #e2e8f0;
    border-radius: 4px;
    padding: 3.5px 1px;
    font-size: 7.5px;
    font-weight: 700;
    font-family: Arial, sans-serif;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.65);
}

.cab-vom-btn:hover {
    border-color: #60a5fa;
}

.cab-vom-btn.active {
    background: linear-gradient(180deg, #0284c7 0%, #0369a1 100%);
    border-color: #38bdf8;
    color: #ffffff;
}

.cab-vom-btn.hold-on {
    background: linear-gradient(180deg, #d97706 0%, #b45309 100%);
    border-color: #fbbf24;
    color: #ffffff;
}

.cab-vom-dial-wrap {
    position: relative;
    width: 100%;
    height: 136px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1px 0;
}

.cab-vom-dial-svg {
    width: 174px;
    height: 136px;
    display: block;
    overflow: visible;
}

.cab-vom-dial-opt {
    cursor: pointer;
}

.cab-vom-dial-opt text {
    font-family: Arial, sans-serif;
    font-size: 9px;
    font-weight: 800;
    fill: #e2e8f0;
    transition: fill 0.12s ease;
}

.cab-vom-dial-opt.is-red text {
    fill: #ef4444;
}

.cab-vom-dial-opt.is-muted text {
    fill: #94a3b8;
}

.cab-vom-dial-opt.active text {
    fill: #facc15;
}

.cab-vom-dial-opt:hover text {
    fill: #38bdf8;
}

.cab-vom-jacks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 2px 6px 0;
}

.cab-vom-jack {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 8px;
    font-weight: 800;
    font-family: Arial, sans-serif;
    color: #e2e8f0;
    gap: 3px;
}

.cab-vom-jack-hole {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle, #06080c 42%, #1d222c 48%, #0a0d12 100%);
    border: 4.5px solid #dc2626;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.7);
    position: relative;
}

.cab-vom-jack.com .cab-vom-jack-hole {
    border-color: #2f3644;
}

.cab-vom-jack.plugged .cab-vom-jack-hole::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6.5px;
    height: 6.5px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #fca5a5, #ef4444);
    box-shadow: 0 0 5px rgba(239, 68, 68, 0.85);
}

.cab-vom-jack.com.plugged .cab-vom-jack-hole::after {
    background: radial-gradient(circle at 35% 35%, #cbd5e1, #475569);
    box-shadow: 0 0 4px rgba(148, 163, 184, 0.7);
}

.cab-vom-rating {
    text-align: center;
    font-size: 7px;
    font-weight: 700;
    font-family: Arial, sans-serif;
    color: #9ca3af;
    letter-spacing: 0.35px;
    padding-top: 2px;
}

.cab-vom-formula-card {
    background: rgba(11, 18, 32, 0.94);
    border: 1px solid #2563eb;
    border-radius: 8px;
    padding: 6px 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.65);
}

.cab-vom-formula {
    font-size: 9.5px;
    line-height: 1.38;
    color: #7dd3fc;
}

@media (max-width: 680px) {
    .cab-vom-float {
        width: 174px;
        top: 6px;
        right: 6px;
    }
    .cab-vom-face {
        padding: 7px 6px 6px;
        gap: 6px;
    }
    .cab-vom-7seg-svg {
        width: 102px;
        height: 29px;
    }
    .cab-vom-dial-wrap {
        height: 112px;
    }
    .cab-vom-dial-svg {
        width: 146px;
        height: 112px;
    }
    .cab-vom-jack-hole {
        width: 18px;
        height: 18px;
        border-width: 3.5px;
    }
}

/* ====== AUTOCAD DXF IMPORT VERIFICATION MODAL (KNOWN / LIKELY / UNKNOWN) ====== */
.dxf-review-modal[hidden] {
    display: none;
}

.dxf-review-modal {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.dxf-review-card {
    width: min(760px, 100%);
    max-height: 88vh;
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid #334155;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.72);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dxf-review-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-bottom: 1px solid #1e293b;
}

.dxf-review-head h3 {
    font-size: 1rem;
    color: #f8fafc;
}

.dxf-review-sub {
    margin: 4px 0 0;
    font-size: 0.8rem;
    color: #94a3b8;
}

.dxf-review-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
    background: #0b1220;
    border-bottom: 1px solid #1e293b;
}

.dxf-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.dxf-stat-known {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.dxf-stat-likely {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.38);
}

.dxf-stat-unknown {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.38);
}

.dxf-stat-info {
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.dxf-review-body {
    padding: 12px 16px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dxf-sec-box {
    border: 1px solid #1e293b;
    border-radius: 8px;
    background: #0b1220;
    padding: 10px 12px;
}

.dxf-sec-box h4 {
    margin: 0 0 8px;
    font-size: 0.86rem;
    color: #f1f5f9;
}

.dxf-item-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 0;
    border-top: 1px solid rgba(51, 65, 85, 0.45);
    font-size: 0.8rem;
}

.dxf-item-row:first-of-type {
    border-top: none;
    padding-top: 2px;
}

.dxf-item-meta {
    flex: 1 1 260px;
    color: #cbd5e1;
}

.dxf-item-meta code {
    color: #38bdf8;
    font-weight: 700;
}

.dxf-map-select {
    background: #0f172a;
    color: #f8fafc;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 0.78rem;
    max-width: 270px;
}

.dxf-review-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 16px;
    background: #0b1220;
    border-top: 1px solid #1e293b;
}

.dxf-backdrop-chk {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.8rem;
    color: #cbd5e1;
    cursor: pointer;
}

.dxf-foot-actions {
    display: flex;
    gap: 8px;
}

/* === 3rd Studio Pane (Live Oscilloscope + Cross-Ref + Quick Tools) === */
.cab-right-inspector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.cab-side-card {
    background: #121a28;
    border: 1px solid #28364b;
    border-radius: var(--radius);
    padding: 9px 10px;
    color: #e2e8f0;
}

.cab-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 6px;
}

.cab-studio-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.cab-side-hint {
    font-size: 10.5px;
    color: #64748b;
    font-weight: 500;
}

#cab-scope-canvas {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 5px;
    border: 1px solid #1e2d42;
    background: #060b14;
}

.cab-scope-kpis {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-top: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
}

.cab-scope-pill {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
}

.cab-scope-pill-ok {
    background: rgba(16, 185, 129, 0.18);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.35);
}

.cab-scope-pill-bad {
    background: rgba(239, 68, 68, 0.22);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.45);
}

.cab-scope-pill-idle {
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
}

.cab-xref-box {
    font-size: 11.5px;
    max-height: 176px;
    overflow-y: auto;
}

.cab-xref-empty {
    color: #94a3b8;
    font-size: 11.5px;
    line-height: 1.45;
    margin-bottom: 7px;
}

.cab-xref-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.cab-xref-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #0b111c;
    border: 1px solid #2c3a4f;
    color: #cbd5e1;
    border-radius: 4px;
    padding: 3px 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
}

.cab-xref-chip small {
    font-size: 9.5px;
    color: #64748b;
}

.cab-xref-chip:hover {
    border-color: #38bdf8;
    color: #f8fafc;
}

.cab-xref-chip.active {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.15);
    color: #4ade80;
}

.cab-xref-head {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 3px;
}

.cab-xref-head strong {
    font-family: var(--font-mono);
    color: #38bdf8;
    font-size: 12.5px;
}

.cab-xref-head span {
    color: #e2e8f0;
    font-size: 11.5px;
    font-weight: 600;
}

.cab-xref-sub {
    font-size: 11px;
    color: #94a3b8;
    margin-bottom: 5px;
}

.cab-xref-sub code {
    color: #fbbf24;
    font-family: var(--font-mono);
}

.cab-xref-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cab-xref-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    text-align: left;
    background: #0a101b;
    border: 1px solid #263348;
    border-radius: 4px;
    padding: 4px 6px;
    color: #cbd5e1;
    font-size: 11px;
    cursor: pointer;
}

.cab-xref-row:hover {
    border-color: #f59e0b;
}

.cab-xref-row.current {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
}

.cab-xref-role {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cab-xref-coord {
    font-family: var(--font-mono);
    font-size: 10px;
    color: #64748b;
}

.cab-xref-st {
    font-family: var(--font-mono);
    font-size: 9.5px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    background: #1e293b;
    color: #94a3b8;
}

.cab-xref-st.on {
    background: rgba(16, 185, 129, 0.2);
    color: #4ade80;
}

.cab-xref-st.trip {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.cab-side-btn-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
}

.cab-side-btn-grid .btn {
    background: #1a2434;
    border-color: #334358;
    color: #e2e8f0;
    font-size: 11px;
    padding: 5px 4px;
}

.cab-side-btn-grid .btn:hover:not(:disabled) {
    background: #253348;
    border-color: #4e6382;
}

.cab-quickstart-card {
    background: linear-gradient(180deg, rgba(14, 116, 144, 0.14) 0%, #111a28 100%);
    border-color: #1f4058;
}

.cab-qs-close {
    background: transparent;
    border: 1px solid #334155;
    color: #94a3b8;
    border-radius: 4px;
    width: 20px;
    height: 20px;
    line-height: 1;
    font-size: 11px;
    cursor: pointer;
    padding: 0;
}

.cab-qs-close:hover {
    color: #f8fafc;
    border-color: #64748b;
}

.cab-qs-list {
    margin: 0;
    padding-left: 16px;
    font-size: 11px;
    line-height: 1.5;
    color: #cbd5e1;
}

.cab-qs-list li + li {
    margin-top: 3px;
}

/* Dark Unified Engineering Package Panel (#cab-bom-wrap) */
.cab-bom-panel {
    background: #101826;
    border: 1px solid #2b384d;
    border-radius: var(--radius);
    padding: 14px;
    color: #e2e8f0;
}

.cab-bom-panel .btn {
    background: #1a2434;
    border-color: #34445a;
    color: #e2e8f0;
}

.cab-bom-panel .btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.cab-bom-panel select,
.cab-bom-panel input[type="text"] {
    background: #080d16;
    color: #f8fafc;
    border: 1px solid #36465d;
    border-radius: 5px;
    padding: 4px 8px;
}

.cab-bom-panel .table-wrap,
.cab-bom-panel .table-scroll {
    background: #0b111c;
    border: 1px solid #253348;
    border-radius: 6px;
}

.cab-sub-banner {
    background: #141f31;
    border: 1px solid #2a3a52;
    color: #e2e8f0;
}

.cab-ferrule-banner {
    background: rgba(6, 78, 59, 0.25);
    border: 1px solid rgba(52, 211, 153, 0.35);
    color: #d1fae5;
}

.cab-bom-panel .data-table {
    background: #0b111c;
    border-color: #253348;
    color: #e2e8f0;
    margin: 0;
}

.cab-bom-panel .data-table th {
    background: #162032;
    color: #f8fafc;
    border-bottom: 1px solid #2b384d;
    border-right: 1px solid #243044;
}

.cab-bom-panel .data-table td {
    background: transparent;
    color: #e2e8f0;
    border-bottom: 1px solid #1e293b;
    border-right: 1px solid #1e293b;
}

.cab-bom-panel .data-table tbody tr:nth-child(even) {
    background: rgba(30, 41, 59, 0.42);
}

.cab-bom-panel .data-table tbody tr:hover {
    background: rgba(56, 189, 248, 0.08);
}

.cab-bom-summary-card {
    padding: 9px 12px;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 6px;
    color: #e0f2fe;
}

.cab-phys-card {
    padding: 10px 12px;
    background: #0c1422;
    border: 1px solid #28374e;
    border-radius: 8px;
    color: #e2e8f0;
}

.cab-phys-explain-card {
    padding: 10px 12px;
    background: #0c1422;
    border: 1px solid #28374e;
    border-radius: 8px;
    color: #e2e8f0;
}

.cab-phys-card code,
.cab-phys-explain-card code {
    background: #172133;
    color: #38bdf8;
    padding: 1px 5px;
    border-radius: 4px;
}

/* DXF Vector Block Thumbnails in Review Modal */
.dxf-block-thumb {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 5px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #070d18;
    border: 1px solid #263449;
}

.dxf-block-thumb-svg {
    display: block;
    width: 44px;
    height: 44px;
}

.dxf-block-thumb-empty {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
}

/* === Multi-Sheet Bar (IEC 61082-1 Multi-Page CAD) === */
.cab-sheet-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 8px;
    background: #0d1421;
    border-bottom: 1px solid #243247;
}

.cab-sheet-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.cab-sheet-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #141e2e;
    border: 1px solid #2b3a50;
    color: #94a3b8;
    border-radius: 4px;
    padding: 4px 9px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
}

.cab-sheet-tab:hover {
    border-color: #38bdf8;
    color: #e2e8f0;
}

.cab-sheet-tab.active {
    background: rgba(14, 165, 233, 0.16);
    border-color: #38bdf8;
    color: #f8fafc;
}

.cab-sheet-tab .cab-sheet-cnt {
    font-family: var(--font-mono);
    font-size: 10px;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 0 4px;
    border-radius: 3px;
}

.cab-sheet-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.cab-sheet-act {
    background: #172234;
    border: 1px solid #304159;
    color: #cbd5e1;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.cab-sheet-act:hover {
    background: #223149;
    border-color: #4f6789;
    color: #ffffff;
}

.cab-sheet-demo-btn {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(52, 211, 153, 0.45);
    color: #4ade80;
}

.cab-sheet-demo-btn:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

/* === BOQ Commercial Pricing Controls & Totals === */
.cab-boq-config {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: #0d1522;
    border: 1px solid #26354c;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #cbd5e1;
}

.cab-boq-config label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
}

.cab-boq-config input[type="number"] {
    width: 62px;
    padding: 3px 6px;
    background: #070c14;
    color: #38bdf8;
    border: 1px solid #36465d;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-weight: 700;
    text-align: center;
}

.cab-boq-disclaimer {
    font-size: 11px;
    color: #94a3b8;
    font-style: italic;
}

#cab-bom-wrap .cab-boq-price-input {
    width: 96px;
    padding: 3px 6px;
    background: #070c14;
    color: #fbbf24;
    border: 1px solid #36475e;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-align: right;
}

.cab-boq-totals {
    margin-top: 10px;
    padding: 10px 14px;
    background: #0d1523;
    border: 1px solid #29384e;
    border-radius: 6px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 8px 14px;
    font-size: 12.5px;
}

.cab-boq-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cab-boq-stat span {
    font-size: 11px;
    color: #94a3b8;
}

.cab-boq-stat strong {
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: #f8fafc;
}

.cab-boq-stat.grand strong {
    font-size: 15px;
    color: #4ade80;
}

/* === Electrical AI Copilot & ML Diagnostics Drawer === */
.cab-ai-quick-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.cab-ai-input-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.cab-ai-input-row input[type="text"] {
    flex: 1 1 320px;
    padding: 7px 10px;
    font-size: 13px;
}

.cab-ai-output {
    background: #0a101b;
    border: 1px solid #243349;
    border-radius: 6px;
    padding: 12px;
    font-size: 12.5px;
    line-height: 1.6;
    color: #e2e8f0;
    min-height: 58px;
}

.cab-ai-output h4 {
    margin: 0 0 6px;
    color: #38bdf8;
    font-size: 13.5px;
}

.cab-ai-output code {
    background: #172133;
    color: #7dd3fc;
    padding: 1px 5px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

.cab-ml-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin: 8px 0;
}

.cab-ml-kpi {
    background: #101929;
    border: 1px solid #25344b;
    border-radius: 5px;
    padding: 7px 9px;
}

.cab-ml-kpi span {
    display: block;
    font-size: 10.5px;
    color: #94a3b8;
}

.cab-ml-kpi strong {
    font-family: var(--font-mono);
    font-size: 13px;
    color: #f8fafc;
}

@media (max-width: 720px) {
    .page-shell:has(#sec-cabinet.active) {
        padding: 10px 8px 40px;
    }

    #sec-cabinet > .card.cab-studio-card {
        padding: 10px;
    }

    .cab-right-inspector {
        grid-template-columns: minmax(0, 1fr);
    }
}
