
:root{
    font-family:system-ui,-apple-system,Segoe UI,sans-serif;
    color:#1f2937;
    background:#f4f6f8;
    --sidebar:#13212d;
    --sidebar2:#0e1a24;
    --accent:#0784d8;
    --border:#d9e0e7;
    --card:#fff;
    --muted:#6b7280;
}
*{box-sizing:border-box}
body{margin:0;background:#f4f6f8;color:#1f2937}
a{color:#006ecb;text-decoration:none}
a:hover{text-decoration:underline}
.app-shell{min-height:100vh;display:grid;grid-template-columns:245px 1fr}
.sidebar{background:linear-gradient(180deg,var(--sidebar),var(--sidebar2));color:#dce6ef;padding:18px 16px;position:sticky;top:0;height:100vh;overflow:auto}
.brand{font-size:1.55rem;font-weight:800;color:#19a9ff;margin:0 0 26px;letter-spacing:.2px}
.nav-section{font-size:.75rem;text-transform:uppercase;color:#9fb0c0;margin:22px 0 8px;letter-spacing:.06em}
.nav-link{display:flex;align-items:center;gap:.65rem;padding:10px 12px;border-radius:7px;color:#e7eef6;text-decoration:none;margin:3px 0}
.nav-link:hover{background:rgba(255,255,255,.08);text-decoration:none}
.nav-link.active{background:#087ed0;color:#fff}
.nav-icon{width:1.15rem;text-align:center;opacity:.95}
.sidebar-footer{margin-top:18px;color:#9fb0c0;font-size:.78rem}
.main{min-width:0}
.topbar{height:58px;background:#fff;border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 22px}
.menu-button{font-size:1.35rem;color:#334155}
.topbar-right{display:flex;align-items:center;gap:1rem}
.searchbox{position:relative}
.searchbox input{width:260px;margin:0;padding:8px 34px 8px 12px;border:1px solid #cfd8e3;border-radius:5px;background:#fff}
.searchbox:after{content:"⌕";position:absolute;right:10px;top:5px;color:#475569;font-size:1.25rem}
.user-chip{display:flex;align-items:center;gap:.35rem;color:#334155;text-decoration:none;font-weight:600;padding:6px 8px;border-radius:6px}.user-chip:hover{background:#eef2f6;text-decoration:none}
.content{max-width:1480px;margin:0 auto;padding:0 22px 28px}
.breadcrumbs{font-size:.9rem;color:#64748b;margin:16px 0 14px}
.breadcrumbs a{margin-right:.35rem}
.page-title{font-size:1.65rem;margin:0 0 16px;color:#111827}
.top{display:none}
.wrap{max-width:none;margin:0;padding:0}
.card{background:var(--card);border:1px solid var(--border);border-radius:6px;padding:16px;margin-bottom:16px;box-shadow:0 1px 2px rgba(15,23,42,.03)}
.card h2,.card h3{margin-top:0}
.card h2{font-size:1.05rem;padding:12px 16px;margin:-16px -16px 16px;border-bottom:1px solid var(--border);background:#fafbfc;border-radius:6px 6px 0 0}
table{border-collapse:collapse;width:100%;background:white}
th,td{border-bottom:1px solid #e6ebf1;text-align:left;padding:9px 10px;vertical-align:top}
th{background:#fafbfc;font-weight:700;color:#111827}
input,select,textarea{width:100%;box-sizing:border-box;padding:8px;margin:4px 0 12px;border:1px solid #c6d0da;border-radius:5px;background:#fff}
button,.btn{display:inline-block;background:#20242a;color:white;border:0;border-radius:5px;padding:8px 12px;text-decoration:none;cursor:pointer;font-weight:600}
button:hover,.btn:hover{text-decoration:none;filter:brightness(.96)}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.muted{color:var(--muted)}
.danger{color:#a00}
.small{font-size:.9rem}
.userbar{float:right;color:#ddd}.userbar a{margin:0;color:#fff}.top:after{content:"";display:block;clear:both}
.auth-wrap{min-height:70vh;display:flex;align-items:center;justify-content:center}.auth-shell{width:100%;max-width:420px;margin:40px auto}.auth-brand{background:var(--accent);padding:22px 24px 20px;border-radius:8px 8px 0 0}.auth-logo{display:block;max-width:190px;width:58%;height:auto;margin:0 auto}.auth-card{max-width:420px;margin:0;border-top:0;border-radius:0 0 8px 8px}.auth-card h2{margin-top:0}.auth-error{background:#fff4f4;border:1px solid #e0aaaa;border-radius:5px;padding:10px 12px;margin:0 0 14px;color:#7a1f1f}.auth-submit{width:100%;margin-top:4px}.nav-logout-form{margin:0;padding:0}.nav-logout{width:100%;text-align:left;font:inherit;background:transparent;border:0;color:#e7eef6;padding:10px 12px;margin:3px 0;filter:none}.nav-logout:hover{background:rgba(255,255,255,.08);filter:none}
.pill{display:inline-block;background:#eef2f6;border-radius:999px;padding:2px 8px;font-size:.85rem}
.error{background:#fff4f4;border-color:#e0aaaa}
.warning{background:#fff9e8;border-color:#e4c56b}
.success{border-left:4px solid #2d7a3f}
.helpbox{background:#eef5ff;border:1px solid #c9d9ef;border-radius:8px;padding:14px 18px;margin-bottom:18px}
.helpbox strong{display:block;margin-bottom:6px}.helpbox ul{margin:8px 0 0 20px;padding:0}.helpbox li{margin:4px 0}
.fieldhelp{color:#667085;font-size:.88rem;margin:-2px 0 8px;line-height:1.38}
.card form label{font-weight:600;display:block}
td a{font-weight:600}
.compact-grid{grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.75rem}
.cpdef-editor{border-top:1px solid #d7d7d7;padding-top:1rem;margin-top:1rem}
button.danger{background:#7a1f1f;color:#fff}
button.danger:hover{background:#5f1717;color:#fff}
.venue-switcher{display:inline-flex;align-items:center;gap:.35rem;margin:0 0 0 1rem;vertical-align:middle}
.venue-switcher label{font-size:.85rem;color:#ddd;font-weight:600}
.venue-switcher select{width:auto;min-width:180px;margin:0;padding:5px 8px;border-radius:5px;border:1px solid #777;background:#fff;color:#222}
.delete-form{margin-top:.5rem;margin-bottom:1.5rem}
.checkbox-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));gap:.25rem .75rem;margin:.35rem 0 1rem}
.checkbox-list label{display:flex;align-items:center;gap:.35rem;margin:0;font-weight:400}
.checkbox-list input[type="checkbox"]{width:auto;margin:0}

/* Rack Visualizer */
.rack-toolbar{display:grid;grid-template-columns:1fr 180px 150px 160px;gap:.75rem;align-items:end}
.rack-toolbar label{font-weight:600;margin-bottom:0}.rack-toolbar select{margin:0}
.rack-page-grid{display:grid;grid-template-columns:1fr 1.25fr 1.15fr;gap:16px;align-items:start}
.rack-card{border-radius:4px;padding:0;overflow:hidden}.rack-card h2{font-size:1rem;margin:0;padding:12px 16px;border-bottom:1px solid #ddd;background:#fafafa}.rack-card>p,.rack-card>ul,.rack-card>.fieldhelp,.rack-card>.info-list,.rack-card>.legend-row,.rack-card>.rack-visual-core,.rack-card>.rack-front-label,.rack-card>.rack-table{margin:14px 16px}.info-list{display:grid;grid-template-columns:120px 1fr;gap:.55rem 1rem}.info-list dt{font-weight:500;color:#333}.info-list dd{margin:0;color:#222}.legend-row{display:flex;align-items:center;gap:.75rem;margin-bottom:.75rem}.legend-swatch{display:inline-block;width:24px;height:24px;border:1px solid #888;border-radius:2px;background:#eee}.legend-swatch.equipment,.rack-block.equipment{background:linear-gradient(#d9e9fa,#a9cbe8)}.legend-swatch.panel,.rack-block.panel{background:linear-gradient(#dff1df,#b8d9b8)}.legend-swatch.power,.rack-block.power{background:linear-gradient(#ffe08a,#ffc94f)}.legend-swatch.other,.rack-block.other{background:linear-gradient(#d9c8ef,#b99bdc)}.legend-swatch.empty{background:#f7f7f7}
.rack-view-card{min-width:380px}.rack-visual-core{display:grid;grid-template-columns:52px minmax(260px,360px) 52px;gap:10px;justify-content:center;align-items:stretch}.rack-labels{display:grid;grid-template-rows:repeat(var(--rack-units), 18px);font-size:.78rem;line-height:18px;color:#111}.rack-labels.left{text-align:right}.rack-labels.right{text-align:left}.rack-frame{position:relative;display:grid;grid-template-rows:repeat(var(--rack-units), 18px);grid-template-columns:repeat(12,minmax(0,1fr));border-left:8px solid #333;border-right:8px solid #333;border-top:2px solid #222;border-bottom:2px solid #222;background:#f7f7f7;box-shadow:inset 0 0 0 1px #aaa}.rack-unit-line{grid-column:1 / -1;border-bottom:1px solid #c7c7c7;background:#f9f9f9}.rack-unit-line:nth-child(even){background:#f1f1f1}.rack-unit-line:nth-child(5n){border-bottom-color:#999}.rack-block{z-index:2;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:0;border:1px solid #4f7295;border-radius:0;color:#111;text-decoration:none;font-weight:700;font-size:.82rem;line-height:1.1;text-align:center;overflow:hidden;padding:1px 6px;box-sizing:border-box;box-shadow:inset 0 1px rgba(255,255,255,.55)}.rack-block:hover{outline:2px solid #0057b8;z-index:3}.rack-block-model{font-size:.72rem;font-weight:500;margin-top:2px}.rack-front-label{text-align:center;font-weight:700;font-size:.85rem;margin-top:6px!important}.rack-table{font-size:.9rem}.rack-table th,.rack-table td{padding:7px 8px}.util{display:inline-block;width:140px;height:14px;background:#e9edf2;border-radius:4px;vertical-align:middle;overflow:hidden;margin-right:8px}.util span{display:block;height:100%;background:#0875be}
@media (max-width:1000px){.rack-page-grid{grid-template-columns:1fr}.rack-toolbar{grid-template-columns:1fr}.rack-view-card{min-width:0}}

.warning{background:#fff9e8;border-color:#e4c56b}

.checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: .25rem .75rem;
    margin: .35rem 0 1rem;
}
.checkbox-list label {
    display: flex;
    align-items: center;
    gap: .35rem;
    margin: 0;
    font-weight: 400;
}
.checkbox-list input[type="checkbox"] {
    width: auto;
}


/* Equipment Model overview */
.component-overview h2{margin-top:0}
.overview-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:12px;margin:10px 0 14px}
.overview-label{font-size:.78rem;text-transform:uppercase;letter-spacing:.04em;color:#667085;font-weight:700}
.overview-value{font-size:1.05rem;font-weight:700;color:#111827;margin-top:2px}
.overview-section{border-top:1px solid var(--border,#d9e0e7);padding-top:12px;margin-top:12px}
.overview-columns{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;margin-top:8px}
.summary-chip-row{margin-top:8px}
.summary-chip{display:inline-block;background:#eef2f6;border:1px solid #d7dee8;border-radius:999px;padding:3px 9px;margin:2px 4px 2px 0;font-size:.86rem;color:#253244}
.summary-chip b{font-weight:800;color:#0f172a}
.overview-details{margin-top:14px}
.overview-details summary{cursor:pointer;font-weight:700;color:#0f5f9e}
.compact-overview-table{margin-top:10px;font-size:.9rem}
.compact-overview-table th,.compact-overview-table td{padding:6px 8px}


/* Connection point definition accordion */
.cpdef-accordion-list{
    display:grid;
    gap:8px;
}
.cpdef-accordion{
    border:1px solid var(--border,#d9e0e7);
    border-radius:6px;
    background:#fff;
    overflow:hidden;
}
.cpdef-accordion summary{
    list-style:none;
    cursor:pointer;
    padding:10px 12px;
    display:grid;
    grid-template-columns:auto minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
    background:#fafbfc;
    border-left:4px solid #0784d8;
}
.cpdef-accordion summary::-webkit-details-marker{
    display:none;
}
.cpdef-accordion summary:before{
    content:"▶";
    color:#506070;
    font-size:.8rem;
    line-height:1;
}
.cpdef-accordion[open] summary:before{
    content:"▼";
}
.cpdef-summary-main{
    min-width:0;
}
.cpdef-summary-name{
    display:block;
    font-weight:800;
    color:#111827;
}
.cpdef-summary-meta{
    display:block;
    font-size:.88rem;
    color:#667085;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
.cpdef-order-badge{
    justify-self:end;
    display:inline-block;
    background:#eef2f6;
    border:1px solid #d7dee8;
    border-radius:999px;
    padding:2px 8px;
    font-size:.82rem;
    color:#253244;
    font-weight:700;
}
.cpdef-accordion-body{
    padding:12px 14px 14px;
    border-top:1px solid var(--border,#d9e0e7);
}
.cpdef-accordion .cpdef-editor{
    border-top:0;
    padding-top:0;
    margin-top:0;
}

/* Internal routes */
.internal-route-form{margin-top:12px}

button[disabled],
.btn[disabled]{
    opacity:.55;
    cursor:not-allowed;
}
.danger-zone{
    border-color:#e0aaaa;
    background:#fffafa;
}

.danger-zone{
    margin-top:2rem;
    border-top:4px solid #7a1f1f;
}

.site-logo {
    display: block;
    text-align: center;
    margin: 0 0 24px;
}

.site-logo img {
    display: inline-block;
    width: 170px;      /* or whatever looks best */
    height: auto;
}
/* Setup dashboard */
.dashboard-hero{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    border-left:4px solid var(--accent);
}
.dashboard-hero h2{
    margin:.1rem 0 .45rem;
    font-size:1.55rem;
    color:#0f172a;
}
.dashboard-eyebrow{
    margin:0;
    font-size:.78rem;
    font-weight:800;
    letter-spacing:.08em;
    text-transform:uppercase;
    color:#0784d8;
}
.dashboard-progress{
    flex:0 0 auto;
    min-width:160px;
    padding:14px 16px;
    border:1px solid #c9d9ef;
    border-radius:8px;
    background:#eef5ff;
    text-align:center;
}
.dashboard-progress strong{
    display:block;
    font-size:2rem;
    line-height:1;
    color:#0f172a;
}
.dashboard-progress span{
    display:block;
    margin-top:5px;
    color:#475569;
    font-size:.86rem;
}
.setup-flow h2{margin-bottom:14px}
.setup-step-list{
    display:grid;
    gap:10px;
}
.setup-step{
    display:grid;
    grid-template-columns:34px 42px minmax(0,1fr) auto;
    gap:12px;
    align-items:center;
    padding:14px;
    border:1px solid #d9e0e7;
    border-radius:8px;
    background:#fff;
    color:#1f2937;
    text-decoration:none;
}
.setup-step:hover{
    text-decoration:none;
    border-color:#9ec7e8;
    box-shadow:0 2px 8px rgba(15,23,42,.06);
}
.setup-step-number{
    width:28px;
    height:28px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    background:#eef2f6;
    color:#475569;
    font-weight:800;
    font-size:.9rem;
}
.setup-step-status{
    width:36px;
    height:36px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    font-size:1.25rem;
    font-weight:900;
}
.setup-step.complete .setup-step-status{
    background:#e7f6ed;
    color:#157347;
}
.setup-step.not-started .setup-step-status{
    background:#fff1f1;
    color:#a4262c;
}
.setup-step-main{
    min-width:0;
    display:grid;
    gap:3px;
}
.setup-step-title{
    font-size:1.05rem;
    font-weight:800;
    color:#111827;
}
.setup-step-description{
    color:#475569;
    line-height:1.35;
}
.setup-step-count{
    color:#667085;
    font-size:.88rem;
}
.setup-step-action{
    text-align:right;
    display:grid;
    gap:4px;
    white-space:nowrap;
}
.setup-step-state{
    justify-self:end;
    display:inline-block;
    border-radius:999px;
    padding:2px 8px;
    font-size:.78rem;
    font-weight:800;
    background:#eef2f6;
    color:#475569;
}
.setup-step.complete .setup-step-state{
    background:#e7f6ed;
    color:#157347;
}
.setup-step.not-started .setup-step-state{
    background:#fff1f1;
    color:#a4262c;
}
.setup-step-link{
    color:#0f5f9e;
    font-weight:800;
}
.dashboard-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
}
.dashboard-overview-table th{
    width:70%;
}
.dashboard-overview-table td{
    text-align:right;
    font-weight:800;
}
.dashboard-order-list{
    margin:10px 0 14px 1.25rem;
    padding:0;
}
.dashboard-order-list li{
    margin:5px 0;
}
@media (max-width:800px){
    .dashboard-hero,
    .setup-step{
        display:block;
    }
    .dashboard-progress{
        margin-top:14px;
    }
    .setup-step-number,
    .setup-step-status{
        margin-right:8px;
        vertical-align:middle;
    }
    .setup-step-main{
        display:block;
        margin-top:10px;
    }
    .setup-step-main span{
        display:block;
        margin-top:4px;
    }
    .setup-step-action{
        text-align:left;
        margin-top:10px;
    }
    .setup-step-state{
        justify-self:start;
    }
    .dashboard-grid{
        grid-template-columns:1fr;
    }
}

/* Reusable autocomplete / combobox */
.relatar-combobox{
    position:relative;
    width:100%;
}
.relatar-combobox input{
    margin-bottom:12px;
}
.relatar-combobox-menu{
    position:absolute;
    z-index:50;
    left:0;
    right:0;
    top:calc(100% - 12px);
    max-height:240px;
    overflow:auto;
    background:#fff;
    border:1px solid #8f8f8f;
    border-radius:0;
    box-shadow:none;
    padding:0;
}
.relatar-combobox-option{
    display:block;
    width:100%;
    text-align:left;
    background:#fff;
    color:#000;
    border:0;
    border-radius:0;
    padding:5px 12px;
    font-weight:400;
    cursor:pointer;
    line-height:1.25;
}
.relatar-combobox-option:hover,
.relatar-combobox-option.is-active{
    background:#1f6fd2;
    color:#fff;
    filter:none;
}
.relatar-combobox-create{
    border-top:1px solid #cfd8e3;
    margin-top:0;
    font-weight:400;
}
.relatar-combobox-create:hover,
.relatar-combobox-create.is-active{
    background:#1f6fd2;
    color:#fff;
}

.cpdef-select{
    width:auto;
    margin:0;
}
.bulk-delete-form{
    margin:0;
}

/* Signal Trace */
.trace-path{
    margin:0 0 1rem 1.5rem;
    padding:0;
}
.trace-path li{
    margin:0 0 .9rem;
    padding:.55rem .75rem;
    background:#fafafa;
    border:1px solid #ddd;
    border-radius:8px;
}
.trace-path li::marker{
    font-weight:700;
}
.trace-suggestion{
    margin:.35rem 0;
}
.trace-suggestion button{
    width:100%;
    text-align:left;
}

/* Signal Trace endpoint picker */
.trace-picker-shell{
    position:relative;
}
.trace-picker-input{
    width:100%;
}
.trace-picker-results{
    margin-top:.35rem;
    max-height:420px;
    overflow:auto;
    border:1px solid #d0d5dd;
    border-radius:10px;
    background:#fff;
}
.trace-picker-result{
    display:block;
    width:100%;
    text-align:left;
    border:0;
    border-bottom:1px solid #eef0f3;
    border-radius:0;
    background:#fff;
    color:inherit;
    padding:.65rem .75rem;
    cursor:pointer;
}
.trace-picker-result:hover,
.trace-picker-result.active{
    background:#f2f5f8;
}
.trace-picker-primary{
    display:block;
    font-weight:700;
    font-size:1rem;
}
.trace-picker-meta,
.trace-picker-placement{
    display:block;
    margin-top:.15rem;
    font-size:.86rem;
    color:#555;
}
.trace-picker-empty{
    padding:.75rem;
    color:#777;
}
.trace-picker-selected .trace-picker-input{
    border-color:#5c7c99;
}

/* Signal Trace browser-first endpoint picker */
.trace-browser-shell{
    border:1px solid #d0d5dd;
    border-radius:10px;
    background:#fff;
    overflow:hidden;
}
.trace-browser-toolbar{
    display:flex;
    gap:.75rem;
    align-items:end;
    padding:.75rem;
    border-bottom:1px solid #e5e7eb;
    background:#fafafa;
}
.trace-browser-toolbar .trace-picker-input{
    flex:1;
    width:100%;
}
.trace-group-label{
    margin:0;
    min-width:150px;
    font-size:.85rem;
    color:#555;
}
.trace-group-label select{
    margin-top:.15rem;
}
.trace-picker-results{
    max-height:460px;
    overflow:auto;
    background:#fff;
}
.trace-result-group{
    position:sticky;
    top:0;
    z-index:1;
    padding:.4rem .75rem;
    background:#f1f4f7;
    border-bottom:1px solid #d7dce2;
    font-size:.8rem;
    font-weight:700;
    color:#344054;
}
.trace-picker-result{
    display:block;
    width:100%;
    text-align:left;
    border:0;
    border-bottom:1px solid #eef0f3;
    border-radius:0;
    background:#fff;
    color:#111;
    padding:.6rem .85rem;
    cursor:pointer;
}
.trace-picker-result:hover,
.trace-picker-result.active{
    background:#eef5fb;
}
.trace-picker-primary{
    display:block;
    font-weight:700;
    font-size:1rem;
    line-height:1.25;
}
.trace-picker-meta,
.trace-picker-placement{
    display:block;
    margin-top:.16rem;
    font-size:.86rem;
    color:#4b5563;
}
.trace-muted{
    color:#667085;
    font-size:.82rem;
}
.trace-picker-empty{
    padding:.75rem;
    color:#667085;
    background:#fff;
}
.trace-picker-selected .trace-picker-input{
    border-color:#5c7c99;
}

.generator-preview{
    margin:.75rem 0 1rem;
    padding:.75rem;
    border:1px solid #d0d5dd;
    border-radius:8px;
    background:#fafafa;
}

/* Signal Trace result */
.trace-view-path .trace-path li{
    position:relative;
}
.trace-edge-label{
    margin:.5rem 0 .1rem;
    color:#667085;
    font-size:.86rem;
    font-weight:600;
}

/* Interactive Signal Trace */
.trace-view-path .trace-path li,
.trace-view-path li{
    position:relative;
}
.trace-edge-label{
    margin:.5rem 0 .1rem;
    color:#667085;
    font-size:.86rem;
    font-weight:600;
}

.trace-insert-form{
    margin:.4rem 0 .75rem 1.2rem;
    padding:.55rem .65rem;
    border-left:3px solid #d0d5dd;
    background:#fafafa;
}
.trace-insert-form label{
    margin:0 0 .25rem;
}
.trace-insert-form select{
    display:block;
    margin:.2rem 0 .45rem;
}

.rack-block.accessory,
.legend-swatch.accessory {
    background: rgba(130, 130, 130, 0.35);
    border-style: dashed;
}

.rack-block.blank,
.legend-swatch.blank {
    background: rgba(95, 95, 95, 0.22);
    border-style: solid;
}

.accessory-table input,
.accessory-table select {
    min-width: 5rem;
    width: 100%;
}

.accessory-table .actions {
    white-space: nowrap;
}

.inline-form {
    display: inline;
}

/* Responsive rack visualizer */
.rack-page-grid{
    grid-template-areas:"meta visual details";
}
.rack-meta-column{grid-area:meta;min-width:0}
.rack-visual-column{grid-area:visual;min-width:0}
.rack-details-column{grid-area:details;min-width:0}
.rack-table{width:100%;border-collapse:collapse}
.rack-table th{text-align:left}

.rack-card,
.rack-visual-column,
.rack-details-column,
.rack-meta-column{
    max-width:100%;
    box-sizing:border-box;
}

.rack-visual-core,
.rack-frame{
    max-width:100%;
    min-width:0;
    box-sizing:border-box;
}

/* Use the full three-column layout only above 1400px. */
@media (min-width:1401px){
    .rack-page-grid{
        grid-template-columns:minmax(260px,.85fr) minmax(380px,1.15fr) minmax(560px,1.45fr);
        grid-template-areas:"meta visual details";
    }
}

/* At 1400px and below, give every section the full available width. */
@media (max-width:1400px){
    .rack-page-grid{
        grid-template-columns:minmax(0,1fr);
        grid-template-areas:
            "visual"
            "details"
            "meta";
    }
    .rack-view-card{min-width:0}
}

@media (max-width:1200px){
    .rack-visual-core{
        grid-template-columns:clamp(28px,7vw,42px) minmax(0,min(360px,calc(100vw - 120px))) clamp(28px,7vw,42px);
        gap:6px;
        width:auto;
    }
    .rack-labels{font-size:.72rem}
}

@media (max-width:700px){
    .rack-card h2{padding:10px 12px}
    .rack-card>p,
    .rack-card>ul,
    .rack-card>.fieldhelp,
    .rack-card>.info-list,
    .rack-card>.legend-row,
    .rack-card>.rack-visual-core,
    .rack-card>.rack-front-label,
    .rack-card>.rack-table{margin:12px}
    .info-list{grid-template-columns:1fr;gap:.2rem .5rem}
    .info-list dt{margin-top:.35rem}
    .rack-labels{font-size:.7rem}
    .rack-visual-core{grid-template-columns:34px minmax(180px,1fr) 34px;gap:6px}
    .rack-block{font-size:.72rem;padding:1px 3px}
    .rack-block-model{display:none}
}

@media (max-width:520px){
    .rack-visual-core{
        grid-template-columns:30px minmax(0,1fr) 30px;
        gap:4px;
    }
    .rack-labels{font-size:.66rem}
    .rack-block{
        font-size:.68rem;
        padding-left:2px;
        padding-right:2px;
    }
}

/* Keep rack/container lists as tables at every viewport width. */
.rack-object-list{
    table-layout:auto;
    width:calc(100% - 32px);
    border-collapse:collapse;
}
.rack-object-list th,
.rack-object-list td{
    display:table-cell;
    word-break:normal;
    overflow-wrap:normal;
    white-space:normal;
    vertical-align:top;
}
.rack-object-list th{white-space:nowrap}
.rack-object-list th:nth-child(1),
.rack-object-list td:nth-child(1),
.rack-object-list th:nth-child(2),
.rack-object-list td:nth-child(2),
.rack-object-list th:nth-child(4),
.rack-object-list td:nth-child(4),
.rack-object-list th:nth-child(6),
.rack-object-list td:nth-child(6){
    white-space:nowrap;
    width:1%;
}
.rack-object-list th:nth-child(3),
.rack-object-list td:nth-child(3),
.rack-object-list th:nth-child(5),
.rack-object-list td:nth-child(5){
    min-width:8rem;
}

.profile-grid{align-items:start}
@media (max-width:900px){.profile-grid{grid-template-columns:1fr}}

/* Responsive application shell */
html,
body{
    max-width:100%;
}

.menu-button{
    appearance:none;
    -webkit-appearance:none;
    background:transparent;
    color:#334155;
    border:0;
    border-radius:6px;
    padding:7px 9px;
    margin:0;
    line-height:1;
    font-size:1.45rem;
    cursor:pointer;
}
.menu-button:hover{
    background:#eef2f6;
    filter:none;
}

.sidebar-backdrop{
    display:none;
}

.main,
.content,
.card,
.topbar,
.topbar-right,
.grid{
    min-width:0;
}

img,
svg,
canvas,
video{
    max-width:100%;
    height:auto;
}

@media (min-width:901px){
    .menu-button{
        visibility:hidden;
    }
}

@media (max-width:900px){
    body{
        overflow-x:hidden;
    }

    body.sidebar-open{
        overflow:hidden;
    }

    .app-shell{
        display:block;
        min-height:100vh;
    }

    .sidebar{
        position:fixed;
        z-index:1000;
        top:0;
        left:0;
        bottom:0;
        width:min(82vw, 300px);
        max-width:300px;
        height:100dvh;
        transform:translateX(-105%);
        transition:transform .18s ease-out;
        box-shadow:0 12px 32px rgba(15,23,42,.35);
        padding-bottom:52px;
    }

    body.sidebar-open .sidebar{
        transform:translateX(0);
    }

    .sidebar-footer{
        position:static;
        margin-top:24px;
        padding-left:12px;
    }

    .sidebar-backdrop{
        display:block;
        position:fixed;
        inset:0;
        z-index:900;
        background:rgba(15,23,42,.42);
    }

    .sidebar-backdrop[hidden]{
        display:none;
    }

    .main{
        width:100%;
        max-width:100%;
        overflow-x:hidden;
    }

    .topbar{
        position:sticky;
        top:0;
        z-index:800;
        height:auto;
        min-height:58px;
        gap:10px;
        align-items:flex-start;
        padding:10px 12px;
    }

    .topbar-right{
        flex:1 1 auto;
        display:grid;
        grid-template-columns:minmax(0,1fr) auto;
        gap:8px 10px;
        align-items:center;
    }

    .searchbox{
        grid-column:1 / 2;
        min-width:0;
    }

    .searchbox input{
        width:100%;
        min-width:0;
    }

    .venue-switcher{
        grid-column:1 / -1;
        display:grid;
        grid-template-columns:auto minmax(0,1fr);
        align-items:center;
        gap:6px;
        margin:0;
        min-width:0;
    }

    .venue-switcher label{
        color:#64748b;
    }

    .venue-switcher select{
        width:100%;
        min-width:0;
    }

    .user-chip{
        grid-column:2 / 3;
        justify-self:end;
        max-width:42vw;
        overflow:hidden;
        white-space:nowrap;
        text-overflow:ellipsis;
    }

    .content{
        width:100%;
        max-width:none;
        padding:0 12px 22px;
        overflow-x:hidden;
    }

    .breadcrumbs{
        overflow-wrap:anywhere;
    }

    .page-title{
        font-size:1.45rem;
        line-height:1.15;
    }

    .grid,
    .dashboard-hero{
        grid-template-columns:1fr;
    }

    .dashboard-hero{
        display:block;
    }

    .dashboard-progress{
        margin-top:14px;
    }

    table{
        max-width:100%;
    }
}

@media (max-width:560px){
    .topbar{
        align-items:flex-start;
    }

    .topbar-right{
        grid-template-columns:minmax(0,1fr) auto;
    }

    .searchbox{
        grid-column:1 / -1;
    }

    .user-chip{
        grid-column:2 / 3;
        grid-row:1;
        max-width:38vw;
    }

    .venue-switcher{
        grid-column:1 / -1;
    }

    .card{
        padding:12px;
    }

    .card h2{
        margin:-12px -12px 12px;
        padding:10px 12px;
    }
}

/* Staged Trace Editor */
.trace-editor-toolbar{
    display:flex;
    gap:.75rem;
    align-items:center;
    flex-wrap:wrap;
    margin-top:1rem;
    padding-top:.9rem;
    border-top:1px solid #e5e7eb;
}
.trace-editor-workspace{
    margin-top:1rem;
    padding:1rem;
    border:1px solid #d0d5dd;
    border-radius:12px;
    background:#fbfcfd;
}
.trace-editor-node{
    margin:.65rem 0;
    padding:.75rem;
    border:1px solid #d7dce2;
    border-radius:10px;
    background:#fff;
}
.trace-editor-node-title{
    font-weight:700;
    font-size:1rem;
}
.trace-editor-node-meta{
    margin-top:.15rem;
    color:#4b5563;
    font-size:.88rem;
}
.trace-editor-node-actions{
    display:grid;
    grid-template-columns:minmax(18rem,1fr) auto auto;
    gap:.5rem;
    align-items:center;
    margin-top:.65rem;
}
.trace-editor-gap{
    margin:.4rem 0 .4rem 1rem;
    padding:.65rem;
    border-left:3px solid #cfd8e3;
    background:#f6f8fa;
    display:grid;
    grid-template-columns:minmax(16rem,1fr) auto minmax(16rem,1fr) auto;
    gap:.5rem;
    align-items:end;
}
.trace-editor-gap-label{
    grid-column:1 / -1;
    color:#667085;
    font-size:.82rem;
    font-weight:700;
}
.trace-pending-card{
    margin-top:1rem;
    padding:.75rem;
    border:1px dashed #cfd8e3;
    border-radius:10px;
    background:#fff;
}
.trace-change-list{
    margin:.25rem 0 .65rem 1.25rem;
}
.trace-apply-form{
    display:flex;
    gap:.5rem;
    flex-wrap:wrap;
    margin-top:.75rem;
}
.danger-soft{
    border-color:#f1b8b8;
    color:#9f1f1f;
}
@media (max-width:900px){
    .trace-editor-node-actions,
    .trace-editor-gap{
        grid-template-columns:1fr;
    }
    .trace-editor-node-actions select,
    .trace-editor-gap select,
    .trace-editor-node-actions button,
    .trace-editor-gap button{
        width:100%;
    }
}

.trace-search-select{
    position:relative;
    min-width:16rem;
    width:100%;
}
.trace-search-select-button{
    width:100%;
    min-height:2.35rem;
    text-align:left;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    background:#fff;
    color:#111827;
    border:1px solid #cfd8e3;
}
.trace-search-select-button.placeholder{
    color:#667085;
}
.trace-search-select-panel{
    display:none;
    position:absolute;
    z-index:80;
    left:0;
    right:0;
    top:calc(100% + 4px);
    padding:.5rem;
    border:1px solid #cfd8e3;
    border-radius:10px;
    background:#fff;
    box-shadow:0 14px 35px rgba(15,23,42,.16);
}
.trace-search-select.open .trace-search-select-panel{
    display:block;
}
.trace-search-select-input{
    width:100%;
    margin-bottom:.4rem;
}
.trace-search-select-results{
    max-height:17rem;
    overflow:auto;
}
.trace-search-select-result{
    display:block;
    width:100%;
    margin:0;
    padding:.45rem .5rem;
    border:0;
    border-radius:8px;
    background:transparent;
    color:#111827;
    text-align:left;
}
.trace-search-select-result:hover,
.trace-search-select-result.active{
    background:#eef2f7;
}
.trace-suggestion-button{
    grid-column:1 / -1;
    text-align:left;
}
@media (max-width:900px){
    .trace-search-select{
        min-width:0;
    }
    .trace-search-select-panel{
        position:static;
        margin-top:.35rem;
        box-shadow:none;
    }
}

.trace-designation-suggestions{
    grid-column:1 / -1;
    display:grid;
    gap:.35rem;
    padding:.55rem;
    border:1px dashed #cfd8e3;
    border-radius:10px;
    background:#fff;
}
.trace-designation-suggestion-title{
    color:#667085;
    font-size:.82rem;
    font-weight:700;
}
.trace-designation-suggestion-button{
    width:100%;
    text-align:left;
}

.trace-parallel-suggestion{
    margin:0 0 1rem;
    padding:.75rem;
    border:1px dashed #b8c4d4;
    border-radius:10px;
    background:#fff;
    display:grid;
    gap:.45rem;
}
.trace-parallel-suggestion-title{
    font-weight:700;
    color:#374151;
}
.trace-parallel-suggestion-path{
    color:#111827;
    line-height:1.45;
}
.trace-parallel-suggestion-actions{
    display:flex;
    flex-wrap:wrap;
    gap:.5rem;
}

.trace-search-filterbar{
    display:flex;
    flex-wrap:wrap;
    gap:.4rem;
    margin:.1rem 0 .45rem;
}
.trace-search-filter{
    display:flex;
    align-items:center;
    gap:.25rem;
    margin:0;
    font-size:.8rem;
    color:#475467;
}
.trace-search-filter select{
    width:auto;
    min-width:7rem;
    padding:.25rem .45rem;
    font-size:.8rem;
}
@media (max-width:700px){
    .trace-search-filterbar{
        display:grid;
        grid-template-columns:1fr;
    }
    .trace-search-filter,
    .trace-search-filter select{
        width:100%;
    }
}

/* Trace editor draft/resume workflow */
.trace-editor-helper-actions{
    display:flex;
    gap:.75rem;
    align-items:center;
    flex-wrap:wrap;
    margin:.75rem 0 1rem;
    padding:.75rem;
    border:1px solid #dbe3ec;
    border-radius:10px;
    background:#fff;
}
.trace-draft-notice{
    display:flex;
    gap:.65rem;
    align-items:center;
    flex-wrap:wrap;
    margin:.75rem 0 1rem;
    padding:.75rem;
    border:1px solid #f0d28a;
    border-radius:10px;
    background:#fff8e5;
}
.trace-draft-notice[hidden]{
    display:none;
}
@media (max-width:700px){
    .trace-editor-helper-actions .button,
    .trace-draft-notice button{
        width:100%;
    }
}

.trace-additional-paths{
    margin: 12px 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface-soft);
}
.trace-additional-path-row{
    display: flex;
    gap: 10px;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 8px;
}
@media (max-width: 700px){
    .trace-additional-path-row{
        display: block;
    }
    .trace-additional-path-row button{
        margin-top: 8px;
    }
}

.trace-removal-box {
    border: 1px solid rgba(220, 53, 69, 0.35);
    background: rgba(220, 53, 69, 0.08);
    border-radius: 10px;
    padding: 12px;
    margin: 12px 0;
}
.danger-text {
    color: #b42318;
}

.trace-object-notes {
    margin-top: .5rem;
}
.trace-object-notes summary {
    cursor: pointer;
    font-size: .9rem;
    color: var(--muted);
}
.inline-note-form {
    margin-top: .5rem;
}
.inline-note-form textarea {
    min-height: 5rem;
}
.inline-note-form .button,
.inline-note-form button {
    margin-top: .4rem;
    margin-right: .4rem;
}


.trace-editor-object-notes {
    margin-top: .65rem;
    padding-top: .55rem;
    border-top: 1px solid var(--border);
}

/* Bulk paired port label editor */
.paired-label-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    margin: 14px 0 18px;
}
.paired-label-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    min-width: 0;
}
.paired-label-item input {
    width: 100%;
    text-align: center;
    font-weight: 650;
}
.paired-label-order {
    text-align: center;
    font-size: .82rem;
    color: var(--text-muted, #6b7280);
}
.paired-label-current {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-size: .72rem;
    color: var(--text-muted, #6b7280);
}
@media (max-width: 600px) {
    .paired-label-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
}

.trace-endpoint-purpose{margin:.45rem 0;padding:.45rem .6rem;border-left:3px solid currentColor;background:rgba(127,127,127,.08);font-size:.92rem}

/* Compact installed connection-point overview with expandable editors. */
.connection-point-table { table-layout: auto; }
.connection-point-summary-row td { vertical-align: middle; }
.connection-point-expand {
    width: 1.8rem;
    min-width: 1.8rem;
    padding: .15rem .3rem;
    margin-right: .25rem;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
}
.connection-point-documentation-marker { font-weight: 700; }
.connection-point-detail-row > td { padding: 1rem; background: rgba(127,127,127,.06); }
.connection-point-details-grid {
    display: grid;
    grid-template-columns: minmax(14rem, 1fr) minmax(18rem, 1.35fr) minmax(16rem, 1fr);
    gap: 1.25rem;
    align-items: start;
}
.connection-point-details-grid h3 { margin-top: 0; }
.connection-point-facts {
    display: grid;
    grid-template-columns: minmax(7rem, auto) 1fr;
    gap: .35rem .8rem;
    margin: 0;
}
.connection-point-facts dt { font-weight: 600; }
.connection-point-facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.connection-point-detail-row input,
.connection-point-detail-row select,
.connection-point-detail-row textarea { width: 100%; }
.connection-point-delete-action { margin-top: 1rem; }
@media (max-width: 1050px) {
    .connection-point-details-grid { grid-template-columns: 1fr; }
}

.panel-layout-action{margin:0 0 10px;display:flex;justify-content:flex-end}

/* Rack object action dialog */
.rack-object-dialog{width:min(420px,calc(100vw - 32px));padding:0;border:1px solid var(--border);border-radius:7px;box-shadow:0 18px 55px rgba(15,23,42,.28)}
.rack-object-dialog::backdrop{background:rgba(15,23,42,.48)}
.rack-object-dialog-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;padding:16px;border-bottom:1px solid var(--border);background:#fafbfc}
.rack-object-dialog-header h2{margin:0;font-size:1.1rem}
.rack-object-dialog-header p{margin:4px 0 0}
.rack-dialog-close{width:auto;margin:0;padding:1px 8px;background:transparent;color:#334155;font-size:1.45rem;line-height:1}
.rack-object-dialog-actions{display:flex;flex-wrap:wrap;gap:10px;padding:16px}


/* Container and rack printing */
.container-print-header{display:none}
.rack-print-controls{min-width:0}
.rack-print-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.5rem;align-items:center}
.rack-print-row select,.rack-print-row button,.rack-print-controls>button{margin:0}

@media print {
    @page{margin:12mm}
    body{background:#fff;color:#000}
    .app-shell{display:block;min-height:0}
    .sidebar,.topbar,.breadcrumbs,.page-title,.helpbox,.rack-toolbar,.rack-object-dialog,.explorer-toolbar{display:none!important}
    .main,.content,.wrap{display:block;max-width:none;width:auto;margin:0;padding:0}
    .container-print-header{display:block;margin:0 0 12mm;border-bottom:1px solid #777;padding-bottom:4mm}
    .container-print-header h1{font-size:18pt;margin:0 0 2mm}
    .container-print-header p{font-size:9pt;margin:0}
    .rack-page-grid{display:block!important}
    .rack-card{box-shadow:none;border-color:#888;break-inside:avoid}
    .rack-card h2{background:#fff;border-bottom-color:#aaa}
    .rack-block{color:#000!important;text-decoration:none!important}
    .rack-block:hover{outline:none}
    .rack-table a{color:#000;text-decoration:none}
    .print-exclude{display:none!important}

    body.print-rack-elevation .rack-print-contents,
    body.print-rack-elevation .container-print-contents,
    body.print-rack-elevation .container-print-meta{display:none!important}

    body.print-rack-contents .rack-print-elevation,
    body.print-rack-contents .container-print-meta{display:none!important}

    body.print-rack-both .rack-print-elevation,
    body.print-rack-both .rack-print-contents{display:block!important}
    body.print-rack-both .rack-print-elevation{margin-bottom:10mm}

    body.print-container-contents .rack-print-elevation,
    body.print-container-contents .container-print-meta{display:none!important}

    .rack-visual-core{grid-template-columns:40px minmax(250px,360px) 40px;gap:8px;margin-left:auto!important;margin-right:auto!important}
    .rack-details-column{width:100%}

    /* Long rack content cards must be allowed to split across pages.
       Otherwise the browser moves the whole card to page 2. */
    body.print-rack-contents .rack-print-contents .rack-card,
    body.print-rack-both .rack-print-contents .rack-card{break-inside:auto;page-break-inside:auto}
    .rack-print-contents thead,.container-print-contents thead{display:table-header-group}
    .rack-print-contents tr,.container-print-contents tr{break-inside:avoid;page-break-inside:avoid}

    table{font-size:9pt}
    th,td{padding:5px 6px}
}

/* Keep rack print controls aligned with the existing selector toolbar. */
.rack-toolbar{grid-template-columns:max-content minmax(240px,1fr) max-content minmax(180px,220px) minmax(260px,340px)}
@media (max-width:1000px){.rack-toolbar{grid-template-columns:1fr}.rack-print-row{grid-template-columns:1fr auto}}

/* Editable connection-point overview */
.cpdef-inline-form{margin-top:.75rem}
.cpdef-inline-table{min-width:860px}
.cpdef-inline-table th{white-space:nowrap}
.cpdef-inline-table td{vertical-align:top}
.cpdef-inline-table input,.cpdef-inline-table select{margin:0;min-width:0}
.cpdef-inline-order{width:5.5rem}
.cpdef-inline-order input{width:5rem}
.cpdef-inline-name{min-width:13rem}
.cpdef-inline-uses{min-width:21rem}
.cpdef-inline-uses .checkbox-list{grid-template-columns:repeat(2,minmax(8.5rem,1fr));margin:0;gap:.2rem .55rem}
.cpdef-inline-actions{margin:.8rem 0 0}
.table-scroll{overflow-x:auto}
@media (max-width:760px){
  .cpdef-inline-table{min-width:760px}
  .cpdef-inline-uses{min-width:18rem}
}

/* Compact declared-use editor for the connection-point overview */
.cpdef-inline-table td{vertical-align:middle}
.cpdef-inline-uses{min-width:16rem}
.cpdef-inline-uses .cpdef-use-summary{display:inline;overflow-wrap:anywhere}
.cpdef-edit-uses{margin:0 0 0 .55rem;padding:.35rem .65rem;white-space:nowrap}
.cpdef-use-dialog{width:min(42rem,calc(100vw - 2rem));max-height:calc(100vh - 2rem);padding:0;border:1px solid var(--border);border-radius:10px;background:var(--card);color:inherit;box-shadow:0 18px 60px rgba(0,0,0,.3)}
.cpdef-use-dialog::backdrop{background:rgba(0,0,0,.48)}
.cpdef-use-dialog-shell{margin:0;padding:1rem}
.cpdef-use-dialog-header{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:.8rem}
.cpdef-use-dialog-header h3{margin:0}
.cpdef-use-dialog-header p{margin:.2rem 0 0}
.dialog-close{width:2.2rem;min-width:2.2rem;padding:.15rem .4rem;font-size:1.5rem;line-height:1;background:transparent;color:inherit;border:0}
.cpdef-use-dialog-list{grid-template-columns:repeat(2,minmax(11rem,1fr));max-height:min(60vh,31rem);overflow:auto;margin:0;padding:.25rem}
.cpdef-use-dialog-list label{padding:.25rem .1rem}
.cpdef-use-dialog-actions{display:flex;align-items:center;gap:.55rem;margin-top:1rem;padding-top:.9rem;border-top:1px solid var(--border)}
.cpdef-use-dialog-spacer{flex:1}
@media (max-width:600px){
  .cpdef-use-dialog-list{grid-template-columns:1fr}
  .cpdef-use-dialog-actions{flex-wrap:wrap}
  .cpdef-use-dialog-spacer{display:none}
}


/* Signal trace endpoint route choice */
.trace-route-choice-dialog{width:min(38rem,calc(100vw - 2rem));padding:0;border:1px solid var(--border);border-radius:10px;background:var(--card);color:inherit;box-shadow:0 18px 60px rgba(0,0,0,.3)}
.trace-route-choice-dialog::backdrop{background:rgba(0,0,0,.48)}
.trace-route-choice-shell{padding:1rem}
.trace-route-choice-actions{display:flex;flex-direction:column;gap:.65rem}
.trace-route-choice-actions button{width:100%;margin:0;text-align:left}

/* Hierarchical location editor */
.location-editor-layout{display:grid;grid-template-columns:minmax(260px,360px) minmax(0,1fr);gap:18px;align-items:start}
.location-tree-card{padding:0;overflow:hidden;position:sticky;top:74px;max-height:calc(100vh - 96px);display:flex;flex-direction:column}
.location-tree-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:16px;border-bottom:1px solid var(--border);background:#fafbfc}
.location-tree-heading h2{padding:0;margin:0 0 3px;background:none;border:0;font-size:1.05rem}
.location-tree-heading p{margin:0}
.location-tree-heading .btn{white-space:nowrap;font-size:.88rem;padding:7px 10px}
.location-tree{padding:10px 8px 14px;overflow:auto}
.location-tree-level{list-style:none;margin:0;padding-left:18px}
.location-tree>.location-tree-level{padding-left:0}
.location-tree-level li{margin:1px 0}
.location-tree-link{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border-radius:5px;color:#174f7d;font-weight:600}
.location-tree-link:hover{background:#edf5fb;text-decoration:none}
.location-tree-link.selected{background:#dceeff;color:#0c4f85;box-shadow:inset 3px 0 #0784d8}
.location-tree-name{min-width:0;overflow-wrap:anywhere}
.location-tree-type{font-size:.72rem;font-weight:500;color:#738194;white-space:nowrap}
.location-detail-card hr{border:0;border-top:1px solid var(--border);margin:22px 0}
.location-breadcrumb{margin:-6px 0 14px;color:#526272;font-weight:600}
.location-summary{display:grid;grid-template-columns:max-content 1fr;gap:4px 12px;margin:0 0 18px;padding-bottom:14px;border-bottom:1px solid var(--border)}
.location-summary dt{font-weight:700;color:#526272}.location-summary dd{margin:0}
.compact-list{margin:8px 0 0;padding-left:20px}
.btn.secondary{background:#e8edf3;color:#1f2937}
@media (max-width:900px){
    .location-editor-layout{grid-template-columns:1fr}
    .location-tree-card{position:static;max-height:none}
    .location-tree{max-height:42vh}
}

/* Bulk tools */
.bulk-tool-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px}
.bulk-tool-card{display:grid;grid-template-columns:auto 1fr;gap:12px 14px;align-items:start;background:#fff;border:1px solid var(--border);border-radius:7px;padding:18px;color:#1f2937;text-decoration:none;box-shadow:0 1px 2px rgba(15,23,42,.03)}
.bulk-tool-card:hover{border-color:#9cb9d2;box-shadow:0 3px 10px rgba(15,23,42,.08);text-decoration:none}
.bulk-tool-icon{grid-row:1 / span 2;font-size:1.55rem;color:#087ed0;width:30px;text-align:center}
.bulk-tool-content{display:flex;flex-direction:column;gap:5px}
.bulk-tool-content strong{font-size:1.05rem;color:#111827}
.bulk-tool-content span{color:#5f6b7a;line-height:1.45}
.bulk-tool-open{grid-column:2;color:#006ecb;font-weight:700;font-size:.9rem}

.bulk-location-toolbar{display:grid;grid-template-columns:minmax(260px,1fr) auto auto;gap:16px;align-items:end;position:sticky;top:58px;z-index:15}
.bulk-location-toolbar input{margin-bottom:0}
.bulk-location-checkbox{display:flex!important;align-items:center;gap:7px;white-space:nowrap;padding-bottom:9px}
.bulk-location-checkbox input{width:auto;margin:0}
.bulk-location-save-area{display:flex;align-items:center;gap:10px;padding-bottom:4px}
.bulk-location-card{padding:0}
.bulk-location-table{min-width:0;table-layout:fixed}
.bulk-location-table th:nth-child(1){width:30%}.bulk-location-table th:nth-child(2){width:34%}.bulk-location-table th:nth-child(3){width:36%}
.bulk-location-table tr.is-changed td{background:#fffbea}
.bulk-location-current{line-height:1.4}
.location-picker-button{width:100%;min-width:0;min-height:2.4rem;height:auto;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;text-align:left;white-space:normal;background:#fff;color:#1f2937;border:1px solid #c6d0da;font-weight:500;line-height:1.35}
.location-picker-button [data-location-label]{flex:1;min-width:0;white-space:normal;overflow-wrap:anywhere;word-break:break-word}
.location-picker-button>span:last-child{flex:0 0 auto;margin-top:2px}
.location-picker-button:hover{filter:none;border-color:#0784d8;background:#f8fbff}
.location-reset-button{background:transparent;color:#006ecb;padding:4px 0;margin-top:3px;font-size:.85rem}
.location-reset-button:hover{filter:none;text-decoration:underline}
.location-picker-dialog{position:fixed;inset:0;z-index:1000;background:rgba(15,23,42,.42);padding:5vh 20px;overflow:auto}
.location-picker-panel{max-width:760px;max-height:90vh;margin:0 auto;background:#fff;border-radius:8px;box-shadow:0 16px 50px rgba(0,0,0,.25);padding:16px;display:flex;flex-direction:column}
.location-picker-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;font-size:1.1rem}
.location-picker-close{background:transparent;color:#334155;font-size:1.6rem;line-height:1;padding:2px 7px}
.location-picker-close:hover{filter:none;background:#eef2f6}
.location-picker-current{margin:0 0 10px;padding:10px 12px;background:#f7f9fb;border:1px solid var(--border);border-radius:6px}
.location-picker-current span,.location-picker-current strong{display:block}
.location-picker-current strong{margin-top:3px;line-height:1.35;overflow-wrap:anywhere}
.location-picker-panel>input{margin:0 0 10px}
.location-picker-options{overflow:auto;border:1px solid var(--border);border-radius:6px;min-height:180px}
.location-picker-option{display:block;width:100%;text-align:left;background:#fff;color:#1f2937;border:0;border-bottom:1px solid #edf0f3;border-radius:0;padding:8px 12px 8px calc(12px + (var(--location-depth, 0) * 20px));font-weight:500}
.location-picker-option:last-child{border-bottom:0}
.location-picker-option:hover{filter:none;background:#eef6ff}
.location-picker-option small{display:block;color:#6b7280;font-weight:400;margin-top:2px;white-space:normal}
.location-picker-none{background:#fafbfc;padding-left:12px}
body.location-picker-open{overflow:hidden}
@media (max-width:900px){.bulk-location-toolbar{grid-template-columns:1fr;position:static}.bulk-location-checkbox{padding-bottom:0}.bulk-location-save-area{justify-content:space-between}.bulk-tool-grid{grid-template-columns:1fr}}

/* Venue Explorer */
.explorer-toolbar{display:grid;grid-template-columns:minmax(280px,1fr) auto auto;gap:16px;align-items:end}
.explorer-toolbar input{margin-bottom:0}
.explorer-check{display:flex!important;align-items:center;gap:7px;white-space:nowrap;padding-bottom:9px}
.explorer-check input{width:auto;margin:0}
.explorer-actions{display:flex;gap:8px;padding-bottom:4px}
.venue-explorer-card{padding:0;overflow:hidden}
.venue-explorer-heading{padding:14px 16px;border-bottom:1px solid var(--border);background:#fafbfc}
.venue-explorer-heading strong{display:block}
#venue-explorer-status:not(:empty){padding:9px 16px;border-bottom:1px solid var(--border)}
.venue-explorer-tree,.explorer-branch{list-style:none;margin:0;padding:0}
.venue-explorer-tree{padding:8px 10px 14px}
.explorer-branch{margin-left:18px;padding-left:13px;border-left:1px solid #dbe3ea}
.explorer-node{margin:2px 0}
.explorer-details>summary,.explorer-leaf{display:flex;align-items:flex-start;gap:8px;padding:7px 9px;border-radius:5px;min-width:0}
.explorer-details>summary{cursor:pointer;list-style:none}
.explorer-details>summary::-webkit-details-marker{display:none}
.explorer-details>summary::before{content:'›';width:12px;flex:0 0 12px;margin-top:1px;color:#667585;font-weight:700;transition:transform .12s ease}
.explorer-details[open]>summary::before{transform:rotate(90deg)}
.explorer-leaf::before{content:'';width:12px;flex:0 0 12px}
.explorer-details>summary:hover,.explorer-leaf:hover{background:#edf5fb}
.explorer-icon{width:18px;height:18px;flex:0 0 18px;display:inline-flex;align-items:center;justify-content:center;color:#526579;margin-top:1px}
.explorer-icon-svg{display:block;width:18px;height:18px}
.explorer-main{min-width:0;flex:1;overflow-wrap:anywhere}
.explorer-location-main,.explorer-label-line{display:flex;align-items:baseline;gap:7px;flex-wrap:wrap}
.explorer-object-main{display:block}
.explorer-location-badge,.explorer-kind-badge,.explorer-count-badge{display:inline-flex;align-items:center;padding:1px 7px;border:1px solid #d5dde5;border-radius:999px;background:#f4f6f8;color:#657383;font-size:.72rem;font-weight:500;line-height:1.45;white-space:nowrap;text-transform:capitalize}
.explorer-count-badge{min-width:1.55rem;justify-content:center;text-transform:none}
.explorer-main>a,.explorer-label-line>a{font-weight:600}
.explorer-meta{display:block;color:#6b7280;font-size:.82rem;margin-top:2px}
.explorer-empty{color:#7a8794;font-size:.84rem;padding:5px 10px 8px 49px}
.explorer-cycle{color:#a33;padding:6px 10px}
.explorer-node[hidden]{display:none!important}
@media (max-width:900px){
  .explorer-toolbar{grid-template-columns:1fr}
  .explorer-check{padding-bottom:0}
  .explorer-actions{padding-bottom:0;flex-wrap:wrap}
  .explorer-branch{margin-left:9px;padding-left:8px}
  .explorer-details>summary,.explorer-leaf{padding-left:5px;padding-right:5px}
}

/* 0.5.34: bulk installed connection-point label editor */
.bulk-cp-order-toolbar{display:grid;grid-template-columns:minmax(260px,1fr) auto auto;align-items:end;gap:16px;position:sticky;top:0;z-index:5}
.bulk-cp-filter input{margin-bottom:0}.bulk-cp-checkbox{display:flex;align-items:center;gap:7px;white-space:nowrap;padding-bottom:9px}.bulk-cp-checkbox input,.bulk-cp-select-col input{width:auto}.bulk-cp-save-area{display:flex;align-items:center;justify-content:flex-end;gap:10px;white-space:nowrap}.bulk-cp-sequence-card{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:8px 20px;align-items:end}.bulk-cp-sequence-card p{margin-bottom:0}.bulk-cp-sequence-controls{display:flex;align-items:end;gap:10px;flex-wrap:wrap}.bulk-cp-sequence-controls label{margin-top:0}.bulk-cp-sequence-controls input{width:100px;margin-bottom:0}.bulk-cp-sequence-controls button{white-space:nowrap}.bulk-cp-order-table{min-width:820px}.bulk-cp-order-table th,.bulk-cp-order-table td{vertical-align:middle}.bulk-cp-select-col{width:42px;text-align:center}.bulk-cp-current-order{width:110px}.bulk-cp-order-input{width:180px;margin:0}.bulk-cp-order-table tr.is-changed td{background:rgba(255,193,7,.10)}
@media(max-width:850px){.bulk-cp-order-toolbar{grid-template-columns:1fr;position:static}.bulk-cp-checkbox{padding-bottom:0}.bulk-cp-save-area{justify-content:flex-start}.bulk-cp-sequence-card{grid-template-columns:1fr}.bulk-cp-sequence-controls{align-items:end}}

/* 0.5.35: protect installed connection-point prefixes during bulk field-label editing */
.bulk-cp-protected-label {
    display: flex;
    align-items: center;
    gap: .35rem;
}
.bulk-cp-protected-label > span {
    white-space: pre;
    flex: 0 0 auto;
}
.bulk-cp-protected-label .bulk-cp-order-input {
    min-width: 5rem;
    flex: 1 1 auto;
}
