/* Milroy Construction OS — Executive Project Lifecycle
   ---------------------------------------------------------------------------
   Colour discipline (spec section 61): lifecycle stage communicates POSITION
   only. Health, timer and blockers each get their own, separate indicator.
   Stage chips are therefore deliberately neutral-grey — never green/red. */

:root {
  /* Brand palette sampled from milroyconstruction.com
     Navy #1A3A52 and Sand #C2B6A0 are the two brand colours.

     Note on Sand: white-on-sand is roughly 2:1 contrast. That reads fine on a
     marketing hero, but this is a data-dense screen read at a glance, so Sand
     is used for accents, rules, focus and highlights -- not as a background
     behind small text. Navy carries the text-bearing buttons. */
  /* Calm release (Kyle, 17 Nov 2026): a warm off-white ground, white cards, softer lines — the look of the
     client portal brought into the OS. Navy still carries the text-bearing buttons. */
  --bg:            #f6f4ef;
  --surface:       #ffffff;
  --surface-2:     #fbfaf7;
  --surface-3:     #f4f1ea;
  --border:        #e9e4db;
  --border-strong: #d8d1c5;

  --text:          #2a2a2a;
  --text-2:        #5f5b55;
  --text-3:        #8e887f;
  --text-inv:      #ffffff;

  --brand:         #1a3a52;   /* Milroy navy */
  --brand-2:       #142e42;   /* navy, pressed */
  --brand-3:       #24506f;   /* navy, lifted */
  --brand-soft:    #efeae0;   /* sand tint: selected rows, the active nav item */

  --accent:        #c0b59d;   /* Milroy sand */
  --accent-2:      #a99c82;   /* sand, pressed */
  --accent-soft:   #f3efe6;   /* sand tint */

  /* Health colours stay semantic rather than brand-derived, warmed slightly
     to sit alongside the navy/sand palette. */
  --green:  #16704a;  --green-bg:  #e6f2ec;  --green-br:  #b5d6c5;
  --yellow: #8a5a09;  --yellow-bg: #fbf1de;  --yellow-br: #e8cfa4;
  --red:    #a8291f;  --red-bg:    #fbeae8;  --red-br:    #eebfba;
  --grey:   #666666;  --grey-bg:   #f0f0f0;  --grey-br:   #d8d8d8;

  --radius:   10px;           /* calm release: softer corners on cards and panels */
  --radius-s: 8px;
  --shadow-1: 0 1px 2px rgba(40,30,10,.04), 0 8px 24px rgba(40,30,10,.05);
  --shadow-2: 0 10px 30px rgba(40,30,10,.12);
  --shadow-3: -12px 0 40px rgba(26,58,82,.18);

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --sans: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--sans); background: var(--bg); color: var(--text);
  font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1,h2,h3,h4 { margin: 0; font-family: var(--display); font-weight: 600; letter-spacing: -.005em; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 3px; }

/* ------------------------------------------------------------------ layout */
.app { display: flex; flex-direction: column; min-height: 100%; }

.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 16px;
  padding: env(safe-area-inset-top, 0px) 20px 0; height: calc(56px + env(safe-area-inset-top, 0px)); box-sizing: border-box;
  background: var(--brand); color: var(--text-inv);
  border-bottom: 2px solid var(--accent);          /* the sand rule from the logo */
  box-shadow: var(--shadow-1);
}
/* The real Milroy logo, recoloured for dark chrome: sand rules and chevron
   kept, the grey wordmark reversed to white, paper knocked out to transparent.
   Sized by height so the 400x168 source stays crisp on retina. */
.topbar .logo { display: flex; align-items: center; }
/* Kyle, 13 Nov 2026: a Back control for phones — a home-screen app has no browser Back, so leaving a project page
   or a settings page needed the nav. Hidden on wide screens and on top-level pages. */
.topbar-back { display: none; }
@media (max-width: 760px) {
  .topbar-back { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 36px; padding: 4px 8px; margin-right: -6px;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); border-radius: 8px; color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
  .topbar-back[hidden] { display: none; }
}
.topbar .logo:hover { text-decoration: none; }
.topbar .logo-img { height: 34px; width: auto; display: block; }
@media (max-width: 900px) { .topbar .logo-img { height: 28px; } }
.topbar nav { display: flex; gap: 2px; margin-left: 12px; }
.topbar nav a {
  color: rgba(255,255,255,.82); padding: 6px 12px; border-radius: var(--radius-s);
  font-weight: 550; font-size: 13.5px;
}
.topbar nav a:hover { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.topbar nav a.active { background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 12.5px; color: rgba(255,255,255,.85); text-align: right; line-height: 1.25; }
.topbar .who strong { display: block; color: #fff; font-size: 13px; }
.topbar .btn-plain {
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.2);
  color: #fff; padding: 6px 12px; border-radius: var(--radius-s); cursor: pointer; font-size: 13px;
}
.topbar .btn-plain:hover { background: rgba(255,255,255,.24); }
/* Account menu (Kyle, 11 Nov 2026), left of the name/role. 22 Nov 2026: the gear became the word "MENU" on every
   screen size, since it holds Analytics and the quick actions as well as settings. */
.topbar .account-menu { display: inline-flex; align-items: center; gap: 6px; }
.topbar .account-menu .menu-word { font-weight: 600; letter-spacing: .08em; }
.topbar .account-menu.active { background: rgba(255,255,255,.24); box-shadow: inset 0 -2px 0 var(--accent); }

.page { padding: 20px 24px 64px; max-width: 1800px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; }
.page-head .sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }

/* --------------------------------------------------------------- KPI cards */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; margin-bottom: 18px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; cursor: pointer; text-align: left; transition: .12s; position: relative;
}
.kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow-1); transform: translateY(-1px); }
.kpi.active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.kpi.active::after {
  content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 3px;
  background: var(--accent); border-radius: var(--radius) var(--radius) 0 0;
}
.kpi .k-value { font-family: var(--display); }
.kpi .k-label { font-size: 11.5px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .k-value { font-size: 25px; font-weight: 680; margin-top: 5px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .k-value.currency { font-size: 19px; }
.kpi.tone-danger  .k-value { color: var(--red); }
.kpi.tone-warning .k-value { color: var(--yellow); }
.kpi.zero .k-value { color: var(--text-3); }

/* ----------------------------------------------------------------- toolbar */
.toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 14px;
}
.toolbar .grow { flex: 1; }
.field { display: flex; align-items: center; gap: 6px; }
.field label { font-size: 12px; color: var(--text-3); font-weight: 600; }
select, input[type=text], input[type=date], input[type=number], input[type=email], input[type=password], textarea {
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-s);
  padding: 6px 9px; font-size: 13px; min-width: 0;
}
select:hover, input:hover { border-color: var(--text-3); }
textarea { width: 100%; resize: vertical; min-height: 66px; font-family: inherit; }
.search-input { min-width: 230px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  padding: 7px 13px; border-radius: var(--radius-s); cursor: pointer; font-weight: 560; font-size: 13px;
  transition: .12s; white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--text-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn { border-width: 1.5px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
/* Sand button: brand accent, but dark text so it stays legible */
.btn-accent { background: var(--accent); border-color: var(--accent-2); color: #33302a; }
.btn-accent:hover { background: var(--accent-2); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { filter: brightness(.93); }
.btn-sm { padding: 4px 9px; font-size: 12.5px; }
.btn-link { background: none; border: none; color: var(--brand); padding: 0; cursor: pointer; font-weight: 560; }
.btn-link:hover { text-decoration: underline; }

.chip-toggle {
  border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px;
  padding: 5px 12px; font-size: 12.5px; cursor: pointer; font-weight: 560; color: var(--text-2);
}
.chip-toggle:hover { border-color: var(--text-3); }
.chip-toggle.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-toggle.on.danger { background: var(--red); border-color: var(--red); }

/* ------------------------------------------------------------------- table */
.table-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: auto; box-shadow: var(--shadow-1);
}
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.grid thead th {
  position: sticky; top: 0; z-index: 5; background: var(--surface-2);
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-3); font-weight: 700; padding: 9px 10px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.grid thead th.sortable { cursor: pointer; user-select: none; }
table.grid thead th.sortable:hover { color: var(--text); background: var(--surface-3); }
table.grid thead th .arrow { color: var(--brand); margin-left: 3px; }
table.grid tbody td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.grid tbody tr { cursor: pointer; }
table.grid tbody tr:hover td { background: var(--surface-2); }
table.grid tbody tr.selected td { background: var(--brand-soft); }
table.grid tbody tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--brand); }
table.grid tbody tr:last-child td { border-bottom: none; }
table.grid tbody tr.attention td:first-child { box-shadow: inset 3px 0 0 var(--red); }

.p-name { font-weight: 620; color: var(--text); }
.p-meta { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.muted { color: var(--text-3); }
.empty-cell { color: var(--text-3); font-style: italic; font-size: 12.5px; }

/* ------------------------------------------------------------------ badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 640; border: 1px solid transparent; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-green  { color: var(--green);  background: var(--green-bg);  border-color: var(--green-br); }
.b-yellow { color: var(--yellow); background: var(--yellow-bg); border-color: var(--yellow-br); }
.b-red    { color: var(--red);    background: var(--red-bg);    border-color: var(--red-br); }
.b-grey, .b-neutral, .b-unrated { color: var(--grey); background: var(--grey-bg); border-color: var(--grey-br); }
.badge.override-mark::after { content: "✎"; font-size: 10px; opacity: .85; }

/* stage chip: neutral by design — position, not health (spec section 61) */
.stage-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: var(--radius-s);
  background: var(--surface-3); border: 1px solid var(--border-strong);
  font-size: 12px; font-weight: 620; color: var(--text-2); white-space: nowrap;
}
.stage-chip .seq {
  font-family: var(--mono); font-size: 10px; color: var(--text-inv);
  background: var(--brand); border-radius: 3px; padding: 0 4px; line-height: 15px;
}
.hold-flag {
  background: var(--grey-bg); color: var(--grey); border: 1px solid var(--grey-br);
  font-size: 10.5px; font-weight: 750; letter-spacing: .05em; padding: 1px 6px; border-radius: 3px;
}
.blocker-flag {
  display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 650;
  color: var(--red); background: var(--red-bg); border: 1px solid var(--red-br);
  padding: 2px 7px; border-radius: 999px;
}
.blocker-flag.sev-medium, .blocker-flag.sev-low {
  color: var(--yellow); background: var(--yellow-bg); border-color: var(--yellow-br);
}
.warn-flag { font-size: 11.5px; color: var(--yellow); font-weight: 620; }

.timer-cell { display: flex; align-items: baseline; gap: 6px; }
.timer-days { font-weight: 660; font-variant-numeric: tabular-nums; }
.timer-target { font-size: 11.5px; color: var(--text-3); }

.progress { display: flex; align-items: center; gap: 7px; min-width: 92px; }
.progress .bar { flex: 1; height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.progress .bar > i { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.progress .pct { font-size: 11.5px; color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 30px; text-align: right; }

.overdue { color: var(--red); font-weight: 620; }
.due-soon { color: var(--yellow); font-weight: 600; }

/* ------------------------------------------------------------------ matrix */
.matrix-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; box-shadow: var(--shadow-1); margin-bottom: 14px; }
table.matrix { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.matrix th { background: var(--surface-2); padding: 8px 6px; border-bottom: 1px solid var(--border);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 700; }
table.matrix th.proj-col { text-align: left; padding-left: 12px; min-width: 210px; position: sticky; left: 0; z-index: 6; }
table.matrix td { padding: 0; border-bottom: 1px solid var(--border); text-align: center; }
table.matrix td.proj-cell { text-align: left; padding: 7px 12px; position: sticky; left: 0; background: var(--surface); z-index: 4; border-right: 1px solid var(--border); }
table.matrix tbody tr:hover td { background: var(--surface-2); }
table.matrix tbody tr:hover td.proj-cell { background: var(--surface-2); }
table.matrix tbody tr { cursor: pointer; }
.cell-mark { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; }
.cell-complete { color: var(--green); background: var(--green-bg); font-weight: 700; }
.cell-current  { color: #fff; background: var(--brand); font-weight: 700; box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 4px var(--accent); }
.cell-skipped  { color: var(--text-3); }
.cell-future   { color: var(--border-strong); }

/* ------------------------------------------------------------------ drawer */
.scrim { position: fixed; inset: 0; background: rgba(16,24,40,.34); z-index: 60; animation: fade .14s ease; }
@keyframes fade { from { opacity: 0 } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(680px, 94vw); z-index: 61;
  background: var(--surface); box-shadow: var(--shadow-3); display: flex; flex-direction: column;
  animation: slide .18s cubic-bezier(.32,.72,.35,1);
}
@keyframes slide { from { transform: translateX(100%) } }
/* Kyle, 13 Nov 2026: as a home-screen app the page runs under the iPhone status bar (viewport-fit=cover), so the
   drawer's title and close button were hidden behind it, and its buttons sat under the home indicator. */
.drawer-head { padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.drawer-head .row1 { display: flex; align-items: flex-start; gap: 12px; }
.drawer-head h2 { font-size: 18px; flex: 1; }
.drawer-head .sub { color: var(--text-3); font-size: 12.5px; margin-top: 3px; }
.drawer-head .badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; align-items: center; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--text-3); font-size: 20px; line-height: 1; padding: 2px 6px; min-width: 36px; min-height: 36px; border-radius: var(--radius-s); }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 40px; }
.drawer-foot { padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: var(--surface-2); display: flex; gap: 8px; flex-wrap: wrap; }

.sec { margin-bottom: 22px; }
.sec > h3 {
  font-family: var(--sans); font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-3);
  margin-bottom: 9px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 11px 16px; }
.kv .item .k { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.kv .item .v { font-size: 14px; font-weight: 600; margin-top: 2px; }
.kv .item .v.small { font-size: 13px; font-weight: 500; }
.clickable { cursor: pointer; border-bottom: 1px dashed var(--border-strong); display: inline-block; }
.clickable:hover { color: var(--brand); border-bottom-color: var(--brand); }

.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 11px 13px; background: var(--surface); margin-bottom: 8px; }
.card.flat { background: var(--surface-2); }
.card .card-title { font-weight: 620; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.card .card-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.card.alert-red { border-left: 3px solid var(--red); }
.card.alert-yellow { border-left: 3px solid var(--yellow); }
.card.alert-green { border-left: 3px solid var(--green); }

.empty {
  padding: 16px; text-align: center; color: var(--text-3); font-size: 13px;
  background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.empty.tight { padding: 11px; font-size: 12.5px; }

.attention-list { list-style: none; margin: 0; padding: 0; }
.attention-list li { padding: 5px 0 5px 18px; position: relative; font-size: 13px; color: var(--text-2); }
.attention-list li::before { content: "▸"; position: absolute; left: 3px; color: var(--red); }

.signal-row { display: flex; gap: 8px; align-items: flex-start; padding: 5px 0; font-size: 13px; }

/* ------------------------------------------------------------------- modal */
.modal-scrim { position: fixed; inset: 0; background: rgba(16,24,40,.42); z-index: 80; display: grid; place-items: center; padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px)); animation: fade .12s; }
.modal { background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-2); width: min(560px, 100%); max-height: 88vh; display: flex; flex-direction: column; }
.modal-head { padding: 15px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.modal-head h3 { font-size: 16px; flex: 1; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 10px 10px; }
.form-row { margin-bottom: 13px; }
.form-row label { display: block; font-size: 12px; font-weight: 640; color: var(--text-2); margin-bottom: 4px; }
.form-row input, .form-row select, .form-row textarea { width: 100%; }
.form-row .hint { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.checkline { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.checkline input { width: auto; }

.alert { padding: 10px 12px; border-radius: var(--radius-s); font-size: 13px; margin-bottom: 13px; border: 1px solid; }
.alert-err  { background: var(--red-bg); border-color: var(--red-br); color: var(--red); }
.alert-warn { background: var(--yellow-bg); border-color: var(--yellow-br); color: var(--yellow); }
.alert-info { background: var(--brand-soft); border-color: #c6d6e9; color: var(--brand-2); }
/* Waiting on a reply (Kyle, 17 Nov 2026): change requests and client messages at the top of the Overview */
.needs-reply .reply-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 6px 0; border-top: 1px solid rgba(0,0,0,.06); color: var(--ink); }
.needs-reply .reply-row:first-of-type { border-top: 0; }
.needs-reply .reply-row.quiet { opacity: .85; }
.p-card .badge.b-red[href] { text-decoration: none; cursor: pointer; }
.alert ul { margin: 6px 0 0; padding-left: 18px; }

.gate-item { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--border); cursor: pointer; }

.gate-item:last-child { border-bottom: none; }
.gate-item input { margin-top: 3px; width: auto; }
.gate-label { flex: 1; font-size: 13px; }
.req-hard { font-size: 10px; font-weight: 750; color: var(--red); background: var(--red-bg); border: 1px solid var(--red-br); padding: 1px 5px; border-radius: 3px; letter-spacing: .04em; }
.req-soft { font-size: 10px; font-weight: 700; color: var(--text-3); background: var(--surface-3); border: 1px solid var(--border-strong); padding: 1px 5px; border-radius: 3px; letter-spacing: .04em; }

/* --------------------------------------------------------------- workspace */
.ws-head { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow-1); }
.ws-head .top { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.ws-head h1 { font-size: 20px; }
.ws-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.ws-tabs a { padding: 9px 14px; font-size: 13.5px; font-weight: 570; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.ws-tabs a:hover { color: var(--text); text-decoration: none; background: var(--surface-2); }
.ws-tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; align-items: start; }
.cols > * { min-width: 0; }   /* a wide table scrolls inside its wrapper instead of pushing the page sideways */
.fingerprint { overflow-wrap: anywhere; }   /* a 64-character hash wraps instead of widening the page on a phone */
.table-wrap { max-width: 100%; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); margin-bottom: 14px; }
.panel > header { padding: 11px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.panel > header h3 { font-size: 13.5px; flex: 1; }
.panel > .panel-body { padding: 14px; }

.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 5px; bottom: 5px; width: 2px; background: var(--border); }
.timeline .tl-item { position: relative; padding: 8px 0; }
.timeline .tl-item::before {
  content: ""; position: absolute; left: -20px; top: 14px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--surface); border: 2px solid var(--border-strong);
}
.timeline .tl-item.open::before { background: var(--brand); border-color: var(--brand); }
.tl-date { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-body { font-size: 13px; }

.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px,1fr)); gap: 10px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 9px 11px; }
.stat .s-k { font-size: 10.5px; color: var(--text-3); font-weight: 650; text-transform: uppercase; letter-spacing: .04em; }
.stat .s-v { font-family: var(--display); font-size: 17px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------------- misc */
.toast-host { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1e232b; color: #fff; padding: 10px 16px; border-radius: var(--radius); box-shadow: var(--shadow-2); font-size: 13px; max-width: 520px; animation: rise .16s; }
.toast.err { background: var(--red); }
.toast.ok  { background: var(--green); }
@keyframes rise { from { opacity: 0; transform: translateY(8px) } }

.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(160deg, #1a3a52 0%, #142e42 60%, #102637 100%);
}
.login-card {
  background: var(--surface); border-radius: 6px; box-shadow: var(--shadow-2);
  padding: 28px 30px 30px; width: 100%; border-top: 4px solid var(--accent);
}
.login-stack { width: min(410px, 100%); display: flex; flex-direction: column; gap: 24px; }
.login-logo { display: flex; justify-content: center; }
.login-logo img { width: 260px; max-width: 82%; height: auto; display: block; }
.login-eyebrow {
  font-family: var(--display); font-size: 10.5px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--text-3);
  text-align: center; margin-bottom: 20px;
}
.login-card h1 { font-size: 19px; margin-bottom: 4px; }
.login-card .sub { color: var(--text-3); font-size: 13px; margin-bottom: 20px; }

.loading { padding: 50px; text-align: center; color: var(--text-3); }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg) } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.hide-sm { }
@media (max-width: 1180px) { .cols { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .page { padding: 14px 12px 60px; }
  .hide-sm { display: none !important; }
  /* Spec section 14: full-screen on mobile. Anchoring to both edges is exact,
     whereas 100vw can disagree with the layout viewport (scrollbars, pinch-zoom). */
  .drawer { left: 0; right: 0; width: auto; }
  .topbar { padding: 0 12px; gap: 10px; }
  .topbar .who { display: none; }
  /* The bar must never push the page sideways. On a phone the nav is the only
     part allowed to shrink, and it scrolls within itself, so Sign out stays
     pinned on screen instead of being pushed past the right edge. */
  /* Audit (12 Nov 2026): on a phone the nav takes a row of its own under the logo, so every
     item is on screen — nothing is clipped and nothing has to be scrolled to be found. */
  .topbar { flex-wrap: wrap; height: auto; min-height: calc(56px + env(safe-area-inset-top, 0px)); padding-top: calc(8px + env(safe-area-inset-top, 0px)); padding-bottom: 4px; row-gap: 2px; }
  /* 22 Nov 2026: Analytics moved into MENU so the row fits a phone. As a guard for the narrowest phones, the row
     scrolls within itself rather than ever widening the page. */
  .topbar nav { order: 10; flex: 1 0 100%; margin-left: 0; min-width: 0; display: flex; justify-content: space-between; gap: 0;
    overflow-x: auto; scrollbar-width: none; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a { white-space: nowrap; flex: 1 1 auto; text-align: center; padding: 7px 4px; font-size: 13px; }
  .page { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }   /* room to scroll past the quick button */
  .topbar .logo, .topbar .btn-plain { flex: none; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); }
  .form-grid { grid-template-columns: 1fr; }
}

@media print {
  .topbar, .toolbar, .drawer, .scrim, .kpi { break-inside: avoid; }
  body { background: #fff; }
}

/* --------------------------------------------------- client selections portal */
.portal-empty p { margin: 0 0 14px; max-width: 62ch; line-height: 1.55; color: var(--text-2); }
.portal-status { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.portal-link { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.portal-link input { flex: 1; min-width: 240px; font-family: var(--mono); font-size: 13px; background: var(--surface-2); }
.portal-rooms { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.portal-chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* ------------------------------------------------- client selections review */
.sel-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (max-width: 760px) { .sel-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sel-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.sel-stat b { display: block; font-size: 22px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sel-stat span { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.sel-stat.warn b { color: var(--yellow); }
.sel-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px 18px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.sel-row:last-child { border-bottom: 0; }
.sel-row.compact { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 900px) { .sel-row, .sel-row.compact { grid-template-columns: minmax(0, 1fr); } }
.sel-lab { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.sel-name { font-size: 14px; font-weight: 640; margin-top: 2px; }
.sel-meta, .sel-note, .sel-tier { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.sel-note { color: var(--text); }
.sel-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.sel-row.compact .sel-actions { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
@media (max-width: 900px) { .sel-row.compact .sel-actions { justify-content: flex-start; } }
.inl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* Selection sheet by room (Kyle, 17 Nov 2026): one collapsible block per room, one line per decision. */
.sheet-room { border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); margin-bottom: 8px; }
.sheet-room > summary { cursor: pointer; padding: 10px 12px; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; font-size: 13.5px; }
.sheet-room > summary::-webkit-details-marker { display: none; }
.sheet-room > summary::before { content: '▸'; color: var(--text-3); font-size: 12px; margin-right: 2px; }
.sheet-room[open] > summary::before { content: '▾'; }
.sheet-room > summary .muted { font-size: 12px; }
.sheet-rows { border-top: 1px solid var(--border); padding: 2px 12px 6px; background: var(--surface); border-radius: 0 0 8px 8px; }
.sheet-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.sheet-row:last-child { border-bottom: 0; }
.sheet-row.gone .sheet-main > div:first-child { opacity: .6; text-decoration: line-through; text-decoration-color: var(--text-3); }
.sheet-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
@media (max-width: 720px) { .sheet-row { grid-template-columns: minmax(0, 1fr); } .sheet-actions { justify-content: flex-start; } }
.inl input, .inl select { padding: 6px 8px; font-size: 13px; }
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.pkg-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.pkg-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pkg-head b { font-size: 13px; }
.pkg-num { font-size: 12px; color: var(--brand); font-weight: 700; }
.act-list { font-size: 13px; }
.act-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.act-row:last-child { border-bottom: 0; }
.act-when { color: var(--text-3); font-variant-numeric: tabular-nums; }
.act-evidence { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
@media (max-width: 600px) { .act-row { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

/* ------------------------------------------------------------ phones & touch */
/* Dialogs can never be wider than the screen, whatever width a form asks for. */
.modal { max-width: 100%; }
@media (max-width: 900px) {
  .panel > header { flex-wrap: wrap; }
  .panel > header h3 { min-width: 120px; }
}
@media (max-width: 640px) {
  /* Dialogs become bottom sheets: full width, scrollable body, footer above the home indicator. */
  .modal-scrim { padding: 0; place-items: end center; }
  .modal { width: 100% !important; max-width: 100%; max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px - env(safe-area-inset-top, 0px)); border-radius: 14px 14px 0 0; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-radius: 0; flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }
}
@media (pointer: coarse) {
  /* 36 px minimum for anything a thumb has to hit. */
  .btn-sm { min-height: 36px; padding: 7px 11px; }
  .btn-xs, .btn-link { min-height: 32px; }
  .btn-plain { min-height: 36px; }
  .chip-toggle { min-height: 36px; padding: 7px 12px; }
  .ws-tabs a { padding: 12px 14px; font-size: 14px; }
  .toolbar select, .toolbar input, .form-row select, .form-row input, .inl input, .inl select { min-height: 40px; }
  table.grid thead th.sortable { padding-top: 11px; padding-bottom: 11px; }
}
.p-cards { display: none; }
@media (max-width: 760px) {
  /* Control Tower: the KPI strip scrolls sideways in one row instead of pushing the projects two screens down. */
  .kpis { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; margin: 0 -12px 14px; padding: 0 12px 6px; scrollbar-width: none; }
  .kpis::-webkit-scrollbar { display: none; }
  .kpi { flex: 0 0 148px; scroll-snap-align: start; }
  .kpi .k-value { font-size: 22px; }
  /* The portfolio becomes a list of cards; the eight-column table is desktop only. */
  .portfolio .table-wrap { display: none; }
  .p-cards { display: grid; gap: 8px; }
  .ws-tabs { margin: 0 -12px 14px; padding: 0 12px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
  .ws-head .actions, .project-actions { gap: 6px; }
}
.p-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow-1); cursor: pointer; display: grid; gap: 7px; }
.p-card.attention { border-left: 3px solid var(--red); }
.p-card.selected { outline: 2px solid var(--brand); }
.p-card .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.p-card .p-name { font-size: 15px; }
.p-card .val { margin-left: auto; font-weight: 650; font-variant-numeric: tabular-nums; }
.p-card .next { font-size: 12.5px; color: var(--text-2); }
.p-card .next b { color: var(--text); font-weight: 600; }
/* Offline / install hints */
.net-banner { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 90; background: var(--text); color: #fff; border-radius: 10px; padding: 10px 14px; font-size: 13px; box-shadow: var(--shadow-2); display: flex; gap: 10px; align-items: center; }
.net-banner b { font-weight: 650; }
.net-banner .btn-plain { color: #fff; margin-left: auto; opacity: .85; }

/* Control Tower filters on phones: search + quick chips stay; drop-downs fold behind "Filters". */
.filters-toggle { display: none; }
@media (max-width: 760px) {
  .toolbar { gap: 8px 6px; }
  .toolbar .search-input { flex: 1 1 100%; min-height: 40px; }
  .filters-toggle { display: inline-flex; order: 2; min-height: 36px; }
  .filters-toggle.has-active { border-color: var(--brand); color: var(--brand); font-weight: 650; }
  .toolbar .chip-toggle { order: 3; }
  .toolbar .grow { display: none; }
  .toolbar:not(.open) .field { display: none; }
  .toolbar.open .field { order: 4; flex: 1 1 100%; justify-content: space-between; }
  .toolbar.open .field select { flex: 1; max-width: 70%; }
  .toolbar .btn.btn-sm:not(.filters-toggle) { order: 5; }
}
@media (pointer: coarse) {
  .topbar nav a { min-height: 38px; display: inline-flex; align-items: center; }
  .topbar .btn-plain { min-height: 38px; }
  input[type=checkbox], input[type=radio] { width: 18px; height: 18px; }
  .btn-primary { min-height: 38px; }
}
.net-banner span { flex: 1 1 auto; }
.net-banner .btn-plain { flex: 0 0 auto; white-space: nowrap; }
@media (pointer: coarse) {
  .ws-head .top a[href="/dashboard"] { display: inline-flex; align-items: center; min-height: 36px; padding: 0 4px; margin-left: -4px; }
  .topbar .logo { min-height: 36px; display: inline-flex; align-items: center; }
}
@media (pointer: coarse) {
  .gate-item { padding: 11px 0; }
  .gate-item input[type=checkbox] { width: 20px; height: 20px; margin-top: 0; }
}
/* Installed on an iPhone: the sign-in screen has no top bar, so keep it clear of the status bar. */
.login-wrap { padding-top: env(safe-area-inset-top, 0px); }

/* Inactivity warning (last 60 seconds before the automatic sign-out). */
.idle-bar { position: fixed; top: env(safe-area-inset-top, 0px); left: 0; right: 0; z-index: 96; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); background: var(--yellow-bg); color: var(--yellow); border-bottom: 1px solid var(--yellow-br); font-size: 14px; font-weight: 600; box-shadow: var(--shadow-2); }
.idle-bar b { font-variant-numeric: tabular-nums; }
.idle-bar .btn { min-height: 36px; }
.login-notice { margin-bottom: 14px; }

/* Unfinished text offered back after a sign-out. */
.draft-bar { background: var(--brand-soft); border: 1px solid var(--border); border-left: 3px solid var(--brand); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; display: grid; gap: 6px; }
.draft-title { font-weight: 650; font-size: 13.5px; }
.draft-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.draft-actions { display: flex; gap: 6px; }

/* Dialog: "Discard what you typed?" row */
/* Phone drawer: the page behind it must not scroll */
@media (max-width: 900px) { body.drawer-open { overflow: hidden; } }

/* Client photos on a custom request (review queue) */
.sel-photos { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.sel-photos a { display: block; width: 72px; height: 72px; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.sel-photos img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ------------------------------------------------------- product catalog */
.cat-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--border); background: #fff; display: inline-block; }
.cat-thumb-empty { display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); background: var(--surface-2); font-size: 12px; }
.catalog-grid .cat-name { font-weight: 600; }
.cat-flags { display: flex; gap: 4px; flex-wrap: wrap; }
.cat-flags .badge { font-size: 10.5px; padding: 1px 6px; }
.cat-changes { display: grid; gap: 6px; font-size: 13px; }
.cat-change { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; align-items: baseline; }
.cat-form .cat-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.cat-form .form-row { margin-bottom: 10px; }
.cat-section { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); margin: 14px 0 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.cat-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 2px 0 10px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-finish-groups { display: grid; gap: 8px; }
.cat-finish-group .k { display: block; font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.cat-pics { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cat-pic { width: 120px; border: 1px solid var(--border); border-radius: var(--radius-s); padding: 4px; background: #fff; }
.cat-pic.primary { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.cat-pic img { width: 100%; height: 96px; object-fit: contain; display: block; }
.cat-pic-actions { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 12px; margin-top: 4px; }
.btn-link.danger { color: var(--red); }
.cat-upload { display: inline-block; cursor: pointer; }
.cat-drop { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 28px 16px; text-align: center; background: var(--surface); cursor: pointer; margin-bottom: 14px; }
.cat-drop:hover, .cat-drop.over { border-color: var(--brand); background: var(--brand-soft); }
.cat-finishes { display: grid; gap: 12px; }
.cat-finish-rows { display: grid; gap: 2px; }
.cat-finish-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 3px 0; }
.cat-finish-row.off { opacity: .55; }
.cat-finish-row .grow { flex: 1; }
.cat-finish-row input[type=color], .cat-form input[type=color] { width: 28px; height: 24px; padding: 0; border: 1px solid var(--border-strong); border-radius: 4px; background: none; cursor: pointer; }
.cat-finishes .k, .cat-hide-list .k { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin: 8px 0 6px; }
.cat-hide-list { max-height: 52vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-s); padding: 4px 10px; }
.cat-hide-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.cat-hide-row:last-child { border-bottom: none; }
.cat-hide-row img { width: 34px; height: 34px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }
.cat-hide-row .grow { flex: 1; }
.cat-hide-row.hidden { opacity: .55; text-decoration: line-through; }
.muted.small, .small { font-size: 12px; }
.view-only-note { margin: 0 0 10px; padding: 6px 10px; border: 1px dashed var(--line); border-radius: 6px; }
@media (max-width: 640px) {
  .cat-form .cat-cols { grid-template-columns: 1fr; }
  .cat-change { grid-template-columns: 1fr; gap: 2px; }
}

/* ------------------------------------------------------------ link requests */
.nav-count { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 6px; border-radius: 9px; background: var(--accent, #C2B6A0); color: #1a1a1a; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; vertical-align: 1px; }
.modal .kv .item .v { overflow-wrap: anywhere; }
.req-quote { margin: 0 0 12px; padding: 10px 14px; border-left: 3px solid var(--accent, #C2B6A0); background: var(--surface-2); font-size: 13.5px; }

/* ---- change orders (spec: Change Orders in the OS and Portal) */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .form-grid-2 { grid-template-columns: 1fr; } }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 18px; }
.co-request, .co-priceable { padding: 10px 0; border-bottom: 1px solid var(--border); }
.co-request:last-child, .co-priceable:last-child { border-bottom: none; }
.co-request-text { white-space: pre-wrap; }
.co-priceable { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.co-note { background: var(--surface-2); border-left: 3px solid var(--sand, #C2B6A0); padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }
.co-totals { display: flex; justify-content: flex-end; gap: 28px; padding: 10px 4px; align-items: baseline; }
.co-lines tbody tr td:first-child { color: var(--text-3); width: 28px; }
.co-preview { margin-top: 8px; padding: 8px 10px; background: var(--surface-2); border-radius: 5px; }
.co-card { border: 1px solid var(--border); border-radius: 5px; padding: 8px 12px; margin-bottom: 8px; }
.co-card > summary { cursor: pointer; list-style: none; }
.co-card > summary::-webkit-details-marker { display: none; }
.co-evidence { margin-top: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 5px; font-size: 13px; line-height: 1.5; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
.contract-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 12px 0 0; }
.contract-ok, .contract-missing { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; }

.ct-form h4 { margin: 18px 0 8px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.ct-form h4:first-child { margin-top: 0; }
.ct-group { border: 1px solid var(--border); border-radius: 5px; padding: 10px; margin-bottom: 8px; display: grid; gap: 6px; }
.ct-row { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.ct-row input:first-child { flex: 1; }

/* Change-order margin (10 Nov 2026): the internal cost block on the line editor is set apart so nobody mistakes it for a printed field. */
.co-internal { margin-top: 10px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 6px; background: var(--surface-2); }
.co-internal .co-preview { background: transparent; padding: 4px 0 0; margin-top: 4px; }

/* Simplification (10 Nov 2026): delay chip, Contract Docs sub-tabs, Settings tab strip, count on the Requests button. */
.hold-flag.delay-flag { background: #B42318; color: #fff; border-color: #B42318; }
.ws-tabs.sub { margin: 0 0 14px; font-size: 13.5px; }
.ws-tabs.sub a { padding: 8px 12px; }
.ws-tabs.sub .nav-count { margin-left: 6px; }
.ws-tabs.settings-tabs { margin-bottom: 4px; }
.btn .nav-count { display: inline-block; }

/* Control Tower row actions + batch selection (Kyle, 11 Nov 2026) */
table.grid th.sel, table.grid td.sel { width: 34px; padding-left: 10px; padding-right: 2px; text-align: center; }
table.grid th.menu, table.grid td.menu { width: 38px; padding-left: 2px; padding-right: 8px; text-align: right; }
input.row-select, input.row-select-all { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--brand); vertical-align: middle; }
.row-menu-btn { border: 1px solid transparent; background: transparent; color: var(--text-3); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.row-menu-btn:hover, .row-menu-btn:focus-visible { border-color: var(--border-strong); background: var(--surface); color: var(--text); outline: none; }
table.grid tbody tr:hover .row-menu-btn { color: var(--text); }
.menu-pop { position: fixed; z-index: 60; min-width: 180px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow-2); padding: 4px; display: grid; }
.menu-pop button { text-align: left; background: transparent; border: 0; padding: 8px 12px; border-radius: 6px; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; }
.menu-pop button:hover, .menu-pop button:focus-visible { background: var(--surface-2); outline: none; }
.menu-pop button.danger { color: var(--red); }
.sel-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; padding: 8px 12px; background: var(--brand-soft); border: 1px solid var(--brand); border-radius: var(--radius); position: sticky; top: 0; z-index: 7; }
.sel-bar .spacer { flex: 1; }
.batch-list { display: grid; gap: 4px; margin: 6px 0 12px; max-height: 220px; overflow: auto; font-size: 13.5px; }
.batch-row { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.batch-row > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-card .row-menu-btn { margin-left: auto; }

/* Contract reader (Kyle, 11 Nov 2026) */
.reader-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2); }
.reader-group { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); }
.reader-grid { display: grid; grid-template-columns: 28px 1.1fr 1.6fr 1.2fr; gap: 6px 10px; align-items: center; }
.reader-head { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 700; padding-bottom: 2px; border-bottom: 1px solid var(--border); }
.reader-cell { min-width: 0; font-size: 13.5px; }
.reader-cell input, .reader-cell select { width: 100%; }
.reader-cell .reader-notfound::placeholder { color: var(--text-3); font-style: italic; }
.reader-differs { color: var(--yellow, #9a6a12); }
.reader-list { display: grid; gap: 4px; }
.reader-list-row { display: grid; grid-template-columns: 1fr 110px 28px; gap: 6px; align-items: center; }
.allowance-strip { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
@media (max-width: 720px) { .reader-grid { grid-template-columns: 24px 1fr; } .reader-head:nth-child(3), .reader-head:nth-child(4) { display: none; } .reader-cell:nth-child(4n+3), .reader-cell:nth-child(4n) { grid-column: 2; } }

/* ------------------------------------------------------- users & access */
table.grid.users tbody tr.me td { background: var(--surface-2); }
table.grid.users tbody tr { cursor: default; }
table.grid.users tbody tr:hover td { background: var(--surface-2); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check-row input { width: auto; }
.temp-password-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 12px; flex-wrap: wrap; }
.temp-password { font-size: 18px; letter-spacing: .04em; background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 6px; padding: 8px 12px; user-select: all; }
@media (max-width: 700px) {
  /* Phones: Person · Role · Status · menu; two-factor and last sign-in wait for a wider screen. */
  table.grid.users th:nth-child(4), table.grid.users td:nth-child(4),
  table.grid.users th:nth-child(5), table.grid.users td:nth-child(5) { display: none; }
  table.grid.users tbody td { padding: 8px 6px; font-size: 12.5px; }
  table.grid.users th, table.grid.users td { white-space: normal; }
  table.grid.users td:first-child { max-width: 150px; }
  table.grid.users td:first-child .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  table.grid.users th.menu, table.grid.users td.menu { width: 30px; padding-right: 2px; }
  table.grid.users .badge { font-size: 10.5px; padding: 2px 6px; }
}

/* ------------------------------------------------- catalog: colors & finishes */
.cat-colors { display: grid; gap: 6px; }
.cat-color-row { display: grid; grid-template-columns: 16px minmax(110px, .8fr) minmax(220px, 1.3fr) auto 28px; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.cat-color-row .swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.cat-color-name { font-weight: 600; font-size: 13.5px; }
.cat-color-pic { display: flex; align-items: center; gap: 10px; min-width: 0; white-space: nowrap; }
.cat-color-pic .btn-link { white-space: nowrap; }
.cat-color-pic img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.cat-color-price { display: flex; align-items: center; gap: 8px; }
.cat-color-price input { width: 96px; }
.cat-color-row .icon-btn { font-size: 18px; }
@media (max-width: 700px) {
  .cat-color-row { grid-template-columns: 16px 1fr 28px; }
  .cat-color-pic, .cat-color-price { grid-column: 2 / span 1; }
  .cat-ra-row { grid-column: 2 / span 1; flex-wrap: wrap; }
}

/* Quick actions (Kyle, 12 Nov 2026): /quick/upload, /quick/pause, /quick/task — phone-first pages reached
   from the app icon's long-press menu (Android), MENU → Quick actions, or the "+" button on the phone
   Control Tower. */
.quick-head { margin-bottom: 12px; }
.quick-kicker { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-weight: 650; margin-bottom: 2px; }
.quick-search { width: 100%; min-height: 42px; font-size: 15px; margin-bottom: 10px; }
.quick-group h3 { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 14px 0 6px; font-weight: 650; }
.quick-proj {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
  margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow-1); transition: .12s;
}
.quick-proj:hover { border-color: var(--brand); }
.quick-proj.static { cursor: default; box-shadow: none; background: var(--surface-2); margin: 10px 0 14px; }
.quick-proj.hold { opacity: .8; }
.quick-proj .qp-main { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.quick-proj .qp-main b { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-proj .qp-sub { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-proj .qp-side { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.quick-proj .qp-stage { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.quick-proj .qp-arrow { font-size: 22px; color: var(--text-3); line-height: 1; }
.quick-proj .chip { font-size: 11px; font-weight: 650; border-radius: 999px; padding: 2px 8px; letter-spacing: .02em; }
.quick-proj .chip-hold { background: var(--accent-soft); color: var(--accent-2); }
.quick-proj .chip-delay { background: var(--red); color: #fff; }
.quick-back { display: inline-block; font-size: 13px; margin: 2px 0 0; }
.quick-form textarea { width: 100%; min-height: 72px; }
.quick-form .form-row { margin-bottom: 12px; }
.quick-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.quick-actions.col { flex-direction: column; align-items: stretch; max-width: 420px; }
.btn-lg { min-height: 44px; font-size: 14.5px; padding: 10px 18px; }
.quick-done { text-align: center; padding: 18px 8px 6px; }
.quick-check { width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 28px; line-height: 56px; margin: 0 auto 10px; }
.quick-done h2 { font-size: 18px; margin: 0 0 4px; }
.quick-other { margin-top: 18px; font-size: 13px; color: var(--text-3); }
@media (max-width: 760px) {
  .quick-proj .qp-stage { display: none; }
  .quick-actions.col { max-width: none; }
}
/* The round "+" on the phone Control Tower. Hidden on wide screens — the top bar has the menu there. */
.quick-fab { display: none; }
@media (max-width: 760px) {
  .quick-fab {
    display: flex; align-items: center; justify-content: center; position: fixed; right: 16px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: 54px; height: 54px; border-radius: 50%;
    background: var(--brand); color: #fff; border: 0; font-size: 30px; line-height: 1; box-shadow: var(--shadow-2);
    cursor: pointer; z-index: 60; font-weight: 400; padding: 0 0 3px;
  }
  .quick-fab:active { background: var(--brand-2); }
  body.drawer-open .quick-fab { display: none; }
}

/* Catalog (Kyle, 12 Nov 2026): the $ band on an appliance brand. */
.cat-band { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); font-size: 11.5px; font-weight: 700; letter-spacing: .04em; vertical-align: 1px; }

/* Catalog category banner (Kyle, 12 Nov 2026): replaces the category drop-down. */
.cat-bar { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 14px; }
.cat-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: 999px; padding: 7px 12px 7px 10px; font: inherit; font-size: 13px; cursor: pointer; color: var(--text-2); transition: .12s; }
.cat-btn .n { font-size: 11px; font-weight: 700; color: var(--accent-2); letter-spacing: .04em; }
.cat-btn b { font-weight: 600; color: var(--text); }
.cat-btn .c { font-size: 11.5px; font-weight: 650; background: var(--surface-3); border-radius: 999px; padding: 1px 7px; color: var(--text-3); }
.cat-btn:hover { border-color: var(--brand); }
.cat-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.cat-btn.on b, .cat-btn.on .n { color: #fff; }
.cat-btn.on .c { background: rgba(255,255,255,.2); color: #fff; }
.cat-btn.empty:not(.on) { opacity: .6; }
.cat-btn.dir { margin-left: auto; text-decoration: none; border-style: dashed; }
.cat-btn.dir:hover { text-decoration: none; }
/* Design direction editor (Kyle, 13 Nov 2026) */
.dir-card { padding: 14px 16px; margin-bottom: 14px; }
.dir-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dir-head h2 { font-size: 16px; margin: 0 0 2px; }
.dir-list { display: grid; gap: 6px; }
.dir-row { display: grid; grid-template-columns: 112px 1fr auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.dir-row.off { opacity: .6; }
.dir-pic { width: 112px; height: 72px; border-radius: 6px; overflow: hidden; background: var(--surface-3); display: flex; align-items: center; justify-content: center; }
.dir-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dir-name { font-weight: 600; }
.dir-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 13px; }
.dir-move { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 600px) { .dir-row { grid-template-columns: 84px 1fr auto; } .dir-pic { width: 84px; height: 56px; } }
@media (max-width: 760px) { .cat-bar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -12px; margin-right: -12px; padding: 0 12px 4px; } .cat-bar::-webkit-scrollbar { display: none; } .cat-btn { flex: 0 0 auto; min-height: 36px; } }

/* Messages (Kyle, 12 Nov 2026): client list on the left, the conversation and composer on the right. */
.msg-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 16px; align-items: start; }
.msg-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; position: sticky; top: 12px; max-height: calc(100vh - 110px); display: flex; flex-direction: column; }
.msg-side .search-input { width: 100%; min-width: 0; margin-bottom: 8px; }
.msg-list { overflow: auto; display: grid; gap: 4px; }
.msg-item { display: grid; gap: 2px; text-align: left; width: 100%; font: inherit; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 9px 10px; cursor: pointer; }
.msg-item:hover { background: var(--surface-2); }
.msg-item.on { background: var(--brand-soft); border-color: var(--brand); }
.msg-item .mi-top { display: flex; align-items: center; gap: 6px; }
.msg-item .mi-top b { font-weight: 650; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-item.unread .mi-top b { font-weight: 750; }
.msg-item .mi-when { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.msg-item .mi-proj { font-size: 12px; color: var(--text-3); }
.msg-item .mi-last { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-item .mi-ch { color: var(--text-3); }
.msg-main { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 520px; }
.msg-empty { padding: 40px 20px; text-align: center; }
.msg-head { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.msg-head h2 { font-size: 17px; margin: 0; }
.msg-back { display: none; font-size: 13px; }
.msg-who { flex: 1 1 auto; min-width: 0; }
.msg-contacts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip-contact { font-size: 12px; background: var(--surface-3); border-radius: 999px; padding: 2px 9px; color: var(--text-2); }
.chip-contact.warn { background: var(--red-bg); color: var(--red); }
.msg-thread { flex: 1 1 auto; overflow: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; max-height: 56vh; background: var(--surface-2); }
.msg-bubble { max-width: 78%; border-radius: 12px; padding: 9px 12px; font-size: 14px; line-height: 1.45; box-shadow: var(--shadow-1); }
.msg-bubble.in { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 4px; }
.msg-bubble.out { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg-bubble.failed { background: var(--red-bg); color: var(--red); }
.msg-bubble .mb-subject { font-weight: 700; margin-bottom: 3px; }
.msg-bubble .mb-body { white-space: pre-wrap; word-break: break-word; }
.msg-bubble .mb-meta { font-size: 11px; opacity: .75; margin-top: 5px; }
.msg-bubble.out .mb-meta { text-align: right; }
.mb-err { font-weight: 600; }
.msg-composer { padding: 12px 16px 14px; border-top: 1px solid var(--border); display: grid; gap: 8px; }
.msg-composer textarea { width: 100%; min-height: 84px; resize: vertical; }
.msg-composer .form-row { margin: 0; }
.mc-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mc-row .spacer { flex: 1; }
.checkline.small { font-size: 12px; }
.msg-pick { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; margin: 8px 0 4px; display: grid; }
.mp-row { display: flex; align-items: center; gap: 8px; padding: 6px 2px; border-bottom: 1px solid var(--border); font-size: 13.5px; cursor: pointer; }
.mp-row:last-child { border-bottom: 0; }
.mp-row input { width: auto; }
.mp-row .mp-name { flex: 1 1 auto; min-width: 0; }
/* Unknown numbers (Kyle, 21 Nov 2026): the second section of the Messages list */
.msg-section { margin: 12px 4px 4px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12.5px; }
.msg-section.first { margin-top: 0; padding-top: 2px; border-top: 0; }
.msg-item.archived { opacity: .7; }
@media (max-width: 900px) {
  .msg-layout { grid-template-columns: minmax(0, 1fr); }
  .msg-side { position: static; max-height: none; }
  .msg-layout.has-thread .msg-side { display: none; }
  .msg-back { display: inline-block; width: 100%; }
  .msg-bubble { max-width: 92%; }
  .msg-thread { max-height: none; }
}

/* ---- See it in your space (13 Nov 2026): the Renders page and the catalog's render assets */
.rn-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.rn-sub { color: var(--text-2); font-size: .9rem; margin: 0 0 8px; }
.rn-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 10px; }
.rn-thumb-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.rn-thumb { position: relative; width: 168px; border: 2px solid var(--line); border-radius: 8px; padding: 0; background: var(--panel); cursor: pointer; overflow: hidden; text-align: left; }
.rn-thumb img { display: block; width: 100%; height: 112px; object-fit: cover; }
.rn-thumb.on { border-color: var(--brand, #c0b59d); box-shadow: 0 0 0 2px rgba(192,181,157,.35); }
.rn-thumb-label { display: block; font-size: .78rem; padding: 4px 6px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rn-thumb-badge { position: absolute; top: 6px; left: 6px; }
.rn-items { display: flex; flex-direction: column; gap: 6px; }
.rn-item { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.rn-item .rn-n { width: 20px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rn-item .swatch { width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line); flex: none; }
.rn-item .swatch.none { background: repeating-linear-gradient(45deg, #eee 0 4px, #fff 4px 8px); }
.rn-item-text { flex: 1; min-width: 0; }
.rn-flags { margin: 6px 0 0 18px; padding: 0; }
.rn-prompt { margin: 10px 0; }
.rn-prompt pre { white-space: pre-wrap; font-size: .8rem; background: var(--panel-2, #f6f4f0); padding: 10px; border-radius: 6px; max-height: 320px; overflow: auto; }
.rn-row { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.rn-jobs { display: flex; flex-direction: column; gap: 14px; }
.rn-job { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.rn-job-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rn-job-head .grow { flex: 1; }
.rn-renders { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 10px; }
.rn-render { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.rn-render.posted { border-color: #6fae7a; }
.rn-render img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: cover; }
.rn-render-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.rn-render-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.rn-audit { font-size: .86rem; padding: 6px 8px; border-radius: 6px; background: var(--panel-2, #f6f4f0); }
.rn-audit.ok { border-left: 3px solid #6fae7a; }
.rn-audit.issues { border-left: 3px solid #d9a441; }
.rn-checks { margin: 4px 0 0 16px; padding: 0; }
.rn-checks li.bad { color: #9a5b00; }
.rn-legend ol { margin: 4px 0 0 18px; padding: 0; font-size: .86rem; }
.rn-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.cat-ra { display: inline-flex; align-items: center; gap: 10px; margin-left: 6px; flex-wrap: wrap; }
.cat-ra-row { grid-column: 2 / span 3; display: flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--text-2); }
.cat-ra-row img { width: 28px; height: 28px; object-fit: contain; background: #fff; border-radius: 4px; border: 1px solid var(--line); }
.cat-ra-row::before { content: 'Renders:'; }
.cat-render-asset { display: flex; align-items: center; gap: 12px; margin: 10px 0; padding: 8px; border: 1px dashed var(--line); border-radius: 8px; }
.cat-render-asset img { width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--line); }
@media (max-width: 720px) {
  .rn-pick { grid-template-columns: 1fr; }
  .rn-thumb-wrap { width: calc(50% - 5px); }
  .rn-thumb { width: 100%; }
  .rn-renders { grid-template-columns: 1fr; }
}
/* Render accuracy (14 Nov 2026): team picks, what the renderer sees, review scores, the catalog picker */
.rn-item.team { background: rgba(47,96,142,.06); border-radius: 6px; padding: 2px 4px; margin: 0 -4px; }
.badge.b-blue { background: rgba(47,96,142,.14); color: #1f4f7d; }
.rn-seen { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }
.rn-seen-item { width: 132px; display: flex; flex-direction: column; gap: 3px; font-size: .76rem; color: var(--text-2); }
.rn-seen-item img { width: 132px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.rn-mentions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -6px 0 10px; }
.rn-score { font-weight: 700; }
.rn-fix { margin: 2px 0 4px 18px; font-size: .82rem; color: var(--text-2); }
.rn-pick-list { display: flex; flex-direction: column; gap: 4px; max-height: 48vh; overflow: auto; margin-top: 6px; }
.rn-pick-row { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; cursor: pointer; font: inherit; color: inherit; }
.rn-pick-row:hover { border-color: var(--brand); }
.rn-pick-row img, .rn-pick-chosen img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #fff; flex: none; }
.rn-pick-nopic { width: 48px; height: 48px; display: grid; place-items: center; font-size: .66rem; color: var(--text-3); border: 1px dashed var(--line); border-radius: 6px; flex: none; text-align: center; }
.rn-pick-row .grow { flex: 1; min-width: 0; }
.rn-pick-chosen { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

/* Selections tab: renders on the portal (14 Nov 2026) */
.sel-renders { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.sel-render { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.sel-render img { display: block; width: 100%; height: 170px; object-fit: cover; }
.sel-render-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; }

/* finish pictures (15 Nov 2026) */
.cat-finish-pic{display:inline-flex;align-items:center;gap:8px;flex:none}
.cat-finish-pic .pic{width:34px;height:34px;border-radius:50%;overflow:hidden;border:1px solid var(--line, #d7dce2);background:#fff;flex:none}
.cat-finish-pic .pic img{width:100%;height:100%;object-fit:cover;transform:scale(2.1);transform-origin:66% 60%;display:block}
.cat-finish-row{flex-wrap:wrap}

/* portal access (16 Nov 2026) */
.pa-sections{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:6px 14px}
.pa-sec{display:flex;align-items:flex-start;gap:8px;padding:6px 8px;border:1px solid var(--line, #d7dce2);border-radius:8px;cursor:pointer;background:#fff}
.pa-sec input{margin-top:3px;flex:none}
.pa-sec span{display:flex;flex-direction:column;gap:1px;font-size:13px}
.pa-sec small{color:var(--muted, #6b7280);font-size:12px;line-height:1.35}
.pa-designer{border:1px solid var(--line, #d7dce2);border-radius:10px;padding:10px 12px;margin-bottom:10px;display:flex;flex-direction:column;gap:4px}
.pa-designer.dead{opacity:.7}
.pa-d-head{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.pa-d-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}

/* =====================================================================================================
   Calm release (Kyle, 17 Nov 2026) — the OS laid out like the client portal: a left rail instead of the
   top bar on wide screens, a Today strip on the Control Tower, project cards, one project header, an
   Overview that leads with what needs you, and the Selections tab folded. Nothing was removed: every
   filter, button and panel is still here, some behind a Filters button or a Show row.
   ===================================================================================================== */

/* ---- look: lighter headings, tracked labels, pill buttons, softer panels */
.page-head h1 { font-weight: 500; font-size: 26px; letter-spacing: -.01em; color: var(--brand); }
.page-head .eyebrow { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin-bottom: 4px; }
.page-head .sub { font-size: 13px; }
.kpi, .panel, .toolbar, .table-wrap, .pkg-card, .sel-stat, .sheet-room, .ws-head, .p-card, .card { border-color: transparent; box-shadow: var(--shadow-1); }
.panel > header { border-bottom-color: var(--border); }
.panel > header h3 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.kpi { padding: 16px 18px; }
.kpi .k-label { letter-spacing: .12em; font-size: 10.5px; }
.kpi .k-value { font-weight: 600; font-size: 27px; }
.kpi .k-value.currency { font-size: 23px; }
.kpi .k-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.btn, .chip-toggle { border-radius: 999px; }
.stage-chip { border-radius: 999px; border-color: transparent; }
table.grid thead th, .portfolio th { font-size: 10.5px; letter-spacing: .12em; }
.ws-tabs a { border-radius: 10px 10px 0 0; }
.alert { border-radius: var(--radius); }
.stat { border-color: transparent; background: var(--surface-2); }

/* ---- the left rail (wide screens only; phones and tablets keep the top bar they already have) */
@media (min-width: 1000px) {
  .app { flex-direction: row; align-items: stretch; }
  .topbar {
    position: sticky; top: 0; height: 100vh; height: 100dvh; width: 240px; flex: 0 0 240px; align-self: flex-start;
    flex-direction: column; align-items: stretch; gap: 4px; padding: 22px 14px 16px; overflow-y: auto;
    background: var(--surface); color: var(--text); border-bottom: 0; border-right: 1px solid var(--border); box-shadow: none;
  }
  .topbar .logo { padding: 2px 10px 18px; }
  .topbar .logo-img { height: 38px; filter: brightness(.42) sepia(.25); }   /* the white wordmark, back to its grey on a light rail */
  .topbar nav { flex-direction: column; gap: 2px; margin-left: 0; }
  .topbar nav a { color: var(--text-2); padding: 10px 14px; border-radius: 12px; font-size: 14px; font-weight: 500; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .topbar nav a:hover { background: var(--surface-3); color: var(--brand); }
  .topbar nav a.active { background: var(--accent-soft); color: var(--brand); box-shadow: none; font-weight: 600; }
  .topbar nav .nav-count { margin-left: auto; }
  .topbar .spacer { flex: 1; }
  .topbar .who { order: 1; text-align: left; color: var(--text-3); font-size: 12px; padding: 12px 12px 6px; border-top: 1px solid var(--border); margin-top: 8px; }
  .topbar .who strong { color: var(--text); font-size: 13.5px; }
  .topbar .account-menu { order: 2; }
  .topbar .btn-plain { order: 3; background: var(--surface); border-color: var(--border-strong); color: var(--brand); justify-content: center; display: inline-flex; align-items: center; border-radius: 999px; padding: 8px 12px; margin: 2px 8px 0; }
  .topbar .btn-plain:hover { background: var(--accent-soft); }
  .topbar .account-menu.active { background: var(--accent-soft); box-shadow: none; }
  main.page { flex: 1 1 auto; min-width: 0; padding: 28px 32px 72px; }
}

/* ---- Control Tower: the "Needs you today" strip was retired on 22 Nov 2026 (Kyle): its counts now sit on the
   project tiles as labels (.p-flags). */
.p-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.p-flags:empty { display: none; }
.p-flags .badge { font-weight: 600; }
.grid td .p-flags { margin-top: 4px; }
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .kpis.four { display: flex; } }

/* ---- Control Tower: filters behind one button on every screen; search, Needs My Attention and the view stay out */
.toolbar .filters-toggle { display: inline-flex; min-height: 34px; }
.toolbar .filters-toggle.has-active { border-color: var(--brand); color: var(--brand); font-weight: 650; }
.toolbar:not(.open) .field.filter { display: none; }
.toolbar:not(.open) .chip-toggle.secondary { display: none; }
.toolbar.open .field.filter { order: 4; }
.toolbar.open .chip-toggle.secondary { order: 4; }
.toolbar .view-switch { margin-left: auto; display: inline-flex; background: var(--surface-3); border-radius: 999px; padding: 3px; gap: 2px; }
.toolbar .view-switch button { border: 0; background: none; border-radius: 999px; padding: 5px 12px; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.toolbar .view-switch button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-1); }
.toolbar .sort-field select { min-width: 120px; }
@media (max-width: 760px) { .toolbar .view-switch { margin-left: 0; order: 6; } .toolbar .grow { display: none; } }

/* ---- Control Tower: project cards on every screen (the table is the other view) */
.portfolio.cards .table-wrap { display: none; }
.portfolio.cards .p-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.portfolio:not(.cards) .p-cards { display: none; }
@media (max-width: 760px) { .portfolio .p-cards { display: grid; gap: 10px; grid-template-columns: 1fr; } .portfolio .table-wrap { display: none; } }
.p-card { padding: 0; overflow: hidden; border-radius: 14px; display: flex; flex-direction: column; gap: 0; }
.p-card.attention { border-left: 0; box-shadow: inset 4px 0 0 var(--red), var(--shadow-1); }
/* Tiles (Kyle, 22 Nov 2026): a real picture band, 16:9, with the % complete on it */
.p-card .cover { aspect-ratio: 16 / 9; position: relative; display: flex; align-items: flex-end; padding: 10px 12px; background: linear-gradient(135deg, #e9e2d4, #f6f2ea); }
.p-card .cover.c2 { background: linear-gradient(135deg, #dce3e8, #f2f5f7); }
.p-card .cover.c3 { background: linear-gradient(135deg, #e3e7dc, #f4f6f0); }
.p-card .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.p-card .cover .pct { position: relative; background: rgba(255,255,255,.94); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 4px 10px; color: var(--brand); box-shadow: var(--shadow-1); }
.p-card .cover .wm { position: absolute; right: 14px; bottom: 6px; font-family: var(--display); font-size: 64px; font-weight: 600; color: rgba(26,58,82,.10); line-height: 1; letter-spacing: -.02em; }
.p-card .cover .tick { position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 6px; }
.p-card .cover .row-menu-btn { position: absolute; top: 8px; right: 8px; margin: 0; background: rgba(255,255,255,.85); border-radius: 8px; }
.p-card .body { padding: 12px 14px 10px; display: grid; gap: 7px; }
.p-card .p-name { font-size: 15px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.p-card .p-name small { font-weight: 400; color: var(--text-3); font-size: 12px; white-space: nowrap; }
.p-card .p-name small.city { font-size: 12.5px; }
.p-card .p-scope { font-size: 12.5px; color: var(--text-2); margin-top: -3px; }
.p-card .p-flags { margin-top: 0; }
.p-card .foot { border-top: 1px solid var(--border); padding: 9px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); margin-top: auto; }
.p-card .foot b { color: var(--text); font-size: 14px; font-variant-numeric: tabular-nums; }
.p-card .foot .kind { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sel-all-line { margin: 0 0 10px; font-size: 12.5px; color: var(--text-3); }
.sel-all-line .checkline { display: inline-flex; cursor: pointer; }
.p-card .cover.has-img .wm { display: none; }
@media (max-width: 760px) { .p-card .cover { aspect-ratio: 2 / 1; height: auto; } .p-card .cover:not(.has-img) { aspect-ratio: auto; height: 56px; } .p-card .cover .wm { font-size: 34px; } }

/* ---- Project page: one header, the four facts, the rest under More */
.ws-head.hero { background: var(--brand); color: #fff; border: 0; border-radius: 14px; padding: 22px 24px 18px; box-shadow: var(--shadow-2); }
.ws-head.hero h1 { color: #fff; font-weight: 500; font-size: 27px; letter-spacing: -.01em; }
.ws-head.hero .sub, .ws-head.hero .top a { color: rgba(255,255,255,.72) !important; }
.ws-head.hero .top a:hover { color: #fff !important; }
.ws-head.hero .flags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ws-head.hero .facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 4px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.16); }
.ws-head.hero .fact { min-width: 0; }
.ws-head.hero .fact.clickable { cursor: pointer; border-bottom: 0; }
.ws-head.hero .fact.clickable b { border-bottom: 1px dotted rgba(255,255,255,.45); padding-bottom: 1px; }
.ws-head.hero .fact.clickable:hover b { border-bottom-color: #fff; }
.ws-head.hero .fact small { display: block; font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.6); font-weight: 600; margin-bottom: 4px; }
.ws-head.hero .fact b { font-size: 17px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ws-head.hero .fact span.hint { font-size: 12px; color: rgba(255,255,255,.7); }
.ws-head.hero .fact .badge { font-size: 12px; }
.ws-head.hero .acts { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.ws-head.hero .acts .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.28); color: #fff; }
.ws-head.hero .acts .btn:hover { background: rgba(255,255,255,.18); }
.ws-head.hero .acts .btn.btn-primary { background: var(--accent); border-color: var(--accent); color: #111; }
.ws-head.hero .acts .btn.btn-primary:hover { background: #d0c6b0; border-color: #d0c6b0; }
.ws-head.hero .acts .btn.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
@media (max-width: 760px) { .ws-head.hero { padding: 16px 16px 14px; } .ws-head.hero .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ws-head.hero h1 { font-size: 22px; } }

/* ---- Overview: the Needs-you list and the folded facts */
.needs .nrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.needs .nrow:first-child { border-top: 0; }
.needs .nrow .ic { width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.needs .nrow.red .ic { background: var(--red-bg); color: var(--red); }
.needs .nrow.yellow .ic { background: var(--yellow-bg); color: var(--yellow); }
.needs .nrow .tx { flex: 1; min-width: 0; }
.needs .nrow .tx b { display: block; font-size: 13.5px; }
.needs .nrow .tx small { color: var(--text-3); font-size: 12px; display: block; }
.needs .nrow .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.needs .nrow.quiet { opacity: .8; }
@media (max-width: 640px) { .needs .nrow { flex-wrap: wrap; } .needs .nrow .acts { width: 100%; justify-content: flex-start; padding-left: 46px; } }
details.fold { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); margin-bottom: 14px; }
details.fold > summary { cursor: pointer; list-style: none; padding: 12px 16px; font-family: var(--display); font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: 'Show'; margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 500; }
details.fold[open] > summary::after { content: 'Hide'; }
details.fold > summary .muted { font-weight: 400; font-size: 12px; }
details.fold .panel { box-shadow: none; border-radius: 0; margin: 0; border-top: 1px solid var(--border); }
details.fold .panel:last-child { border-radius: 0 0 var(--radius) var(--radius); }

/* My order (Kyle, 17 Nov 2026): drag the Control Tower tiles into your own order */
.p-card .cover .grip { position: absolute; left: 10px; bottom: 8px; font-size: 15px; line-height: 1; color: var(--text-2); background: rgba(255,255,255,.85); border-radius: 6px; padding: 3px 5px; cursor: grab; opacity: 0; transition: opacity .15s; box-shadow: var(--shadow-1); }
.p-card:hover .cover .grip, .p-card:focus-within .cover .grip { opacity: 1; }
@media (hover: none) { .p-card .cover .grip { opacity: .9; } }
.p-cards.arranging .p-card { transition: transform .12s; }
.p-card.dragging { opacity: .45; outline: 2px dashed var(--brand); cursor: grabbing; }
.drag-hint { margin-top: 10px; }
.sort-field .btn-link.small { font-size: 12px; margin-left: 6px; }

/* Analytics → Portfolio today (Kyle, 17 Nov 2026): the Control Tower's old value tiles, as links */
.portfolio-today { margin-bottom: 18px; }
.portfolio-today .cap { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-weight: 700; margin: 0 0 10px; }
.portfolio-today a.kpi { display: block; color: inherit; text-decoration: none; }

/* Client change requests (Kyle, 17 Nov 2026): the client's photos as small pictures, full size on click */
.cr-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.cr-thumbs a { display: block; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-3); }
.cr-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cr-thumbs a:hover { border-color: var(--border-strong); box-shadow: var(--shadow-1); }

/* Analytics → Portfolio today with the expected-margin tile (margin roles): five across, wrapping on narrow screens */
.kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1180px) { .kpis.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .kpis.five { display: flex; } }

/* Lifecycle 2 (Kyle, 17 Nov 2026): the project plan — one block per stage, check items and milestones inside */
.lifecycle .plan-stage { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-1); margin-bottom: 10px; }
.lifecycle .plan-stage .hd { display: flex; align-items: center; gap: 10px; padding: 11px 14px; flex-wrap: wrap; }
.lifecycle .plan-stage .hd .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-2); flex: none; }
.lifecycle .plan-stage.done .hd .n { background: var(--green-bg); color: var(--green); }
.lifecycle .plan-stage.current .hd .n { background: var(--brand); color: #fff; }
.lifecycle .plan-stage.na { opacity: .62; }
.lifecycle .plan-stage.na .hd b { text-decoration: line-through; text-decoration-color: var(--text-3); }
.lifecycle .plan-stage .hd b { font-size: 15px; }
.lifecycle .plan-stage .hd .meta { color: var(--text-3); font-size: 12.5px; }
.lifecycle .plan-stage .hd .r { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.lifecycle .plan-stage .bd { padding: 0 14px 12px 50px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; border-top: 1px solid var(--border); padding-top: 10px; }
.lifecycle .plan-stage .bd h4 { margin: 0 0 4px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.lifecycle .plan-stage .bd .btn-link.small { font-size: 12.5px; margin-top: 6px; display: inline-block; }
.lifecycle .gate-item .btn-link.small { margin: 0 0 0 4px; color: var(--text-3); font-size: 15px; line-height: 1; }
.lifecycle .ms-row { display: flex; gap: 9px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--border); }
.lifecycle .ms-row:last-child { border-bottom: none; }
.lifecycle .ms-row .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); flex: none; margin-top: 6px; }
.lifecycle .ms-row.done .dot { background: var(--green); }
.lifecycle .ms-row.overdue .dot { background: var(--red); }
.lifecycle .ms-row .t { flex: 1; font-size: 13.5px; min-width: 0; }
.lifecycle .ms-row .act { display: flex; gap: 4px; flex: none; }
@media (max-width: 760px) { .lifecycle .plan-stage .bd { grid-template-columns: 1fr; padding-left: 14px; } }

/* Arrangeable Overview (Kyle, 17 Nov 2026): sections with a grip, two columns, drag between them */
.cols.arrangeable .col { min-width: 0; min-height: 60px; }
.cols.arrangeable .arrange-note { grid-column: 1 / -1; padding: 2px 4px 8px; }
.ov-sec { position: relative; }
.ov-sec .sec-grip { cursor: grab; color: var(--text-3); font-size: 15px; line-height: 1; padding: 2px 4px; margin-right: 2px; user-select: none; -webkit-user-select: none; touch-action: none; border-radius: 4px; }
.ov-sec .sec-grip:hover { color: var(--text); background: var(--surface-3); }
.ov-sec .sec-head { display: flex; align-items: center; gap: 6px; padding: 2px 2px 8px; }
.ov-sec .sec-head .sec-title { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.ov-sec.dragging { opacity: .55; outline: 2px dashed var(--brand); outline-offset: 2px; border-radius: var(--radius); }
.cols.arranging { cursor: grabbing; }
.cols.arranging .col { outline: 1px dashed var(--border-strong); outline-offset: 4px; border-radius: var(--radius); }
.sec-group > .panel:last-child { margin-bottom: 14px; }
details.fold > summary .sec-grip { margin-right: 6px; }

/* Settings → Stages & Gates */
.gate-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.gate-row:last-child { border-bottom: none; }
.gate-row .t { flex: 1; font-size: 13.5px; min-width: 0; }
h4.sub-h { margin: 0 0 6px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.ov-sec, .ov-sec .fold, .ov-sec .panel { min-width: 0; }
.ov-sec .table-wrap { overflow-x: auto; max-width: 100%; }
.ov-sec details.fold > .panel:first-of-type { margin-top: 10px; }
.ov-sec .panel > header { flex-wrap: wrap; row-gap: 6px; }
.ov-sec { overflow-x: clip; }
/* One record (Kyle, 19 Nov 2026): the project-record line under a field, and the inline new client */
.rec-line { font-size: 12px; margin-top: 4px; line-height: 1.4; }
.rec-line .btn-link.small { font-size: 12px; }
.new-client { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 10px 12px 6px; margin: -4px 0 12px; background: var(--surface-2); }
.nrow .row-acts { display: flex; gap: 6px; flex-wrap: wrap; }

/* Passkeys (Kyle, 20 Nov 2026): the sign-in button, the "or" rule under it, and the passkey rows on Security. */
.btn-passkey { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; padding: 11px 14px; }
.btn-passkey:hover { background: var(--brand-3); border-color: var(--brand-3); }
.btn-passkey:disabled { opacity: .6; }
.passkey-ico { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid currentColor; position: relative; }
.passkey-ico::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: currentColor; }
.login-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; color: var(--text-3); font-size: 12px; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.pk-list { margin: 4px 0 14px; border-top: 1px solid var(--border); }
.pk-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }


/* ---------------------------------------------------------------- Calendar (Kyle, 21 Nov 2026) */
.cal-head { flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.cal-tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; padding: 3px; background: var(--surface); }
.cal-tab { border: 0; background: transparent; font: inherit; font-weight: 600; padding: 6px 14px; border-radius: 999px; cursor: pointer; color: var(--text-2); }
.cal-tab.on { background: var(--brand); color: #fff; }
.cal-nav { display: inline-flex; align-items: center; gap: 6px; }
.cal-title { font-weight: 700; margin-left: 8px; font-size: 15px; }
.cal-filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin: 2px 0 14px; }
.cal-filters select { max-width: 260px; }
.cal-seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.cal-seg-btn { border: 0; background: var(--surface); font: inherit; font-size: 13px; padding: 6px 12px; cursor: pointer; color: var(--text-2); }
.cal-seg-btn.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.cal-kinds { display: inline-flex; gap: 6px; }
.cal-page.busy { opacity: .6; }
/* colours per kind */
.cal-kind-meeting.on { background: #1f4e79; border-color: #1f4e79; }
.cal-kind-site_work.on { background: #7a5c2e; border-color: #7a5c2e; }
.cal-kind-deadline.on { background: #a23b3b; border-color: #a23b3b; }
/* Calendar types (Kyle, 25 Nov 2026): Personal and Site Visit */
.cal-kind-personal.on { background: #6b5b8a; border-color: #6b5b8a; }
.cal-kind-site_visit.on { background: #2e7a78; border-color: #2e7a78; }
.cal-dot.personal { background: transparent; border: 2px solid #6b5b8a; width: 9px; height: 9px; box-sizing: border-box; }
.cal-dot.site_visit { background: #2e7a78; border-radius: 0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.cal-chip.personal { border-left-color: #6b5b8a; background: #eeebf3; }
.cal-chip.site_visit { border-left-color: #2e7a78; background: #e2f0ef; }
.tg-block.personal { border-left-color: #6b5b8a; background: #ebe7f1; }
.tg-block.site_visit { border-left-color: #2e7a78; background: #dfeeed; }
.tg-ghost.personal { border-color: #6b5b8a; color: #6b5b8a; } .tg-ghost.site_visit { border-color: #2e7a78; color: #2e7a78; }
.cal-row.personal .cal-row-when { color: #6b5b8a; } .cal-row.site_visit .cal-row-when { color: #2e7a78; }
.cal-line.personal .cal-line-when b { color: #6b5b8a; } .cal-line.site_visit .cal-line-when b { color: #2e7a78; }
.cal-personal-note { margin-top: 6px; }
.cal-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #1f4e79; vertical-align: middle; }
.cal-dot.site_work { background: #7a5c2e; border-radius: 2px; } .cal-dot.deadline { background: #a23b3b; transform: rotate(45deg); border-radius: 1px; }
/* month */
.cal-month { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
.cal-weekdays > div { padding: 8px 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 112px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.other { background: var(--surface-2); color: var(--text-3); }
.cal-cell.today .cal-daynum { background: var(--brand); color: #fff; }
.cal-daynum { align-self: flex-start; border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 700; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; color: inherit; }
.cal-daynum:hover { background: var(--brand-soft); }
.cal-chip { display: flex; align-items: baseline; gap: 4px; width: 100%; min-width: 0; border: 0; border-left: 3px solid #1f4e79; background: #e9f0f7; color: var(--text); font: inherit; font-size: 12px; line-height: 1.25; padding: 2px 6px; border-radius: 4px; cursor: pointer; text-align: left; text-decoration: none; overflow: hidden; }
.cal-chip .cal-chip-t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; flex: 0 1 auto; }
.cal-chip .cal-chip-p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-3); flex: 1 1 auto; }
.cal-chip .cal-chip-time { color: var(--text-3); font-weight: 600; flex: none; }
.cal-chip.site_work { border-left-color: #7a5c2e; background: #f3ece1; }
.cal-chip.deadline { border-left-color: #a23b3b; background: #f7e7e7; }
.cal-chip.private { outline: 1px dashed var(--text-3); outline-offset: -1px; }
.cal-chip.system { border-left-color: var(--border); background: transparent; color: var(--text-3); font-style: italic; }
.cal-chip.system .cal-chip-t { font-weight: 500; }
/* Google Calendar (Kyle, 23 Nov 2026): the viewer's own Google events — dashed, quiet, not clickable */
.cal-chip.google { border-left: 3px dashed #4a7a5a; background: rgba(74, 122, 90, 0.08); color: var(--text-2, var(--text)); cursor: default; }
.cal-row.google { color: var(--text-2, var(--text)); cursor: default; }
.cal-row.google .cal-row-when { color: #4a7a5a; }
.gcal-busy:not(:empty) { margin-top: 8px; padding: 6px 10px; border-radius: 6px; background: #fbf3e2; color: #6b4e12; }
.gcal-status { padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.gcal-team table { width: 100%; margin-top: 8px; }
.cal-more { border: 0; background: transparent; font: inherit; font-size: 11.5px; color: var(--brand); cursor: pointer; text-align: left; padding: 0 6px; }
/* week */
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-wcol { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; gap: 4px; min-height: 200px; min-width: 0; }
.cal-wcol.today { border-color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); }
.cal-wday { font-size: 12px; color: var(--text-3); margin-bottom: 4px; } .cal-wday span { font-size: 16px; color: var(--text); font-weight: 700; }
.cal-empty { color: var(--text-3); font-size: 12px; padding: 4px 6px; }
.cal-add { margin-top: auto; border: 1px dashed var(--border); background: transparent; color: var(--text-3); border-radius: 6px; cursor: pointer; font: inherit; }
.cal-add:hover { color: var(--brand); border-color: var(--brand); }
/* Day and This Week: the hour grid (Kyle, 24 Nov 2026) */
.cal-gridwrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.tg { min-width: 100%; }
.tg-row { display: grid; }
.tg-head { border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 3; }
.tg-colhead { padding: 8px 8px; font-size: 12.5px; color: var(--text-3); border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tg-colhead.today { color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand); }
.tg-colhead .tg-daynum { font-size: 16px; color: var(--text); font-weight: 700; }
.tg-colhead.today .tg-daynum { color: var(--brand); }
.tg-gutter { font-size: 10.5px; color: var(--text-3); text-align: right; padding: 6px 6px 0 0; }
.tg-allday { border-bottom: 1px solid var(--border); min-height: 30px; }
.tg-adcell { border-left: 1px solid var(--border); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tg-busy-chip { font-size: 11px; color: var(--text-3); background: repeating-linear-gradient(45deg, #eee, #eee 4px, #f6f6f6 4px, #f6f6f6 8px); border-radius: 4px; padding: 2px 6px; }
.tg-scroll { max-height: 620px; overflow-y: auto; }
.tg-body { position: relative; }
.tg-hours { position: relative; }
.tg-hour { position: absolute; right: 6px; transform: translateY(-6px); font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.tg-col { position: relative; border-left: 1px solid var(--border); min-width: 0;
  background-image: repeating-linear-gradient(to bottom, var(--border) 0, var(--border) 1px, transparent 1px, transparent 48px); }
.tg-col.today { background-color: rgba(31, 78, 121, 0.03); }
.tg-now { position: absolute; left: 0; right: 0; height: 2px; background: #c0392b; z-index: 2; pointer-events: none; }
.tg-block { position: absolute; display: flex; flex-direction: column; align-items: flex-start; overflow: hidden; border: 0; border-left: 3px solid #1f4e79; background: #e1eaf3;
  color: var(--text); font: inherit; font-size: 11.5px; line-height: 1.25; padding: 2px 6px; border-radius: 5px; text-align: left; cursor: pointer; z-index: 1; }
.tg-block.can-edit { cursor: grab; }
.tg-block.site_work { border-left-color: #7a5c2e; background: #f1e8da; }
.tg-block.deadline { border-left-color: #a23b3b; background: #f5e3e3; }
.tg-block.google { border-left: 3px dashed #4a7a5a; background: #e9f1ec; }
.tg-block.changed { box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.tg-block.dragging { opacity: .35; }
.tg-block:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.tg-b-time { color: var(--text-3); font-weight: 600; white-space: nowrap; }
.tg-b-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tg-b-loc { color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tg-resize { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; cursor: ns-resize; }
.tg-ghost { position: absolute; left: 2px; right: 2px; border-radius: 5px; border: 2px dashed #1f4e79; background: rgba(31,78,121,.12); font-size: 11px; font-weight: 700; color: #1f4e79; padding: 2px 6px; pointer-events: none; z-index: 4; }
.tg-ghost.site_work { border-color: #7a5c2e; color: #7a5c2e; } .tg-ghost.deadline { border-color: #a23b3b; color: #a23b3b; } .tg-ghost.google { border-color: #4a7a5a; color: #4a7a5a; }
.tg-busy { position: absolute; left: 2px; right: 2px; border-radius: 5px; font-size: 11px; color: var(--text-3); padding: 2px 6px; z-index: 0;
  background: repeating-linear-gradient(45deg, #ececec, #ececec 5px, #f5f5f5 5px, #f5f5f5 10px); }
.cal-chip.can-edit { cursor: grab; }
.cal-chip.google { cursor: pointer; }
.cal-chip.dragging { opacity: .35; }
.chip-ghost { position: fixed; z-index: 1000; pointer-events: none; width: 160px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.drop-target { outline: 2px dashed var(--brand); outline-offset: -2px; background: var(--brand-soft) !important; }
.cal-byperson { margin-left: 8px; }
.cal-note { margin: 8px 12px; }
.cal-ask .cal-ask-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.toast-undo { margin-left: 8px; border: 1px solid currentColor; background: transparent; color: inherit; border-radius: 6px; padding: 1px 8px; font: inherit; font-weight: 600; cursor: pointer; }
/* agenda + rows */
.cal-agenda-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 10px; }
.cal-agenda-day h3 { margin: 0 0 6px; font-size: 13.5px; }
.cal-row { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 2px 12px; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--border); background: transparent; font: inherit; padding: 8px 2px; cursor: pointer; color: var(--text); text-decoration: none; align-items: baseline; }
.cal-row:first-of-type { border-top: 0; }
.cal-row .cal-row-when { font-weight: 600; font-size: 13px; color: var(--text-2); }
.cal-row .cal-row-title { font-weight: 600; }
.cal-row > .muted { grid-column: 2; font-size: 12.5px; }
.cal-row.meeting .cal-row-when { color: #1f4e79; } .cal-row.site_work .cal-row-when { color: #7a5c2e; } .cal-row.deadline .cal-row-when { color: #a23b3b; }
.cal-row.system { color: var(--text-3); font-style: italic; }
/* view dialog */
.cal-view-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.cal-view-row .k { color: var(--text-3); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding-top: 2px; }
.cal-view-row .v { white-space: pre-wrap; }
/* form */
.cal-form .cal-when-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.cal-picklist { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; max-height: 150px; overflow: auto; padding: 2px 0; }
.cal-picklist.inline { max-height: none; }
.cal-pick { white-space: nowrap; }
.cal-client { margin: 8px 0 0 24px; padding: 8px 12px; border-left: 3px solid var(--brand-soft); }
/* lines on the Control Tower and a project's Overview */
.cal-line { display: grid; grid-template-columns: 14px 78px minmax(0, 1fr); gap: 0 10px; align-items: start; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--border); background: transparent; font: inherit; padding: 7px 0; cursor: pointer; color: var(--text); text-decoration: none; }
.cal-line:first-child { border-top: 0; }
.cal-line .cal-dot { margin-top: 5px; }
.cal-line .cal-line-when { display: flex; flex-direction: column; line-height: 1.25; }
.cal-line .cal-line-when b { font-size: 12.5px; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.cal-line .cal-line-when small { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }
.cal-line.meeting .cal-line-when b { color: #1f4e79; } .cal-line.site_work .cal-line-when b { color: #7a5c2e; } .cal-line.deadline .cal-line-when b { color: #a23b3b; }
.cal-line .cal-line-title { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-line > .muted { grid-column: 3; font-size: 12px; }
.cal-line:hover .cal-line-title { color: var(--brand); }
.cal-line.system { color: var(--text-3); font-style: italic; }
.cal-line.system .cal-line-title { font-weight: 500; }
.cal-dot.system { background: var(--border); }
/* Control Tower: happening today / later this week */
.happening { margin: -4px 0 18px; }
.hap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hap-col { margin-bottom: 0; }
.hap-list { padding: 2px 14px 4px; }
.hap-empty { padding: 12px 14px; margin: 0; }
.hap-foot { display: flex; gap: 18px; justify-content: flex-end; padding: 8px 4px 0; font-size: 13px; }
@media (max-width: 900px) { .hap-grid { grid-template-columns: 1fr; } }
/* a project's Overview: Coming up / On site */
.sched-list { padding: 2px 14px 4px; }
.sched-cap { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); font-weight: 600; margin: 10px 14px 0; }
.sched-empty { padding: 10px 14px 12px; margin: 0; }
@media (max-width: 900px) {
  .cal-grid .cal-cell { min-height: 64px; padding: 2px 3px; }
  .cal-cell .cal-chip .cal-chip-t { display: none; }
  .cal-cell .cal-chip { height: 6px; padding: 0; border-left-width: 0; border-radius: 3px; }
  .cal-cell .cal-chip.meeting { background: #1f4e79; } .cal-cell .cal-chip.site_work { background: #7a5c2e; } .cal-cell .cal-chip.deadline { background: #a23b3b; } .cal-cell .cal-chip.personal { background: #6b5b8a; } .cal-cell .cal-chip.site_visit { background: #2e7a78; } .cal-cell .cal-chip.system { background: var(--border); } .cal-cell .cal-chip.google { background: #4a7a5a; opacity: .5; }
  .cal-cell .cal-more { font-size: 10px; padding: 0; }
  .cal-week { grid-template-columns: 1fr; }
  .tg-scroll { max-height: 520px; }
  .cal-form .cal-when-row { grid-template-columns: 1fr; }
  .cal-row { grid-template-columns: 1fr; }
  .cal-row > .muted { grid-column: 1; }
}

/* Project picture dialog (tiles, 22 Nov 2026) */
.hero-preview { aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #e9e2d4, #f6f2ea); display: flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.hero-preview img { width: 100%; height: 100%; object-fit: cover; }
.hero-empty { color: var(--text-3); font-size: 13px; padding: 20px; text-align: center; }
.hero-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hero-row input[type="file"] { display: none; }
.hero-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; margin-top: 6px; }
.hero-opt { border: 2px solid transparent; border-radius: 8px; padding: 0; background: var(--surface-2); cursor: pointer; font: inherit; overflow: hidden; text-align: left; color: var(--text-2); }
.hero-opt img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.hero-opt .hero-cap { display: block; font-size: 11px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-opt.on { border-color: var(--brand); color: var(--brand); }
.hero-opt.none .hero-none { display: flex; align-items: center; justify-content: center; aspect-ratio: 3 / 2; font-size: 11.5px; color: var(--text-3); background: linear-gradient(135deg, #e9e2d4, #f6f2ea); }

/* ---- Team messaging (Kyle, 22 Nov 2026) */
.team-head { display: flex; align-items: center; }
.tm-av { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; flex: 0 0 26px; font-size: 11px; font-weight: 700; background: var(--brand-soft); color: var(--brand); }
.tm-av.k-everyone { background: #1f4e79; color: #fff; font-size: 13px; }
.tm-av.k-group { background: #efe7d8; font-size: 12px; }
.tm-av.k-project { background: #e8eef3; color: #1f4e79; font-size: 13px; }
.msg-item.team .mi-top b { margin-left: 2px; }
.msg-item.team .mi-last { padding-left: 32px; }
.tm-person { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: transparent; font: inherit; color: var(--text); text-align: left; padding: 7px 4px; border-radius: 6px; cursor: pointer; }
.tm-person:hover { background: var(--surface-2); }
.tm-private { margin-top: 2px; font-size: 11.5px; }
.tm-thread { gap: 2px; }
.tm-day { align-self: center; font-size: 11.5px; color: var(--text-3); letter-spacing: .04em; margin: 12px 0 6px; }
.tm-earlier { align-self: center; margin-bottom: 6px; }
.tm-msg { display: flex; gap: 8px; align-items: flex-start; max-width: 82%; margin: 4px 0; }
.tm-msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.tm-col { display: flex; flex-direction: column; min-width: 0; }
.tm-msg.mine .tm-col { align-items: flex-end; }
.tm-meta { font-size: 11.5px; color: var(--text-3); margin: 0 4px 2px; }
.tm-own { margin-left: 6px; }
.tm-own .btn-link { font-size: 11.5px; }
.tm-bubble { background: var(--surface); border-radius: 12px; border-top-left-radius: 4px; padding: 8px 12px; font-size: 14px; line-height: 1.45; box-shadow: var(--shadow-1); min-width: 0; }
.tm-msg.mine .tm-bubble { background: var(--brand); color: #fff; border-top-left-radius: 12px; border-top-right-radius: 4px; }
.tm-msg.at-me .tm-bubble { box-shadow: 0 0 0 2px #c9a24a, var(--shadow-1); }
.tm-bubble.deleted { background: transparent !important; color: var(--text-3) !important; font-style: italic; box-shadow: none; border: 1px dashed var(--border); }
.tm-body { white-space: pre-wrap; word-break: break-word; }
.tm-mention { font-weight: 700; background: rgba(201,162,74,.18); border-radius: 4px; padding: 0 2px; }
.tm-msg.mine .tm-mention { background: rgba(255,255,255,.22); }
.tm-proj { display: inline-block; font-size: 12px; font-weight: 600; text-decoration: none; background: rgba(31,78,121,.08); color: inherit; border-radius: 999px; padding: 1px 8px; margin-bottom: 4px; }
.tm-imgs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tm-imgs img { display: block; max-width: 220px; max-height: 180px; border-radius: 8px; object-fit: cover; }
.tm-files { display: grid; gap: 4px; margin-top: 6px; }
.tm-file { display: inline-block; font-size: 13px; text-decoration: none; color: inherit; background: rgba(0,0,0,.05); border-radius: 6px; padding: 4px 8px; }
.tm-msg.mine .tm-file { background: rgba(255,255,255,.16); }
.tm-seen { font-size: 11px; color: var(--text-3); margin: 3px 4px 0; }
.tm-composer textarea { min-height: 0; }
.tm-composer.compact { border-top: 0; padding: 8px 14px 12px; }
.tm-ta-wrap { position: relative; }
.tm-pop { position: absolute; left: 8px; bottom: calc(100% + 4px); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-2, 0 6px 24px rgba(0,0,0,.12)); padding: 4px; z-index: 30; min-width: 220px; display: grid; }
.tm-pop[hidden] { display: none; }
.tm-pop-item { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; font: inherit; text-align: left; padding: 6px 8px; border-radius: 6px; cursor: pointer; color: var(--text); }
.tm-pop-item.on, .tm-pop-item:hover { background: var(--brand-soft); }
.tm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-chips:empty { display: none; }
.tm-chip { font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 4px 2px 10px; }
.tm-chip.busy { opacity: .7; }
.tm-bar { display: flex; align-items: center; gap: 10px; }
.tm-mini { padding: 4px 14px; display: grid; gap: 8px; }
.tm-mini-body { font-size: 13px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 760px) { .tm-msg { max-width: 94%; } .tm-imgs img { max-width: 160px; } }
.msg-list { grid-template-columns: minmax(0, 1fr); }   /* long names/snippets ellipsize instead of widening the list */

/* Milroy Projects (Kyle, 23 Nov 2026): the company's own work — no contract, no value, no client */
.b-milroy { color: #6b5a2e; background: rgba(192,181,157,.28); border-color: rgba(160,140,95,.45); }
.milroy-note { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin-bottom: 10px; border-radius: 8px;
  background: rgba(192,181,157,.14); border: 1px solid rgba(160,140,95,.30); font-size: 13px; color: var(--text-2); }
.milroy-note p { margin: 0; line-height: 1.5; }
.gate-item .na-mark { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; font-weight: 700; color: var(--text-3); }
.gate-item.na .gate-label { color: var(--text-3); }
@media (max-width: 760px) { .milroy-note { flex-direction: column; gap: 6px; } }
.ws-head.hero .b-milroy { color: #f3ead2; background: rgba(192,181,157,.22); border-color: rgba(214,200,165,.55); }

/* Google Drive folders (Kyle, 23 Nov 2026) */
.drive-crumbs { margin: 0 0 10px; font-size: 13px; }
.drive-crumbs a { color: var(--link, inherit); }
.drive-list tbody tr td:first-child { overflow-wrap: anywhere; }
.drive-ico { display: inline-block; width: 22px; }
.drive-suggest { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid var(--line, #e6e1d7); border-radius: 8px; margin-bottom: 6px; flex-wrap: wrap; }

/* Settings → Notifications (Kyle, 23 Nov 2026) */
.notify-grid td input[type="checkbox"] { width: 20px; height: 20px; }
.notify-grid td:first-child { min-width: 220px; }
.device-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line, #e6e1d7); }
.steps-list { margin: 6px 0 8px 18px; padding: 0; line-height: 1.6; }
label.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; }
label.check input { margin-top: 3px; flex: none; }
@media (max-width: 760px) { .notify-grid td:first-child { min-width: 0; } }

/* Contract workflow (Kyle, 25 Nov 2026): the "Generate/Upload Contract" header button, its chooser, and the contract page. */
.btn-gold { background: var(--accent); border-color: var(--accent-2); color: #1d1b17; font-weight: 650; }
.btn-gold:hover { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.ws-head.hero .acts .btn.btn-gold { background: var(--accent); border-color: var(--accent); color: #111; box-shadow: 0 0 0 3px rgba(192,181,157,.28); }
.ws-head.hero .acts .btn.btn-gold:hover { background: #d0c6b0; border-color: #d0c6b0; }
.ws-head.hero .acts .btn.contract-cta.waiting { border-style: dashed; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 18px 16px; min-height: 150px;
  background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; font: inherit; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.choice-card:hover, .choice-card:focus-visible { border-color: var(--brand); box-shadow: var(--shadow-1); }
.choice-card b { font-size: 16px; color: var(--brand); }
.choice-icon { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 20px; }
@media (max-width: 560px) { .choice-grid { grid-template-columns: 1fr; } .choice-card { min-height: 0; } }

.cpage .crumb { font-size: 12px; color: var(--text-3); margin-bottom: 2px; }
.cp-bar { position: static; z-index: 5; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 0; margin: -6px 0 12px; background: var(--bg); border-bottom: 1px solid var(--border); }
.cp-bar .spacer { flex: 1; }
.cp-save { font-size: 12.5px; color: var(--text-3); }
.cp-save.ok::before { content: '✓ '; color: var(--green); }
.cp-save.err { color: var(--red); font-weight: 600; }
.cp-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.cp-nav { position: static; display: grid; gap: 4px; }
.cp-navitem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: var(--radius-s); background: none; font: inherit; font-size: 13.5px; color: var(--text-2); text-align: left; cursor: pointer; }
.cp-navitem:hover { background: var(--surface-3); }
.cp-navitem.active { background: var(--surface); color: var(--brand); font-weight: 600; box-shadow: var(--shadow-1); }
.cp-stepno { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 700; color: var(--text-3); background: var(--surface); }
.cp-navitem.done .cp-stepno { background: var(--green); border-color: var(--green); color: #fff; font-size: 0; }
.cp-navitem.done .cp-stepno::after { content: '✓'; font-size: 12px; }
.cp-step { scroll-margin-top: 16px; }
@media (min-width: 1000px) { .cp-bar { position: sticky; top: 0; } .cp-nav { position: sticky; top: 76px; } .cp-step { scroll-margin-top: 76px; } }
.cp-step > header h3 { display: flex; align-items: center; gap: 10px; }
.cp-step > header .cp-stepno { border-color: var(--accent); color: var(--brand); }
.cp-body textarea { width: 100%; }
.cp-row { display: flex; gap: 8px; align-items: center; }
.cp-row input { flex: 1; }
.cp-num { font-family: var(--display); font-weight: 600; color: var(--accent-2); width: 22px; }
.cp-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.cp-amt { width: 120px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 13px; }
.cp-warn { color: var(--red) !important; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.alert-ok { background: var(--green-bg); border-color: var(--green-br); color: var(--green); }
.cp-status { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cp-ai { border: 1.5px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 8px; }
.cp-ai-head { display: grid; gap: 2px; margin-bottom: 10px; }
.cp-ai-head b { color: var(--brand); font-size: 14.5px; }
.cp-ai textarea { background: var(--surface); }
.cp-ai-picks { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.cp-ai-cards { display: grid; gap: 12px; }
.cp-ai-card { border: 1px solid var(--border-strong); border-radius: var(--radius-s); padding: 12px 14px; background: var(--surface); }
.cp-ai-card.used { border-color: var(--green-br); background: var(--green-bg); }
.cp-ai-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.cp-ai-card h4 { margin: 0 0 6px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.cp-ai-text { font-size: 13.5px; max-height: 320px; overflow: auto; }
.cp-ai-text p { margin: 0 0 8px; }
.cp-ai-text ul { margin: 4px 0 10px; padding-left: 18px; }
.cp-ai-group b { font-family: var(--display); color: var(--brand); }
.cp-ai-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; font-size: 13.5px; }
.cp-ai-cols ul { padding-left: 18px; margin: 4px 0; }
.cp-ai-sent { margin: 12px 0 0; }
@media (max-width: 860px) {
  .cp-layout { grid-template-columns: minmax(0, 1fr); }
  .cp-nav { position: static; min-width: 0; grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; background: var(--bg); padding: 6px 0; }
  .cp-navitem span:last-child { white-space: nowrap; }
  .form-grid-3, .cp-ai-cols { grid-template-columns: 1fr; }
}
/* Draft with AI — edit a suggestion in the pop-up before using it (Kyle, 25 Nov 2026) */
.cp-ai-card.editing { border-color: var(--brand); box-shadow: 0 0 0 3px var(--accent-soft); }
.cp-ai-edit textarea { width: 100%; font-size: 13.5px; }
.cp-ai-edit .ct-group { background: var(--surface-2); }
.cp-ai-edit .cp-row input { flex: 1; }
/* Client portal button in the project header (Kyle, 25 Nov 2026): until the portal is active */
.ws-head.hero .acts .btn.portal-cta { background: #fff; border-color: #fff; color: var(--brand); font-weight: 650; }
.ws-head.hero .acts .btn.portal-cta:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.ws-head.hero .acts .btn.portal-cta.reactivate { background: transparent; color: #fff; border-color: #fff; border-style: dashed; }
/* Sign-in (Kyle, 25 Nov 2026): automatic Face ID / Touch ID, forgot password, and the security set-up prompt */
.login-auto { display: flex; align-items: center; gap: 14px; padding: 18px 4px 10px; }
.passkey-ico.big { width: 34px; height: 34px; border-width: 3px; color: var(--brand); }
.passkey-ico.big::after { width: 10px; height: 10px; margin: -5px 0 0 -5px; }
.login-choices { display: grid; gap: 10px; margin-top: 12px; }
.form-row .login-pw-label { display: flex; justify-content: space-between; align-items: baseline; }
.login-forgot { font-weight: 400; font-size: 12.5px; }
.login-links { margin-top: 8px; font-size: 13px; }
.login-links.center { text-align: center; margin-top: 14px; }
.login-h2 { font-size: 18px; margin: 0 0 6px; }
.sec-item { display: grid; grid-template-columns: 26px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.sec-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; }
.sec-item.done .sec-check { background: var(--green); border-color: var(--green); }
.sec-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 520px) { .sec-item { grid-template-columns: 26px 1fr; } .sec-item > :last-child { grid-column: 2; justify-self: start; } .sec-acts { justify-content: flex-start; } }
/* Project Photos (Kyle, 25 Nov 2026) */
.photos-tab .panel-body { display: grid; gap: 14px; }
.ph-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ph-head h3 { flex: 1; }
.ph-tools { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.ph-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.ph-buttons .btn { padding: 11px 16px; font-size: 15px; }
.ph-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph-status { display: none; font-size: 13px; padding: 8px 12px; border-radius: var(--radius-s); background: var(--accent-soft); color: var(--brand); }
.ph-status.on { display: block; }
.ph-status.warn { background: var(--yellow-bg, #fff6db); color: var(--yellow, #8a6100); }
.ph-day h4 { margin: 6px 0 8px; font-size: 13px; letter-spacing: .03em; color: var(--text-2); }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ph-tile { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: var(--radius-s); overflow: hidden; background: var(--surface-3); cursor: pointer; }
.ph-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-noimg { font-size: 28px; display: flex; align-items: center; justify-content: center; height: 100%; }
.ph-badge, .ph-shared, .ph-area { position: absolute; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.ph-badge { left: 6px; top: 6px; background: rgba(0,0,0,.62); color: #fff; }
.ph-shared { right: 6px; top: 6px; background: var(--green); color: #fff; }
.ph-area { left: 6px; bottom: 6px; right: 6px; background: rgba(0,0,0,.55); color: #fff; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; font-weight: 500; }
.ph-empty { padding: 30px 10px; text-align: center; }
.ph-view { display: grid; gap: 10px; }
.ph-big { width: 100%; max-height: 70vh; object-fit: contain; background: #111; border-radius: var(--radius-s); }
.ph-share { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; font-weight: 600; }
@media (max-width: 640px) {
  .ph-fields { grid-template-columns: 1fr; }
  .ph-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .ph-area { display: none; }
  .ph-buttons .btn { flex: 1 1 100%; }
}

/* Create Drive Folder (25 Nov 2026) */
.drive-nofolder-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.drive-new-subs { margin: 4px 0 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.drive-new-subs ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 4px 12px; }
.drive-new-subs li { font-size: 13px; display: flex; gap: 6px; align-items: baseline; min-width: 0; overflow-wrap: anywhere; }
.drive-new input[type="text"] { width: 100%; }

/* Client communications (25 Nov 2026) */
.cc-needs ul { margin: 4px 0 0; padding-left: 18px; }
.cc-list { display: flex; flex-direction: column; }
.cc-row { padding: 8px 0; border-bottom: 1px solid var(--border); min-width: 0; }
.cc-row:last-child { border-bottom: 0; }
.cc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cc-what { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.cc-when { white-space: nowrap; }
.cc-sub { color: var(--text-2); overflow-wrap: anywhere; margin-top: 2px; }
.cc-err { color: var(--red); background: var(--red-bg); border-radius: 6px; padding: 4px 8px; margin: 4px 0; overflow-wrap: anywhere; }

.cc-visits { margin-top: 14px; }
.cc-visit { padding: 6px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.cc-visit:last-child { border-bottom: 0; }
.test-note:empty { display: none; }

/* Settings shows only its own menu (Kyle, 26 Nov 2026): the main menu hides; Back brings it back. */
.topbar-back-label { display: none; }
body.in-settings .topbar nav { display: none !important; }
body.in-settings .topbar-back, body.in-settings .topbar-back[hidden] { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); border-radius: 8px; color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
body.in-settings .topbar-back-label { display: inline; font-size: 14px; font-weight: 600; }
@media (min-width: 1000px) {
  .topbar .logo { order: -1; }
  body.in-settings .topbar-back { justify-content: flex-start; margin: 0 0 6px; padding: 10px 14px; border-radius: 12px;
    background: var(--surface-3); border: 1px solid var(--border); color: var(--brand); }
}

/* Team set-up status (26 Nov 2026) */
.su-summary { margin-bottom: 14px; }
.su-sum-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.su-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 360px; }
.su-chip { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); white-space: nowrap; }
.su-chip.su-done { background: var(--green-bg); border-color: var(--green-br); color: var(--green); }
.su-chip.su-check { background: var(--yellow-bg); border-color: var(--yellow-br); color: var(--yellow); }
.su-chip.su-missing { background: var(--red-bg); border-color: var(--red-br); color: var(--red); }
.su-chip.su-off { background: var(--surface-2); color: var(--text-3); }
.su-chip.su-optional.su-missing { background: var(--surface-2); border-color: var(--border); color: var(--text-3); }
.su-acts { margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Analytics rebuild (Kyle, 26 Nov 2026) */
.an-section { margin-top: 22px; }
.an-period select { min-width: 160px; }
.an-missing { border: 1px solid var(--border); border-left: 3px solid var(--yellow); border-radius: 10px; padding: 10px 14px; margin: 4px 0 8px; background: var(--surface, #fff); }
.an-missing summary { cursor: pointer; }
.an-missing ul { margin: 8px 0 2px; padding-left: 18px; }
.an-missing li { margin: 3px 0; font-size: 13.5px; }

/* Client contacts (Kyle, 26 Nov 2026) */
.cc-head { margin: 14px 0 2px; font-size: 13px; }
.cc-contact { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 6px; margin: 8px 0; }
.cc-grid { grid-template-columns: 1fr 1.4fr 1fr; }
.cc-flags { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: -2px; }
.cc-flags .btn-link { margin-left: auto; }
@media (max-width: 640px) { .cc-grid { grid-template-columns: 1fr; } .cc-flags .btn-link { margin-left: 0; } }
.cal-client-invites .cal-pick { display: inline-flex; margin-right: 14px; }
.cc-people { display: grid; gap: 6px; }
.cc-person .muted { font-size: 12.5px; }
.suggest-wrap { position: relative; }
.suggest-list { position: absolute; left: 0; right: 0; z-index: 30; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); margin-top: 4px; max-height: 280px; overflow-y: auto; }
.suggest-item { padding: 8px 12px; cursor: pointer; font-size: 13.5px; }
.suggest-item.active, .suggest-item:hover { background: var(--bg-2, #f4f1ea); }
.suggest-item .small { font-size: 11.5px; }

/* Weekly project review (Kyle, 27 Nov 2026) */
.wr-card { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px 6px; margin-top: 8px; }
.wr-head { font-size: 16px; margin-bottom: 10px; }
.wr-seg { display: inline-flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.wr-opt { border: 1px solid var(--border); background: transparent; border-radius: 999px; padding: 6px 14px; font: inherit; cursor: pointer; }
.wr-opt.on.wr-on_track { background: #e6f2ea; border-color: #2f7a4b; color: #1f5a36; }
.wr-opt.on.wr-at_risk { background: #fbf1dc; border-color: #b7862a; color: #7a5612; }
.wr-opt.on.wr-behind { background: #fbeae8; border-color: #a23b3b; color: #7d2626; }
.wr-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0; }
.wr-checks { margin: 8px 0 4px; display: grid; gap: 4px; }
.wr-move { margin: 6px 0 2px; }
.wr-move.on { background: #e6f2ea; border-color: #2f7a4b; }
.wr-ms { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 3px 0; }
.wr-fc input { width: 150px; }
.wr-add { display: grid; grid-template-columns: 1fr 150px auto auto; gap: 8px; align-items: center; margin: 6px 0; }
@media (max-width: 640px) { .wr-add { grid-template-columns: 1fr; } }
.wr-mark { font-size: 11.5px; margin-top: 3px; }
.wr-mark.ok { color: #2f7a4b; }
.wr-mark.due { color: #a06a12; }
/* Weekly review: any stage (Kyle, 30 Nov 2026) */
.wr-stage { min-width: 260px; max-width: 100%; }
.wr-why { margin: 6px 0 2px; display: grid; gap: 4px; }
/* From Google Drive in the upload dialogs (Kyle, 2 Dec 2026) */
.dp-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.dp-picked { color: var(--ok, #2f7a4b); overflow-wrap: anywhere; }
.dp-crumbs { margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.dp-list { display: grid; gap: 4px; max-height: 60vh; overflow: auto; }
.dp-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--surface); font: inherit; cursor: pointer; }
.dp-item:hover { background: var(--surface-2); }
.dp-icon { flex: none; }
.dp-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ---------------------------------------------- Control Tower overview, Leads (Kyle, 27 Nov 2026) */
.ct-kpis { margin-bottom: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
a.ct-kpi { color: inherit; text-decoration: none; display: block; }
.ct-kpi .k-sub { margin-top: 3px; }
.ct-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
@media (max-width: 900px) { .ct-grid { grid-template-columns: 1fr; } }
.ct-list { padding: 4px 6px 6px; }
.ct-line { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--radius-s); color: inherit; text-decoration: none; font-size: 13px; }
a.ct-line:hover { background: var(--surface-2); }
.ct-line .badge { flex: none; }
.ct-line-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ct-activity { align-items: baseline; }
.ct-activity .ct-line-name { white-space: normal; }
.ct-when { flex: none; width: 118px; }
.ct-more { padding: 4px 10px 8px; }
.view-switch.lead-status { margin: 0 0 12px; display: inline-flex; background: var(--surface-3); border-radius: 999px; padding: 3px; gap: 2px; }
.view-switch.lead-status button { border: 0; background: none; border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.view-switch.lead-status button.on { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-1); }
.lost-reasons { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
@media (max-width: 600px) { .lost-reasons { grid-template-columns: 1fr; } .ct-when { width: 92px; } }
.badge.b-lead { background: #eef3fb; color: #2b4c7e; border: 1px solid #c9d7ee; }
@media (max-width: 600px) {
  .ct-line { flex-wrap: wrap; row-gap: 2px; }
  .ct-line > .muted.small:last-child:not(.ct-when) { flex-basis: 100%; }
  .ct-line-name { white-space: normal; }
}
/* Control Tower: customizable tiles (Kyle, 5 Dec 2026) */
.ct-grid { align-items: start; }
.ct-grid > .panel, .ct-grid > .ct-edit-wrap { margin: 0; }
.ct-span { grid-column: 1 / -1; }
.ct-span .happening { margin: 0; }
.ct-editing .ct-edit-wrap { position: relative; outline: 2px dashed var(--line-strong, #c9c2b4); outline-offset: 3px; border-radius: var(--radius); cursor: grab; }
.ct-editing .ct-edit-wrap.dragging { opacity: .45; }
.ct-editing .ct-edit-wrap > a { pointer-events: none; }
.ct-edit-bar { display: flex; gap: 4px; justify-content: flex-end; align-items: center; padding: 2px 2px 4px; }
.ct-edit-bar .btn-icon { min-width: 30px; height: 30px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; font-size: 12px; }
.ct-edit-bar .btn-icon:disabled { opacity: .35; cursor: default; }
.ct-edit-bar .ct-remove { color: var(--danger, #b3261e); }
.ct-drag { margin-right: auto; color: var(--text-3); font-size: 16px; padding-left: 4px; }
.ct-add { display: flex; align-items: center; justify-content: center; border: 2px dashed var(--line); border-radius: var(--radius); padding: 14px; min-height: 84px; }
.ct-add-panels { min-height: 120px; }
.ct-add-select { max-width: 100%; }
@media (max-width: 760px) {
  .ct-editing.kpis { overflow: visible; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 14px; padding: 0 3px; }
  .ct-editing .ct-edit-wrap { min-width: 0; }
  .ct-editing .kpi { min-width: 0; width: auto; flex: none; }
}
/* Learn the OS: the guided tour (Kyle, 5 Dec 2026) */
.tour-scrim { position: fixed; inset: 0; z-index: 9000; }
.tour-spot { position: fixed; z-index: 9001; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(15, 26, 38, .55); outline: 3px solid var(--brand, #1c3a52); pointer-events: none; transition: all .25s ease; }
.tour-card { position: fixed; z-index: 9002; background: var(--surface, #fff); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.28); padding: 18px 20px 14px; max-width: calc(100vw - 32px); }
.tour-card.tour-card-sheet { left: 50% !important; top: auto !important; bottom: 20px; transform: translateX(-50%); width: min(520px, calc(100vw - 24px)) !important; }
.tour-title { margin: 4px 0 8px; font-size: 19px; }
.tour-body { margin: 0 0 8px; line-height: 1.5; }
.tour-why { margin: 0 0 10px; padding: 8px 10px; background: var(--surface-2, #f6f3ee); border-radius: 8px; line-height: 1.45; }
.tour-acts { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
@media (max-width: 700px) { .tour-card.tour-card-sheet { bottom: 12px; max-height: 62vh; overflow: auto; } }
/* The practice copy */
.practice-strip { background: #fff4d6; color: #5c4400; border: 1px solid #ecd28a; border-radius: 10px; padding: 8px 10px; font-size: 12.5px; line-height: 1.4; display: flex; flex-direction: column; gap: 6px; margin: 0 0 12px; }
@media (max-width: 760px) { .practice-strip { flex-direction: row; flex-wrap: wrap; align-items: center; margin: 0 0 8px; width: 100%; order: -1; } }
/* Practice site links on Users & access */
.pl-panel > header { display: flex; align-items: center; gap: 10px; }
.pl-acts { white-space: nowrap; text-align: right; }
.pl-acts .btn + .btn { margin-left: 6px; }
.pl-url { flex: 1 1 280px; min-width: 0; font-size: 13px; }
@media (max-width: 760px) {
  .pl-table thead { display: none; }
  .pl-table, .pl-table tbody, .pl-table tr, .pl-table td { display: block; width: 100%; }
  .pl-table tr { padding: 10px 2px; border-bottom: 1px solid var(--border); }
  .pl-table td { border: 0 !important; padding: 2px 0 !important; }
  .pl-acts { white-space: normal; text-align: left; padding-top: 6px !important; }
  .pl-acts .btn { margin: 2px 6px 2px 0; }
}
.practice-card { max-width: 560px; }
