/* Layout: navy top bar + left rail on desktop, bottom tab bar + camera FAB on phones. Blueprint navy with hi-vis amber. */
:root {
  --navy: #14202e; --navy-2: #1d2c3d;
  --bg: #f2f4f7; --surface: #ffffff; --surface-2: #f7f8fa; --line: #dde2e8; --line-2: #c9d1da;
  --fg: #18222d; --muted: #5f6d7b;
  --accent: #f2a900; --accent-ink: #1c1500; --accent-soft: #fff4d6;
  --good: #16794a; --good-bg: #e3f4ea; --warn: #a65d00; --warn-bg: #fff0d9; --bad: #b42318; --bad-bg: #fde7e5; --info: #2563a8; --info-bg: #e5eefa;
  --st-open: #6b7a89; --st-in_progress: #2563a8; --st-review: #a65d00; --st-done: #16794a;
  --p-low: #8a97a5; --p-medium: #2563a8; --p-high: #d97706; --p-critical: #b42318;
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --r: 8px; --shadow: 0 1px 2px rgba(20, 32, 46, .06), 0 4px 14px rgba(20, 32, 46, .06);
  --top-h: 56px; --nav-w: 92px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e151d; --surface: #16202b; --surface-2: #1b2632; --line: #263342; --line-2: #34445a; --fg: #e5eaf0; --muted: #97a6b6;
    --accent-soft: #3a2e0c; --good: #4cc38a; --good-bg: #12301f; --warn: #f0ae4c; --warn-bg: #352610; --bad: #f07167; --bad-bg: #3a1a18; --info: #6ea8ec; --info-bg: #142740;
    --st-open: #8d9bab; --st-in_progress: #6ea8ec; --st-review: #f0ae4c; --st-done: #4cc38a; --p-medium: #6ea8ec;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); letter-spacing: .01em; line-height: 1.15; text-wrap: balance; }
h1 { font-size: 2rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.15rem; } h4 { font-size: 1rem; }
p { margin: 0; }
a { color: var(--info); }
button { font: inherit; color: inherit; }
.muted { color: var(--muted); } .hint { color: var(--muted); font-size: .84rem; } .err { color: var(--bad); font-weight: 600; min-height: 1.2em; }
.center { text-align: center; } .grow { flex: 1; min-width: 0; } .spacer { flex: 1; }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gap-lg { gap: 20px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } .grid4 { grid-template-columns: 1fr 1fr; } }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pre { white-space: pre-wrap; }

/* icons */
.ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ico.lg { width: 40px; height: 40px; color: var(--line-2); }
.ico.rot { transform: rotate(90deg); width: 16px; height: 16px; opacity: .7; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--surface); font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none; color: var(--fg); white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #ffb81a; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn.danger, .icon-btn.danger { color: var(--bad); }
.btn.danger-solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { min-height: 34px; padding: 0 10px; font-size: .85rem; }
.btn.xl { min-height: 56px; padding: 0 28px; font-size: 1.1rem; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.active { background: var(--navy); border-color: var(--navy); color: #fff; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r); border: 0; background: transparent; cursor: pointer; color: var(--fg); text-decoration: none; flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:disabled { opacity: .35; }
input, select, textarea { width: 100%; font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r); padding: 9px 10px; min-height: 40px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
textarea { resize: vertical; min-height: 0; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: .8rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.form-grid { display: grid; gap: 14px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; font-size: .9rem; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; accent-color: var(--accent); }
.inline { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.inline input { width: 90px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 7px; font-weight: 600; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--fg); box-shadow: var(--shadow); }
.seg.sm button { padding: 6px 10px; font-size: .85rem; }
.pill { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 700; letter-spacing: .03em; padding: 2px 8px; border-radius: 99px; white-space: nowrap; text-transform: uppercase; }
.pill.good { background: var(--good-bg); color: var(--good); } .pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); } .pill.muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.tag { font-size: .75rem; padding: 1px 7px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--muted); }
.tnum { font: 500 .78rem var(--mono); color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 700; font-size: .78rem; flex: none; }
.avatar.sm { width: 26px; height: 26px; font-size: .68rem; }
.notice { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r); background: var(--warn-bg); color: var(--warn); font-weight: 600; font-size: .9rem; }
.notice.soft { background: var(--info-bg); color: var(--info); }
.mark { width: 22px; height: 22px; background: var(--accent); clip-path: polygon(0 100%, 50% 0, 100% 100%, 72% 100%, 50% 55%, 28% 100%); display: inline-block; flex: none; }

/* gate (sign in / projects) */
.gate { min-height: 100%; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left));
  background: var(--navy) repeating-linear-gradient(0deg, transparent 0 47px, rgba(255,255,255,.045) 47px 48px), repeating-linear-gradient(90deg, transparent 0 47px, rgba(255,255,255,.045) 47px 48px); }
.gate-card { width: min(440px, 100%); background: var(--surface); border-radius: 14px; padding: 28px; display: grid; gap: 18px; box-shadow: 0 24px 70px rgba(0,0,0,.4); }
.gate-card.wide { width: min(780px, 100%); }
.brand-lg { display: flex; align-items: center; gap: 10px; font: 700 1.9rem var(--font-display); }
.brand-lg b { color: var(--warn); }
.proj-list { display: grid; gap: 8px; }
.proj { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; text-align: left; }
.proj:hover { border-color: var(--accent); }
.proj > span:nth-child(2) { flex: 1; display: grid; }
.proj small { color: var(--muted); }
.proj-ic { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 700; }

/* shell */
.shell { height: 100%; display: grid; grid-template: "top top" var(--top-h) "nav main" minmax(0, 1fr) / var(--nav-w) minmax(0, 1fr); }
.topbar { grid-area: top; display: flex; min-width: 0; overflow: hidden; align-items: center; gap: 10px; background: var(--navy); color: #fff; padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); height: calc(var(--top-h) + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); margin-top: calc(-1 * env(safe-area-inset-top)); }
.proj-btn { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; color: #fff; cursor: pointer; font: 700 1.25rem var(--font-display); min-width: 0; padding: 6px 8px; border-radius: 8px; }
.proj-btn:hover { background: var(--navy-2); }
.proj-btn .pn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }
.clock-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; border-radius: 99px; padding: 6px 14px; font-weight: 700; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.clock-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: #8193a5; }
.clock-chip.on { border-color: #3ddc84; } .clock-chip.on .dot { background: #3ddc84; box-shadow: 0 0 0 4px rgba(61,220,132,.22); animation: pulse 2s infinite; }
.clock-chip:not(.on) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); } .clock-chip:not(.on) .dot { background: var(--accent-ink); }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(61,220,132,0); } }
.user-btn { display: flex; align-items: center; gap: 8px; border: 0; background: transparent; color: #cfd8e1; cursor: pointer; font-size: .85rem; padding: 4px 6px; border-radius: 8px; }
.user-btn:hover { background: var(--navy-2); }
.sidenav { grid-area: nav; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 8px 0; overflow-y: auto; }
.sidenav a { display: grid; justify-items: center; gap: 4px; padding: 11px 4px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 700; text-align: center; border-left: 3px solid transparent; }
.sidenav a .ico { width: 24px; height: 24px; }
.sidenav a:hover { color: var(--fg); }
.sidenav a.on { color: var(--fg); border-left-color: var(--accent); background: var(--accent-soft); }
.view { grid-area: main; overflow-y: auto; min-width: 0; position: relative; }
.bottomnav { display: none; }
.fab { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(24px, env(safe-area-inset-bottom)); width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px rgba(0,0,0,.3); cursor: pointer; z-index: 50; display: grid; place-items: center; }
.fab svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.loading { padding: 40px; color: var(--muted); text-align: center; }
@media (max-width: 800px) {
  .shell { grid-template: "top" var(--top-h) "main" minmax(0, 1fr) "nav" auto / minmax(0, 1fr); }
  .proj-btn { font-size: 1.1rem; padding: 6px 4px; } .proj-btn .pn { max-width: 40vw; } .proj-btn .ico.rot { display: none; }
  .clock-chip { padding: 6px 10px; }
  .sidenav { display: none; }
  .bottomnav { grid-area: nav; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .bottomnav a, .bottomnav button { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 8px 2px 6px; border: 0; background: none; color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 700; cursor: pointer; border-top: 3px solid transparent; }
  .bottomnav .ico { width: 23px; height: 23px; }
  .bottomnav .on { color: var(--fg); border-top-color: var(--accent); }
  .fab { bottom: calc(76px + env(safe-area-inset-bottom)); width: 56px; height: 56px; }
  .user-btn .un { display: none; }
  h1 { font-size: 1.7rem; }
}

/* pages */
.page { padding: 22px max(16px, env(safe-area-inset-right)) 100px max(16px, env(safe-area-inset-left)); display: grid; gap: 18px; max-width: 1440px; margin: 0 auto; align-content: start; }
@media (min-width: 801px) { .page { padding-left: 26px; padding-right: 26px; } }
.page-head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between; }
.page-head > div:first-child { display: grid; gap: 4px; min-width: 0; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters > * { width: auto; flex: 1 1 150px; max-width: 240px; }
.filters input[type=search] { flex: 2 1 220px; max-width: 360px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; align-content: start; min-width: 0; box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.more-link { display: inline-flex; align-items: center; gap: 2px; font-size: .85rem; font-weight: 600; text-decoration: none; }
.more-link .ico { width: 16px; height: 16px; }
.empty-state { display: grid; justify-items: center; gap: 8px; padding: 28px 16px; text-align: center; color: var(--muted); }
.empty-state h3 { color: var(--fg); }
.empty-state p { max-width: 46ch; }
.grp { font-size: 1.05rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.mini { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }

/* dashboard */
.weather { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.weather b { color: var(--fg); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { display: grid; gap: 2px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--fg); box-shadow: var(--shadow); border-top: 4px solid var(--line-2); }
.kpi.good { border-top-color: var(--good); } .kpi.warn { border-top-color: var(--warn); } .kpi.bad { border-top-color: var(--bad); }
.kpi .k-l { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi .k-v { font: 700 2.1rem var(--font-display); font-variant-numeric: tabular-nums; }
.kpi .k-n { font-size: .82rem; color: var(--muted); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 420px) { .dash-grid { grid-template-columns: 1fr; } }
.stack-col { display: grid; gap: 16px; }
.people { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.people li { display: flex; align-items: center; gap: 10px; }
.people small { display: block; color: var(--muted); }
.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(70px, 120px) 1fr auto; gap: 10px; align-items: center; font-size: .88rem; }
.bar-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-t { display: flex; height: 14px; background: var(--surface-2); border-radius: 4px; overflow: hidden; gap: 1px; }
.bar-s { background: color-mix(in srgb, var(--info) 55%, transparent); }
.bar-s.today { background: var(--info); }
.bar-v { font-variant-numeric: tabular-nums; font-weight: 600; font-size: .85rem; }
.stack { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.st-open { background: var(--st-open); } .st-in_progress { background: var(--st-in_progress); } .st-review { background: var(--st-review); } .st-done { background: var(--st-done); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.task-mini { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.task-mini button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 6px; border: 0; background: none; cursor: pointer; border-radius: 6px; text-align: left; }
.task-mini button:hover { background: var(--surface-2); }
.prio { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.p-low.prio { background: var(--p-low); } .p-medium.prio { background: var(--p-medium); } .p-high.prio { background: var(--p-high); } .p-critical.prio { background: var(--p-critical); }
.due { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.due.bad { color: var(--bad); font-weight: 700; }
.assignee-grid { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .85rem; color: var(--muted); }
.assignee-grid b { color: var(--fg); }
.activity { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-height: 420px; overflow-y: auto; }
.activity li { display: flex; gap: 10px; font-size: .9rem; }
.activity .ico { color: var(--muted); width: 18px; height: 18px; margin-top: 2px; }
.activity small { display: block; color: var(--muted); font-size: .78rem; }
.clock-hero { grid-template-columns: 1fr auto; align-items: center; border-left: 6px solid var(--line-2); }
.clock-hero.on { border-left-color: var(--good); }
.clock-hero .big { font: 700 2.6rem var(--font-display); font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .clock-hero { grid-template-columns: 1fr; } .clock-hero .btn { width: 100%; } }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick > * { display: grid; justify-items: center; gap: 6px; padding: 14px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: .88rem; cursor: pointer; text-decoration: none; color: var(--fg); }
.quick .ico { width: 26px; height: 26px; color: var(--warn); }

/* photos */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.photo-grid.sm { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.ph { position: relative; padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: pointer; aspect-ratio: 1; background: var(--surface-2); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.ph:hover img { transform: scale(1.04); }
.ph-cap { position: absolute; inset: auto 0 0 0; padding: 18px 8px 6px; background: linear-gradient(transparent, rgba(0,0,0,.72)); color: #fff; font-size: .75rem; text-align: left; display: flex; gap: 4px; align-items: center; white-space: nowrap; overflow: hidden; }
.ph-cap .ico { width: 14px; height: 14px; margin-left: auto; }
.ph-day { display: grid; }
.thumb-row { display: flex; gap: 6px; overflow-x: auto; }
.thumb-row img { height: 110px; border-radius: 8px; }
.lb { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; }
@media (max-width: 760px) { .lb { grid-template-columns: 1fr; } }
.lb-stage { position: relative; background: #0b0f14; border-radius: 10px; display: grid; place-items: center; min-height: 300px; }
.lb-img { max-width: 100%; max-height: 72vh; display: block; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); color: #111; cursor: pointer; display: grid; place-items: center; }
.lb-nav.l { left: 10px; } .lb-nav.r { right: 10px; }
.lb-info { display: grid; gap: 12px; align-content: start; }
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: .9rem; }
.meta-list dt { color: var(--muted); font-weight: 600; } .meta-list dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* plans */
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.sheet { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; color: var(--fg); box-shadow: var(--shadow); }
.sheet:hover { border-color: var(--accent); }
.sheet-img { aspect-ratio: 4/3; background: #fff; border-bottom: 1px solid var(--line); overflow: hidden; }
.sheet-img img { width: 100%; height: 100%; object-fit: contain; }
.sheet-b { padding: 10px 12px; display: grid; gap: 2px; }
.sheet-b small { color: var(--muted); }
.plan-group { display: grid; }
.pv { display: grid; grid-template-rows: auto auto 1fr; height: 100%; }
.pv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); background: var(--surface); border-bottom: 1px solid var(--line); }
.pv-bar select { width: auto; max-width: 260px; }
.pv-bar.sub { padding-top: 6px; padding-bottom: 6px; gap: 14px; background: var(--surface-2); font-size: .88rem; }
.pv-bar.sub select { min-height: 32px; padding: 4px 8px; }
@media (max-width: 560px) { .pv-bar .btn span:last-child { display: none; } .pv-bar .btn { padding: 0 10px; } }
.pv-wrap { position: relative; min-height: 0; overflow: hidden; background: #dfe4ea; }
@media (prefers-color-scheme: dark) { .pv-wrap { background: #0a1016; } }
.pv-stage { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; }
.pv-stage.placing { cursor: crosshair; }
.pv-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; --inv: 1; }
.pv-img { display: block; width: 100%; height: 100%; user-select: none; pointer-events: none; box-shadow: 0 2px 20px rgba(0,0,0,.2); background: #fff; }
.pv-pins { position: absolute; inset: 0; }
.pin { position: absolute; padding: 0; border: 0; background: none; cursor: pointer; transform: translate(-50%, -100%) scale(var(--inv)); transform-origin: 50% 100%; z-index: 1; }
.pin:hover { z-index: 3; }
.pin.task .pin-b { display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px 15px 15px 2px; transform: rotate(-45deg); color: #fff; font: 600 .72rem var(--mono); box-shadow: 0 2px 6px rgba(0,0,0,.4); border: 2px solid #fff; background: var(--st-open); }
.pin.task .pin-b i { transform: rotate(45deg); font-style: normal; }
.pin.task.p-high .pin-b { background: var(--p-high); } .pin.task.p-critical .pin-b { background: var(--p-critical); } .pin.task.p-medium .pin-b { background: var(--p-medium); }
.pin.task.s-done .pin-b { background: var(--st-done); } .pin.task.s-review .pin-b { outline: 3px solid var(--st-review); }
.pin-cam { position: absolute; right: -6px; top: -6px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--navy); }
.pin.photo { transform: translate(-50%, -50%) scale(var(--inv)); transform-origin: 50% 50%; }
.pin.photo .pin-b { display: block; width: 38px; height: 38px; border-radius: 8px; overflow: hidden; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.45); }
.pin.photo img { width: 100%; height: 100%; object-fit: cover; }
.pin.flash .pin-b { animation: flash .6s 4; }
@keyframes flash { 50% { box-shadow: 0 0 0 10px rgba(242,169,0,.6); } }
.pv-hint { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 99px; font-weight: 600; font-size: .88rem; pointer-events: none; z-index: 5; box-shadow: var(--shadow); white-space: nowrap; }
.pv-zoom { position: absolute; left: 12px; bottom: 16px; display: grid; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; z-index: 4; }
@media (max-width: 800px) { .pv-zoom { bottom: 90px; } }
.pv-zoom button { width: 44px; height: 44px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.pick-scroll { overflow: auto; max-height: 68vh; background: #dfe4ea; border-radius: 8px; }
.pick-wrap { position: relative; cursor: crosshair; }
.pick-wrap img { display: block; width: 100%; min-width: 600px; user-select: none; }
.pick-marker { position: absolute; transform: translate(-50%, -100%); color: var(--bad); pointer-events: none; }
.pick-marker .ico { width: 38px; height: 38px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.4)); }
.pick-marker .ico svg { fill: var(--bad); stroke: #fff; stroke-width: 1.4; }

/* tasks */
.board { display: grid; gap: 12px; align-items: start; overflow-x: auto; }
.board.c3 { grid-template-columns: repeat(3, minmax(260px, 1fr)); } .board.c4 { grid-template-columns: repeat(4, minmax(250px, 1fr)); }
.bcol { background: color-mix(in srgb, var(--line) 45%, transparent); border-radius: 12px; padding: 10px; display: grid; gap: 8px; min-height: 140px; align-content: start; }
.bcol.drop { outline: 2px dashed var(--accent); }
.bcol-h { display: flex; align-items: center; gap: 8px; font: 700 .95rem var(--font-display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 2px 4px; }
.bcol-h i { width: 10px; height: 10px; border-radius: 3px; } .bcol-h b { margin-left: auto; font-family: var(--mono); font-size: .8rem; }
.tcard { display: grid; gap: 6px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--p-low); border-radius: 10px; text-align: left; cursor: grab; box-shadow: var(--shadow); width: 100%; }
.tcard:hover { border-color: var(--line-2); }
.tcard.p-medium { border-left-color: var(--p-medium); } .tcard.p-high { border-left-color: var(--p-high); } .tcard.p-critical { border-left-color: var(--p-critical); }
.tc-img { width: 100%; height: 110px; object-fit: cover; border-radius: 6px; }
.tc-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tc-title { font-weight: 600; overflow-wrap: anywhere; }
.tc-loc { display: flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--muted); }
.tc-loc .ico { width: 14px; height: 14px; }
.tc-foot { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.cnt { display: inline-flex; align-items: center; gap: 2px; } .cnt .ico { width: 14px; height: 14px; }
.prio-tag { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.prio-tag.p-low { color: var(--p-low); } .prio-tag.p-medium { color: var(--p-medium); } .prio-tag.p-high { color: var(--p-high); } .prio-tag.p-critical { color: var(--p-critical); }
.tlist { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.trow { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--surface-2); }
.trow .b { font-weight: 600; }
.trow small { display: block; }
.st-select { width: auto; min-height: 32px; padding: 4px 8px; font-size: .8rem; font-weight: 700; border-width: 2px; flex: none; }
.st-select.st-open { border-color: var(--st-open); background: var(--surface); } .st-select.st-in_progress { border-color: var(--st-in_progress); background: var(--info-bg); }
.st-select.st-review { border-color: var(--st-review); background: var(--warn-bg); } .st-select.st-done { border-color: var(--st-done); background: var(--good-bg); }
@media (max-width: 560px) { .trow .avatar { display: none; } }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.feed .ev { font-size: .82rem; color: var(--muted); padding-left: 34px; }
.feed .cm { display: flex; gap: 8px; }
.feed .cm > div { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; flex: 1; min-width: 0; }
.cm-h { display: flex; gap: 8px; align-items: baseline; font-size: .85rem; } .cm-b { white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-box { display: grid; gap: 8px; justify-items: end; }
.sec { font-size: 1rem; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--line); }

/* map */
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
@media (max-width: 960px) { .map-layout { grid-template-columns: 1fr; } }
.map { height: min(68vh, 720px); min-height: 380px; border-radius: 12px; border: 1px solid var(--line); z-index: 0; }
.crew-side { display: grid; gap: 8px; align-content: start; }
.crew-row { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-align: left; cursor: pointer; width: 100%; }
.crew-row:disabled { cursor: default; opacity: .75; }
.crew-row small { display: block; color: var(--muted); font-size: .78rem; }
.crew-dot { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 700 .75rem var(--font); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.45); }
.crew-dot.stale { opacity: .5; filter: grayscale(.7); }
.site-dot { width: 18px; height: 18px; background: var(--accent); border: 3px solid var(--navy); transform: rotate(45deg); }

/* time */
.week-nav { display: flex; align-items: center; gap: 6px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.sheet-t { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: .9rem; min-width: 720px; }
.sheet-t th, .sheet-t td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: center; }
.sheet-t thead th { background: var(--surface-2); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sheet-t tbody th, .sheet-t tfoot th { text-align: left; font-weight: 600; }
.sheet-t .who { display: flex; align-items: center; gap: 8px; } .sheet-t .who small { display: block; color: var(--muted); font-weight: 400; font-size: .75rem; }
.sheet-t td.today, .sheet-t th.today { background: var(--accent-soft); }
.sheet-t td button { border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--info); text-decoration: underline dotted; padding: 2px 4px; }
.sheet-t td:not(.has) { color: var(--line-2); }
.sheet-t .tot { font-weight: 700; background: var(--surface-2); }
.sheet-t tfoot td, .sheet-t tfoot th { font-weight: 700; border-bottom: 0; }
.entries { display: grid; }
.entry { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.entry:last-child { border-bottom: 0; }
.entry small { display: block; color: var(--muted); }
.entry .dur { font-variant-numeric: tabular-nums; white-space: nowrap; }
.flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }

/* reports */
.report-list { display: grid; gap: 8px; }
.report-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-align: left; cursor: pointer; width: 100%; }
.report-row:hover { border-color: var(--accent); }
.report-row small { display: block; color: var(--muted); }
.report-row .pill { margin: 4px 4px 0 0; }
.rr-date { display: grid; justify-items: center; width: 52px; padding: 4px; border-radius: 8px; background: var(--navy); color: #fff; }
.rr-date b { font: 700 1.5rem/1 var(--font-display); } .rr-date small { color: var(--accent); text-transform: uppercase; font-weight: 700; font-size: .7rem; }
.report-doc { display: grid; gap: 16px; }
.rp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 560px) { .rp-stats { grid-template-columns: 1fr 1fr; } }
.rp-stats div { background: var(--surface-2); border-radius: 10px; padding: 10px; display: grid; }
.rp-stats small { color: var(--muted); font-size: .75rem; text-transform: uppercase; font-weight: 700; letter-spacing: .04em; }
.rp-stats b { font-size: 1.1rem; }
.rp-sec { display: grid; gap: 6px; } .rp-sec h4 { color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-size: .85rem; }
.rp-sec ul { margin: 0; padding-left: 1.2rem; }
.mini-t { border-collapse: collapse; font-size: .9rem; } .mini-t td { padding: 4px 16px 4px 0; border-bottom: 1px solid var(--line); } .mini-t .num { text-align: right; font-variant-numeric: tabular-nums; }
#printArea { display: none; }
@media print {
  body.printing > *:not(#printArea) { display: none !important; }
  body.printing #printArea { display: block; padding: 0; color: #000; }
  body.printing { background: #fff; }
}

/* team */
.invites { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .invites { grid-template-columns: 1fr; } }
.invite { background: var(--navy); color: #fff; border-radius: 12px; padding: 14px; display: grid; gap: 8px; }
.invite small { color: #b6c3d0; font-weight: 600; }
.invite .code { font: 500 1.6rem var(--mono); letter-spacing: .18em; color: var(--accent); }
.invite .lnk { font-size: .8rem; color: #b6c3d0; overflow-wrap: anywhere; }
.invite .btn { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.members { display: grid; }
.member { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.member:last-child { border-bottom: 0; }
.member small { display: block; color: var(--muted); }
.member select { width: auto; min-height: 34px; padding: 4px 8px; }
.roles-help { font-size: .9rem; color: var(--muted); } .roles-help summary { cursor: pointer; font-weight: 600; color: var(--fg); }
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.more-grid > * { display: grid; justify-items: center; gap: 6px; padding: 18px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--fg); font-weight: 700; cursor: pointer; }
.more-grid .ico { width: 26px; height: 26px; color: var(--warn); }
.consent { margin: 0; padding-left: 1.1rem; display: grid; gap: 8px; }

/* dialogs */
.dlg { border: 0; padding: 0; border-radius: 14px; width: min(520px, calc(100% - 24px)); max-height: calc(100% - 24px); background: var(--surface); color: var(--fg); box-shadow: 0 24px 70px rgba(0,0,0,.4); display: none; flex-direction: column; }
.dlg[open] { display: flex; }
.dlg.wide { width: min(880px, calc(100% - 24px)); }
.dlg.side { margin: 0 0 0 auto; height: 100%; max-height: 100%; border-radius: 0; width: min(560px, 100%); }
.dlg.lightbox { width: min(1200px, calc(100% - 24px)); }
.dlg::backdrop { background: rgba(10, 16, 24, .55); }
.dlg-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--line); }
.dlg-head h2 { flex: 1; font-size: 1.3rem; }
.dlg-body { padding: 16px 20px; overflow-y: auto; min-height: 0; display: grid; gap: 14px; align-content: start; flex: 1; }
.dlg-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); flex-wrap: wrap; }
@media (max-width: 560px) {
  .dlg:not(.side) { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 16px 16px 0 0; max-height: 94%; }
}
.col-end { display: flex; align-items: flex-end; }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 2000; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { border-left: 4px solid #3ddc84; } .toast.err { border-left: 4px solid #f07167; } .toast.warn { border-left: 4px solid var(--accent); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.leaflet-container { font: inherit; }

/* quantities & progress */
.kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis.k5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpis.k5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .kpis.k5 .kpi { padding: 10px 12px; } .kpis.k5 .k-v { font-size: 1.35rem; } .kpis.k5 .k-n { font-size: .75rem; } }
.kpis.k5 .k-v { font-size: 1.7rem; }
.boq { border-collapse: collapse; width: 100%; font-size: .9rem; font-variant-numeric: tabular-nums; min-width: 900px; }
.boq.compact { min-width: 560px; }
.boq th, .boq td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.boq thead th { background: var(--surface-2); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.boq tbody tr:not(.grp-row) { cursor: pointer; } .boq tbody tr:not(.grp-row):hover { background: var(--surface-2); }
.boq .grp-row th { background: var(--accent-soft); font-family: var(--font-display); font-size: .95rem; letter-spacing: .03em; }
.boq .num { text-align: right; white-space: nowrap; } .boq .b { font-weight: 700; }
.boq .desc { min-width: 200px; } .boq .small { font-size: .8rem; color: var(--muted); white-space: nowrap; } .boq .bad { color: var(--bad); font-weight: 600; }
.mono { font-family: var(--mono); font-size: .8rem; }
.qbar { position: relative; height: 18px; min-width: 130px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.qbar-fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--good) 70%, transparent); }
.qbar-fill.bad { background: color-mix(in srgb, var(--p-high) 75%, transparent); }
.qbar-mark { position: absolute; top: -1px; bottom: -1px; width: 3px; background: var(--fg); }
.qbar b { position: relative; font-size: .72rem; padding-left: 6px; line-height: 16px; }
.curve-wrap { overflow-x: auto; }
.scurve { width: 100%; min-width: 520px; height: auto; display: block; }
.scurve .grid { stroke: var(--line); stroke-width: 1; } .scurve .tick { stroke: var(--line-2); }
.scurve .ax { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.scurve .planned { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 6 5; }
.scurve .actual { fill: none; stroke: var(--info); stroke-width: 3; stroke-linejoin: round; }
.scurve .actual-area { fill: color-mix(in srgb, var(--info) 14%, transparent); stroke: none; }
.scurve .dot { fill: var(--info); stroke: var(--surface); stroke-width: 2; }
.scurve .lbl { fill: var(--fg); font-weight: 700; font-size: 13px; font-family: var(--font); }
.scurve .forecast { stroke: var(--p-high); stroke-width: 2; stroke-dasharray: 2 4; }
.scurve .today { stroke: var(--accent); stroke-width: 2; } .scurve .finish { stroke: var(--bad); stroke-width: 1.5; stroke-dasharray: 3 3; }
.legend .lg-planned { background: none; border-top: 2px dashed var(--muted); height: 0 !important; width: 16px !important; }
.legend .lg-actual { background: var(--info); } .legend .lg-forecast { background: var(--p-high); } .legend .lg-finish { background: var(--bad); }
.qrows-box { display: grid; gap: 8px; justify-items: start; }
.qrows { display: grid; gap: 8px; width: 100%; }
.qrow { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(80px, .8fr) minmax(0, 1.3fr) auto; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.qrow .unit { grid-column: 1 / -1; font-size: .78rem; color: var(--muted); }
.qrow .icon-btn { font-size: 1.4rem; }
@media (max-width: 560px) { .qrow { grid-template-columns: 1fr 1fr auto; } .qrow select { grid-column: 1 / -1; } }
.qlogged { margin: 0 0 6px; padding-left: 1.1rem; font-size: .9rem; } .qlogged small { color: var(--muted); }
.qty-box { display: grid; gap: 8px; padding: 10px; border: 1px dashed var(--line-2); border-radius: 10px; }
.prog-big { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.prog-big > div { display: grid; } .prog-big .k-v { font: 700 2.2rem/1 var(--font-display); } .prog-big small { color: var(--muted); font-size: .78rem; }
.prog-big .pill { margin-left: auto; }
.prog-bars { display: grid; gap: 6px; } .prog-bars > div { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 8px; font-size: .78rem; color: var(--muted); }
.pb { position: relative; height: 10px; background: var(--surface-2); border-radius: 99px; overflow: visible; display: block; }
.pb i { position: absolute; inset: 0 auto 0 0; background: var(--good); border-radius: 99px; } .pb.time i { background: var(--muted); }
.pb b { position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--fg); border-radius: 2px; }
.qweek { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .88rem; } .qweek li { display: flex; gap: 10px; }
.tone-good { color: var(--good); } .tone-warn { color: var(--warn); } .tone-bad { color: var(--bad); } .tone-muted { color: var(--muted); }
.stack-col > .row.between { justify-content: space-between; }
@media print { .scurve { min-width: 0; } .boq { min-width: 0; font-size: 10pt; } }
