/* =====================================================================
   Light Glass Digital Twin — portable theme
   Tokens + reusable components, taken from the Factory Restroom HVAC
   dashboard (digitaltwin.kmce.io) with project-specific parts removed.
   Pages keep only layout (positions, grids, breakpoints) in their own
   <style>. Everything visual lives here. See DESIGN-LANGUAGE.md.
   ===================================================================== */

:root {
  /* surface & ink (Tailwind slate) */
  --bg: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: rgba(15, 23, 42, 0.08);
  --hover: rgba(15, 23, 42, 0.035);
  --well: rgba(15, 23, 42, 0.03);
  --card: rgba(255, 255, 255, 0.86);

  /* brand & status */
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --accent-line: rgba(37, 99, 235, 0.35);
  --ok: #10b981;
  --ok-ring: rgba(16, 185, 129, 0.15);
  --warn: #f59e0b;
  --warn-soft: #fef3c7;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --off: #cbd5e1;

  /* chart series (categorical) — c1 is always the main series */
  --c1: #2563eb;
  --c2: #10b981;
  --c3: #f59e0b;
  --c4: #8b5cf6;
  --c5: #0ea5e9;
  --c6: #94a3b8;

  /* shape & depth */
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 28px rgba(15, 23, 42, .08);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, .10);

  /* type & layout */
  --font: "Inter", "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: 24px;
}
@media (max-width: 820px) { :root { --gutter: 16px; } }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Surfaces ---------- */
.glass { background: var(--card); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--radius); }
.card { padding: 10px 8px 8px; }
.note { margin: 0 8px 10px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }

/* ---------- Typography ---------- */
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--accent); border-radius: 2px; }
.title { margin: 8px 0 4px; font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.02em; }
.title span { color: var(--faint); font-weight: 500; }
.section-label { margin: 4px 8px 6px; font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }

/* ---------- Card header ---------- */
.card-head { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 8px 10px; }
.card-head h2 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.card-head small { color: var(--muted); font-size: 12px; }
.chev { display: none; width: 7px; height: 7px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(-135deg) translate(-2px, -2px); transition: transform .2s; }
.collapsed .chev { transform: rotate(45deg); }

/* ---------- Segmented control & icon buttons ---------- */
.seg { display: flex; background: rgba(15, 23, 42, .04); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg button, .icon-btn { border: 0; background: transparent; padding: 7px 13px; border-radius: var(--radius-xs); font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; white-space: nowrap; }
.seg button:hover, .icon-btn:hover { color: var(--ink); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.icon-btn { padding: 7px 10px; display: inline-flex; align-items: center; gap: 6px; }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.on { color: var(--accent); background: var(--accent-soft); }
.divider { width: 1px; height: 22px; background: var(--line); margin: 0 2px; }

/* ---------- Buttons ---------- */
.btn { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); transition: border-color .15s, color .15s; }
.btn:hover { border-color: var(--accent-line); color: var(--accent); }
.btn-primary { border: 0; border-radius: var(--radius-sm); padding: 9px 14px; font-weight: 600; font-size: 13px; cursor: pointer; background: var(--accent); color: #fff; }
.btn-danger { border-color: rgba(239, 68, 68, .3); color: var(--danger); }

/* ---------- Form fields & chips ---------- */
.field { font: inherit; font-size: 12.5px; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 6px 9px; outline: none; transition: border-color .15s, box-shadow .15s; }
.field:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
select.field { padding-right: 26px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 13px) 50%, calc(100% - 9px) 50%; background-size: 4px 4px; background-repeat: no-repeat; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 11px; font-size: 12px; cursor: pointer; color: var(--ink-2); transition: all .15s; }
.chips button:hover { border-color: var(--accent-line); }
.chips button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Popover (anchored under a toolbar button) ---------- */
.popover { position: absolute; top: calc(100% + 8px); right: 0; padding: 8px; width: 262px; display: none; z-index: 10; }
.popover.open { display: block; animation: pop .18s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- Toggle row (label + switch) ---------- */
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 8px; border-radius: var(--radius-xs); cursor: pointer; font-size: 13px; color: var(--ink-2); user-select: none; }
.toggle:hover { background: var(--hover); }
.toggle .sw { width: 30px; height: 18px; border-radius: 99px; background: var(--off); position: relative; transition: background .2s; flex: none; }
.toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s; }
.toggle.on .sw { background: var(--accent); }
.toggle.on .sw::after { transform: translateX(12px); }
.toggle .lbl { display: flex; align-items: center; gap: 8px; }
.chip { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.slider-row { padding: 2px 8px 8px 26px; display: none; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.slider-row.show { display: flex; }
input[type=range] { flex: 1; accent-color: var(--accent); }

/* ---------- Mini switch (inline in list rows) ---------- */
.mini-sw { width: 28px; height: 16px; border-radius: 99px; background: var(--accent); position: relative; border: 0; cursor: pointer; padding: 0; flex: none; }
.mini-sw::after { content: ""; position: absolute; top: 2px; left: 14px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: left .2s; }
.off .mini-sw { background: var(--off); }
.off .mini-sw::after { left: 2px; }

/* ---------- Status dot, badge, live dot ---------- */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-ring); flex: none; }
.off .dot, .dot.off { background: var(--off); box-shadow: none; }
.fault .dot, .dot.fault { background: var(--danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); }
.warn .dot, .dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; color: var(--muted); background: var(--well); border: 1px solid var(--line); border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.badge.accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.badge.danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.badge.warn { color: #b45309; background: var(--warn-soft); border-color: transparent; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(16, 185, 129, .5); animation: live 2s ease-out infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); flex: none; animation: pulse-red 1.4s ease-out infinite; }
.pulse-dot.amber { background: var(--warn); animation-name: pulse-amber; }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); } 80%, 100% { box-shadow: 0 0 0 7px rgba(239, 68, 68, 0); } }
@keyframes pulse-amber { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, .55); } 80%, 100% { box-shadow: 0 0 0 7px rgba(245, 158, 11, 0); } }

/* ---------- Big numbers ---------- */
.bigval { font-size: 40px; font-weight: 600; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.bigval small { font-size: 18px; color: var(--muted); font-weight: 500; }
.stat-big { padding: 0 8px 10px; }
.stat-big > span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.stat-big > span b { color: var(--ink-2); font-weight: 600; }
.stat-big.tight { padding: 0; }
.stat-big.tight .bigval { font-size: 30px; }

/* ---------- KPI tiles ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 6px 10px; }
.kpis.three { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.kpi { background: var(--well); border-radius: var(--radius-sm); padding: 9px 11px; }
.kpi b { display: block; font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi b small { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi span { font-size: 11.5px; color: var(--muted); }
.kpi.accent b { color: var(--accent); }
.kpis.three .kpi { padding: 8px 9px; }
.kpis.three .kpi b { font-size: 16px; }
.kpis.three .kpi span { font-size: 11px; }
/* wide KPI row on full pages: tile = label · value · delta vs previous period */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi-grid .kpi { background: rgba(255, 255, 255, .7); border: 1px solid var(--line); display: grid; gap: 2px; }
.kpi-grid .kpi b { font-size: 19px; }
.delta { font-size: 11px; font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.delta.good { color: #047857; }
.delta.bad { color: #b45309; }

/* ---------- Sparkline (inline SVG area chart) ---------- */
.spark { padding: 0 8px 10px; }
.spark svg { display: block; width: 100%; height: 72px; overflow: visible; }
.spark .area { fill: var(--accent); opacity: .10; }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark .grid { stroke: var(--line); stroke-width: 1; }
.spark .now { fill: var(--accent); stroke: #fff; stroke-width: 2; }
.spark .axis { font-size: 9.5px; fill: var(--faint); font-family: var(--font); }

/* ---------- Device dots (one square per device, clickable) ---------- */
.unit-dots { display: grid; grid-template-columns: repeat(6, 14px); gap: 6px; }
.unit-dots button { width: 14px; height: 14px; border-radius: 4px; border: 0; padding: 0; cursor: pointer; background: var(--accent); transition: transform .15s, background .2s; }
.unit-dots button:hover { transform: scale(1.2); }
.unit-dots button.off { background: var(--off); }
.unit-dots button.fault { background: var(--danger); }
.unit-dots button.sel { outline: 2px solid var(--ink); outline-offset: 1px; }

/* ---------- List rows: dot · name/sub · value · action ---------- */
.list { overflow-y: auto; flex: 1; padding: 0 2px; scrollbar-width: thin; }
.row { display: grid; grid-template-columns: 10px 1fr auto auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: background .15s; }
.row:hover { background: var(--hover); }
.row.sel { background: var(--accent-soft); }
.row .name { font-size: 13px; font-weight: 600; }
.row .sub { font-size: 11.5px; color: var(--muted); display: block; font-weight: 400; margin-top: 1px; }
.row .val { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.off .val { color: var(--faint); }

/* ---------- Detail card (selected item) ---------- */
.detail { margin: 0 6px 10px; padding: 14px; border-radius: 12px; background: linear-gradient(160deg, #eff6ff, #ffffff 70%); border: 1px solid rgba(37, 99, 235, .15); display: none; }
.detail.show { display: block; }
.detail .top { display: flex; justify-content: space-between; align-items: flex-start; }
.detail h4 { margin: 0; font-size: 16px; }
.detail .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.detail .close { border: 0; background: transparent; cursor: pointer; color: var(--faint); font-size: 18px; line-height: 1; padding: 2px 4px; }
.detail .btn-primary { margin-top: 12px; width: 100%; }
.detail.isoff .btn-primary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.detail.isoff .bigval { color: var(--faint); }
.setpoint { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.stepper { display: flex; gap: 6px; }
.stepper button { width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; font-size: 18px; cursor: pointer; color: var(--ink-2); }
.stepper button:hover { color: var(--accent); border-color: var(--accent-line); }
.meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 14px; }
.meta div { font-size: 11px; color: var(--muted); }
.meta b { display: block; font-size: 12.5px; color: var(--ink); font-weight: 600; margin-top: 2px; }

/* ---------- Progress, meter, battery, saving ---------- */
.progress { height: 6px; border-radius: 99px; background: rgba(15, 23, 42, .08); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .6s ease; }
.progress.warn i { background: var(--warn); }
.progress.danger i { background: var(--danger); }
.meter { display: grid; gap: 6px; padding: 0 8px 8px; }
.meter-row { display: grid; grid-template-columns: 74px 1fr 64px; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.meter-row b { text-align: right; color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.meter-row .bar { height: 8px; border-radius: 99px; background: var(--well); overflow: hidden; }
.meter-row .bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--ok); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.meter-row.base .bar i { background: var(--off); }
.battery { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.battery .cell { width: 26px; height: 10px; border: 1.5px solid var(--faint); border-radius: 3px; padding: 1px; position: relative; }
.battery .cell::after { content: ""; position: absolute; right: -4px; top: 2px; width: 2px; height: 4px; border-radius: 0 1px 1px 0; background: var(--faint); }
.battery .cell i { display: block; height: 100%; border-radius: 1px; background: var(--ok); }
.battery.low .cell i { background: var(--warn); }
.saving { margin: 2px 6px 4px; padding: 9px 11px; border-radius: var(--radius-sm); background: rgba(16, 185, 129, .08); color: #047857; font-size: 12.5px; line-height: 1.45; }
.saving b { font-weight: 600; }
.saving.neg { background: var(--warn-soft); color: #b45309; }

/* ---------- Alerts ----------
   .alert-card  floating red-tinted glass card, one per unacknowledged fault (.task = amber job)
   .alert-item  the same content inline inside another card
   .alert-mini  compact summary of overflow / acknowledged alerts */
.alert { border-color: rgba(239, 68, 68, .35); background: linear-gradient(160deg, rgba(254, 226, 226, .94), rgba(255, 255, 255, .92) 70%); }
.alert-card { padding: 12px 12px 10px; }
.alert-card.task { border-color: rgba(245, 158, 11, .4); background: linear-gradient(160deg, rgba(254, 243, 199, .95), rgba(255, 255, 255, .92) 70%); }
.alert-item { padding: 10px; margin: 0 2px 6px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .75); border: 1px solid rgba(239, 68, 68, .18); }
:is(.alert-item, .alert-card) .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
:is(.alert-item, .alert-card) .what { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.alert-card .what { font-size: 14px; }
:is(.alert-item, .alert-card) .what small { color: var(--muted); font-weight: 500; font-size: 12px; }
:is(.alert-item, .alert-card) .where { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
:is(.alert-item, .alert-card) .advice { font-size: 11.5px; color: var(--ink-2); margin-top: 6px; line-height: 1.5; }
:is(.alert-item, .alert-card) .acts { display: flex; gap: 6px; margin-top: 8px; }
:is(.alert-item, .alert-card) .acts .btn { padding: 5px 10px; font-size: 12px; }
.alert-card .acts .btn:first-child { background: var(--danger); border-color: var(--danger); color: #fff; }
.alert-card.task .acts .btn:first-child { background: var(--warn); border-color: var(--warn); }
.alert-mini { padding: 8px 6px 6px; }
.alert-mini .head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 6px 6px; font-size: 12.5px; font-weight: 600; }
.alert-mini .rows { max-height: 152px; overflow-y: auto; scrollbar-width: thin; }
.alert-mini .mrow { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; padding: 6px; border-radius: var(--radius-xs); cursor: pointer; font-size: 12px; }
.alert-mini .mrow:hover { background: var(--hover); }
.alert-mini .mrow .dot { width: 7px; height: 7px; box-shadow: none; }
.alert-mini .mrow.ack .dot { background: var(--warn); }
.alert-mini .mrow.active .dot { background: var(--danger); }
.alert-mini .mrow small { color: var(--muted); }
.enter { animation: rise .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- Toast (top centre, auto-hides) ---------- */
.toasts { position: fixed; top: 78px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 40; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow); font-size: 13px; animation: toast-in .3s cubic-bezier(.2, .8, .2, 1); cursor: pointer; }
.toast.danger { background: var(--danger); }
.toast .t-sub { opacity: .8; font-size: 12px; }
.toast.out { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- Drawer (slides up from the bottom edge) + data table ---------- */
.drawer { display: flex; flex-direction: column; opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(24px) scale(.98); transform-origin: bottom left; transition: opacity .22s ease, transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s .3s; }
.drawer.open { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: opacity .22s ease, transform .3s cubic-bezier(.2, .8, .2, 1); }
.drawer-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 6px 10px; }
.drawer-bar .spacer { flex: 1; }
.table-wrap { overflow: auto; flex: 1; border-top: 1px solid var(--line); scrollbar-width: thin; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.table th { position: sticky; top: 0; z-index: 1; background: rgba(248, 250, 252, .97); text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: .02em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover { background: var(--hover); }
.table tbody tr.active td { background: rgba(254, 226, 226, .45); }
.table td.strong { color: var(--ink); font-weight: 600; }
.table .empty { text-align: center; color: var(--faint); padding: 28px; cursor: default; }

/* ---------- Loading splash & camera-swap veil ---------- */
.splash { position: fixed; inset: 0; background: #fff; display: grid; place-items: center; z-index: 50; transition: opacity .8s ease; }
.splash.hide { opacity: 0; pointer-events: none; }
.splash .ld { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.splash .ld i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.veil { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .18s; z-index: 2; }
.veil.on { opacity: 1; }

/* ---------- 3D labels (three.js CSS2DRenderer) ----------
   .tag3d         device pill: dot · id · value   (.sel .off .fault)
   .tag3d-sensor  sensor pill, smaller             (.on = sees someone, .offline)
   .tag3d-mini    tiny square label for secondary items
   Put .hide-tags on the label layer to hide them all. */
.tag3d { pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 4px 9px 4px 7px; border-radius: 99px; background: rgba(255, 255, 255, .94); border: 1px solid rgba(37, 99, 235, .22); box-shadow: var(--shadow-sm); font-size: 11.5px; font-weight: 600; color: var(--ink); white-space: nowrap; transition: border-color .2s, background .2s; }
.tag3d i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
.tag3d span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.tag3d:hover, .tag3d.sel { border-color: var(--accent); background: #fff; }
.tag3d.sel { background: var(--accent); color: #fff; }
.tag3d.sel span { color: rgba(255, 255, 255, .8); }
.tag3d.sel i { background: #fff; box-shadow: none; }
.tag3d.off { border-color: var(--line); color: var(--muted); }
.tag3d.off i { background: var(--off); box-shadow: none; }
.tag3d.fault { background: var(--danger); border-color: var(--danger); color: #fff; animation: tag-alarm 1.2s ease-in-out infinite; }
.tag3d.fault span { color: rgba(255, 255, 255, .9); }
.tag3d.fault i { background: #fff; box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
@keyframes tag-alarm { 50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, .22), var(--shadow-sm); } }
.tag3d-sensor { pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 5px; padding: 2px 8px 2px 6px; border-radius: 99px; background: rgba(255, 255, 255, .92); border: 1px solid rgba(15, 23, 42, .12); box-shadow: var(--shadow-sm); font-size: 10.5px; color: var(--ink-2); white-space: nowrap; }
.tag3d-sensor b { font-weight: 600; color: var(--ink); }
.tag3d-sensor span { color: var(--muted); font-variant-numeric: tabular-nums; }
.tag3d-sensor i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.tag3d-sensor.on { border-color: rgba(16, 185, 129, .45); }
.tag3d-sensor.on i { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-ring); }
.tag3d-sensor.on span { color: #047857; }
.tag3d-sensor.warn { border-color: rgba(245, 158, 11, .5); }
.tag3d-sensor.warn i { background: var(--warn); }
.tag3d-sensor.warn span { color: #b45309; }
.tag3d-sensor.offline { opacity: .55; }
.tag3d-mini { font-size: 10px; font-weight: 600; color: #475569; background: rgba(255, 255, 255, .9); border: 1px solid rgba(15, 23, 42, .12); border-radius: 5px; padding: 1px 5px; letter-spacing: .03em; }
.hide-tags :is(.tag3d, .tag3d-sensor, .tag3d-mini), .hide-sensors .tag3d-sensor { display: none; }
@media (max-width: 820px) {
  .tag3d { font-size: 10.5px; padding: 3px 7px 3px 6px; gap: 5px; }
  .tag3d span, .tag3d-sensor, .tag3d-mini { display: none; }
}

/* ---------- AI assistant dock ----------
   .dock-bar   glass pill: avatar circle · name/status · mic button
   .mic-btn    round primary action (.live = in a session → red stop)
   .levels     tiny live audio meter (set --l 0..1 on each <i>)
   .bubble     speech bubble for the assistant (.err for problems)
   .said       muted line with what the user said */
.dock-bar { position: relative; display: flex; align-items: center; gap: 10px; height: 56px; padding: 6px 6px 6px 58px; border-radius: 99px; }
.dock-avatar { position: absolute; left: 6px; top: 6px; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle at 50% 30%, #f8fbff, #dbeafe 75%); box-shadow: inset 0 0 0 1px rgba(37, 99, 235, .15); }
.dock-text { min-width: 0; flex: 1; line-height: 1.25; }
.dock-text b { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; }
.dock-text span { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mic-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; display: grid; place-items: center; color: #fff; background: var(--accent); box-shadow: 0 6px 16px rgba(37, 99, 235, .32); transition: background .2s, box-shadow .2s, transform .15s; }
.mic-btn:hover { transform: scale(1.05); }
.mic-btn:active { transform: scale(.95); }
.mic-btn svg { width: 19px; height: 19px; }
.mic-btn.live { background: var(--danger); box-shadow: 0 6px 16px rgba(239, 68, 68, .32); }
.mic-btn .ring { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .8s linear infinite; }
.levels { display: inline-flex; align-items: center; gap: 2px; height: 12px; }
.levels i { width: 3px; border-radius: 2px; background: var(--accent); height: calc(3px + var(--l, 0) * 9px); transition: height .08s; }
.bubble { padding: 11px 14px; border-radius: 16px 16px 16px 5px; font-size: 13.5px; line-height: 1.55; color: var(--ink); }
.bubble .who { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--accent); margin-bottom: 3px; }
.bubble.err .who { color: var(--danger); }
.bubble .tool { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.bubble .tool::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.said { margin-top: 6px; font-size: 12px; color: var(--muted); padding-left: 2px; }
.said b { color: var(--ink-2); font-weight: 600; }

/* ---------- Full pages (over the faded, paused 3D scene) ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head h2 { margin: 8px 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { margin: 0; max-width: 620px; font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.feature { padding: 16px; border-radius: var(--radius); background: rgba(255, 255, 255, .7); border: 1px solid var(--line); }
.feature h3 { margin: 12px 0 4px; font-size: 14px; font-weight: 600; }
.feature p { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.feature-ic { width: 34px; height: 34px; border-radius: var(--radius-sm); display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); }
.feature-ic svg { width: 18px; height: 18px; }

/* ---------- Chart cards (chart left, computed insights right) ---------- */
.chart-card { background: rgba(255, 255, 255, .82); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; min-width: 0; }
.chart-card > header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.chart-card h4 { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.35; }
.chart-card header small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.chart-card .acts { margin-left: auto; display: flex; gap: 2px; }
.chart-ic { flex: none; width: 30px; height: 30px; border-radius: var(--radius-xs); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.chart-ic svg { width: 16px; height: 16px; }
.chart-body { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; align-items: start; }
.chart-box { position: relative; height: 260px; min-width: 0; }
.chart-box.sm { height: 118px; }
.chart-box canvas { max-width: 100%; }
.insights { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.insights li { position: relative; padding-left: 14px; }
.insights li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.empty-box { padding: 22px; border: 1px dashed rgba(15, 23, 42, .14); border-radius: var(--radius); text-align: center; font-size: 12.5px; color: var(--muted); }
/* heatmap in plain HTML: hours across, rows = days. Cell colour = accent at opacity --a */
.heat { display: grid; grid-template-columns: 48px repeat(var(--cols), minmax(0, 1fr)); gap: 2px; font-size: 10px; color: var(--muted); }
.heat .hr { white-space: nowrap; padding-right: 6px; text-align: right; line-height: 13px; }
.heat i { height: 13px; border-radius: 2px; background: rgba(37, 99, 235, var(--a)); }
.heat i.na { background: var(--well); }

@media (max-width: 1180px) {
  .chart-body { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .page-head { flex-direction: column; gap: 10px; }
  .page-head h2 { font-size: 20px; }
  .chart-box { height: 220px; }
}

/* =====================================================================
   DC-1 additions (Data Center + KMCE OS) — same tokens, no new colours.
   Documented in ../ROADMAP.md §Design additions.
   ===================================================================== */
/* amber state for 3D pills (generator running, UPS on battery, bypass) */
.tag3d.warn { border-color: rgba(245, 158, 11, .6); }
.tag3d.warn i { background: var(--warn); box-shadow: 0 0 0 3px rgba(245, 158, 11, .18); }
.tag3d.warn span { color: #b45309; }
.tag3d-mini { pointer-events: auto; cursor: pointer; white-space: nowrap; }
.hide-details .detail-tag { display: none; }
.unit-dots button.warn { background: var(--warn); }
.rack-dots { grid-template-columns: repeat(10, 12px); gap: 5px; }
.rack-dots button { width: 12px; height: 12px; border-radius: 3px; }

/* label · progress · value row inside cards */
.bar-row { display: grid; grid-template-columns: 92px 1fr 44px; align-items: center; gap: 8px; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.bar-row b { text-align: right; color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.state-word { font-size: 22px; letter-spacing: -.01em; }
.det-note { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.det-note b { color: var(--ink-2); font-weight: 600; }
.det-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.det-acts .btn { padding: 6px 10px; font-size: 12px; }
.detail .setpoint { margin-top: 10px; }
.detail .badge { flex: none; }
.eng-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }

/* battery modules: one cell per module, accent by temperature, amber/red when hot */
.cells { display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px; margin-top: 10px; }
.cells i { height: 12px; border-radius: 2px; background: rgba(37, 99, 235, var(--a, .2)); }
.cells i.warn { background: var(--warn); }
.cells i.fault { background: var(--danger); }

/* alarm timeline inside an alert card */
.timeline { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 3px; font-size: 11px; color: var(--ink-2); }
.timeline li { display: grid; grid-template-columns: 58px 1fr; gap: 6px; }
.timeline time { color: var(--muted); font-variant-numeric: tabular-nums; }

/* alarm → evidence flow strip (proposal figure 2) */
.flow { display: flex; align-items: center; gap: 6px; padding: 0 6px 10px; flex-wrap: wrap; }
.flow-step { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-2); background: var(--well); border-radius: 99px; padding: 4px 10px 4px 4px; }
.flow-step b { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; color: #fff; background: var(--accent); }
.flow > i { width: 12px; height: 1px; background: var(--faint); }

/* single-line diagram (SVG): grey = not energised, blue = utility, amber = generator/battery/bypass, red dashed = lost */
.sld { width: 100%; height: auto; display: block; font-family: var(--font); }
.sld text { font-size: 11px; fill: var(--muted); }
.sld text.b, .sld tspan.b { font-weight: 600; fill: var(--ink); }
.sld text.sm { font-size: 10px; }
.sld .ln { fill: none; stroke: #cbd5e1; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: stroke .3s; }
.sld .ln.bus { stroke-width: 4; }
.sld .ln.live { stroke: var(--accent); }
.sld .ln.gen { stroke: var(--warn); }
.sld .ln.ok { stroke: var(--ok); }
.sld .ln.dead { stroke: var(--danger); stroke-dasharray: 4 5; }
.sld .ln.flow { stroke-dasharray: 9 7; animation: sld-flow 1s linear infinite; }
@keyframes sld-flow { to { stroke-dashoffset: -16; } }
.sld .src { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.sld .src.lost { stroke: var(--danger); }
.sld .src.on { stroke: var(--warn); }
.sld .xf { fill: #fff; stroke: var(--ink-2); stroke-width: 1.6; }
.sld .ups-box { fill: rgba(37, 99, 235, .04); stroke: rgba(37, 99, 235, .25); stroke-width: 1; stroke-dasharray: 3 3; }
.sld .sld-el rect { fill: #fff; stroke: rgba(15, 23, 42, .18); stroke-width: 1; }
.sld .sld-el.on rect { stroke: var(--warn); }
.sld .sld-el.load rect { fill: var(--accent-soft); stroke: transparent; }
.sld .sld-el.load text { fill: var(--accent); font-weight: 600; }
.sld .sld-el text { font-size: 10.5px; fill: var(--ink-2); }
.sld .sld-el { cursor: pointer; }
.sld .sld-el:hover rect, .sld .sld-el:hover circle { stroke: var(--accent); }
.sld .bat { stroke: var(--ink-2); stroke-width: 3; } .sld .bat.thin { stroke-width: 1.5; }
.sld .divider-v { stroke: var(--line); stroke-dasharray: 2 4; }

/* operating-state cards (proposal §3.2) */
.state-card { padding: 14px; border-radius: var(--radius); background: rgba(255, 255, 255, .7); border: 1px solid var(--line); display: grid; gap: 6px; align-content: start; }
.state-card b { font-size: 13.5px; }
.state-card p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.state-card .kit span { font-weight: 600; color: var(--accent); }
.state-card.now { border-color: var(--accent-line); background: linear-gradient(160deg, #eff6ff, #ffffff 70%); }
.state-card.now.warn { border-color: rgba(245, 158, 11, .45); background: linear-gradient(160deg, var(--warn-soft), #ffffff 70%); }
.state-card .badge { justify-self: start; }

/* feed capacity grid: row · normal bar · after-loss bar · numbers */
.feed-grid { display: grid; grid-template-columns: 52px 1fr 1fr 150px; align-items: center; gap: 10px 12px; font-size: 12px; }
.feed-grid .num { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.feed-grid small { color: var(--muted); }
.sm { font-size: 11px; color: var(--muted); }
.cell-block + .cell-block { margin-top: 14px; }
.cell-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; }
.pq { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.pq .kpi { display: grid; gap: 2px; }

/* engine console (AWS-style tiles) */
.engine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.engine-tile { font: inherit; text-align: left; cursor: pointer; display: grid; gap: 8px; align-content: start; padding: 14px; border-radius: var(--radius); background: rgba(255, 255, 255, .72); border: 1px solid var(--line); transition: border-color .15s, box-shadow .15s, transform .15s; color: var(--ink); }
.engine-tile:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.engine-tile.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.engine-tile.planned { background: rgba(255, 255, 255, .5); }
.engine-tile.planned .feature-ic { color: var(--faint); background: var(--well); }
.engine-tile p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.et-top { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; }
.et-name small { display: block; font-size: 10.5px; letter-spacing: .06em; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.et-name b { font-size: 14px; font-weight: 600; }
.et-io { font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.et-io span { display: block; font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.et-foot { font-size: 11.5px; color: var(--accent); font-weight: 500; }
.cap-list { display: flex; flex-wrap: wrap; gap: 6px; }
.cap-list span { font-size: 11.5px; padding: 3px 9px; border-radius: 99px; background: var(--well); color: var(--ink-2); }
code.api { display: block; font-size: 11.5px; padding: 8px 10px; border-radius: var(--radius-xs); background: var(--well); color: var(--ink-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.steps4 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.steps4 li { display: grid; gap: 6px; padding: 10px; border-radius: var(--radius-sm); background: var(--well); font-size: 12px; color: var(--muted); }
.steps4 li b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; background: #fff; color: var(--muted); border: 1px solid var(--line); }
.steps4 li.done b { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.steps4 li.now { background: var(--accent-soft); color: var(--ink); }
.steps4 li.now b { background: var(--accent); color: #fff; border-color: transparent; }
.layers5 { display: grid; gap: 4px; }
.layers5 div { display: grid; grid-template-columns: 30px 150px 1fr; gap: 10px; align-items: baseline; padding: 6px 8px; border-radius: var(--radius-xs); font-size: 12.5px; }
.layers5 div.hl { background: var(--accent-soft); }
.layers5 b { color: var(--accent); }
.layers5 small { color: var(--muted); font-size: 11.5px; }
.platform { display: flex; flex-wrap: wrap; gap: 8px; }
.platform span { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 7px 12px; border-radius: 99px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); color: var(--ink-2); }
.pkg { padding: 16px; border-radius: var(--radius); background: rgba(255, 255, 255, .7); border: 1px solid var(--line); }
.pkg.rec { border-color: var(--accent-line); box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.pkg-top { display: flex; justify-content: space-between; align-items: center; }
.pkg-top b { font-size: 15px; }
.pkg-price { margin-top: 6px; font-size: 12px; color: var(--muted); }
.pkg ul { margin: 12px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.8; color: var(--ink-2); }

/* customers */
.cust-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.cust-card { padding: 14px; border-radius: var(--radius); background: rgba(255, 255, 255, .72); border: 1px solid var(--line); cursor: pointer; display: grid; gap: 8px; align-content: start; transition: border-color .15s; }
.cust-card:hover { border-color: var(--accent-line); }
.cust-card.sel { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.cc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cc-top b { display: block; font-size: 14px; }
.cc-sites { display: flex; flex-wrap: wrap; gap: 4px; }
.cc-sites span { font-size: 11px; color: var(--ink-2); background: var(--well); border-radius: 6px; padding: 2px 7px; }
.cc-meta { display: flex; gap: 10px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cust-card .bar-row { margin-top: 2px; }
.app-head { display: grid; gap: 2px; margin-bottom: 12px; }
.app-head b { font-size: 13.5px; }
.tl5 { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tl5 li { display: grid; gap: 2px; padding: 9px; border-radius: var(--radius-sm); background: var(--well); font-size: 11.5px; color: var(--muted); border-top: 3px solid var(--accent); }
.tl5 li b { font-size: 12px; color: var(--ink); }
.tl5 li time { font-size: 11px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.tl5 li.warn { border-top-color: var(--warn); } .tl5 li.warn time { color: #b45309; }
.tl5 li.ok { border-top-color: var(--ok); } .tl5 li.ok time { color: #047857; }
.rooms { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; margin-top: 12px; }
.rooms i { height: 18px; border-radius: 3px; font-style: normal; font-size: 8.5px; color: #fff; display: grid; place-items: center; font-weight: 600; }
.rooms i.occ, .legend i.occ { background: var(--accent); }
.rooms i.ready, .legend i.ready { background: var(--ok); }
.rooms i.dirty, .legend i.dirty { background: var(--off); }
.rooms i.exc, .legend i.exc { background: var(--warn); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.chargers { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.chargers i { height: 20px; border-radius: 4px; background: var(--off); }
.chargers i.chg { background: var(--accent); }
.chargers i.fault { background: var(--danger); }
.chart-box.sm2 { height: 190px; }
.gantt { display: grid; gap: 8px; }
.g-phases { display: flex; font-size: 10.5px; color: var(--muted); margin-left: 200px; margin-right: 54px; }
.g-phases span { border-left: 1px dashed rgba(15, 23, 42, .15); padding-left: 4px; }
.g-row { display: grid; grid-template-columns: 192px 1fr 46px; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-2); }
.g-row b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.g-bar { height: 8px; border-radius: 99px; background: var(--well); overflow: hidden; }
.g-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

/* ESG */
.esg-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.esg-controls label { display: inline-flex; align-items: center; gap: 6px; }
.esg-controls .spacer { flex: 1; }
.esg-controls .btn.dim { opacity: .5; }
.btn-primary:disabled { background: var(--accent-soft); color: var(--accent); cursor: default; }
.esg-steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.esg-step { display: grid; gap: 4px; padding: 12px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, .7); border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); align-content: start; }
.esg-step b { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.esg-step b i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; background: var(--well); color: var(--muted); }
.esg-step small { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.esg-step.done b i { background: var(--ok); color: #fff; }
.esg-step.warn b i { background: var(--warn); color: #fff; }
.esg-step.now { border-color: var(--accent-line); background: linear-gradient(160deg, #eff6ff, #ffffff 70%); }
.esg-step.now b i { background: var(--accent); color: #fff; }
.ai-text { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.spin { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent-soft); border-top-color: var(--accent); animation: spin .8s linear infinite; vertical-align: -2px; }
.print-head { display: none; }
@media print {
  .print-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
  .print-head b { color: var(--ink); font-size: 14px; }
}
@media (max-width: 1180px) {
  .esg-steps, .tl5 { grid-template-columns: repeat(2, 1fr); }
  .steps4 { grid-template-columns: repeat(2, 1fr); }
}
