/* J Group project portal.
   Layout: charcoal top band like jgrouprenovations.com, white work cards on a quiet
   grey ground, brand orange kept for actions and progress. Built phone-first. */
:root {
  --bg: #EEEEEC;
  --surface: #FFFFFF;
  --surface-2: #F6F6F4;
  --ink: #1E1E1E;
  --muted: #66645E;
  --line: #DCDAD5;
  --line-strong: #C4C1BA;
  --charcoal: #2B2B2B;
  --charcoal-2: #3B3B39;
  --on-dark: #F5F4F1;
  --on-dark-muted: #B8B5AE;
  --brand: #ED7D23;
  --brand-soft: #FDEBDB;
  --btn: #B95A0C;
  --btn-hover: #A14E09;
  --ok: #1E7A4C;
  --warn: #9A5700;
  --crit: #B3261E;
  --info: #235EA4;
  --focus: #235EA4;
  --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-body: "Almarai", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --r: 10px;
  --r-sm: 6px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.5; }
img { max-width: 100%; }
a { color: var(--info); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.minw { min-width: 0; }
.flush { margin: 0; }
.spacer { flex: 1; }
.hint { font-size: 13px; color: var(--muted); }
.eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.h-hero { font-family: var(--font-display); font-weight: 400; font-size: clamp(26px, 4.6vw, 38px); line-height: 1.15; overflow-wrap: anywhere; }
.h-page { font-family: var(--font-display); font-weight: 400; font-size: 28px; line-height: 1.2; }
.h-sec { font-family: var(--font-display); font-weight: 400; font-size: 22px; line-height: 1.25; }
.h-card { font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.3; overflow-wrap: anywhere; }
.h-phase { font-size: 17px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }

/* ---- Shell ---------------------------------------------------------------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { background: var(--charcoal); color: var(--on-dark); padding-top: env(safe-area-inset-top, 0px); }
.topbar-in, .demo-in, .page {
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.topbar-in { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; margin-right: auto; min-width: 0; }
.brand img, .login-brand img { height: 46px; width: auto; flex: none; }
.brand-name { display: block; font-family: var(--font-display); font-size: 17px; line-height: 1.2; }
.brand-sub { display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--brand); }
.nav { display: flex; gap: 4px; }
.nav a { color: var(--on-dark-muted); text-decoration: none; font-weight: 700; font-size: 15px; padding: 8px 12px; border-radius: var(--r-sm); }
.nav a:hover { color: var(--on-dark); }
.nav a.on { color: var(--on-dark); background: var(--charcoal-2); }
.me { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--on-dark-muted); }
.me-name { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me button { background: transparent; color: var(--on-dark); border: 1px solid #5A5955; border-radius: var(--r-sm); padding: 6px 10px; cursor: pointer; font-size: 14px; }
.me button:hover { border-color: var(--on-dark-muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; border: 1px solid #5A5955; }
.pill:empty { display: none; }
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--on-dark-muted); }
.pill.live i { background: #4CC38A; animation: pulse 2.4s infinite; }
.pill.offline i { background: #F0A040; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(76, 195, 138, .55); }
  70% { box-shadow: 0 0 0 7px rgba(76, 195, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(76, 195, 138, 0); }
}
@media (prefers-reduced-motion: reduce) { .pill.live i { animation: none; } * { transition: none !important; } }
@media (max-width: 640px) {
  .me-name { display: none; }
  .brand-name { font-size: 15px; }
  .brand img { height: 38px; }
}

.demo { background: var(--brand-soft); border-bottom: 1px solid #F1C9A3; font-size: 14px; }
.demo-in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-block: 8px; }
.demo b { font-weight: 800; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--info); text-decoration: underline; cursor: pointer; font-size: 14px; }

.page { flex: 1; display: flex; flex-direction: column; gap: 20px; padding-top: 24px; padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
.stack { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stack.tight { gap: 6px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row.tight { gap: 6px; }
.row.end { justify-content: flex-end; }
.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.empty { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.empty p { margin: 0; max-width: 62ch; color: var(--muted); }
.loading, .boot { padding: 56px 16px; text-align: center; color: var(--muted); font-family: var(--font-body); }
.back { color: var(--muted); text-decoration: none; font-size: 15px; align-self: flex-start; }
.back:hover { color: var(--ink); }

/* ---- Controls ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 9px 16px; border-radius: var(--r); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 700; font-size: 15px; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--btn); border-color: var(--btn); color: #FFFFFF; }
.btn.primary:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: 14px; }
.btn.big { min-height: 50px; font-size: 16px; width: 100%; }
.btn.danger:hover { color: var(--crit); }
.btn.armed { background: var(--crit); border-color: var(--crit); color: #FFFFFF; }
.btn.armed:hover { color: #FFFFFF; background: var(--crit); }
.link { background: none; border: 0; padding: 4px 0; cursor: pointer; font-size: 14px; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.link.danger:hover { color: var(--crit); }
.link.armed { color: var(--crit); font-weight: 700; text-decoration: none; }
.x { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 8px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; flex: none; }
.x:hover { color: var(--crit); background: #F8E5E3; }
.x.armed { background: var(--crit); color: #FFFFFF; font-size: 13px; font-weight: 700; }
.icon { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; color: var(--muted); font-size: 15px; }
.icon:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.icon:disabled { opacity: .35; cursor: default; }

.tone-ok { --tone: var(--ok); }
.tone-warn { --tone: var(--warn); }
.tone-crit { --tone: var(--crit); }
.tone-info { --tone: var(--info); }
.tone-muted { --tone: var(--muted); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--tone);
  background: var(--surface-2); background: color-mix(in srgb, var(--tone) 12%, var(--surface));
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.tag { display: inline-block; padding: 1px 8px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: var(--muted); }
.count { font-size: 12px; color: var(--muted); font-weight: 700; }

.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 7px 12px; font-size: 14px; font-weight: 700; color: var(--muted); cursor: pointer; min-height: 38px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--charcoal); color: var(--on-dark); }

.form { display: flex; flex-direction: column; gap: 14px; }
.form.inset { padding: 14px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field label { font-size: 13px; font-weight: 700; color: var(--muted); }
input:not([type]), input[type="text"], input[type="email"], input[type="date"], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); font-size: 16px;
}
textarea { resize: vertical; min-height: 96px; line-height: 1.45; }
.select-inline { width: auto; min-height: 36px; padding: 6px 10px; font-size: 15px; }
.check-line { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.check-line input, .mini-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--btn); }
.tpl-preview { margin: 0 0 0 28px; font-size: 13px; color: var(--muted); }

/* ---- Board ---------------------------------------------------------------- */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.kpi { background: var(--surface); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kpi-n { font-family: var(--font-display); font-size: 30px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-l { font-size: 13px; color: var(--muted); line-height: 1.25; }
.kpi.tone-crit .kpi-n { color: var(--crit); }
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:last-child { grid-column: 1 / -1; }
  .kpi-n { font-size: 26px; }
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; gap: 12px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.pcard:hover { border-color: var(--line-strong); box-shadow: 0 2px 12px rgba(30, 30, 30, .07); }
.pcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pcard .h-card { font-size: 20px; font-weight: 400; margin-top: 2px; }
.pcard .muted.small { margin: 2px 0 0; }
.now { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; font-size: 15px; }
.next { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.next li { display: flex; gap: 8px; align-items: flex-start; }
.box { width: 13px; height: 13px; border: 1.5px solid var(--line-strong); border-radius: 3px; margin-top: 3px; flex: none; }
.pcard-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; }

.prog { display: flex; flex-direction: column; gap: 6px; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width .3s; }
.bar.on-dark { background: #464643; border-color: #52514D; }
.prog-l { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- Project page --------------------------------------------------------- */
.phead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 16px 28px; }
@media (max-width: 760px) { .phead { grid-template-columns: minmax(0, 1fr); } }
.phead .muted { margin: 4px 0 0; }
.phead .dates { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.phead-side { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.phead-side .prog { align-self: stretch; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: 15px; white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--brand); }

.phase { display: flex; flex-direction: column; gap: 12px; }
.phase.st-blocked { border-color: var(--crit); }
.phase.st-done { background: var(--surface-2); }
.phase-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 10px; }
.phase-ctl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.meta { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; color: var(--muted); }
.due.crit { color: var(--crit); font-weight: 700; }
.due.warn { color: var(--warn); font-weight: 700; }
select.status {
  width: auto; min-height: 36px; padding: 5px 10px; font-size: 14px; font-weight: 700; color: var(--tone);
  background-color: var(--surface); background-color: color-mix(in srgb, var(--tone) 10%, var(--surface));
  border-color: var(--line-strong); border-color: color-mix(in srgb, var(--tone) 40%, var(--line));
}
select.status option { color: var(--ink); background: var(--surface); }
.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); }
.check { display: flex; gap: 12px; flex: 1; min-width: 0; padding: 10px 0; cursor: pointer; align-items: flex-start; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--ok); }
.tt { overflow-wrap: anywhere; }
.task.done .tt { text-decoration: line-through; color: var(--muted); }
.by { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.add-task { display: flex; gap: 8px; }
.add-task input { flex: 1; min-width: 0; }
.all-done { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); font-weight: 700; font-size: 14px; color: var(--ok); background: var(--surface-2); background: color-mix(in srgb, var(--ok) 10%, var(--surface)); }
.add-phase { align-self: flex-start; }

.log-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 780px; width: 100%; }
.composer { display: flex; flex-direction: column; gap: 12px; }
.composer-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.file-btn { position: relative; overflow: hidden; border-style: dashed; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.thumbs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs li { position: relative; width: 84px; height: 84px; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-sm); display: block; }
.thumbs .x { position: absolute; top: 3px; right: 3px; min-width: 26px; height: 26px; font-size: 16px; background: rgba(0, 0, 0, .62); color: #FFFFFF; }
.share { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; background: var(--surface-2); }
.share.on { border-color: var(--brand); background: var(--brand-soft); }
.share input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--btn); flex: none; }
.share b { display: block; }

.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; color: var(--muted); }
.entry-meta strong { color: var(--ink); }
.entry-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.entry-actions { display: flex; justify-content: flex-end; }
.share-pill { margin-left: auto; border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.share-pill.on { background: var(--brand-soft); border-color: var(--brand); color: var(--btn); }

.photos { display: grid; gap: 6px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.photos.n1 { grid-template-columns: minmax(0, 1fr); }
.photos.n2, .photos.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.photo { padding: 0; border: 0; border-radius: var(--r-sm); overflow: hidden; cursor: zoom-in; aspect-ratio: 4 / 3; background: var(--surface-2); max-width: 100%; }
.photos.n1 .photo { aspect-ratio: 16 / 10; max-width: 560px; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-missing { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 13px; }
.lightbox {
  position: fixed; inset: 0; z-index: 50; background: rgba(15, 15, 15, .93);
  display: flex; align-items: center; justify-content: center;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lightbox .photo-missing { color: #DDDDDD; }
.lb-close, .lb-prev, .lb-next { position: absolute; border: 0; background: rgba(255, 255, 255, .16); color: #FFFFFF; width: 46px; height: 46px; border-radius: 50%; font-size: 28px; line-height: 1; cursor: pointer; }
.lb-close { top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); }
.lb-prev { left: calc(12px + env(safe-area-inset-left, 0px)); top: 50%; transform: translateY(-50%); }
.lb-next { right: calc(12px + env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); color: #DDDDDD; font-size: 14px; }

.checks { list-style: none; margin: 0; padding: 0; }
.check-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 14px 0; border-top: 1px solid var(--line); align-items: center; }
.check-row:first-child { border-top: 0; padding-top: 0; }
.check-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.check-name { font-weight: 700; overflow-wrap: anywhere; }
.check-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: flex-end; }
.check-ctl input[type="date"] { width: auto; min-height: 36px; padding: 5px 8px; font-size: 15px; }
.check-row .notes { grid-column: 1 / -1; min-height: 38px; padding: 6px 10px; font-size: 15px; background: var(--surface-2); }
.mini-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
@media (max-width: 640px) { .check-row { grid-template-columns: minmax(0, 1fr); } .check-ctl { justify-content: flex-start; } }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip-btn { border: 1px dashed var(--line-strong); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--ink); }
.chip-btn:hover { border-style: solid; border-color: var(--btn); color: var(--btn); }

.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.people li:first-child { border-top: 0; padding-top: 4px; }
.people li > div:first-child { display: flex; flex-direction: column; }
.inline-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.inline-form.four { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto; }
@media (max-width: 720px) { .inline-form, .inline-form.four { grid-template-columns: minmax(0, 1fr); } }
.preview-frame { border: 2px dashed var(--line-strong); border-radius: calc(var(--r) + 4px); padding: 14px; background: var(--bg); }

/* ---- Homeowner view ------------------------------------------------------- */
.client { display: flex; flex-direction: column; gap: 18px; }
.client-hero { background: var(--charcoal); color: var(--on-dark); border-radius: var(--r); padding: 26px 24px; display: flex; flex-direction: column; gap: 10px; }
.client-hero .eyebrow { color: var(--brand); }
.light-muted { margin: 0; color: var(--on-dark-muted); }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 16px; margin: 10px 0 4px; }
.hero-stats > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hs-n { font-family: var(--font-display); font-size: 36px; line-height: 1; }
.hs-k { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--on-dark-muted); }
.hs-v { font-size: 18px; font-weight: 700; overflow-wrap: anywhere; }
.hs-l { font-size: 13px; color: var(--on-dark-muted); }
.client-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .client-grid { grid-template-columns: minmax(0, 1fr); } }

.timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.tl { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 4px 12px; padding: 9px 0; align-items: center; }
.tl::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.tl:first-child::before { top: 50%; }
.tl:last-child::before { bottom: 50%; }
.tl:only-child::before { display: none; }
.tl-dot { position: relative; z-index: 1; justify-self: center; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); }
.tl-done .tl-dot { background: var(--ok); border-color: var(--ok); }
.tl-in_progress .tl-dot { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.tl-blocked .tl-dot { border-color: var(--warn); }
.tl-name { font-weight: 700; overflow-wrap: anywhere; }
.tl-done .tl-name { color: var(--muted); font-weight: 400; }
.tl-state { font-size: 13px; color: var(--muted); text-align: right; }
.tl-in_progress .tl-state { color: var(--btn); font-weight: 700; }
.tl-blocked .tl-state { color: var(--warn); font-weight: 700; }

.client-checks { list-style: none; margin: 10px 0 0; padding: 0; }
.client-checks li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.client-checks li:first-child { border-top: 0; }
.client-checks .muted { flex-basis: 100%; }
.contact p { margin: 8px 0 0; }
.contact a { color: var(--btn); font-weight: 800; font-size: 18px; text-decoration: none; white-space: nowrap; }

/* ---- Sign in -------------------------------------------------------------- */
.login {
  min-height: 100vh; background: var(--charcoal); display: flex; align-items: center; justify-content: center;
  padding: max(24px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(24px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.login-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: var(--r); padding: 0 24px 24px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.login-brand { display: flex; align-items: center; gap: 12px; margin: 0 -24px 6px; padding: 16px 24px; background: #333331; color: var(--on-dark); border-bottom: 3px solid var(--brand); }
.alert { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: #FBE9E7; color: var(--crit); font-size: 14px; }
.sent { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.sent p { margin: 0; }
.demo-pick { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 8px; }

/* ---- Notices -------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 60; width: max-content; max-width: min(92vw, 520px); background: var(--charcoal); color: var(--on-dark);
  padding: 12px 18px; border-radius: var(--r); box-shadow: 0 8px 28px rgba(0, 0, 0, .25); font-size: 15px;
}
.toast.bad { background: var(--crit); color: #FFFFFF; }
