/* NNN Console shell, components and visualization baseline MMM */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(34, 211, 238, 0.18); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(34, 211, 238, 0.34); }

#app { position: relative; z-index: 1; min-height: 100vh; }

/* Top bar */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 60;
  display: flex; align-items: center; gap: 18px; padding: 0 18px;
  background: linear-gradient(180deg, rgba(12, 24, 40, 0.98), rgba(9, 19, 33, 0.96));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.topbar::after {
  content: ""; position: absolute; bottom: -1px; left: 0; width: 240px; height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 246px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(145deg, #0ea5e9, #06b6d4 55%, #0e7490);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-name { font-size: 14px; font-weight: 700; letter-spacing: 0.4px; line-height: 1.15; }
.brand-sub { font-size: 9px; color: var(--cyan); letter-spacing: 1.5px; font-family: var(--mono); margin-top: 3px; }
.topnav { display: flex; align-items: center; gap: 4px; flex: 1; }
.topnav-item {
  display: flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 6px;
  font-size: 12px; color: var(--text-2); border: 1px solid transparent; transition: all .18s ease;
}
.topnav-item:hover { color: var(--text); background: rgba(34, 211, 238, 0.06); }
.topnav-item.active { color: var(--cyan-3); border-color: var(--line-2); background: var(--cyan-fill); }
.topnav-item .idx { font-family: var(--mono); font-size: 9px; opacity: .6; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.link-pill {
  display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2);
  padding: 5px 9px; border: 1px solid var(--line-soft); border-radius: 5px; font-family: var(--mono);
}
.link-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.avatar {
  width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #06222b;
  background: linear-gradient(145deg, var(--cyan-3), var(--cyan-2));
}

/* Sidebar */
.sidebar {
  position: fixed; top: 56px; bottom: 26px; left: 0; width: 228px; z-index: 50;
  background: rgba(9, 19, 33, 0.92); border-right: 1px solid var(--line);
  overflow-y: auto; overflow-x: hidden; padding: 12px 8px 18px;
  backdrop-filter: blur(10px);
}
.side-group { margin-bottom: 8px; }
.side-group-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 10px 5px; cursor: pointer; user-select: none;
}
.side-group-name { font-size: 11px; font-weight: 600; color: var(--text-2); letter-spacing: .3px; }
.side-group-en { font-family: var(--mono); font-size: 8.5px; color: var(--text-4); letter-spacing: 1px; }
.side-group-head .chev { font-size: 10px; color: var(--text-4); transition: transform .2s ease; }
.side-group.collapsed .chev { transform: rotate(-90deg); }
.side-group.collapsed .side-items { display: none; }
.side-item {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 7px 10px 7px 14px; margin: 1px 0; border-radius: 5px;
  font-size: 12px; color: var(--text-2); transition: all .16s ease;
}
.side-item:hover { color: var(--text); background: rgba(34, 211, 238, 0.05); }
.side-item.active { color: var(--cyan-3); background: var(--cyan-fill); font-weight: 600; }
.side-item.active::before {
  content: ""; position: absolute; left: 3px; top: 7px; bottom: 7px; width: 2px;
  border-radius: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan);
}
.side-item .sid { font-family: var(--mono); font-size: 9px; color: var(--text-4); min-width: 26px; }
.side-item.active .sid { color: var(--cyan); }
.side-item .nm { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot { margin: 12px 6px 0; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: rgba(34, 211, 238, 0.03); }
.side-foot-row { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-3); margin-bottom: 5px; }
.side-foot-row b { color: var(--cyan); font-family: var(--mono); font-weight: 500; }

/* Main */
.main { margin-left: 228px; padding: 74px 18px 46px; min-height: 100vh; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.page-title-wrap { display: flex; align-items: center; gap: 12px; }
.page-index {
  font-family: var(--mono); font-size: 11px; color: var(--cyan);
  border: 1px solid var(--line-2); border-radius: 4px; padding: 3px 6px; background: var(--cyan-fill);
}
.page-title { font-size: 21px; font-weight: 650; letter-spacing: .3px; margin: 0; line-height: 1.2; }
.page-en { font-family: var(--mono); font-size: 9.5px; color: var(--cyan); letter-spacing: 2px; margin-top: 5px; }
.page-desc { font-size: 11.5px; color: var(--text-3); margin-top: 6px; }
.page-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.crumb { font-size: 10.5px; color: var(--text-4); font-family: var(--mono); margin-right: 6px; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar-stat { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-3); font-family: var(--mono); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 5px 10px; font-size: 10.5px; color: var(--text-3); font-family: var(--mono); }
.seg button.on { background: var(--cyan-fill); color: var(--cyan-3); }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.grid > * { min-width: 0; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

/* Card */
.card {
  position: relative; background: linear-gradient(160deg, rgba(17, 31, 50, 0.96), rgba(12, 25, 41, 0.96));
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  animation: rise .34s ease both;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.42), transparent 46%);
}
.card-head {
  display: flex; align-items: center; gap: 9px; padding: 10px 13px;
  border-bottom: 1px solid var(--line-soft); min-height: 38px;
}
.card-head::before { content: ""; width: 2px; height: 12px; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.card-title { font-size: 12.5px; font-weight: 600; letter-spacing: .2px; }
.card-en { font-family: var(--mono); font-size: 8.5px; color: var(--text-4); letter-spacing: 1.3px; margin-left: 2px; }
.card-head .tail { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.card-body { padding: 13px; }
.card-note { padding: 8px 13px 11px; font-size: 10.5px; color: var(--text-4); border-top: 1px solid var(--line-soft); }
.card-corner { position: absolute; top: 8px; right: 10px; display: flex; gap: 3px; }
.card-corner i { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); display: block; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 5px; padding: 6px 12px; font-size: 11.5px; border: 1px solid var(--line-2);
  background: rgba(34, 211, 238, 0.05); color: var(--text-2); transition: all .16s ease; white-space: nowrap;
}
.btn:hover { color: var(--text); border-color: var(--line-3); background: rgba(34, 211, 238, 0.10); }
.btn-primary { color: #04222c; font-weight: 650; border-color: transparent; background: linear-gradient(135deg, var(--cyan-3), var(--cyan-2)); box-shadow: 0 0 16px rgba(34, 211, 238, 0.22); }
.btn-primary:hover { color: #04222c; box-shadow: 0 0 22px rgba(34, 211, 238, 0.38); }
.btn-danger { color: #fff; border-color: rgba(244, 63, 94, .45); background: rgba(244, 63, 94, .16); }
.btn-danger:hover { color: #fff; background: rgba(244, 63, 94, .28); }
.btn-sm { padding: 4px 9px; font-size: 10.5px; }
.btn-icon { width: 26px; height: 26px; padding: 0; }
.btn-amber { color: var(--amber); border-color: rgba(251, 191, 36, .35); background: var(--amber-fill); }

/* Chips and badges */
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border-radius: 4px;
  font-size: 10px; font-family: var(--mono); letter-spacing: .3px;
  border: 1px solid var(--line); color: var(--text-3); background: rgba(148, 163, 184, 0.05);
}
.chip-cyan { color: var(--cyan-3); border-color: var(--line-2); background: var(--cyan-fill); }
.chip-good { color: var(--green); border-color: rgba(52, 211, 153, .3); background: var(--green-fill); }
.chip-warn { color: var(--amber); border-color: rgba(251, 191, 36, .3); background: var(--amber-fill); }
.chip-bad { color: var(--red); border-color: rgba(244, 63, 94, .3); background: var(--red-fill); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.dot-good { background: var(--green); box-shadow: 0 0 8px rgba(52, 211, 153, .8); }
.dot-warn { background: var(--amber); box-shadow: 0 0 8px rgba(251, 191, 36, .8); }
.dot-bad { background: var(--red); box-shadow: 0 0 8px rgba(244, 63, 94, .8); animation: blink 1.7s infinite; }
.dot-flat { background: var(--cyan); box-shadow: 0 0 8px rgba(34, 211, 238, .7); }
.dot-off { background: var(--text-4); }

/* KPI */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi {
  position: relative; padding: 12px 13px; border-radius: 7px; overflow: hidden;
  background: linear-gradient(150deg, rgba(21, 38, 60, .9), rgba(13, 26, 43, .9));
  border: 1px solid var(--line); transition: transform .18s ease, border-color .18s ease;
}
.kpi:hover { transform: translateY(-2px); border-color: var(--line-2); }
.kpi::after { content: ""; position: absolute; right: -18px; top: -18px; width: 70px; height: 70px; border-radius: 50%; background: var(--tone-fill); filter: blur(18px); }
.kpi-label { font-size: 10.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi-en { font-family: var(--mono); font-size: 8px; color: var(--text-4); letter-spacing: .8px; }
.kpi-value { font-family: var(--mono); font-size: 25px; font-weight: 600; letter-spacing: -.5px; margin-top: 7px; color: var(--text); line-height: 1.1; }
.kpi-value .unit { font-size: 11px; color: var(--text-3); margin-left: 3px; font-weight: 400; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.kpi-delta { font-family: var(--mono); font-size: 10px; color: var(--tone); }
.kpi-feature { font-family: var(--mono); font-size: 9px; color: var(--text-4); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
table.tbl th {
  text-align: left; padding: 8px 10px; font-size: 9.5px; font-weight: 500; letter-spacing: .6px;
  color: var(--text-4); text-transform: uppercase; border-bottom: 1px solid var(--line);
  background: rgba(34, 211, 238, 0.025); white-space: nowrap;
}
table.tbl td { padding: 8px 10px; border-bottom: 1px solid rgba(148, 163, 184, 0.07); color: var(--text-2); white-space: nowrap; }
table.tbl tbody tr { transition: background .14s ease; }
table.tbl tbody tr:hover { background: rgba(34, 211, 238, 0.055); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl td.num { font-family: var(--mono); color: var(--text); }
.table-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.table-tools input[type=text] {
  background: rgba(6, 16, 28, .7); border: 1px solid var(--line); border-radius: 5px;
  padding: 5px 9px; font-size: 11px; width: 170px; outline: none;
}
.table-tools input[type=text]:focus { border-color: var(--line-3); }
.tab-btn {
  padding: 4px 9px; font-size: 10.5px; border-radius: 4px; border: 1px solid var(--line);
  background: transparent; color: var(--text-3);
}
.tab-btn.on { color: var(--cyan-3); border-color: var(--line-2); background: var(--cyan-fill); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 10px; font-size: 10.5px; color: var(--text-4); font-family: var(--mono); }

/* Chart */
.chart-box { position: relative; width: 100%; }
.chart-box svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-3); }
.legend-swatch { width: 12px; height: 3px; border-radius: 2px; }
.chart-overlay { position: absolute; inset: 0; pointer-events: none; }

/* Panel body items */
.pb-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed rgba(148, 163, 184, 0.10); font-size: 11.5px; }
.pb-row:last-child { border-bottom: 0; }
.pb-label { color: var(--text-3); display: flex; align-items: center; gap: 7px; }
.pb-value { color: var(--text); font-family: var(--mono); font-size: 11px; text-align: right; }
.pb-value.good { color: var(--green); }
.pb-value.warn { color: var(--amber); }
.pb-value.bad { color: var(--red); }
.pb-value.cyan { color: var(--cyan-3); }
.bar-item { margin: 10px 0; }
.bar-top { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-3); margin-bottom: 5px; }
.bar-top b { font-family: var(--mono); color: var(--text); font-weight: 500; }
.bar-track { height: 5px; border-radius: 4px; background: rgba(148, 163, 184, .12); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--cyan-2), var(--cyan)); box-shadow: 0 0 10px rgba(34, 211, 238, .45); transition: width .4s ease; }
.bar-fill.warn { background: linear-gradient(90deg, #d97706, var(--amber)); box-shadow: 0 0 10px rgba(251, 191, 36, .4); }
.bar-fill.bad { background: linear-gradient(90deg, #be123c, var(--red)); }
.step-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed rgba(148, 163, 184, .1); }
.step-item:last-child { border-bottom: 0; }
.step-no { font-family: var(--mono); font-size: 9px; color: var(--cyan); border: 1px solid var(--line-2); border-radius: 3px; min-width: 20px; height: 20px; display: grid; place-items: center; background: var(--cyan-fill); flex: none; }
.step-label { font-size: 11.5px; color: var(--text); }
.step-value { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.note-box { margin-top: 10px; padding: 9px 11px; border-left: 2px solid var(--cyan-2); background: rgba(34, 211, 238, .05); font-size: 10.8px; color: var(--text-3); line-height: 1.65; border-radius: 0 4px 4px 0; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: span 2; }
.field label { font-size: 10.5px; color: var(--text-2); display: flex; justify-content: space-between; }
.field label span { font-family: var(--mono); color: var(--cyan-3); }
.field select, .field input[type=text], .field input[type=number] {
  background: rgba(6, 16, 28, .8); border: 1px solid var(--line); border-radius: 5px;
  padding: 7px 9px; font-size: 11.5px; outline: none; width: 100%;
}
.field select:focus, .field input:focus { border-color: var(--line-3); box-shadow: 0 0 0 2px rgba(34, 211, 238, .08); }
.field-range { display: flex; align-items: center; gap: 10px; }
.field-range input[type=range] { flex: 1; accent-color: var(--cyan-2); height: 4px; }
.field-range .rv { font-family: var(--mono); font-size: 11px; color: var(--cyan-3); min-width: 58px; text-align: right; }

/* Digital twin */
.twin-stage {
  position: relative; min-height: 430px; border-radius: 6px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 38%, rgba(20, 58, 82, .55), rgba(7, 16, 28, .96) 72%);
  border: 1px solid rgba(34, 211, 238, .12); display: grid; place-items: center;
}
.twin-stage::before {
  content: ""; position: absolute; left: -20%; right: -20%; bottom: 0; height: 42%;
  background: linear-gradient(rgba(34, 211, 238, .13) 1px, transparent 1px), linear-gradient(90deg, rgba(34, 211, 238, .13) 1px, transparent 1px);
  background-size: 26px 18px, 26px 18px; transform: perspective(320px) rotateX(62deg); transform-origin: bottom;
  mask-image: linear-gradient(transparent, #000 40%);
}
.twin-stage::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 4px); pointer-events: none; }
.twin-figure { position: relative; height: 400px; max-width: 88%; object-fit: contain; z-index: 2; filter: drop-shadow(0 0 20px rgba(34, 211, 238, .28)); }
.twin-hot { position: absolute; z-index: 3; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--cyan); background: rgba(6, 20, 32, .9); box-shadow: 0 0 12px var(--cyan); cursor: pointer; transition: transform .15s ease; }
.twin-hot:hover { transform: scale(1.45); }
.twin-hot.off { border-color: var(--text-4); box-shadow: none; }
.twin-hot.active { background: var(--cyan); box-shadow: 0 0 18px var(--cyan); }
.twin-label { position: absolute; z-index: 4; font-family: var(--mono); font-size: 9px; color: var(--cyan-3); background: rgba(6, 18, 30, .88); border: 1px solid var(--line-2); padding: 2px 5px; border-radius: 3px; pointer-events: none; }
.twin-axis { position: absolute; left: 12px; bottom: 12px; z-index: 4; font-family: var(--mono); font-size: 9px; color: var(--text-4); line-height: 1.6; }
.twin-viewbar { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 10px; }
.view-btn { border: 1px solid var(--line); background: transparent; color: var(--text-3); font-size: 10.5px; padding: 4px 10px; border-radius: 4px; }
.view-btn.on { color: var(--cyan-3); border-color: var(--line-2); background: var(--cyan-fill); }
.twin-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 10px; color: var(--text-3); }
.twin-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }

/* Light field digital twin */
.lightstage { width: 100%; }
.lightstage-canvas {
  position: relative; width: 100%; aspect-ratio: 1703 / 1235; overflow: hidden;
  border: 1px solid rgba(34, 211, 238, .20); border-radius: 7px;
  background: radial-gradient(ellipse at 52% 44%, #0d2135, #06101d 78%);
  box-shadow: inset 0 0 60px rgba(2, 10, 20, .85), 0 0 26px rgba(34, 211, 238, .06);
}
.lightstage-canvas::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 6;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .014) 0 1px, transparent 1px 4px);
}
.lightstage-base { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; }
.lightstage-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; overflow: visible; }
.lightstage-scale {
  position: absolute; right: 12px; bottom: 10px; z-index: 5;
  font-family: var(--mono); font-size: 9px; color: var(--text-4); letter-spacing: .5px;
}
.lt-flow { animation: ltDash 1.7s linear infinite; }
@keyframes ltDash { to { stroke-dashoffset: -60; } }
.lt-spark { filter: drop-shadow(0 0 7px #f0fdff); animation: ltPulse 2.1s ease-in-out infinite; }
.lt-spark.s2 { animation-delay: .6s; }
.lt-spark.s3 { animation-delay: 1.25s; }
@keyframes ltPulse { 0%, 100% { opacity: .28; } 50% { opacity: 1; } }
.lt-leader { stroke: rgba(103, 232, 249, .40); stroke-width: 1.4; stroke-dasharray: 6 6; }
.lt-target { fill: rgba(34, 211, 238, .20); stroke: #67e8f9; stroke-width: 1.6; }
.lt-badge-bg { fill: rgba(6, 20, 33, .90); stroke: rgba(34, 211, 238, .38); stroke-width: 1.2; }
.lt-badge-id { fill: #22d3ee; font-family: var(--mono); font-size: 19px; font-weight: 600; }
.lt-badge-tx { fill: #cbd5e1; font-family: var(--sans); font-size: 19px; }
.lt-svg-label { fill: #67e8f9; font-family: var(--mono); font-size: 20px; }
.lt-svg-label.amber { fill: #fcd34d; }
.lt-node { cursor: pointer; }
.lt-node.on .lt-badge-bg { fill: rgba(12, 54, 72, .95); stroke: #67e8f9; stroke-width: 2; }
.lt-node.on .lt-target { fill: rgba(34, 211, 238, .55); filter: drop-shadow(0 0 8px #22d3ee); }
.lt-node.on .lt-badge-tx { fill: #f0fdff; }
.lt-toolbar, .lt-presetbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.lt-presetbar { margin-top: 8px; }
.lt-bar-label { font-family: var(--mono); font-size: 9px; color: var(--text-4); letter-spacing: 1px; margin-right: 4px; }
.lt-toggle, .lt-preset {
  border: 1px solid var(--line); background: rgba(6, 16, 28, .6); color: var(--text-3);
  font-size: 10px; padding: 4px 9px; border-radius: 4px; transition: all .16s ease;
}
.lt-toggle:hover, .lt-preset:hover { border-color: var(--line-3); color: var(--text); }
.lt-toggle.on, .lt-preset.on { color: var(--cyan-3); border-color: var(--line-2); background: var(--cyan-fill); }
.lt-bar-spacer { flex: 1; }
.lt-node-now { font-size: 10px; color: var(--text-4); }
.lt-node-now b { font-family: var(--mono); color: var(--cyan-3); font-weight: 500; }
.lg-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.lg-dot.cyan { background: #22d3ee; box-shadow: 0 0 8px #22d3ee; }
.lg-dot.amber { background: #fbbf24; box-shadow: 0 0 8px #fbbf24; }
.lg-dot.white { background: #f0fdff; box-shadow: 0 0 8px #f0fdff; }
.lg-dot.teal { background: #67e8f9; box-shadow: 0 0 8px #67e8f9; }

/* Light path solver panel */
.lp-verdict {
  display: flex; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 6px;
  border: 1px solid rgba(52, 211, 153, .30); background: var(--green-fill);
}
.lp-verdict.bad { border-color: rgba(244, 63, 94, .34); background: var(--red-fill); }
.lp-verdict b { font-size: 11.5px; color: var(--green); }
.lp-verdict.bad b { color: var(--red); }
.lp-verdict span { margin-left: auto; font-family: var(--mono); font-size: 9.5px; color: var(--text-3); }
.lp-formula {
  margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 5px;
  background: rgba(6, 16, 28, .55); font-family: var(--mono); font-size: 11px; color: var(--cyan-3);
}
.lp-formula span { color: var(--text-4); margin: 0 5px; }
.lp-polar { margin-top: 12px; border: 1px solid var(--line); border-radius: 6px; background: rgba(6, 16, 28, .4); padding: 8px; }
.lp-polar svg { width: 100%; height: 128px; display: block; }
.lt-polar-tx { fill: #64748b; font-family: var(--mono); font-size: 11px; }
.lp-polar-cap { text-align: center; font-size: 9.5px; color: var(--text-4); margin-top: 2px; }
.lp-controls { margin-top: 12px; display: flex; flex-direction: column; gap: 11px; }
.lp-control label { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-3); }
.lp-control label b { font-family: var(--mono); font-size: 11px; color: var(--cyan-3); font-weight: 500; }
.lp-control input[type=range] { width: 100%; margin-top: 6px; accent-color: var(--cyan-2); height: 4px; }
.lp-readout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.lp-cell { padding: 8px 9px; border: 1px solid var(--line); border-radius: 5px; background: rgba(6, 16, 28, .5); }
.lp-cell span { display: block; font-size: 9.5px; color: var(--text-4); }
.lp-cell b { display: block; font-family: var(--mono); font-size: 13px; color: var(--cyan-3); font-weight: 500; margin-top: 4px; }
.lp-robot {
  display: flex; gap: 10px; align-items: center; margin-top: 13px; padding: 9px;
  border: 1px solid var(--line); border-radius: 6px; background: rgba(6, 16, 28, .45);
}
.lp-robot img { width: 58px; height: 78px; object-fit: contain; border-radius: 4px; background: #09121f; filter: drop-shadow(0 0 8px rgba(34, 211, 238, .25)); }
.lp-robot-t { font-size: 10.5px; color: var(--text); font-weight: 600; }
.lp-robot-d { font-size: 9.5px; color: var(--text-4); line-height: 1.7; margin-top: 4px; }

/* Light node table */
.ln-head, .ln-row {
  display: grid; grid-template-columns: 52px minmax(0, 1.5fr) minmax(0, 1fr) 72px 84px;
  gap: 8px; align-items: center; padding: 7px 9px; font-size: 10.5px;
}
.ln-head { color: var(--text-4); font-family: var(--mono); font-size: 9px; letter-spacing: .4px; border-bottom: 1px solid var(--line); }
.ln-row { border-bottom: 1px solid rgba(148, 163, 184, .07); cursor: pointer; transition: background .15s ease; }
.ln-row:hover { background: rgba(34, 211, 238, .05); }
.ln-row.on { background: var(--cyan-fill); border-left: 2px solid var(--cyan); }
.ln-id { font-family: var(--mono); color: var(--cyan-3); }
.ln-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ln-role, .ln-angle { font-family: var(--mono); color: var(--text-3); font-size: 9.5px; }
.ln-status { display: flex; align-items: center; gap: 5px; font-size: 9.5px; }
.ln-status.good { color: var(--green); }
.ln-status.warn { color: var(--amber); }
.ln-foot { margin-top: 10px; font-size: 10px; color: var(--text-4); }

/* Actuator list */
.act-list { max-height: 430px; overflow-y: auto; padding-right: 3px; }
.act-group { margin-bottom: 9px; }
.act-group-head { display: flex; justify-content: space-between; align-items: center; padding: 5px 7px; font-size: 10.5px; color: var(--text-2); background: rgba(34, 211, 238, .045); border-radius: 4px; margin-bottom: 4px; }
.act-group-head b { font-family: var(--mono); color: var(--cyan); font-weight: 500; }
.act-item { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 4px; cursor: pointer; font-size: 10.8px; border: 1px solid transparent; }
.act-item:hover { background: rgba(34, 211, 238, .06); }
.act-item.on { background: var(--cyan-fill); border-color: var(--line-2); }
.act-item .aid { font-family: var(--mono); color: var(--cyan-3); min-width: 28px; font-size: 10px; }
.act-item .anm { flex: 1; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-item .avl { font-family: var(--mono); color: var(--text-3); font-size: 10px; }
.act-item .ast { width: 6px; height: 6px; border-radius: 50%; flex: none; }

/* Detail strip */
.detail-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 10px; }
.detail-cell { padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: rgba(6, 16, 28, .45); }
.detail-cell .lb { font-size: 10px; color: var(--text-4); }
.detail-cell .vl { font-family: var(--mono); font-size: 16px; color: var(--text); margin-top: 5px; }
.detail-cell .vl.cyan { color: var(--cyan-3); }

/* Structure gallery */
.struct-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.struct-card { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; background: rgba(6, 16, 28, .5); transition: border-color .18s ease, transform .18s ease; }
.struct-card:hover { border-color: var(--line-3); transform: translateY(-2px); }
.struct-img {
  height: 210px; width: 100%; object-fit: contain; display: block;
  background-color: #09121f;
  background-image: linear-gradient(rgba(34, 211, 238, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(34, 211, 238, 0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: center;
}
.struct-cap { padding: 9px 11px; }
.struct-cap .t { font-size: 11.5px; color: var(--text); }
.struct-cap .e { font-family: var(--mono); font-size: 8.5px; color: var(--cyan); letter-spacing: 1px; margin-top: 3px; }
.struct-cap .d { font-size: 10px; color: var(--text-4); margin-top: 4px; }
.struct-spec { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.spec-cell { padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: rgba(34, 211, 238, .03); }
.spec-cell .n { font-size: 10px; color: var(--text-4); }
.spec-cell .v { font-family: var(--mono); font-size: 14px; color: var(--cyan-3); margin-top: 4px; }

/* Studio map */
.studio-map { position: relative; border-radius: 6px; overflow: hidden; background: radial-gradient(ellipse at 50% 46%, rgba(18, 48, 72, .5), rgba(7, 16, 28, .95) 75%); border: 1px solid var(--line); }
.studio-map svg { display: block; width: 100%; height: auto; }
.studio-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 10.5px; color: var(--text-3); }

/* Heatmap */
.heat-grid { display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px; }
.heat-cell { aspect-ratio: 1 / 1; border-radius: 2px; transition: transform .12s ease; }
.heat-cell:hover { transform: scale(1.35); z-index: 2; }
.heat-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9px; color: var(--text-4); margin-top: 8px; }

/* Matrix */
.matrix-table { border-collapse: separate; border-spacing: 4px; font-family: var(--mono); font-size: 11px; }
.matrix-table th { color: var(--text-4); font-weight: 400; font-size: 9.5px; padding: 3px 6px; }
.matrix-table td { width: 62px; height: 34px; text-align: center; border-radius: 4px; color: var(--text); }

/* Timeline */
.timeline-track { position: relative; padding: 18px 0 8px; }
.timeline-line { height: 4px; border-radius: 3px; background: rgba(148, 163, 184, .14); position: relative; }
.timeline-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, var(--cyan-2), var(--cyan)); width: 34%; box-shadow: 0 0 12px rgba(34, 211, 238, .4); }
.timeline-node { position: absolute; top: -6px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--cyan); background: #0a1726; transform: translateX(-50%); }
.timeline-node.done { background: var(--cyan); }
.timeline-labels { display: flex; justify-content: space-between; margin-top: 10px; font-family: var(--mono); font-size: 9.5px; color: var(--text-4); }
.seq-cards { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 12px; }
.seq-card { border: 1px solid var(--line); border-radius: 6px; padding: 9px 11px; min-width: 130px; background: rgba(34, 211, 238, .03); }
.seq-card .sn { font-size: 11px; color: var(--text); }
.seq-card .st { font-family: var(--mono); font-size: 9.5px; color: var(--cyan); margin-top: 4px; }

/* Gallery */
.gal-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.gal-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.gal-search { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.gal-search input {
  width: 250px; padding: 6px 10px; font-size: 11px; color: var(--text);
  background: rgba(6, 16, 28, .75); border: 1px solid var(--line); border-radius: 5px; outline: none;
}
.gal-search input:focus { border-color: var(--line-3); box-shadow: 0 0 0 2px rgba(34, 211, 238, .08); }
.gal-count { font-family: var(--mono); font-size: 10px; color: var(--cyan-3); white-space: nowrap; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gallery-card {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: linear-gradient(170deg, rgba(17, 31, 50, .9), rgba(7, 16, 28, .9));
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.gallery-card:hover { border-color: var(--line-3); transform: translateY(-3px); box-shadow: var(--shadow), 0 0 22px rgba(34, 211, 238, .10); }
.gal-thumb { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: #0a1420; }
.gal-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .45s ease, filter .3s ease; }
.gallery-card:hover .gal-thumb img { transform: scale(1.045); }
.gal-badge {
  position: absolute; left: 9px; top: 9px; z-index: 2; padding: 3px 8px; border-radius: 4px;
  font-size: 9.5px; letter-spacing: .4px; color: #06222b; font-weight: 650;
  background: linear-gradient(120deg, #67e8f9, #22d3ee); box-shadow: 0 2px 10px rgba(2, 12, 20, .5);
}
.gal-score {
  position: absolute; right: 9px; top: 9px; z-index: 2; padding: 3px 8px; border-radius: 4px;
  font-family: var(--mono); font-size: 12px; color: var(--green);
  background: rgba(6, 18, 30, .82); border: 1px solid rgba(52, 211, 153, .34);
}
.gal-score small { font-size: 8px; color: var(--text-3); margin-left: 2px; }
.gal-hover {
  position: absolute; inset: auto 0 0 0; z-index: 3; display: flex; gap: 7px; padding: 12px 10px 10px;
  background: linear-gradient(transparent, rgba(3, 10, 18, .94) 55%);
  opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease;
}
.gallery-card:hover .gal-hover { opacity: 1; transform: translateY(0); }
.gal-body { padding: 10px 11px 11px; }
.gal-name { font-size: 11.5px; font-weight: 600; color: var(--text); line-height: 1.45; }
.gal-sub { font-family: var(--mono); font-size: 9px; color: var(--text-4); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gal-fabric { font-size: 10px; color: var(--text-3); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gal-metrics {
  display: flex; justify-content: space-between; gap: 4px; margin-top: 9px; padding-top: 8px;
  border-top: 1px solid var(--line); font-family: var(--mono); font-size: 9px; color: var(--text-4);
}
.gal-metrics b { color: var(--cyan-3); font-weight: 500; }
.gal-tags { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; margin-top: 9px; }
.gal-tags span {
  font-size: 9px; color: var(--text-3); padding: 2px 6px; border-radius: 3px;
  background: rgba(148, 163, 184, .09); border: 1px solid rgba(148, 163, 184, .12);
}
.gal-tags .gal-status { color: var(--green); border-color: rgba(52, 211, 153, .26); background: var(--green-fill); margin-left: auto; }

/* Capture lightbox */
.capture-lightbox { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; }
.capture-photo {
  border-radius: 7px; overflow: hidden; border: 1px solid var(--line-2);
  background: #0a1420; display: flex; align-items: center; justify-content: center; min-height: 380px;
}
.capture-photo img { width: 100%; max-height: 58vh; object-fit: contain; display: block; }
.capture-title { font-size: 14px; font-weight: 650; color: var(--text); }
.capture-sub { font-family: var(--mono); font-size: 9.5px; color: var(--cyan); margin-top: 5px; letter-spacing: .4px; }
.capture-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.capture-grid > div { padding: 8px 9px; border: 1px solid var(--line); border-radius: 5px; background: rgba(6, 16, 28, .5); }
.capture-grid span { display: block; font-size: 9.5px; color: var(--text-4); }
.capture-grid b { display: block; font-family: var(--mono); font-size: 11px; color: var(--text); font-weight: 500; margin-top: 4px; }
.capture-grid b.cyan { color: var(--cyan-3); }
.capture-note { margin-top: 12px; font-size: 10.5px; line-height: 1.7; color: var(--text-3); border-left: 2px solid var(--cyan-2); padding-left: 9px; }
.capture-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

/* Task cards */
.task-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.task-card { border: 1px solid var(--line); border-radius: 7px; padding: 12px; background: rgba(6, 16, 28, .48); position: relative; overflow: hidden; }
.task-card.running { border-color: var(--line-2); }
.task-card::after { content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: var(--tone); opacity: .6; }
.task-top { display: flex; justify-content: space-between; align-items: center; }
.task-id { font-family: var(--mono); font-size: 9.5px; color: var(--cyan); }
.task-name { font-size: 12px; color: var(--text); margin-top: 8px; font-weight: 600; }
.task-meta { display: flex; gap: 12px; margin-top: 7px; font-size: 10px; color: var(--text-4); }
.task-progress { margin-top: 11px; }

/* Logs and alarms */
.log-row { display: grid; grid-template-columns: 150px 70px 150px 1fr 110px; gap: 10px; padding: 8px 10px; border-bottom: 1px solid rgba(148, 163, 184, .07); font-size: 11px; align-items: center; }
.log-row:hover { background: rgba(34, 211, 238, .05); }
.log-row.head { color: var(--text-4); font-size: 9.5px; letter-spacing: .6px; text-transform: uppercase; background: rgba(34, 211, 238, .025); }
.log-time, .log-kind, .log-id { font-family: var(--mono); color: var(--text-4); font-size: 10px; }
.log-desc { color: var(--text-2); }
.alarm-card { border: 1px solid var(--line); border-left: 3px solid var(--tone); border-radius: 6px; padding: 11px 13px; margin-bottom: 9px; background: rgba(6, 16, 28, .45); }
.alarm-top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.alarm-code { font-family: var(--mono); font-size: 10.5px; color: var(--text); }
.alarm-time { font-family: var(--mono); font-size: 9.5px; color: var(--text-4); margin-left: auto; }
.alarm-title { font-size: 12px; color: var(--text); margin-top: 7px; }
.alarm-detail { font-size: 10.8px; color: var(--text-3); margin-top: 5px; line-height: 1.6; }

/* Dialog page surface */
.dialog-backdrop {
  grid-column: span 12; min-height: 600px; display: flex; align-items: flex-start; justify-content: center;
  padding: 30px 18px; border-radius: 8px; border: 1px dashed rgba(34, 211, 238, 0.18);
  background: radial-gradient(ellipse at 50% 0%, rgba(20, 52, 76, .45), rgba(6, 14, 25, .82) 72%),
    linear-gradient(rgba(148, 163, 184, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .025) 1px, transparent 1px);
  background-size: auto, 36px 36px, 36px 36px;
}
.dialog-window { width: min(1080px, 100%); box-shadow: 0 24px 70px rgba(0, 0, 0, .6), 0 0 44px rgba(34, 211, 238, .09); }
.dialog-titlebar {
  display: flex; align-items: center; gap: 10px; padding: 11px 15px;
  border-bottom: 1px solid var(--line); background: rgba(34, 211, 238, .04);
}
.dialog-titlebar .dt { font-size: 13px; font-weight: 650; }
.dialog-titlebar .de { font-family: var(--mono); font-size: 9px; color: var(--cyan); letter-spacing: 1.2px; }
.dialog-titlebar .dx { margin-left: auto; border: 1px solid var(--line); background: transparent; color: var(--text-3); width: 24px; height: 24px; border-radius: 4px; line-height: 1; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 15px; border-top: 1px solid var(--line); }
.twin-hud { position: absolute; z-index: 5; font-family: var(--mono); font-size: 9px; color: var(--text-4); line-height: 1.75; pointer-events: none; }
.twin-hud b { color: var(--cyan-3); font-weight: 500; }
.twin-hud.left { left: 12px; top: 12px; }
.twin-hud.right { right: 12px; top: 12px; text-align: right; }
.twin-cross { position: absolute; z-index: 4; width: 16px; height: 16px; pointer-events: none; opacity: .5; }
.twin-cross::before, .twin-cross::after { content: ""; position: absolute; background: var(--cyan); }
.twin-cross::before { width: 16px; height: 1px; top: 8px; left: 0; }
.twin-cross::after { width: 1px; height: 16px; left: 8px; top: 0; }

/* Wizard and dialogs */
.wizard-steps { display: flex; gap: 0; margin-bottom: 20px; }
.wizard-step { flex: 1; display: flex; align-items: center; gap: 8px; position: relative; padding: 10px 12px; border-bottom: 2px solid var(--line); }
.wizard-step.on { border-bottom-color: var(--cyan); background: rgba(34, 211, 238, .05); }
.wizard-step.done { border-bottom-color: rgba(52, 211, 153, .5); }
.wizard-step .wn { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 10px; border: 1px solid var(--line-2); color: var(--text-3); flex: none; }
.wizard-step.on .wn { color: #04222c; background: var(--cyan); border-color: var(--cyan); }
.wizard-step .wt { font-size: 11.5px; color: var(--text-2); }
.wizard-step.on .wt { color: var(--text); }
.dialog-frame { display: flex; gap: 16px; align-items: flex-start; }
.dialog-preview { flex: 1; border: 1px solid var(--line); border-radius: 7px; padding: 14px; background: rgba(6, 16, 28, .6); min-height: 330px; }
.dialog-side { width: 300px; flex: none; }
.dialog-hero { border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: #09121f; }
.dialog-hero img { width: 100%; height: 300px; object-fit: contain; display: block; background: #0a1420; }
.confirm-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed rgba(148, 163, 184, .12); font-size: 11.5px; }
.confirm-row b { font-family: var(--mono); color: var(--cyan-3); font-weight: 500; }

/* Tuning */
.tuning-layout { display: grid; grid-template-columns: 210px 1fr 320px; gap: 14px; }
.tuning-tree { max-height: 500px; overflow-y: auto; }
.tuning-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-height: 500px; overflow-y: auto; padding-right: 4px; }
.slider-card { border: 1px solid var(--line); border-radius: 6px; padding: 10px; background: rgba(6, 16, 28, .45); }
.slider-card .sl-top { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-2); }
.slider-card .sl-id { font-family: var(--mono); color: var(--cyan); }
.slider-card input[type=range] { width: 100%; accent-color: var(--cyan-2); margin: 10px 0 4px; }
.slider-card .sl-range { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9px; color: var(--text-4); }
.tuning-preview { border: 1px solid var(--line); border-radius: 7px; background: radial-gradient(ellipse at 50% 40%, rgba(20, 58, 82, .5), rgba(7, 16, 28, .95) 75%); min-height: 480px; display: grid; place-items: center; overflow: hidden; }
.tuning-preview img { height: 430px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 0 16px rgba(34, 211, 238, .3)); }

/* Light grid */
.light-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.light-card { border: 1px solid var(--line); border-radius: 7px; padding: 12px; background: rgba(6, 16, 28, .45); }
.light-card.off { opacity: .5; }
.light-card .lh { display: flex; justify-content: space-between; align-items: center; }
.light-card .ln { font-size: 11.5px; color: var(--text); }
.light-card .li { font-family: var(--mono); font-size: 10px; color: var(--cyan); }
.light-card .lv { font-family: var(--mono); font-size: 21px; color: var(--cyan-3); margin: 9px 0 3px; }
.light-card .lu { font-size: 10px; color: var(--text-4); }
.light-card input[type=range] { width: 100%; accent-color: var(--cyan-2); margin-top: 9px; }
.light-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 9.5px; color: var(--text-4); margin-top: 7px; }

/* Fabric grid */
.fabric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.fabric-card { border: 1px solid var(--line); border-radius: 7px; padding: 12px; background: linear-gradient(150deg, rgba(21, 38, 60, .7), rgba(10, 22, 37, .7)); position: relative; overflow: hidden; }
.fabric-card::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, rgba(34, 211, 238, .16), transparent 70%); }
.fabric-card .fid { font-family: var(--mono); font-size: 9.5px; color: var(--cyan); }
.fabric-card .fn { font-size: 12.5px; color: var(--text); margin-top: 7px; font-weight: 600; }
.fabric-card .fm { display: flex; gap: 12px; margin-top: 10px; font-size: 10px; color: var(--text-4); }
.fabric-card .fm b { color: var(--text-2); font-family: var(--mono); font-weight: 500; }

/* Report */
.report-head { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; margin-bottom: 16px; }
.report-cell { padding: 13px; border: 1px solid var(--line); border-radius: 7px; background: rgba(34, 211, 238, .04); text-align: center; }
.report-cell .rv { font-family: var(--mono); font-size: 24px; color: var(--cyan-3); }
.report-cell .rl { font-size: 10px; color: var(--text-3); margin-top: 5px; }

/* Action strip */
.action-strip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.converge-ring { width: 96px; height: 96px; flex: none; }
.action-metrics { display: grid; grid-template-columns: repeat(3, minmax(110px, 1fr)); gap: 12px; flex: 1; }

/* Modal layer */
.overlay { position: fixed; inset: 0; z-index: 200; background: rgba(3, 9, 17, .72); backdrop-filter: blur(5px); display: none; align-items: center; justify-content: center; padding: 24px; }
.overlay.open { display: flex; animation: fade .2s ease; }
.modal { width: min(720px, 96vw); max-height: 88vh; overflow-y: auto; border-radius: 10px; border: 1px solid var(--line-2); background: linear-gradient(160deg, #13243a, #0b1828); box-shadow: var(--shadow), 0 0 40px rgba(34, 211, 238, .10); animation: pop .24s ease; }
.modal.wide { width: min(980px, 96vw); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.modal-head .mt { font-size: 14px; font-weight: 650; }
.modal-head .me { font-family: var(--mono); font-size: 9px; color: var(--cyan); letter-spacing: 1.2px; }
.modal-head .close { margin-left: auto; border: 0; background: transparent; color: var(--text-3); font-size: 18px; line-height: 1; }
.modal-head .close:hover { color: var(--text); }
.modal-body { padding: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.toast { position: fixed; right: 22px; bottom: 44px; z-index: 300; padding: 11px 16px; border-radius: 6px; border: 1px solid var(--line-2); background: rgba(13, 30, 47, .97); box-shadow: var(--shadow); font-size: 11.5px; color: var(--text); display: none; }
.toast.show { display: block; animation: rise .24s ease; }
.drawer { position: fixed; top: 56px; right: 0; bottom: 26px; width: 400px; z-index: 190; background: linear-gradient(160deg, #122238, #0a1727); border-left: 1px solid var(--line-2); box-shadow: -16px 0 40px rgba(0,0,0,.45); transform: translateX(102%); transition: transform .26s ease; overflow-y: auto; }
.drawer.open { transform: translateX(0); }

/* Status bar */
.statusbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 26px; z-index: 60;
  display: flex; align-items: center; gap: 16px; padding: 0 14px;
  background: rgba(7, 16, 28, .96); border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 9.5px; color: var(--text-4); overflow: hidden;
}
.statusbar .sb-item { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.statusbar .sb-item b { color: var(--text-3); font-weight: 400; }
.statusbar .sb-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }

/* Animations */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes dash { to { stroke-dashoffset: 0; } }
.chart-line { stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: dash 1.5s ease forwards; }
.pulse-ring { animation: blink 2.2s infinite; }

/* Sub navigation inside the current group */
.subtabs-wrap { margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.subtabs { display: flex; gap: 2px; flex-wrap: wrap; }
.subtab {
  position: relative; padding: 8px 13px; font-size: 11.5px; color: var(--text-3);
  border-bottom: 2px solid transparent; transition: all .16s ease;
}
.subtab:hover { color: var(--text); background: rgba(34, 211, 238, .05); }
.subtab.on { color: var(--cyan-3); border-bottom-color: var(--cyan); background: rgba(34, 211, 238, .07); font-weight: 600; }

@media (max-width: 1280px) {
  .span-4, .span-5 { grid-column: span 6; }
  .span-7, .span-8 { grid-column: span 12; }
  .struct-grid, .gallery-grid, .task-grid, .fabric-grid, .light-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tuning-layout { grid-template-columns: 180px 1fr; }
  .tuning-preview { grid-column: span 2; }
}
@media (max-width: 900px) {
  .sidebar { width: 60px; }
  .side-group-name, .side-group-en, .side-item .nm, .side-item .sid, .side-foot { display: none; }
  .side-item { justify-content: center; padding-left: 8px; }
  .main { margin-left: 60px; }
  .topnav { display: none; }
  .brand { min-width: 0; }
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
  .form-grid, .tuning-sliders, .capture-lightbox { grid-template-columns: 1fr; }
  .capture-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
