*{box-sizing:border-box}
:root{
  --radius:4px;
  --bg:#090909;
  --surface:#121212;
  --surface-soft:#1a1a1a;
  --surface-strong:#242424;
  --topbar:#0e0e0e;
  --sidebar:#070707;
  --sidebar-hover:#171717;
  --sidebar-text:#eeeeee;
  --sidebar-muted:#8d8d8d;
  --border:#303030;
  --border-strong:#565656;
  --text:#f4f4f4;
  --muted:#bcbcbc;
  --table-text:#c8c8c8;
  --table-link:#f4f4f4;
  --primary:#dddddd;
  --primary-strong:#2b2b2b;
  --primary-strong-hover:#363636;
  --button-soft:#1d1d1d;
  --button-soft-hover:#292929;
  --button-soft-text:#f4f4f4;
  --input-bg:#101010;
  --selected-row:#303030;
  --danger-soft:#242424;
  --danger-soft-hover:#303030;
  --danger-soft-text:#dddddd;
  --assignment-low-bg:#24190d;
  --assignment-busy-bg:#3a2812;
  --assignment-full-bg:#4b3110;
  --teal:#dddddd;
  --green:#66c98f;
  --amber:#d8a657;
  --red:#e46f72;
  --shadow:0 18px 44px rgba(0,0,0,.32);
}

body[data-theme="blue-light"]{
  --bg:#dfe7f0;
  --surface:#eef4fa;
  --surface-soft:#e5edf6;
  --surface-strong:#d5e1ef;
  --topbar:#e8eef6;
  --sidebar:#0d1520;
  --sidebar-hover:#1a2a43;
  --sidebar-text:#d7e2ee;
  --sidebar-muted:#728299;
  --border:#b5c4d6;
  --border-strong:#8499b3;
  --text:#172333;
  --muted:#4f6177;
  --table-text:#172333;
  --table-link:#2d6fb5;
  --primary:#2d6fb5;
  --primary-strong:#245f9f;
  --primary-strong-hover:#1f528a;
  --button-soft:#d5e1ef;
  --button-soft-hover:#c8d8eb;
  --button-soft-text:#172333;
  --input-bg:#eef4fa;
  --selected-row:#c7d9ee;
  --danger-soft:#f0dada;
  --danger-soft-hover:#e8caca;
  --danger-soft-text:#a43f3f;
  --assignment-low-bg:#f4ead8;
  --assignment-busy-bg:#f0dcc0;
  --assignment-full-bg:#eccb96;
  --teal:#2d6fb5;
  --green:#245f9f;
  --amber:#9b650e;
  --red:#a43f3f;
  --shadow:0 14px 34px rgba(35,50,60,.12);
}

body[data-theme="graphite-gold"]{
  --bg:#171717;
  --surface:#202020;
  --surface-soft:#262626;
  --surface-strong:#303030;
  --topbar:#1b1b1b;
  --sidebar:#121212;
  --sidebar-hover:#2a271f;
  --sidebar-text:#d1cbc1;
  --sidebar-muted:#7f796e;
  --border:#3c3c3c;
  --border-strong:#5a5447;
  --text:#ece7da;
  --muted:#c9c0b3;
  --table-text:#eee5d6;
  --table-link:#d3a84f;
  --primary:#d3a84f;
  --primary-strong:#5d431e;
  --primary-strong-hover:#745426;
  --button-soft:#303030;
  --button-soft-hover:#39352d;
  --button-soft-text:#ece7da;
  --input-bg:#1b1b1b;
  --selected-row:#332d20;
  --danger-soft:#301d1c;
  --danger-soft-hover:#3b2423;
  --danger-soft-text:#d66a63;
  --assignment-low-bg:#332514;
  --assignment-busy-bg:#3f3015;
  --assignment-full-bg:#57401a;
  --teal:#d3a84f;
  --green:#f0cf7a;
  --amber:#d79a3b;
  --red:#d66a63;
  --shadow:0 18px 44px rgba(0,0,0,.3);
}

body{margin:0;background:var(--bg);color:var(--text);font:13px/1.5 var(--tblr-font-sans-serif,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif)}
a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:none}
code,.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}

.app-shell{display:grid;grid-template-columns:240px minmax(0,1fr);min-height:100vh}
.sidebar{background:var(--sidebar);color:var(--sidebar-text);display:flex;flex-direction:column;padding:18px 14px;position:sticky;top:0;height:100vh}
.brand-block{display:flex;gap:12px;align-items:center;padding:4px 8px 20px}
.brand-mark{width:38px;height:38px;border-radius:var(--radius);background:rgba(0,0,0,.28);border:1px solid rgba(255,255,255,.12);display:grid;place-items:center;font-size:13px;font-weight:600;color:var(--primary)}
.brand-title{font-size:14px;font-weight:600}
.side-nav{display:flex;flex-direction:column;gap:4px}
.nav-section{padding:14px 10px 6px;font-size:11px;color:var(--sidebar-muted);text-transform:uppercase;letter-spacing:.06em}
.side-nav a{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:var(--radius);color:var(--sidebar-text);font-size:13px;font-weight:500}
.side-nav a:hover{background:var(--sidebar-hover)}
.side-nav .nav-group{margin:0}
.side-nav .nav-group summary{display:flex;align-items:center;gap:10px;padding:9px 10px;border-radius:var(--radius);color:var(--sidebar-text);font-size:13px;font-weight:500;list-style:none;cursor:pointer;user-select:none}
.side-nav .nav-group summary:hover{background:var(--sidebar-hover)}
.side-nav .nav-group summary::-webkit-details-marker{display:none}
.side-nav .nav-group summary::after{content:"";margin-left:auto;width:7px;height:7px;border-right:1.5px solid var(--sidebar-muted);border-bottom:1.5px solid var(--sidebar-muted);transform:rotate(45deg);transition:transform .16s ease,border-color .16s ease}
.side-nav .nav-group[open] summary::after{transform:rotate(225deg);border-color:var(--sidebar-text)}
.side-nav .nav-group[open] summary{background:var(--sidebar-hover)}
.side-nav .nav-group-items{display:flex;flex-direction:column;gap:4px;margin-top:4px}
.side-nav .nav-subitem{padding:8px 10px 8px 34px;font-size:12px;font-weight:500;color:var(--sidebar-muted)}
.side-nav .nav-subitem:hover{background:var(--sidebar-hover);color:var(--sidebar-text)}
.side-nav .nav-subicon{width:22px;height:20px;font-size:9px}
.side-nav .nav-subicon .ui-icon{width:12px;height:12px}
.nav-icon{width:28px;height:24px;border-radius:3px;border:1px solid rgba(255,255,255,.12);display:grid;place-items:center;font-size:10px;color:var(--primary)}
.nav-icon .ui-icon{width:14px;height:14px;stroke-width:1.75}

.workspace{min-width:0}
.topbar{height:60px;background:var(--topbar);border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:100}
.topbar h1{margin:0;font-size:18px;font-weight:600}
.crumb,.eyebrow{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em}
.topbar-actions{display:flex;align-items:center;gap:8px}
.topbar-icon-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;min-height:32px;padding:0;border-radius:var(--radius);border:1px solid var(--border-strong);background:var(--button-soft);color:var(--button-soft-text)}
.topbar-icon-btn:hover{background:var(--button-soft-hover);border-color:var(--primary);color:var(--text)}
.topbar-icon-btn .ui-icon{width:16px;height:16px}
.topbar-dot{position:absolute;right:6px;top:6px;width:6px;height:6px;border-radius:999px;background:var(--red)}
.theme-menu{position:relative}
.theme-menu-panel{position:fixed;right:28px;top:54px;min-width:132px;padding:6px;border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow);z-index:9999}
.theme-menu-panel button{display:flex;width:100%;justify-content:flex-start;min-height:28px;border-color:transparent;background:transparent;color:var(--text)}
.theme-menu-panel button:hover,.theme-menu-panel button[aria-pressed="true"]{background:var(--surface-strong);border-color:var(--border)}
main{padding:24px 28px 36px;max-width:1440px}

.hero-band{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;margin-bottom:18px;padding:8px 2px}
.hero-band h2{margin:4px 0 6px;font-size:21px;font-weight:600;line-height:1.25}

.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:16px 18px;margin:14px 0;box-shadow:var(--shadow);color:var(--text)}
.card h2{margin:0 0 8px;font-size:15px;font-weight:600;color:var(--text)}
.card h3{margin:0 0 6px;font-size:13px;font-weight:600;color:var(--text)}
.section-title{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:12px}
.title-with-icon{display:flex;align-items:center;gap:8px}
.title-with-icon .ui-icon{width:16px;height:16px;color:var(--primary)}
.muted{color:var(--muted)}
.small{font-size:12px}
.form-hint{color:var(--muted);font-size:12px;line-height:1.35}

.btn,button,input,select,textarea{font:inherit}
.btn,button{display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:5px 10px;border-radius:var(--radius);border:1px solid var(--border-strong);background:var(--button-soft);color:var(--button-soft-text);cursor:pointer;font-size:11px;font-weight:500;line-height:1.15;min-height:30px;transition:background-color .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease}
.btn:hover,button:hover{background:var(--button-soft-hover);border-color:#c3ccd6}
.btn.primary,button.primary{background:var(--primary-strong);border-color:var(--primary-strong);color:#f8fafc}
.btn.primary:hover,button.primary:hover{background:var(--primary-strong-hover);border-color:var(--primary-strong-hover)}
.btn.secondary,button.secondary,.btn.ghost{background:var(--button-soft);border-color:var(--border-strong);color:var(--button-soft-text)}
.btn.secondary:hover,button.secondary:hover,.btn.ghost:hover{background:var(--button-soft-hover);border-color:#c3ccd6}
.btn.danger,button.danger{background:var(--danger-soft);border-color:#e7d5d5;color:var(--danger-soft-text)}
.btn.danger:hover,button.danger:hover{background:var(--danger-soft-hover);border-color:#dbc4c4}
button:disabled,.btn:disabled{opacity:.55;cursor:not-allowed}
input,select,textarea{width:100%;padding:8px 10px;border-radius:var(--radius);border:1px solid var(--border-strong);background:var(--input-bg);color:var(--text);font-size:12px}
textarea{min-height:140px;line-height:1.55}

.msg,.error{padding:12px 14px;border-radius:var(--radius);margin:12px 0;white-space:pre-wrap}
.msg{background:var(--surface-soft);border:1px solid var(--border-strong);color:var(--green)}
.error{background:var(--danger-soft);border:1px solid var(--danger-soft-hover);color:var(--danger-soft-text)}

.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.stat{padding:14px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow)}
.stat .k{font-size:12px;color:var(--muted)}
.metric-label{display:flex;align-items:center;gap:6px}
.metric-label .ui-icon{width:14px;height:14px}
.stat .v{margin-top:8px;font-size:22px;font-weight:400;line-height:1;color:var(--text)}
.stat .hint{margin-top:6px;font-size:12px;color:var(--muted)}
.accent-teal .v{color:var(--teal)}
.accent-green .v{color:var(--green)}
.accent-slate .v{color:var(--muted)}
.accent-amber .v{color:var(--amber)}

.table-tools{display:flex;gap:8px;align-items:center}
.table-wrap{overflow:auto;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface)}
table{width:100%;border-collapse:collapse;min-width:900px}
th,td{padding:8px 12px;border-bottom:1px solid var(--border);text-align:left;vertical-align:middle;line-height:1.25;color:var(--table-text)}
th{background:var(--surface-soft);font-size:12px;font-weight:600;color:var(--muted)}
.table-wrap td a{color:var(--table-link)}
.table-wrap td a:hover{color:var(--text)}
.table-wrap td .table-key{color:var(--table-link)}
tbody tr:hover{background:var(--surface-soft)}
tbody tr.selected{background:var(--selected-row)}
tbody tr.selected td{color:var(--text)}
tbody tr.selected .mono,
tbody tr.selected .table-key,
tbody tr.selected a,
tbody tr.selected strong{color:var(--text)}
.checkbox-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}
.checkbox-card{display:flex;flex-direction:column;gap:4px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-soft)}
.checkbox-card input{margin:0 0 4px}
.checkbox-card-title{font-size:13px}
.checkbox-card-meta{font-size:12px;color:var(--muted)}
tbody tr[data-profile-row],
tbody tr[data-nav-row]{cursor:pointer}

.device-cell{display:flex;align-items:center;gap:12px;min-width:220px}
.device-avatar{width:32px;height:32px;border-radius:var(--radius);background:var(--surface-strong);color:var(--primary);display:grid;place-items:center}
.device-avatar .ui-icon{width:18px;height:18px}
.device-name{font-size:13px;font-weight:400;color:var(--table-link)}
.device-meta-line{display:flex;flex-wrap:wrap;gap:8px;margin-top:3px;font-size:11px;color:var(--muted)}
.status-dot{display:inline-block;width:8px;height:8px;border-radius:999px;margin-right:6px;vertical-align:middle}
.status-dot.ok{background:var(--green)}
.status-dot.bad{background:var(--red)}
.status-text{font-size:12px;font-weight:500}
.config-inline{display:flex;flex-direction:column;gap:4px}
.device-id-inline{margin-top:6px}
.state-stack{display:flex;flex-direction:column;gap:6px}
.state-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px}

.pill{display:inline-flex;align-items:center;min-height:20px;padding:1px 6px;border-radius:3px;border:1px solid var(--border);background:var(--surface-strong);color:var(--button-soft-text);font-size:11px;font-weight:500;line-height:1.1}
.pill.ok{background:var(--surface-soft);border-color:var(--border-strong);color:var(--green)}
.pill.bad{background:var(--danger-soft);border-color:var(--danger-soft-hover);color:var(--danger-soft-text)}
.pill.run{background:var(--surface-soft);border-color:var(--border-strong);color:var(--primary)}
.pill.warn{background:var(--surface-soft);border-color:var(--border-strong);color:var(--amber)}

.actions{display:flex;flex-wrap:wrap;gap:8px}
.actions.compact{gap:6px}
.actions.compact .btn,.actions.compact button{padding:4px 8px;font-size:11px;line-height:1.1;min-height:28px}
.btn .ui-icon{width:14px;height:14px}
.stack{flex-direction:column;align-items:flex-start}
.device-context-head{display:flex;align-items:center;gap:12px}
.device-context-icon{width:32px;height:32px;border-radius:var(--radius);background:var(--surface-strong);color:var(--primary);display:grid;place-items:center}
.device-context-icon .ui-icon{width:18px;height:18px}
.device-tab-wrap{margin-top:16px}
.asset-tab-wrap{margin-top:0}
.device-tab-card{margin-top:-1px;padding:0}
.asset-tab-card{margin-top:-1px;padding:0}
.device-panel-body{padding:16px}
.asset-panel-body{padding:16px}
.device-panel-body>.card,.device-panel-body>details.card{margin:0 0 16px}
.asset-panel-body>.card,.asset-panel-body>details.card{margin:0 0 16px}
.device-panel-body>.card:last-child,.device-panel-body>details.card:last-child{margin-bottom:0}
.asset-panel-body>.card:last-child,.asset-panel-body>details.card:last-child{margin-bottom:0}

.detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.device-selector-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.quad-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.control-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.selector-card .actions{margin-top:auto}
.panel-block{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-soft);padding:14px}
.panel-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.service-actions-row{margin-top:16px}
.scene-config-form{margin-top:14px}
.scene-summary-details{margin-top:12px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface)}
.scene-summary-details summary{display:flex;align-items:center;gap:8px;cursor:pointer;font-size:12px;font-weight:500;color:var(--muted);list-style:none}
.scene-summary-details summary::before{content:"";width:7px;height:7px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);transition:transform .16s ease}
.scene-summary-details summary::-webkit-details-marker{display:none}
.scene-summary-details[open] summary::before{transform:rotate(45deg)}
.scene-summary-details[open] summary{margin-bottom:10px;color:var(--text)}
.scene-summary-details .info-list{margin-top:0}
.mini-details summary{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:12px;color:var(--table-link);list-style:none}
.mini-details summary::before{content:"";width:7px;height:7px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(-45deg);transition:transform .16s ease}
.mini-details summary::-webkit-details-marker{display:none}
.mini-details[open] summary::before{transform:rotate(45deg)}
.mini-details-body{margin-top:8px;padding:8px 10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-soft)}
.mini-details-item{font-size:11px;line-height:1.5;color:var(--text)}
.mini-details-item+.mini-details-item{margin-top:4px}
.models-status-table .model-status-col{min-width:92px;max-width:124px;vertical-align:bottom}
.models-status-table .model-status-label{display:block;font-size:11px;line-height:1.25;white-space:normal;word-break:break-word;overflow-wrap:anywhere}
.models-status-table .model-extra-col{min-width:150px}
.scene-actions-row{margin-top:12px}
.field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:14px}
.field-grid label>span{display:block;margin-bottom:6px;font-size:12px;color:var(--muted)}
.field-grid label>span .required-mark{display:inline;color:var(--red);font-weight:600;margin-left:4px}
.field-grid .full{grid-column:1/-1}
.field-grid input,.field-grid select,.field-grid textarea{width:100%;padding:9px 10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--input-bg);color:var(--text);font:inherit}
.field-grid textarea{resize:vertical;min-height:120px}
.code-input{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:12px;line-height:1.5}

.info-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.info-list>div{padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-soft)}
.info-list span{display:block;margin-bottom:5px;font-size:12px;color:var(--muted)}
.info-list strong{display:block;font-size:13px;font-weight:400;line-height:1.45}
.detail-sheet{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.detail-item{padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-soft)}
.detail-item.full{grid-column:1/-1}
.detail-item span{display:block;margin-bottom:5px;font-size:12px;color:var(--muted)}
.detail-item strong{display:block;font-size:13px;font-weight:400;line-height:1.45;color:var(--text)}
.form-state-hint{margin-top:6px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.editor-state.readonly .section-title{padding-bottom:8px;border-bottom:1px solid var(--border)}
.editor-state.editing{border-color:var(--border-strong);box-shadow:0 0 0 1px rgba(255,255,255,.03),var(--shadow)}
.editor-state.editing .section-title{padding-bottom:10px;border-bottom:1px solid var(--border-strong)}
.editor-state.editing .field-grid label>span{color:var(--text)}
.editor-state.editing .field-grid input,
.editor-state.editing .field-grid select,
.editor-state.editing .field-grid textarea{border-color:var(--border-strong);background:var(--surface)}
.editor-state.editing .profile-instance-grid{margin-top:16px}
.editable-line{display:flex;align-items:center;justify-content:space-between;gap:8px}
.editable-line strong{margin:0;flex:1 1 auto}
.icon-only{display:inline-flex;align-items:center;justify-content:center;padding:0;min-width:28px;width:28px;height:28px}
.icon-only .ui-icon{width:14px;height:14px;margin:0 auto}
.btn.ghost.icon-only{background:transparent;border-color:transparent;color:var(--muted)}
.btn.ghost.icon-only:hover{background:var(--surface-strong);border-color:var(--border);color:var(--text)}
.inline-edit-form{display:flex;align-items:center;gap:8px}
.inline-edit-form input{flex:1 1 auto;min-width:0}
.compact-list{grid-template-columns:1fr}

.summary-strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.control-summary{margin-bottom:16px}
.summary-chip{padding:12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-soft)}
.summary-chip-label{font-size:12px;color:var(--muted)}
.summary-chip-value{margin-top:6px;font-size:13px;font-weight:600}

.asset-stat{margin-top:12px;font-size:20px;font-weight:400;color:var(--text)}
.asset-list{margin-top:14px;border-top:1px solid var(--border)}
.asset-row{display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid var(--border)}
.asset-link{color:inherit}
.asset-link>span:first-child{color:var(--table-link)}
.asset-link:hover{background:var(--surface-soft)}
.truncate-cell{max-width:260px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.muted-row{opacity:.62}
.asset-tabs .nav-link{font-size:12px;font-weight:500;color:var(--muted)}
.asset-tabs .nav-link:hover{color:var(--text)}
.asset-tabs .nav-link.active{color:var(--text)}
.nav-tabs{border-color:var(--border)}
.nav-tabs .nav-link{border-color:var(--border)!important;border-radius:var(--radius) var(--radius) 0 0;background:var(--surface-soft)!important;color:var(--muted)!important}
.nav-tabs .nav-link:hover{border-color:var(--border-strong)!important;background:var(--surface-strong)!important;color:var(--text)!important}
.nav-tabs .nav-item.show .nav-link,.nav-tabs .nav-link.active{border-color:var(--border)!important;background:var(--surface)!important;color:var(--text)!important}
.profile-editor-tabs .tab-content>.card{margin-top:-1px}
.nested-section{margin-top:14px;padding:14px}
.nested-section pre{margin-top:10px}
.profile-instance-editor .field-grid{margin-top:14px}

.empty-state{padding:18px;border:1px dashed var(--border-strong);border-radius:var(--radius);background:var(--surface-soft)}
.empty-state.compact{padding:14px}
.empty-title{font-size:13px;font-weight:600;margin-bottom:6px}

.collapsible summary,.collapsible-inline summary{cursor:pointer;font-weight:600}
pre{margin-top:12px;padding:12px;border-radius:var(--radius);border:1px solid var(--border);background:var(--sidebar);color:var(--sidebar-text);overflow:auto;white-space:pre-wrap}

.row{display:flex;gap:12px;flex-wrap:wrap}
.row>*{flex:1 1 220px}
.subnav{display:flex;gap:8px;flex-wrap:wrap}
.device-tab-wrap{margin-top:16px}
.device-tabs .nav-link{font-size:12px;font-weight:500;color:var(--muted)}
.device-tabs .nav-link:hover{color:var(--text)}
.device-tabs .nav-link.active{color:var(--text)}
.device-tab-card{margin-top:0}
.device-panel-body{padding:16px}
.device-panel-body>.card,.device-panel-body>details.card{margin:0 0 16px}
.device-panel-body>.card:last-child,.device-panel-body>details.card:last-child{margin-bottom:0}
.ui-icon{display:block;flex:0 0 auto}

.batch-toolbar{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:14px 16px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-soft);margin:0 0 12px}
.batch-toolbar-count{font-size:13px;font-weight:600}
.batch-toolbar .actions{justify-content:flex-end}
.batch-toolbar .actions .btn,.batch-toolbar .actions button{white-space:nowrap}
.select-cell{width:52px;text-align:center;vertical-align:middle}
.select-cell input[type=checkbox]{width:16px;height:16px;margin:0;accent-color:var(--primary)}

.assignment-board-page .section-title{margin-bottom:10px}
.assignment-kpis{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin-bottom:14px}
.assignment-kpi{padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-soft)}
.assignment-kpi span{display:block;font-size:12px;color:var(--muted)}
.assignment-kpi strong{display:block;margin-top:6px;font-size:18px;font-weight:400;color:var(--text)}
.assignment-action-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:12px}
.assignment-slider{display:flex;align-items:center;gap:10px;min-width:260px}
.assignment-slider span{font-size:12px;color:var(--muted)}
.assignment-slider strong{font-size:12px;font-weight:500;color:var(--text)}
.assignment-slider input[type=range]{width:180px}
.assignment-board-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-top:12px}
.assignment-device-card{padding:10px 11px;border:1px solid var(--border);border-radius:var(--radius);background:var(--assignment-low-bg)}
.assignment-device-card.state-idle{background:var(--surface-soft)}
.assignment-device-card.state-low{background:var(--assignment-low-bg)}
.assignment-device-card.state-busy{background:var(--assignment-busy-bg)}
.assignment-device-card.state-full{background:var(--assignment-full-bg)}
.assignment-device-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;margin-bottom:8px}
.assignment-device-head h3{margin:0;font-size:13px;font-weight:500;color:var(--text)}
.assignment-device-head .mono{display:block;margin-top:4px;font-size:11px;color:var(--muted)}
.assignment-device-metrics{display:flex;align-items:center;gap:8px}
.assignment-device-metrics strong{font-size:12px;font-weight:500;color:var(--text)}
.assignment-chip-list{display:flex;flex-wrap:wrap;gap:6px;min-height:24px}
.assignment-chip{display:inline-flex;align-items:center;gap:5px;padding:4px 7px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface)}
.assignment-chip-unassigned{background:var(--surface-strong)}
.assignment-chip-text{font-size:11px;color:var(--text)}
.assignment-chip-remove{border:0;background:transparent;color:var(--muted);padding:0;line-height:1;cursor:pointer}
.assignment-chip-remove:hover{color:var(--text)}
.assignment-device-add{display:flex;gap:6px;align-items:center;margin-top:10px}
.assignment-device-add select{flex:1 1 auto;padding:7px 8px;border:1px solid var(--border);border-radius:var(--radius);background:var(--input-bg);color:var(--text);font:inherit}
.assignment-unassigned{margin-top:16px;padding-top:4px}

@media (max-width:1400px){
  .assignment-board-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}

@media (max-width:900px){
  .assignment-board-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width:1024px){
  .app-shell{grid-template-columns:1fr}
  .sidebar{position:relative;height:auto}
  .topbar{position:relative;height:auto;padding:18px;flex-direction:column;align-items:flex-start;gap:12px}
  .theme-menu{display:flex;flex-direction:column;align-items:flex-start}
  main{padding:18px}
  .stats,.detail-grid,.device-selector-grid,.quad-grid,.control-grid,.summary-strip,.info-list,.field-grid{grid-template-columns:1fr}
  .hero-band{flex-direction:column;align-items:flex-start}
  .batch-toolbar{flex-direction:column}
  .assignment-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
  .assignment-board-grid{grid-template-columns:1fr}
}
