/* FM Suite — drafting-table design system
   Structure: deep navy chrome. Workspace: cool blueprint paper.
   Data voice: monospace for tags, coordinates, IDs. */

:root {
  --ink:        #122036;   /* deep navy structure   */
  --ink-2:      #1b2d49;   /* raised navy           */
  --ink-line:   #2b3e5e;
  --paper:      #eaeef4;   /* workspace background  */
  --panel:      #ffffff;
  --line:       #d6dde7;
  --line-soft:  #e7ecf2;
  --text:       #1d2939;
  --muted:      #66748c;
  --faint:      #93a0b5;
  --accent:     #2f6fed;   /* CAD interactive blue  */
  --accent-ink: #1d4fbf;
  --cyan:       #18b4c9;
  --ok:         #1f9d5b;
  --warn:       #d08700;
  --danger:     #d4352a;
  --radius:     10px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--paper);
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(47,111,237,.22); }

/* ---------- left rail (module switcher) ---------- */
#rail {
  width: 76px; flex: 0 0 76px;
  background: var(--ink);
  display: flex; flex-direction: column; align-items: stretch;
  padding-top: 8px;
  border-right: 1px solid #0c1626;
}
.rail-brand {
  color: #eaf1ff; text-align: center; font-weight: 700; letter-spacing: .5px;
  font-size: 12px; padding: 10px 4px 14px; line-height: 1.15;
}
.rail-brand small { display:block; color: var(--cyan); font-family: var(--mono); font-weight: 500; font-size: 9px; letter-spacing: 1.5px; margin-top: 3px; }
.rail-item {
  background: none; border: 0; color: #8fa1bd;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 4px; font-size: 9.5px; letter-spacing: .2px;
  border-left: 3px solid transparent; transition: background .15s, color .15s;
}
.rail-item .rail-ico { display: grid; place-items: center; height: 24px; }
.rail-item:hover:not(.disabled) { color: #dce6f7; background: #0d1a2e; }
.rail-item.active { color: #fff; background: var(--ink-2); border-left-color: var(--accent); }
.rail-item.disabled { opacity: .4; cursor: default; }
.rail-label { text-align: center; line-height: 1.05; }

/* ---------- main column ---------- */
#main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#topbar {
  height: 46px; flex: 0 0 46px; background: var(--ink-2);
  border-bottom: 1px solid #0c1626;
  display: flex; align-items: center; padding: 0 16px; gap: 14px; color: #e8eef9;
}
#topbar .tb-title { font-weight: 600; font-size: 14px; letter-spacing: .2px; }
#topbar .tb-crumb { font-family: var(--mono); font-size: 11px; color: #7f93b3; letter-spacing: .5px; }
#topbar .spacer { flex: 1; }
#topbar .env { font-family: var(--mono); font-size: 10px; color: var(--cyan); border: 1px solid #234; padding: 3px 8px; border-radius: 5px; letter-spacing: 1px; }
#stage { flex: 1; min-height: 0; position: relative; }

/* ---------- asset map layout ---------- */
.am { position: absolute; inset: 0; display: flex; }
.am-left {
  width: 312px; flex: 0 0 312px; background: var(--panel);
  border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0;
}
.panel-head { padding: 14px 16px 8px; }
.ph-title { font-weight: 700; font-size: 15px; letter-spacing: .2px; }
.bp-bar { display: flex; gap: 6px; padding: 0 14px 8px; }
.bp-select {
  flex: 1; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 8px; background: #fff; color: var(--text); font-size: 13px;
}
.left-actions { display: flex; gap: 6px; padding: 0 14px 10px; flex-wrap: wrap; }
.search {
  margin: 0 14px 8px; height: 34px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 10px; font-size: 13px; background: #fbfcfe;
}
.search:focus, .field:focus, .bp-select:focus { outline: 2px solid rgba(47,111,237,.35); outline-offset: 0; border-color: var(--accent); }

.asset-list { flex: 1; overflow-y: auto; padding: 4px 8px 14px; }
.list-empty { color: var(--muted); font-size: 13px; padding: 18px 12px; line-height: 1.5; }
.asset-row {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  background: none; border: 0; border-radius: 8px; padding: 8px 10px; margin-bottom: 2px;
}
.asset-row:hover { background: var(--line-soft); }
.asset-row.active { background: rgba(47,111,237,.10); box-shadow: inset 0 0 0 1px rgba(47,111,237,.3); }
.a-glyph { flex: 0 0 18px; display: grid; place-items: center; }
.a-main { flex: 1; min-width: 0; }
.a-tag { display: block; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .3px; color: var(--ink); }
.a-name { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-flags { flex: 0 0 auto; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.dot.placed { background: var(--ok); box-shadow: 0 0 0 2px rgba(31,157,91,.18); }

/* ---------- center stage ---------- */
.am-stage { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--paper); position: relative; }
.am-toolbar {
  height: 42px; flex: 0 0 42px; display: flex; align-items: center; gap: 16px;
  padding: 0 14px; background: #fff; border-bottom: 1px solid var(--line);
}
.tb-group { display: flex; align-items: center; gap: 4px; }
.tb-btn {
  height: 28px; min-width: 28px; padding: 0 8px; border: 1px solid var(--line);
  background: #fff; border-radius: 7px; font-size: 15px; color: var(--text); line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.tb-btn:hover { background: var(--line-soft); border-color: #c4cedb; }
.tb-btn.wide { font-size: 12px; font-weight: 600; }
.mono { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .4px; }
.coord { margin-left: auto; color: var(--faint); }

.am-viewport {
  flex: 1; min-height: 0; overflow: auto; padding: 24px;
  /* faint blueprint grid */
  background-color: var(--paper);
  background-image:
    linear-gradient(rgba(47,111,237,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47,111,237,.05) 1px, transparent 1px);
  background-size: 26px 26px;
}
.canvas-wrap { position: relative; width: max-content; margin: 0 auto;
  box-shadow: 0 4px 24px rgba(15,31,51,.16); background: #fff; }
#pdfCanvas { display: block; }
.marker-layer { position: absolute; inset: 0; }
.am.placing .marker-layer { cursor: crosshair; }
.am.placing .canvas-wrap { box-shadow: 0 0 0 2px var(--accent), 0 4px 24px rgba(15,31,51,.2); }

/* markers */
.marker {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center;
  cursor: grab; z-index: 2; filter: drop-shadow(0 1px 2px rgba(15,31,51,.35));
}
.marker.dragging { cursor: grabbing; z-index: 9; }
.marker .mk-svg { display: block; }
.marker-tag {
  margin-top: 2px; font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .3px; color: var(--ink); background: rgba(255,255,255,.92);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; white-space: nowrap;
  opacity: 0; transition: opacity .12s; pointer-events: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis;
}
.marker:hover .marker-tag, .marker.selected .marker-tag { opacity: 1; }
.marker.selected .mk-svg circle:first-child { stroke: var(--accent); }
.marker.selected::before {
  content: ''; position: absolute; top: 15px; left: 50%; width: 40px; height: 40px;
  transform: translate(-50%, -50%); border: 2px solid var(--accent); border-radius: 50%;
  animation: ping .9s ease-out 1;
}
@keyframes ping { 0% { opacity: .8; transform: translate(-50%,-50%) scale(.6); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.15); } }

.place-banner {
  position: absolute; top: 52px; left: 50%; transform: translateX(-50%) translateY(-8px);
  background: var(--accent); color: #fff; padding: 7px 12px; border-radius: 8px;
  font-size: 12.5px; font-weight: 500; z-index: 6; display: none; align-items: center; gap: 10px;
  box-shadow: 0 6px 18px rgba(47,111,237,.4);
}
.place-banner.show { display: flex; }
.place-banner .mini { background: rgba(255,255,255,.2); color: #fff; }

/* ---------- right detail panel (overlay slide-in) ---------- */
.am-right {
  position: absolute; top: 0; right: 0; bottom: 0; width: 384px;
  background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -8px 0 28px rgba(15,31,51,.10);
  transform: translateX(100%); transition: transform .22s ease; z-index: 5;
  display: flex; flex-direction: column; overflow-y: auto;
}
.am-right.open { transform: translateX(0); }
.detail-head { display: flex; align-items: center; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.d-glyph { width: 32px; height: 32px; display: grid; place-items: center; background: var(--line-soft); border-radius: 8px; }
.d-tag { font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--ink); letter-spacing: .3px; }
.d-sub { font-size: 12px; color: var(--muted); }
.detail-head .icon-btn { margin-left: auto; }
.detail-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.fr { display: flex; flex-direction: column; gap: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lbl { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.field {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-size: 13px; font-family: var(--sans); background: #fff; color: var(--text);
}
.field.sm { padding: 6px 8px; }
textarea.field { resize: vertical; }
.extra-box { border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; }
.extra-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; padding: 3px 0; }
.extra-row .ek { color: var(--muted); font-family: var(--mono); }
.extra-row .ev { color: var(--text); text-align: right; }

.detail-section { padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.sec-title { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .7px; margin-bottom: 8px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(18,32,54,.78); color: #fff; font-size: 14px; line-height: 1; }
.photo-add { aspect-ratio: 1; border: 1.5px dashed var(--line); border-radius: 8px; background: #fafbfd; color: var(--muted); font-size: 12px; }
.photo-add:hover { border-color: var(--accent); color: var(--accent); }
.hidden-file { display: none; }

.mk-list .mk-row { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.mk-row-actions { display: flex; gap: 6px; }
.hint { font-size: 12px; color: var(--faint); }

.detail-actions { padding: 14px 16px 22px; display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--line); margin-top: auto; }

/* ---------- buttons ---------- */
.btn {
  height: 32px; padding: 0 12px; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { background: var(--line-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); }
.btn.danger { color: var(--danger); border-color: #f0c9c6; }
.btn.danger:hover { background: #fdf1f0; }
.btn.ghost { background: transparent; }
.icon-btn { width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 7px; font-size: 16px; line-height: 1; color: var(--muted); }
.icon-btn:hover { background: var(--line-soft); color: var(--text); }
.mini { font-size: 11px; padding: 3px 8px; border: 1px solid var(--line); background: #fff; border-radius: 6px; color: var(--text); }
.mini.danger { color: var(--danger); border-color: #f0c9c6; }
.mini:hover { background: var(--line-soft); }

/* ---------- modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,40,.42); display: grid; place-items: center; z-index: 50; opacity: 0; transition: opacity .18s; padding: 20px; }
.modal-overlay.show { opacity: 1; }
.modal { width: min(560px, 96vw); max-height: 88vh; background: #fff; border-radius: 14px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(15,31,51,.3); transform: translateY(8px); transition: transform .18s; }
.modal-overlay.show .modal { transform: translateY(0); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 15px; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line); background: #fafbfd; }

/* types manager */
.types-mgr { display: flex; flex-direction: column; gap: 12px; }
.type-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: #fbfcfe; }
.tr-top { display: flex; align-items: center; gap: 8px; }
.tr-top .field { flex: 1; }
.color-in { width: 38px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.icon-picker { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.ip { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 7px; background: #fff; display: grid; place-items: center; }
.ip.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: rgba(47,111,237,.06); }

/* ---------- toasts ---------- */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 9px; font-size: 13px; box-shadow: 0 8px 24px rgba(15,31,51,.32); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; border-left: 3px solid var(--accent); }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.danger { border-left-color: var(--danger); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* responsive: collapse left panel labels on narrow */
@media (max-width: 920px) {
  .am-left { width: 250px; flex-basis: 250px; }
  .am-right { width: 100%; }
}

/* ---------- rooms ---------- */
.room-layer { position: absolute; top: 0; left: 0; pointer-events: none; overflow: visible; }
.room-label-layer { position: absolute; inset: 0; pointer-events: none; }
.room-poly {
  fill: var(--rc, #2f6fed); fill-opacity: .12;
  stroke: var(--rc, #2f6fed); stroke-width: 1.5; stroke-opacity: .9; stroke-linejoin: round;
}
.room-poly.selected { fill-opacity: .24; stroke-width: 2.5; }
.draw-line { fill: rgba(47,111,237,.10); stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 4; stroke-linejoin: round; }
.draw-dot { fill: #fff; stroke: var(--accent); stroke-width: 2; }
.draw-dot.first { fill: var(--accent); }
.am.drawing .marker-layer { cursor: crosshair; }
.am.drawing .canvas-wrap { box-shadow: 0 0 0 2px var(--accent), 0 4px 24px rgba(15,31,51,.2); }

.room-label {
  position: absolute; transform: translate(-50%, -50%);
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .3px;
  color: var(--ink); background: rgba(255,255,255,.88); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px; white-space: nowrap; pointer-events: none;
  max-width: 170px; overflow: hidden; text-overflow: ellipsis;
}
.room-label.selected { border-color: var(--accent); color: var(--accent-ink); }

.place-banner.draw { background: var(--ink); }
.place-banner.draw .mini { background: rgba(255,255,255,.18); color: #fff; }
.tb-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* room detail */
.d-glyph.room { background: var(--rc, #2f6fed); }
.lbl-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.link-mini { background: none; border: 0; color: var(--accent); font-size: 11px; font-weight: 600; cursor: pointer; padding: 0; }
.link-mini:hover { text-decoration: underline; }
.room-asset { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line-soft); padding: 7px 2px; }
.room-asset:hover { background: var(--line-soft); }

/* ---------- settings gear + customizable brand ---------- */
.gear-btn {
  background: transparent; border: 1px solid rgba(255,255,255,.18); color: #cdd9ee;
  width: 30px; height: 30px; border-radius: 7px; font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.gear-btn:hover { background: rgba(255,255,255,.10); color: #fff; }
.rail-brand { word-break: break-word; }
.rail-brand small:empty { display: none; }

/* ---------- left panel: tabs + panes ---------- */
.panel-head { display: flex; flex-direction: column; gap: 8px; }
.left-tabs { display: inline-flex; background: var(--line-soft); border: 1px solid var(--line); border-radius: 8px; padding: 2px; gap: 2px; align-self: flex-start; }
.left-tab { border: 0; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 6px; }
.left-tab.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(15,31,51,.12); }
.left-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }

/* ---------- hierarchy tree ---------- */
.tree { flex: 1; overflow-y: auto; padding: 4px 6px 14px; }
.tree-row { display: flex; align-items: center; gap: 6px; padding: 5px 8px 5px 0; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text); }
.tree-row:hover { background: var(--line-soft); }
.tree-row.active { background: rgba(47,111,237,.10); box-shadow: inset 0 0 0 1px rgba(47,111,237,.3); }
.tree-row.leaf .tw-label { color: var(--text); font-weight: 500; }
.tw-chev { width: 14px; flex: 0 0 14px; text-align: center; color: var(--faint); font-size: 10px; transition: transform .12s; cursor: pointer; }
.tw-chev.open { transform: rotate(90deg); }
.tw-chev.empty { visibility: hidden; }
.tw-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; box-shadow: 0 0 0 1px rgba(15,31,51,.12) inset; }
.tw-dot.ghost { background: var(--line); }
.tw-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.tree-row.leaf .tw-label { font-weight: 500; }
.tw-count { flex: 0 0 auto; font-family: var(--mono); font-size: 10px; color: var(--muted); background: var(--line-soft); border-radius: 9px; padding: 1px 7px; min-width: 20px; text-align: center; }

.tree-result { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line-soft); padding: 8px 6px; cursor: pointer; }
.tree-result:hover { background: var(--line-soft); }
.tr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tr-name { font-size: 13px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-path { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- toolbar floor label ---------- */
.floor-label { color: var(--ink); font-weight: 600; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 6px; border-right: 1px solid var(--line); margin-right: 4px; }

/* ---------- sites/buildings manager ---------- */
.sites-mgr { display: flex; flex-direction: column; gap: 18px; }
.mgr-sec .sec-title { margin-bottom: 8px; }
.mgr-site { border: 1px solid var(--line); border-radius: 10px; padding: 8px; margin-bottom: 8px; background: #fbfcfe; }
.mgr-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.mgr-row:last-child { margin-bottom: 0; }
.mgr-row .field { flex: 1; }
.mgr-row.indent { padding-left: 16px; }
.mgr-buildings { margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.mgr-bp { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.mgr-bp .field:first-child { flex: 1.2; }
.mgr-bp select { flex: 1; }

/* ---------- login screen ---------- */
.login-screen { position: fixed; inset: 0; z-index: 200; background: var(--ink); display: grid; place-items: center; padding: 20px; }
.login-card { width: min(360px, 94vw); background: #fff; border-radius: 14px; padding: 26px 24px; box-shadow: 0 24px 60px rgba(0,0,0,.4); display: flex; flex-direction: column; gap: 12px; }
.login-brand { font-weight: 800; letter-spacing: .5px; color: var(--ink); font-size: 18px; }
.login-title { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.login-card .field { width: 100%; }
.login-btn { width: 100%; height: 38px; margin-top: 4px; }
.login-err { color: var(--danger); font-size: 12.5px; min-height: 16px; }

/* ---------- user bar ---------- */
.user-bar { display: flex; align-items: center; gap: 10px; margin-right: 6px; }
.ub-name { color: #eaf1ff; font-size: 13px; font-weight: 600; }
.ub-role { color: var(--cyan); font-family: var(--mono); font-size: 10px; letter-spacing: .5px; border: 1px solid rgba(255,255,255,.18); padding: 2px 7px; border-radius: 5px; }
.ub-link { background: none; border: 0; color: #b9c8e4; font-size: 12px; font-weight: 600; cursor: pointer; }
.ub-link:hover { color: #fff; text-decoration: underline; }

/* ---------- room shape editing ---------- */
.edit-layer { position: absolute; top: 0; left: 0; pointer-events: none; }
.edit-handle { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; z-index: 12; }
.edit-handle.vert { width: calc(13px * var(--hz,1)); height: calc(13px * var(--hz,1)); border-radius: 50%; background: #fff; border: 2px solid var(--accent); cursor: grab; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.edit-handle.vert:hover { background: var(--accent); }
.edit-handle.add { width: calc(9px * var(--hz,1)); height: calc(9px * var(--hz,1)); border-radius: 50%; background: var(--accent); opacity: .5; cursor: copy; }
.edit-handle.add:hover { opacity: 1; transform: translate(-50%,-50%) scale(1.2); }
.edit-handle.move { width: calc(22px * var(--hz,1)); height: calc(22px * var(--hz,1)); border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: calc(13px * var(--hz,1)); cursor: move; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.room-poly.editing { fill-opacity: .18; stroke-dasharray: 4 3; }

/* ---------- pan (hand tool) cursors ---------- */
.marker-layer { cursor: grab; }
.am.placing .marker-layer, .am.drawing .marker-layer { cursor: crosshair; }
.am.editing-shape .marker-layer { cursor: default; }
.am.panning .marker-layer { cursor: grabbing; }

/* ---------- room type labels ---------- */
.room-label .rl-type { display: block; font-size: 9px; color: var(--muted); font-weight: 500; letter-spacing: .2px; }
.tw-sub { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-left: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; }
.tr-type { font-family: var(--mono); font-size: 9px; color: #fff; background: var(--accent); border-radius: 4px; padding: 0 5px; margin-left: 6px; }

/* ---------- dashboard ---------- */
.dash { padding: 24px 28px; overflow-y: auto; height: 100%; }
.dash-title { margin: 0 0 16px; font-size: 20px; color: var(--ink); }
.dash-loading { color: var(--muted); padding: 40px; }
.dash-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.dash-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.dash-num { font-size: 28px; font-weight: 800; color: var(--ink); font-family: var(--mono); line-height: 1.1; }
.dash-label { font-size: 12px; color: var(--muted); margin-top: 3px; }
.dash-hint { font-size: 10px; color: var(--faint); margin-top: 1px; }
.dash-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.dash-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.dash-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.dash-bar-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.dash-bar-label { flex: 0 0 130px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-bar-track { flex: 1; height: 9px; background: var(--line-soft); border-radius: 5px; overflow: hidden; }
.dash-bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 5px; min-width: 2px; }
.dash-bar-n { flex: 0 0 auto; font-family: var(--mono); font-size: 11px; color: var(--muted); min-width: 24px; text-align: right; }
.dash-table { margin-top: 6px; }
.dash-trow { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.dash-trow.dash-thead { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.dash-site { font-weight: 600; }
@media (max-width: 800px) { .dash-two { grid-template-columns: 1fr; } }

/* ---------- Training (LMS) iframe module ---------- */
.lms-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }

/* ---------- global search palette ---------- */
.gsearch-btn { background: none; border: 0; color: #cdd9ee; cursor: pointer; font-size: 15px; padding: 5px 9px; border-radius: 7px; line-height: 1; }
.gsearch-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.cmdk-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(8,14,24,.5); display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.cmdk-box { width: min(560px, 96vw); background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(0,0,0,.4); overflow: hidden; max-height: 72vh; display: flex; flex-direction: column; }
.cmdk-inwrap { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cmdk-input { width: 100%; border: 0; outline: none; font-size: 16px; font-family: inherit; color: var(--text); background: transparent; }
.cmdk-results { overflow-y: auto; }
.cmdk-hint { padding: 18px; color: var(--muted); font-size: 13px; }
.cmdk-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line-soft); padding: 10px 14px; }
.cmdk-item:hover { background: var(--line-soft); }
.cmdk-kind { font-family: var(--mono); font-size: 9px; letter-spacing: .5px; text-transform: uppercase; color: #fff; background: var(--accent); border-radius: 4px; padding: 2px 6px; flex: 0 0 auto; }
.cmdk-main { display: flex; flex-direction: column; min-width: 0; }
.cmdk-label { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- asset list filters ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.filter-sel { flex: 1 1 calc(50% - 6px); min-width: 0; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--text); font-size: 12px; padding: 0 6px; }
.list-count { font-family: var(--mono); font-size: 10px; letter-spacing: .5px; color: var(--muted); text-transform: uppercase; padding: 2px 16px 6px; }
.a-status { font-size: 10.5px; color: var(--muted); }

/* ---------- mobile menu button + backdrop ---------- */
.am-menu-btn { display: none; align-items: center; justify-content: center; width: 34px; height: 30px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: 15px; margin-right: 8px; flex: 0 0 auto; }
.am-backdrop { display: none; }

/* ---------- responsive (tablet / phone) ---------- */
@media (max-width: 820px) {
  #rail { width: 56px; flex: 0 0 56px; }
  .rail-label { display: none; }
  .rail-brand { font-size: 10px; padding: 8px 2px 10px; }
  #topbar { padding: 0 10px; gap: 8px; }
  #topbar .tb-title { font-size: 13px; }
  .tb-crumb { display: none; }
  .ub-name { display: none; }
  .am-left { position: absolute; left: 0; top: 0; bottom: 0; z-index: 30; width: min(86%, 320px); flex-basis: auto; transform: translateX(-100%); transition: transform .22s ease; box-shadow: 6px 0 28px rgba(0,0,0,.32); }
  .am.show-left .am-left { transform: translateX(0); }
  .am-backdrop { display: block; position: absolute; inset: 0; background: rgba(0,0,0,.4); z-index: 20; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .am.show-left .am-backdrop { opacity: 1; pointer-events: auto; }
  .am-right { width: 100%; }
  .am-menu-btn { display: inline-flex; }
  .am-toolbar { overflow-x: auto; }
  .dash { padding: 16px; }
  .dash-two { grid-template-columns: 1fr; }
}

/* dark-mode surfaces for the new bits */

/* ---------- premium chrome ---------- */
#rail {
  background: var(--ink);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink), #ffffff 9%), var(--ink) 52%, color-mix(in srgb, var(--ink), #000000 16%));
  border-right: 1px solid color-mix(in srgb, var(--ink), #000000 35%);
  box-shadow: 2px 0 16px rgba(0,0,0,.26);
}
.rail-brand {
  margin: 0 8px 8px; padding: 10px 4px 12px; letter-spacing: 1.6px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
}
.rail-brand small { color: color-mix(in srgb, var(--accent), #ffffff 22%); letter-spacing: 2px; }
.rail-item { transition: background .15s, color .15s, box-shadow .15s; }
.rail-item.active {
  color: #fff; background: var(--ink-2);
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 4%, transparent) 70%, transparent);
  border-left-color: var(--accent);
}
.rail-item.active .rail-ico { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent) 65%, transparent)); }
#topbar {
  background: var(--ink-2);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink-2), #ffffff 6%), var(--ink-2));
  border-bottom: 1px solid color-mix(in srgb, var(--ink), #000000 25%);
  box-shadow: 0 2px 14px rgba(0,0,0,.16); position: relative;
}
#topbar::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent) 18%, color-mix(in srgb, var(--accent), #ffffff 35%) 50%, var(--accent) 82%, transparent);
}

/* ---------- settings preset swatches ---------- */
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-sw { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; font-size: 12px; color: var(--text); }
.preset-sw:hover { border-color: var(--accent); }
.preset-chip { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; flex: 0 0 auto; }
.preset-dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
.preset-name { white-space: nowrap; }

/* ---------- Regulatory hub ---------- */
.reg-hub { padding: 28px; overflow-y: auto; height: 100%; }
.reg-head { margin-bottom: 20px; }
.reg-title { margin: 0; font-size: 22px; color: var(--ink); }
.reg-sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.reg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.reg-card { display: flex; gap: 14px; align-items: flex-start; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s; }
.reg-card:hover { border-color: var(--accent); box-shadow: 0 8px 24px rgba(0,0,0,.10); transform: translateY(-1px); }
.reg-ico { color: var(--accent); flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 11px; }
.reg-card-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.reg-card-title { font-weight: 700; font-size: 15px; color: var(--text); }
.reg-card-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.reg-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.reg-tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: .3px; text-transform: uppercase; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 5px; padding: 2px 6px; }
.reg-open { margin-left: auto; align-self: center; font-size: 12px; font-weight: 600; color: var(--accent); flex: 0 0 auto; }
.reg-tool { position: absolute; inset: 0; display: flex; flex-direction: column; }
.reg-bar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--panel); flex: 0 0 auto; }
.reg-back { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--text); cursor: pointer; }
.reg-back:hover { border-color: var(--accent); color: var(--accent); }
.reg-bar-title { font-size: 13px; color: var(--muted); }
.reg-frame { flex: 1 1 auto; width: 100%; border: 0; background: #fff; }

/* overdue emphasis on dashboard cards */
.dash-card.dash-bad { border-color: color-mix(in srgb, var(--danger, #d33) 50%, var(--line)); background: color-mix(in srgb, var(--danger, #d33) 7%, var(--panel)); }
.dash-card.dash-bad .dash-num { color: var(--danger, #c0392b); }

/* ===== inline top-bar search ===== */
.gsearch { position: relative; width: 300px; max-width: 38vw; }
.gsearch-input {
  width: 100%; height: 30px; box-sizing: border-box;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  color: #fff; border-radius: 8px; padding: 0 10px; font-size: 13px; outline: none;
}
.gsearch-input::placeholder { color: rgba(255,255,255,.55); }
.gsearch-input:focus { background: rgba(255,255,255,.14); border-color: var(--accent); }
.gsearch-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 80;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 14px 40px rgba(15,31,51,.22); max-height: 60vh; overflow: auto; padding: 6px;
}
.gs-item { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left;
  background: none; border: 0; border-radius: 7px; padding: 7px 9px; cursor: pointer; color: inherit; }
.gs-item:hover { background: var(--line-soft); }
.gs-kind { font-family: var(--mono); font-size: 10px; letter-spacing: .5px; text-transform: uppercase;
  color: #fff; background: var(--accent); padding: 2px 6px; border-radius: 5px; flex: 0 0 auto; }
.gs-main { display: flex; flex-direction: column; min-width: 0; }
.gs-label { font-size: 13px; font-weight: 600; color: inherit; }
.gs-sub { font-size: 11px; color: #6b7c8e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gs-empty { padding: 12px; text-align: center; color: #8090a0; font-size: 12.5px; }

/* ===== settings tabs + accounts ===== */
.set-wrap { min-width: 520px; max-width: 660px; }
.set-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.set-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; cursor: pointer; font-size: 13px; font-weight: 600; color: #6b7c8e; }
.set-tab:hover { color: inherit; }
.set-tab.on { color: var(--accent); border-bottom-color: var(--accent); }
.set-panel { min-height: 220px; }
.set-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.set-check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: inherit; opacity: .85; cursor: pointer; }
.set-check input { width: 15px; height: 15px; }
.acct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 16px; }
.acct-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; }
.acct-card.add { grid-column: 1 / -1; border-style: dashed; }
.acct-head { display: flex; align-items: baseline; gap: 8px; }
.acct-user { font-weight: 700; font-size: 13.5px; }
.acct-role { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: #fff; background: var(--ink-2, #3a4a5a); padding: 2px 7px; border-radius: 5px; }
.acct-foot { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.acct-foot .spacer { flex: 1; }
@media (max-width: 660px) { .set-wrap { min-width: 0; } .acct-grid { grid-template-columns: 1fr; } }

/* header logo + settings logo control */
.tb-logo { height: 30px; width: auto; max-width: 220px; object-fit: contain; display: block; }
#topbar .tb-title { display: inline-flex; align-items: center; }
.logo-control { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo-preview { height: 40px; max-width: 240px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.logo-btns { display: flex; gap: 8px; align-items: center; }

/* ===== Wiki module ===== */
.wiki-list { display: flex; flex-direction: column; gap: 8px; }
.wiki-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 13px 16px; cursor: pointer; }
.wiki-row:hover { border-color: var(--accent); }
.wiki-row-title { font-weight: 650; font-size: 14.5px; }
.wiki-row-meta { font-size: 12px; color: var(--muted, #6b7c8e); white-space: nowrap; }
.wiki-page { max-width: 860px; }
.wiki-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 4px; }
.wiki-title { font-size: 26px; font-weight: 800; margin: 0; }
.wiki-actions { display: flex; gap: 8px; flex-shrink: 0; }
.wiki-byline { font-size: 12.5px; color: var(--muted, #6b7c8e); margin: 4px 0 18px; }
.wiki-body { font-size: 15px; line-height: 1.65; }
.wiki-body h1 { font-size: 22px; margin: 22px 0 8px; }
.wiki-body h2 { font-size: 18px; margin: 20px 0 7px; }
.wiki-body h3 { font-size: 15.5px; margin: 16px 0 6px; }
.wiki-body p { margin: 9px 0; }
.wiki-body ul, .wiki-body ol { margin: 9px 0 9px 22px; }
.wiki-body li { margin: 3px 0; }
.wiki-body a { color: var(--accent); }
.wiki-body code { background: var(--line-soft); padding: 1px 5px; border-radius: 4px; font-family: var(--mono, monospace); font-size: 13px; }
.wiki-img { max-width: 100%; border-radius: 8px; margin: 10px 0; border: 1px solid var(--line); }
.wiki-attach { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 14px; }
.wiki-attach-h { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted, #6b7c8e); margin-bottom: 8px; }
.wiki-file { display: inline-block; margin: 0 10px 8px 0; font-size: 13.5px; color: var(--accent); text-decoration: none; }
.wiki-file:hover { text-decoration: underline; }
.wiki-editor { width: 100%; box-sizing: border-box; font-family: var(--mono, monospace); font-size: 13.5px; line-height: 1.55; resize: vertical; margin-top: 8px; }
.wiki-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wiki-hist { display: flex; flex-direction: column; gap: 10px; }
.wiki-hist-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--panel); }
.wiki-hist-meta { display: flex; align-items: center; gap: 12px; }
.wiki-hist-who { font-weight: 650; font-size: 13.5px; }
.wiki-hist-when { font-size: 12px; color: var(--muted, #6b7c8e); margin-left: auto; }
.wiki-hist-body { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.55; }

/* ===== Leadership module ===== */
.lead-wrap { max-width: 980px; }
.lead-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.lead-actions { display: flex; gap: 8px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 720px){ .grid3 { grid-template-columns: 1fr; } }

.lead-tiles { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 18px; }
@media (max-width: 720px){ .lead-tiles { grid-template-columns: 1fr 1fr; } }
.lead-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.lead-tile-v { font-size: 23px; font-weight: 800; letter-spacing: -.5px; }
.lead-tile-l { font-size: 12px; color: var(--muted, #6b7c8e); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }
.lead-tile.good .lead-tile-v { color: #1f7a4d; }
.lead-tile.bad .lead-tile-v { color: var(--accent); }

.lead-tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.lead-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lead-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted, #6b7c8e); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.lead-table td { padding: 9px 14px; border-bottom: 1px solid var(--line-soft, #eef1f5); }
.lead-table td.num, .lead-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.lead-table td.neg { color: var(--accent); }
.lead-table tr.lead-cat td { background: var(--line-soft, #f3f5f8); font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .3px; }
.lead-click tbody tr:hover, .lead-row:hover { background: var(--line-soft, #f3f5f8); cursor: pointer; }
.lead-actual { width: 100px; text-align: right; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); font-variant-numeric: tabular-nums; }

.lead-pri, .lead-stat { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; text-transform: capitalize; }
.lead-pri.p-critical { background: #fde2e2; color: #a6093d; } .lead-pri.p-high { background: #ffe9d6; color: #9a4b00; }
.lead-pri.p-medium { background: #e6eef7; color: #2b5685; } .lead-pri.p-low { background: #eceff2; color: #5a6675; }
.lead-stat.s-funded { background: #def0e3; color: #1f7a4d; } .lead-stat.s-approved { background: #def0e3; color: #1f7a4d; }
.lead-stat.s-proposed, .lead-stat.s-submitted { background: #e6eef7; color: #2b5685; } .lead-stat.s-deferred { background: #eceff2; color: #5a6675; }
.lead-pullbar { margin: 4px 0 14px; }

/* drop zone */
.lead-drop { border: 2px dashed var(--line); border-radius: 16px; padding: 46px 24px; text-align: center; background: var(--panel); transition: border-color .15s, background .15s; }
.lead-drop.over { border-color: var(--accent); background: var(--line-soft, #f3f5f8); }
.lead-drop-ico { color: var(--accent); opacity: .85; display: flex; justify-content: center; margin-bottom: 10px; }
.lead-drop-t { font-size: 17px; font-weight: 700; }
.lead-drop-s { font-size: 13px; color: var(--muted, #6b7c8e); margin: 6px 0 16px; }

/* generated documents */
.lead-doc { background: #fff; color: #1c2531; border: 1px solid var(--line); border-radius: 12px; padding: 40px 48px; max-width: 820px; margin: 0 auto; line-height: 1.6; }
.lead-doc .doc-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: #a6093d; font-weight: 700; }
.lead-doc h1 { font-size: 26px; margin: 4px 0 6px; }
.lead-doc .doc-meta { font-size: 13px; color: #5a6675; border-bottom: 2px solid #1c2531; padding-bottom: 14px; margin-bottom: 18px; }
.lead-doc h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: #2b3a4d; margin: 20px 0 4px; }
.lead-doc p { margin: 0 0 6px; font-size: 14.5px; }
.lead-doc .doc-facts { display: flex; gap: 28px; flex-wrap: wrap; background: #f3f5f8; border-radius: 10px; padding: 14px 18px; margin-bottom: 6px; }
.lead-doc .doc-facts span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #5a6675; }
.lead-doc .doc-facts b { font-size: 18px; }
.lead-doc .doc-sign { display: flex; justify-content: space-between; gap: 20px; margin-top: 34px; padding-top: 14px; border-top: 1px solid #d6dce3; font-size: 13px; color: #5a6675; flex-wrap: wrap; }

@media print {
  #rail, #topbar, .no-print, .lead-head.no-print { display: none !important; }
  #stage, #main, body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  .lead-doc { border: none; padding: 0; max-width: none; }
  .reg-hub.lead-wrap { padding: 0 !important; }
}
