/* Altekore Time — the dashboard. Same direction as the sample (web/sample.html): a night-blue band carries the company
   and the headline; the work area is calm paper with hairline structure. Hours in a book serif, clock times in a mono
   face, the day drawn as lanes, one per app. Colours are the sample's validated activity palette. */
:root {
  --night: #0f1833; --night-2: #18234a; --night-3: #26335f; --night-ink: #eef1fa; --night-ink-2: #a2abc8;
  --paper: #f3f4f7; --surface: #ffffff; --surface-2: #f8f9fb; --sunk: #eceef3;
  --line: #e1e4eb; --line-2: #edeff4;
  --ink: #111a30; --ink-2: #4a546d; --ink-3: #737c93;
  --brand: #2a5bd7; --brand-2: #1f49b8; --brand-soft: #e8eefc; --on-brand: #ffffff;
  --c-prod: #2a78d6; --c-neutral: #1baf7a; --c-unprod: #eb6834; --c-flag: #6250d6;
  --c-break: #b8bfcd; --c-off: #d6453f; --c-move: #e0a23a; --c-lock: #8790a6;
  --green: #12805c; --green-soft: #dcf2e9; --amber: #9a5a05; --amber-soft: #fbefdc; --brick: #b42318; --brick-soft: #fbe8e6;
  --outlier: #6250d6; --outlier-soft: #ece9fb;
  --shadow: 0 1px 2px rgba(17,26,48,.05), 0 10px 30px -18px rgba(17,26,48,.22);
  --f-display: "Newsreader", Georgia, serif;
  --f-ui: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Menlo, monospace;
  --r-s: 7px; --r: 14px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --night: #090f22; --night-2: #141d3c; --night-3: #212c55;
  --paper: #0c1222; --surface: #131b30; --surface-2: #172039; --sunk: #0f1629; --line: #252f4d; --line-2: #1c2541;
  --ink: #e9edf7; --ink-2: #b2bace; --ink-3: #8b94ac;
  --brand: #8ea7f6; --brand-2: #a8bbfa; --brand-soft: #1b2650; --on-brand: #0b1120;
  --c-prod: #3987e5; --c-neutral: #199e70; --c-unprod: #d95926; --c-flag: #9085e9; --c-break: #3a4565; --c-off: #e66767;
  --c-move: #c98c2a; --c-lock: #5b6584;
  --green: #4cc79f; --green-soft: #10312a; --amber: #f0b453; --amber-soft: #33260f; --brick: #f1877c; --brick-soft: #3a1915;
  --outlier: #a99ff0; --outlier-soft: #221d45;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -18px rgba(0,0,0,.6); color-scheme: dark; } }
:root[data-theme="dark"] {
  --night: #090f22; --night-2: #141d3c; --night-3: #212c55;
  --paper: #0c1222; --surface: #131b30; --surface-2: #172039; --sunk: #0f1629; --line: #252f4d; --line-2: #1c2541;
  --ink: #e9edf7; --ink-2: #b2bace; --ink-3: #8b94ac;
  --brand: #8ea7f6; --brand-2: #a8bbfa; --brand-soft: #1b2650; --on-brand: #0b1120;
  --c-prod: #3987e5; --c-neutral: #199e70; --c-unprod: #d95926; --c-flag: #9085e9; --c-break: #3a4565; --c-off: #e66767;
  --c-move: #c98c2a; --c-lock: #5b6584;
  --green: #4cc79f; --green-soft: #10312a; --amber: #f0b453; --amber-soft: #33260f; --brick: #f1877c; --brick-soft: #3a1915;
  --outlier: #a99ff0; --outlier-soft: #221d45;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 30px -18px rgba(0,0,0,.6); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.55 var(--f-ui); -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
h1, h2, h3 { text-wrap: balance; margin: 0; }
a { color: var(--brand); }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 900px) { .wrap { padding: 0 36px; } }

/* ---------- band ---------- */
.band { background: var(--night); color: var(--night-ink); }
.band .bar { display: flex; align-items: center; gap: 14px; min-height: 60px; flex-wrap: wrap; }
.band .co { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.band .co img, .band .co .mk { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; background: var(--night-2); flex: none; }
.band .co span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.band nav { display: flex; gap: 2px; flex-wrap: wrap; }
.band nav a { color: var(--night-ink-2); text-decoration: none; padding: 7px 12px; border-radius: 8px; font-weight: 500; font-size: 14px; }
.band nav a:hover { color: var(--night-ink); background: var(--night-2); }
.band nav a.on { color: var(--night-ink); background: var(--night-3); }
.band nav a .count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--c-flag); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.band .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.band select, .band .who { background: var(--night-2); border: 1px solid var(--night-3); color: var(--night-ink); border-radius: 8px; padding: 6px 10px; font-size: 13.5px; }
.band .who { cursor: pointer; }
.head { padding: 26px 0 22px; display: flex; gap: 20px; align-items: flex-end; flex-wrap: wrap; }
.head h1 { font: 500 34px/1.1 var(--f-display); letter-spacing: -.01em; }
.head p { margin: 6px 0 0; color: var(--night-ink-2); }
.head .ctl { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn-n { background: var(--night-2); border: 1px solid var(--night-3); color: var(--night-ink); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 14px; }
.btn-n:hover { background: var(--night-3); }
.btn-n[disabled] { opacity: .4; cursor: default; }
.band input[type=date] { background: var(--night-2); border: 1px solid var(--night-3); color: var(--night-ink); border-radius: 8px; padding: 6px 10px; color-scheme: dark; }

/* ---------- page ---------- */
main { padding: 22px 0 60px; }
.grid { display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px 20px; min-width: 0; }
.card h2 { font: 600 15px/1.3 var(--f-ui); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h2 .muted { font-weight: 400; font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; }
.kpi .l { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.kpi .v { font: 500 28px/1.15 var(--f-display); margin-top: 4px; }
.kpi .v small { font: 400 14px var(--f-ui); color: var(--ink-3); }
.kpi .s { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.meter { height: 6px; border-radius: 3px; background: var(--sunk); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--c-prod); border-radius: 3px; }
.two { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.two { align-items: start; }
@media (min-width: 1000px) { .two { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.empty { padding: 34px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink-2); font-size: 16px; margin-bottom: 4px; }

/* ---------- day lanes ---------- */
.lanes { position: relative; }
.lane { display: grid; grid-template-columns: 150px minmax(0, 1fr) 64px; align-items: center; height: 30px; border-top: 1px solid var(--line-2); }
.lane:first-child { border-top: 0; }
.lane .nm { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 10px; display: flex; gap: 7px; align-items: center; }
.lane .nm i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.lane .tr { position: relative; height: 18px; }
.lane .tt { font-size: 12.5px; text-align: right; color: var(--ink-2); }
.seg { position: absolute; top: 0; bottom: 0; border-radius: 3px; min-width: 2px; cursor: pointer; }
.seg:hover, .seg.sel { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 2; }
.seg.productive { background: var(--c-prod); } .seg.neutral { background: var(--c-neutral); } .seg.unproductive { background: var(--c-unprod); }
.seg.meeting { background: var(--c-flag); }
.seg.idle { background: repeating-linear-gradient(135deg, var(--c-break) 0 4px, transparent 4px 7px); border: 1px solid var(--c-break); }
.seg.movement_only { background: repeating-linear-gradient(135deg, var(--c-move) 0 4px, transparent 4px 7px); border: 1px solid var(--c-move); }
.seg.locked { background: var(--c-lock); opacity: .55; }
.seg.paused { background: var(--sunk); border: 1px dashed var(--ink-3); }
.seg.marked { background: var(--c-flag); opacity: .75; }
.seg.flag { background: transparent; border: 2px dashed var(--c-flag); top: -3px; bottom: -3px; pointer-events: none; }
.axis { display: grid; grid-template-columns: 150px minmax(0, 1fr) 64px; height: 24px; }
.axis .tr { position: relative; }
.axis span { position: absolute; transform: translateX(-50%); font-size: 11.5px; color: var(--ink-3); top: 4px; white-space: nowrap; }
.axis span::before { content: ""; position: absolute; left: 50%; top: -6px; height: 4px; border-left: 1px solid var(--line); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin-top: 12px; }
.legend i { display: inline-block; width: 12px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
@media (max-width: 640px) {
  .lane, .axis { grid-template-columns: 92px minmax(0, 1fr) 46px; }
  .lane .nm { font-size: 12px; }
}
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--night); color: var(--night-ink); border-radius: 8px; padding: 8px 10px;
  font-size: 12.5px; max-width: 320px; box-shadow: var(--shadow); }
.tip b { display: block; }
.tip .muted { color: var(--night-ink-2); }

/* ---------- inspector, forms ---------- */
.insp { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.insp dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 8px 0 0; font-size: 13.5px; }
.insp dt { color: var(--ink-3); }
.insp dd { margin: 0; overflow-wrap: anywhere; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 13px; cursor: pointer; font-weight: 500; font-size: 14px; }
.btn:hover { background: var(--surface-2); }
.btn.pri { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.pri:hover { background: var(--brand-2); }
.btn.on { background: var(--brand-soft); border-color: var(--brand); }
.btn[disabled] { opacity: .5; cursor: default; }
.field { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.field input, .field select, .field textarea { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; font-weight: 400; color: var(--ink); }
.form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); align-items: end; min-width: 0; }
.form .field, .form input, .form select { min-width: 0; width: 100%; }
.form .wide { grid-column: 1 / -1; }
.msg { font-size: 13.5px; margin-top: 8px; } .msg.err { color: var(--brick); } .msg.ok { color: var(--green); }

/* ---------- lists ---------- */
.list { display: grid; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 0; border-top: 1px solid var(--line-2); align-items: center; }
.item:first-child { border-top: 0; }
.item .t { font-weight: 500; }
.item .d { font-size: 13px; color: var(--ink-2); grid-column: 1 / -1; }
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); }
.pill.open { background: var(--amber-soft); color: var(--amber); }
.pill.accepted { background: var(--green-soft); color: var(--green); }
.pill.declined, .pill.withdrawn { background: var(--brick-soft); color: var(--brick); }
.pill.outlier { background: var(--outlier-soft); color: var(--outlier); }
.bars .b { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr) 70px; gap: 10px; align-items: center; padding: 5px 0; font-size: 13.5px; }
.bars .b .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars .b .tk { height: 10px; background: var(--sunk); border-radius: 5px; overflow: hidden; }
.bars .b .tk i { display: block; height: 100%; border-radius: 5px; }
.bars .b .v { text-align: right; font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2); }

/* ---------- team roster ---------- */
.roster { width: 100%; border-collapse: collapse; font-size: 14px; }
.roster th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.roster td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.roster tr.p { cursor: pointer; }
.roster tr.p:hover td { background: var(--surface-2); }
.roster .nm { display: flex; gap: 10px; align-items: center; min-width: 160px; }
.roster .nm small { display: block; color: var(--ink-3); font-size: 12px; }
.roster .num { text-align: right; font-family: var(--f-mono); font-size: 13px; white-space: nowrap; }
.wvx { position: relative; height: 8px; background: var(--sunk); border-radius: 4px; min-width: 110px; }
.wvx i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--c-prod); }
.wvx b { position: absolute; top: -3px; bottom: -3px; border-left: 2px solid var(--ink); }
.scroll { overflow-x: auto; }
.av { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; flex: none; }

/* ---------- trend ---------- */
.trend { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 10px; }
.trend .c { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; height: 100%; position: relative; }
.trend .c i { width: 100%; max-width: 34px; background: var(--c-prod); border-radius: 4px 4px 0 0; }
.trend .c i.p { background: var(--c-neutral); }
.trend .c span { font-size: 10.5px; color: var(--ink-3); margin-top: 4px; white-space: nowrap; }
.trend .exp { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--ink-3); }

/* ---------- sign in ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--night); }
.auth .card { width: min(420px, 100%); padding: 28px; }
.auth h1 { font: 500 28px/1.2 var(--f-display); margin: 14px 0 6px; }
.auth p { color: var(--ink-2); margin: 0 0 14px; }
.auth .field { margin-top: 12px; }
.auth .btn { width: 100%; margin-top: 16px; padding: 11px; }
.auth .link { background: none; border: 0; color: var(--brand); cursor: pointer; padding: 0; margin-top: 12px; font-size: 13.5px; }
footer.foot { text-align: center; font-size: 12.5px; color: var(--ink-3); padding: 20px 0 30px; }
a.btn { text-decoration: none; color: inherit; display: inline-block; }
a.btn.on { color: var(--ink); }
tr.left td { opacity: .55; }

/* Altekore Practice additions */
.pill.ok { background: var(--green-soft); color: var(--green); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--line, #e5e7eb); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line, #e5e7eb); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) { .tbl { font-size: 13px; } .tbl th, .tbl td { padding: 8px 6px; } }

/* ---------- step 7a: tabs, People, dialogs ---------- */
.band .tabs { display: flex; gap: 4px; margin-top: -6px; overflow-x: auto; }
.band .tabs a { color: var(--night-ink-2); text-decoration: none; padding: 10px 14px; font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.band .tabs a:hover { color: var(--night-ink); }
.band .tabs a.on { color: var(--night-ink); border-bottom-color: #8a9cff; }
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.toolbar input[type=search] { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 7px 10px; min-width: 0; width: min(280px, 100%); }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.chk input { margin-top: 3px; }
.tbl.people tr.p { cursor: pointer; }
.tbl.people tr.p:hover td, .tbl.people tr.p:focus td { background: var(--surface-2); }
.tbl.people td small { display: block; color: var(--ink-3); font-size: 12.5px; overflow-wrap: anywhere; }
.tbl.people td:first-child { min-width: 170px; }
.pill.open { background: var(--amber-soft); color: var(--amber); }
.note { background: var(--amber-soft); color: var(--amber); border-radius: var(--r-s); padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.dlg { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.dlg::backdrop { background: rgba(9, 15, 34, .55); }
.dform { display: grid; gap: 12px; padding: 22px; }
.dform h2 { font: 500 22px/1.25 var(--f-display); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dform > p { margin: -6px 0 0; }
.row.end { justify-content: flex-end; margin-top: 4px; }
.row .sp { flex: 1; }
.btn.danger { color: var(--brick); border-color: var(--brick-soft); }
.linkbox { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px; font-size: 13.5px; }
.linkbox p { margin: 0 0 8px; }
.linkbox input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: 12.5px var(--f-mono); background: var(--surface); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.facts dt { color: var(--ink-3); } .facts dd { margin: 0; }
@media (max-width: 700px) { .tbl.people .w { display: none; } }

/* ---------- step 7b: org chart, teams & levels ---------- */
.small { font-size: 12.5px; }
.note.ok { background: var(--green-soft); color: var(--green); }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.item.off .t { color: var(--ink-3); }
.addrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.addrow input { flex: 1 1 140px; min-width: 0; border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 7px 10px; }
.levels { list-style: none; margin: 0; padding: 0; }
.levels li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.levels li:first-child { border-top: 0; }
.levels .rk { width: 24px; height: 24px; border-radius: 6px; background: var(--sunk); display: inline-grid; place-items: center; font-size: 12px; color: var(--ink-2); flex: none; }
.levels .t { font-weight: 500; flex: 1; min-width: 0; }
.form.two-up { grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); }
fieldset.leads { border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 12px 10px; margin: 0; display: grid; gap: 6px; max-height: 220px; overflow: auto; }
fieldset.leads legend { font-size: 13px; color: var(--ink-2); font-weight: 500; padding: 0 4px; }
.org, .org ul { list-style: none; margin: 0; padding: 0; }
.org ul { margin-left: 22px; padding-left: 18px; border-left: 1.5px solid var(--line); }
.org li { position: relative; padding: 5px 0; }
.org ul > li::before { content: ""; position: absolute; left: -18px; top: 27px; width: 16px; border-top: 1.5px solid var(--line); }
.org .node { display: inline-flex; align-items: center; gap: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; max-width: 100%; }
.org .node.me { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.org .node .av { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; flex: none; }
.org .who { min-width: 0; }
.org .who b { display: block; font-weight: 600; font-size: 14px; }
.org .who small { color: var(--ink-3); font-size: 12.5px; }
.org .tog { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; min-width: 28px; height: 24px; padding: 0 7px; cursor: pointer; font-size: 12px; color: var(--ink-2); flex: none; }
@media (max-width: 640px) { .org ul { margin-left: 10px; padding-left: 12px; } .org ul > li::before { left: -12px; width: 10px; } }
select.btn-n { appearance: auto; }

/* ---------- step 8: clients, sensitive data, reveal log ---------- */
a.item.link { text-decoration: none; color: inherit; grid-template-columns: minmax(0, 1fr) auto; }
a.item.link:hover .t { color: var(--brand); }
.crumb { margin: 0 0 4px !important; font-size: 13.5px; }
.crumb a { color: var(--night-ink-2); }
.tbl.sens td small, .tbl.log td small { display: block; color: var(--ink-3); font-size: 12.5px; }
.tbl.sens td.acts { text-align: right; white-space: nowrap; }
.tbl.sens td.acts .btn + .btn { margin-left: 6px; }
.nowrap { white-space: nowrap; }
.reveal { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 12px 14px; }
.reveal .mono { font-size: 18px; flex: 1; overflow-wrap: anywhere; }
@media (max-width: 700px) { .tbl.sens .w { display: none; } .tbl.sens td.acts { white-space: normal; } .tbl.sens td.acts .btn { margin: 2px 0 2px 4px; } }

/* ---------- step 9: audit ---------- */
.seg2 { display: inline-flex; background: var(--night-2); border: 1px solid var(--night-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg2 a { color: var(--night-ink-2); text-decoration: none; padding: 5px 12px; border-radius: 7px; font-size: 13.5px; font-weight: 500; }
.seg2 a.on { background: var(--night-3); color: var(--night-ink); }
.form.filters { margin-bottom: 14px; grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
.toolbar .push { margin-left: auto; }
.tbl.audit td:first-child { width: 1%; }
.diff { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }
.diff b { font-weight: 600; color: var(--ink-2); margin-right: 4px; }
@media (max-width: 700px) { .tbl.audit th:first-child, .tbl.audit td:first-child { white-space: normal; } }

/* ---------- B2 step 4: clients list, client 360 ---------- */
.toolbar.wrap select { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 7px 10px; max-width: 100%; }
.tbl.clients tr.p, .tbl.clients tr.p td { cursor: pointer; }
.tbl.clients tr.p:hover td, .tbl.clients tr.p:focus td { background: var(--surface-2); }
.tbl td small { display: block; color: var(--ink-3); font-size: 12.5px; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl td.acts { text-align: right; white-space: nowrap; }
.tbl td.acts .btn + .btn { margin-left: 6px; }
@media (max-width: 700px) { .tbl.clients .w, .tbl.ents .w, .tbl.conts .w { display: none; } .tbl td.acts { white-space: normal; } }
.head p .pill { margin-left: 4px; }
.ctabs { display: flex; gap: 4px; margin: 0 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.ctabs a { padding: 9px 12px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ctabs a.on { color: var(--ink); border-bottom-color: var(--brand); }
.ctabs a small { color: var(--ink-3); font-weight: 400; }
.card h2 a { margin-left: auto; font-weight: 400; }
.dlg .dform.wide { width: auto; }
.dlg:has(.dform.wide) { width: min(720px, calc(100vw - 32px)); }
fieldset.group { border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 12px 12px; margin: 0; }
fieldset.group legend { font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 0 4px; }
.field.wide { grid-column: 1 / -1; }
.noteform { display: grid; gap: 8px; margin-bottom: 16px; }
.noteform textarea, .dform textarea { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 8px 10px; font: inherit; resize: vertical; }
.notes { display: grid; gap: 10px; }
.note { border: 1px solid var(--line-2); border-radius: var(--r-s); padding: 10px 12px; background: var(--surface-2); }
.note.pinned { border-color: var(--amber); background: var(--amber-soft); }
.note p { margin: 0 0 6px; white-space: pre-wrap; overflow-wrap: anywhere; }
.row .push, .row.small .push { margin-left: auto; }
/* B2 step 5 */
.tbl.svcs td small, .tbl.cat td small { display: block; color: var(--ink-3); font-size: 12.5px; }
@media (max-width: 700px) { .tbl.svcs .w { display: none; } }
.form.two-up input:disabled, .form.two-up select:disabled { opacity: .75; }
/* B2 step 6: import */
a.btn-n { text-decoration: none; display: inline-block; }
.head .ctl { gap: 8px; }
.tbl.mapping select { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 6px 8px; max-width: 100%; }
.row.chips { gap: 6px; margin-bottom: 12px; }
.tbl.preview .err { color: var(--brick); }
.tbl.runs details ul { margin: 6px 0 0; padding-left: 18px; }
input[type=file] { max-width: 100%; }
/* B2 step 7: timeline */
.seg3 { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 2px; gap: 2px; background: var(--surface-2); flex-wrap: wrap; }
.seg3 button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--ink-2); }
.seg3 button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.timeline { list-style: none; margin: 8px 0 12px; padding: 0; }
.timeline .tl-day { font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin: 14px 0 6px; }
.timeline .tl { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; padding: 6px 0; position: relative; }
.timeline .tl::before { content: ""; position: absolute; left: 6px; top: 18px; bottom: -6px; border-left: 1.5px solid var(--line); }
.timeline .tl .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c-break); margin-top: 4px; position: relative; z-index: 1; }
.timeline .tl .dot.added { background: var(--green); } .timeline .tl .dot.removed { background: var(--brick); } .timeline .tl .dot.changed { background: var(--brand); }
.timeline .note-ev .dot { background: var(--amber); } .timeline .reveal-ev .dot { background: var(--outlier); }
.timeline .tl-h { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.timeline .tl-body { margin: 4px 0 0; white-space: pre-wrap; font-size: 14px; overflow-wrap: anywhere; }
.timeline .diff { margin-top: 4px; }

/* templates (B3) */
.steps { display: grid; gap: 8px; margin: 4px 0 10px; }
.step { border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px; background: var(--surface-2); display: grid; gap: 6px; }
.srow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.srow input, .srow select { border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 6px 8px; font: inherit; color: var(--ink); min-width: 0; }
.srow .st, .srow .qn { flex: 1 1 200px; font-weight: 600; }
.srow.sub { font-size: 13.5px; }
.srow .ss { flex: 1 1 120px; }
.srow .off { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); }
.srow .so { width: 70px; }
.srow .mv { display: inline-flex; gap: 4px; margin-left: auto; }
.due { padding: 10px 12px; border-radius: var(--r-s); background: var(--brand-soft); color: var(--ink); }
.due b { font-weight: 600; }
.form .chk input { width: auto; flex: none; }

/* jobs (B3) */
.picks { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-s); padding: 8px 10px; display: grid; gap: 6px;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }
.dform.wide { width: min(720px, 92vw); }
h3.sec { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin: 14px 0 6px; }
.jstep .t { font-weight: 600; color: var(--ink); }
.jstep.done .t { text-decoration: line-through; color: var(--ink-3); }
.jstep .chk { font-size: 14px; }
.hist { display: grid; gap: 8px; font-size: 13.5px; }
.hist .ev small { display: block; color: var(--ink-3); }
.tbl tr.pj { cursor: pointer; }
.tbl tr.pj:hover td { background: var(--surface-2); }
.tbl.jobs tr.p, .tbl.tpls tr.p, .tbl tr[data-job] { cursor: pointer; }
.tbl.jobs tr.p:hover td, .tbl.tpls tr.p:hover td, .tbl tr[data-job]:hover td { background: var(--surface-2); }

/* ---------- B4: tasks, the bell, views ---------- */
.band .bell { position: relative; display: inline-flex; align-items: center; padding: 6px 8px; }
.band .bell .count { position: absolute; top: -6px; right: -6px; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--c-flag); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 600; }
.card .seg2 { background: var(--sunk); border-color: var(--line); }
.card .seg2 a { color: var(--ink-2); }
.card .seg2 a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(17,26,48,.08); }
.tbl.tasks td.tick, .tbl.tasks th.tick { width: 28px; padding-right: 0; }
.tbl.tasks tr.tk { cursor: pointer; }
.tbl.tasks tr.tk:hover td { background: var(--surface-2); }
.tbl.tasks tr.sub td:nth-child(2), .tbl.tasks tr.sub td:nth-child(3) { padding-left: 26px; }
.tbl.tasks tr.grp td { background: var(--surface-2); font-weight: 600; font-size: 13.5px; }
.tbl.tasks.wide td, .tbl.tasks.wide th { white-space: nowrap; }
.tgroup + .tgroup { margin-top: 16px; }
.av { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 10.5px; font-weight: 600; margin-right: -4px; border: 2px solid var(--surface); vertical-align: middle; }
.bulkbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; margin: 4px 0 10px; border-radius: 10px; background: var(--brand-soft); }
.bulkbar select, .bulkbar input { border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; background: var(--surface); }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.bcol { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px; min-height: 120px; }
.bcol.over { outline: 2px dashed var(--brand); }
.bcol h3 { font-size: 13.5px; margin: 0 0 8px; }
.bcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; margin-bottom: 8px; cursor: grab; box-shadow: var(--shadow); }
.bcard.late { border-left: 3px solid var(--brick); }
.bcard.dragging { opacity: .5; }
.bcard b { display: block; font-weight: 600; font-size: 14px; }
.bcard small { display: block; color: var(--ink-3); font-size: 12px; margin-bottom: 6px; }
.cal { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cal-h, .cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-h span { padding: 6px 8px; font-size: 12px; color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-g .cell { min-height: 96px; padding: 4px 6px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-g .cell:nth-child(7n) { border-right: 0; }
.cal-g .cell.out { background: var(--surface-2); color: var(--ink-3); }
.cal-g .cell.now .dn { background: var(--brand); color: var(--on-brand); border-radius: 50%; }
.cal-g .cell.over { background: var(--brand-soft); }
.cal .dn { font-size: 12px; width: 22px; height: 22px; display: grid; place-items: center; }
.cal .chip { display: block; font-size: 12px; padding: 1px 6px; border-radius: 5px; background: var(--brand-soft); color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .chip.late { background: var(--brick-soft); color: var(--brick); }
.cal .chip.done { opacity: .55; text-decoration: line-through; }
.cal .more { color: var(--ink-3); }
@media (max-width: 700px) { .cal-g .cell { min-height: 64px; } .cal .chip { font-size: 10.5px; } }
.gantt { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.gantt svg { display: block; font: 12px var(--f-ui); }
.gantt .g-we { fill: var(--surface-2); }
.gantt .g-m { fill: var(--ink-2); font-weight: 600; }
.gantt .g-d { fill: var(--ink-3); font-size: 10.5px; }
.gantt .g-sep, .gantt .g-row { stroke: var(--line-2); }
.gantt .g-l a { fill: var(--ink); }
.gantt .g-bar { fill: var(--c-prod); cursor: grab; }
.gantt .g-bar.done { fill: var(--c-neutral); opacity: .7; }
.gantt .g-bar.waiting, .gantt .g-bar.review { fill: var(--c-flag); }
.gantt .g-bar.not_started { fill: var(--c-lock); }
.gantt .g-bar.late { fill: var(--c-off); }
.gantt .g-end { fill: transparent; cursor: ew-resize; }
.gantt .dragging { opacity: .7; }
.gantt .g-link { fill: none; stroke: var(--ink-3); stroke-width: 1.4; }
.gantt .g-arrow { fill: var(--ink-3); }
.gantt .g-now { stroke: var(--brick); stroke-width: 1.5; stroke-dasharray: 3 3; }
.pre { white-space: pre-wrap; }
.cms { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.cm { border-top: 1px solid var(--line-2); padding-top: 10px; }
.cm .cm { margin: 10px 0 0 26px; border-top: 0; padding-top: 0; }
.cmh { display: flex; align-items: center; gap: 8px; }
.cmh small { color: var(--ink-3); }
.cmb { margin: 4px 0 4px 32px; white-space: pre-wrap; }
.cmb .mention { color: var(--brand); }
.btn.link { background: none; border: 0; color: var(--brand); padding: 0 0 0 32px; }
.cform textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: var(--surface); resize: vertical; }
.cform .row { margin-top: 6px; }
.cform select { border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; background: var(--surface); }
.nlist { display: flex; flex-direction: column; max-height: 60vh; overflow: auto; margin: 10px 0; }
.nrow { display: grid; gap: 2px; padding: 10px 8px; border-top: 1px solid var(--line-2); text-decoration: none; color: inherit; border-radius: 6px; }
.nrow:hover { background: var(--surface-2); }
.nrow.un { background: var(--brand-soft); }
.nrow .nk { font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.nrow .nb { color: var(--ink-2); font-size: 13.5px; }
.nrow small { color: var(--ink-3); }
.strow { margin-bottom: 6px; flex-wrap: nowrap; }
.strow input[name=n], .strow select { border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; background: var(--surface); min-width: 0; }
.strow input[type=color] { width: 34px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: none; }
.mono.ok { color: var(--green); } .mono.err { color: var(--brick); }
.picks.small { max-height: 160px; }

/* ---------- B5: review and sign-off ---------- */
.chain { list-style: none; margin: 12px 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; counter-reset: lvl; }
.chain li { flex: 1 1 160px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; background: var(--surface-2); position: relative; }
.chain li::before { counter-increment: lvl; content: counter(lvl); position: absolute; top: 8px; right: 10px; font-size: 11px; color: var(--ink-3); }
.chain li b { font-size: 14px; }
.chain li span:not(.pill) { font-size: 13px; color: var(--ink-2); }
.chain li .pill { justify-self: start; margin-top: 2px; }
.chain li.open { border-color: var(--amber); background: var(--amber-soft); }
.chain li.signed { border-color: var(--green-soft); }
.chain li.returned { border-color: var(--brick-soft); }
.rnote .ans { margin-top: 4px; color: var(--ink); }
.rnote.done .t { color: var(--ink-3); text-decoration: line-through; }
.lvrow .lvn { width: 22px; height: 22px; border-radius: 50%; background: var(--sunk); display: grid; place-items: center; font-size: 12px; flex: none; }
.lvrow .ln { flex: 1; }

/* ---------- B6: requests, documents, the portal ---------- */
.reqs { display: flex; flex-direction: column; gap: 10px; }
.req { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.req summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.req .list { margin: 8px 0; }
.req select { border: 1px solid var(--line); border-radius: 7px; padding: 3px 6px; background: var(--surface); }
.linkbox input { width: 100%; font: 12.5px var(--f-mono); padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
body.portal .band .head h1 { font-size: 30px; }
.preq { margin-bottom: 16px; }
.pitem .msg { grid-column: 1 / -1; margin: 0; }
.naf { grid-column: 1 / -1; margin-top: 6px; }
.naf input { border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; }
@media print { .band nav, .band .right, .tabs, .ctl, .toolbar button, .btn, footer { display: none !important; } .band { background: none; color: #000; } .card { box-shadow: none; break-inside: avoid; } }

/* ---------- B7: time and capacity ---------- */
.timer .toolbar { gap: 10px; }
.tbl.sheet th small { display: block; color: var(--ink-3); font-weight: 400; }
.tbl.sheet tfoot td { font-weight: 600; border-top: 1px solid var(--line); }
.tent { display: inline-block; padding: 1px 6px; border-radius: 6px; text-decoration: none; color: var(--ink); background: var(--sunk); font-variant-numeric: tabular-nums; font-size: 13px; }
.tent.submitted { background: var(--amber-soft); color: var(--amber); }
.tent.approved { background: var(--green-soft); color: var(--green); }
.tent.rejected { background: var(--brick-soft); color: var(--brick); }
.appr { border-top: 1px solid var(--line-2); padding-top: 8px; margin-top: 8px; }
.meter { height: 10px; border-radius: 6px; background: var(--sunk); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--c-prod); }
.meter.near span { background: var(--c-move); }
.meter.over span { background: var(--c-off); }
.cap .ch { width: 56px; text-align: right; border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.cap .wdays { white-space: nowrap; }
.cap .wdays label { display: inline-flex; flex-direction: column; align-items: center; font-size: 11px; margin-right: 2px; }
.cap select { border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; background: var(--surface); }

/* ---------- B8: dashboards and reports ---------- */
.rep .toolbar select { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--surface); color: var(--ink); margin-left: 4px; }
.rep td.bar { width: 28%; min-width: 80px; white-space: nowrap; }
.rep td.bar span { display: inline-block; height: 8px; background: var(--c-prod); vertical-align: middle; }
.rep td.bar span.late { background: var(--c-off); border-radius: 4px 0 0 4px; }
.rep tr.sub > td { border-top: 0; padding-top: 0; }
.rep tr.sub summary { cursor: pointer; color: var(--ink-3); font-size: 12.5px; }
.rep .neg { color: var(--brick); font-weight: 600; }
.gc { display: inline-block; padding: 2px 7px; border-radius: 6px; font-size: 12px; text-decoration: none; white-space: nowrap; background: var(--sunk); color: var(--ink-2); }
.gc.ok { background: var(--green-soft); color: var(--green); }
.gc.rev { background: var(--amber-soft); color: var(--amber); }
.gc.wip { background: color-mix(in srgb, var(--c-prod) 18%, transparent); color: var(--ink); }
.gc.late { background: var(--brick-soft); color: var(--brick); font-weight: 600; }
.gc.off { text-decoration: line-through; }
.rep .legend { margin: 0 0 0 auto; }
.sgrid td, .sgrid th { text-align: center; } .sgrid td:first-child, .sgrid th:first-child { text-align: left; position: sticky; left: 0; background: var(--surface); }
.wl td small { display: block; color: var(--ink-3); font-size: 11px; }
.wc { display: inline-block; min-width: 46px; padding: 2px 6px; border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.wc.low { background: var(--sunk); color: var(--ink-2); }
.wc.mid { background: color-mix(in srgb, var(--c-prod) 18%, transparent); color: var(--ink); }
.wc.full { background: var(--amber-soft); color: var(--amber); }
.wc.over { background: var(--brick-soft); color: var(--brick); }
.ages { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.age, .tile { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink); background: var(--surface-2); }
.age b, .tile b { font-size: 22px; font-variant-numeric: tabular-nums; }
.age span, .tile span { font-size: 12.5px; color: var(--ink-2); }
.age.warn, .tile.warn { border-color: var(--brick); background: var(--brick-soft); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
@media (max-width: 560px) { .ages { grid-template-columns: repeat(2, 1fr); } }
@media print { .rep details { display: block; } .rep details > * { display: block; } .rep tr.sub summary { display: none; } nav.ctabs { display: none; } }

/* ---------- B9: compliance ---------- */
.sugh { font-size: 14px; margin: 14px 0 6px; color: var(--ink-2); }
.item.sug .d { font-size: 12.5px; }
.xlist { max-height: 220px; overflow: auto; border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 8px; }
.tbl.udin .mono, .field input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .02em; }

/* ---------- B10: CRM and proposals ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.bcol { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px; min-height: 120px; }
.bcol h3 { font-size: 13px; margin: 0 0 8px; color: var(--ink-2); }
.bcol.won { background: var(--green-soft); } .bcol.lost { opacity: .75; }
.lcard { display: flex; flex-direction: column; gap: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; margin-bottom: 8px; text-decoration: none; color: var(--ink); }
.lcard:hover { border-color: var(--brand); }
.lcard span { font-size: 12.5px; color: var(--ink-2); } .lcard small { color: var(--ink-3); font-size: 11.5px; } .lcard .row { gap: 4px; flex-wrap: wrap; }
.seg2 { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg2 button { border: 0; background: var(--surface); padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.seg2 button.on { background: var(--sunk); color: var(--ink); font-weight: 600; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; } .kv dt { color: var(--ink-3); } .kv dd { margin: 0; }
.logf textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font: inherit; margin: 6px 0; background: var(--surface); color: var(--ink); }
.logf select, .logf input { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; background: var(--surface); color: var(--ink); }
.list.log .item .d { white-space: pre-wrap; }
.plines input, .plines select { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.plines .idesc { display: block; width: 100%; margin-top: 4px; min-width: 180px; } .plines .ifee { width: 90px; text-align: right; } .plines .iqty { width: 52px; text-align: right; } .plines .ipkg { width: 110px; }
.ptot { display: inline-flex; gap: 10px; flex-wrap: wrap; align-items: baseline; margin: 4px 12px 4px 0; font-size: 13px; } .ptot b { color: var(--ink); } .ptot span { color: var(--ink-2); }
textarea.letter, .letter { width: 100%; font: 14px/1.55 var(--f-serif, Georgia, serif); border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--surface); color: var(--ink); }
div.letter { white-space: pre-wrap; border: 0; padding: 0; }
.accept .mono { word-break: break-all; }
tr.left td { opacity: .5; }
/* the public pages: the form and the proposal */
body.pubform .auth, body.pubprop .auth { align-items: flex-start; }
.pform { max-width: 640px; width: 100%; } .pform h1 { margin: 6px 0; }
.pbrand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; } .pbrand img { max-height: 36px; max-width: 140px; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
body.embedded { background: transparent; } body.embedded .auth { padding: 0; min-height: 0; } body.embedded .pform { box-shadow: none; border: 0; }
.pwrap { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
.pwrap .card h1 { margin: 0 0 6px; } .ph { margin: 6px 0 -6px; font-size: 16px; }
.pkgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pkg { display: flex; flex-direction: column; gap: 6px; border: 2px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface); cursor: pointer; }
.pkg.on { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.pkg input { align-self: flex-start; } .pkg .big { font-size: 24px; font-weight: 700; } .pkg .big small { font-size: 13px; font-weight: 400; color: var(--ink-2); }
.pkg ul { margin: 4px 0 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-2); }
.ptotal { font-size: 18px; font-weight: 600; margin: 10px 0 0; }
@media (max-width: 560px) { .board { grid-auto-columns: 78%; } }

/* ---------- B11: e-signature ---------- */
.pdfbox { display: flex; flex-direction: column; gap: 12px; }
.pdfpage { position: relative; width: 100%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.pdfpage canvas { width: 100%; height: 100%; display: block; }
.pdfover { position: absolute; inset: 0; }
.pfield { position: absolute; --c: var(--brand); border: 1.5px dashed var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); border-radius: 4px; font-size: 11px; color: var(--c); overflow: hidden; display: flex; align-items: center; padding: 0 3px; }
.pfield span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.pfield.edit { cursor: move; touch-action: none; }
.pfield.done { border-style: solid; opacity: .6; }
.pfield.mine { border-style: solid; background: color-mix(in srgb, var(--brand) 18%, transparent); animation: pfpulse 2s ease-in-out 3; }
@keyframes pfpulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 25%, transparent); } }
.pfx { margin-left: auto; border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 12px; padding: 0 2px; }
.esplit { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 16px; align-items: start; }
.eside { position: sticky; top: 12px; } .eside h3 { margin: 14px 0 6px; font-size: 14px; }
.esg { display: grid; grid-template-columns: 22px 1fr 1fr auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.esg b { width: 20px; height: 20px; border-radius: 50%; background: var(--c); color: #fff; font-size: 11px; display: grid; place-items: center; }
.esg input, .eside select, #ewho { border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; min-width: 0; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.ftools { display: flex; flex-direction: column; gap: 6px; } .ftools .seg2 { flex-wrap: wrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.list.hist .item { padding: 5px 0; }
.swrap { max-width: 900px; } .sgn { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.codein { width: 120px; font-size: 20px; letter-spacing: 4px; text-align: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.sigprev { font: italic 34px/1.3 "Newsreader", Georgia, serif; color: #0f1f5a; border-bottom: 1px solid var(--line); padding: 4px 8px; min-height: 52px; margin: 6px 0 12px; }
.sigpad { width: 100%; max-width: 600px; aspect-ratio: 10 / 3; border: 1px dashed var(--line); border-radius: 8px; background: #fff; touch-action: none; display: block; margin: 6px 0; }
@media (max-width: 860px) { .esplit { grid-template-columns: 1fr; } .eside { position: static; } }

/* ---------- billing (B12) ---------- */
.itot { margin: 12px 0 4px auto; border-collapse: collapse; min-width: 260px; }
.itot td { padding: 4px 0 4px 18px; font-size: 14px; } .itot td.num { text-align: right; font-variant-numeric: tabular-nums; }
.itot tr.b td { font-weight: 700; border-top: 1px solid var(--line); padding-top: 7px; }
.tbl.lines input, .tbl.lines select { width: 100%; min-width: 0; } .tbl.lines td:first-child { min-width: 220px; }
.tbl.lines input.num { text-align: right; max-width: 110px; }
.tbl tr.tot td { border-top: 2px solid var(--line); }
.card.held { border-color: #e2a33a; background: color-mix(in srgb, #e2a33a 8%, var(--surface)); }
input.saved { border-color: #2bb18e; }
.neg { color: var(--brick); }

/* ---------- messages (B13) ---------- */
.inbox .msg-row { cursor: pointer; } .inbox .msg-row.un .t { font-weight: 700; }
.msgbody { max-height: 50vh; overflow: auto; background: var(--surface-2, #f6f7f9); border-radius: 10px; padding: 12px; font-size: 13.5px; }
.dlg .wide-dlg { width: min(760px, 92vw); }
/* automations (B14) */
.auto h2 { font: 500 18px/1.3 var(--f-display); display: flex; gap: 8px; align-items: center; }
.auto details { margin-top: 8px; }
.row.cond { gap: 6px; margin: 4px 0; }
.row.cond input { flex: 1; min-width: 80px; }
.card.sub { padding: 12px; margin: 6px 0; box-shadow: none; border: 1px solid var(--line, #ddd); }
/* WIP, profitability, forecasting (B15) */
.pill.warn { background: var(--amber-soft); color: var(--amber); }
.rep .pos { color: var(--green); font-weight: 600; }
/* books health (B18) */
.checks { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.checks li.ok { color: var(--green); }
.checks li.no { color: var(--muted, #777); }
.lgs select { max-width: 100%; width: 100%; }
.lgs td:first-child { min-width: 0; overflow-wrap: anywhere; }
/* chat, SOPs, proofing, notice board (B19) */
.chat { display: grid; grid-template-columns: 240px 1fr; gap: 16px; }
.chans { display: flex; flex-direction: column; gap: 2px; }
.chans h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; margin: 12px 0 4px; color: var(--muted, #777); }
a.chan { display: block; padding: 6px 10px; border-radius: 8px; text-decoration: none; color: inherit; overflow-wrap: anywhere; }
a.chan.on, a.chan:hover { background: var(--line, #eee); }
.chatmain { display: flex; flex-direction: column; min-width: 0; background: var(--card, #fff); border-radius: 12px; padding: 12px; }
.chathead { padding-bottom: 8px; border-bottom: 1px solid var(--line, #eee); }
.msgs { flex: 1; max-height: 60vh; min-height: 240px; overflow-y: auto; padding: 8px 0; }
.cm { padding: 6px 4px; } .cm.gone .cb { color: var(--muted, #888); font-style: italic; }
.cm .cb { white-space: normal; overflow-wrap: anywhere; } .cact a { margin-right: 8px; }
.thread { margin-left: 22px; border-left: 2px solid var(--line, #eee); padding-left: 8px; }
.post textarea { width: 100%; }
.mdx h3, .mdx h4, .mdx h5 { margin: 12px 0 6px; } .mdx p { margin: 6px 0; }
.proofwrap { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.pview .pdfpage { position: relative; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.pview .pdfover { cursor: crosshair; }
.pin { position: absolute; transform: translate(-50%, -50%); width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: var(--brick, #c0392b); color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; }
.pin.done { background: var(--green, #2e7d32); }
.marks .mk { padding: 8px 0; border-bottom: 1px solid var(--line, #eee); } .marks .mk.done { opacity: .6; }
.ann { padding: 10px 0; border-bottom: 1px solid var(--line, #eee); } .ann.pinned { background: var(--amber-soft, #fff7e0); padding: 10px; border-radius: 8px; }
.notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; } .note { border: 1px solid var(--line, #eee); border-radius: 10px; padding: 10px; overflow: hidden; }
.annbar { display: flex; flex-wrap: wrap; gap: 12px; } .annbar a { text-decoration: none; color: inherit; }
.soplink { margin-left: 6px; }
@media (max-width: 760px) { .chat, .proofwrap { grid-template-columns: 1fr; } .msgs { max-height: 50vh; } }
table.feeh tr.soon td { background: var(--brand-soft); }
table.feeh td small { display: block; color: var(--ink-3); }
