/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.25; text-wrap: balance; letter-spacing: 0; font-weight: 700; }
h3, h4 { font-family: var(--font-body); font-weight: 750; letter-spacing: -0.005em; }
h1 { font-size: 22px; font-weight: 600; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 14.5px; font-weight: 600; }
p { margin: 0; }
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
.mono { font-family: var(--font-mono); font-size: 0.92em; letter-spacing: -0.01em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--primary-dark); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100%; }
.shell.collapsed { --sidebar-w: 72px; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 12px 18px; gap: 4px;
  transition: width 0.18s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand-mark { width: 38px; height: 38px; flex: none; display: block; }
.brand-logo { height: 40px; width: auto; display: block; max-width: 100%; }
.brand-name { font: 700 15.5px var(--font-display); }
.brand-sub { font-size: 11px; color: var(--text-3); }
.nav-group { margin-top: 10px; }
.nav-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-3); padding: 6px 10px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text-2); font-weight: 600; font-size: 13.5px; cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
}
.nav-item svg { width: 18px; height: 18px; flex: none; }
.nav-item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--primary-light); color: var(--primary-dark); }
.nav-item .count { margin-left: auto; font-size: 11px; background: var(--primary); color: var(--primary-ink); border-radius: 99px; padding: 0 7px; }
.shell.collapsed .nav-label, .shell.collapsed .nav-text, .shell.collapsed .brand-text, .shell.collapsed .brand-logo, .shell.collapsed .nav-item .count { display: none; }
.brand .brand-mark { display: none; }
.shell.collapsed .brand .brand-mark { display: block; }
.shell.collapsed .nav-item { justify-content: center; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding-inline: 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.search {
  flex: 1 1 auto; max-width: 460px; position: relative;
}
.search input {
  width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  padding: 0 12px 0 36px;
}
.search svg { position: absolute; left: 11px; top: 10px; width: 17px; height: 17px; color: var(--text-3); }
.search-results {
  position: absolute; top: 44px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 60vh; overflow: auto; padding: 6px; z-index: 40;
}
.search-hit { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.search-hit:hover, .search-hit.sel { background: var(--surface-2); }
.search-hit .kind { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); width: 74px; flex: none; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; position: relative; color: var(--text-2); flex: none;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.user-chip .who { line-height: 1.15; }
.user-chip .who b { display: block; font-size: 13px; }
.user-chip .who span { font-size: 11px; color: var(--text-2); }

.content { padding: 22px 24px 60px; max-width: 1480px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { color: var(--text-2); margin-top: 3px; max-width: 70ch; }
.page-head > .row { justify-content: flex-end; }
.page-head .select, .page-head .input { width: auto; max-width: 100%; }
.demo-banner {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 14px; margin-bottom: 16px;
  background: var(--primary-light); color: var(--primary-dark); border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600;
}

/* ---------- Cards & grid ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-body { padding: 16px 18px; }
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span-2 { grid-column: span 2; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.kpi .label { font-size: 12px; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .value { font: 750 22px/1.2 var(--font-body); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.kpi .sub { font-size: 12px; color: var(--text-3); }
.kpi.accent { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.kpi.accent .label, .kpi.accent .sub { color: color-mix(in srgb, var(--primary-ink) 80%, transparent); }
.kpi.clickable { cursor: pointer; }
.kpi.clickable:hover { border-color: var(--primary); }

.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.mini-stats > div { background: var(--surface); padding: 10px 12px; }
.mini-stats b { display: block; font: 750 16px var(--font-body); font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: 11.5px; color: var(--text-2); }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font-weight: 650; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { border-color: var(--primary); color: var(--primary-dark); text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--primary-ink); }
.btn.danger { color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 12px; font-weight: 700; color: var(--text-2); }
.field .hint { font-size: 11.5px; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 11px; border-radius: 9px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text);
}
.textarea { height: auto; min-height: 76px; padding: 9px 11px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { grid-column: 1 / -1; margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--line); }
.check { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .input, .toolbar .select { height: 34px; width: auto; min-width: 140px; font-size: 13px; }
.toolbar .input.search-in { min-width: 220px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 0 12px; height: 32px; font-weight: 650; font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.seg button.on { background: var(--primary-light); color: var(--primary-dark); }
.seg button + button { border-left: 1px solid var(--line); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 650; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--primary-dark); border-bottom-color: var(--primary); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 99px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral-ink);
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge.plain::before { display: none; }
.badge.success { background: var(--success-bg); color: var(--success-ink); }
.badge.info { background: var(--info-bg); color: var(--info-ink); }
.badge.warning { background: var(--warning-bg); color: var(--warning-ink); }
.badge.danger { background: var(--danger-bg); color: var(--danger-ink); }
.badge.brand { background: var(--primary-light); color: var(--primary-dark); }
.badge.us { background: var(--primary-light); color: var(--primary-dark); }
.badge.tp { background: color-mix(in srgb, var(--series-3p) 16%, var(--surface)); color: color-mix(in srgb, var(--series-3p) 75%, var(--text)); }
.badge.dev { background: color-mix(in srgb, var(--series-dev) 16%, var(--surface)); color: color-mix(in srgb, var(--series-dev) 70%, var(--text)); }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 600; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2);
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0;
}
.tbl th.sortable { cursor: pointer; }
.tbl td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover td { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tfoot td { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--line); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-2); flex-wrap: wrap; }

.person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.person .meta { min-width: 0; line-height: 1.25; }
.person .meta b { display: block; font-weight: 650; }
.person .meta span { font-size: 11.5px; color: var(--text-2); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font: 700 12px var(--font-body); color: #fff; background: hsl(calc(18 + var(--h, 180) / 8) 30% 38%);
}
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }

/* ---------- Empty / skeleton ---------- */
.empty { padding: 40px 20px; text-align: center; color: var(--text-2); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty svg { width: 36px; height: 36px; color: var(--text-3); }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Overlays ---------- */
.overlay { position: fixed; inset: 0; background: rgba(22, 19, 15, 0.5); z-index: 60; display: flex; }
.modal {
  margin: auto; width: min(620px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
}
.modal.wide { width: min(880px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); gap: 12px; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.drawer {
  margin-left: auto; width: min(560px, 100vw); height: 100%; background: var(--surface); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; animation: slideIn 0.2s ease;
}
.drawer.wide { width: min(760px, 100vw); }
.drawer-body { overflow: auto; padding: 18px 20px 40px; flex: 1; }
@keyframes slideIn { from { transform: translateX(24px); opacity: 0.4; } }
.toasts { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 90; display: flex; flex-direction: column; gap: 8px; max-width: calc(100vw - 32px); }
.toast { background: var(--text); color: var(--bg); padding: 11px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 13px; display: flex; gap: 9px; align-items: center; max-width: 420px; animation: slideIn 0.2s ease; }
.toast.error { background: var(--danger); color: #fff; }
.toast.success::before { content: '✓'; color: var(--success); font-weight: 800; }
.popover { position: absolute; right: 0; top: 46px; width: 340px; max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 40; }

.dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; font-size: 13px; }
.dl dt { color: var(--text-2); font-weight: 600; }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Charts ---------- */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--text-2); font: 11px var(--font-body); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-line { stroke: var(--line-strong); }
.chart .bar { fill: var(--primary); }
.chart .bar:hover, .chart .hit:hover + .bar { fill: var(--primary-dark); }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 2; }
.chart .area { fill: color-mix(in srgb, var(--primary) 14%, transparent); }
.chart .endpoint { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.chart-tip { position: fixed; pointer-events: none; z-index: 80; background: var(--text); color: var(--bg); padding: 7px 10px; border-radius: 8px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow-lg); white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); font-weight: 600; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sharebar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--series-avail); gap: 2px; }
.sharebar > span { height: 100%; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.progress.ok > span { background: var(--success); }

/* ---------- Plot layout ---------- */
.layout-board { display: flex; flex-direction: column; gap: 18px; }
.block-row { display: flex; gap: 14px; align-items: flex-start; }
.block-label { writing-mode: vertical-rl; transform: rotate(180deg); font: 700 11px var(--font-body); letter-spacing: 0.14em; color: var(--text-3); padding: 6px 0; }
.plots-grid { display: grid; grid-template-columns: repeat(8, minmax(54px, 1fr)); gap: 6px; flex: 1; }
.road { height: 22px; border-radius: 4px; background: repeating-linear-gradient(90deg, var(--surface-3) 0 18px, transparent 18px 28px), var(--surface-2); border: 1px dashed var(--line-strong); display: grid; place-items: center; font-size: 10.5px; color: var(--text-3); font-weight: 700; letter-spacing: 0.1em; }
.plot {
  position: relative; border-radius: 6px; padding: 6px 7px; min-height: 58px; cursor: pointer; border: 1.5px solid transparent;
  display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; line-height: 1.2; transition: transform 0.1s;
}
.plot:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.plot b { font: 700 12px var(--font-mono); }
.plot .ar { opacity: 0.85; font-variant-numeric: tabular-nums; }
.plot.corner::after { content: ''; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 2px; background: currentColor; opacity: 0.55; }
.plot.dim { opacity: 0.25; }
.st-AVAILABLE { background: var(--success-bg); color: var(--success-ink); border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.st-RESERVED { background: var(--warning-bg); color: var(--warning-ink); border-color: color-mix(in srgb, var(--warning) 55%, transparent); }
.st-BOOKED { background: var(--info-bg); color: var(--info-ink); border-color: color-mix(in srgb, var(--info) 50%, transparent); }
.st-SOLD { background: var(--primary); color: var(--primary-ink); }
.st-SOLD.ch-THIRD_PARTY { background: var(--series-3p); color: #fff; }
.st-SOLD.ch-DEVELOPER_DIRECT { background: var(--series-dev); color: #fff; }
.st-BLOCKED, .st-NOT_FOR_SALE { background: var(--neutral-bg); color: var(--neutral-ink); border-color: var(--line-strong); border-style: dashed; }
.st-ON_HOLD { background: var(--danger-bg); color: var(--danger-ink); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.swatch { display: inline-block; width: 13px; height: 13px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; border-width: 1.5px; border-style: solid; }

/* ---------- Network tree ---------- */
.tree { font-size: 13px; }
.tree ul { list-style: none; margin: 0; padding-left: 22px; border-left: 1px dashed var(--line-strong); margin-left: 15px; }
.tree > ul { border-left: 0; padding-left: 0; margin-left: 0; }
.tree li { position: relative; padding: 4px 0; }
.tree ul ul > li::before { content: ''; position: absolute; left: -22px; top: 24px; width: 18px; border-top: 1px dashed var(--line-strong); }
.node {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; max-width: 720px;
}
.node:hover { border-color: var(--primary); }
.node.sel { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.node .toggle { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; flex: none; font-weight: 700; color: var(--text-2); }
.node .toggle.leaf { visibility: hidden; }
.node .nums { margin-left: auto; display: flex; gap: 14px; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text-2); text-align: right; }
.node .nums b { color: var(--text); display: block; font-size: 13px; }
.des-tag { font: 700 10.5px var(--font-mono); padding: 2px 6px; border-radius: 5px; background: var(--primary-light); color: var(--primary-dark); letter-spacing: 0.02em; }

/* ---------- ID card ---------- */
.idcard {
  width: 330px; max-width: 100%; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.idcard .top { background: linear-gradient(135deg, var(--charcoal), var(--charcoal-2)); color: var(--on-charcoal); padding: 14px 16px 36px; position: relative; border-bottom: 3px solid var(--gold); }
.idcard .top img { height: 34px; width: auto; display: block; }
.idcard .top .org { font: 700 15px var(--font-display); }
.idcard .top .tag { font-size: 10px; color: var(--on-charcoal-2); letter-spacing: 0.16em; text-transform: uppercase; margin-top: 6px; }
.idcard .photo { width: 78px; height: 78px; border-radius: 14px; border: 4px solid var(--surface); margin: -34px auto 0; display: grid; place-items: center; font: 700 26px var(--font-body); color: #fff; position: relative; }
.idcard .body { padding: 8px 18px 16px; text-align: center; }
.idcard .qr { display: grid; place-items: center; padding: 8px; background: #fff; border-radius: 8px; width: max-content; margin: 10px auto 0; }

/* ---------- Timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 10px; padding-bottom: 12px; position: relative; }
.timeline li::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); margin-top: 5px; }
.timeline li::after { content: ''; position: absolute; left: 4px; top: 16px; bottom: 0; border-left: 1px solid var(--line); }
.timeline li:last-child::after { display: none; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: linear-gradient(160deg, var(--charcoal), var(--charcoal-2)); color: var(--on-charcoal); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.18; }
.login-art h1 em { font-style: italic; color: var(--gold); }
.login-art .logo { height: 54px; width: auto; }
.login-art > * { position: relative; }
.login-art h1 { font-size: 34px; line-height: 1.15; max-width: 16ch; }
.login-form { display: grid; place-items: center; padding: 32px 16px; }
.login-form .inner { width: min(400px, 100%); }
.acct { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); width: 100%; text-align: left; }
.acct:hover { border-color: var(--primary); }

/* ---------- Mobile ---------- */
.bottom-nav { display: none; }
.only-mobile { display: none; }
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 70; width: 270px; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.collapsed { --sidebar-w: 0; }
  .shell.collapsed .nav-label, .shell.collapsed .nav-text, .shell.collapsed .brand-text, .shell.collapsed .brand-logo { display: revert; }
  .shell.collapsed .brand .brand-mark { display: none; }
  .only-mobile { display: grid; }
  .g-2, .g-3 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .content { padding: 16px 16px 90px; }
  .topbar { padding-inline: 12px; gap: 8px; }
  .user-chip .who { display: none; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 28px 20px; min-height: 220px; }
  .login-art h1 { font-size: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 120px 1fr; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; color: var(--text-2); padding: 4px 0; border-radius: 8px; }
  .bottom-nav a svg { width: 20px; height: 20px; }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav a:hover { text-decoration: none; }
  .node .nums .hide-sm { display: none; }
  .plots-grid { grid-template-columns: repeat(4, minmax(54px, 1fr)); }
}
@media (max-width: 560px) {
  .g-4 { grid-template-columns: 1fr 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi .value { font-size: 18px; }
  h1 { font-size: 19px; }
  .search { max-width: none; }
  .toolbar .input, .toolbar .select { min-width: 0; flex: 1 1 140px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Commission settings */
.rate-table td.num, .rate-table th.num { min-width: 64px; }
.how-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 8px; color: var(--text-2); }
.how-list b { color: var(--text); }
.steps { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 12px; }
.steps span { font-size: 11.5px; font-weight: 650; padding: 4px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-3); border: 1px solid var(--line); }
.steps span.done { background: var(--primary-light); color: var(--primary-dark); border-color: transparent; }
.steps span.now { background: var(--primary); color: var(--primary-ink); border-color: transparent; }
.steps span.lost { background: var(--danger-bg); color: var(--danger-ink); border-color: transparent; }
.role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.role-cards .card { padding: 16px; }
.role-cards ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
.rate-table .prj-col { min-width: 180px; }
.rate-table th, .rate-table td { padding-inline: 10px; }
.act-col { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }

/* Commission split grid */
.split-tbl th, .split-tbl td { padding: 7px 8px; }
.split-tbl td.own { color: var(--primary-dark); font-weight: 800; }
.split-tbl.edit .num-in { width: 76px; padding: 6px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.split-tbl.edit .num-in.own { border-color: var(--primary); background: var(--primary-light); font-weight: 700; }
.quickfill { margin-top: 10px; }
.quickfill summary { cursor: pointer; color: var(--primary-dark); font-weight: 650; }
/* Site form */
.site-form .card { margin-bottom: 16px; }
.site-form .card-head h2 { display: flex; align-items: center; gap: 10px; }
.step-no { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: inline-grid; place-items: center; font: 800 13px var(--font-body); }
.block-card { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; background: var(--surface); }
.block-card .bh { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.block-card .bh .field { width: 110px; }
.plot-edit td { padding: 4px 6px; }
.plot-edit input, .plot-edit select { padding: 5px 7px; min-width: 0; }
.plot-edit .w-s { width: 70px; } .plot-edit .w-m { width: 92px; }
.plot-edit tr.locked { opacity: .65; }
.media-list { display: grid; gap: 8px; }
.media-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.media-row .mi { width: 36px; height: 36px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-light); color: var(--primary-dark); flex: none; }
.media-row .mt { flex: 1; min-width: 0; }
.progress-line { height: 4px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin-top: 6px; }
.progress-line i { display: block; height: 100%; background: var(--primary); width: 0; transition: width .2s; }
.launch-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; border: 1px solid var(--line); }
.launch-bar.DRAFT { background: var(--neutral-bg); }
.launch-bar.PENDING_APPROVAL { background: var(--warning-bg); border-color: transparent; }
.launch-bar.LIVE { background: var(--success-bg); border-color: transparent; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.listing-photo { aspect-ratio: 16/9; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); border-bottom: 1px solid var(--line); }
.listing-photo img { width: 100%; height: 100%; object-fit: cover; }
.listing-photo svg { width: 34px; height: 34px; }
.order-strip { padding: 10px 14px; margin-bottom: 14px; border-radius: var(--radius-sm); background: var(--primary-light); color: var(--text); }
.perm-tbl td, .perm-tbl th { padding: 6px 8px; } .perm-tbl input { width: 16px; height: 16px; accent-color: var(--primary); } .center { text-align: center; }
.split-tbl.edit td:not(:first-child) { text-align: right; } .split-tbl.edit .num-in { margin-left: auto; display: block; }
.perm-tbl td:first-child { min-width: 230px; } .perm-tbl th { font-size: 10.5px; }
