/* Company Brain: one neutral system, the client's brand colour as the only accent. */
@font-face {
  font-family: "Inter";
  src: url("/static/fonts/inter-latin-fc45a11d8f.woff2") format("woff2");  /* Latin only; the name changes with the file */
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --accent: var(--brand);
  --on-accent: #fff;
  --accent-soft: color-mix(in oklab, var(--brand) 10%, transparent);
  --bg: #ffffff;
  --bg-subtle: #f7f7f8;
  --fill: #f0f0f2;
  --fill-strong: #e6e6ea;
  --line: rgba(0, 0, 0, .09);
  --text: #1d1d1f;
  --text-2: #636366;
  --danger: #c4001a;
  --danger-soft: #fdecee;
  --ok: #1b7f3b;
  --ok-soft: #e9f6ee;
  --shadow-float: 0 1px 2px rgba(0, 0, 0, .05), 0 8px 28px rgba(0, 0, 0, .08);
  --shadow-dialog: 0 24px 64px rgba(0, 0, 0, .22);
  --radius: 14px;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.16, 1, .3, 1);  /* fast ease-out for presses */
  --sidebar: 264px;
  --tabbar: 64px;
  --topbar: 56px;
  color-scheme: light dark;
}

/* Dark mode: follows the device unless the person picked Light or Dark under Account. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: color-mix(in oklab, var(--brand) 55%, white);
    --on-accent: #0c1213;
    --accent-soft: color-mix(in oklab, var(--brand) 30%, transparent);
    --bg: #161618;
    --bg-subtle: #1c1c1e;
    --fill: #2a2a2d;
    --fill-strong: #36363a;
    --line: rgba(255, 255, 255, .1);
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --danger: #ff6b6b;
    --danger-soft: #3a1d1f;
    --ok: #5fd38a;
    --ok-soft: #1a3022;
    --shadow-float: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 28px rgba(0, 0, 0, .35);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --grid: #2c2c2f; --axis: #48484d;
  }
  :root:not([data-theme="light"]) .powered img { filter: invert(1); }
}
:root[data-theme="dark"] {
    --accent: color-mix(in oklab, var(--brand) 55%, white);
    --on-accent: #0c1213;
    --accent-soft: color-mix(in oklab, var(--brand) 30%, transparent);
    --bg: #161618;
    --bg-subtle: #1c1c1e;
    --fill: #2a2a2d;
    --fill-strong: #36363a;
    --line: rgba(255, 255, 255, .1);
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --danger: #ff6b6b;
    --danger-soft: #3a1d1f;
    --ok: #5fd38a;
    --ok-soft: #1a3022;
    --shadow-float: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 28px rgba(0, 0, 0, .35);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --grid: #2c2c2f; --axis: #48484d;
  color-scheme: dark;
}
:root[data-theme="dark"] .powered img { filter: invert(1); }
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss03"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-wrap: break-word;  /* a long file name or email address wraps instead of widening the page */
}
::selection { background: color-mix(in oklab, var(--accent) 28%, transparent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
input, textarea, select, button { font: inherit; color: inherit; caret-color: var(--accent); accent-color: var(--accent); }
a { color: inherit; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
svg, video, iframe, canvas { max-width: 100%; }
* { scrollbar-width: thin; scrollbar-color: var(--fill-strong) transparent; }
.icon { flex: none; }
time, .num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shell ---------- */
.app { min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); display: flex; flex-direction: column; gap: 20px;
  padding: 16px 12px; background: var(--bg-subtle); border-right: 1px solid var(--line);
}
.org { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 15px; line-height: 1.35; padding: 6px 8px; }
/* The whole logo, whatever its shape: on white, so it reads in dark mode too; it carries the company's name, so no text beside it */
.org-logo { display: block; height: 60px; width: auto; max-width: 100%; object-fit: contain; object-position: left; padding: 4px 6px; border-radius: 8px; background: #fff; box-sizing: border-box; }
.topbar .org-logo { height: 40px; padding: 2px 4px; }
.hello-logo { display: block; height: 76px; width: auto; max-width: 240px; object-fit: contain; padding: 6px 8px; margin-inline: auto; border-radius: 10px; background: #fff; box-sizing: border-box; }
.side-nav { display: grid; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 15px;
  transition: background-color .15s, color .15s;
}
.side-nav a:hover { background: var(--fill); color: var(--text); }
.side-nav a[aria-current="page"] { background: var(--fill); color: var(--text); font-weight: 600; }
.side-nav a[aria-current="page"] .icon { color: var(--accent); }
.side-foot { margin-top: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; flex: none; }  /* minmax: a long email shortens, not pushes the buttons out */
/* A short screen (a director's long menu on a 750 px laptop): the links scroll, Account and the buttons stay in view */
.side-nav { min-height: 0; flex: 0 1 auto; overflow-y: auto; scrollbar-width: thin; }
@media (max-height: 800px) { .sidebar { gap: 12px; padding-block: 10px; } .side-nav a { height: 34px; } }
/* The sysadmin testing as someone else: always clear whose app this is. */
.switch-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 16px;
  padding: 10px 14px; border-radius: 12px; background: #8a4b00; color: #fff; font-size: 15px; }
.switch-banner .btn { background: #fff; color: #5c3200; }
/* Unread notifications: a count on the bell (phone top bar) and on the side menu's Notifications. */
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #c4001a; color: #fff;  /* one red in both themes: white text stays readable */
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.side-nav .badge { margin-left: auto; }
.bell { position: relative; width: 44px; height: 44px; }
.bell .badge { position: absolute; top: 4px; right: -2px; box-shadow: 0 0 0 2px var(--bg); }  /* grows towards the bell, never onto the account icon beside it */
.notification.unread .row-title { font-weight: 600; }
.unread-dot { display: inline-block; width: 8px; height: 8px; margin: 0 8px 1px 0; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.who { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.who-text { min-width: 0; flex: 1; line-height: 1.3; }
.who-text strong, .who-text small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-text strong { font-size: 14px; font-weight: 600; }
.who-text small { font-size: 13px; color: var(--text-2); }
.powered { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0 8px; font-size: 12px; color: var(--text-2); }
.powered img { opacity: .7; }

.avatar {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--fill-strong); color: var(--text); font-size: 13px; font-weight: 600; letter-spacing: .01em;
}
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }

.topbar, .tabbar { display: none; }
.main { margin-left: var(--sidebar); padding: 40px 32px 96px; animation: enter .32s var(--ease-out) both; }
.page { max-width: 760px; margin: 0 auto; container: page / inline-size; }  /* @container page: the room the content has, side menu or not */
.page.wide { max-width: 1000px; }
@keyframes enter { from { transform: translateY(6px); } }  /* content stays visible; only position eases */

@media (max-width: 899px), (max-height: 500px) {
  .sidebar { display: none; }
  .topbar {
    display: flex; position: sticky; top: 0; z-index: 20; height: calc(var(--topbar) + env(safe-area-inset-top)); align-items: center;
    padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
    padding-top: env(safe-area-inset-top); background: color-mix(in oklab, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px);
    border-bottom: 1px solid var(--line);
  }
  .tabbar {
    display: flex; position: fixed; z-index: 20; inset: auto 0 0 0; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); background: color-mix(in oklab, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); border-top: 1px solid var(--line);
  }
  .tabbar a {
    flex: 1; min-width: 0; display: grid; place-items: center; align-content: center; gap: 3px; text-decoration: none;
    font-size: 11px; font-weight: 500; color: var(--text-2); transition: color .15s;
  }
  .tabbar span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
  .tabbar a[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .tabbar a:active .icon { transform: scale(.88); }
  .tabbar .icon { transition: transform .2s var(--spring); }
  .main { margin-left: 0; padding: 20px max(16px, env(safe-area-inset-right)) calc(var(--tabbar) + env(safe-area-inset-bottom) + 32px) max(16px, env(safe-area-inset-left)); }
}
.main.solo { margin: 0; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg-subtle); }

/* ---------- Type ---------- */
h1 { font-size: clamp(24px, 20px + 1.5vw, 30px); line-height: 1.2; font-weight: 650; letter-spacing: -.022em; margin: 0 0 6px; text-wrap: balance; }
h2 { font-size: 19px; line-height: 1.3; font-weight: 600; letter-spacing: -.012em; margin: 40px 0 12px; }
.lede { color: var(--text-2); margin: 0 0 28px; font-size: 16px; }
.muted { color: var(--text-2); }
.small { font-size: 14px; }

/* ---------- Controls ---------- */
[hidden] { display: none !important; }  /* .btn and friends set display, which would otherwise show hidden ones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px;
  border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 15px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .18s var(--spring), filter .15s, background-color .15s, box-shadow .15s, opacity .15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.96); }
.btn.secondary { background: var(--fill); color: var(--text); }
.btn.secondary:hover { background: var(--fill-strong); filter: none; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.ghost { background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--fill); color: var(--text); filter: none; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; cursor: default; transform: none; filter: none; }
.btn[aria-busy="true"]::before {
  content: ""; width: 15px; height: 15px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }
.icon-btn {
  width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; border-radius: 10px; background: transparent;
  color: var(--text-2); cursor: pointer; transition: background-color .15s, color .15s, transform .18s var(--spring);
}
.icon-btn:hover { background: var(--fill); color: var(--text); }
.icon-btn:active { transform: scale(.9); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

label, .label { display: block; font-size: 14px; font-weight: 500; margin: 0 0 6px; }
.hint { color: var(--text-2); font-size: 13px; font-weight: 400; }
.input, input[type=text], input[type=search], input[type=email], input[type=password], input[type=date], input[type=time], input[type=number], textarea, select {
  width: 100%; max-width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg); font-size: 16px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
select { appearance: none; padding-right: 36px; cursor: pointer;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; font-size: 15px; cursor: pointer; margin: 0; }
.check input { width: 18px; height: 18px; margin: 0; }
.field { margin-top: 16px; }
.grid2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }

/* ---------- Surfaces ---------- */
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 24px; padding: 0 9px; border-radius: 999px;
  background: var(--fill); color: var(--text-2); font-size: 13px; font-weight: 500; white-space: nowrap;
  max-width: 100%;  /* Phase 5: a long chip (a project's name) wraps on a phone instead of widening the page */
}
@media (max-width: 480px) { .chip { white-space: normal; line-height: 1.3; padding-block: 3px; border-radius: 12px; } }
/* A long button label wraps on a phone, still at least 44 px tall to tap */
.btn { max-width: 100%; }
@media (max-width: 480px) { .btn { white-space: normal; height: auto; min-height: 44px; padding-block: 8px; line-height: 1.25; text-align: center; }
  .btn.sm { height: auto; min-height: 40px; padding-block: 6px; } }
/* WebKit's file picker has a fixed width wider than a 320 px phone */
input[type=file] { max-width: 100%; min-width: 0; }
.chip.accent { background: var(--accent-soft); color: var(--text); }
.chip.warn { background: var(--danger-soft); color: var(--danger); }
.flash {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin: 0 0 20px; font-size: 15px;
  animation: drop .35s var(--ease-out) both;
}
.flash .icon { margin-top: 2px; }
.flash.error { background: var(--danger-soft); color: var(--danger); }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
@keyframes drop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-main { flex: 1; min-width: 0; }
.row-title { display: block; font-weight: 500; overflow-wrap: anywhere; }
/* A row that opens as a whole: its main link covers the row; buttons inside stay on top. */
.row.tap { position: relative; }
.row.tap .row-link::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.row.tap .btn { position: relative; z-index: 1; }
.row.tap:hover { background: var(--fill); }
.row-sub { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--text-2); font-size: 14px; margin-top: 2px; }
.empty { text-align: center; color: var(--text-2); padding: 48px 16px; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
.disclose-icon { transition: transform .25s var(--ease-out); color: var(--text-2); }
details[open] > summary .disclose-icon { transform: rotate(180deg); }
details[open] > .reveal { animation: enter .28s var(--ease-out) both; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 15px; }
th { font-size: 13px; font-weight: 500; color: var(--text-2); }
code { font: 500 14px/1.4 ui-monospace, "SF Mono", Menlo, monospace; background: var(--fill); padding: 2px 6px; border-radius: 6px; }

/* ---------- Ask ---------- */
.ask { display: flex; flex-direction: column; min-height: calc(100dvh - 136px); }
.hello { margin: auto 0; text-align: center; padding: 24px 0 32px; }
.hello img, .hello .avatar { margin: 0 auto 20px; border-radius: 14px; }
.hello img { object-fit: contain; }
.hello .spaces { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.thread { display: grid; gap: 24px; padding-bottom: 24px; }
.bubble {
  justify-self: end; max-width: 85%; background: var(--fill); padding: 10px 16px; border-radius: 20px 20px 6px 20px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.answer { font-size: 16.5px; line-height: 1.65; animation: reveal .5s var(--ease-out) both; }
@keyframes reveal { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } }  /* the one authored moment: the answer replaces the shimmer */
.answer-actions { display: flex; gap: 4px; margin: -4px 0 0 -12px; }
.answer p { margin: 0 0 12px; }
.answer ul { margin: 0 0 12px; padding-left: 22px; }
.answer li { margin: 4px 0; }
.cite {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin: 0 1px 0 3px; vertical-align: 2px;
  border-radius: 6px; background: var(--accent-soft); color: var(--text); font-size: 12px; font-weight: 600; text-decoration: none;
  transition: background-color .15s, transform .18s var(--spring);
}
.cite:hover { background: var(--accent); color: var(--on-accent); transform: translateY(-1px); }
.sources { border-top: 1px solid var(--line); padding-top: 14px; }
.sources-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 0 4px; }
.source { border-bottom: 1px solid var(--line); scroll-margin-top: 80px; border-radius: 10px; transition: background-color .4s; }
.source:last-child { border-bottom: 0; }
.source:has(.anchor:target) { background: var(--accent-soft); }
.anchor { display: block; scroll-margin-top: 80px; }
.source summary { display: flex; align-items: center; gap: 12px; padding: 10px 6px; }
.old-versions { margin-top: 32px; }
.old-versions summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.old-versions summary h2 { margin: 0; }
.old-versions .row-title { color: var(--text-2); }
.source .n { flex: none; min-width: 24px; padding: 0 6px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--fill); font-size: 13px; font-weight: 600; }
.source .reveal { padding: 0 6px 14px 42px; }
.passage { white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--text-2); margin: 0 0 12px; }
.typing { display: grid; gap: 10px; }
.typing span { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--fill) 0%, var(--fill-strong) 50%, var(--fill) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.typing span:nth-child(1) { width: 92%; } .typing span:nth-child(2) { width: 78%; } .typing span:nth-child(3) { width: 55%; }
@keyframes shimmer { to { background-position: -200% 0; } }
.composer-wrap { position: sticky; bottom: 0; padding: 12px 0 16px; background: linear-gradient(to top, var(--bg) 70%, transparent); margin-top: auto; }
@media (max-width: 899px), (max-height: 500px) { .composer-wrap { bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: 12px; } }
.composer {
  display: flex; align-items: flex-end; gap: 8px; padding: 8px 8px 8px 16px; border: 1px solid var(--line); border-radius: 24px;
  background: var(--bg); box-shadow: var(--shadow-float); transition: border-color .15s, box-shadow .2s;
}
.composer:focus-within { border-color: color-mix(in oklab, var(--accent) 50%, var(--line)); }
.composer textarea { border: 0; box-shadow: none; padding: 8px 0; min-height: 40px; max-height: min(200px, 30dvh); resize: none; background: transparent; }
.composer textarea:focus { box-shadow: none; }
.send {
  flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: var(--accent); color: var(--on-accent); transition: transform .2s var(--spring), opacity .15s;
}
.send:hover { transform: scale(1.06); }
.send:active { transform: scale(.9); }
.send:disabled { opacity: .3; cursor: default; transform: none; }
.composer-note { text-wrap: balance; text-align: center; font-size: 12px; color: var(--text-2); margin: 8px 0 0; }

/* ---------- Photos ---------- */
.photos { display: grid; gap: 4px; margin-top: 12px; border-radius: 14px; overflow: hidden; grid-template-columns: repeat(3, 1fr); }
.photos.n1 { grid-template-columns: 1fr; }
.photos.n2, .photos.n4 { grid-template-columns: repeat(2, 1fr); }
.photos button { padding: 0; border: 0; background: var(--fill); cursor: zoom-in; aspect-ratio: 1; overflow: hidden; }
.photos.n1 button { aspect-ratio: 4 / 3; }
.photos img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease-out); }
.photos button:hover img { transform: scale(1.03); }
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100dvh; }
.lightbox::backdrop { background: rgba(0, 0, 0, .86); }
.lightbox[open] img { animation: zoom .3s var(--ease-out) both; max-width: 94vw; max-height: 88dvh; border-radius: 10px; }
.lightbox .icon-btn { position: fixed; color: #fff; background: rgba(255, 255, 255, .14); width: 44px; height: 44px; border-radius: 50%; }
.lightbox .icon-btn:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.lightbox .close { top: 16px; right: 16px; }
.lightbox .prev, .lightbox .next { top: 50%; transform: translateY(-50%); }
.lightbox .prev { left: 16px; } .lightbox .next { right: 16px; }
.lightbox .count { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); margin: 0; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); text-align: center; color: #fff; font-size: 14px; font-variant-numeric: tabular-nums; }
.lightbox[data-single] .prev, .lightbox[data-single] .next, .lightbox[data-single] .count { display: none; }
@keyframes zoom { from { opacity: 0; transform: scale(.94); } }
.previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.previews:empty { display: none; }
.previews figure { position: relative; margin: 0; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; animation: zoom .25s var(--ease-out) both; }
.previews img { width: 100%; height: 100%; object-fit: cover; }
.previews button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; }

/* ---------- Updates ---------- */
.compose-card textarea { resize: none; overflow: hidden; border: 0; padding: 4px 0; min-height: 84px; box-shadow: none; font-size: 17px; background: transparent; }
.compose-card textarea:focus { box-shadow: none; }
.compose-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 8px; }
.compose-bar select, .compose-bar input[type=text] { width: auto; min-height: 36px; height: 36px; padding-top: 0; padding-bottom: 0; font-size: 14px; border-radius: 10px; }
.compose-bar select { flex: 1 1 150px; min-width: 0; max-width: 100%; }
.compose-bar input[type=text] { flex: 1 1 130px; }
.compose-bar button.btn { flex: none; }
.post { display: flex; gap: 12px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.post:last-child { border-bottom: 0; }
.post-body { flex: 1; min-width: 0; }
.post-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; color: var(--text-2); }
.post-head strong { color: var(--text); font-size: 15px; font-weight: 600; }
.post-text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0 0; }
.post-tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
/* Progress photos: links per project, the worker's own words, the confirmation step, a post opened from a link. */
.progress-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 20px; }
.progress-links .hint { margin-right: 4px; }
a.chip { text-decoration: none; }
a.chip:hover { color: var(--text); }
.original { margin-top: 6px; }
.original summary { font-size: 13px; color: var(--text-2); cursor: pointer; }
.original .post-text { color: var(--text-2); }
.compose-card .confirm-view textarea { display: block; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg); min-height: 0; }
.compose-card .confirm-view textarea:focus { border-color: color-mix(in oklab, var(--accent) 60%, var(--line)); }
.confirming .previews button { display: none; }
.post { scroll-margin-top: 80px; }
.post:target { background: var(--accent-soft); box-shadow: 0 0 0 8px var(--accent-soft); border-radius: 4px; }
.progress-day h2 .hint { margin-left: 6px; }
.thumbs { display: flex; gap: 4px; margin: 0 6px 12px 42px; width: fit-content; border-radius: 10px; }
.thumbs img, .thumbs .more { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; background: var(--fill); }
.thumbs .more { display: grid; place-items: center; font-size: 14px; font-weight: 600; color: var(--text-2); }
.thumbs:hover img { opacity: .85; }

/* ---------- Documents ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.search { position: relative; flex: 1; min-width: min(200px, 100%); }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-2); }
.search input { padding-left: 40px; }
.doc-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--fill); color: var(--text-2); }
.row-title a { text-decoration: none; }
.row-title a:hover { text-decoration: underline; }
.upload-panel { margin-bottom: 28px; }
.upload-panel .file-pick { padding: 20px; }
.file-pick { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1.5px dashed var(--fill-strong); border-radius: 14px; cursor: pointer; transition: border-color .15s, background-color .15s; }
.file-pick:hover, .file-pick.drag { border-color: var(--accent); background: var(--accent-soft); }
.file-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-pick strong { font-weight: 600; }

/* ---------- People ---------- */
.perm { display: grid; grid-template-columns: 1fr auto auto; gap: 0 24px; align-items: center; }
.perm > * { padding: 10px 0; border-bottom: 1px solid var(--line); }
.perm input { width: 20px; height: 20px; margin: 12px; justify-self: center; cursor: pointer; }
.perm .h { font-size: 13px; color: var(--text-2); font-weight: 500; }
.secret { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }

/* ---------- Login ---------- */
.login { width: 100%; max-width: 400px; }
.login .panel { padding: 32px 28px; box-shadow: var(--shadow-float); border: 0; }
.login .mark { display: block; height: 72px; width: auto; max-width: 100%; padding: 6px 8px; margin-bottom: 20px; border-radius: 10px; object-fit: contain; object-position: left; background: #fff; box-sizing: border-box; }
.login .powered { justify-content: center; margin-top: 20px; }

/* ---------- Visuals (charts and steps) ---------- */
:root { --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --grid: #ececef; --axis: #c7c7cc; }
.s1 { --c: var(--s1); } .s2 { --c: var(--s2); } .s3 { --c: var(--s3); }
.visual { margin: 4px 0 20px; padding: 18px 18px 12px; border: 1px solid var(--line); border-radius: 18px; animation: reveal .5s .08s var(--ease-out) both; }
.visual figcaption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 14px; font-size: 15px; }
.visual-src { font-size: 13px; color: var(--text-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: -4px 0 12px; padding: 0; font-size: 13px; color: var(--text-2); }
.legend li { display: flex; align-items: center; gap: 6px; }
.key { width: 14px; height: 4px; border-radius: 2px; background: var(--c); }
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(80px, 30%) 1fr; gap: 12px; align-items: center; }
.bar-label { font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.bar-group { display: grid; gap: 2px; }
.bar-track { position: relative; height: 22px; border-radius: 4px; outline-offset: 2px; }
.bar { position: absolute; top: 3px; bottom: 3px; min-width: 2px; border-radius: 4px; background: var(--c); transform-origin: left; animation: grow .6s var(--ease-out) both; }
.bar-track:hover .bar, .bar-track:focus .bar { filter: brightness(1.1); }
.bars { --value-room: 76px; }
.bar-track { margin-right: var(--value-room); }
.bar-value { position: absolute; right: calc(-1 * var(--value-room)); width: var(--value-room); top: 50%; transform: translateY(-50%); text-align: right; font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text); }
.zero { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--axis); }
@keyframes grow { from { transform: scaleX(0); } }
.line-chart { padding: 4px 56px 0 52px; }
.plot { position: relative; height: 200px; }
.plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.plot polyline { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke;
  stroke-dasharray: 1000; animation: draw 1s var(--ease-out) both; }
@keyframes draw { from { stroke-dashoffset: 1000; } to { stroke-dashoffset: 0; } }
.grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--grid); }
.grid:first-child { background: var(--axis); }
.tick { position: absolute; right: calc(100% + 8px); top: -8px; font-size: 12px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dot { position: absolute; width: 10px; height: 10px; margin: 0 0 -5px -5px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px var(--bg); cursor: default; transition: transform .2s var(--ease-out); }
.dot::after { content: ""; position: absolute; inset: -10px; }  /* hit target larger than the mark */
.dot:hover, .dot:focus { transform: scale(1.4); outline: none; }
.end-label { position: absolute; left: calc(100% + 10px); margin-bottom: -9px; font-size: 13px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.xaxis { position: relative; height: 28px; margin-top: 8px; }
.xaxis span { position: absolute; transform: translateX(-50%); font-size: 12px; color: var(--text-2); white-space: nowrap; }
.xaxis span:first-child { transform: none; } .xaxis span:last-child { transform: translateX(-100%); }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { position: relative; display: flex; gap: 14px; padding-bottom: 16px; }
.steps li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; border-radius: 1px; background: var(--fill-strong); }
.step-n { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); font-size: 13px; font-weight: 600; }
.steps strong { display: block; font-weight: 600; line-height: 28px; }
.steps p { margin: 0; color: var(--text-2); font-size: 15px; }
.as-table { margin-top: 8px; font-size: 14px; }
.as-table summary { color: var(--text-2); padding: 6px 0; }
.as-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.chart-tip { position: fixed; z-index: 50; pointer-events: none; padding: 6px 10px; border-radius: 8px; background: var(--text); color: var(--bg);
  font-size: 13px; font-weight: 500; white-space: nowrap; box-shadow: var(--shadow-float); transform: translate(-50%, calc(-100% - 10px)); animation: drop .15s var(--ease-out) both; }

/* ---------- Chat, history, director pages ---------- */
.side-label { margin: 16px 12px 4px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.side-chats { display: grid; gap: 1px; overflow-y: auto; min-height: 88px; flex: 1; margin-top: -8px; }  /* some of the chats stay in view under a long menu */
.side-chats a { display: block; padding: 7px 12px; border-radius: 9px; color: var(--text-2); text-decoration: none; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background-color .15s, color .15s; }
.side-chats a:hover, .side-chats a[aria-current="page"] { background: var(--fill); color: var(--text); }
.sidebar { overflow: hidden; }
a.who { text-decoration: none; transition: background-color .15s; }
a.who:hover, a.who[aria-current="page"] { background: var(--fill); }
.ask-bar { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; margin: -8px 0 8px; }
.ask-bar form { margin: 0; }
.turn { display: grid; gap: 14px; }
.turn + .turn { padding-top: 24px; border-top: 1px solid var(--line); }
.answer.streaming p:last-child::after { content: ""; display: inline-block; width: 8px; height: 1em; margin-left: 2px; vertical-align: -2px;
  border-radius: 2px; background: var(--accent); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.followups { display: flex; flex-wrap: wrap; gap: 8px; }
.followup { font: inherit; font-size: 14px; text-align: left; padding: 8px 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); cursor: pointer; transition: background-color .15s, border-color .15s, transform .18s var(--spring); }
.followup:hover { background: var(--fill); border-color: var(--fill-strong); }
.followup:active { transform: scale(.97); }
.subnav { display: flex; gap: 4px; overflow-x: auto; margin: -8px auto 20px; max-width: 1000px; padding-bottom: 2px; }
.subnav a { padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--text-2); text-decoration: none; white-space: nowrap; }
.subnav a:hover { background: var(--fill); color: var(--text); }
.subnav a[aria-current="page"] { background: var(--text); color: var(--bg); }
.subnav-pick { display: none; }
@media (max-width: 899px), (max-height: 500px) {
  .subnav { display: none; }
  .subnav-pick { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 44px; margin: -8px 0 20px;
    padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); font-weight: 600; font-size: 15px; cursor: pointer; }
  .subnav-pick span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.subnav-list { position: fixed; margin: 0; padding: 6px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); color: var(--text);
  box-shadow: var(--shadow-float); inset: calc(var(--topbar) + env(safe-area-inset-top) + 60px) max(16px, env(safe-area-inset-right)) auto max(16px, env(safe-area-inset-left));
  width: auto; max-height: calc(100dvh - var(--topbar) - env(safe-area-inset-top) - 60px - var(--tabbar) - env(safe-area-inset-bottom) - 8px); overflow-y: auto; }
.subnav-list:popover-open { display: grid; gap: 2px; animation: drop .2s var(--ease-out) both; }
.budget-banner { display: flex; gap: 10px; align-items: flex-start; max-width: 1000px; margin: -12px auto 20px; padding: 12px 14px;
  border-radius: 12px; text-decoration: none; font-size: 15px; background: #fff5e0; color: #7a4a00; animation: drop .35s var(--ease-out) both; }
.budget-banner.over { background: var(--danger-soft); color: var(--danger); }
:root[data-theme="dark"] .budget-banner.warn { background: #3a2c12; color: #f5c46b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .budget-banner.warn { background: #3a2c12; color: #f5c46b; } }
.filters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); align-items: end; margin-bottom: 20px; }
.filters .check { min-height: 44px; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.log-row { display: block; }
.log-row summary { display: flex; gap: 12px; align-items: center; }
.log-detail { padding: 12px 0 4px 44px; }
.log-detail .answer { font-size: 15px; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); margin-bottom: 20px; }
.stat { display: grid; gap: 4px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.stat-label { font-size: 13px; color: var(--text-2); }
.stat-value { font-size: 26px; font-weight: 650; letter-spacing: -.02em; overflow-wrap: anywhere; }
.stat-value small { font-size: 14px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.meter { display: block; height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; margin-top: 4px; }
.meter span { display: block; height: 100%; border-radius: 3px; background: var(--accent); transition: width .6s var(--ease-out); }
.meter.warn span { background: #d98a00; }
.meter.over span { background: var(--danger); }
.insights-suggest { margin: 8px 0 8px; }  /* not .suggest: that is the typing drop-down (position: absolute) */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
section.panel + section.panel { margin-top: 16px; }
.choices { display: grid; gap: 8px; margin-top: 12px; }
.choice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
  font-weight: 400; margin: 0; transition: border-color .15s, background-color .15s; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choice input { margin-top: 3px; }
.choice strong { display: block; font-weight: 600; }
.color-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.color-row input[type=color] { width: 56px; height: 44px; padding: 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: pointer; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--fill); }
.segmented button, .segmented a { font: inherit; text-decoration: none; font-size: 14px; font-weight: 500; padding: 7px 16px; border: 0; border-radius: 9px; background: transparent;
  color: var(--text-2); cursor: pointer; transition: background-color .15s, color .15s, box-shadow .15s; }
.segmented button[aria-checked="true"], .segmented a[aria-current="page"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

/* ---------- Digest, document check, starters ---------- */
.welcome { font-size: 17px; margin: 8px auto 6px; max-width: 560px; }
.starters { justify-content: center; margin-top: 18px; }
.digest-headline { font-size: 19px; font-weight: 500; line-height: 1.5; margin: 4px 0 8px; }
.attention { margin: 20px 0 8px; padding: 16px 18px; border-radius: 16px; background: var(--accent-soft); }
.attention h2 { margin: 0 0 8px; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.attention ul { margin: 0; padding-left: 20px; }
.attention li { margin: 6px 0; }
.attention li p { margin: 0; }
.digest-section { padding: 8px 0 12px; border-bottom: 1px solid var(--line); }
.digest-section h2 { margin-top: 28px; }
.figures { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); margin: 4px 0 16px; }
.figure { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--fill); }
.figure-value { font-size: clamp(16px, 4.8cqi, 20px); font-weight: 650; letter-spacing: -.01em; overflow-wrap: anywhere; }  /* a 7-figure sum stays on one line on a phone */
.figure-label { font-size: 13px; color: var(--text-2); }
.figure-value p { margin: 0; } .figure-value .cite { font-size: 11px; vertical-align: 3px; }
.caption { margin: -8px 0 12px; font-size: 15px; color: var(--text-2); }
.caption p { margin: 0; }
.conflict { padding: 18px 0; border-bottom: 1px solid var(--line); }
.conflict-head { display: flex; gap: 10px; align-items: center; }
.compare { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); margin: 12px 0; }
.compare-side { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; }
.compare-side.current { border-color: var(--accent); }
.compare-title { margin: 0 0 6px; font-weight: 600; }
.compare-title .hint { display: block; font-weight: 400; }

/* ---------- Procurement review: scan beside the fields ---------- */
.review { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 20px; }
@media (min-width: 1100px) { .review { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; } .scan { position: sticky; top: 16px; } }
.scan iframe, .scan img { display: block; width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 14px; background: var(--fill); object-fit: contain; }
.scan a { display: inline-block; margin-top: 6px; }
.review fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.table-scroll, .table-wrap { overflow-x: auto; position: relative; }  /* relative: hidden labels in a wide table stay inside it, not widening the page */
.lines th, .lines td { padding: 4px; }
.lines input { min-height: 36px; padding: 6px 8px; font-size: 15px; border-radius: 8px; min-width: 64px; }
.lines td:nth-child(2) input { min-width: 220px; }
.doubt input, tr.doubt input, .doubt.sig input[type=text] { border-color: var(--danger); background: var(--danger-soft); }
.sig { align-items: end; margin-top: 12px; }
.flag-text { margin: 4px 0 0; }
.flag-review { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.flag-review input { flex: 1 1 200px; width: auto; min-width: 0; max-width: 100%; }
.flag-review input { min-height: 34px; padding: 6px 10px; font-size: 14px; border-radius: 10px; }
.row.flag, .row.supplier { align-items: flex-start; }
.row.supplier details { flex: 1; min-width: 0; }
.row.supplier form { padding: 12px 0 4px; }
.items { margin-top: 12px; font-size: 14px; }
.items td, .items th { padding: 8px 6px; }
.items .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row.supplier fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.project-row { flex: 1; align-items: end; }
.project-row .coordinators { grid-column: 1 / -1; border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.project-row .coordinators legend { width: 100%; padding: 0; margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.project-actions { display: flex; gap: 12px; align-items: center; }
.project-id { margin: 10px 0 0; }
.project-id label { width: 100%; margin: 0; }
.project-id input { flex: 1; min-width: 0; max-width: 260px; }
.proc-filter { margin: 0 0 16px; }
.sheet { font-size: 14px; }
.sheet th, .sheet td { padding: 8px 10px; white-space: nowrap; vertical-align: top; }
.sheet .wide-cell { white-space: normal; min-width: 220px; }
.sheet .num { text-align: right; font-variant-numeric: tabular-nums; }
.panel > h2:first-child { margin-top: 0; }
.flag-group { padding: 16px 0; border-bottom: 1px solid var(--line); }
.flag-group:last-child { border-bottom: 0; }
.flag-group .list { margin-top: 4px; }

/* Loading bar while a tapped link's page loads (app.js); it keeps filling with Reduce Motion (see below). */
.leaving body::after { content: ""; position: fixed; top: env(safe-area-inset-top); left: 0; right: 0; z-index: 100; height: 3px;
  background: var(--accent); transform-origin: left; animation: leaving 8s cubic-bezier(.1, .7, .3, 1) forwards; }
@keyframes leaving { from { transform: scaleX(0); } to { transform: scaleX(.95); } }

/* Pages fade into each other instead of flashing blank (Safari 18.2+, Chrome 126+); the tab bar stays put. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .tabbar { view-transition-name: tabbar; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  /* A busy spinner is the one motion kept, slower: without it the ring looks stuck and nothing says work is happening. */
  .btn[aria-busy="true"]::before { animation-duration: 1.4s !important; animation-iteration-count: infinite !important; }
  .leaving body::after { animation-duration: 8s !important; }  /* likewise: a still bar would not say a page is coming */
}

/* ---------- Quote comparison grid ---------- */
.cmp td.cell { min-width: 210px; white-space: normal; }
.cmp td.cell .chip { margin-right: 4px; }
.cmp td.unsure { box-shadow: inset 3px 0 var(--danger); }
.cmp .offered { display: block; margin-top: 2px; }
.cmp .rate { display: block; margin-bottom: 4px; }
.cmp .rate .chip, .cmp .rate .hint { margin-left: 4px; }
.mr-table td.approval { min-width: 200px; white-space: normal; }
.mr-table td.approval .hint { display: block; margin-top: 2px; }
.cmp .cell-edit { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cmp .cell-edit select, .cmp .cell-edit input { min-height: 32px; padding: 4px 8px; font-size: 13px; border-radius: 8px; width: auto; flex: 1 1 100px; }
.cmp .cell-edit input::placeholder { font-style: italic; }
.cmp tr.group td { background: var(--fill); font-weight: 600; white-space: normal; }
.cmp tr.subtotal td, .cmp tfoot td { font-weight: 600; }
.cmp tfoot tr.total td { border-top: 2px solid var(--text); }
.drawing-reads td { white-space: normal; vertical-align: top; }
.drawing-reads img { display: block; max-width: 300px; max-height: 220px; width: auto; height: auto; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; }
.cmp td.item-cell { white-space: normal; min-width: 260px; max-width: 360px; }
.cmp .requirement, .cmp .source { display: block; margin-top: 4px; }
.cmp .requirement { font-size: 13px; }
.cmp .lines-detail { margin-top: 4px; font-size: 13px; }
.cmp .lines-detail ul { margin: 4px 0 0; padding-left: 18px; }
.sheet.scope td { white-space: normal; min-width: 180px; }
.prices-edit td { padding: 4px; }
.prices-edit input, .prices-edit select { min-height: 34px; padding: 4px 8px; font-size: 14px; border-radius: 8px; min-width: 160px; }
.prices-edit input.short { min-width: 70px; width: 90px; }
.price-tag { display: block; padding: 2px 0; }
.price-tag.stale { opacity: .55; }
/* The store (SPEC 4.3): photos on the sheet, the PM's "from store" on each PR line, DO lines to check. */
.store-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 8px; vertical-align: middle; margin-right: 8px; }
.store-photo { width: 96px; height: 96px; object-fit: cover; border-radius: 14px; }
.phone-only { display: none; }
@container page (max-width: 599px) { .store-sheet .wide-only, .statement .wide-only { display: none; } .store-sheet .phone-only, .statement .phone-only { display: block; } }  /* phones: item (and what is reserved), in store, free */
.res-row { flex-wrap: wrap; }  /* a reservation's text keeps its width; its buttons go underneath on a phone */
.res-row .row-main { flex: 1 1 240px; }
.res-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.store-stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 96px), 1fr)); }
.store-stats .stat-value { font-size: 22px; }
.mr-store { grid-column: 1 / -1; display: grid; gap: 6px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); }
.mr-store[hidden] { display: none; }
.do-lines input, .do-lines select { min-width: 90px; }
.do-lines tr.unsure td:first-child { box-shadow: inset 3px 0 var(--danger); }
.do-lines td:first-child input { min-width: 240px; }  /* the supplier's wording, read in full */
.do-lines select[name="po_line"] { min-width: 240px; }
.do-lines select[name="problem"] { min-width: 150px; }
.price-line .row-sub, .price-estimate { display: block; margin-top: 2px; }
.price-estimate { margin-top: 6px; }
.match-form { margin-top: 10px; }
.match-form fieldset { border: 0; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.match-change { margin-top: 6px; }
.match-change summary { cursor: pointer; color: var(--accent); font-size: 14px; }

/* ---------- Material requests ---------- */
.mr-static { margin: 0; padding: 11px 0; font-size: 16px; }
.mr-lines { display: grid; gap: 12px; margin-top: 16px; }
/* Phone first: item (and brand) across the row, then colour, unit and quantity side by side. */
.mr-line { position: relative; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px 12px; margin: 0; padding: 14px;
  border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.mr-line label { position: relative; margin: 0; min-width: 0; }
.mr-line input { margin-top: 6px; }
.mr-item, .mr-brand { grid-column: 1 / -1; padding-right: 40px; }
.mr-brand { padding-right: 0; }
.mr-remarks { grid-column: 1 / -1; }
.pr-form-links { display: flex; flex-wrap: wrap; gap: 8px; }
.mr-remove { position: absolute; top: 8px; right: 8px; }
/* Duplicate: the same item in another colour. Needs the script, so it shows only once the form is enhanced. */
.mr-dup { display: none; grid-column: 1 / -1; justify-self: start; margin: -2px 0 -6px -10px; }
.mr-js .mr-dup { display: inline-flex; }
[data-add-line] { margin-top: 12px; }
@container page (min-width: 760px) {
  .mr-line { grid-template-columns: 3fr 1.3fr 1.2fr 1fr; padding-right: 52px; }
  .mr-line:has(.mr-brand) { grid-template-columns: 3fr 1.3fr 1.2fr 1fr 1.6fr; }
  .mr-item, .mr-brand { grid-column: auto; padding-right: 0; }
  .mr-remove { top: 36px; }
}
.needed { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; }
.needed-option { min-height: 44px; flex-wrap: wrap; }
.needed-date { width: auto; margin-left: 30px; }
.needed-date[hidden] { display: none; }
.mr-table th { text-align: left; font-size: 13px; color: var(--text-2); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.mr-table td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.worker-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%; }
.worker-row .row-title { flex: 1 1 160px; }
.worker-row select { width: auto; }
/* Suggestions under a field as you type */
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin: 4px 0 0; padding: 4px; list-style: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-float);
  max-height: min(264px, 40dvh); overflow-y: auto; font-weight: 400; }
.suggest li { padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--fill); }
.suggest .hint { margin-left: 6px; }

/* PR signatures and the PO approval chain (SPEC 4.6) */
.signs, .po-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 8px; }
.signs li, .po-step { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-subtle); }
.po-step.done { background: var(--ok-soft); border-color: transparent; }
.po-step.done svg { color: var(--ok); vertical-align: -3px; margin-right: 4px; }
.po-step.waiting { border-color: var(--accent); }
.po-step.later { opacity: .7; }
a.stat { color: inherit; text-decoration: none; }
a.stat:hover { border-color: var(--accent); }
.po-progress { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.po-progress .chip.waiting { box-shadow: inset 0 0 0 1px var(--accent); }
.po-progress .chip.later { opacity: .6; }
.po-progress svg { vertical-align: -2px; margin-right: 2px; }
.pr-sign { margin-bottom: 16px; }
.po-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.po-actions form { margin: 0; }
.po-back { margin: 0 0 12px; }
.po-back summary { cursor: pointer; font-weight: 600; }
.po-changes { margin: 4px 0 0; padding-left: 18px; font-size: 14px; color: var(--text-2); }
.po-head { margin-bottom: 12px; }
.po-head .label { display: block; }
.po-line fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.po-sources { display: grid; gap: 4px; }
.po-sources .check { align-items: flex-start; font-size: 14px; }
.po-sources .check.stale { opacity: .6; }
.po-items { margin: 0 0 8px; padding: 0; }
.po-items .row-main { gap: 4px; }
.po-items .chip { margin-left: 6px; vertical-align: 1px; }
.po-totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 0 0 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.po-totals dt { text-align: right; color: var(--text-2); } .po-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Light or dark, the account avatar, More on the phone tab bar ---------- */
.who-row { display: flex; align-items: center; gap: 4px; }
.who-row .who { flex: 1; min-width: 0; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
}
.topbar .org { min-width: 0; }
.topbar .icon-btn { flex: none; }  /* on the smallest phones the company's name gives way, not the 44 px buttons */
.topbar .org span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .refresh { margin-left: auto; width: 44px; height: 44px; }
.topbar .theme-toggle { width: 44px; height: 44px; }
.refresh[aria-busy="true"] .icon { animation: spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .refresh[aria-busy="true"] .icon { animation: none; opacity: .5; } }
.me-link { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; text-decoration: none; }
.me-link .avatar { width: 30px; height: 30px; font-size: 13px; transition: transform .18s var(--spring), box-shadow .15s; }
.me-link:active .avatar { transform: scale(.9); }
.me-link[aria-current="page"] .avatar { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.tab-more { display: none; }
@media (max-width: 899px), (max-height: 500px) {
  .tab-more { flex: 1; min-width: 0; display: grid; place-items: center; align-content: center; gap: 3px; padding: 0; border: 0;
    background: none; font: inherit; font-size: 11px; font-weight: 500; color: var(--text-2); cursor: pointer; }
  .tab-more[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .tab-more:active .icon { transform: scale(.88); }
  .tab-more .icon { transition: transform .2s var(--spring); }
}
/* A landscape phone has about 390 px of height: thinner bars, each label beside its icon */
@media (max-height: 500px) {
  :root { --tabbar: 44px; --topbar: 44px; }
  .tabbar a, .tab-more { grid-auto-flow: column; justify-content: center; gap: 6px; }
}
.more-tabs { position: fixed; inset: auto max(12px, env(safe-area-inset-right)) calc(var(--tabbar) + env(safe-area-inset-bottom) + 8px) auto; margin: 0; min-width: 200px;
  max-height: calc(100dvh - var(--tabbar) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px); overflow-y: auto;
  padding: 6px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg); color: var(--text); box-shadow: var(--shadow-float); }
.more-tabs:popover-open { display: grid; gap: 2px; animation: drop .2s var(--ease-out) both; }
.more-tabs a, .subnav-list a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; text-decoration: none;
  font-size: 15px; font-weight: 500; color: var(--text-2); }
.more-tabs a:hover, .subnav-list a:hover { background: var(--fill); color: var(--text); }
.more-tabs a[aria-current="page"], .subnav-list a[aria-current="page"] { background: var(--fill); color: var(--text); font-weight: 600; }
.more-tabs a[aria-current="page"] .icon { color: var(--accent); }

/* ---------- Folds: a section that opens and closes (native details), with what is inside said on its header ---------- */
.folds { margin-top: 8px; border-top: 1px solid var(--line); }
.fold { border-bottom: 1px solid var(--line); }
.fold > summary { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 8px; margin: 0 -8px; border-radius: 12px;
  transition: background-color .15s; }
.fold > summary:hover { background: var(--fill); }
.fold > summary h2, .fold > summary h3 { margin: 0; text-wrap: balance; }
.fold > summary h3 { font-size: 16px; font-weight: 600; line-height: 1.35; }
.fold-head { flex: 1; min-width: 0; display: grid; gap: 4px; }
.fold-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--text-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.fold-body { padding: 0 0 20px; }
.fold-body > .row:first-child, .fold-body > .list:first-child { margin-top: -4px; }
/* A fold inside a fold: lighter, so the outer heading stays the landmark. */
.fold .fold > summary { min-height: 52px; padding: 10px 8px; }
.fold .fold:last-child { border-bottom: 0; }
.fold .fold .fold-body { padding-bottom: 14px; }
.fold-body > .fold:first-child { border-top: 1px solid var(--line); }
.fold-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0 0; }
.fold-tools .hint { margin: 0; }
/* A form behind a fold: the header reads as an action, the form sits on its own surface. */
.fold.action > summary h2 { font-size: 17px; }
.fold.action > summary .fold-icon { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--fill); color: var(--text-2); }
.fold.action[open] > summary .fold-icon { background: var(--accent-soft); color: var(--text); }

/* ---------- Current prices: categories, then each type by size ---------- */
.price-sheet { margin: 4px 0 8px; }
.price-sheet .size-cell { width: 1%; padding-right: 16px; font-weight: 600; }
.price-sheet td.wide-cell { min-width: 0; }
.price-sheet td.item-cell { min-width: 140px; max-width: 280px; font-weight: 500; }
.price-sheet tr:last-child td { border-bottom: 0; }
.price-tag strong { font-weight: 600; }
.price-tag + .price-tag { margin-top: 4px; }
.action-folds { margin-top: 32px; }
/* A row of filters that does not fit scrolls within itself, never the page. */
.segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.segmented::-webkit-scrollbar { display: none; }
.segmented > * { flex: none; white-space: nowrap; }
.page-actions { margin: 12px 0 8px; }

/* ---------- PDF: a page printed (Save as PDF) is the page itself, without the app around it ---------- */
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --bg-subtle: #fff; --fill: #f0f0f2; --fill-strong: #e6e6ea; --line: rgba(0, 0, 0, .15);
    --text: #000; --text-2: #444; --accent: var(--brand); --accent-soft: color-mix(in oklab, var(--brand) 10%, transparent);
    --danger: #a00016; --danger-soft: #fdecee; --ok: #1b7f3b; --ok-soft: #e9f6ee; color-scheme: light; }
  @page { size: A4; margin: 14mm 12mm; }
  body { font-size: 11pt; background: #fff; }
  .sidebar, .topbar, .tabbar, .more-tabs, .subnav, .subnav-pick, .switch-banner, .budget-banner, .btn, .icon-btn, .toolbar form, form.toolbar,
  .filters, .fold.action, .action-folds:has(> .fold.action:only-child), .disclose-icon, .segmented, .flash, .cell-edit { display: none !important; }
  .main { margin: 0; padding: 0; animation: none; }
  .page, .page.wide { max-width: none; container-type: normal; }  /* a contained box may not break across printed pages */
  .fold > summary { min-height: 0; padding: 8px 0; margin: 0; }
  .fold-body { padding-bottom: 8px; }
  .table-scroll { overflow: visible; }
  .sheet th, .sheet td { white-space: normal; padding: 4px 6px; }
  .sheet .wide-cell { min-width: 0; }
  .store-sheet .wide-only, .statement .wide-only { display: table-cell !important; }
  .phone-only { display: none !important; }
  tr, .row { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
  a { text-decoration: none; color: inherit; }
  .chip { border: 1px solid var(--line); }
  * { animation: none !important; transition: none !important; }
}

/* ---------- Ad-hoc jobs and accounts (SPEC-procurement-labour.md Part 5) ---------- */
.job-steps { list-style: none; margin: 8px 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.job-steps li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-subtle); color: var(--text-2); }
.job-steps li strong { color: var(--text); font-weight: 600; }
.job-steps li.done { background: var(--ok-soft); border-color: transparent; }
.job-steps li.now { border-color: var(--accent); background: var(--bg); }
.job-steps a { font-size: 14px; }
.allocations { border: 0; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.allocations legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 500; }
.allocation { display: grid; grid-template-columns: 1fr 140px; gap: 12px; align-items: center; }
.allocation label { margin: 0; }
.invoice-row { align-items: flex-start; flex-wrap: wrap; }
.invoice-row .row-main { flex: 1 1 260px; }
.invoice-status { display: flex; gap: 6px; align-items: center; margin-left: auto; }
.invoice-status select { width: auto; min-height: 34px; padding: 4px 32px 4px 10px; font-size: 14px; border-radius: 10px; }
.statement tfoot td { font-weight: 600; }
.sheet.claims td, .sheet.claims th { white-space: nowrap; }
@media print { .no-print, .invoice-status { display: none !important; } }
.money-stats { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
@container page (max-width: 599px) { .money-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .money-stats .stat-value { font-size: 20px; } }

/* ---------- The Email inbox (SPEC-procurement-labour.md 5.4) ---------- */
.inbox-item { align-items: flex-start; }
.inbox-file { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.inbox-file select, .inbox-file input[type=text] { width: 100%; min-width: 0; flex: 1 1 220px; min-height: 36px; padding-top: 4px; padding-bottom: 4px; font-size: 14px; border-radius: 10px; }
.inbox-more { margin-top: 8px; }
.inbox-more > summary { padding: 4px 0; }
.email-text { margin: 0 0 8px; }
.email-text .passage { margin: 6px 0 0; max-height: 240px; overflow: auto; }

/* ---------- A document's details (Company documents; user, 2026-10-30) ---------- */
.doc-more { margin-top: 4px; }
.doc-more > summary { padding: 4px 0; cursor: pointer; }
.doc-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 8px 16px; margin: 8px 0 4px; }
.doc-details div { min-width: 0; }
.doc-details .wide { grid-column: 1 / -1; }
.doc-details dt { font-size: 13px; color: var(--text-2); }
.doc-details dd { margin: 2px 0 0; overflow-wrap: anywhere; }

/* Dashboards (Phase 4): a tile is a link to the page behind its number. What waits for this person is outlined in the
   accent, as a job's current step is; a warning carries its icon. Charts sit in panels, two across on wide screens. */
.dashboard h2 { margin-top: 32px; }
.dash-lede { margin-bottom: 0; }
.tiles { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); }
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 120px; padding: 16px 40px 16px 16px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--bg); color: var(--text); text-decoration: none;
  transition: background-color .18s var(--ease-out), border-color .18s var(--ease-out), transform .18s var(--spring); }
.tile:hover { background: var(--bg-subtle); border-color: color-mix(in oklab, var(--text) 18%, transparent); }
.tile:active { transform: scale(.98); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tile.for-you { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 4%, var(--bg)); }
.tile.for-you:hover { background: var(--accent-soft); border-color: var(--accent); }
.tile-label { min-height: calc(2em * 1.35); font-size: 14px; font-weight: 500; color: var(--text-2); line-height: 1.35; }  /* two lines: the numbers line up */
.tile-value { font-size: 30px; font-weight: 650; letter-spacing: -.02em; line-height: 1.1; overflow-wrap: anywhere; }
.tile-sub { font-size: 13px; color: var(--text-2); line-height: 1.35; }
.tile-sub.warn { display: flex; align-items: flex-start; gap: 5px; color: var(--danger); font-weight: 500; }
.tile-sub.warn svg { flex: none; margin-top: 1px; }
.tile-go { position: absolute; top: 16px; right: 14px; color: var(--text-2); transform: rotate(-90deg); transition: transform .18s var(--ease-out); }
.tile:hover .tile-go { transform: rotate(-90deg) translateY(2px); }
.chart-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.chart-card { display: flex; flex-direction: column; min-width: 0; padding: 18px 18px 10px; }
.chart-card .visual { flex: 1; margin: 0; padding: 0; border: 0; animation: none; }
.chart-card .bar-row { grid-template-columns: minmax(96px, 42%) 1fr; }
.chart-open { align-self: flex-end; gap: 2px; }
.chart-open .tile-go { position: static; }
.chart-open:hover .tile-go { transform: rotate(-90deg); }
.dash-custom { margin-top: 32px; }
.dash-pick { display: grid; gap: 10px; align-content: start; border: 0; margin: 0; padding: 0; min-width: 0; }
.dash-pick legend { font-weight: 600; font-size: 15px; margin-bottom: 4px; padding: 0; }
.dash-pick .check { min-height: 44px; }
@container page (max-width: 599px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { min-height: 112px; padding: 14px 30px 14px 14px; }
  .tile-value { font-size: 24px; }
  .tile-go { right: 8px; top: 14px; }
}
@container page (max-width: 279px) { .tiles { grid-template-columns: minmax(0, 1fr); } }  /* a folded phone's cover: two across would break words */
@media (prefers-reduced-motion: reduce) { .tile, .tile-go { transition: none; } }
@media print { .dash-custom, .chart-open, .tile-go { display: none !important; } .tile { break-inside: avoid; } }

/* The Calendar (2026-10-31): each kind has a colour key and its name (the validated chart slots s1-s3: never colour
   alone); postponed and cancelled slots are greyed and struck through, so nobody goes. */
.k-adhoc { --c: var(--s1); } .k-contract { --c: var(--s2); } .k-dlp { --c: var(--s3); }
.kind-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.kind-tag .key, .month-slot .key, .kind-card .key { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.off-tag { opacity: .6; }
.cal-filters { gap: 10px; align-items: center; flex-wrap: wrap; }
.cal-filters select { flex: 1 1 180px; max-width: 260px; }
.cal-day { margin-top: 24px; }
.cal-day-head { font-size: 16px; margin: 0 0 4px; }
.slot-row { align-items: flex-start; gap: 14px; }
.slot-time { flex: none; width: 52px; padding-top: 2px; font-size: 14px; font-weight: 600; line-height: 1.3; }
.slot-row.off, .row.off { opacity: .5; }
.slot-row.off .row-title, .row.off .row-title, .month-slot.off .month-slot-text { text-decoration: line-through; }
.slot-row.done .row-title a { color: var(--text-2); }
.slot-head.off h1 { text-decoration: line-through; color: var(--text-2); }
.month-nav { align-items: center; gap: 8px; margin: 16px 0 12px; }
.month-nav .prev { transform: rotate(90deg); } .month-nav .next { transform: rotate(-90deg); }
.month { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.month-head, .month-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-head span { padding: 8px; font-size: 12px; font-weight: 600; color: var(--text-2); border-bottom: 1px solid var(--line); }
.month-day { min-height: 108px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.month-week .month-day:last-child { border-right: 0; }
.month-week:last-child .month-day { border-bottom: 0; }
.month-day.out { background: var(--bg-subtle); }
.month-day.out .month-num { color: var(--text-2); opacity: .6; }
.month-num { align-self: flex-start; min-width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; }
.month-num:hover { background: var(--fill); }
.month-day.today .month-num { background: var(--accent); color: var(--on-accent); }
.month-slot { display: flex; align-items: center; gap: 5px; padding: 2px 4px; border-radius: 6px; font-size: 12px; color: var(--text); text-decoration: none; min-width: 0; }
.month-slot:hover { background: var(--fill); }
.month-slot-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.month-slot.off { opacity: .5; }
.month-more { font-size: 12px; padding-left: 4px; }
.cal-legend { margin-top: 12px; }
.kind-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 8px; border: 0; margin: 0 0 8px; padding: 0; }
.kind-pick legend, .scope-pick legend, .people-pick legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 8px; }
.kind-card { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 500; }
.kind-card input { position: absolute; opacity: 0; pointer-events: none; }
.kind-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.kind-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.scope-pick, .people-pick { border: 0; margin: 12px 0 0; padding: 0; min-width: 0; }
.people-pick input[type=search] { margin-bottom: 6px; }
.pick-list { max-height: min(260px, 50dvh); overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; }
.pick-row { min-height: 40px; }
.slot-facts { margin-top: 8px; }
@container page (max-width: 599px) {
  .month-day { min-height: 64px; padding: 4px 2px; }
  .month-slot { padding: 2px; justify-content: center; min-height: 24px; background: var(--fill); }  /* Phase 5: a 24 px target */
  .month-slot .key { width: 12px; height: 12px; }
  .month-slot-text { display: none; }  /* phones: a key per slot; the agenda has the words */
  .month-head span { padding: 6px 2px; text-align: center; }
  .slot-time { width: 44px; }
}
@media print { .cal-filters, .month-nav .btn { display: none !important; } }

/* How you are told (Account): a segmented choice per feature, made of real radios (keyboard and no-JS work). */
.segmented label { position: relative; font-size: 14px; font-weight: 500; padding: 7px 14px; border-radius: 9px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.segmented label input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 1px; }
.channels { display: grid; gap: 4px; padding: 8px 16px 16px; }
.channel-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; border: 0;
  border-bottom: 1px solid var(--line); margin: 0; padding: 12px 0; min-width: 0; }
.channel-row legend { float: left; font-size: 15px; font-weight: 500; padding: 0; }

.change { display: block; }  /* one line per thing a change changed */
@container page (max-width: 599px) {
  .channel-row .segmented { width: 100%; }
  .channel-row .segmented label { flex: 1; text-align: center; padding: 11px 6px; font-size: 13px; }
}
@media (max-width: 599px) { .check { min-height: 44px; } }  /* Phase 5: the whole label is the tap target */

/* Progress claims (2026-10-31): the PM's % per item, a thumb-sized field beside each line */
.stage { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 12px 0 20px; padding: 12px 14px; border: 1px solid var(--accent); border-radius: var(--radius); }
.stage.done { border-color: var(--line); background: var(--ok-soft); }
.stage-label { width: 100%; font-size: 13px; color: var(--text-2); }
.stage-nudge { margin-left: auto; }
.stage-nudge form { margin: 0; }
.waiting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 16px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 15px; }
.waiting form { margin: 0; }
.claim-tools { align-items: end; justify-content: space-between; margin-top: 8px; }
.claim-day label { margin-bottom: 4px; }
.claim-day-row { display: flex; gap: 8px; align-items: center; }
.claim-day-row input { width: 5em; min-height: 34px; padding: 4px 10px; }
.variation-answer { align-items: end; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.claim-section { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 17px; margin: 28px 0 4px; }
.pct-field { display: flex; align-items: center; gap: 6px; flex: none; margin: 0; font-weight: 400; }
.pct-field input { width: 6.5em; text-align: right; }
.breakdown-edit td { vertical-align: top; }
.breakdown-edit textarea { min-width: 280px; white-space: normal; }
.breakdown-edit input { min-width: 4.5em; }
