/* =====================================================================
   KXPL AEC INTELLIGENCE — Design tokens
   Brand values extracted from https://www.keplerxpvtltd.com/assets/main/css/style.css
   (:root --color-light/#effffb, --color-green/#50d890, --color-blue/#4f98ca,
    --color-dark/#272727, hovers #45c080 / #4088ba). Font: site system stack.
   ===================================================================== */
:root {
  /* Official KXPL palette (from website CSS) */
  --kx-light: #effffb;
  --kx-green: #50d890;
  --kx-blue: #4f98ca;
  --kx-dark: #272727;
  --kx-green-hover: #45c080;
  --kx-blue-hover: #4088ba;
  --kx-green-deep: #3daa70;       /* site: .service-link-mobile:hover */
  --kx-hero: #06151d;             /* site: rgba(6,21,29) hero overlay */
  --kx-teal-dark: #102e32;        /* site: .projects-hero */
  --kx-teal-ink: #173c3e;         /* site: .filter-intro p */
  --kx-gradient: linear-gradient(135deg, var(--kx-green), var(--kx-blue));

  /* Semantic tokens (light — default) */
  --primary: var(--kx-green);
  --primary-hover: var(--kx-green-hover);
  --primary-ink: #1f7a4c;         /* green darkened for text contrast on white */
  --secondary: var(--kx-blue);
  --secondary-hover: var(--kx-blue-hover);
  --secondary-ink: #2f6f9a;
  --accent: var(--kx-teal-dark);
  --bg: #f5fbf9;
  --bg-brand: var(--kx-light);
  --surface: #ffffff;
  --surface-2: #f3fbf8;           /* site: .project-filters */
  --surface-3: #eaf4f1;
  --text: var(--kx-dark);
  --text-2: #4d5b5a;
  --text-3: #607875;              /* site: .filter-intro span */
  --border: #d9ece5;              /* site: .project-filters border */
  --border-strong: #cde1d9;       /* site: .filter-btn border */
  --sidebar-bg: var(--kx-dark);
  --sidebar-text: #d5e5e1;
  --sidebar-muted: #8fa5a1;
  --shadow: 0 1px 2px rgba(39,39,39,.06), 0 4px 14px rgba(39,39,39,.06);
  --shadow-lg: 0 10px 40px rgba(39,39,39,.18);

  /* Status colours */
  --ok: #2e9e63;      --ok-bg: rgba(80,216,144,.14);
  --info: #2f6f9a;    --info-bg: rgba(79,152,202,.14);
  --warn: #b7791f;    --warn-bg: #fff4dd;
  --danger: #c0392b;  --danger-bg: #fdecea;
  --neutral: #607875; --neutral-bg: #eef3f2;
  --ai: #7b4fc9;      --ai-bg: #f1ebfb;

  --radius: 10px;
  --radius-sm: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 248px;
  --header-h: 60px;
}
:root[data-theme="dark"] {
  --bg: #0d1a1d;
  --bg-brand: #0d1a1d;
  --surface: #13262a;
  --surface-2: #17302f;
  --surface-3: #1c3836;
  --text: #e6f2ef;
  --text-2: #b9d4ce;
  --text-3: #8fa5a1;
  --border: #24413f;
  --border-strong: #2f5250;
  --primary-ink: var(--kx-green);
  --secondary-ink: #7fb8de;
  --sidebar-bg: #081215;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
  --ok-bg: rgba(80,216,144,.15); --info-bg: rgba(79,152,202,.18);
  --warn-bg: rgba(183,121,31,.2); --danger-bg: rgba(192,57,43,.22);
  --neutral-bg: #1c3836; --ai-bg: rgba(123,79,201,.22);
  --warn: #f0b552; --danger: #ff7b6b; --ok: #6be3a3; --info: #7fb8de; --ai: #b79af0;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.45; }
a { color: var(--secondary-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: var(--sidebar-bg); color: var(--sidebar-text); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { padding: 16px 16px 12px; border-bottom: 1px solid rgba(239,255,251,.1); }
.brand .logo-box { background: #fff; border-radius: 8px; padding: 8px 10px; display: flex; align-items: center; justify-content: center; min-height: 52px; }
.brand .logo-box img { max-width: 100%; max-height: 76px; object-fit: contain; display: block; }
.brand .product { margin-top: 10px; font-weight: 700; font-size: 12.5px; letter-spacing: .08em; color: #fff; }
.brand .tagline { font-size: 10.5px; letter-spacing: .06em; color: var(--kx-green); text-transform: uppercase; }
.logo-placeholder { border: 2px dashed #c0392b; color: #c0392b; background: #fff7f6; border-radius: 6px; font-size: 10.5px; font-weight: 700; text-align: center; padding: 6px; line-height: 1.25; width: 100%; }
.logo-placeholder span { display: block; font-weight: 500; color: #7a2a21; }
.nav { padding: 8px 8px 16px; flex: 1; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--sidebar-muted); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--sidebar-text); font-size: 13.2px; }
.nav a:hover { background: rgba(239,255,251,.07); text-decoration: none; }
.nav a.active { background: rgba(80,216,144,.16); color: #fff; box-shadow: inset 3px 0 0 var(--kx-green); }
.nav a .num { font-size: 10px; color: var(--sidebar-muted); width: 16px; text-align: right; }
.nav svg { width: 16px; height: 16px; flex: none; opacity: .9; }
.sidebar-foot { padding: 12px 16px; font-size: 11px; color: var(--sidebar-muted); border-top: 1px solid rgba(239,255,251,.1); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--header-h); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 0 18px; position: sticky; top: 0; z-index: 20; }
.topbar .page-logo { height: 30px; display: none; }
.topbar .page-logo img { height: 30px; }
.topbar select, .topbar input { height: 34px; }
.search-wrap { position: relative; flex: 1; max-width: 460px; }
.search-wrap input { width: 100%; padding-left: 32px; }
.search-wrap svg { position: absolute; left: 9px; top: 9px; width: 16px; height: 16px; color: var(--text-3); }
.search-results { position: absolute; top: 40px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); max-height: 420px; overflow: auto; z-index: 50; }
.search-results .sr { padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.search-results .sr:hover { background: var(--surface-2); }
.search-results .sr .t { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.topbar .spacer { flex: 1; }
.icon-btn { position: relative; width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 1px solid var(--border); border-radius: 20px; cursor: pointer; background: var(--surface); }
.user-chip .av { width: 28px; height: 28px; border-radius: 50%; background: var(--kx-gradient); color: #fff; font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.user-chip .role { font-size: 11px; color: var(--text-3); }
.popover { position: absolute; right: 18px; top: 56px; width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 60; max-height: 70vh; overflow: auto; }
.popover .ph { padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 650; display: flex; justify-content: space-between; align-items: center; }

.content { padding: 20px 22px 40px; max-width: 1600px; width: 100%; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .titles { flex: 1; min-width: 260px; }
.page-head .sub { color: var(--text-3); margin-top: 3px; font-size: 13px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-banner { background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(183,121,31,.3); border-radius: 8px; padding: 6px 12px; font-size: 12px; margin-bottom: 14px; display: flex; gap: 8px; align-items: center; }
.demo-banner b { font-weight: 700; }

/* ---------- Components ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-h { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.card-h h3 { flex: 1; }
.card-b { padding: 14px 16px; }
.card-b.flush { padding: 0; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
@media (max-width: 1200px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g-2-1 { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .app { grid-template-columns: 1fr; } .sidebar { position: fixed; left: -260px; width: 248px; z-index: 80; transition: left .2s; } .app.nav-open .sidebar { left: 0; } .g2,.g3,.g4 { grid-template-columns: 1fr; } .menu-btn { display: inline-flex !important; } .topbar .user-chip .meta { display: none; } }
@media (min-width: 861px) { .menu-btn { display: none !important; } }
.mb { margin-bottom: 14px; }
.mt { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.kpi { padding: 14px 16px; cursor: pointer; position: relative; overflow: hidden; transition: transform .12s, box-shadow .12s; }
.kpi:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(39,39,39,.1); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--kx-gradient); }
.kpi .lbl { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.kpi .val { font-size: 24px; font-weight: 700; margin-top: 4px; letter-spacing: -.02em; }
.kpi .foot { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--kx-gradient); color: #fff; border: 0; }
.btn-primary:hover { background: linear-gradient(135deg, var(--kx-green-hover), var(--kx-blue-hover)); box-shadow: 0 4px 14px rgba(80,216,144,.4); }
.btn-dark { background: var(--kx-dark); color: var(--kx-light); border-color: var(--kx-dark); }
.btn-dark:hover { background: #3a3a3a; color: var(--kx-light); border-color: #3a3a3a; }
.btn-danger { color: var(--danger); border-color: rgba(192,57,43,.4); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-link { background: none; border: 0; color: var(--secondary-ink); cursor: pointer; font: inherit; padding: 0; }

input, select, textarea { font: inherit; font-size: 13px; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 7px; padding: 6px 9px; min-height: 32px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(80,216,144,.45); border-color: var(--kx-green); }
textarea { width: 100%; min-height: 70px; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); font-weight: 600; }
label.f input, label.f select, label.f textarea { font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.form-grid .span2 { grid-column: span 2; } .form-grid .span3 { grid-column: 1 / -1; }
@media (max-width: 860px) { .form-grid { grid-template-columns: 1fr; } .form-grid .span2 { grid-column: auto; } }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 9px 14px; font: inherit; font-size: 13px; font-weight: 600; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--text); border-bottom-color: var(--kx-green); }

/* Tables */
.tbl-tools { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tbl-tools input[type=search] { width: 220px; }
.tbl-wrap { overflow: auto; max-height: 68vh; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.8px; }
table.t th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--text-2); font-weight: 650; text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; cursor: pointer; user-select: none; }
table.t th.num, table.t td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.t tbody tr:hover td { background: var(--surface-2); }
table.t tr.clickable { cursor: pointer; }
table.t tfoot td { position: sticky; bottom: 0; background: var(--surface-3); font-weight: 700; border-top: 1px solid var(--border-strong); }
table.t tr.group td { background: var(--surface-3); font-weight: 700; }
table.t tr.deduct td { color: var(--danger); }
table.t input, table.t select { min-height: 26px; padding: 3px 6px; font-size: 12.5px; width: 100%; }
table.t input.n { text-align: right; width: 76px; }
.tbl-empty { padding: 30px; text-align: center; color: var(--text-3); }
.pager { display: flex; gap: 8px; align-items: center; padding: 8px 12px; font-size: 12px; color: var(--text-3); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 650; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral); }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-danger { background: var(--danger-bg); color: var(--danger); }
.b-ai { background: var(--ai-bg); color: var(--ai); }
.b-demo { background: var(--warn-bg); color: var(--warn); border: 1px dashed currentColor; }

.alert { border-radius: 8px; padding: 10px 12px; font-size: 13px; display: flex; gap: 10px; align-items: flex-start; border: 1px solid transparent; }
.alert.warn { background: var(--warn-bg); color: #7a5414; border-color: rgba(183,121,31,.25); }
.alert.danger { background: var(--danger-bg); color: #8e2a20; border-color: rgba(192,57,43,.25); }
.alert.info { background: var(--info-bg); color: #24577a; border-color: rgba(79,152,202,.25); }
.alert.ok { background: var(--ok-bg); color: #1f6e45; }
:root[data-theme="dark"] .alert.warn { color: var(--warn); } :root[data-theme="dark"] .alert.danger { color: var(--danger); } :root[data-theme="dark"] .alert.info { color: var(--info); } :root[data-theme="dark"] .alert.ok { color: var(--ok); }
.backend-note { border: 1px dashed var(--secondary); background: var(--info-bg); color: var(--secondary-ink); border-radius: 8px; padding: 10px 12px; font-size: 12.5px; }
.backend-note b { color: var(--text); }

.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 320px; }
.list { display: flex; flex-direction: column; }
.list .li { padding: 9px 14px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-start; }
.list .li:last-child { border-bottom: 0; }
.health { display: flex; align-items: center; gap: 12px; }
.health .ring { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.bar { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--kx-gradient); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; }
.steps { display: flex; gap: 0; align-items: center; flex-wrap: wrap; font-size: 11.5px; }
.steps span { padding: 3px 9px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-3); }
.steps span:first-child { border-radius: 10px 0 0 10px; } .steps span:last-child { border-radius: 0 10px 10px 0; }
.steps span.on { background: var(--ok-bg); color: var(--ok); border-color: rgba(46,158,99,.35); font-weight: 700; }

/* Modal & toast */
.modal-bg { position: fixed; inset: 0; background: rgba(6,21,29,.55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow: auto; }
.modal { background: var(--surface); border-radius: 12px; width: min(860px, 100%); box-shadow: var(--shadow-lg); }
.modal.wide { width: min(1200px, 100%); }
.modal-h { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-h h2 { flex: 1; }
.modal-b { padding: 16px 18px; max-height: 72vh; overflow: auto; }
.modal-f { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.toasts { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--kx-dark); color: var(--kx-light); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 13px; max-width: 420px; border-left: 4px solid var(--kx-green); }
.toast.err { border-left-color: #ff7b6b; }

/* Assistant */
.chat { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 420px; }
.chat-log { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; }
.msg.user { align-self: flex-end; background: var(--kx-dark); color: var(--kx-light); border-bottom-right-radius: 3px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 3px; width: 92%; }
.msg.bot .meta { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border-strong); font-size: 12px; color: var(--text-2); display: grid; gap: 4px; }
.msg.bot table.t { margin-top: 8px; background: var(--surface); }
.chat-in { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.chat-in input { flex: 1; height: 38px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border-strong); background: var(--surface); border-radius: 14px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--text-2); }
.chip:hover { border-color: var(--kx-green); color: var(--text); }

.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--text-3); background: var(--surface-2); cursor: pointer; }
.dropzone.over { border-color: var(--kx-green); background: var(--ok-bg); }
canvas.diff { max-width: 100%; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.tree { font-size: 13px; }
.tree ul { list-style: none; padding-left: 18px; margin: 4px 0; }
.tree > ul { padding-left: 0; }
.tree li { padding: 2px 0; }
.empty-state { padding: 40px; text-align: center; color: var(--text-3); }
.formula { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 2px 6px; border-radius: 4px; }
@media print { .sidebar, .topbar, .page-head .actions, .tbl-tools { display: none !important; } .app { display: block; } }

/* =====================================================================
   V2 additions — collapsible navigation groups, Gantt, viewer, mobile, misc.
   Same KXPL tokens as V1; nothing above this line was changed.
   ===================================================================== */
.nav-sec .nav-group { display: flex; align-items: center; gap: 6px; width: 100%; background: none; border: 0; cursor: pointer; text-align: left; font: inherit; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--sidebar-muted); padding: 12px 10px 5px; }
.nav-sec .nav-group:hover { color: #fff; }
.nav-sec .gi { font-size: 9.5px; width: 16px; height: 16px; border-radius: 4px; background: rgba(239,255,251,.08); display: inline-flex; align-items: center; justify-content: center; letter-spacing: 0; }
.nav-sec .car { margin-left: auto; transition: transform .15s; }
.nav-sec.collapsed .car { transform: rotate(-90deg); }
.nav-sec.collapsed .nav-items { display: none; }
.nav a .num.new { width: auto; font-size: 9px; padding: 0 5px; border-radius: 6px; background: rgba(80,216,144,.18); color: var(--kx-green); }
.sync-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 15px; border: 1px solid var(--border); background: var(--surface); font-size: 12px; cursor: pointer; color: var(--text-2); }
.sync-pill svg { width: 14px; height: 14px; }
.sync-pill.pending { border-color: var(--warn); color: var(--warn); }
.sync-pill.offline { border-color: var(--danger); color: var(--danger); }
/* Gantt */
.gantt { position: relative; overflow: auto; max-height: 70vh; border-top: 1px solid var(--border); }
.gantt table { border-collapse: separate; border-spacing: 0; font-size: 12px; }
.gantt th, .gantt td { border-bottom: 1px solid var(--border); padding: 0 8px; height: 28px; white-space: nowrap; background: var(--surface); }
.gantt th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); font-weight: 650; color: var(--text-2); }
.gantt td.lbl, .gantt th.lbl { position: sticky; left: 0; z-index: 2; max-width: 320px; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--border-strong); }
.gantt th.lbl { z-index: 4; }
.gantt td.tl { padding: 0; position: relative; }
.gantt .scale { display: flex; } .gantt .scale span { flex: none; border-left: 1px solid var(--border); font-size: 10.5px; padding-left: 3px; color: var(--text-3); overflow: hidden; }
.gbar { position: absolute; top: 8px; height: 12px; border-radius: 3px; background: var(--kx-blue); cursor: grab; }
.gbar.crit { background: var(--danger); }
.gbar.done { background: var(--ok); }
.gbar i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(0,0,0,.28); border-radius: 3px 0 0 3px; }
.gbase { position: absolute; top: 21px; height: 4px; border-radius: 2px; background: var(--text-3); opacity: .55; }
.gms { position: absolute; top: 7px; width: 13px; height: 13px; transform: rotate(45deg); background: var(--ai); }
.gtoday { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--kx-green); z-index: 1; pointer-events: none; }
.gantt tr.sum td { font-weight: 700; background: var(--surface-3); }
.gsum { position: absolute; top: 10px; height: 8px; background: var(--kx-dark); border-radius: 1px; }
:root[data-theme="dark"] .gsum { background: var(--kx-light); }
/* Heat cells for resource / allocation matrices */
.heat td.c { text-align: center; font-size: 11.5px; min-width: 54px; }
.heat .s-ok { background: var(--ok-bg); } .heat .s-warn { background: var(--warn-bg); } .heat .s-bad { background: var(--danger-bg); } .heat .s-info { background: var(--info-bg); }
/* Drawing viewer */
.viewer { display: grid; grid-template-columns: 280px 1fr; gap: 14px; }
.viewer.cmp .stage-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stage { position: relative; overflow: hidden; background: #f4f6f6; border: 1px solid var(--border); border-radius: 8px; height: 68vh; cursor: grab; touch-action: none; }
.stage canvas.pg, .stage img.pg, .stage svg.pg { position: absolute; left: 0; top: 0; transform-origin: 0 0; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.stage svg.mk { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.stage .wm { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background: rgba(192,57,43,.9); color: #fff; font-weight: 700; padding: 3px 12px; border-radius: 4px; z-index: 5; font-size: 12px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.thumb { border: 1px solid var(--border); border-radius: 8px; padding: 6px; cursor: pointer; background: var(--surface); font-size: 11.5px; }
.thumb:hover { border-color: var(--kx-green); }
.thumb .ti { height: 100px; background: var(--surface-2); border-radius: 5px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--text-3); font-weight: 700; }
.thumb .ti img { max-width: 100%; max-height: 100%; }
.thumb.sup { opacity: .6; } .thumb.sup .ti { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 8px, var(--surface-3) 8px, var(--surface-3) 16px); }
.dlist { max-height: 68vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.dlist .di { padding: 7px 10px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 12.5px; }
.dlist .di.on { background: var(--ok-bg); }
.toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.toolbar .btn.on { background: var(--ok-bg); border-color: var(--kx-green); }
/* Money trail */
.trail { display: flex; flex-direction: column; gap: 0; }
.trail .st { display: grid; grid-template-columns: 34px 1fr; gap: 10px; }
.trail .dot { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; margin: 0 auto; }
.trail .st.on .dot { background: var(--kx-gradient); border-color: transparent; color: #fff; }
.trail .ln { width: 2px; background: var(--border-strong); margin: 0 auto; min-height: 16px; height: 100%; }
.trail .bx { padding: 4px 0 14px; }
.trail .bx .h { font-weight: 700; font-size: 13px; }
/* Mobile-first site app */
.m-shell { max-width: 520px; margin: 0 auto; }
.m-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--border-strong); background: var(--surface); font: inherit; font-size: 17px; font-weight: 650; color: var(--text); cursor: pointer; margin-bottom: 10px; text-align: left; }
.m-btn svg { width: 26px; height: 26px; color: var(--primary-ink); }
.m-btn.primary { background: var(--kx-gradient); color: #fff; border: 0; } .m-btn.primary svg { color: #fff; }
.m-shell input, .m-shell select, .m-shell textarea { font-size: 16px; min-height: 44px; width: 100%; }
.m-shell label.f { font-size: 14px; }
.m-shell .form-grid { grid-template-columns: 1fr; }
.lang-sw button { border: 1px solid var(--border-strong); background: var(--surface); padding: 4px 10px; border-radius: 12px; cursor: pointer; font: inherit; font-size: 13px; }
.lang-sw button.on { background: var(--ok-bg); border-color: var(--kx-green); }
.recap td.num { font-variant-numeric: tabular-nums; }
.recap tr.tot td { font-weight: 800; background: var(--surface-3); }
.recap tr.sub td { font-weight: 700; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 8px; font-size: 11px; background: var(--surface-3); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .viewer { grid-template-columns: 1fr; } .split { grid-template-columns: 1fr; } .viewer.cmp .stage-wrap { grid-template-columns: 1fr; } }
.gantt .grw { border-bottom: 1px solid var(--border); }
.gantt .glb { position: sticky; left: 0; z-index: 2; background: var(--surface); border-right: 1px solid var(--border-strong); padding: 0 8px; line-height: 28px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; flex: none; }
.gantt .gh .glb, .gantt .gh .scale { background: var(--surface-2); font-weight: 650; line-height: 28px; }
.gantt .gh .glb { z-index: 5; }
.gantt .gtl { flex: none; background-image: linear-gradient(to right, var(--border) 1px, transparent 1px); background-size: 35px 100%; }
.gantt .garr { color: var(--text-3); z-index: 1; }
.clickable { cursor: pointer; }
.stage { user-select: none; -webkit-user-select: none; }
.stage svg.mk { pointer-events: none; }

/* ---------- V2 Phase 3: vendors & value engineering ---------- */
.chip.on { background: rgba(80,216,144,.18); border-color: var(--kx-green); color: var(--text); }
.chip input { display: none; }
.row.wrap { flex-wrap: wrap; }
.muted-row td { color: var(--text-2); background: var(--surface-2); }
.cmp-t th { text-align: left; vertical-align: top; }
.cmp-t td { vertical-align: top; }
.cmp-t td.best { background: rgba(80,216,144,.14); box-shadow: inset 3px 0 0 var(--kx-green); }
.ve-t label.f { margin-bottom: 6px; }
.ve-t .needs { border: 1px dashed var(--border-strong); border-radius: 8px; padding: 6px; }
.map-note { position: absolute; z-index: 500; left: 8px; bottom: 8px; background: var(--surface); border: 1px solid var(--border); padding: 4px 8px; border-radius: 6px; }
[data-map] { position: relative; background: var(--surface-2); }
.leaflet-container { font: inherit; }
.int-ok { color: var(--ok); } .int-fail { color: var(--danger); }

/* ---------- V2 Phase 4: contracts & billing ---------- */
.flow-strip { display: flex; gap: 4px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.flow-strip span:not(.badge) { padding: 4px 12px; border-radius: 14px; font-size: 12px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.flow-strip span.done { background: rgba(80,216,144,.15); color: var(--text); border-color: rgba(80,216,144,.5); }
.flow-strip span.on { background: var(--kx-dark); color: var(--kx-light); border-color: var(--kx-dark); }
tr.err-row td { background: rgba(192,57,43,.08); }
tr.tot th, tr.tot td { border-top: 2px solid var(--border-strong); }

/* ---------- V2 Phase 5: site operations & mobile ---------- */
.m-app { max-width: 560px; margin: 0 auto; }
.m-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.m-head h2 { margin: 2px 0; }
.m-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.m-tiles .m-btn { flex-direction: column; justify-content: center; text-align: center; min-height: 96px; margin: 0; }
.m-ic { font-size: 28px; line-height: 1; }
.m-task { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 8px; background: var(--surface); }
.m-task.due { border-left: 4px solid var(--warn); } .m-task.ok { border-left: 4px solid var(--kx-green); }
.m-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 6px; }
.m-row select, .m-row input { min-height: 38px; }
.m-row input.n { width: 80px; }
.lang-pick { min-height: 34px; border-radius: 8px; }
.voice { margin-top: 6px; }
@media (max-width: 640px) {
  .modal-bg { padding: 0; }
  .modal-bg .modal { width: 100vw !important; max-width: 100vw !important; height: 100vh; max-height: 100vh; border-radius: 0; }
  .m-row select, .m-row input, .m-row .m-lbl { flex: 1 1 45%; font-size: 16px; }
  .m-tiles .m-btn { min-height: 84px; font-size: 15px; }
  /* V1 top bar on phones: project picker shrinks, search collapses to its icon width, theme toggle hidden */
  .topbar { gap: 6px; padding: 0 8px; }
  .topbar #project-select { min-width: 0; flex: 1 1 auto; max-width: 52vw; }
  .topbar .search-wrap { flex: 0 0 36px; max-width: 36px; }
  .topbar .search-wrap:focus-within { position: absolute; left: 8px; right: 8px; max-width: none; z-index: 30; }
  .topbar .spacer, .topbar #theme-btn { display: none; }
  .content { padding-left: 12px; padding-right: 12px; }
  .m-head { flex-wrap: wrap; gap: 8px; }
}

.m-lbl { display: inline-flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--text-2); }
.m-lbl input { width: 100%; }
.neg { color: #c0392b; } .pos { color: #1e8e5a; }

/* V2.2 */
.kx-score { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.kx-score-bar { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: rgba(127,127,127,.2); overflow: hidden; }
.kx-score-bar i { display: block; height: 100%; border-radius: 3px; }
.gap { gap: 8px; flex-wrap: wrap; }
.row.gap { display: flex; align-items: center; }
.kx-role-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.kx-src { font-size: 12px; opacity: .8; border-left: 3px solid var(--line, #ccc); padding-left: 8px; margin-top: 6px; }
.chart-box.chart-empty { height: auto; min-height: 90px; display: flex; align-items: center; justify-content: center; }
/* V2.2 screens: cards built without card-h / card-b get the standard inner padding; wide tables scroll inside the card */
#view[data-v22] .card:not(.kpi):not(:has(> .card-h)):not(:has(> .card-b)) { padding: 14px 16px; }
#view[data-v22] .card { min-width: 0; overflow-x: auto; }

/* ---------- V2.3 KXPL CDE ---------- */
.cde-docs { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
.cde-tree { max-height: 70vh; overflow: auto; }
.cde-fold { display: block; padding: 5px 8px; border-radius: 6px; cursor: pointer; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.cde-fold:hover { background: var(--surface-2); }
.cde-fold.on { background: var(--ok-bg); font-weight: 600; box-shadow: inset 3px 0 0 #50D890; }
.cde-drop { border: 2px dashed var(--border-strong); text-align: center; color: var(--text-3); }
.cde-drop.over { border-color: #50D890; background: var(--ok-bg); }
.cde-pv { position: relative; display: inline-block; max-width: 100%; }
.cde-pin { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #4F98CA; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); pointer-events: auto; }
.cde-more { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 0; border-top: 1px solid var(--border); margin-top: 10px; }
.cde-more.hidden { display: none; }
.bimv { display: flex; flex-direction: column; gap: 10px; }
.bimv-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bimv-tools label { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; }
.bimv-body { display: grid; grid-template-columns: 260px minmax(0, 1fr) 300px; gap: 10px; align-items: start; }
.bimv-canvas { position: relative; height: 560px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: #EFFFFB; }
.bimv-canvas canvas { display: block; width: 100% !important; height: 100% !important; }
.bimv-canvas:fullscreen { height: 100vh; border-radius: 0; }
.bimv-msg { position: absolute; left: 10px; top: 10px; right: 10px; background: rgba(255,255,255,.92); color: #272727; padding: 6px 10px; border-radius: 6px; font-size: 12px; pointer-events: none; }
.bimv-msg:empty { display: none; }
.bimv-tree, .bimv-props { max-height: 560px; overflow: auto; font-size: 12px; overflow-wrap: anywhere; }
.bimv-el { display: block; padding: 2px 6px; border-radius: 4px; cursor: pointer; }
.bimv-el:hover { background: var(--surface-2); }
.bimv-el.on { background: #50D890; color: #272727; font-weight: 600; }
.bimv-tr { padding-left: 10px; }
.bimv-status { min-height: 18px; }
@media (max-width: 1200px) { .bimv-body { grid-template-columns: 220px minmax(0, 1fr); } .bimv-props { grid-column: 1 / -1; max-height: none; } }
@media (max-width: 860px) { .cde-docs, .bimv-body { grid-template-columns: 1fr; } .bimv-canvas { height: 420px; } .bimv-tree { max-height: 260px; } .cde-tree { max-height: 240px; } }
.cde-docs > *, .bimv-body > * { min-width: 0; }
@media (max-width: 860px) { .cde-docs, .bimv-body { grid-template-columns: minmax(0, 1fr); } .cde-fold { white-space: normal; } }

/* ---------- Hosted mode: sign-in gate (js/core/hosted.js) ---------- */
#kx-gate { position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(160deg, #effffb 0%, #e3f1fa 100%); overflow: auto; }
[data-theme="dark"] #kx-gate { background: linear-gradient(160deg, #0f1a1c 0%, #102e32 100%); }
.kx-gate-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 40px rgba(16,46,50,.15); padding: 28px 26px 18px; text-align: center; }
.kx-gate-card form, .kx-gate-card .f { text-align: left; }
.kx-gate-card .f input { width: 100%; }
.kx-gate-logo { max-width: 180px; max-height: 110px; margin: 0 auto 10px; display: block; }
.kx-gate-title { font-weight: 700; letter-spacing: .06em; font-size: 15px; margin-bottom: 4px; }
.kx-gate-sub { color: var(--text-2); font-size: 13px; margin: 6px 0 14px; line-height: 1.5; }
.kx-gate-btn { width: 100%; justify-content: center; margin-top: 6px; padding: 10px; }
.kx-gate-msg { min-height: 18px; font-size: 12.5px; margin: 4px 0; }
.kx-gate-msg.err { color: var(--danger, #c0392b); }
.kx-gate-msg.ok { color: var(--text-3); }
.kx-gate-foot { margin-top: 18px; font-size: 11px; color: var(--text-3); }
.kx-gate-rel { margin-top: 6px; font-size: 11px; color: var(--text-3); letter-spacing: .02em; text-align: center; } /* V2.31 Batch 16 item 1 */
.kx-gate-spin { width: 28px; height: 28px; margin: 8px auto; border: 3px solid var(--border); border-top-color: var(--kx-green, #50d890); border-radius: 50%; animation: kxspin 0.9s linear infinite; }
@keyframes kxspin { to { transform: rotate(360deg); } }
.stage svg.cad * { vector-effect: non-scaling-stroke; }

/* V2.6 sidebar: module search, group / ungroup, a subtle colour per main module */
.nav-tools { display: flex; gap: 6px; padding: 0 12px 8px; }
.nav-tools input { flex: 1; min-width: 0; height: 30px; font-size: 12.5px; background: rgba(239,255,251,.07); border: 1px solid rgba(239,255,251,.12); color: var(--sidebar-text); border-radius: 7px; padding: 0 9px; }
.nav-tools input::placeholder { color: var(--sidebar-muted); }
.nav-tg { width: 30px; height: 30px; border-radius: 7px; border: 1px solid rgba(239,255,251,.12); background: rgba(239,255,251,.07); color: var(--sidebar-text); cursor: pointer; font-size: 14px; }
.nav-tg.on { background: rgba(80,216,144,.2); color: #fff; }
.nav-sec .gi { background: color-mix(in srgb, var(--gc, #50d890) 30%, transparent); color: #fff; }
.nav-sec .nav-items a svg { color: var(--gc, currentColor); }
.nav-sec .nav-items a { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--gc, transparent) 45%, transparent); }
.nav-sec .nav-items a.active { box-shadow: inset 3px 0 0 var(--gc, var(--kx-green)); }
.nav.flat .nav-group { display: none; }
.nav.flat .nav-sec.collapsed .nav-items { display: block; }
.nav a .grp { font-size: 9.5px; color: var(--sidebar-muted); margin-left: auto; }
.nav mark { background: rgba(80,216,144,.35); color: inherit; border-radius: 2px; }
.nav .nav-empty { padding: 10px 14px; font-size: 12px; color: var(--sidebar-muted); }
.sr-filters { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.sr-filters button { font-size: 11px; border: 1px solid var(--border); background: transparent; border-radius: 12px; padding: 2px 8px; cursor: pointer; color: inherit; }
.sr-filters button.on { background: var(--kx-green); border-color: var(--kx-green); color: #102e32; }
.t th .sort-hint { opacity: .35; font-size: .9em; }
.t th[data-s] { cursor: pointer; }
/* V2.6 organisation chart */
.org ul { list-style: none; margin: 0; padding-left: 26px; border-left: 1px dashed var(--border); }
.org > ul { padding-left: 0; border-left: 0; }
.org li { margin: 6px 0; position: relative; }
.org-card { display: inline-flex; gap: 10px; align-items: center; padding: 7px 12px 7px 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; min-width: 240px; }
.org-card:hover { border-color: var(--kx-green); }
.org-tg { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); background: transparent; cursor: pointer; color: inherit; font-weight: 700; }

/* V2.6 PM: active-task badge and dashboard Gantt */
.act-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; border: 0; background: #e0a93c; color: #272727; font: 700 11px/1 inherit; cursor: pointer; vertical-align: middle; animation: kxpulse 2s infinite; }
.act-badge:hover { background: #f0b94c; }
@keyframes kxpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(224,169,60,.5); } 50% { box-shadow: 0 0 0 4px rgba(224,169,60,0); } }
.gantt { font-size: 12px; }
.g-row { display: grid; grid-template-columns: 260px 1fr 120px 80px; gap: 8px; align-items: center; border-bottom: 1px solid var(--border); padding: 6px 0; }
.g-head { position: sticky; top: 0; background: var(--surface); z-index: 2; }
.g-lbl a { color: var(--text); text-decoration: none; }
.g-lbl a:hover { text-decoration: underline; }
.g-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.g-track { position: relative; height: 30px; background: repeating-linear-gradient(90deg, transparent 0 59px, var(--border) 59px 60px); border-radius: 4px; }
.g-head .g-track { background: none; }
.g-mon { position: absolute; top: 8px; font-size: 11px; color: var(--text-3); white-space: nowrap; transform: translateX(2px); border-left: 1px solid var(--border); padding-left: 3px; }
.g-today { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #d64545; z-index: 1; pointer-events: none; }
.g-today span { position: absolute; top: -14px; left: -14px; font-size: 10px; color: #d64545; font-weight: 700; }
.g-bar { position: absolute; top: 7px; height: 16px; border: 1.5px solid; border-radius: 4px; overflow: hidden; }
.g-fill { height: 100%; opacity: .75; }
.g-plan { position: absolute; top: -2px; bottom: -2px; width: 2px; background: #272727; }
.g-ms { position: absolute; top: 9px; width: 12px; height: 12px; transform: translateX(-6px) rotate(45deg); border: 1px solid #fff; padding: 0; cursor: pointer; z-index: 2; }
.g-num { text-align: right; }
/* V2.6 notifications */
.n-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--kx-green, #50d890); margin-right: 6px; vertical-align: middle; }
.popover .li.unread { background: rgba(80,216,144,.08); }
/* V2.7 popup maximise / restore */
.modal-f .modal-max { margin-left: 4px; width: 32px; height: 32px; flex: none; }
.modal-bg.maxed { padding: 0; }
.modal-bg.maxed .modal { width: 100vw; max-width: none; min-height: 100vh; border-radius: 0; display: flex; flex-direction: column; }
.modal-bg.maxed .modal-b { max-height: none; flex: 1; }
/* V2.7 sidebar numbering (1.1, 1.2 …) and the main module holding the open page */
.nav a .sn { font-size: 10px; min-width: 26px; color: var(--sidebar-muted); font-variant-numeric: tabular-nums; flex: none; }
.nav a.active .sn { color: inherit; }
.nav-sec.collapsed.has-active > .nav-group { color: #fff; box-shadow: inset 3px 0 0 var(--gc, #50d890); }
.page-head .crumb { font-size: 11.5px; color: var(--text-3); margin-bottom: 2px; letter-spacing: .01em; }
/* V2.7 profile picture crop */
.crop-box { position: relative; border-radius: 8px; overflow: hidden; background: #ddd; touch-action: none; flex: none; }
.crop-box canvas { display: block; cursor: grab; }
.crop-mask { position: absolute; inset: 0; pointer-events: none; }
.crop-mask.circle { box-shadow: 0 0 0 999px rgba(0,0,0,.45); border-radius: 50%; }
.crop-mask.square { box-shadow: inset 0 0 0 2px rgba(255,255,255,.8); }
/* V2.7 compact role permission matrix */
.rm-tools { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.rm-wrap { max-height: 58vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.modal-bg.maxed .rm-wrap { max-height: calc(100vh - 260px); }
table.rm { font-size: 12px; }
table.rm th, table.rm td { padding: 3px 8px; }
table.rm th { position: sticky; top: 0; background: var(--surface); z-index: 1; font-size: 11px; }
table.rm .c { text-align: center; width: 64px; }
table.rm tr.rm-g td { background: color-mix(in srgb, var(--kx-green, #50d890) 7%, var(--surface)); }
table.rm tr.rm-m td:first-child { padding-left: 30px; }
.rm-tg { border: 0; background: none; cursor: pointer; width: 18px; color: var(--text-3); padding: 0; }
#view > .crumb { font-size: 11.5px; color: var(--text-3); margin-bottom: 6px; }

/* V2.7 Module 7 step strip */
.e7-strip{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px}
.e7-step{display:block;padding:8px 10px;border:1px solid var(--border);border-radius:8px;background:var(--card,#fff);color:inherit;text-decoration:none;font-size:12.5px;line-height:1.5}
.e7-step.on{border-color:var(--primary,#0b6b5c);box-shadow:inset 0 -3px 0 var(--primary,#0b6b5c)}
.e7-step.off{opacity:.6}
@media (max-width:900px){.e7-strip{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:520px){.e7-strip{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* V2.8 searchable dropdown (shared; every single-choice select) */
.kxs-pop { position: fixed; z-index: 3000; background: var(--surface); border: 1px solid var(--border-strong, var(--border)); border-radius: 8px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; min-width: 200px; }
.kxs-pop .kxs-q { margin: 6px; width: auto; height: 32px; }
.kxs-list { overflow: auto; flex: 1; padding-bottom: 4px; }
.kxs-o { padding: 6px 10px; cursor: pointer; font-size: 13px; line-height: 1.35; white-space: normal; }
.kxs-o.hi { background: color-mix(in srgb, var(--kx-green) 18%, var(--surface)); }
.kxs-o.sel { font-weight: 650; }
.kxs-o.dis { opacity: .45; cursor: default; }
.kxs-o mark { background: rgba(80,216,144,.45); color: inherit; padding: 0; border-radius: 2px; }
.kxs-g { padding: 6px 10px 2px; font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; }
.kxs-none { padding: 10px; color: var(--text-3); font-size: 13px; }
/* V2.8 show / hide password */
.kx-pw { position: relative; display: block; width: 100%; }
.kx-pw > input { width: 100%; padding-right: 38px !important; }
.kx-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 30px; height: 30px; border: 0; background: transparent; color: var(--text-3); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; padding: 0; }
.kx-eye:hover, .kx-eye:focus-visible { color: var(--text); background: color-mix(in srgb, var(--kx-green) 14%, transparent); }
.kx-eye svg { width: 18px; height: 18px; }
/* V2.8 logo opens Home */
[data-logo] { cursor: pointer; }
/* V2.8 upload widget: proportionate icon */
.dropzone > svg, .cde-drop > svg { width: 28px; height: 28px; display: block; margin: 0 auto 6px; }
/* V2.8 searchable multi-select */
.kxm { position: relative; }
.kxm-box { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; min-height: 36px; padding: 3px 6px; border: 1px solid var(--border-strong, var(--border)); border-radius: 8px; background: var(--surface); cursor: text; }
.kxm-chips { display: contents; }
.kxm-chip { display: inline-flex; align-items: center; gap: 4px; background: color-mix(in srgb, var(--kx-green) 18%, var(--surface)); border-radius: 12px; padding: 1px 4px 1px 9px; font-size: 12px; }
.kxm-chip button { border: 0; background: none; cursor: pointer; font-size: 14px; line-height: 1; color: var(--text-3); padding: 0 3px; }
.kxm-q { border: 0 !important; outline: none; flex: 1; min-width: 120px; height: 28px; background: transparent; box-shadow: none !important; }
.kxm-list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 2px; z-index: 50; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); max-height: 240px; overflow: auto; padding: 4px 0; }
.kxm-o { display: flex !important; gap: 8px; align-items: center; padding: 5px 10px; font-size: 13px; cursor: pointer; font-weight: 400 !important; }
.kxm-o:hover { background: var(--surface-2); }
.kxm-o input { width: auto !important; height: auto !important; }
.kxm-none { padding: 8px 10px; color: var(--text-3); font-size: 13px; }
/* V2.8 CDE folder tree expand / collapse */
.cde-tg { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; border: 0; background: none; cursor: pointer; color: var(--text-3); padding: 0; margin-right: 2px; font-size: 11px; flex: none; }
.cde-tg.sp { cursor: default; }
.cde-tg:hover { color: var(--text); }
/* V2.8 PM dashboard: readable dates, View button, responsive rows */
.g-row { grid-template-columns: minmax(200px, 280px) minmax(360px, 1fr) 120px 80px; }
.g-lbl { min-width: 0; }
.g-lbl a { display: block; overflow-wrap: anywhere; }
.g-dates { display: flex; flex-wrap: wrap; gap: 0 6px; line-height: 1.35; }
.g-view { margin-top: 3px; padding: 1px 8px; font-size: 11.5px; }
.g-head .g-mon { top: 0; }
.g-head .g-today > span { top: 15px; left: 3px; background: var(--surface); padding: 0 2px; }
/* V2.8 role matrix: fixed module column, even action columns, zebra rows, sticky header */
table.rm { table-layout: fixed; width: 100%; min-width: 700px; border-collapse: separate; border-spacing: 0; }
table.rm col.rm-mod { width: 260px; }
table.rm col.rm-c { width: auto; }
table.rm th.rm-mod, table.rm td:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.rm thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2, var(--surface)); border-bottom: 1px solid var(--border-strong, var(--border)); vertical-align: bottom; }
table.rm .c { width: auto; text-align: center; }
table.rm tbody tr.rm-m:nth-child(even) td { background: var(--surface-2, #f6faf8); }
table.rm tbody tr.rm-m:hover td { background: color-mix(in srgb, var(--kx-green) 9%, var(--surface)); }
table.rm input[type=checkbox] { width: 16px; height: 16px; margin: 2px 0 0; }
.btn.btn-ok { background: #3daa70; border-color: #3daa70; color: #fff; }
.btn.btn-ok:hover { background: #33925f; }
/* V2.8 full file viewer (CDE documents) */
.fv-bar { flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.fv-main { display: flex; gap: 8px; align-items: stretch; }
.fv-stage { flex: 1; min-width: 0; }
.fv-side { width: 280px; flex: none; max-height: 72vh; overflow: auto; }
.modal-bg.maxed .fv-stage .stage { height: calc(100vh - 250px); }
.fv-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fv-cmp .stage { height: calc(100vh - 230px); }
@media (max-width: 860px) { .fv-main { flex-direction: column; } .fv-side { width: auto; } .fv-cmp { grid-template-columns: 1fr; } .fv-cmp .stage { height: 45vh; } }
/* V2.8 Phase 2: live timers, due colours, header running timer, time log, threaded comments */
.kx-live { font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, Consolas, monospace; white-space: nowrap; padding: 1px 6px; border-radius: 4px; }
.kx-live.on { font-weight: 700; }
.kx-live.green { background: rgba(61,170,112,.16); color: #1f7a4a; }
.kx-live.yellow { background: rgba(224,169,60,.22); color: #8a5d00; }
.kx-live.red { background: rgba(211,64,64,.16); color: #b02a2a; }
.kx-due { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.kx-due:not(.red):not(.yellow):not(.green) { display: none; }
.kx-due.green { background: #3daa70; } .kx-due.yellow { background: #e0a93c; } .kx-due.red { background: #d34040; animation: kxpulse 2s infinite; }
.run-timer { display: inline-flex; align-items: center; gap: 6px; max-width: 320px; height: 32px; padding: 0 10px; margin-right: 6px; border-radius: 16px; border: 1px solid var(--border); background: var(--card, #fff); color: inherit; cursor: pointer; font: inherit; font-size: 12px; }
.run-timer[hidden] { display: none; }
.run-timer .rt-dot { width: 8px; height: 8px; border-radius: 50%; background: #d34040; animation: kxpulse 1.4s infinite; }
.run-timer .rt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
@media (max-width: 640px) { .run-timer .rt-name { display: none; } }
.tk-log-t td, .tk-log-t th { font-size: 12px; } .tk-log-t tfoot td { border-top: 2px solid var(--border); }
.tk-thread { border-top: 1px solid var(--border); padding-top: 8px; }
.tk-cs { max-height: 340px; overflow: auto; margin: 6px 0; }
.tk-c { padding: 6px 0; border-bottom: 1px solid var(--border); }
.tk-r { margin: 6px 0 0 18px; padding-left: 10px; border-left: 3px solid var(--border); }
.tk-txt { white-space: pre-wrap; }
.tk-rbox { display: flex; gap: 6px; margin: 6px 0 0 18px; } .tk-rbox input { flex: 1; }
.tk-new { display: flex; gap: 6px; align-items: flex-end; } .tk-new textarea { flex: 1; }
/* V2.8 Phase 2 F: Module 7 method choice, AI progress, AI configuration */
.e7m-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; color: inherit; display: inline-flex; gap: 6px; align-items: center; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--kx-green, #3daa70); color: #fff; font-weight: 600; }
.seg button svg { width: 15px; height: 15px; }
.seg button:disabled { opacity: .6; cursor: default; }
.e7m-man, .e7m-ai { margin-top: 8px; }
.ai-prog .ai-bar { height: 12px; border-radius: 6px; background: var(--border); overflow: hidden; }
.ai-prog .ai-bar span { display: block; height: 100%; background: linear-gradient(90deg, #3daa70, #2f8fbf); transition: width .45s ease; }
.ai-prog.fail .ai-bar span { background: #d34040; }
.ai-prog .ai-row { display: flex; gap: 10px; align-items: baseline; margin-top: 8px; flex-wrap: wrap; }
.ai-cfg dt { font-weight: 600; } .ai-cfg dd { margin: 0 0 8px; }
.ai-cfg .stat { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.ai-cfg .stat::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: #d34040; }
.ai-cfg .stat.ok::before { background: #3daa70; }
/* V2.8 H: backup module picker, G: AI suggestion cards */
.bk-mods { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 12px; max-height: 300px; overflow: auto; padding: 6px; border: 1px solid var(--border); border-radius: 8px; }
.bk-mods label { display: flex; gap: 6px; align-items: center; }
.ve-sugg .card { border-left: 3px solid var(--primary, #1f4e79); }

/* ---- V2.9 change request ---- */
/* CR 3: long text never cut */
.modal-f { flex-wrap: wrap; }
.modal-f .kx-reason { flex: 1 1 100%; width: 100%; min-height: 34px; resize: vertical; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
td.kx-longcol { min-width: 220px; max-width: 460px; white-space: normal; }
.kx-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.kx-clamp .kx-clamp-t { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.kx-clamp.open .kx-clamp-t { display: block; -webkit-line-clamp: unset; overflow: visible; }
.kx-more { border: 0; background: none; color: var(--blue, #4f98ca); font: inherit; font-size: 11.5px; font-weight: 650; padding: 0; cursor: pointer; }
@media print { .kx-clamp .kx-clamp-t { display: block; -webkit-line-clamp: unset; overflow: visible; } .kx-more { display: none; } }
/* CR 4: phones / tablets — native pickers, 16px controls (no iOS zoom-in that hides the picker), nothing clipped */
@media (pointer: coarse) { select, input, textarea { font-size: 16px; } select { min-height: 40px; } table.t select, table.t input { font-size: 15px; min-height: 34px; } }
.modal-b .kxm { position: relative; } .kxm-list { z-index: 3001; }
/* CR 11: Billable / Non-billable chip toggle */
input.kx-seg-src { position: absolute; opacity: 0; width: 1px !important; height: 1px !important; pointer-events: none; }
.kx-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; padding: 2px; background: var(--surface-2); gap: 2px; width: max-content; }
.kx-seg button { border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 28px; }
.kx-seg .kx-seg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.kx-seg button.on[data-v="1"] { background: #50d890; color: #0f3d27; } .kx-seg button.on[data-v="1"] .kx-seg-dot { background: #0f3d27; }
.kx-seg button.on[data-v="0"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong); } .kx-seg button.on[data-v="0"] .kx-seg-dot { background: var(--text-3); }
.kx-seg.dis { opacity: .6; } .kx-seg.dis button { cursor: default; }
label.kx-seg-label { position: relative; }

/* ---- V2.9 Company CRM (Titan CRM workflow): lead board, tasks calendar, project timeline ---- */
.kx-board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.kx-col { flex: 0 0 230px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; display: flex; flex-direction: column; max-height: 70vh; }
.kx-col.over { outline: 2px dashed var(--accent, #3cb7b0); }
.kx-col-h { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.kx-col-b { padding: 6px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.kx-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 8px; cursor: grab; font-size: 13px; }
.kx-card.drag { opacity: .5; }
.kx-card-st { margin-top: 4px; width: 100%; font-size: 12px; min-height: 28px; }
.kx-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.kx-cal-h { font-size: 12px; font-weight: 600; text-align: center; padding: 4px 0; color: var(--muted, #6b7d7b); }
.kx-cal-d { min-height: 92px; border: 1px solid var(--border); border-radius: 8px; padding: 4px; font-size: 12px; overflow: hidden; }
.kx-cal-d.out { opacity: .45; }
.kx-cal-d.today { border-color: var(--accent, #3cb7b0); box-shadow: inset 0 0 0 1px var(--accent, #3cb7b0); }
.kx-cal-n { font-weight: 600; margin-bottom: 2px; }
.kx-cal-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 4px; padding: 1px 4px; margin-bottom: 2px; background: rgba(79,152,202,.14); cursor: pointer; }
.kx-cal-t.late { background: rgba(214,90,106,.18); color: var(--danger, #b03040); }
.kx-cal-t.done { text-decoration: line-through; opacity: .6; }
@media (max-width: 700px) { .kx-cal-d { min-height: 64px; } .kx-cal-t { font-size: 10px; } }
.kx-tl { display: flex; flex-direction: column; gap: 4px; }
.kx-tl-r { display: grid; grid-template-columns: minmax(90px, 220px) 1fr; gap: 8px; align-items: center; }
.kx-tl-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kx-tl-t { position: relative; height: 14px; background: rgba(127,127,127,.08); border-radius: 7px; }
.kx-tl-b { position: absolute; top: 2px; height: 10px; border-radius: 5px; background: #4f98ca; }
.kx-tl-b.b-ok { background: #50d890; } .kx-tl-b.b-warn { background: #e0a03c; } .kx-tl-b.b-danger { background: #d65a6a; } .kx-tl-b.b-grey { background: #9aa8a6; }
.kx-tl-now { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--danger, #b03040); }
.kx-filters .f { margin: 0; min-width: 120px; }
.kx-seg button[aria-checked="true"]:not([data-v]) { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border-strong); }

/* V2.9 item 15 — CDE action menus, status flow, overview */
.kx-ctx { position: fixed; z-index: 2000; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 4px; }
.kx-ctx button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 7px 10px; border-radius: 6px; color: var(--text); font: inherit; cursor: pointer; min-height: 36px; }
.kx-ctx button:hover:not([disabled]), .kx-ctx button:focus { background: var(--surface-2); outline: none; }
.kx-ctx button[disabled] { color: var(--muted); cursor: not-allowed; }
.kx-ctx button.danger:not([disabled]) { color: #c0392b; }
.kx-ctx hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.cde-fm { float: right; background: none; border: 0; padding: 0 6px; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; opacity: .35; }
.cde-fold:hover .cde-fm, .cde-fold.on .cde-fm, .cde-fm:focus { opacity: 1; }
@media (hover: none) { .cde-fm { opacity: .8; } }
.cde-dm { padding: 0 8px; }
.cde-flow { display: flex; flex-wrap: wrap; gap: 4px; }
.cde-flow span { padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.cde-flow span.done { background: var(--surface-2); color: var(--text); }
.cde-flow span.cur { background: var(--kx-blue, #1f5fa8); border-color: transparent; color: #fff; font-weight: 600; }
.cde-v29 { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.cde-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cde-launch { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cde-launch a { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; color: inherit; text-decoration: none; }
.cde-launch a:hover { background: var(--surface-2); }
.cde-pick { max-height: 200px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; columns: 2; }
.cde-pick label { display: flex; gap: 6px; align-items: center; padding: 2px 0; break-inside: avoid; }
@media (max-width: 640px) { .cde-pick { columns: 1; } }

/* V2.13 (Batch 4 item 1): Terms & Conditions screen after sign-in */
#kx-gate.kx-gate-wide .kx-gate-card { max-width: 860px; }
.kx-tc { text-align: left; }
.kx-tc .kx-gate-sub { text-align: center; }
.kx-tc-body { max-height: 52vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; background: var(--bg, #fff); font-size: 13px; line-height: 1.55; margin: 10px 0; }
.kx-tc-body h1, .kx-tc-body h2, .kx-tc-body h3 { font-size: 15px; margin: 12px 0 6px; }
.kx-tc-body table { border-collapse: collapse; } .kx-tc-body td, .kx-tc-body th { border: 1px solid var(--border); padding: 4px 6px; }
.kx-tc-chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; margin: 6px 0; cursor: pointer; }
.kx-tc-chk input { margin-top: 3px; }
.tc-doc { max-height: 60vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; background: var(--surface); }
.kx-tc-body section.docx, .tc-doc section.docx { padding: 0 !important; width: auto !important; min-height: 0 !important; margin: 0 !important; box-shadow: none !important; background: transparent !important; }
.kx-tc-body .docx-wrapper, .tc-doc .docx-wrapper { padding: 0 !important; background: transparent !important; }
#kx-gate.kx-gate-wide .kx-gate-logo { max-height: 56px; width: auto; }
#kx-gate.kx-gate-wide .kx-gate-card { padding-top: 16px; }
@media (max-height: 760px) { .kx-tc-body { max-height: 42vh; } }

/* V2.13 Batch 4 items 7/8: Master Prompt Library page */
.pl-common{border:1px solid var(--border);border-left:4px solid var(--primary);border-radius:10px;background:var(--surface);padding:10px 14px}
.pl-common>summary{cursor:pointer;list-style-position:outside;padding:2px 0}
.pl-cbody{margin-top:10px}
.pl-intro{color:var(--text-2);margin-bottom:10px}
.pl-sh{font-weight:600;font-size:13px;margin:4px 0 6px;color:var(--accent)}
:root[data-theme="dark"] .pl-sh{color:var(--kx-green)}
.pl-ol{margin:0 0 10px;padding-left:20px;font-size:13px;line-height:1.5}
.pl-ol li{margin-bottom:3px}
.pl-hdr{white-space:pre-wrap;background:var(--surface-2);border:1px dashed var(--border-strong);padding:10px 12px;border-radius:8px;font-size:13px;line-height:1.5;margin-top:6px}
.pl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,360px),1fr));gap:12px;margin-top:6px}
.pl-card{border:1px solid var(--border);border-radius:10px;background:var(--surface);display:flex;flex-direction:column;min-width:0;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.pl-card.pl-ret{opacity:.6}
.pl-h{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border-bottom:1px solid var(--border)}
.pl-code{flex:none;font-weight:700;font-size:12px;background:var(--kx-teal-dark);color:#fff;border-radius:6px;padding:3px 8px;letter-spacing:.02em}
.pl-t{font-weight:600;line-height:1.3}
.pl-cat{display:inline-block;margin-top:4px;font-size:11px;padding:1px 8px;border-radius:999px;background:rgba(79,152,202,.12);color:var(--secondary-ink)}
.pl-txt{white-space:pre-wrap;font-size:13px;line-height:1.55;padding:10px 12px;max-height:260px;overflow:auto;flex:1;word-break:break-word}
.pl-hv{max-height:none;border:1px solid var(--border);border-radius:8px;margin-top:6px}
.pl-txt mark.pl-f{background:rgba(80,216,144,.18);color:inherit;border-radius:3px;padding:0 2px}
.pl-meta{padding:0 12px 6px}
.pl-foot{display:flex;flex-wrap:wrap;gap:6px;padding:8px 12px;border-top:1px solid var(--border)}
.pl-foot .pl-done,.pl-common .pl-done{background:var(--primary);color:#fff;border-color:var(--primary)}
.pl-gen{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,320px),1fr));gap:10px}
.pl-gsec{border:1px solid var(--border);border-radius:8px;padding:8px 10px;background:var(--surface)}
.pl-gh{font-weight:600;margin-bottom:6px}
.pl-gi{display:flex;gap:8px;align-items:flex-start;font-size:13px;line-height:1.45;padding:3px 0;cursor:pointer}
.pl-gi input{margin-top:3px;flex:none}
.pl-gi input:checked+span{color:var(--text-3);text-decoration:line-through}
.pl-cl td{vertical-align:top;font-size:12.5px}
.pl-sg{margin-bottom:14px}
.pl-sgh{font-weight:600;margin:6px 0}

/* V2.13 Batch 4 item 6: QA/QC & EHS manuals as web content */
.md-wrap{display:grid;grid-template-columns:300px minmax(0,1fr);gap:16px;align-items:start;margin-top:10px}
.md-toc{position:sticky;top:70px;max-height:calc(100vh - 90px);overflow:auto;background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:10px}
.md-srch input{width:100%}
.md-tocd>summary{font-weight:600;font-size:13px;margin:10px 0 6px;cursor:pointer;color:var(--text-2)}
.md-tc{margin:2px 0}
.md-tc>summary{list-style:none;cursor:pointer}
.md-tc>summary::-webkit-details-marker{display:none}
.md-tc>summary a{display:flex;gap:8px;align-items:flex-start;padding:6px 8px;border-radius:8px;color:var(--text);text-decoration:none;font-size:13px;line-height:1.3}
.md-tc>summary a small{display:block;font-size:11px;color:var(--text-3);text-transform:uppercase;letter-spacing:.04em}
.md-tc>summary a:hover,.md-tc>summary a.on{background:var(--surface-2)}
.md-tc>summary a.on{box-shadow:inset 3px 0 0 var(--primary)}
.md-ic{flex:none;width:26px;height:26px;border-radius:7px;display:grid;place-items:center;background:rgba(80,216,144,.14);color:var(--primary-ink)}
.md-ic svg{width:15px;height:15px}
.md-tc ol{margin:2px 0 6px 34px;padding:0;list-style:none;border-left:1px solid var(--border)}
.md-tc ol a{display:block;padding:3px 8px;font-size:12.5px;color:var(--text-2);text-decoration:none;line-height:1.35}
.md-tc ol a:hover,.md-tc ol a.on{color:var(--primary-ink);background:var(--surface-2)}
.md-rv{font-size:10px;color:var(--secondary-ink)}
.md-main{min-width:0}
.md-ch{display:flex;gap:12px;align-items:center;flex-wrap:wrap;background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:12px 14px;margin-bottom:10px}
.md-ch h2{margin:2px 0;font-size:20px}
.md-chic{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:var(--kx-gradient);color:#fff;flex:none}
.md-chic svg{width:22px;height:22px}
.md-chb{margin-left:auto;display:flex;gap:6px}
.md-sec{background:var(--surface);border:1px solid var(--border);border-radius:10px;margin-bottom:8px}
.md-sec>summary{cursor:pointer;padding:11px 14px;display:flex;gap:10px;align-items:center;flex-wrap:wrap;font-weight:600}
.md-sec[open]>summary{border-bottom:1px solid var(--border)}
.md-st{flex:1;min-width:0}
.md-rvb{font-size:11px;font-weight:500;padding:2px 8px;border-radius:999px;background:rgba(79,152,202,.13);color:var(--secondary-ink)}
.md-sb{padding:10px 14px 14px}
.md-tools{display:flex;gap:6px;justify-content:flex-end;margin-bottom:4px}
.md-doc{font-size:14px;line-height:1.6;overflow-wrap:anywhere}
.md-doc h3{font-size:16px;margin:16px 0 6px;color:var(--accent)}
.md-doc h4{font-size:14.5px;margin:14px 0 6px}
.md-doc h5,.md-doc h6{font-size:13.5px;margin:12px 0 4px}
:root[data-theme="dark"] .md-doc h3{color:var(--kx-green)}
.md-doc ul,.md-doc ol{padding-left:22px}
.md-doc mark,.md-res mark{background:rgba(255,213,79,.55);color:inherit;border-radius:2px}
.md-tw{overflow-x:auto;margin:10px 0;border:1px solid var(--border);border-radius:8px}
.md-doc table{border-collapse:collapse;width:100%;font-size:13px}
.md-doc th,.md-doc td{border:1px solid var(--border);padding:6px 8px;vertical-align:top;text-align:left}
.md-tw table{border:0}.md-tw tr>*:first-child{border-left:0}.md-tw tr>*:last-child{border-right:0}.md-tw thead tr:first-child>*{border-top:0}.md-tw tbody tr:last-child>*{border-bottom:0}
.md-doc thead th{background:var(--kx-teal-dark);color:#fff;font-weight:600}
.md-doc tbody tr:nth-child(even) td{background:var(--surface-2)}
.md-formw{border-style:dashed;border-color:var(--border-strong)}
.md-fh{display:flex;gap:8px;align-items:center;padding:7px 10px;background:var(--surface-2);border-bottom:1px dashed var(--border-strong);font-size:13px}
.md-fh svg{width:16px;height:16px}.md-fh button{margin-left:auto}
.md-formw thead th{background:var(--surface-2);color:var(--text)}
.md-formw td:empty{background:repeating-linear-gradient(0deg,transparent 0 22px,var(--border) 22px 23px)!important;min-width:80px;height:26px}
.md-call{border-radius:8px;padding:10px 12px;margin:10px 0;border:1px solid var(--border);border-left:4px solid var(--secondary);background:rgba(79,152,202,.08);font-size:13.5px}
.md-call.imp{border-left-color:#d9534f;background:rgba(217,83,79,.08)}
.md-ck{border:1px solid var(--border);border-radius:10px;margin:12px 0;overflow:hidden}
.md-ckh{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:8px 12px;background:var(--surface-2);border-bottom:1px solid var(--border)}
.md-ckic{width:24px;height:24px;border-radius:6px;display:grid;place-items:center;background:var(--primary);color:#fff}.md-ckic svg{width:14px;height:14px}
.md-cki{display:flex;gap:10px;padding:10px 12px;border-bottom:1px solid var(--border)}
.md-cki[data-a="Yes"]{background:rgba(80,216,144,.08)}.md-cki[data-a="No"]{background:rgba(217,83,79,.07)}
.md-ckn{flex:none;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;background:var(--surface-2);font-weight:600;font-size:12px}
.md-ckb{flex:1;min-width:0}
.md-ckt{font-weight:500}
.md-cka{font-size:12.5px;color:var(--text-2);margin-top:2px}.md-cka span{font-weight:600}
.md-ckc{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px;align-items:center}
.md-ckc input{flex:1;min-width:160px;font-size:13px}
.md-seg{display:inline-flex;border:1px solid var(--border-strong);border-radius:8px;overflow:hidden}
.md-seg button{border:0;background:var(--surface);padding:5px 12px;font-size:12.5px;cursor:pointer;color:var(--text)}
.md-seg button+button{border-left:1px solid var(--border-strong)}
.md-seg button.on[data-v="Yes"]{background:var(--primary);color:#fff}.md-seg button.on[data-v="No"]{background:#d9534f;color:#fff}.md-seg button.on[data-v="N/A"]{background:var(--text-3);color:#fff}
.md-ckf{padding:6px 12px}
.md-res{background:var(--surface);border:1px solid var(--border);border-radius:10px;padding:6px}
.md-rh{padding:8px 10px}
.md-hit{display:block;padding:9px 10px;border-radius:8px;text-decoration:none;color:var(--text);border-top:1px solid var(--border)}
.md-hit:hover{background:var(--surface-2)}
.md-ht{font-weight:600;margin:2px 0}
.md-foot{margin:12px 2px}
.md-rte{border:1px solid var(--border-strong);border-radius:8px;overflow:hidden}
.md-tb{display:flex;flex-wrap:wrap;gap:4px;padding:6px;background:var(--surface-2);border-bottom:1px solid var(--border);position:sticky;top:0;z-index:2}
.md-tb button{border:1px solid var(--border);background:var(--surface);border-radius:6px;padding:4px 9px;font-size:12.5px;cursor:pointer;color:var(--text)}
.md-ed{min-height:45vh;max-height:62vh;overflow:auto;padding:12px 14px;outline:none;background:var(--surface)}
@media (max-width:900px){.md-wrap{grid-template-columns:1fr}.md-toc{position:static;max-height:none}.md-chb{margin-left:0}}
/* V2.13 Generate Cashflow layout */
.cfg-t td:first-child,.cfg-t th:first-child{white-space:nowrap}
@media (min-width: 1201px){.cfg-ch{grid-template-columns:minmax(0,1.4fr) minmax(0,1.4fr) minmax(0,1fr)}}
@media (max-width: 700px){.cfg-ch{grid-template-columns:1fr}}

/* ===== V2.14 Batch 5: avatars, welcome card, Running tasks indicator, chunked upload panel ===== */
.kx-av { display: inline-block; vertical-align: middle; border: 2px solid var(--bg, #fff); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.kx-av-i { display: inline-flex; align-items: center; justify-content: center; background: var(--kx-gradient); color: #fff; font-weight: 700; text-decoration: none; letter-spacing: .02em; }
#user-av.has-photo { background: none; padding: 0; overflow: hidden; }
.kx-welcome .card-b { background: linear-gradient(120deg, rgba(80,216,144,.10), rgba(79,152,202,.10)); border-radius: inherit; }
.kx-team { min-width: 220px; }
.kx-team-row { display: flex; flex-wrap: wrap; gap: 0; }
.kx-team-row > a { margin-right: -6px; transition: transform .12s; }
.kx-team-row > a:hover { transform: translateY(-3px); z-index: 1; }
.kx-tasks { position: fixed; right: 18px; bottom: 18px; z-index: 1200; }
.kx-tasks-btn { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 22px; border: 1px solid var(--border, #d6e6e2); background: var(--surface, #fff); color: inherit; box-shadow: 0 6px 20px rgba(0,0,0,.18); cursor: pointer; font: inherit; }
.kx-tasks-btn:hover { box-shadow: 0 8px 26px rgba(0,0,0,.24); }
.kx-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--kx-blue); border-top-color: transparent; display: inline-block; animation: kx-spin .8s linear infinite; }
@keyframes kx-spin { to { transform: rotate(360deg); } }
.kx-upl { position: fixed; left: 18px; bottom: 18px; z-index: 1200; width: min(460px, calc(100vw - 36px)); background: var(--surface, #fff); color: inherit; border: 1px solid var(--border, #d6e6e2); border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.18); padding: 10px 12px; max-height: 50vh; overflow: auto; }
.kx-upl-h { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.kx-upl-r { margin-top: 6px; }
.kx-upl .ai-bar { height: 6px; }
.kx-login-tc { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 4px; font-size: 13px; }
.kx-login-tc input { margin-top: 2px; }
button[data-signin]:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- V2.15 installable phone app ---------- */
.kx-pwa-banner { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 90; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface, #fff); color: var(--text, #272727); border: 1px solid var(--border, #d9e6e2); border-radius: 12px; box-shadow: 0 8px 28px rgba(39,39,39,.18); max-width: 560px; margin: 0 auto; }
.kx-pwa-banner img { border-radius: 9px; flex: 0 0 auto; }
.kx-pwa-banner .t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; }
.kx-pwa-banner .t span { color: var(--text-3, #5d6b67); font-size: 12px; }
.kx-pwa-banner .btn { flex: 0 0 auto; min-height: 38px; }
@media (max-width: 420px) { .kx-pwa-banner { flex-wrap: wrap; } .kx-pwa-banner .t { flex-basis: calc(100% - 50px); } .kx-pwa-banner .btn { flex: 1 1 40%; } }
.kx-pwa-steps { padding-left: 20px; line-height: 1.55; } .kx-pwa-steps li { margin-bottom: 6px; }
.kx-net { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #fff4d6; color: #7a5300; border: 1px solid #f0d58a; white-space: nowrap; }
.kx-net::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #d08a00; }
.kx-net[hidden] { display: none; }
@media print { .kx-pwa-banner, .kx-net { display: none !important; } }
/* phones: figure cards two across instead of one card per screen */
@media (max-width: 640px) {
  .g2:has(> .kpi), .g3:has(> .kpi), .g4:has(> .kpi) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px 12px; } .kpi .val { font-size: 19px; } .kpi .lbl { font-size: 10.5px; letter-spacing: .03em; } .kpi .foot { font-size: 11px; }
}
/* installed app: room for the iPhone home bar */
.kx-installed .content { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }

/* V2.16 (audit D-22): controls large enough for a finger on tablets and phones */
@media (pointer: coarse), (max-width: 860px) { table.t input, table.t select { min-height: 36px; } .cde-fm { min-width: 40px; min-height: 40px; font-size: 20px; opacity: .8; } }
/* V2.16 Help & User Manual: pictures with numbered callouts, the "?" button */
.hm-fig{margin:12px 0;padding:0;text-align:center}
.hm-fig img{max-width:100%;height:auto;border:1px solid var(--border);border-radius:8px;cursor:zoom-in;background:#fff}
.hm-fig figcaption{font-size:12.5px;color:var(--text-2);margin-top:4px}
.hm-doc blockquote{margin:10px 0;padding:8px 12px;border-left:4px solid var(--kx-green,#50d890);background:var(--surface-2);border-radius:0 8px 8px 0}
.hm-doc table{width:100%}
.md-toc .md-tc>summary{display:block}

/* V2.18 (Batch 6 item 2): loading state while the project is switched; company-wide screens show the selector muted */
#kx-switching { position: fixed; inset: 0; z-index: 9000; pointer-events: all; cursor: progress; background: color-mix(in srgb, var(--bg) 55%, transparent); }
#kx-switching .kx-sw-bar { position: absolute; left: 0; top: 0; height: 3px; width: 40%; background: var(--kx-gradient); animation: kx-sw 1s ease-in-out infinite; }
#kx-switching .kx-sw-box { position: absolute; left: 50%; top: 84px; transform: translateX(-50%); background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 600; box-shadow: 0 6px 24px rgba(16,46,50,.18); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
@keyframes kx-sw { 0% { left: -40%; } 100% { left: 100%; } }
.topbar #project-select.kx-proj-na { opacity: .6; }
@media print { #kx-switching { display: none !important; } }
/* V2.18: whatever the new look adds to a page (tool strips, breadcrumbs, palette) never prints */
@media print { [data-ui3] { display: none !important; } }

/* V2.19 (Batch 7 item 1b): no project selector on company-wide screens */
.topbar #project-select[hidden] { display: none !important; }

/* V2.20 (Batch 8 item 6): the profile menu and the notification panel are placed against the screen (the viewport), right
   under the header that stays at the top, so they open in view at any scroll position. Before, they were placed on the
   page 56 px from its top and so opened out of sight once the page was scrolled. Same rule in both looks and on phones. */
.popover.kx-drop { position: fixed; top: calc(var(--header-h, 56px) + 4px); right: 18px; z-index: 90; max-width: calc(100vw - 16px); max-height: calc(100vh - var(--header-h, 56px) - 20px); max-height: calc(100dvh - var(--header-h, 56px) - 20px); overscroll-behavior: contain; }
@media (max-width: 640px) { .popover.kx-drop { left: 8px !important; right: 8px !important; width: auto !important; } }
@media print { .popover.kx-drop { display: none !important; } }

/* V2.20 (Batch 8 item 4): notification panel */
.popover .n-ph { gap: 10px; }
.popover .n-seg button { padding: 4px 10px; font-size: 12px; font-weight: 500; }
.popover .n-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.popover .n-item { align-items: flex-start; gap: 8px; }
.popover .n-item:not(.unread) .n-main { opacity: .78; }
.popover .n-tg { flex: none; width: 30px; height: 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.popover .n-tg:hover, .popover .n-tg:focus-visible { border-color: var(--kx-green, #3daa70); color: var(--text); }
.popover .n-item.unread .n-tg { color: var(--kx-green-d, #1f7a4d); }
#notif-btn.has-alerts::after { content: ''; position: absolute; right: 5px; bottom: 5px; width: 7px; height: 7px; border-radius: 50%; background: #d98a1f; border: 1.5px solid var(--surface); }

/* V2.20 (Batch 8 item 5): what the new look adds to the page is never shown in the classic look (the look can now change
   without a reload, so these elements may exist while the classic look is on) */
html:not([data-ui="3"]) [data-ui3] { display: none !important; }

/* ===== V2.22 BEAM BRIDGE (field model, dashboard, issues, setup) ===== */
.bb { display: flex; flex-direction: column; gap: 8px; }
.bb-bar { display: flex; gap: 6px; overflow-x: auto; align-items: center; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.bb-tool { flex: none; height: 40px; white-space: nowrap; }
.bb-sync { margin-left: auto; flex: none; padding-left: 8px; }
.bb-filter { background: var(--info-bg); border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.bb-sheet { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; max-height: 46vh; overflow: auto; }
.bb-sheet h3 { margin: 0 34px 6px 0; }
.bb-x { position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; }
.bb-main { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 10px; align-items: stretch; }
.bb-canvas { position: relative; height: calc(100vh - 250px); min-height: 380px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.bb-canvas canvas { display: block; width: 100% !important; height: 100% !important; }
.bb-msg { position: absolute; left: 10px; top: 10px; right: 10px; font-size: 13px; color: var(--text-2); pointer-events: none; z-index: 2; }
.bb-legend { position: absolute; left: 8px; bottom: 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; font-size: 11.5px; z-index: 2; }
.bb-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; flex: none; }
.bb-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; overflow: auto; height: calc(100vh - 250px); min-height: 380px; }
.bb-empty { text-align: center; padding: 30px 10px; color: var(--text-2); }
.bb-ph { display: flex; justify-content: space-between; gap: 8px; position: relative; padding-right: 40px; }
.bb-ph .bb-x { right: -4px; top: -4px; }
.bb-prog { display: flex; align-items: center; gap: 12px; margin: 10px 0 6px; }
.bb-big-pct { font-size: 30px; font-weight: 700; letter-spacing: -.02em; min-width: 84px; }
.bb-bars { flex: 1; min-width: 0; }
.bb-bars .bar, .bb-pbar { position: relative; height: 10px; background: var(--surface-3); border-radius: 6px; overflow: hidden; }
.bb-bars .bar i, .bb-pbar i { display: block; height: 100%; border-radius: 6px; }
.bb-pbar { overflow: visible; }
.bb-pbar b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); }
.bb-grp { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; }
.bb-tabs { margin: 8px 0 10px; }
.bb-tabs button { padding: 10px 10px; white-space: nowrap; }
.bb-form { display: flex; flex-direction: column; gap: 10px; }
.bb-form input, .bb-form select, .bb-form textarea { width: 100%; }
.bb-form input[type=checkbox] { width: auto; }
.bb-qty { display: flex; align-items: center; gap: 8px; }
.bb-qty input { flex: 1; font-size: 18px; height: 44px; font-weight: 600; }
.bb-qty span { white-space: nowrap; font-weight: 400; }
.bb-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bb-quick .btn { justify-content: center; height: 40px; }
.bb-cap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bb-cap [data-picked] { flex-basis: 100%; }
.bb-big { height: 44px; justify-content: center; flex: 1; cursor: pointer; }
.bb-save { height: 46px; justify-content: center; font-size: 15px; width: 100%; }
.bb-files, .bb-photos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bb-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; background: var(--surface-3); font-size: 10px; }
.bb-photos figure { margin: 0; width: 150px; }
.bb-photos .bb-thumb { width: 150px; height: 110px; }
.bb-hist > div, .bb-cm { border-left: 3px solid var(--border-strong); padding: 6px 0 6px 10px; margin-bottom: 8px; font-size: 13px; }
.bb-cm.kid { margin-left: 18px; }
.bb-list { display: flex; flex-direction: column; gap: 4px; }
.bb-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.bb-row > span:nth-of-type(1) { flex: 1; min-width: 0; }
.bb-row input[type=checkbox] { width: 20px; height: 20px; flex: none; }
.bb-hit:hover { border-color: var(--kx-green); }
.bb-pct { white-space: nowrap; font-weight: 600; font-size: 12.5px; }
.bb-seg { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.bb-seg .btn { height: 40px; }
.bb-range { width: 100%; height: 34px; }
.bb-find { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 6px; margin-bottom: 6px; }
.bb-det { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 8px; }
.bb-det summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
.bb-kv th { text-align: left; width: 42%; font-weight: 600; color: var(--text-2); vertical-align: top; }
.bb-kv td, .bb-kv th { padding: 5px 6px; font-size: 12.5px; }
.bb-ex span { display: flex; gap: 6px; align-items: center; font-weight: 400; }
a.bb-kpi { text-decoration: none; color: inherit; display: block; }
.bb-neg { color: var(--danger); font-weight: 600; }
.bb-pos { color: var(--ok); font-weight: 600; }
.bb-t tr[data-go] { cursor: pointer; }
.bb-t td .bb-dot { margin-right: 6px; }
.bb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bb-cbs { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.bb-cbs label { display: flex; gap: 5px; align-items: center; font-weight: 400; min-height: 30px; }
.kx-field-note { display: none; }
.kx-field .kx-field-note { display: block; }
@media (max-width: 900px) {
  .bb-main { display: block; }
  .bb-canvas { height: calc(100vh - 235px); height: calc(100dvh - 235px); min-height: 300px; }
  .bb-panel { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; height: auto; min-height: 0; max-height: 72vh; max-height: 72dvh; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.25); padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .bb-panel.open { display: block; }
  .bb-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; max-height: 70vh; max-height: 70dvh; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.25); padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .bb-find { grid-template-columns: 1fr 1fr; }
  .bb-find input[type=search] { grid-column: 1 / -1; }
  .bb-form input, .bb-form select, .bb-form textarea, .bb-find input, .bb-find select { min-height: 44px; font-size: 16px; }
  .bb .bb-bar .bb-tool { height: 44px; min-height: 44px; }
}
.bb-card { padding: 14px 16px; }

/* V2.23 (Batch 10 items 7, 10): reset-password rules and the read-only Terms & Conditions viewer */
.kx-pw-rules { text-align: left; margin: 0 0 10px; padding: 8px 10px 8px 26px; border: 1px solid var(--border); border-radius: 8px; line-height: 1.5; }
.kx-tcv { position: fixed; inset: 0; z-index: 100000; background: rgba(8, 20, 30, .62); display: flex; align-items: center; justify-content: center; padding: 16px; }
.kx-tcv-card { background: var(--card, #fff); color: var(--text, #1b2a33); width: min(900px, 100%); max-height: 100%; display: flex; flex-direction: column; border-radius: 12px; box-shadow: 0 18px 60px rgba(0, 0, 0, .35); }
.kx-tcv-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border, #d5dde2); }
.kx-tcv-head b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.kx-tcv-ro { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--border, #d5dde2); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.kx-tcv-body { overflow: auto; padding: 16px 22px; line-height: 1.55; text-align: left; user-select: none; -webkit-user-select: none; }
.kx-tcv-body h1, .kx-tcv-body h2, .kx-tcv-body h3 { font-size: 15px; margin: 12px 0 6px; }
.kx-tcv-body table { border-collapse: collapse; } .kx-tcv-body td, .kx-tcv-body th { border: 1px solid var(--border, #d5dde2); padding: 4px 6px; }
.kx-tcv-body section.docx { padding: 0 !important; width: auto !important; min-height: 0 !important; margin: 0 !important; box-shadow: none !important; }
.kx-tcv-body .docx-wrapper { padding: 0 !important; background: transparent !important; }
@media print { html.kx-noprint body { display: none !important; } }

/* V2.23 (Batch 10 item 11): the sync indicator, shown only when offline or when changes are waiting */
.kx-syncdot { border: 1px solid var(--border, #d5dde2); background: var(--warn-bg, #fff6e0); color: var(--warn-ink, #7a5200); border-radius: 999px; font-size: 11.5px; line-height: 1; padding: 5px 10px; margin-right: 8px; cursor: pointer; white-space: nowrap; }
.kx-syncdot[data-state="offline"] { background: var(--danger-bg, #fde8e8); color: var(--danger-ink, #8a1c1c); }
.kx-syncdot[hidden] { display: none !important; }

/* V2.23 (Batch 10 item 5): the export format choice */
.kx-expch { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kx-expch-o { text-align: left; padding: 14px 16px; border: 1.5px solid var(--border, #d5dde2); border-radius: 10px; background: var(--card, #fff); color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 6px; font: inherit; }
.kx-expch-o b { font-size: 16px; } .kx-expch-o span { font-size: 12px; opacity: .8; line-height: 1.4; overflow-wrap: anywhere; }
.kx-expch-o:hover, .kx-expch-o:focus-visible { border-color: var(--primary, #0b3c5d); outline: none; box-shadow: 0 0 0 3px rgba(31, 157, 143, .18); }
@media (max-width: 560px) { .kx-expch { grid-template-columns: 1fr; } }

/* V2.23 (Batch 10 item 3): resizable panels */
.kx-rz { position: absolute; z-index: 30; touch-action: none; user-select: none; -webkit-user-select: none; display: flex; align-items: center; justify-content: center; }
.kx-rz-x { top: 0; bottom: 0; width: 10px; cursor: col-resize; }
.kx-rz-y { left: 0; right: 0; bottom: 0; height: 10px; cursor: row-resize; }
.kx-rz-vscroll { display: flex; flex-direction: column; } .kx-rz-vscroll > * { flex: none; }
.kx-rz-vscroll > .kx-rz-y { position: sticky; bottom: 0; margin-top: auto; width: 100%; min-height: 10px; background: linear-gradient(to top, var(--card, #fff) 40%, transparent); }
.kx-rz::before { content: ''; background: var(--border-strong, #b9c6cc); border-radius: 3px; opacity: .0; transition: opacity .12s; }
.kx-rz-x::before { width: 3px; height: 100%; } .kx-rz-y::before { height: 3px; width: 100%; }
.kx-rz:hover::before, .kx-rz:focus-visible::before, .kx-rz.drag::before { opacity: 1; background: var(--primary, #1f9d8f); }
.kx-rz:focus-visible { outline: none; }
.kx-rz-c { position: absolute; width: 18px; height: 34px; border-radius: 9px; border: 1px solid var(--border-strong, #b9c6cc); background: var(--card, #fff); color: var(--text, #1b2a33); font-size: 13px; line-height: 1; padding: 0; cursor: pointer; opacity: 0; transition: opacity .12s; top: 14px; }
.kx-rz:hover .kx-rz-c, .kx-rz:focus-within .kx-rz-c, .kx-rz.off .kx-rz-c, .kx-rz-c:focus-visible { opacity: 1; }
@media (hover: none) { .kx-rz-c { opacity: 1; } .kx-rz::before { opacity: .55; } .kx-rz-x { width: 16px; } .kx-rz-y { height: 16px; } }
.kx-rz-host { position: relative; }
.kx-rz-pane { min-width: 0; overflow-wrap: anywhere; }
.kx-rz-pane.kx-rz-off { display: none !important; }
.kx-rz-vpane { position: relative; }
html.kx-rz-on, html.kx-rz-on * { user-select: none !important; -webkit-user-select: none !important; }
html.kx-rz-on-x, html.kx-rz-on-x * { cursor: col-resize !important; } html.kx-rz-on-y, html.kx-rz-on-y * { cursor: row-resize !important; }
html.kx-rz-on iframe, html.kx-rz-on canvas { pointer-events: none; }
/* the main menu */
#app { position: relative; }
.kx-rz-side { position: fixed; top: 0; bottom: 0; height: 100vh; z-index: 60; }
/* V2.25: one column while the menu is hidden. With two columns the page itself fell into the 0-wide first one. */
#app.kx-side-off { grid-template-columns: minmax(0, 1fr); } #app.kx-side-off > .sidebar { display: none; }
@media (max-width: 860px) { .kx-rz { display: none !important; } }
/* text in the menu wraps and unwraps with the width */
.sidebar .nav a { white-space: normal; overflow-wrap: anywhere; }
.sidebar .nav a > span:not(.num), .sidebar .nav a .t { min-width: 0; overflow-wrap: anywhere; white-space: normal; }
.cde-tree, .bimv-tree, .bimv-props, .md-toc { overflow-wrap: anywhere; }
@media print { .kx-rz { display: none !important; } }

/* V2.23 Batch 10 section C: CDE */
.kx-superseded { position: relative; }
.kx-superseded::after { content: 'SUPERSEDED'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: clamp(28px, 7vw, 76px); font-weight: 800; letter-spacing: .08em; color: rgba(179, 38, 30, .28); transform: rotate(-24deg); pointer-events: none; z-index: 3; }
.kx-tplrow input { height: 30px; } .kx-tplrow .btn-sm { padding: 2px 7px; min-width: 28px; }
.mk-layer { padding: 4px 0; border-bottom: 1px solid var(--line, #e3e8e6); } .mk-set { font-size: 12px; }
.kx-nm { border: 1px dashed var(--line, #cfd8d4); border-radius: 8px; padding: 8px 10px; } .kx-nm:empty { display: none; }
table.t tr.warn td { background: rgba(217, 164, 0, .12); }
.fv-main .fv-side[data-mside] { min-width: 300px; max-width: 380px; overflow: auto; }

/* ===== V2.23 Batch 10 item 12: Project plan (task table + Gantt) ===== */
.kxp-bar { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px 8px 0 0; }
.kxp-bar .g { display: inline-flex; gap: 4px; align-items: center; padding-right: 10px; border-right: 1px solid var(--border); }
.kxp-bar .g:last-child { border-right: 0; }
.kxp-bar .btn.on { background: var(--ok-bg); border-color: var(--kx-green); font-weight: 700; }
.kxp-bar select { height: 28px; font-size: 12px; max-width: 190px; }
.kxp-bar .chk { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; white-space: nowrap; cursor: pointer; }
.kxp-sum { display: flex; flex-wrap: wrap; gap: 4px 18px; padding: 6px 10px; background: var(--surface-2); border: 1px solid var(--border); border-top: 0; }
.kxp-sum .bad, .kxp-t .bad { color: var(--danger); font-weight: 700; } .kxp-sum .warnc, .kxp-t .warnc { color: var(--warn); font-weight: 700; } .kxp-t .ok { color: var(--ok); }
.kxp { display: flex; height: max(360px, calc(100vh - 330px)); border: 1px solid var(--border); border-top: 0; background: var(--surface); outline: none; border-radius: 0 0 8px 8px; overflow: hidden; }
.kxp:focus-visible { box-shadow: inset 0 0 0 2px var(--kx-blue); }
.kxp-l { flex: 0 0 auto; overflow: auto; scrollbar-width: thin; }
.kxp-r { flex: 1 1 0; min-width: 0; overflow: auto; position: relative; }
.kxp-sp { flex: 0 0 6px; cursor: col-resize; background: var(--border); touch-action: none; }
.kxp-sp:hover { background: var(--kx-blue); }
.kxp-t { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12px; }
.kxp-t th { position: sticky; top: 0; z-index: 3; height: 40px; box-sizing: border-box; padding: 0 6px; text-align: left; background: var(--surface-2); border-bottom: 1px solid var(--border-strong); border-right: 1px solid var(--border); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kxp-t td { height: 26px; box-sizing: border-box; padding: 0 6px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: cell; }
.kxp-t td.ro { color: var(--text-2); cursor: default; } .kxp-t .num { text-align: right; }
.kxp-t tr.sum td { font-weight: 700; background: var(--surface-2); }
.kxp-t tr.crit td[data-f="name"] { color: var(--danger); }
.kxp-t tr.sel td { background: var(--info-bg); }
.kxp-t td.cur { box-shadow: inset 0 0 0 2px var(--kx-blue); }
.kxp-t tr.grp td { background: var(--surface-3); height: 26px; }
.kxp-t .nm { display: inline-flex; align-items: center; gap: 2px; }
.kxp-t .tg { display: inline-block; width: 14px; text-align: center; cursor: pointer; text-decoration: none; color: var(--text-2); font-style: normal; }
.kxp-t .msd { color: var(--text); font-size: 10px; }
.kxp-t td[data-f="ind"] span { margin-right: 2px; cursor: help; }
.kxp-in { width: 100%; height: 22px; border: 0; outline: 2px solid var(--kx-blue); background: var(--surface); color: var(--text); font: inherit; padding: 0 4px; box-sizing: border-box; }
.kxp-gh { position: sticky; top: 0; z-index: 4; height: 40px; background: var(--surface-2); border-bottom: 1px solid var(--border-strong); box-sizing: border-box; font-size: 11px; }
.kxp-gh .r1, .kxp-gh .r2 { position: relative; height: 20px; }
.kxp-gh span { position: absolute; top: 0; height: 20px; line-height: 20px; box-sizing: border-box; padding: 0 4px; border-right: 1px solid var(--border); white-space: nowrap; overflow: hidden; }
.kxp-gh .r1 span { font-weight: 700; border-bottom: 1px solid var(--border); } .kxp-gh .r2 span { text-align: center; padding: 0; color: var(--text-2); } .kxp-gh .r2 span.off { background: var(--surface-3); }
.kxp-gb { position: relative; }
.kxp-gb > svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.kxp-gb svg path { fill: none; stroke: var(--text-3); stroke-width: 1.2; } .kxp-gb svg path.crit { stroke: var(--danger); }
.kxp-gb svg path.hit { stroke: transparent; stroke-width: 9; pointer-events: stroke; cursor: pointer; }
.kxp-gb svg marker path { fill: var(--text-3); stroke: none; }
.kxp-gb svg .pl { fill: none; stroke: #d6336c; stroke-width: 1.6; }
.kxp-gb .nw { position: absolute; top: 0; bottom: 0; background: var(--surface-2); opacity: .8; }
.kxp-gb .rw { position: absolute; left: 0; right: 0; height: 26px; box-sizing: border-box; border-bottom: 1px solid var(--border); }
.kxp-gb .rw.sel { background: var(--info-bg); opacity: .6; } .kxp-gb .rw.grp { background: var(--surface-3); }
.kxp-gb .today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed var(--kx-green-deep); z-index: 1; }
.kxp-gb .tb { position: absolute; height: 15px; border-radius: 3px; background: #9cc4e4; border: 1px solid var(--kx-blue-hover); box-sizing: border-box; cursor: grab; z-index: 2; touch-action: none; }
.kxp-gb .tb .pg { display: block; height: 100%; background: var(--kx-blue-hover); border-radius: 2px 0 0 2px; pointer-events: none; }
.kxp-gb .tb.crit { background: #f3b1b1; border-color: #c92a2a; } .kxp-gb .tb.crit .pg { background: #c92a2a; }
.kxp-gb .tb.done { background: #a9dfc0; border-color: var(--kx-green-deep); } .kxp-gb .tb.done .pg { background: var(--kx-green-deep); }
.kxp-gb .tb.conf { outline: 2px solid var(--danger); outline-offset: 1px; }
.kxp-gb .tb .rz { position: absolute; right: -1px; top: -1px; width: 6px; height: 15px; cursor: ew-resize; }
.kxp-gb .tb .lk { position: absolute; right: -11px; top: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--text-2); cursor: crosshair; opacity: 0; }
.kxp-gb .tb:hover .lk { opacity: 1; }
.kxp-gb .sb { position: absolute; height: 7px; background: var(--text); box-sizing: border-box; z-index: 2; clip-path: polygon(0 0, 100% 0, 100% 100%, calc(100% - 6px) 55%, 6px 55%, 0 100%); height: 12px; }
.kxp-gb .sb i { display: block; height: 3px; margin-top: 2px; background: var(--kx-green); pointer-events: none; }
.kxp-gb .sb.crit { background: #7a1c1c; }
.kxp-gb .ms { position: absolute; width: 13px; height: 13px; background: var(--text); transform: rotate(45deg); z-index: 2; cursor: grab; }
.kxp-gb .ms.crit { background: #c92a2a; } .kxp-gb .ms.done { background: var(--kx-green-deep); }
.kxp-gb .bt { position: absolute; font-size: 10.5px; line-height: 15px; color: var(--text-2); white-space: nowrap; pointer-events: none; z-index: 2; }
.kxp-gb .bl { position: absolute; height: 4px; background: #868e96; border-radius: 2px; z-index: 1; }
.kxp-gb .blm { position: absolute; width: 8px; height: 8px; background: #868e96; transform: rotate(45deg); z-index: 1; }
.kxp-gb .slk { position: absolute; height: 2px; background: var(--text-3); z-index: 1; }
.kxp-gb .lkline { position: absolute; height: 0; border-top: 2px dashed var(--kx-blue); transform-origin: 0 0; z-index: 5; pointer-events: none; }
.kxp-curve { max-height: 300px; } .kxp-curve .ax line { stroke: var(--border); } .kxp-curve .ax text { font-size: 10px; fill: var(--text-2); }
.kxp-curve .plan { fill: none; stroke: var(--kx-blue); stroke-width: 2; } .kxp-curve .ev { fill: none; stroke: var(--kx-green-deep); stroke-width: 2; } .kxp-curve .base { fill: none; stroke: #868e96; stroke-width: 1.5; stroke-dasharray: 5 4; } .kxp-curve .st { stroke: #d6336c; stroke-dasharray: 3 3; }
.kxp-leg { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; } .kxp-leg i { display: inline-block; width: 18px; height: 3px; vertical-align: middle; margin-right: 4px; }
.kxp-exp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 860px) { .kxp { height: 70vh; } .kxp-exp { grid-template-columns: 1fr; } }
.kxp-leg i.plan { background: var(--kx-blue); } .kxp-leg i.base { background: #868e96; } .kxp-leg i.ev { background: var(--kx-green-deep); height: 8px; width: 8px; border-radius: 50%; }
.kxp-gb svg line.rub { stroke: var(--kx-blue); stroke-width: 2; stroke-dasharray: 5 4; }
.kxp-gb .drg { opacity: .7; cursor: grabbing; } .kxp-gb .tgt { outline: 2px solid var(--kx-blue); outline-offset: 2px; }
.kxp-bar .btn.btn-sm { padding: 3px 9px; min-height: 28px; height: 28px; font-size: 12px; border-radius: 6px; }
.kxp-bar { gap: 5px 8px; padding: 6px 8px; } .kxp-bar .g { padding-right: 8px; }
.kxp-bar select { height: 28px; min-height: 28px; padding: 2px 6px; font-size: 12px; border-radius: 6px; width: auto; }

/* V2.25 (Batch 12 item 4): a chip that holds a check box shows its state */
.chip:has(input:checked) { background: rgba(80,216,144,.18); border-color: var(--kx-green); color: var(--text); font-weight: 600; }
/* V2.25 (Batch 12 item 1): project list of the dashboard: name only, with a Duration column */
.g-row.g12 { grid-template-columns: minmax(180px, 260px) minmax(340px, 1fr) 96px 120px 96px; }
.g-lbl a.g-name { color: var(--kx-link, #0b6b5c); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.g-lbl a.g-name:hover { text-decoration-thickness: 2px; }
.seg { display: inline-flex; gap: 0; } .seg .btn { border-radius: 0; margin: 0; } .seg .btn:first-child { border-radius: 8px 0 0 8px; } .seg .btn:last-child { border-radius: 0 8px 8px 0; } .seg .btn + .btn { border-left: 0; }
a.g-name { color: var(--kx-link, #0b6b5c); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* V2.25 (Batch 12 item 2): Select statutory approvals */
.b12-stl { max-height: 56vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.modal.max .b12-stl { max-height: none; }
.b12-stg + .b12-stg { border-top: 1px solid var(--border); }
.b12-stgh { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--surface-2, rgba(127,127,127,.08)); position: sticky; top: 0; z-index: 1; }
.b12-stgh label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; margin: 0; }
.b12-sti { display: flex; gap: 10px; align-items: flex-start; padding: 7px 12px 7px 32px; cursor: pointer; margin: 0; }
.b12-sti:hover { background: rgba(127,127,127,.07); }
.b12-sti[hidden], .b12-stg[hidden] { display: none; }
.b12-stl input[type=checkbox] { width: 16px; height: 16px; flex: none; margin: 2px 0 0; display: inline-block; }
.b12-stl [hidden] { display: none !important; }
/* V2.25 (Batch 12 item 9): the logo is always on screen and opens Home. In the side menu it stays at the top while the
   menu scrolls; when the side menu is hidden or on a narrow screen (phone), the logo of the top bar is shown instead. */
.sidebar > .brand { position: sticky; top: 0; z-index: 6; background: var(--sidebar-bg); flex: none; }
.sidebar > .brand [data-logo] { cursor: pointer; }
#app.kx-side-off .topbar .page-logo { display: block; flex: none; cursor: pointer; }
@media (max-width: 860px) { .topbar .page-logo { display: block; flex: none; cursor: pointer; } .topbar .page-logo img { height: 26px; } }
/* V2.25 (Batch 12 item 7b): Project plan with more room. Slim tool bar, ribbon, compact page head, maximise. */
.kxp-bar { display: block; padding: 4px 6px; }
.kxp-row1, .kxp-ribbon { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.kxp-ribbon { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.kxp-noribbon .kxp-ribbon { display: none; }
.kxp-bar .g { gap: 3px; padding-right: 6px; }
.kxp-fill { flex: 1 1 auto; }
.kxp-bar .kxp-lay { border-right: 0; padding-right: 0; }
.kxp-bar .btn.kxp-ib { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 28px; padding: 3px 6px; }
.kxp-bar .btn.kxp-ib svg { flex: none; }
.kxp-bar .btn.kxp-ib[disabled] { opacity: .4; }
.kxp-bar .kxp-flow:empty { display: none; }
.kxp-bar .kxp-stage { text-decoration: none; cursor: pointer; white-space: nowrap; font-weight: 700; padding: 4px 10px; }
.kxp-bar .kxp-flow .btn { white-space: nowrap; }
.kxp-home { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; color: inherit; border: 1px solid var(--border); margin-right: 4px; }
.kxp-ttl { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; margin-right: 8px; }
.kxp-sum { padding: 3px 8px; gap: 2px 14px; }
.kxp-wide .page-head { display: none; }
.kxp-wide.kxp-figs .page-head { display: flex; margin-bottom: 6px; }
.kxp-wide .page-head .sub { display: none; }
.kxp-wide .page-head h1 { font-size: 18px; margin: 0; }
.kxp-bar select { max-width: 160px; }
.kxp-wide [data-kpis] { display: none; }
.kxp-wide.kxp-figs [data-kpis] { display: grid; }
.kxp-wide .tabs { margin-bottom: 6px; }
.kxp-host .kxp { height: max(320px, calc(100vh - 250px)); }
.kxp-compact .kxp-t td, .kxp-compact .kxp-t tr.grp td { height: 22px; font-size: 11.5px; }
.kxp-compact .kxp-gb .rw { height: 22px; }
.kxp-compact .kxp-in { height: 19px; }
.kxp-notable .kxp-l, .kxp-notable .kxp-sp, .kxp-nochart .kxp-r, .kxp-nochart .kxp-sp { display: none; }
.kxp-nochart .kxp-l { flex: 1 1 auto; width: auto !important; }
html.kxp-max, html.kxp-max body { overflow: hidden; }
html.kxp-max .kxp-host { position: fixed; inset: 0; z-index: 70; background: var(--bg, var(--surface)); padding: 4px 6px 0; display: flex; flex-direction: column; }
html.kxp-max .kxp-host .kxp { flex: 1 1 auto; height: auto !important; min-height: 0; border-radius: 0; }
html.kxp-max .kxp-host .kxp-bar { border-radius: 0; }
.kxp-sp:focus-visible { background: var(--kx-blue); outline: none; }
.flow-strip .flow-arrow { font-style: normal; color: var(--text-3); }
html .content.kxp-wide, html[data-ui="3"] .content.kxp-wide { padding-bottom: 8px; } /* the plan ends at the bottom of the window: the page itself does not scroll */
/* V2.27 Batch 14 item 2: bulk edit grid */
.bk14 .modal { width: min(1500px, 100%); }
.bk14-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.bk14-bar input[type=search] { width: 180px; } .bk14-bar select, .bk14-bar input { height: 32px; } .bk14-sep { width: 1px; height: 22px; background: var(--line, #d7dedb); margin: 0 4px; }
.bk14-wrap { max-height: 58vh; overflow: auto; border: 1px solid var(--line, #d7dedb); border-radius: 8px; }
.bk14-grid thead th { position: sticky; top: 0; z-index: 1; background: var(--card, #fff); }
.bk14-grid td { padding: 2px 4px; vertical-align: middle; }
.bk14-grid td input[type=text], .bk14-grid td input[type=date], .bk14-grid td select { width: 100%; min-width: 120px; height: 30px; border: 1px solid transparent; background: transparent; border-radius: 4px; padding: 2px 6px; font: inherit; }
.bk14-grid td input:hover, .bk14-grid td select:hover, .bk14-grid td input:focus, .bk14-grid td select:focus { border-color: var(--line, #b9c4c0); background: var(--card, #fff); }
.bk14-grid .bk14-ch { background: #fff4c2 !important; border-color: #d9a406 !important; color: #111; }
.bk14-old { color: #a33; text-decoration: line-through; } .bk14-new { color: #17703f; font-weight: 600; }

/* ---------- V2.33 (Batch 17): dashboards (items 4, 6), material test calendar (item 5), 4D/5D suite (item 1) ---------- */
.d17-filters .card-b { padding: 10px 14px; }
.d17-filters select { min-width: 150px; }
.d17-k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.d17-k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.d17-kpi { position: relative; overflow: hidden; }
.d17-kpi::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: linear-gradient(180deg, var(--kx-green, #50d890), #4f98ca); opacity: .85; }
.d17-kpi .val { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.d17-click { cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.d17-click:hover, .d17-click:focus-visible { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(16, 46, 50, .12); outline: none; }
.d17-tr { font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 9px; white-space: nowrap; }
.d17-tr.good { color: var(--ok); background: var(--ok-bg); }
.d17-tr.bad { color: var(--danger); background: var(--danger-bg); }
.d17-tr.flat { color: var(--neutral); background: var(--neutral-bg); }
.d17-bca { font-size: 17px; }
.d17-card .card-h { gap: 8px; flex-wrap: wrap; }
.d17-cv { position: relative; width: 100%; }
@media (max-width: 1200px) { .d17-k5, .d17-k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .d17-k5, .d17-k6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .d17 .grid.g2 { grid-template-columns: 1fr; } .d17-filters select { min-width: 0; width: 100%; } }
.mt17-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mt17-h { font-size: 11px; font-weight: 700; color: var(--text-3); text-align: center; padding: 4px 0; }
.mt17-d { min-height: 86px; border: 1px solid var(--border); border-radius: 6px; padding: 4px; display: flex; flex-direction: column; gap: 3px; background: var(--surface); }
.mt17-d.off { background: transparent; border-style: dashed; opacity: .4; }
.mt17-d.today { border-color: var(--kx-green, #50d890); box-shadow: inset 0 0 0 1px var(--kx-green, #50d890); }
.mt17-d .n { font-size: 11px; font-weight: 700; color: var(--text-3); }
.mt17-ev { border: 0; border-radius: 4px; font-size: 10.5px; padding: 2px 4px; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral); }
.mt17-ev.b-ok { background: var(--ok-bg); color: var(--ok); } .mt17-ev.b-danger { background: var(--danger-bg); color: var(--danger); } .mt17-ev.b-warn { background: var(--warn-bg); color: var(--warn); } .mt17-ev.b-info { background: var(--info-bg); color: var(--info); }
@media (max-width: 700px) { .mt17-d { min-height: 54px; } .mt17-ev { font-size: 9px; } }
/* V2.33 (Batch 17 item 1): 4D / 5D Planning Suite field progress (phone-friendly cards) */
.s17-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:10px}
.s17-act{text-align:left;padding:12px;cursor:pointer;border:1px solid var(--line,#dde3ea);background:var(--card,#fff);display:flex;flex-direction:column;gap:4px;min-height:44px}
.s17-act:hover{border-color:var(--primary,#1f4e79)}
.s17-bar{height:8px;border-radius:4px;background:var(--line,#e5e9ef);overflow:hidden}
.s17-bar i{display:block;height:100%;background:var(--ok,#2e7d32)}
.s17-fm .f{display:block;margin-bottom:10px}.s17-fm input[type=range]{width:80%;vertical-align:middle}
@media (max-width:600px){.s17-cards{grid-template-columns:1fr}.s17-field select{flex:1 1 45%}}
/* V2.33: dashboard cards shrink with the window (a drawn chart must not hold its grid column open when the window narrows) */
.d17-card, .d17-kpi { min-width: 0; }
.d17-cv canvas { max-width: 100%; }
/* V2.35 (Batch 19 items 3 and 4): the project list of the top bar: resizable, long names wrap, edit pencil */
.kxs-pop[data-kxs-rs] { position: fixed; }
.kxs-pop[data-kxs-rs] .kxs-list { min-height: 60px; }
.kxs-rz { position: absolute; z-index: 2; }
.kxs-rz-e { top: 0; right: 0; width: 7px; height: calc(100% - 12px); cursor: ew-resize; }
.kxs-rz-s { left: 0; bottom: 0; height: 7px; width: calc(100% - 12px); cursor: ns-resize; }
.kxs-rz-se { right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, var(--border-strong, #9aa) 50%, var(--border-strong, #9aa) 60%, transparent 60%, transparent 70%, var(--border-strong, #9aa) 70%, var(--border-strong, #9aa) 80%, transparent 80%); }
.kxs-rz:hover { background-color: color-mix(in srgb, var(--kx-green, #50d890) 25%, transparent); }
.kxs-prj .kxs-o { overflow-wrap: anywhere; word-break: normal; }
.kxs-o.kxs-ox { display: flex; align-items: flex-start; gap: 6px; }
.kxs-o.kxs-ox .kxs-t { flex: 1 1 auto; min-width: 0; }
.kxs-act { flex: 0 0 auto; border: 1px solid transparent; background: transparent; border-radius: 6px; width: 26px; height: 24px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-2, inherit); padding: 0; }
.kxs-act svg { width: 14px; height: 14px; }
.kxs-act:hover, .kxs-act:focus-visible { border-color: var(--border); background: var(--surface-2, #eef); color: var(--text, inherit); }
/* V2.35 (Batch 19 item 2): concrete grades, a member row linked "Same as above" */
.g15 tr.g19-linked td { background: color-mix(in srgb, var(--kx-green, #50d890) 7%, transparent); }
.g15 tr.g19-linked select:disabled, .g15 tr.g19-linked input:disabled { opacity: .75; }

/* V2.41.2: toasts never under the AI Assistant / Running tasks / a window's button bar (placement: js/core/toast41.js).
   The stack is drawn above them and every message wraps in full; a long stack scrolls instead of running off the screen. */
.toasts { z-index: 1300; overflow-y: auto; overflow-x: hidden; pointer-events: none; padding: 2px; }
.toasts > .toast { pointer-events: auto; max-width: min(440px, calc(100vw - 24px)); box-sizing: border-box; overflow-wrap: anywhere; word-break: normal; white-space: normal; flex: none; }
.toasts > .toast .kx-t-m { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }
@media print { .toasts { display: none; } }
