:root {
    --bg: #070a0c;
    --panel: #0c1115;
    --panel-2: #10171c;
    --panel-3: #151d22;
    --line: #263139;
    --text: #f2f5f6;
    --muted: #8c9aa3;
    --green: #9bff00;
    --green-soft: rgba(155,255,0,.11);
    --green-line: rgba(155,255,0,.35);
    --danger: #ff6060;
    --shadow: 0 30px 80px rgba(0,0,0,.45);
    --radius: 12px;
}

* { box-sizing: border-box; }

html, body {
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
    background:
        radial-gradient(circle at 80% 15%, rgba(155,255,0,.035), transparent 26%),
        linear-gradient(135deg, #080b0e, #050708 65%);
}

a { color: inherit; text-decoration: none; }

button, input { font: inherit; }

code {
    color: var(--green);
    background: #080d10;
    border: 1px solid #1d292f;
    padding: .08rem .35rem;
    border-radius: 5px;
}

/* LOGIN */
.login-body {
    overflow: hidden;
    min-height: 100vh;
}

.login-backdrop {
    position: fixed;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(7,10,12,.98) 0%, rgba(7,10,12,.90) 48%, rgba(7,10,12,.70) 100%),
        repeating-linear-gradient(117deg, transparent 0 38px, rgba(155,255,0,.018) 39px 40px),
        radial-gradient(ellipse at 78% 50%, rgba(155,255,0,.10), transparent 32%);
}

.login-backdrop::after {
    content: "";
    position: absolute;
    right: -10vw;
    bottom: -20vh;
    width: 72vw;
    height: 70vh;
    opacity: .14;
    transform: skewX(-13deg);
    background:
        repeating-linear-gradient(0deg, transparent 0 26px, rgba(255,255,255,.12) 27px 28px),
        repeating-linear-gradient(90deg, transparent 0 88px, rgba(155,255,0,.16) 89px 91px);
    mask-image: linear-gradient(to top, black, transparent);
}

.login-wrap {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}

.login-card {
    width: min(460px, 100%);
    padding: 38px;
    background: rgba(10,15,18,.94);
    border: 1px solid #202b31;
    border-top: 3px solid var(--green);
    box-shadow: var(--shadow);
}

.setup-card { width: min(540px, 100%); }

.login-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 8px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 2px solid var(--green);
    color: var(--green);
    font-size: 22px;
    line-height: 1;
    box-shadow: inset 0 0 0 4px #0a1013;
}

.brand-mark.large {
    width: 64px;
    height: 64px;
    font-size: 34px;
}

.login-title {
    line-height: .85;
    letter-spacing: -.04em;
    font-weight: 900;
    font-stretch: condensed;
}

.login-title span {
    display: block;
    color: var(--green);
    font-size: 34px;
}

.login-title strong {
    display: block;
    margin-top: 6px;
    font-size: 28px;
}

.login-kicker, .eyebrow {
    margin: 22px 0 30px;
    color: var(--muted);
    letter-spacing: .18em;
    font-size: 11px;
    font-weight: 800;
}

.setup-copy {
    margin: -12px 0 24px;
    color: #b8c3c9;
    line-height: 1.55;
    font-size: 14px;
}

.login-form {
    display: grid;
    gap: 18px;
}

.login-form label > span {
    display: block;
    margin-bottom: 8px;
    color: #aebbc2;
    font-size: 11px;
    letter-spacing: .13em;
    font-weight: 800;
}

input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    color: var(--text);
    background: #080c0f;
    border: 1px solid #2a353c;
    outline: none;
    transition: border-color .16s, box-shadow .16s;
}

input:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(155,255,0,.08);
}

.password-row {
    display: flex;
}

.password-row input { border-right: 0; }

.password-toggle {
    width: 72px;
    color: var(--green);
    background: #10171b;
    border: 1px solid #2a353c;
    cursor: pointer;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
}

.btn {
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .11em;
}

.btn-primary {
    color: #071000;
    background: var(--green);
}

.btn-primary:hover { filter: brightness(.92); }

.btn-wide { width: 100%; min-height: 52px; margin-top: 8px; }

.alert {
    padding: 12px 14px;
    margin: 0 0 18px;
    border: 1px solid;
    font-size: 13px;
}

.alert-error {
    color: #ffaaaa;
    background: rgba(255,96,96,.08);
    border-color: rgba(255,96,96,.36);
}

.login-footer {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
    color: #68757c;
    font-size: 11px;
}

.separator { color: var(--green); }

/* APP */
.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px 18px;
    background: #080c0f;
    border-right: 1px solid #1d282e;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px 26px;
}

.brand > span:last-child {
    display: flex;
    flex-direction: column;
    line-height: .9;
    letter-spacing: -.02em;
}

.brand strong { color: var(--green); font-size: 22px; }
.brand em { margin-top: 4px; font-style: normal; font-weight: 900; font-size: 15px; }

.nav {
    display: grid;
    gap: 5px;
    margin-top: 14px;
}

.nav a {
    padding: 12px 13px;
    color: #aab6bd;
    border-left: 2px solid transparent;
    font-size: 13px;
    font-weight: 700;
}

.nav a:hover {
    color: white;
    background: #0e1519;
    border-left-color: var(--green);
}

.sidebar-user {
    margin-top: auto;
    display: grid;
    padding: 16px 12px 2px;
    border-top: 1px solid #1d282e;
}

.sidebar-user span { font-weight: 800; font-size: 13px; }
.sidebar-user small { color: var(--muted); margin: 3px 0 10px; }
.sidebar-user a { color: var(--green); font-size: 11px; font-weight: 800; }

.main {
    min-width: 0;
    padding: 28px 34px 50px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 30px;
}

.topbar .eyebrow { display: block; margin: 0 0 5px; color: var(--green); }
.topbar h1 { margin: 0; font-size: clamp(28px, 4vw, 44px); letter-spacing: -.04em; }

.system-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #91a0a8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .06em;
}

.status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 14px rgba(155,255,0,.55);
}

.hero-search {
    margin-bottom: 28px;
    padding: 20px;
    border: 1px solid #223038;
    background: linear-gradient(135deg, rgba(155,255,0,.05), rgba(10,15,18,.4));
}

.hero-search.compact { margin-bottom: 20px; }

.hero-search form {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    gap: 0;
}

.hero-search input {
    min-height: 54px;
    border-left: 0;
}

.hero-search .btn { min-height: 54px; }

.search-icon {
    height: 54px;
    display: grid;
    place-items: center;
    color: var(--green);
    background: #080c0f;
    border: 1px solid #2a353c;
    border-right: 0;
    font-size: 23px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.stat-card {
    padding: 16px;
    background: var(--panel);
    border: 1px solid #202b31;
}

.stat-card span { color: var(--muted); font-size: 11px; font-weight: 800; }
.stat-card strong { display: block; margin-top: 8px; font-size: 27px; }
.stat-card:hover { border-color: var(--green-line); }

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.module-card {
    min-height: 155px;
    display: grid;
    grid-template-columns: 58px 1fr;
    gap: 18px;
    padding: 22px;
    background: var(--panel);
    border: 1px solid #202b31;
    transition: transform .15s, border-color .15s, background .15s;
}

.module-card:hover {
    transform: translateY(-2px);
    border-color: var(--green-line);
    background: #0f161a;
}

.module-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    color: var(--green);
    background: var(--green-soft);
    border: 1px solid var(--green-line);
    font-size: 25px;
    font-weight: 900;
}

.module-tag {
    color: var(--green);
    letter-spacing: .15em;
    font-size: 9px;
    font-weight: 900;
}

.module-card h2 { margin: 5px 0 7px; font-size: 21px; }
.module-card p { margin: 0; color: var(--muted); line-height: 1.5; font-size: 13px; }

.empty-state {
    padding: 34px;
    text-align: center;
    background: var(--panel);
    border: 1px dashed #2b373e;
}

.empty-state strong { font-size: 20px; }
.empty-state p { margin: 8px auto 0; max-width: 620px; color: var(--muted); line-height: 1.55; }

.page-intro {
    padding: 24px;
    margin-bottom: 16px;
    background: var(--panel);
    border-left: 3px solid var(--green);
}

.page-intro .eyebrow { margin: 0 0 8px; color: var(--green); }
.page-intro h2 { margin: 0 0 6px; }
.page-intro p { margin: 0; color: var(--muted); }

.table-card {
    overflow: hidden;
    background: var(--panel);
    border: 1px solid #202b31;
}

.agw-table {
    width: 100%;
    border-collapse: collapse;
}

.agw-table th,
.agw-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #1d282e;
}

.agw-table th {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .13em;
}

.agw-table td { font-size: 13px; }
.agw-table td small { display: block; margin-top: 3px; color: var(--muted); }

.badge {
    display: inline-block;
    padding: 4px 7px;
    border: 1px solid;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .11em;
}

.badge-ok { color: var(--green); border-color: var(--green-line); background: var(--green-soft); }
.badge-muted { color: #7c8a92; border-color: #344047; }

.result-list {
    display: grid;
    gap: 8px;
}

.result-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 18px;
    padding: 16px 18px;
    background: var(--panel);
    border: 1px solid #202b31;
}

.result-type {
    color: var(--green);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
}

.result-row h3 { margin: 0 0 5px; font-size: 16px; }
.result-row p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

@media (max-width: 1050px) {
    .stat-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 780px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: static;
        height: auto;
        flex-direction: row;
        align-items: center;
        overflow-x: auto;
        padding: 12px;
    }
    .brand { padding: 0 12px 0 0; min-width: 150px; }
    .nav { display: flex; margin: 0; }
    .nav a { white-space: nowrap; }
    .sidebar-user { display: none; }
    .main { padding: 22px 16px 40px; }
    .module-grid { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
    .login-card { padding: 28px 22px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-search form { grid-template-columns: 34px 1fr; }
    .hero-search .btn { grid-column: 1 / -1; margin-top: 8px; }
}

/* MACHINE LOOKUP */
select {
    width: 100%;
    min-height: 50px;
    padding: 0 42px 0 14px;
    color: var(--text);
    background: #080c0f;
    border: 1px solid #2a353c;
    outline: none;
    font: inherit;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--green) 50%),
        linear-gradient(135deg, var(--green) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 21px,
        calc(100% - 12px) 21px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(155,255,0,.08);
}

.machine-intro {
    margin-bottom: 14px;
}

.machine-lookup-card {
    padding: 22px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, rgba(155,255,0,.055), rgba(10,15,18,.78));
    border: 1px solid #26343b;
}

.machine-lookup-form {
    display: grid;
    grid-template-columns: minmax(180px, .55fr) minmax(280px, 1.45fr) auto;
    align-items: end;
    gap: 12px;
}

.lookup-field > span {
    display: block;
    margin-bottom: 8px;
    color: #aebbc2;
    font-size: 10px;
    letter-spacing: .14em;
    font-weight: 900;
}

.lookup-field input,
.lookup-field select,
.machine-lookup-button {
    min-height: 52px;
}

.pin-field input {
    text-transform: uppercase;
    letter-spacing: .06em;
    font-weight: 750;
}

.machine-lookup-button {
    min-width: 132px;
}

.machine-alert {
    margin-top: 0;
}

.machine-found-card,
.machine-not-found-card,
.machine-lookup-empty {
    background: var(--panel);
    border: 1px solid #202b31;
}

.machine-found-card {
    overflow: hidden;
    border-top: 3px solid var(--green);
}

.machine-found-heading {
    display: grid;
    grid-template-columns: 54px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 24px;
    border-bottom: 1px solid #1d282e;
}

.machine-found-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    color: #081000;
    background: var(--green);
    font-size: 28px;
    font-weight: 1000;
}

.machine-found-label {
    color: var(--green);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .16em;
}

.machine-found-heading h3,
.machine-not-found-card h3,
.machine-lookup-empty h3 {
    margin: 5px 0 0;
    font-size: clamp(24px, 4vw, 38px);
    letter-spacing: -.035em;
}

.machine-found-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    background: #1d282e;
}

.machine-found-details > div {
    min-width: 0;
    padding: 18px 22px;
    background: #0b1114;
}

.machine-found-details span {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: .12em;
    font-weight: 900;
}

.machine-found-details strong {
    display: block;
    overflow-wrap: anywhere;
    font-size: 15px;
}

.machine-match-note {
    padding: 14px 22px 0;
    color: #c6d0d5;
    font-size: 12px;
    line-height: 1.55;
}

.machine-alternates {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 12px 22px 18px;
}

.machine-alternates span {
    padding: 6px 9px;
    color: #c7d2d7;
    background: #11191d;
    border: 1px solid #2b373e;
    font-size: 11px;
    font-weight: 800;
}

.machine-next-stage {
    padding: 18px 22px;
    background: rgba(155,255,0,.045);
    border-top: 1px solid rgba(155,255,0,.15);
}

.machine-next-stage span {
    color: var(--green);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .14em;
}

.machine-next-stage p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.machine-not-found-card,
.machine-lookup-empty {
    padding: 28px;
}

.machine-not-found-card {
    border-left: 3px solid var(--danger);
}

.machine-not-found-card .machine-found-label {
    color: #ff8e8e;
}

.machine-not-found-card p,
.machine-lookup-empty p {
    max-width: 680px;
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: 13px;
}

@media (max-width: 900px) {
    .machine-lookup-form {
        grid-template-columns: 1fr 1.5fr;
    }
    .machine-lookup-button {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 620px) {
    .machine-lookup-form {
        grid-template-columns: 1fr;
    }
    .machine-lookup-button {
        grid-column: auto;
    }
    .machine-found-heading {
        grid-template-columns: 48px 1fr;
    }
    .machine-found-heading .badge {
        grid-column: 2;
        justify-self: start;
    }
    .machine-found-icon {
        width: 48px;
        height: 48px;
    }
    .machine-found-details {
        grid-template-columns: 1fr;
    }
}

/* MACHINE CONTEXT + RELATIONSHIP WORKSPACE */
.active-machine-bar {
    display: grid;
    grid-template-columns: auto minmax(190px, 1.3fr) repeat(3, minmax(120px, .7fr)) auto;
    gap: 1px;
    margin: 0 0 22px;
    background: #233038;
    border: 1px solid #2d3a42;
    border-left: 3px solid var(--green);
    overflow: hidden;
}
.active-machine-bar > * {
    min-width: 0;
    background: #0b1114;
}
.active-machine-source,
.active-machine-change {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 15px;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .12em;
}
.active-machine-primary,
.active-machine-meta { padding: 10px 14px; }
.active-machine-primary span,
.active-machine-meta span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .13em;
}
.active-machine-primary strong {
    color: var(--text);
    font-size: 14px;
}
.active-machine-meta strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #cdd6da;
    font-size: 11px;
}
.active-machine-change {
    color: var(--green);
    transition: background .15s ease;
}
.active-machine-change:hover { background: var(--green-soft); }

.machine-lookup-card-compact { border-color: #1f2a30; }
.machine-ambiguous-card { border-top-color: #ffd266; }
.machine-ambiguous-card .machine-found-icon { background: #ffd266; }
.machine-ambiguous-card .machine-found-label { color: #ffd266; }

.machine-hero-card {
    display: grid;
    grid-template-columns: minmax(260px, 1.1fr) minmax(420px, 1.9fr);
    margin: 0 0 14px;
    background: linear-gradient(120deg, rgba(155,255,0,.075), #0b1114 42%);
    border: 1px solid #2c3a40;
    border-top: 3px solid var(--green);
}
.machine-hero-main {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 25px;
    border-right: 1px solid #263139;
}
.machine-source-badge {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #071000;
    background: var(--green);
    font-size: 14px;
    font-weight: 1000;
    letter-spacing: .08em;
}
.machine-hero-main h3 {
    margin: 5px 0 4px;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: -.045em;
}
.machine-hero-main p {
    max-width: 580px;
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}
.machine-identity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: #263139;
}
.machine-identity-grid > div {
    min-width: 0;
    padding: 17px 19px;
    background: #0b1114;
}
.machine-identity-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .13em;
}
.machine-identity-grid strong {
    overflow-wrap: anywhere;
    font-size: 12px;
}

.machine-scope-search {
    display: grid;
    grid-template-columns: minmax(280px, .9fr) minmax(430px, 1.5fr);
    gap: 24px;
    align-items: center;
    padding: 20px 22px;
    margin-bottom: 24px;
    background: #0d1418;
    border: 1px solid #263139;
}
.machine-scope-search h3 {
    margin: 5px 0 5px;
    font-size: 18px;
}
.machine-scope-search p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}
.machine-scope-search form {
    display: grid;
    grid-template-columns: 38px minmax(0,1fr) auto;
    align-items: center;
    background: #070b0e;
    border: 1px solid #2b373e;
}
.machine-scope-search form:focus-within { border-color: var(--green); }
.machine-scope-search .search-icon { text-align: center; color: var(--green); font-size: 20px; }
.machine-scope-search input {
    width: 100%;
    min-height: 50px;
    padding: 0 10px;
    color: var(--text);
    background: transparent;
    border: 0;
    outline: 0;
}
.machine-scope-search .btn { min-height: 50px; border-radius: 0; }

.relationship-section {
    padding: 22px;
    margin-bottom: 14px;
    background: #090e11;
    border: 1px solid #222d33;
}
.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}
.section-heading h2 {
    margin: 5px 0 0;
    font-size: clamp(20px, 3vw, 29px);
    letter-spacing: -.03em;
}
.relationship-source-note {
    padding: 7px 9px;
    color: var(--green);
    background: var(--green-soft);
    border: 1px solid var(--green-line);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .1em;
    white-space: nowrap;
}
.relationship-map {
    display: grid;
    grid-template-columns: 210px 42px minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
}
.relationship-node {
    min-height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #0f171b;
    border: 1px solid #324149;
}
.relationship-node-machine {
    box-shadow: inset 3px 0 0 var(--green);
}
.relationship-node strong {
    margin: 7px 0 4px;
    font-size: 22px;
    line-height: 1.05;
}
.relationship-node small { color: var(--muted); }
.relationship-kicker {
    color: var(--green);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .14em;
}
.relationship-arrow {
    display: grid;
    place-items: center;
    color: var(--green);
    font-size: 30px;
    font-weight: 300;
}
.relationship-domain-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 10px;
}
.relationship-domain {
    min-width: 0;
    padding: 17px;
    background: #0c1216;
    border: 1px solid #263239;
}
.relationship-domain-electrical { border-color: rgba(155,255,0,.35); }
.relationship-domain-workshop { border-color: #33434b; }
.relationship-domain-head {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 13px;
}
.domain-icon {
    width: 37px;
    height: 37px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--green);
    background: #111a1f;
    border: 1px solid #344149;
    font-weight: 950;
}
.relationship-domain-head span:not(.domain-icon) {
    color: var(--muted);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .12em;
}
.relationship-domain h3 {
    margin: 2px 0 0;
    font-size: 17px;
}
.relationship-chain {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}
.relationship-chain span {
    padding: 5px 7px;
    color: #d8e0e4;
    background: #11191d;
    border: 1px solid #2a373e;
    font-size: 9px;
    font-weight: 800;
}
.relationship-chain b { color: var(--green); font-size: 12px; }
.relationship-domain p {
    margin: 0 0 13px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}
.relationship-evidence {
    padding-top: 10px;
    color: #64757f;
    border-top: 1px solid #1e292f;
    font-size: 8px;
    line-height: 1.4;
    letter-spacing: .05em;
}

.machine-entry-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.machine-entry-card {
    padding: 20px;
    background: var(--panel);
    border: 1px solid #253138;
}
.machine-entry-primary { border-top: 2px solid var(--green); }
.entry-type {
    color: var(--green);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .13em;
}
.machine-entry-card h3 { margin: 6px 0 8px; font-size: 18px; }
.machine-entry-card p { min-height: 50px; margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.entry-links { display: flex; flex-wrap: wrap; gap: 5px; }
.entry-links span {
    padding: 5px 7px;
    color: #a8b5bc;
    background: #10171b;
    border: 1px solid #27343a;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .05em;
}
.clear-machine-form { display: flex; justify-content: flex-end; }
.btn-muted {
    padding: 10px 13px;
    color: #aab6bc;
    background: #0b1114;
    border: 1px solid #2a353c;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .08em;
}
.btn-muted:hover { border-color: #495961; color: var(--text); }

@media (max-width: 1180px) {
    .active-machine-bar { grid-template-columns: auto 1fr repeat(2, minmax(110px,.6fr)) auto; }
    .active-machine-meta:nth-of-type(5) { display: none; }
    .machine-hero-card { grid-template-columns: 1fr; }
    .machine-hero-main { border-right: 0; border-bottom: 1px solid #263139; }
}
@media (max-width: 980px) {
    .active-machine-bar { grid-template-columns: auto 1fr auto; }
    .active-machine-meta { display: none; }
    .relationship-map { grid-template-columns: 1fr; }
    .relationship-arrow { transform: rotate(90deg); min-height: 30px; }
    .machine-entry-grid { grid-template-columns: 1fr; }
    .machine-scope-search { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .relationship-domain-grid { grid-template-columns: 1fr; }
    .machine-identity-grid { grid-template-columns: 1fr; }
    .active-machine-source { display: none; }
    .active-machine-bar { grid-template-columns: 1fr auto; }
    .machine-scope-search form { grid-template-columns: 36px 1fr; }
    .machine-scope-search .btn { grid-column: 1 / -1; }
}

.search-scope-panel {
    display: grid;
    grid-template-columns: minmax(220px,.7fr) minmax(340px,1.7fr);
    gap: 22px;
    align-items: center;
    padding: 15px 18px;
    margin-bottom: 10px;
    background: rgba(155,255,0,.045);
    border: 1px solid rgba(155,255,0,.20);
}
.search-scope-panel strong,
.search-scope-panel small { display: block; }
.search-scope-panel strong { margin-top: 4px; font-size: 17px; }
.search-scope-panel small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.search-scope-panel p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
@media (max-width: 720px) { .search-scope-panel { grid-template-columns: 1fr; gap: 8px; } }

/* eTIM-STYLE ELECTRICAL BROWSER — deliberately dense/technical rather than card-heavy */
.etim-browser-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin: -2px 0 10px;
    padding: 0 2px;
}
.etim-browser-head h2 {
    margin: 3px 0 0;
    font-size: 20px;
    letter-spacing: -.02em;
}
.etim-kicker {
    color: var(--green);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .13em;
}
.etim-source-state {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #9cabb3;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .1em;
    white-space: nowrap;
}
.etim-toolbar {
    display: grid;
    grid-template-columns: minmax(480px, 1fr) minmax(260px, 390px);
    gap: 10px;
    align-items: stretch;
    margin-bottom: 8px;
}
.etim-tabs {
    display: flex;
    min-width: 0;
    background: #090d10;
    border: 1px solid #2a353b;
}
.etim-tabs a {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 15px;
    color: #aeb9bf;
    border-right: 1px solid #2a353b;
    font-size: 11px;
    font-weight: 850;
}
.etim-tabs a:last-child { border-right: 0; }
.etim-tabs a:hover { color: white; background: #11181c; }
.etim-tabs a.active {
    color: #071000;
    background: var(--green);
}
.etim-tabs b {
    min-width: 24px;
    padding: 2px 5px;
    text-align: center;
    color: inherit;
    background: rgba(0,0,0,.18);
    font-size: 9px;
}
.etim-filter-form {
    display: grid;
    grid-template-columns: 34px 1fr auto;
    align-items: center;
    background: #090d10;
    border: 1px solid #2a353b;
}
.etim-filter-form > span {
    text-align: center;
    color: var(--green);
    font-size: 18px;
}
.etim-filter-form input {
    min-height: 39px;
    padding: 0 7px;
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: 11px;
}
.etim-filter-form a {
    padding: 0 10px;
    color: var(--green);
    font-size: 9px;
    font-weight: 900;
}
.etim-workspace {
    min-height: 630px;
    display: grid;
    grid-template-columns: minmax(500px, .94fr) minmax(500px, 1.06fr);
    background: #070b0d;
    border: 1px solid #2b373e;
}
.etim-list-pane {
    min-width: 0;
    border-right: 1px solid #2b373e;
}
.etim-pane-title {
    height: 37px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    color: #d7dfe3;
    background: #11181c;
    border-bottom: 1px solid #303c43;
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .11em;
}
.etim-pane-title small {
    color: #829199;
    font-size: 9px;
    letter-spacing: 0;
}
.etim-grid-head,
.etim-grid-row {
    display: grid;
    align-items: center;
}
.etim-sheet-cols { grid-template-columns: 56px minmax(260px, 1fr) 98px; }
.etim-entity-cols { grid-template-columns: 92px minmax(270px, 1fr) 52px; }
.etim-grid-head {
    min-height: 29px;
    color: #84929a;
    background: #0b1114;
    border-bottom: 1px solid #263139;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.etim-grid-head > span { padding: 0 9px; }
.etim-grid-head > span + span { border-left: 1px solid #202a30; }
.etim-grid-body {
    max-height: 68vh;
    min-height: 560px;
    overflow: auto;
    scrollbar-color: #3a474e #0a0f12;
}
.etim-grid-row {
    min-height: 45px;
    color: #cdd6db;
    background: #090e11;
    border-bottom: 1px solid #1a2429;
    font-size: 10px;
}
.etim-grid-row:nth-child(even) { background: #0b1114; }
.etim-grid-row:hover { background: #131c20; }
.etim-grid-row.selected {
    color: white;
    background: rgba(155,255,0,.085);
    box-shadow: inset 3px 0 0 var(--green);
}
.etim-grid-row > * {
    min-width: 0;
    padding: 7px 9px;
}
.etim-grid-row > * + * { border-left: 1px solid #1d282e; }
.etim-grid-row > strong {
    color: var(--green);
    font-size: 11px;
    font-weight: 950;
}
.etim-grid-row span b {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #e2e8eb;
    font-size: 10px;
    font-weight: 750;
}
.etim-grid-row span small {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    color: #738188;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 8px;
}
.etim-grid-row code {
    overflow: hidden;
    color: #94a2a9;
    background: transparent;
    border: 0;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 9px;
}
.etim-use-count {
    display: block;
    text-align: center;
    color: #a6b2b8;
    font-weight: 850;
}
.etim-list-empty,
.etim-detail-empty {
    padding: 28px;
    color: #718088;
    font-size: 11px;
}
.etim-detail-pane {
    min-width: 0;
    background: #0b1013;
}
.etim-detail-head {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 17px;
    background: #10171b;
    border-bottom: 1px solid #303c43;
    border-top: 2px solid var(--green);
}
.etim-detail-head span {
    color: var(--green);
    font-size: 8px;
    font-weight: 950;
    letter-spacing: .13em;
}
.etim-detail-head h3 {
    max-width: 720px;
    margin: 4px 0 0;
    font-size: 16px;
    line-height: 1.25;
}
.etim-detail-head > strong {
    flex: 0 0 auto;
    padding: 6px 8px;
    color: #99a6ad;
    background: #090e11;
    border: 1px solid #2b373e;
    font-size: 8px;
    letter-spacing: .07em;
}
.etim-description {
    padding: 15px 17px;
    color: #e2e8eb;
    border-bottom: 1px solid #253037;
    font-size: 13px;
    font-weight: 750;
}
.etim-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    margin: 0;
    background: #253037;
    gap: 1px;
    border-bottom: 1px solid #253037;
}
.etim-meta-grid > div {
    min-width: 0;
    padding: 10px 13px;
    background: #0b1114;
}
.etim-meta-grid dt {
    margin-bottom: 4px;
    color: #75838b;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.etim-meta-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: #d5dde1;
    font-size: 10px;
    line-height: 1.4;
}
.etim-rel-section { border-bottom: 1px solid #253037; }
.etim-rel-title {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 13px;
    color: #9caab1;
    background: #0e1518;
    border-bottom: 1px solid #222d33;
    font-size: 8px;
    font-weight: 950;
    letter-spacing: .1em;
}
.etim-rel-title b {
    padding: 2px 6px;
    color: var(--green);
    background: #081005;
    border: 1px solid rgba(155,255,0,.22);
    font-size: 8px;
}
.etim-chip-list,
.etim-related-sheets {
    max-height: 230px;
    overflow: auto;
    padding: 6px;
}
.etim-chip-list a {
    display: grid;
    grid-template-columns: 78px 1fr;
    gap: 8px;
    padding: 8px 9px;
    border-bottom: 1px solid #1d282e;
    font-size: 9px;
}
.etim-chip-list a:hover,
.etim-related-sheets a:hover { background: #121a1e; }
.etim-chip-list a strong { color: var(--green); }
.etim-chip-list a span {
    overflow: hidden;
    color: #bbc6cb;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.etim-related-sheets a {
    display: grid;
    grid-template-columns: 72px 1fr 80px;
    gap: 8px;
    align-items: center;
    padding: 8px 9px;
    border-bottom: 1px solid #1d282e;
    font-size: 9px;
}
.etim-related-sheets strong { color: var(--green); }
.etim-related-sheets span {
    overflow: hidden;
    color: #bbc6cb;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.etim-related-sheets code {
    overflow: hidden;
    color: #76858d;
    background: none;
    border: 0;
    text-overflow: ellipsis;
}
.etim-chip-list em,
.etim-related-sheets em {
    display: block;
    padding: 10px;
    color: #718087;
    font-size: 9px;
    font-style: normal;
}
.etim-iu-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 9px;
    max-height: 120px;
    overflow: auto;
}
.etim-iu-list code {
    color: #aab6bc;
    background: #080d10;
    border-color: #263139;
    font-size: 8px;
}
.etim-footnote {
    padding: 8px 10px;
    color: #65737b;
    background: #080c0f;
    border: 1px solid #202a30;
    border-top: 0;
    font-size: 8px;
    letter-spacing: .04em;
}
.etim-footnote span { color: #8b999f; }
.etim-footnote strong { color: #9eabb1; }
.etim-no-machine {
    padding: 30px;
    background: #0b1114;
    border: 1px solid #263139;
    border-top: 3px solid var(--green);
}
.etim-no-machine > span {
    color: var(--green);
    font-size: 9px;
    font-weight: 950;
    letter-spacing: .13em;
}
.etim-no-machine h2 { margin: 6px 0; }
.etim-no-machine p { max-width: 650px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.etim-inline-button { display: inline-flex; align-items: center; margin-top: 8px; }

@media (max-width: 1180px) {
    .etim-toolbar { grid-template-columns: 1fr; }
    .etim-workspace { grid-template-columns: minmax(390px,.9fr) minmax(430px,1.1fr); }
}
@media (max-width: 900px) {
    .etim-workspace { grid-template-columns: 1fr; }
    .etim-list-pane { border-right: 0; border-bottom: 1px solid #2b373e; }
    .etim-grid-body { min-height: 320px; max-height: 45vh; }
    .etim-tabs { overflow-x: auto; }
    .etim-tabs a { white-space: nowrap; }
}
@media (max-width: 620px) {
    .etim-browser-head { align-items: flex-start; flex-direction: column; }
    .etim-sheet-cols { grid-template-columns: 45px minmax(200px,1fr); }
    .etim-sheet-cols > :last-child { display: none; }
    .etim-entity-cols { grid-template-columns: 76px minmax(190px,1fr) 42px; }
    .etim-meta-grid { grid-template-columns: 1fr; }
    .etim-related-sheets a { grid-template-columns: 65px 1fr; }
    .etim-related-sheets code { display: none; }
}

/* --------------------------------------------------------------------------
   eTIM-style electrical workspace v1.5
   First-step shell only: accordion navigation + multi-sheet viewer.
   -------------------------------------------------------------------------- */
.etim15-shell {
    position: relative;
    height: max(650px, calc(100vh - 235px));
    min-height: 650px;
    display: grid;
    grid-template-columns: 405px minmax(0, 1fr);
    overflow: hidden;
    background: #eef0f2;
    border: 1px solid #303a40;
    box-shadow: 0 18px 60px rgba(0,0,0,.28);
    transition: grid-template-columns .18s ease;
}

.etim15-nav {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #20252a;
    background: #f7f7f7;
    border-right: 1px solid #b9bdc1;
}

.etim15-machine {
    flex: 0 0 auto;
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    background: #fff;
    border-bottom: 1px solid #d5d7d9;
    font-size: 15px;
}

.etim15-machine-icon {
    width: 35px;
    height: 28px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #922337;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .05em;
}

.etim15-machine strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.etim15-search {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr 42px;
    margin: 5px 5px 6px;
    background: #fff;
    border: 1px solid #c9cccf;
}

.etim15-search input {
    min-height: 36px;
    padding: 0 10px;
    color: #222;
    background: #fff;
    border: 0;
    box-shadow: none;
    font-size: 14px;
}

.etim15-search input:focus { box-shadow: inset 0 0 0 1px #2b66ac; }
.etim15-search > span {
    display: grid;
    place-items: center;
    color: #111;
    border-left: 1px solid #c9cccf;
    font-size: 22px;
    font-weight: 700;
}

.etim15-accordions {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0 5px 5px;
}

.etim15-section {
    flex: 0 0 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #f1f1f1;
    border: 1px solid #d1d3d5;
    border-radius: 2px;
    overflow: hidden;
}

.etim15-section.is-open { flex: 1 1 auto; }

.etim15-section-head {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 10px;
    color: #20252a;
    background: linear-gradient(#fafafa, #efefef);
    border: 0;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
    font-weight: 400;
}

.etim15-section-head:hover { background: #e8ebed; }
.etim15-chevron { color: #5e6469; transition: transform .15s ease; }
.etim15-section.is-open .etim15-chevron { transform: rotate(180deg); }

.etim15-section-body {
    min-height: 0;
    flex: 1;
    display: none;
    overflow: hidden;
    background: #fff;
    border-top: 1px solid #d4d6d8;
}
.etim15-section.is-open .etim15-section-body { display: block; }

.etim15-list {
    height: 100%;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: #8c8f92 #e7e7e7;
}

.etim15-list-row {
    width: 100%;
    min-height: 29px;
    display: grid;
    align-items: start;
    gap: 7px;
    padding: 5px 8px;
    color: #20252a;
    background: #fff;
    border: 0;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.25;
}

.etim15-list-row:hover { background: #eef4fb; }
.etim15-list-row.is-active { color: #034bbb; background: #eef4fb; }
.etim15-list-row[hidden] { display: none !important; }

.etim15-sheet-row { grid-template-columns: 24px minmax(0, 1fr); }
.etim15-plus {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    margin-top: -1px;
    color: #174f84;
    background: #fff;
    border: 1px solid #3974a9;
    border-radius: 5px;
    font-size: 18px;
    line-height: 1;
}

.etim15-entity-row { grid-template-columns: 88px minmax(0, 1fr); }
.etim15-entity-row strong { color: #153f6a; font-weight: 600; }
.etim15-list-empty { padding: 14px 10px; color: #777; font-size: 13px; }

.etim15-nav-handle {
    position: absolute;
    z-index: 20;
    top: 0;
    left: 392px;
    width: 31px;
    height: 108px;
    display: grid;
    place-items: center;
    color: #fff;
    background: #ad1732;
    border: 1px solid #7d0f23;
    border-top: 0;
    border-radius: 0 0 10px 0;
    cursor: pointer;
    font-size: 34px;
    line-height: 1;
    transition: left .18s ease, transform .18s ease;
}

.etim15-shell.is-nav-collapsed { grid-template-columns: 0 minmax(0, 1fr); }
.etim15-shell.is-nav-collapsed .etim15-nav { visibility: hidden; }
.etim15-shell.is-nav-collapsed .etim15-nav-handle { left: 0; transform: rotate(180deg); border-radius: 10px 0 0 0; }

.etim15-main {
    min-width: 0;
    min-height: 0;
    display: grid;
    grid-template-rows: 43px 35px minmax(0, 1fr);
    overflow: hidden;
    background: #fff;
}

.etim15-tabs {
    min-width: 0;
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    padding-left: 33px;
    background: #fff;
    border-bottom: 1px solid #d3d6d8;
    scrollbar-width: thin;
}

.etim15-tabs-empty {
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: #8a8f94;
    font-size: 13px;
}

.etim15-tab {
    flex: 0 0 auto;
    min-width: 230px;
    max-width: 620px;
    display: grid;
    grid-template-columns: minmax(0,1fr) 28px;
    align-items: stretch;
    color: #30363b;
    background: #fafafa;
    border: 0;
    border-right: 1px solid #d6d8da;
    border-bottom: 2px solid transparent;
}

.etim15-tab.is-active {
    color: #064c9a;
    background: #fff;
    border-bottom-color: #1f65ae;
}

.etim15-tab-title {
    min-width: 0;
    display: flex;
    align-items: center;
    padding: 0 10px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
}

.etim15-tab-close {
    width: 24px;
    height: 24px;
    place-self: center;
    display: grid;
    place-items: center;
    color: #fff;
    background: #d9534f;
    border: 0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}
.etim15-tab-close:hover { background: #b52b27; }

.etim15-view-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px 3px 37px;
    background: #fbfbfb;
    border-bottom: 1px solid #dedfe1;
}
.etim15-view-toolbar button {
    min-width: 34px;
    height: 28px;
    padding: 0 7px;
    color: #1e2c35;
    background: #fff;
    border: 1px solid #ccd0d3;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}
.etim15-view-toolbar button:hover { background: #edf3f8; }
.etim15-view-toolbar > span { margin-left: 5px; color: #666; font-size: 12px; }

.etim15-canvas {
    min-width: 0;
    min-height: 0;
    position: relative;
    overflow: auto;
    background: #fff;
    scrollbar-color: #7b7f82 #efefef;
}

.etim15-view-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 6px;
    color: #777;
    text-align: center;
}
.etim15-view-empty strong { color: #444; font-size: 17px; }
.etim15-view-empty span { font-size: 13px; }

.etim15-sheet-stage {
    min-width: 100%;
    min-height: 100%;
    position: relative;
    padding: 10px 28px 30px;
    background: #fff;
}
.etim15-sheet-stage[hidden] { display: none; }
.etim15-sheet-stage img {
    display: block;
    max-width: none;
    height: auto;
    margin: 0 auto;
    user-select: none;
    -webkit-user-drag: none;
}

.etim15-asset-missing {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 7px;
    padding: 30px;
    color: #777;
    text-align: center;
}
.etim15-asset-missing[hidden] { display: none; }
.etim15-asset-missing strong { color: #333; font-size: 17px; }
.etim15-asset-missing span { max-width: 560px; font-size: 13px; line-height: 1.5; }

@media (max-width: 1250px) {
    .etim15-shell { grid-template-columns: 340px minmax(0, 1fr); }
    .etim15-nav-handle { left: 327px; }
}

@media (max-width: 900px) {
    .etim15-shell { grid-template-columns: 300px minmax(620px, 1fr); overflow-x: auto; }
    .etim15-nav-handle { left: 287px; }
}

/* --------------------------------------------------------------------------
   eTIM electrical focus mode + native connector test v1.6.0
   -------------------------------------------------------------------------- */
body.agw-etim-focus { overflow: hidden; }
body.agw-etim-focus .app-shell { grid-template-columns: 1fr; height: 100vh; min-height: 100vh; }
body.agw-etim-focus .sidebar,
body.agw-etim-focus .topbar,
body.agw-etim-focus .active-machine-bar { display: none !important; }
body.agw-etim-focus .main { width: 100vw; height: 100vh; min-height: 0; padding: 0 !important; overflow: hidden; }
body.agw-etim-focus .etim15-shell {
    width: 100vw;
    height: 100vh;
    min-height: 0;
    border: 0;
    box-shadow: none;
}

.etim160-connector-overlay {
    position: fixed;
    z-index: 5000;
    inset: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    color: #20252a;
    background: rgba(31, 36, 40, .30);
}
.etim160-connector-overlay[hidden] { display: none; }
.etim160-connector-dialog {
    width: min(1380px, calc(100vw - 42px));
    height: min(900px, calc(100vh - 42px));
    min-height: 500px;
    place-self: center;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    background: #fff;
    border: 1px solid #9da3a7;
    box-shadow: 0 20px 75px rgba(0,0,0,.45);
}
.etim160-connector-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 6px 8px 6px 14px;
    background: #f6f7f8;
    border-bottom: 1px solid #cfd3d6;
}
.etim160-connector-head strong { color: #154d83; font-size: 18px; }
.etim160-connector-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.etim160-connector-head small { margin-left: auto; color: #73797e; white-space: nowrap; }
.etim160-connector-close {
    flex: 0 0 auto; width: 34px; height: 34px; display: grid; place-items: center;
    color: #fff; background: #cf3e38; border: 0; border-radius: 3px; cursor: pointer; font-size: 20px;
}
.etim160-connector-body { min-height: 0; overflow: auto; padding: 14px; background: #eef0f2; }
.etim160-connector-loading,
.etim160-connector-error { display: grid; place-items: center; min-height: 280px; color: #687078; background: #fff; border: 1px solid #d0d3d5; }
.etim160-connector-error { color: #9d2626; }
.etim160-connector-images { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-bottom: 14px; }
.etim160-connector-card { min-width: 0; padding: 10px; background: #fff; border: 1px solid #cfd3d6; }
.etim160-connector-card h3 { margin: 0 0 8px; color: #4a5156; font-size: 13px; font-weight: 700; }
.etim160-connector-card a { display: grid; place-items: center; min-height: 260px; background: #fafafa; border: 1px solid #e0e2e4; cursor: zoom-in; }
.etim160-connector-card img { display: block; max-width: 100%; max-height: 420px; object-fit: contain; }
.etim160-connector-card .missing { min-height: 260px; display: grid; place-items: center; color: #8a9094; text-align: center; background: #fafafa; border: 1px dashed #cdd1d4; }
.etim160-pin-panel { background: #fff; border: 1px solid #cfd3d6; }
.etim160-pin-title { display: flex; justify-content: space-between; gap: 12px; padding: 9px 11px; color: #474e53; background: #f5f6f7; border-bottom: 1px solid #d5d8da; font-size: 13px; font-weight: 700; }
.etim160-pin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.etim160-pin-table th { position: sticky; top: 0; z-index: 1; padding: 8px 9px; color: #32383c; background: #edf0f2; border-bottom: 1px solid #cbd0d3; text-align: left; }
.etim160-pin-table td { padding: 7px 9px; border-bottom: 1px solid #e2e4e6; vertical-align: top; }
.etim160-pin-table tbody tr:hover { background: #eef5fb; }
.etim160-pin-table td:first-child { width: 70px; font-weight: 700; color: #174f84; }
.etim160-pin-table td:nth-child(2) { width: 130px; font-weight: 600; }
.etim160-pin-table td:nth-child(3) { width: 90px; }
.etim160-pin-empty { padding: 20px; color: #81878c; }
.etim160-debug { margin-top: 8px; color: #8b9196; font-size: 11px; }

@media (max-width: 850px) {
    .etim160-connector-dialog { width: 100vw; height: 100vh; }
    .etim160-connector-images { grid-template-columns: 1fr; }
}
