/* TaskHub — one stylesheet, on IBM Carbon.
   Tokens first; the dark theme only swaps tokens. Colours, type and spacing follow Carbon v11
   (White and Gray 100 themes): IBM Plex Sans, blue 60 for anything interactive, square corners,
   fields that are a grey block with a single line under them, and a 2px focus ring that never hides. */
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/IBMPlexSans-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/fonts/IBMPlexSans-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/fonts/IBMPlexMono-Regular.woff2') format('woff2');
}
:root {
  /* Carbon White theme */
  --bg: #f4f4f4;            /* background */
  --panel: #ffffff;         /* layer-01 */
  --sidebar: #ffffff;
  --col: #f4f4f4;
  --field: #f4f4f4;         /* field-01 */
  --field-hover: #e8e8e8;
  --border: #e0e0e0;        /* border-subtle */
  --border-strong: #8d8d8d; /* border-strong */
  --text: #161616;          /* text-primary */
  --muted: #525252;         /* text-secondary */
  --faint: #6f6f6f;         /* text-helper */
  --hover: #e8e8e8;         /* layer-hover */
  --active: #e0e0e0;        /* layer-selected */
  --accent: #0f62fe;        /* interactive / blue 60 */
  --accent-strong: #0050e6; /* blue 60 hover */
  --accent-press: #002d9c;
  --accent-text: #0f62fe;   /* link-primary */
  --accent-tint: #d0e2ff;   /* blue 20 */
  --danger: #da1e28;        /* red 60 */
  --danger-strong: #ba1b23;
  --danger-tint: #fff1f1;
  --good: #24a148;          /* green 50 */
  --good-tint: #defbe6;
  --warn: #b28600;
  --warn-tint: #fcf4d6;
  --caret: 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='%23525252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  --shadow: 0 1px 2px rgba(0, 0, 0, .08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, .2);
  --radius: 0;              /* Carbon is square */
  --font: 'IBM Plex Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
/* The dark palette, from the operating system unless somebody has chosen light here. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Carbon Gray 100 */
    --bg: #161616;
    --panel: #262626;       /* layer-01 */
    --sidebar: #262626;
    --col: #262626;
    --field: #393939;       /* field-01 */
    --field-hover: #474747;
    --border: #393939;
    --border-strong: #6f6f6f;
    --text: #f4f4f4;
    --muted: #c6c6c6;
    --faint: #8d8d8d;
    --hover: #353535;
    --active: #393939;
    --accent: #4589ff;      /* blue 50 */
    --accent-strong: #0f62fe;
    --accent-press: #002d9c;
    --accent-text: #78a9ff; /* blue 40 */
    --accent-tint: #001d6c;
    --danger: #fa4d56;
    --danger-strong: #da1e28;
    --danger-tint: #3a0a0c;
    --good: #42be65;
    --good-tint: #071908;
    --warn: #f1c21b;
    --warn-tint: #302400;
    --caret: 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='%23c6c6c6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
/* ...and the same palette when somebody has chosen dark outright. */
:root[data-theme="dark"] {
    /* Carbon Gray 100 */
    --bg: #161616;
    --panel: #262626;       /* layer-01 */
    --sidebar: #262626;
    --col: #262626;
    --field: #393939;       /* field-01 */
    --field-hover: #474747;
    --border: #393939;
    --border-strong: #6f6f6f;
    --text: #f4f4f4;
    --muted: #c6c6c6;
    --faint: #8d8d8d;
    --hover: #353535;
    --active: #393939;
    --accent: #4589ff;      /* blue 50 */
    --accent-strong: #0f62fe;
    --accent-press: #002d9c;
    --accent-text: #78a9ff; /* blue 40 */
    --accent-tint: #001d6c;
    --danger: #fa4d56;
    --danger-strong: #da1e28;
    --danger-tint: #3a0a0c;
    --good: #42be65;
    --good-tint: #071908;
    --warn: #f1c21b;
    --warn-tint: #302400;
    --caret: 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='%23c6c6c6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }

* { box-sizing: border-box; }
/* iOS inflates text of its own accord on rotation unless told not to, which is half of why the
   app "needed pinching to fit". */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; height: 100%; }
/* Carbon body-01: 14px on 18, with a touch of tracking. */
body { font: 400 14px/1.43 var(--font); letter-spacing: .16px; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
/* Carbon headings: the big ones are regular weight, the small ones semibold. */
h1 { font-size: 28px; font-weight: 400; line-height: 1.29; letter-spacing: 0; }
h2 { font-size: 16px; font-weight: 600; line-height: 1.375; }
h3 { font-size: 14px; font-weight: 600; line-height: 1.29; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.33; letter-spacing: .32px; }
.center { text-align: center; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.grow { flex: 1; }
.bad-text { color: var(--danger); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
svg { flex: none; }

/* ------------------------------------------------------------ controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 7px; border: 1px solid var(--border-strong);
  background: var(--panel); font-weight: 550; white-space: nowrap; text-decoration: none; color: var(--text);
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-ghost { color: var(--danger); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.block { width: 100%; height: 40px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); flex: none;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.icon-btn.tiny { width: 24px; height: 24px; }
.icon-btn.danger:hover { color: var(--danger); }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-text); font-weight: 550; text-align: left; }
.link-btn:hover { text-decoration: underline; }
.input {
  width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 7px;
  background: var(--panel);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.input.sm { height: 30px; width: auto; font-size: 13px; }
select.input { padding-right: 6px; }
textarea.input { height: auto; padding: 8px 10px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.inline-field { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.inline-field .input { width: auto; height: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 12px; }
.chip {
  border: 1px solid var(--border-strong); background: var(--panel); border-radius: 999px; padding: 3px 10px; font-size: 12.5px;
}
.chip:hover { background: var(--hover); }
.chip-toggle {
  display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 11px; border-radius: 7px;
  border: 1px solid var(--border-strong); background: var(--panel); font-size: 13px; font-weight: 550; color: var(--muted);
}
.chip-toggle:hover { background: var(--hover); }
.chip-toggle.on { background: var(--active); border-color: var(--accent); color: var(--accent-text); }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; background: var(--panel); padding: 0 12px; height: 32px; font-size: 13px; font-weight: 550; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button.on { background: var(--active); color: var(--accent-text); }
.badge { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--muted); white-space: nowrap; }
.count { font-size: 12px; font-weight: 600; color: var(--muted); }
kbd {
  display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 5px; font: 12px var(--mono); text-align: center; background: var(--panel);
}
.spinner {
  width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  display: inline-block; animation: spin .7s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-page { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 60px 20px; color: var(--muted); }

/* avatars */
.avatar {
  display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none;
  box-shadow: 0 0 0 2px var(--panel); letter-spacing: -.02em; line-height: 1;
}
.avatar.more { background: var(--border-strong); color: var(--text); }
.avatar.ghost { background: var(--hover); color: var(--muted); box-shadow: none; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar + .avatar { margin-left: -6px; }

/* ------------------------------------------------------------ shell */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); height: 100vh; height: 100dvh; }
#env-banner {
  height: 26px; display: flex; align-items: center; justify-content: center; padding: 0 12px;
  background: repeating-linear-gradient(135deg, #e16b16 0 14px, #d05f0e 14px 28px); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.has-banner .shell { height: calc(100vh - 26px); height: calc(100dvh - 26px); }
body.has-banner .sidebar { top: 26px; }
body.has-banner .auth-page { min-height: calc(100dvh - 26px); }
.sidebar {
  background: var(--sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column;
  overflow-y: auto; padding: 12px 8px 0;
}
.sidebar-scrim { display: none; }
#drawer-host { display: contents; } /* its children are fixed overlays; it must not take a grid cell */
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar {
  height: 50px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  border-bottom: 1px solid var(--border); background: var(--panel);
}
.topbar-title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.help-btn { font-weight: 700; font-size: 15px; border: 1px solid var(--border-strong); width: 30px; height: 30px; border-radius: 50%; }
.view { flex: 1; overflow: auto; min-height: 0; display: flex; flex-direction: column; }
.view > * { flex: none; }
.only-mobile { display: none; }

.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; font-size: 16px; padding: 4px 8px 14px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, #8f7cf7, #5f4fe0);
  color: #fff; display: grid; place-items: center; font-weight: 800;
}
.brand.big { justify-content: center; font-size: 20px; padding-bottom: 18px; }
.brand.big .brand-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 19px; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; color: var(--text); font-weight: 550;
}
.nav-item svg { color: var(--muted); }
.nav-item:hover { background: var(--hover); text-decoration: none; }
.nav-item.active { background: var(--active); color: var(--accent-text); }
.nav-item.active svg { color: var(--accent-text); }
.side-section {
  display: flex; align-items: center; justify-content: space-between; padding: 18px 6px 6px 10px;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
}
.tree { flex: 1; padding-bottom: 12px; }
.tree-row {
  display: flex; align-items: center; gap: 2px; min-height: 32px; border-radius: 7px;
  padding-left: calc(var(--depth, 0) * 14px);
}
.tree-row:hover { background: var(--hover); }
.tree-row.active { background: var(--active); }
.tree-row.active .tree-name { color: var(--accent-text); font-weight: 650; }
.tree-link {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 5px 4px; color: var(--text); cursor: pointer;
}
.tree-link:hover { text-decoration: none; }
.tree-link svg { color: var(--muted); }
.tree-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-more { opacity: 0; }
.tree-row:hover .tree-more, .tree-row:focus-within .tree-more, .tree-row.active .tree-more { opacity: 1; }
.list-row .tree-link { padding-left: 26px; }
.list-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); flex: none; }
.caret svg { transition: transform .15s; }
.caret.open svg { transform: rotate(90deg); }
.caret-space { width: 24px; flex: none; }
.space-icon {
  width: 22px; height: 22px; border-radius: 6px; color: #fff; display: grid; place-items: center;
  font-size: 12px; font-weight: 750; flex: none;
}
.space-icon.lg { width: 34px; height: 34px; border-radius: 9px; font-size: 17px; }
.tree-add {
  border: 0; background: none; color: var(--muted); padding: 6px 10px 6px calc(10px + var(--depth, 0) * 14px + 26px);
  width: 100%; text-align: left; border-radius: 7px; font-size: 13px;
}
.tree-add:hover { background: var(--hover); color: var(--text); }
.side-foot { position: sticky; bottom: 0; background: var(--sidebar); border-top: 1px solid var(--border); padding: 8px 0; margin: 0 -8px; padding-inline: 8px; }
.me-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 6px 8px; border-radius: 8px; text-align: left;
}
.me-btn:hover { background: var(--hover); }
.me-name { display: flex; flex-direction: column; line-height: 1.2; font-weight: 600; min-width: 0; }
.me-name small { color: var(--muted); font-weight: 500; text-transform: capitalize; }

.crumbs { display: flex; align-items: center; gap: 6px; }
.crumbs a { color: var(--muted); }
.crumbs .sep { color: var(--faint); }

/* timer pill */
.timer-pill {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--danger) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  max-width: 320px;
}
.timer-stop, .timer-go {
  width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--danger); color: #fff; display: grid; place-items: center;
}
.timer-stop svg, .timer-go svg { width: 11px; height: 11px; }
/* Pause is the lighter of the two: it keeps the task, where stop puts it down. Outlined rather
   than filled, so the one that ends things stays the solid one. */
.timer-go { background: transparent; color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent); }
.timer-go:hover { background: color-mix(in srgb, var(--danger) 15%, transparent); }
.timer-clock { font-weight: 650; color: var(--danger); border: 0; background: none; padding: 0; font-size: inherit; }

/* Paused: still the task in hand, but nothing is counting. The red drains out so a glance at the
   bar tells the two apart without reading the icon, and Resume becomes the filled one. */
.timer-pill.paused { background: var(--panel); border-color: var(--border); }
.timer-pill.paused .timer-clock { color: var(--muted); }
.timer-pill.paused .timer-go { background: var(--text); color: var(--panel); border-color: transparent; }
.timer-pill.paused .timer-go:hover { opacity: .85; }
.timer-pill.paused .timer-stop { background: var(--muted); }
.timer-task { border: 0; background: none; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; min-width: 0; }
.timer-task:hover { text-decoration: underline; }

/* ------------------------------------------------------------ pages */
.page-head { padding: 24px 24px 16px; border-bottom: 1px solid var(--border); background: var(--panel); }
.page-head > p { margin-top: 6px; max-width: 760px; }
.page-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.tabs { display: flex; gap: 2px; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 600;
}
.tab:hover { background: var(--hover); text-decoration: none; color: var(--text); }
.tab.active { background: var(--active); color: var(--accent-text); }
.search {
  display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid var(--border-strong);
  border-radius: 7px; background: var(--panel); color: var(--muted); width: 200px;
}
.search input { border: 0; outline: none; background: none; width: 100%; color: var(--text); }
.search:focus-within { border-color: var(--accent); }
.pad { padding: 20px 24px 40px; }

.empty { text-align: center; padding: 56px 20px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty.small { padding: 24px; }
.empty p { max-width: 420px; }
.empty .btn { margin-top: 8px; }
.empty-icon {
  width: 48px; height: 48px; border-radius: 50%; background: var(--active); color: var(--accent-text);
  display: grid; place-items: center; margin-bottom: 4px;
}
.empty-icon svg { width: 22px; height: 22px; }

/* stats + panels */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; color: var(--text);
}
a.stat:hover { border-color: var(--accent); text-decoration: none; }
.stat-v { font-size: 24px; font-weight: 750; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.stat.bad .stat-v { color: var(--danger); }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.progress { height: 6px; background: var(--hover); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--good); border-radius: 99px; transition: width .3s; }
.gs-steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gs-steps li { display: flex; align-items: center; gap: 12px; }
.gs-steps li > div { flex: 1; }
.gs-steps li.done b { color: var(--muted); text-decoration: line-through; }
.gs-check {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; flex: none;
}
.gs-steps li.done .gs-check { background: var(--good); border-color: var(--good); color: #fff; }
.gs-check svg { width: 12px; height: 12px; }

/* ------------------------------------------------------------ list view */
.lv-body.lv-list { padding: 8px 24px 40px; }
.lv-body.lv-board { flex: 1 1 auto; min-height: 0; }
.lv-body.lv-calendar { padding: 16px 24px 40px; }
.table-head, .task-row {
  display: grid; grid-template-columns: var(--cols, minmax(0, 1fr) 110px 96px 72px 72px); align-items: center;
}
.table-head {
  font-size: 11.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 0 4px; position: sticky; top: 0; background: var(--bg); z-index: 2;
}
.table-head .c-name { padding-left: 34px; }
.group { margin-top: 12px; }
.group-head { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.group-title { font-weight: 700; }
.group-title.bad { color: var(--danger); }
.status-pill {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 5px; background: var(--c);
  color: var(--fg, #fff); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap;
}
.rows { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.rows:empty { display: none; }
.task-row { min-height: 42px; border-top: 1px solid var(--border); cursor: pointer; }
.rows > .task-row:first-child { border-top: 0; }
.task-row:hover { background: var(--hover); }
.task-row > div { padding: 0 8px; min-width: 0; }
.c-name { display: flex; align-items: center; gap: 8px; }
.task-row .c-name { padding-left: 6px !important; }
.task-row.is-sub .c-name { padding-left: 38px !important; }
.task-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.is-done .task-title { color: var(--muted); text-decoration: line-through; }
.list-crumb { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 1000; min-width: 0; }
.c-assignee, .c-due, .c-prio { height: 100%; display: flex; align-items: center; border-radius: 6px; }
.task-row .c-assignee:hover, .task-row .c-due:hover, .task-row .c-prio:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.c-time { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }
.ph { color: var(--faint); opacity: 0; display: inline-flex; }
.task-row:hover .ph { opacity: 1; }
.status-dot {
  width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--c); background: transparent; flex: none;
  display: grid; place-items: center; padding: 0; color: var(--fg, #fff);
}
.status-dot:hover { background: color-mix(in srgb, var(--c) 25%, transparent); }
.status-dot.done { background: var(--c); }
.status-dot svg { width: 10px; height: 10px; stroke-width: 3.5; }
.chip-meta {
  display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); white-space: nowrap; flex: none;
}
.chip-meta svg { width: 13px; height: 13px; }
.chip-meta.ok { color: var(--good); }
.due { font-size: 12.5px; white-space: nowrap; font-weight: 550; }
.due.overdue { color: var(--danger); }
.due.due-today { color: var(--warn); }
.flag { display: inline-flex; align-items: center; gap: 5px; }
.add-row { padding: 4px 0; }
.add-btn {
  border: 0; background: none; color: var(--muted); padding: 7px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
}
.add-btn:hover { background: var(--hover); color: var(--text); }
.inline-add input {
  width: 100%; height: 40px; border: 1px solid var(--accent); border-radius: 8px; padding: 0 12px; background: var(--panel); outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.show-closed { margin: 16px 0 0 8px; }

/* ------------------------------------------------------------ board */
.board { display: flex; gap: 12px; overflow-x: auto; height: 100%; padding: 16px 24px; align-items: flex-start; }
.col {
  flex: 0 0 280px; max-height: 100%; background: var(--col); border-radius: 10px; display: flex; flex-direction: column;
  border: 1px solid var(--border);
}
.col-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 10px 8px 12px; border-top: 3px solid var(--c); border-radius: 10px 10px 0 0;
}
.col-name { font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
.col-cards { overflow-y: auto; padding: 2px 8px; min-height: 12px; flex: 0 1 auto; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 10px 11px; margin-bottom: 8px;
  box-shadow: var(--shadow); cursor: grab; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.card:hover { border-color: var(--border-strong); }
.card.is-done .card-title { color: var(--muted); text-decoration: line-through; }
.card-title { font-weight: 550; overflow-wrap: anywhere; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; min-height: 22px; }
.card-meta:has(.grow:only-child) { display: none; }
.col-add-slot { padding: 0 8px 8px; }
.col-add {
  width: 100%; border: 0; background: none; color: var(--muted); text-align: left; padding: 7px 6px; border-radius: 6px;
  display: flex; align-items: center; gap: 6px; font-size: 13px;
}
.col-add:hover { background: var(--hover); color: var(--text); }
.add-card { cursor: default; }
.add-card textarea { width: 100%; border: 0; outline: none; resize: none; background: none; }
.row-end { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.drop-ph { border: 2px dashed var(--accent); border-radius: 8px; margin-bottom: 8px; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; margin: 0; cursor: grabbing;
  box-shadow: var(--shadow-lg); opacity: .95;
}
body.dragging, body.dragging * { cursor: grabbing !important; user-select: none; }

/* ------------------------------------------------------------ calendar */
.cal-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.cal-bar h2 { min-width: 170px; text-align: center; }
.cal-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
}
.cal-dow { padding: 8px; font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--border); }
.cal-day { min-height: 116px; padding: 4px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); min-width: 0; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: color-mix(in srgb, var(--bg) 60%, var(--panel)); }
.cal-day.other .cal-num { color: var(--faint); }
.cal-day.drop-hover { background: var(--active); }
.cal-day-head { display: flex; align-items: center; justify-content: space-between; }
.cal-num { font-size: 12.5px; font-weight: 650; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.cal-day.today .cal-num { background: var(--accent); color: #fff; }
.cal-add { opacity: 0; }
.cal-day:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-task {
  display: flex; align-items: center; gap: 4px; width: 100%; margin-top: 4px; padding: 4px 8px; border: 0; border-left: 3px solid var(--c);
  border-radius: 4px; background: color-mix(in srgb, var(--c) 13%, var(--panel)); font-size: 12px; text-align: left; min-width: 0;
}
.cal-task:hover { background: color-mix(in srgb, var(--c) 24%, var(--panel)); }
.cal-task-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-task.is-done .cal-task-t { text-decoration: line-through; color: var(--muted); }
.cal-more { border: 0; background: none; color: var(--muted); font-size: 12px; font-weight: 600; padding: 3px 6px; }
.cal-more:hover { color: var(--text); }

/* ------------------------------------------------------------ space overview */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.list-card {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text);
}
.list-card:hover { border-color: var(--accent); text-decoration: none; box-shadow: var(--shadow); }
.list-card-h { display: flex; align-items: center; gap: 8px; }
.list-card-f { display: flex; gap: 12px; }
.status-bar { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--hover); gap: 2px; }
.status-bar i { display: block; }
.status-bar .empty-bar { flex: 1; }
.folder-sec { margin-top: 24px; }
.folder-sec h3 { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--muted); }

/* ------------------------------------------------------------ timesheet */
.ts-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.ts { width: 100%; border-collapse: collapse; min-width: 720px; }
.ts th, .ts td { padding: 12px; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
.ts th { font-size: 11.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ts th small { display: block; font-size: 13px; color: var(--text); text-transform: none; }
.ts th.today small { color: var(--accent-text); }
.ts .ts-task { text-align: left; white-space: normal; min-width: 220px; }
.ts tfoot td { font-weight: 700; border-bottom: 0; background: var(--bg); }

/* ------------------------------------------------------------ team */
.people { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
/* The original row. Its flex-wrap outlived it: on the column layout that replaced it, wrap made
   the cells form a second column, so the name cell came out 32px wide beside 286px siblings. */
.person { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.person:first-child { border-top: 0; }
.person.inactive { opacity: .6; }
.person-b { flex: 1; display: flex; flex-direction: column; min-width: 160px; }
.sec-title { margin: 24px 0 10px; }
.invite-link { display: flex; gap: 8px; margin: 6px 0; }

/* ------------------------------------------------------------ drawer (task detail) */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 17, 22, .28); z-index: 40; animation: fade .15s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(760px, 100vw); background: var(--panel); z-index: 41;
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .18s ease-out;
}
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-loading { padding: 40px; color: var(--muted); }
.drawer-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--border); }
.drawer-crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; overflow: hidden; white-space: nowrap; }
.drawer-crumbs a { color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.drawer-crumbs .sep { color: var(--faint); }
.save-state { font-size: 12.5px; color: var(--muted); }
.save-state.saved { color: var(--good); }
.save-state.error { color: var(--danger); font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 28px 24px; }
.title-row { display: flex; gap: 8px; margin-bottom: 8px; }
.complete-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 7px;
  border: 1px solid var(--border-strong); background: var(--panel); font-weight: 600; font-size: 13px; color: var(--muted);
}
.complete-btn:hover { border-color: var(--good); color: var(--good); }
.complete-btn.on { background: var(--good); border-color: var(--good); color: #fff; }
.title-input {
  width: 100%; border: 0; outline: none; resize: none; background: none; font-size: 24px; font-weight: 700; line-height: 1.3;
  padding: 4px 0; border-radius: 6px; overflow: hidden;
}
.title-input:hover { background: var(--hover); }
.title-input:focus { background: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.props { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 24px; margin: 14px 0 8px; }
.prop { display: flex; align-items: center; gap: 10px; min-height: 38px; }
.prop-l { display: flex; align-items: center; gap: 8px; width: 118px; flex: none; color: var(--muted); font-size: 13px; }
.prop-v {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border: 0; background: none; padding: 4px 6px; border-radius: 6px;
  text-align: left; min-width: 0; min-height: 32px;
}
button.prop-v:hover, .date-btn:hover { background: var(--hover); }
.assignee { display: inline-flex; align-items: center; gap: 6px; }
.prop:has(.pending-assignees) { flex-wrap: wrap; }
.pending-assignees { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-left: 128px; width: 100%; margin-top: -6px; }
.assignee.pending { border: 1px dashed var(--border-strong); border-radius: 99px; padding: 2px 8px; font-size: 12.5px; color: var(--muted); }
@media (max-width: 640px) { .pending-assignees { padding-left: 0; } }
.status-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 11px; border: 0; border-radius: 6px;
  background: var(--c); color: var(--fg, #fff); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .03em;
}
.status-btn svg { width: 14px; height: 14px; }
.date-btn { border: 0; background: none; padding: 4px 6px; border-radius: 6px; font-size: 13px; }
.timer-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--border-strong);
  background: var(--panel); font-weight: 600; font-size: 13px;
}
.timer-btn svg { width: 11px; height: 11px; color: var(--good); }
.timer-btn:hover { border-color: var(--good); }
.timer-btn.running { background: var(--danger); border-color: var(--danger); color: #fff; }
.timer-btn.running svg { color: #fff; }
/* Paused: the task still has a timer against it, but nothing is counting. Outlined, not filled,
   so it never reads as running at a glance. */
.timer-btn.paused { border-color: var(--border); background: var(--panel); color: var(--muted); }
.timer-btn.paused svg { color: var(--muted); }
.dsec { margin-top: 22px; }
.dsec h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.desc {
  width: 100%; min-height: 70px; border: 1px solid transparent; border-radius: 8px; padding: 8px 12px; resize: none; background: var(--bg);
  overflow: hidden;
}
.desc:hover { border-color: var(--border); }
.desc:focus { outline: none; border-color: var(--accent); background: var(--panel); }
.add-input { margin-top: 6px; height: 34px; border-style: dashed; background: none; }
.add-input:focus { border-style: solid; }
.sublist { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.sublist:empty { display: none; }
.sub-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-top: 1px solid var(--border); cursor: pointer; }
.sub-row:first-child { border-top: 0; }
.sub-row:hover { background: var(--hover); }
.sub-row .task-title { flex: 1; }
.checklist { margin-top: 6px; }
.check-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.check-row input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--good); flex: none; }
.check-text { flex: 1; border: 0; background: none; padding: 5px 6px; border-radius: 6px; outline: none; }
.check-text:hover { background: var(--hover); }
.check-text:focus { background: var(--bg); }
.check-row.is-done .check-text { color: var(--muted); text-decoration: line-through; }
.check-row .icon-btn { opacity: 0; }
.check-row:hover .icon-btn, .check-row:focus-within .icon-btn { opacity: 1; }
.time-list { border: 1px solid var(--border); border-radius: 8px; }
.time-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-top: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.time-row:first-child { border-top: 0; }
.feed { display: flex; flex-direction: column; gap: 10px; }
.feed-act { font-size: 12.5px; color: var(--muted); padding-left: 38px; }
.feed-act b { color: var(--text); font-weight: 600; }
.comment { display: flex; gap: 10px; }
.comment-b { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; min-width: 0; }
.comment-h { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.comment-h .icon-btn { margin-left: auto; opacity: 0; }
.comment:hover .comment-h .icon-btn { opacity: 1; }
.comment-t { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 2px; }
.comment-box { display: flex; gap: 8px; align-items: flex-end; padding: 12px 24px 16px; border-top: 1px solid var(--border); }
.comment-box textarea {
  flex: 1; resize: none; border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 12px; max-height: 160px; background: var(--panel);
}
.comment-box textarea:focus { outline: none; border-color: var(--accent); }

/* ------------------------------------------------------------ overlays */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(15, 17, 22, .4); display: grid; place-items: center; padding: 16px;
  animation: fade .12s;
  /*
   * The row is the screen and never more. Left to size itself it grows to whatever the dialog
   * holds, and then the dialog's own `height: 100%` measures that grown row instead of the screen:
   * a long form stops scrolling inside itself and pushes the layout out past the viewport, which
   * on a phone reads as a page that will not scroll and can be pinched out to find the rest of.
   */
  grid-template-rows: minmax(0, 1fr);
}
.modal {
  width: min(460px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; background: var(--panel);
  border-radius: 12px; box-shadow: var(--shadow-lg); animation: pop .15s ease-out;
}
.modal.wide { width: min(640px, 100%); }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 20px; flex: none; }
/* min-height: 0 is what lets it scroll rather than grow: without it a flex child refuses to be
   smaller than its content and `overflow-y: auto` never has anything to do. */
.modal-body { padding: 8px 20px; overflow-y: auto; min-height: 0; overscroll-behavior: contain; }
.modal-body > p { margin-bottom: 12px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; flex: none; }
/* What a dialog turned down, said where the form is rather than at the foot of the screen. */
.modal-err { flex: none; margin: 0 20px; padding: 10px 12px; border-left: 3px solid var(--danger);
  background: var(--danger-tint); color: var(--text); font-size: .875rem; line-height: 1.4; }
.modal-err[hidden] { display: none; }
/* Who the task lands on when nobody is picked — said before the button, not after. */
.nt-assign-note { display: block; margin-top: 6px; line-height: 1.35; }
.nt-assign-note:empty { display: none; }
.nt-assign-note.warn { color: var(--warn); }
/* Each candidate parent says where it lives, so a name from another list is not a mystery. */
.nt-parent-item .nt-parent-t { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.nt-parent-item .nt-parent-w { flex: none; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-parent-note { display: block; margin-top: 6px; color: var(--accent-text); line-height: 1.35; }
.nt-parent-note:empty { display: none; }
/* Due date and its optional time, side by side; the time stacks under on a phone. */
.nt-due-row { display: flex; gap: 8px; }
.nt-due-row #nt-due { flex: 1 1 60%; min-width: 0; }
.nt-due-row #nt-duet { flex: 1 1 40%; min-width: 0; }
.nt-due-row input:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 480px) { .nt-due-row { flex-direction: column; } }
.menu {
  position: fixed; z-index: 80; min-width: 200px; max-width: min(520px, calc(100vw - 24px)); max-height: 60vh; overflow-y: auto; overscroll-behavior: contain; background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 5px; animation: pop .1s ease-out;
}
.menu-header { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 8px 4px; }
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%; border: 0; background: none; padding: 7px 8px; border-radius: 6px; text-align: left;
}
.menu-item:hover { background: var(--hover); }
.menu-item.danger { color: var(--danger); }
.mi-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A list of task titles: wide, and wrapping rather than cut off. */
.menu-wrap { width: min(560px, calc(100vw - 24px)); }
.menu-wrap .menu-item { align-items: flex-start; height: auto; min-height: 34px; padding-top: 7px; padding-bottom: 7px; }
.menu-wrap .mi-label { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.35; }
.mi-icon { display: inline-flex; color: var(--muted); }
.menu-item.danger .mi-icon { color: var(--danger); }
.mi-check { color: var(--accent-text); display: inline-flex; visibility: hidden; }
.menu-item.checked .mi-check { visibility: visible; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }
.menu-pad { padding: 4px; display: flex; flex-direction: column; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.date-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; padding: 0; flex: none; }
.swatch.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }
.status-edit-list { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.status-edit { display: flex; align-items: center; gap: 6px; }
.status-edit .input { height: 32px; }
.status-edit .type-sel { width: 118px; flex: none; }
.status-add { display: flex; gap: 8px; margin-bottom: 8px; }
.status-add .input { height: 34px; }
.assign-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.assign-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 99px; border: 1px solid var(--border-strong);
  background: var(--panel); font-size: 13px;
}
.assign-chip.on { background: var(--active); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.pw-details { margin: 4px 0 12px; }
.pw-details summary { cursor: pointer; color: var(--accent-text); font-weight: 600; margin-bottom: 10px; }

/*
 * Centred along the bottom. The corner belongs to arriving notifications, which stay long enough
 * to be read and must not sit on the sidebar's profile menu; a toast answers something you just
 * did and is gone in three seconds, so the two should not be fighting for one corner.
 */
#toasts {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90;
  display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #1f2328; color: #fff; padding: 9px 8px 9px 16px;
  border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; max-width: min(520px, calc(100vw - 32px)); animation: pop .15s;
  transition: opacity .3s, transform .3s;
}
.toast.error { background: #b4232a; }
.toast.good { background: #136c3f; }
.toast.out { opacity: 0; transform: translateY(8px); }
.toast-action { border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-weight: 700; padding: 4px 10px; border-radius: 6px; }
.toast-action:hover { background: rgba(255, 255, 255, .28); }
.toast-x { border: 0; background: none; color: rgba(255, 255, 255, .7); display: grid; place-items: center; padding: 2px; border-radius: 4px; }
.toast-x:hover { color: #fff; }
.toast-x svg { width: 14px; height: 14px; }
.offline-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 95; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 16px; background: #fff4d6; color: #6b4b00; border-bottom: 1px solid #f0d58a; font-weight: 550; font-size: 13px;
}

/* help */
.help section + section { margin-top: 18px; }
.help h3 { margin-bottom: 8px; }
.help-dl { display: grid; grid-template-columns: 80px 1fr; gap: 6px 12px; margin: 0; }
.help-dl dt { font-weight: 700; }
.help-dl dd { margin: 0; color: var(--muted); }
.help-ul { margin: 0; padding-left: 18px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.kbd-table { border-collapse: collapse; }
.kbd-table td { padding: 4px 16px 4px 0; }
.kbd-table td:first-child { white-space: nowrap; color: var(--muted); }

/* ------------------------------------------------------------ auth */
.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); }
.auth-card {
  width: min(400px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 28px 28px 24px;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.auth-card h1 { text-align: center; }
.auth-card > p.muted { text-align: center; margin: 6px 0 20px; }
.auth-card .btn.block { margin-top: 4px; }
.auth-card > p.small { margin-top: 16px; }
.auth-error { color: var(--danger); font-weight: 550; min-height: 20px; margin: -4px 0 8px; font-size: 13px; }
.auth-error:empty { display: none; }

/* ------------------------------------------------------------ responsive */
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  /*
   * On a phone the page itself scrolls, not a box inside it.
   *
   * A nested scroller inside a 100dvh grid is where the mobile browsers disagree: iOS Safari
   * handles it, Android Chrome — above all once the app is installed to the home screen — can end
   * up with nothing that responds to a finger at all. Letting the document scroll is the behaviour
   * every browser implements identically, and it gives back the native address-bar hiding too.
   */
  .shell { height: auto; min-height: 100vh; min-height: 100dvh; }
  body.has-banner .shell { height: auto; min-height: calc(100dvh - 26px); }
  .main { min-height: 0; }
  .view { overflow: visible; }
  .topbar { position: sticky; top: 0; z-index: 30; }
  body.has-banner .topbar { top: 26px; }
  /* Messages is a two-pane layout that has to stay inside the screen, so it keeps its own box. */
  .view:has(> .chat) { height: calc(100dvh - 50px); overflow: hidden; }
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: min(290px, 86vw); z-index: 70; transform: translateX(-100%);
    transition: transform .2s ease, visibility .2s; visibility: hidden;
  }
  .sidebar.open { transform: none; visibility: visible; box-shadow: var(--shadow-lg); }
  .sidebar.open + .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 69; background: rgba(15, 17, 22, .35); }
  .only-mobile { display: inline-grid; }
  .tree-more { opacity: 1; }
  .topbar { padding: 0 8px; }
  .page-head { padding: 16px 16px 12px; }
  .pad { padding: 16px 16px 40px; }
  .lv-body.lv-list, .lv-body.lv-calendar { padding-left: 16px; padding-right: 16px; }
  .board { padding: 12px 16px; }
  .search { width: auto; flex: 1 1 140px; }
  .props { grid-template-columns: 1fr; }
  .drawer-body { padding: 12px 16px 20px; }
  .comment-box { padding: 10px 12px 12px; }
  .timer-pill { max-width: 46vw; }
}
@media (max-width: 640px) {
  h1 { font-size: 19px; }
  .table-head { display: none; }
  .task-row { grid-template-columns: minmax(0, 1fr) auto auto; padding: 4px 0; }
  .c-prio, .c-time { display: none !important; }
  .task-row .c-assignee, .task-row .c-due { padding: 0 4px; }
  .task-row .ph { display: none; }
  .list-crumb { display: none; }
  .col { flex-basis: 84vw; }
  .cal-day { min-height: 74px; padding: 4px; }
  .cal-task { padding: 2px 4px; font-size: 11px; border-left-width: 2px; }
  .cal-task .avatar-stack { display: none; }
  .cal-dow { padding: 6px 2px; text-align: center; font-size: 10.5px; }
  .cal-add { display: none; }
  .timer-task { display: none; }
  .modal-backdrop { place-items: end center; padding: 0; }
  .modal { width: 100%; border-radius: 14px 14px 0 0; max-height: 92dvh; }
  .modal.wide { width: 100%; }
  .prop-l { width: 104px; }
  .title-input { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------ v0.2: roles, 2FA, workspace, tags */
[hidden] { display: none !important; }
.brand-logo { width: 28px; height: 28px; border-radius: 8px; object-fit: contain; background: var(--panel); flex: none; }
.brand.big .brand-logo { width: 40px; height: 40px; border-radius: 10px; }
.brand-mark { background: var(--brand, #7b68ee); }
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-empty { color: var(--muted); font-size: 12.5px; padding: 6px 10px; }
.badge.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.badge.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.row-start { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* tags */
.tag-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; min-width: 0; }
.tag-chip {
  display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600;
  background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--text)); white-space: nowrap;
}
.tag-more { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.task-row .tag-chips { flex-shrink: 1; overflow: hidden; }
.tag-menu .tag-options { max-height: 260px; overflow-y: auto; }
.tag-admin { display: flex; flex-direction: column; }
.tag-admin-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.tag-admin-row:first-child { border-top: 0; }

/* space pickers */
.check-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px; }
.check-line { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.check-line:hover { background: var(--hover); }
.check-line input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.check-line .muted { margin-left: auto; }

/* 2FA screens */
.auth-card.wide { width: min(480px, 100%); }
.fullscreen-host { position: fixed; inset: 0; z-index: 70; background: var(--bg); overflow-y: auto; }
.setup-steps { margin: 0 0 14px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.setup-steps li::marker { font-weight: 700; color: var(--accent-text); }
.qr-box { display: flex; justify-content: center; margin: 10px 0 6px; }
.qr-box svg { border-radius: 8px; border: 1px solid var(--border); }
.key-details summary { cursor: pointer; color: var(--accent-text); font-weight: 600; font-size: 13px; }
.setup-key { display: inline-block; margin: 6px 0; padding: 6px 10px; background: var(--hover); border-radius: 6px; font: 600 13px var(--mono); letter-spacing: .04em; word-break: break-all; }
.recovery-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; padding: 16px; margin: 4px 0 10px; background: var(--hover); border-radius: 10px; font-size: 15px; text-align: center; }
.twofa-box p { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }

/* settings */
.settings .panel { max-width: 760px; }
.settings-grid { display: grid; gap: 4px 20px; margin-top: 10px; }
.logo-row { display: flex; align-items: flex-start; gap: 14px; }
.logo-preview { width: 64px; height: 64px; border-radius: 12px; border: 1px solid var(--border); display: grid; place-items: center; overflow: hidden; background: var(--panel); flex: none; }
.logo-preview img { width: 100%; height: 100%; object-fit: contain; }
.brand-mark.big { width: 48px; height: 48px; font-size: 22px; border-radius: 12px; }
.logo-row label.btn { cursor: pointer; }

/* ------------------------------------------------------------ v0.3: attachments, mentions */
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-bottom: 8px; }
.att-grid.compact { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); margin: 8px 0 2px; }
.att-card { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); min-width: 0; }
.att-thumb { width: 44px; height: 44px; flex: none; border-radius: 6px; overflow: hidden; border: 0; padding: 0; background: var(--hover); display: grid; place-items: center; color: var(--muted); text-decoration: none; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-thumb.file svg { width: 22px; height: 22px; }
.att-card.compact .att-thumb { width: 34px; height: 34px; }
.att-ext { font: 700 10.5px var(--mono); color: var(--accent-text); }
.att-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.att-name { color: var(--text); font-weight: 550; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-meta .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-actions { display: flex; opacity: .75; }
.att-card:hover .att-actions, .att-card:focus-within .att-actions { opacity: 1; }
.att-drop {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px; border: 1.5px dashed var(--border-strong);
  border-radius: 8px; color: var(--muted); cursor: pointer; font-size: 13px;
}
.att-drop:hover { border-color: var(--accent); color: var(--text); }
.att-drop u { color: var(--accent-text); }
.drawer.drop-target { outline: 3px dashed var(--accent); outline-offset: -8px; }
.upload-row { display: flex; align-items: center; gap: 10px; padding: 4px 2px; font-size: 13px; }
.upload-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 50%; }
.upload-bar { flex: 1; height: 6px; background: var(--hover); border-radius: 99px; overflow: hidden; min-width: 60px; }
.upload-bar.small { width: 60px; flex: none; }
.upload-bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.upload-err { color: var(--danger); font-weight: 600; font-size: 12.5px; }

.comment-box { flex-direction: column; align-items: stretch; position: relative; }
.cb-row { display: flex; gap: 8px; align-items: flex-end; }
.cb-files { display: flex; flex-wrap: wrap; gap: 6px; }
.cb-files:empty { display: none; }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 280px; padding: 3px 4px 3px 9px; border-radius: 99px;
  border: 1px solid var(--border-strong); background: var(--panel); font-size: 12.5px;
}
.file-chip svg { width: 13px; height: 13px; color: var(--muted); }
.file-chip.failed { border-color: var(--danger); }
.file-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mention { color: var(--accent-text); font-weight: 650; background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 4px; padding: 0 3px; }
.mention.me { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--text); }
.mention-pop {
  position: absolute; left: 56px; bottom: calc(100% - 8px); width: min(320px, calc(100% - 70px)); background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; z-index: 5;
}
.mention-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 6px 8px; border-radius: 6px; text-align: left; }
.mention-item .muted { margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%; }
.mention-item.on, .mention-item:hover { background: var(--active); }
.lightbox-media { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto; border-radius: 8px; background: #000; }
@media (max-width: 640px) { .att-grid { grid-template-columns: 1fr; } .mention-pop { left: 8px; width: calc(100% - 16px); } }

/* ------------------------------------------------------------ v0.3.1: notifications, numbers, reminders */
#bell { display: flex; }
.bell-btn { position: relative; }
.bell-badge {
  position: absolute; top: 1px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px;
  background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; line-height: 1;
  box-shadow: 0 0 0 2px var(--panel);
}
.bell-btn.ring svg { animation: ring .6s ease-in-out 2; transform-origin: 50% 10%; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(14deg); } 75% { transform: rotate(-14deg); } }
.notif-panel { display: flex; flex-direction: column; max-height: min(70vh, 560px); margin: -5px; }
.notif-head, .notif-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; }
.notif-head { border-bottom: 1px solid var(--border); }
.notif-foot { border-top: 1px solid var(--border); }
.notif-list { overflow-y: auto; }
.notif-item { display: flex; gap: 10px; width: 100%; padding: 10px 14px; border: 0; background: none; text-align: left; align-items: flex-start; border-bottom: 1px solid var(--border); }
.notif-item:hover { background: var(--hover); }
.notif-item.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.notif-icon { width: 28px; height: 28px; border-radius: 50%; background: var(--hover); display: grid; place-items: center; color: var(--muted); flex: none; }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-text { font-size: 13px; overflow-wrap: anywhere; }
.notif-task { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-task .mono { color: var(--accent-text); font-weight: 600; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 6px; }
.notif-empty { text-align: center; padding: 30px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.notif-empty svg { width: 28px; height: 28px; margin-bottom: 4px; }
.task-num { border: 1px solid var(--border-strong); background: var(--panel); border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.task-num:hover { color: var(--accent-text); border-color: var(--accent); }
.icon-btn.on { color: var(--accent-text); background: var(--active); }
.remind-btn { position: relative; }
.mini-badge { position: absolute; top: 2px; right: 2px; min-width: 14px; height: 14px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 9.5px; font-weight: 700; display: grid; place-items: center; }
.dm-time { display: flex; flex-direction: column; gap: 3px; }
.remind-menu .menu-item svg { color: var(--muted); }
.rem-row { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px; font-size: 13px; border-radius: 6px; background: var(--hover); }
.toggle-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; }
.toggle-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-top: 1px solid var(--border); cursor: pointer; }
.toggle-row:first-child { border-top: 0; }
.toggle-row > span { flex: 1; display: flex; flex-direction: column; }
.switch { appearance: none; width: 36px; height: 20px; border-radius: 99px; background: var(--border-strong); position: relative; cursor: pointer; flex: none; transition: background .15s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: var(--shadow); }
.switch:checked { background: var(--good); }
.switch:checked::after { transform: translateX(16px); }
.push-box p { margin-bottom: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ------------------------------------------------------------ v0.3.4: formatted text, reactions, replies */
.nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.rich { white-space: normal; }
.rich p { margin: 0; }
.rich p + p, .rich p + ul, .rich p + ol, .rich ul + p, .rich ol + p, .rich pre, .rich blockquote { margin-top: 6px; }
.rich ul, .rich ol { margin: 2px 0 0; padding-left: 20px; }
.rich code { font-family: var(--mono); font-size: 12.5px; background: var(--hover); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.rich pre { background: var(--hover); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; overflow-x: auto; margin: 6px 0 0; }
.rich pre code { border: 0; padding: 0; background: none; white-space: pre; }
.rich blockquote { margin: 6px 0 0; padding: 2px 10px; border-left: 3px solid var(--border-strong); color: var(--muted); }
.rich a { overflow-wrap: anywhere; }
.fmt-bar { display: flex; gap: 2px; flex-wrap: wrap; }
.fmt-btn { border: 0; background: none; min-width: 28px; height: 26px; padding: 0 6px; border-radius: 5px; color: var(--muted); font-size: 13px; }
.fmt-btn:hover { background: var(--hover); color: var(--text); }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.react-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 7px; border-radius: 99px; border: 1px solid var(--border); background: var(--panel); font-size: 13px; }
.react-chip span { font-size: 12px; font-weight: 600; color: var(--muted); }
.react-chip:hover { border-color: var(--border-strong); }
.react-chip.mine { border-color: var(--accent); background: var(--active); }
.react-chip.mine span { color: var(--accent-text); }
.react-chip.ghost { opacity: 0; border-style: dashed; color: var(--muted); }
.react-chip.ghost svg { width: 12px; height: 12px; }
.comment:hover .react-chip.ghost, .msg:hover .react-chip.ghost, .react-chip.ghost:focus-visible { opacity: 1; }
@media (hover: none) { .react-chip.ghost { opacity: .7; } }
.emoji-pick { display: flex; gap: 2px; }
.emoji-btn { border: 0; background: none; font-size: 20px; width: 36px; height: 36px; border-radius: 8px; }
.emoji-btn:hover { background: var(--hover); }
.comment-foot { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.comment-foot .link-btn { font-size: 12.5px; color: var(--muted); }
.comment-foot .link-btn:hover { color: var(--accent-text); }
.replies { margin: 6px 0 0 38px; display: flex; flex-direction: column; gap: 8px; padding-left: 10px; border-left: 2px solid var(--border); }
.comment.is-reply .comment-b { padding: 6px 10px; }
.reply-banner { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 4px 8px; background: var(--hover); border-radius: 6px; }
.reply-banner svg { width: 13px; height: 13px; }
.reply-banner span { flex: 1; }
.cb-reply:empty { display: none; }

/* ------------------------------------------------------------ v0.3.4: messages */
.view:has(> .chat) { overflow: hidden; }
.view > .chat { flex: 1; }
.chat { display: grid; grid-template-columns: 290px minmax(0, 1fr); min-height: 0; }
.chat-side { border-right: 1px solid var(--border); background: var(--panel); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.chat-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 14px 10px; }
.chat-side-head h1 { font-size: 18px; }
.chat-channels { overflow-y: auto; padding: 0 8px 16px; flex: 1; }
.chat-sec { font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; color: var(--muted); padding: 12px 8px 4px; }
.chat-none { padding: 2px 8px; }
.chat-ch { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; color: var(--text); }
.chat-ch:hover { background: var(--hover); text-decoration: none; }
.chat-ch.active { background: var(--active); }
.chat-ch .space-icon { border-radius: 6px; font-size: 13px; }
.chat-ch-b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-ch-name, .chat-ch-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-ch.unread .chat-ch-name { font-weight: 700; }
.chat-ch.unread .chat-ch-last { color: var(--text); }
.ch-badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; }
.ch-badge.at { background: var(--danger); }
.chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; background: var(--bg); }
.chat-empty { margin: auto; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--border); background: var(--panel); }
.chat-head .space-icon { border-radius: 7px; }
.chat-head-b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-scroll { flex: 1; overflow-y: auto; min-height: 0; padding: 12px 0 8px; outline: none; }
.chat-msgs { display: flex; flex-direction: column; }
.chat-start { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 20px 20px 12px; }
.chat-start .space-icon { border-radius: 10px; font-size: 18px; }
.chat-more { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; color: var(--muted); font-size: 12.5px; }
.chat-first { padding: 8px 20px; }
.chat-day, .chat-new { display: flex; align-items: center; gap: 10px; padding: 10px 20px 4px; font-size: 12px; font-weight: 650; color: var(--muted); }
.chat-day::before, .chat-day::after, .chat-new::before, .chat-new::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.chat-new { color: var(--danger); }
.chat-new::before, .chat-new::after { background: color-mix(in srgb, var(--danger) 45%, transparent); }
.msg { display: flex; gap: 10px; padding: 6px 20px 2px; position: relative; }
.msg.grouped { padding-top: 1px; }
.msg:hover { background: var(--hover); }
.msg.mentions-me { background: color-mix(in srgb, var(--warn) 9%, transparent); box-shadow: inset 3px 0 0 var(--warn); }
.msg.flash { animation: flash 1.5s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 25%, transparent); } }
.msg-av { width: 32px; flex: none; display: flex; justify-content: center; }
.msg-time-h { font-size: 10.5px; opacity: 0; padding-top: 3px; }
.msg:hover .msg-time-h { opacity: 1; }
.msg-b { flex: 1; min-width: 0; }
.msg-h { display: flex; align-items: baseline; gap: 8px; }
.msg-t { overflow-wrap: anywhere; }
.msg-t .edited { font-size: 11.5px; }
.msg .reactions { margin: 4px 0 2px; }
.msg-quote { display: block; max-width: 100%; text-align: left; border: 0; border-left: 3px solid var(--border-strong); background: none; padding: 0 8px; margin: 2px 0 4px; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-quote:hover { border-left-color: var(--accent); color: var(--text); }
.msg-actions { position: absolute; right: 16px; top: -12px; display: none; gap: 2px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 2px; box-shadow: var(--shadow); }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { display: flex; }
@media (hover: none) { .msg-actions { position: static; display: flex; box-shadow: none; border: 0; background: none; align-self: flex-start; } }
.msg-actions .icon-btn { font-size: 14px; }
.new-pill { position: absolute; left: 50%; transform: translateX(-50%); bottom: 118px; border: 0; background: var(--accent); color: #fff; font-weight: 600; font-size: 12.5px; padding: 6px 12px; border-radius: 99px; box-shadow: var(--shadow-lg); display: inline-flex; align-items: center; gap: 4px; z-index: 3; }
.chat-reply { display: flex; align-items: center; gap: 8px; padding: 6px 18px; font-size: 12.5px; border-top: 1px solid var(--border); background: var(--panel); }
.chat-reply svg { width: 13px; height: 13px; color: var(--muted); }
.chat-reply > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer { position: relative; padding: 8px 18px 14px; border-top: 1px solid var(--border); background: var(--panel); display: flex; flex-direction: column; gap: 4px; }
.composer-row { display: flex; gap: 8px; align-items: flex-end; min-width: 0; }
/*
 * min-width: 0 is the whole fix for a composer that pushed Send off the edge of a phone. A flex
 * item will not shrink below the natural width of its own content, and this box's placeholder is a
 * sentence — so on a narrow screen the textarea refused to give way and the button went with it.
 */
.composer textarea { flex: 1 1 0; min-width: 0; resize: none; border: 1px solid var(--border-strong); border-radius: 8px; padding: 8px 10px; background: var(--panel); min-height: 38px; max-height: 220px; line-height: 1.4; }
.composer textarea:focus { outline: none; border-color: var(--accent); }
.composer .mention-pop { left: 18px; }
.dm-people { max-height: 300px; overflow-y: auto; margin-top: 6px; }
.dm-people .menu-item[hidden] { display: none; }
@media (max-width: 800px) {
  .chat { grid-template-columns: minmax(0, 1fr); }
  .chat.has-open .chat-side { display: none; }
  .chat:not(.has-open) .chat-main { display: none; }
  .composer, .chat-head { padding-left: 12px; padding-right: 12px; }
  .msg { padding-left: 12px; padding-right: 12px; }
}

/* ------------------------------------------------------------ v0.3.4: my day */
.daily { max-width: 920px; }
.dr-intro { padding: 12px 16px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 8%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border)); margin-bottom: 16px; display: flex; flex-direction: column; gap: 4px; }
.dr-intro.warn { background: color-mix(in srgb, var(--warn) 10%, var(--panel)); border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); display: block; }
.dr-intro.good { background: color-mix(in srgb, var(--good) 9%, var(--panel)); border-color: color-mix(in srgb, var(--good) 30%, var(--border)); display: block; }
.dr-intro svg { vertical-align: -3px; }
.dr-sec { margin-bottom: 22px; }
.dr-sec > h3 { margin-bottom: 10px; }
.dr-sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.dr-sec-head h3 { flex: 1; }
.dr-sec h3 .count { font-weight: 600; color: var(--muted); margin-left: 4px; }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.dr-empty { padding: 16px; border: 1px dashed var(--border-strong); border-radius: 10px; text-align: center; }
.dr-item { background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--border-strong); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: flex; flex-direction: column; gap: 8px; }
.dr-item.out-done { border-left-color: var(--good); }
.dr-item.out-partial { border-left-color: var(--warn); }
.dr-item.out-not_done { border-left-color: var(--danger); }
.dr-item-top { display: flex; align-items: flex-start; gap: 8px; }
.dr-label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dr-task { font-weight: 600; color: var(--text); }
.dr-text { flex: 1; }
.dr-item-controls { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.seg .seg-btn { height: 28px; font-size: 12.5px; }
.seg .seg-btn.good.on { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.seg .seg-btn.warn.on { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.seg .seg-btn.bad.on { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.seg .seg-btn:disabled { cursor: default; }
.dr-hours { display: inline-flex; align-items: center; gap: 6px; }
.dr-hours input { width: 76px; }
.input.invalid { border-color: var(--danger); }
.dr-note { width: 100%; }
.dr-note-ro { font-size: 13px; color: var(--muted); }
.dr-wrap { display: grid; gap: 12px; }
.dr-ro { padding: 8px 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; white-space: pre-wrap; }
.dr-ro.blocker { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.stars { display: flex; align-items: center; gap: 2px; }
.star { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--border-strong); padding: 0 2px; }
.star.on { color: #f5b301; }
.star:not(:disabled):hover { transform: scale(1.12); }
.star:disabled { cursor: default; }
.stars .muted { margin-left: 8px; }
.dr-foot { position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; background: var(--bg); border-top: 1px solid var(--border); }
.muted-on-primary { opacity: .8; font-weight: 500; }
.badge.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.badge svg { width: 12px; height: 12px; vertical-align: -2px; }
.dr-pick-list { max-height: 340px; overflow-y: auto; margin-top: 6px; }
.dr-pick-item { align-items: flex-start; }
.dr-pick-item .mi-label { display: flex; flex-direction: column; }
.dr-pick-item small { font-size: 11.5px; }
.dr-pick-item .mono { padding-top: 2px; flex: none; }
.menu-item:disabled { opacity: .5; cursor: default; }
.team-day tr.clickable { cursor: pointer; }
.team-day tr.clickable:hover td { background: var(--hover); }
.team-day td, .team-day th { text-align: center; }
.person-cell { display: inline-flex; align-items: center; gap: 8px; }
.person-cell small { display: block; font-size: 11.5px; }
.rating { color: #f5b301; letter-spacing: 1px; }
.mgr-pick { display: inline-flex; align-items: center; gap: 6px; }

/* ------------------------------------------------------------ v0.3.5: forms */
.nav-badge.warn { background: var(--warn); }
.icon-btn.flip svg { transform: rotate(180deg); }
.form-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.form-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.form-card.off { opacity: .7; }
.form-card-b { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.form-card-name { font-weight: 700; font-size: 15px; color: var(--text); }
.form-card-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.form-card-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ff-page { display: flex; justify-content: center; }
.ff-card { width: 100%; max-width: 640px; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 24px 26px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.ff-card form { display: flex; flex-direction: column; gap: 14px; }
.ff-card.public { margin: 24px auto; }
.ff-card.preview { box-shadow: none; }
.ff-ws { text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.ff-desc { white-space: pre-wrap; }
.ff-field { display: flex; flex-direction: column; gap: 5px; }
.ff-field .input { width: 100%; }
.ff-label { font-weight: 600; }
.ff-label .req { color: var(--danger); }
.ff-help { margin-top: -2px; }
.ff-field.bad .input { border-color: var(--danger); }
.ff-check { font-weight: 500; }
.ff-foot { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.ff-done { align-items: center; text-align: center; display: flex; flex-direction: column; gap: 10px; }
.empty-icon.good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.ff-error { color: var(--danger); font-weight: 600; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.fb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.fb-edit { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.fb-sec { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.fb-field { border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.fb-field-top { display: flex; gap: 8px; align-items: center; }
.fb-num { width: 18px; text-align: right; font-weight: 700; flex: none; }
.fb-label { flex: 1; font-weight: 600; }
.fb-field-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.fb-assignees { flex-wrap: wrap; justify-content: flex-start; min-height: 34px; }
.fb-link { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.fb-link .input { flex: 1; min-width: 220px; font-size: 12.5px; }
.fb-preview-wrap { position: sticky; top: 0; }
.fb-preview-h { text-transform: uppercase; font-weight: 700; letter-spacing: .05em; margin-bottom: 6px; }
.resp .resp-cell { max-width: 220px; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.resp td, .resp th { text-align: left; }
@media (max-width: 1000px) { .fb { grid-template-columns: minmax(0, 1fr); } .fb-preview-wrap { position: static; } }

/* ------------------------------------------------------------ v0.3.5: approvals */
.appr-sec h3 { display: flex; align-items: center; gap: 8px; }
.appr-box { border: 1px solid var(--border); border-left: 4px solid var(--warn); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--panel); margin-bottom: 8px; }
.appr-box.approved { border-left-color: var(--good); }
.appr-box.rejected { border-left-color: var(--danger); }
.appr-box.cancelled { border-left-color: var(--border-strong); }
.appr-note { white-space: pre-wrap; padding: 6px 10px; background: var(--hover); border-radius: 6px; font-size: 13px; }
.appr-steps { display: flex; flex-direction: column; gap: 6px; }
.appr-step { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.appr-dec { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--muted); }
.appr-dec svg { width: 13px; height: 13px; }
.appr-step.approved .appr-dec { color: var(--good); }
.appr-step.rejected .appr-dec { color: var(--danger); }
.appr-comment { flex-basis: 100%; margin-left: 30px; color: var(--muted); font-style: italic; }
.appr-actions { display: flex; gap: 8px; }
.appr-hist summary { cursor: pointer; margin: 6px 0; }
.appr-pick { max-height: 240px; overflow-y: auto; }
.appr-pick .check-line { display: flex; align-items: center; gap: 8px; }
.appr-list { display: flex; flex-direction: column; gap: 10px; max-width: 900px; }
.appr-row { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; flex-wrap: wrap; }
.appr-row-b { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 6px; }
.appr-task { font-weight: 650; color: var(--text); }
.appr-row-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

/* ------------------------------------------------------------ v0.3.6: custom fields, repeat, group/sort, views */
.lv-body.has-cf { overflow-x: auto; }
.lv-body.has-cf > * { min-width: var(--minw); }
.c-cf { height: 100%; display: flex; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 13px; }
.table-head .c-cf { overflow: hidden; text-overflow: ellipsis; display: block; line-height: 1.6; }
.task-row .c-cf { border-radius: 6px; }
.task-row .c-cf:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.c-cf .tag-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.fv-num { font-variant-numeric: tabular-nums; }
.fv-check { color: var(--good); display: inline-flex; }
.fv-text { overflow: hidden; text-overflow: ellipsis; }
.fv-link { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; display: inline-block; vertical-align: bottom; }
.fv-edit textarea, .fv-edit .input { width: 100%; }
.fv-edit-foot { display: flex; gap: 6px; margin-top: 8px; }
.prop-l.cf-l span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop .prop-v .fv-link { max-width: 220px; }
.repeat-on { color: var(--accent-text); font-weight: 600; }
.repeat-menu details > summary { list-style: none; cursor: pointer; }
.repeat-menu details > summary::-webkit-details-marker { display: none; }
.rp-custom { display: flex; flex-direction: column; gap: 8px; padding: 6px 8px 8px; }
.rp-row { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.rp-row .input.sm[type=number] { width: 60px; }
.rp-days { display: flex; gap: 4px; }
.rp-day { position: relative; }
.rp-day input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.rp-day span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-strong); font-size: 12px; font-weight: 600; }
.rp-day input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.rp-day input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rp-help { padding: 6px 8px 2px; }
.group-label { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.group-label svg { width: 14px; height: 14px; }
.view-btn .mod-dot { color: var(--warn); font-weight: 800; }
.cf-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px; }
.cf-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.cf-row:first-child { border-top: 0; }
.cf-opts { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.cf-empty { margin: 8px 0 12px; }
.cf-opt { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.cf-opt .input { flex: 1; }
@media (max-width: 760px) { .c-cf { display: none !important; } .lv-body.has-cf > * { min-width: 0; } }

/* ------------------------------------------------------------ v0.3.7: search, bulk edit, Trash, templates, email */
#gsearch { display: flex; margin-right: 6px; }
.gsearch { width: 240px; height: 32px; cursor: text; }
.gsearch:focus-within { width: 300px; }
.gs-kbd { font: 600 10.5px var(--mono); color: var(--faint); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; white-space: nowrap; }
.gsearch:focus-within .gs-kbd { display: none; }
.search.wide { width: min(560px, 100%); height: 38px; }
.sr-panel { display: flex; flex-direction: column; max-height: min(70vh, 540px); overflow-y: auto; margin: -5px; padding: 4px; }
.sr-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; color: var(--muted); padding: 8px 8px 4px; }
.sr-item { display: flex; gap: 10px; align-items: flex-start; width: 100%; border: 0; background: none; text-align: left; padding: 7px 8px; border-radius: 7px; }
.sr-item:hover, .sr-item:focus-visible { background: var(--hover); outline: none; }
.sr-b { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.sr-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.sr-t.done { text-decoration: line-through; color: var(--muted); }
.sr-b .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-none { padding: 14px 10px; }
.sr-all { border: 0; border-top: 1px solid var(--border); background: none; padding: 9px 8px 5px; text-align: left; color: var(--accent-text); font-weight: 600; display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.sr-page { max-width: 820px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 6px; }
.status-pill.sm { font-size: 10px; padding: 1px 6px; flex: none; margin-top: 2px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; }
mark { background: color-mix(in srgb, var(--warn) 35%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.row-check { width: 15px; height: 15px; margin: 0 2px 0 0; flex: none; accent-color: var(--accent); opacity: .35; cursor: pointer; }
.task-row:hover .row-check, .row-check:checked, .row-check:focus-visible, .table-head .row-check { opacity: 1; }
.table-head .c-name { display: flex; align-items: center; gap: 8px; padding-left: 14px !important; }
@media (hover: none) { .row-check { opacity: 1; } }
.bulk-bar { position: sticky; bottom: 12px; margin: 0 24px 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 12px; background: var(--panel); border: 1px solid var(--accent); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 5; }
.bulk-bar b { margin-right: 6px; }
body:has(.bulk-bar) #toasts { bottom: 84px; }
/* A toast is pinned to the bottom and a dialog's buttons are too, so on a phone the message landed
   on top of the button it was telling you about. It sits above them instead. */
body:has(.modal-backdrop) #toasts { bottom: 92px; }
/* A dialog has the person's whole attention and its buttons are along the bottom, so a notification
   sliding in there covers the one thing they are trying to press. It waits its turn. */
body:has(.modal-backdrop) #notif-pops { display: none; }
.trash-list { display: flex; flex-direction: column; max-width: 900px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; }
.trash-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.trash-row:first-child { border-top: 0; }
.trash-b { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 2px; }
.env-table td { text-align: left; white-space: normal; }
.env-table { min-width: 0; }
.panel-head h2 svg { vertical-align: -2px; }
.assign-pick.disabled { opacity: .45; pointer-events: none; }
.imp-map td, .imp-map th { text-align: left; }
.imp-map { min-width: 520px; }
.imp-ex { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { #gsearch { display: none; } .bulk-bar { margin: 0 8px 8px; } }

/* ------------------------------------------------------------ v0.4: dependencies, estimates, workload, timeline */
.chip-meta.blocked { color: var(--warn); font-weight: 700; }
.deps h3 { display: flex; align-items: center; gap: 8px; }
.dep-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.dep-h { text-transform: uppercase; letter-spacing: .04em; font-size: 11px; font-weight: 700; }
.dep-row { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.dep-row.is-done .dep-link { text-decoration: line-through; color: var(--muted); }
.dep-state { display: inline-flex; color: var(--warn); }
.dep-state.done { color: var(--good); }
.dep-state svg, .dep-row > svg { width: 14px; height: 14px; }
.dep-link { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.est { display: inline-flex; align-items: center; gap: 8px; }
.est-bar { width: 70px; height: 6px; background: var(--hover); border-radius: 99px; overflow: hidden; display: inline-block; }
.est-bar i { display: block; height: 100%; background: var(--good); }
.est-bar.over i { background: var(--danger); }
/* workload */
.wl-help { margin-top: 8px; }
.wl-key { margin-left: 10px; white-space: nowrap; }
.wl-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 8px; vertical-align: -1px; }
.wl-key i.ok, .wl-chip.ok i { background: color-mix(in srgb, var(--good) 55%, transparent); }
.wl-key i.full, .wl-chip.full i { background: color-mix(in srgb, var(--warn) 60%, transparent); }
.wl-key i.over, .wl-chip.over i { background: color-mix(in srgb, var(--danger) 60%, transparent); }
.ts.wl th, .ts.wl td { text-align: center; padding: 8px; }
.ts.wl .ts-task { text-align: left; min-width: 200px; }
.ts.wl th.off, .wl-cell.off { background: color-mix(in srgb, var(--hover) 60%, transparent); }
.ts.wl th.late-h { color: var(--danger); }
.wl-cell { min-width: 84px; }
.wl-cell.today { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.wl-chip { position: relative; width: 100%; min-height: 30px; border: 1px solid var(--border); background: var(--panel); border-radius: 7px; overflow: hidden; font: 600 12px var(--font); font-variant-numeric: tabular-nums; }
.wl-chip i { position: absolute; left: 0; top: 0; bottom: 0; }
.wl-chip span { position: relative; }
.wl-chip.over { border-color: var(--danger); color: var(--danger); }
.wl-chip.full { border-color: var(--warn); }
.wl-chip.late { border-color: var(--danger); color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--panel)); }
.wl-week { white-space: nowrap; }
.person-cell small .link-btn { font-size: 11.5px; color: var(--muted); }
/* timeline */
.lv-body.lv-timeline { padding: 8px 24px 40px; display: flex; flex-direction: column; min-height: 0; }
.tl-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.tl { overflow: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); max-height: calc(100vh - 250px); }
.tl-grid { display: flex; flex-direction: column; width: calc(260px + var(--w)); }
.tl-head { display: flex; position: sticky; top: 0; z-index: 4; background: var(--panel); border-bottom: 1px solid var(--border); }
.tl-corner { position: sticky; left: 0; z-index: 5; background: var(--panel); font-size: 11.5px; text-transform: uppercase; font-weight: 700; color: var(--muted); display: flex; align-items: flex-end; padding-bottom: 6px !important; }
.tl-scale { position: relative; height: 44px; flex: none; }
.tl-months span, .tl-days span { position: absolute; white-space: nowrap; font-size: 11px; }
.tl-months span { top: 4px; font-weight: 700; padding-left: 4px; border-left: 1px solid var(--border); height: 18px; }
.tl-days span { top: 24px; text-align: center; color: var(--muted); height: 20px; line-height: 20px; overflow: hidden; }
.tl-days span.off { color: var(--faint); }
.tl-days span.today { color: #fff; background: var(--accent); border-radius: 4px; font-weight: 700; }
.tl-body { display: flex; }
.tl-names { position: sticky; left: 0; z-index: 3; background: var(--panel); border-right: 1px solid var(--border); flex: none; }
.tl-name { width: 260px; height: 34px; display: flex; align-items: center; gap: 6px; padding: 0 10px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; white-space: nowrap; overflow: hidden; font-size: 13px; }
.tl-name:hover { background: var(--hover); }
.tl-name.sub { padding-left: 28px; font-size: 12.5px; }
.tl-name.done .tl-nt { text-decoration: line-through; color: var(--muted); }
.tl-name svg { width: 13px; height: 13px; color: var(--warn); flex: none; }
.tl-nt { overflow: hidden; text-overflow: ellipsis; }
.tl-track { position: relative; flex: none; background-image: linear-gradient(to bottom, transparent 33px, var(--border) 33px); background-size: 100% 34px; }
.tl-off { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--hover) 70%, transparent); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); opacity: .6; z-index: 1; }
.tl-svg { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; overflow: visible; }
.tl-arrow { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.tl-arrow.bad { stroke: var(--danger); stroke-dasharray: 4 3; }
.tl-arrow-head { fill: var(--muted); }
.tl-arrow-head.bad { fill: var(--danger); }
.tl-row { position: absolute; left: 0; right: 0; height: 34px; }
.tl-bar { position: absolute; top: 6px; height: 22px; border-radius: 6px; background: var(--c); color: var(--fg); font-size: 12px; font-weight: 600; display: flex; align-items: center; cursor: grab; z-index: 3; box-shadow: var(--shadow); user-select: none; touch-action: none; }
.tl-bar.sub { top: 9px; height: 16px; font-size: 11px; opacity: .9; }
.tl-bar.done { opacity: .45; }
.tl-bar.late { outline: 2px solid var(--danger); outline-offset: 1px; }
.tl-bar.dragging { cursor: grabbing; opacity: .85; box-shadow: var(--shadow-lg); }
.tl-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; pointer-events: none; }
.tl-h { width: 7px; align-self: stretch; cursor: ew-resize; flex: none; border-radius: 6px; }
.tl-h:hover { background: rgba(0, 0, 0, .18); }
.tl-after { position: absolute; top: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; pointer-events: none; }
.tl-undated { margin-top: 16px; }
.tl-undated h3 { margin-bottom: 6px; }
.tl-u-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.tl-u-row .link-btn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
/* ------------------------------------------------------------ v0.4.1: work process (SOP), parts log, close-out */
.proc { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; margin: 10px 0 6px; background: color-mix(in srgb, var(--accent) 4%, var(--panel)); display: flex; flex-direction: column; gap: 10px; }
.proc-steps { display: flex; gap: 2px; overflow-x: auto; padding-bottom: 2px; }
.proc-step { flex: 1; min-width: 64px; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; background: none; padding: 4px 2px; border-radius: 8px; position: relative; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.proc-step::before { content: ""; position: absolute; top: 15px; left: -50%; right: 50%; height: 2px; background: var(--border-strong); z-index: 0; }
.proc-step:first-child::before { display: none; }
.proc-step.past::before, .proc-step.now::before { background: var(--c); }
.proc-step:hover { background: var(--hover); }
.proc-dot { position: relative; z-index: 1; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 2px solid var(--border-strong); font-size: 11px; }
.proc-dot svg { width: 12px; height: 12px; }
.proc-step.past .proc-dot { background: var(--c); border-color: var(--c); color: #fff; }
.proc-step.now .proc-dot { border-color: var(--c); color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent); }
.proc-step.now { color: var(--text); }
.proc-name { white-space: nowrap; }
.proc-guide { font-size: 13px; background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.proc-next { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.proc-reqs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.proc-reqs li { display: flex; align-items: center; gap: 6px; color: var(--danger); }
.proc-reqs li.ok { color: var(--good); }
.proc-reqs svg { width: 13px; height: 13px; }
.proc-done { color: var(--good); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.proc-done svg { width: 14px; height: 14px; }
.parts h3 { display: flex; align-items: center; gap: 8px; }
.parts-table { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; }
.pt-row { display: grid; grid-template-columns: minmax(140px, 1.4fr) 64px 150px minmax(110px, 1fr) minmax(120px, 1fr) 28px; gap: 6px; align-items: center; padding: 5px 8px; border-top: 1px solid var(--border); min-width: 640px; }
.pt-row:first-child { border-top: 0; }
.pt-head { font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--muted); background: var(--bg); }
.pt-row .input.sm { width: 100%; height: 28px; font-size: 12.5px; }
.pt-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-row.st-taken { background: color-mix(in srgb, var(--warn) 8%, transparent); }
.pt-row.st-damaged { background: color-mix(in srgb, var(--danger) 7%, transparent); }
.pt-row.st-used .pt-name, .pt-row.st-returned .pt-name { color: var(--muted); }
.parts-sum { margin: 6px 0; }
.pt-add { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.pt-add #pt-name { flex: 1; min-width: 180px; }
.pt-qty { width: 64px !important; }
.co-parts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 8px 10px; background: var(--hover); border-radius: 8px; font-size: 13px; }
.proc-preset { align-items: flex-start; padding: 8px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; }
.btn.on-rules { border-color: var(--accent); color: var(--accent-text); }
.ph-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ph-slot { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.ph-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ph-img { border: 0; padding: 0; background: none; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3; cursor: zoom-in; }
.ph-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-empty { aspect-ratio: 4 / 3; border: 2px dashed var(--border-strong); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); }
.ph-empty svg { width: 28px; height: 28px; }
.ph-btn { align-self: flex-start; }
.ph-progress { font-size: 12px; color: var(--muted); }
.ph-flag { display: inline-block; font: 700 10px var(--font); padding: 1px 5px; border-radius: 4px; margin: 0 2px; background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.ph-flag.ok { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.wp-list { gap: 4px; }
.dr-intro.small { font-size: 12.5px; padding: 8px 10px; margin: 4px 0 8px; }
@media (max-width: 640px) { .ph-grid { grid-template-columns: 1fr 1fr; gap: 8px; } .ph-slot { padding: 8px; } }
@media (max-width: 760px) { .tl-name { width: 150px; } .tl-grid { width: calc(150px + var(--w)); } .lv-body.lv-timeline { padding: 8px; } }

/* v0.4.3: trust this device */
.trust-dev { align-items: flex-start; gap: 8px; margin: 4px 0 10px; text-align: left; }
.trust-dev input { margin-top: 3px; }

/* ------------------------------------------------------------ v0.5: HR employee records */
.people-t td, .people-t th { text-align: left; }
.people-t .person-cell small { display: block; font-size: 11.5px; }
.hr-rec { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; align-items: start; max-width: 1200px; }
.hr-sec h2 svg { vertical-align: -2px; }
.hr-dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; margin: 0; font-size: 13.5px; }
.hr-dl dt { color: var(--muted); }
.hr-dl dd { margin: 0; overflow-wrap: anywhere; }
.hr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.hr-grid .field.wide { grid-column: 1 / -1; }
.hr-docs { display: flex; flex-direction: column; gap: 8px; }
.hr-doc { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; }
.hr-doc.exp { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger) 5%, transparent); }
.hr-doc-b { flex: 1; min-width: 0; font-size: 13px; }
.hr-hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; max-height: 360px; overflow-y: auto; }
.hr-toggle { gap: 4px; }
@media (max-width: 640px) { .hr-rec { grid-template-columns: 1fr; } .hr-dl { grid-template-columns: 120px 1fr; } .hr-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ v0.5.1: leave */
.lv-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.lv-card { background: var(--panel); border: 1px solid var(--border); border-top: 4px solid var(--c); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.lv-card-name { font-weight: 650; font-size: 13px; }
.lv-card-num { font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; }
/* How a balance came about: earned so far, carried over, or simply given. */
.lv-card-note { font-size: 11px; color: var(--faint); border-top: 1px solid var(--border); padding-top: 8px; margin-top: 4px; }
.lv-accrual { margin: -4px 0 4px; max-width: 70ch; line-height: 1.45; }
/* A step that does not apply to everybody. */
.onb-opt { font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  color: var(--faint); border: 1px solid var(--border); padding: 0 5px; margin-left: 6px; white-space: nowrap; }
/* Certificates added to one step: each is a line of its own with what it is and where it came from. */
/* ------------------------------------------------------------ IN · OUT · BREAK */
.presence { display: flex; align-items: center; gap: 6px; flex: none; }
.pr-seg { display: inline-flex; border: 1px solid var(--border-strong); overflow: hidden; }
.pr-seg button {
  border: 0; background: var(--panel); color: var(--muted); height: 32px; padding: 0 10px;
  font-size: 12px; font-weight: 650; letter-spacing: .04em;
}
.pr-seg button + button { border-left: 1px solid var(--border-strong); }
.pr-seg button:hover { background: var(--hover); }
.pr-seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pr-seg button.on[data-pr="out"] { background: var(--muted); }
.pr-seg button.on[data-pr="break"] { background: var(--warn); }
.pr-seg button.on[data-pr="break"].over { background: var(--danger); }
/* The countdown, which is the whole point of the break: a clock that keeps running past zero. */
/* Always there, so somebody can see what is left before deciding to take five minutes or fifteen.
   Quiet when the break is paused, amber while it is running, red once it is overspent. */
.pr-count {
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--muted);
  height: 32px; padding: 0 10px; font: 600 13px/1 var(--mono); font-variant-numeric: tabular-nums;
}
.pr-count.running { border-color: var(--warn); background: var(--warn-tint); color: #6b4e00; }
.pr-count.over { border-color: var(--danger); background: var(--danger-tint); color: var(--danger-strong); }
.pr-who { width: 32px; height: 32px; }
/*
 * On a phone the three words stay; they are the control. What gives way is everything round them:
 * the countdown appears only while a break is running, "who is in" steps aside, and the buttons
 * tighten to the smallest size that is still a comfortable thumb target.
 */
@media (max-width: 680px) {
  .presence { gap: 4px; }
  /* IN is a short word next to OUT, which ends the day. A 26px target beside a consequential
     one is a mis-tap waiting to happen, so every button gets the same comfortable width. */
  .pr-seg button { padding: 0 8px; min-width: 44px; font-size: 11px; height: 38px; letter-spacing: .02em; }
  .pr-who { display: none; }
  /*
   * On a narrow phone the title loses, and loses cleanly. Squeezed between the menu button and the
   * toggle it was rendering as a twelve-pixel sliver of an ellipsis — worse than absent, because it
   * still took room. Every screen repeats its own name in its heading; none of them repeats the
   * only control for marking yourself in.
   */
  body.has-presence .topbar-title { display: none; }
  /*
   * A countdown reading 60:00 all day is noise. The moment any of the break has been spent it is
   * the opposite — somebody deciding whether they have time for another fifteen minutes needs to
   * see what is left, running or paused. So it appears with the first break and stays.
   */
  .pr-count { display: none; }
  .pr-count.running, .pr-count.over, .pr-count.used { display: inline-flex; height: 38px; padding: 0 7px; font-size: 11px; }
}
@media (max-width: 400px) {
  /* The last squeeze before anything would have to be dropped. */
  .pr-seg button { padding: 0 6px; min-width: 40px; font-size: 10.5px; }
  .topbar { gap: 6px; padding: 0 4px; }
  /*
   * With a timer running there is one row too many for a 320px phone: the menu, IN · OUT ·
   * BREAK, the running task, the bell and help come to more than the width. The timer is the one
   * that can give — the task name is already gone by here, so what is left is the clock, and a
   * clock can be narrow. IN · OUT · BREAK and the bell do not shrink: one is how you start
   * the day and the other is how you learn anything happened.
   */
  /*
   * Two round buttons will not fit beside IN . OUT . BREAK and the bell on a 320px screen -- the
   * bell was being pushed off the edge. The pill keeps Pause, which is the one the interruption
   * calls for and the one that stops the clock either way; Stop is a tap further on, through the
   * clock, which opens the task where Stop has always been. Losing Pause here instead would mean
   * losing it exactly where a day gets interrupted most.
   */
  .timer-pill { max-width: none; min-width: 0; flex: 0 1 auto; padding: 0 4px; gap: 3px; font-size: 11px; height: 28px; }
  .timer-stop, .timer-go { width: 20px; height: 20px; }
  .timer-pill .timer-stop { display: none; }
  .timer-clock { font-size: 11px; letter-spacing: -.01em; }
  .topbar { gap: 3px; }
  /* Help is the keyboard shortcuts, and there is no keyboard here. It is the one thing on this bar
     nobody reaches for on a phone, so it is what goes when the row will not fit. */
  .topbar .help-btn { display: none; }
}

/* A group header you can roll up, so a long page can be reduced to the parts you care about. */
.group-head { width: 100%; border: 0; background: none; text-align: left; padding: 6px 0; font: inherit; color: inherit; }
/* A kind of work and the statuses it is allowed to use. */
.tt-edit { align-items: start; }
.tt-sts { display: flex; flex-wrap: wrap; gap: 2px 14px; flex: 1 1 100%; min-width: 0; padding: 2px 0 2px 2px; }
.tt-sts .check-line { margin: 0; }
.fold-caret { display: inline-block; width: 14px; color: var(--faint); font-size: 11px; }
.group-head:hover .group-title { text-decoration: underline; }
.onb-certs { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.onb-certs li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px;
  padding: 5px 8px; background: var(--hover); border-radius: 4px; }
.onb-certs li > a { font-weight: 550; }
.onb-certs li > .muted { flex: 1 1 auto; min-width: 0; }
.lv-list { display: flex; flex-direction: column; gap: 8px; max-width: 900px; margin-bottom: 18px; }
.lv-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; flex-wrap: wrap; }
.lv-row-b { flex: 1; min-width: 220px; font-size: 13.5px; }
.lv-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.lc-t th, .lc-t td { padding: 3px 1px; text-align: center; min-width: 24px; }
.lc-t .ts-task { text-align: left; min-width: 150px; padding-left: 8px; }
.lc-t th small { display: block; }
.lc-t .wk { background: color-mix(in srgb, var(--hover) 80%, transparent); }
.lc-t .hol { background: color-mix(in srgb, var(--warn) 12%, transparent); }
.lc-t .today { box-shadow: inset 0 0 0 2px var(--accent); }
.lc-chip { display: block; height: 22px; line-height: 22px; border-radius: 4px; background: var(--c, #7b68ee); color: #fff; font: 700 9px var(--font); overflow: hidden; }
.lc-chip.pending { opacity: .45; }
.lc-chip.half { background: linear-gradient(90deg, var(--c, #7b68ee) 50%, transparent 50%); color: var(--text); }
.lc-chip.wfh { background: repeating-linear-gradient(45deg, var(--c, #0f9d9f) 0 4px, color-mix(in srgb, var(--c, #0f9d9f) 55%, transparent) 4px 8px); }
.lc-hols .badge { margin-right: 4px; }
.lc-hols svg { vertical-align: -2px; }
.lt-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.lt-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px solid var(--border); }
.lt-row b { min-width: 140px; }
.lt-al { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.lt-al .input { width: 80px; }
.office-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.office-row .field { margin: 0; }
/* ---- v0.5.2 payroll + salary slip ---- */
.pay-t th.ded { color: var(--bad, #d33d44); }
.pay-t .input.sm { width: 104px; text-align: right; }
.pay-t .pay-days { width: 64px; }
.pay-t td.num, .ts td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay-in.saved, .pay-days.saved { border-color: var(--good, #008844); box-shadow: 0 0 0 2px rgba(0, 136, 68, .15); }
.pay-heads { list-style: none; margin: 0; padding: 0; }
.pay-heads li { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.pay-slips { list-style: none; margin: 0; padding: 0; }
.pay-slips li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pay-slips li > a:first-child { flex: 1; }
.nowrap { white-space: nowrap; }
/* Attendance: a person in a table row, and the day they had underneath it. */
.ts-person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.pr-tl-row > td { background: var(--hover); }
.pr-tl { list-style: none; margin: 0; padding: 6px 0 6px 8px; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.pr-tl .mono { color: var(--faint); margin-right: 6px; }
.slip { max-width: 820px; margin: 0 auto; background: #fff; color: #111; border: 1px solid #ccc; padding: 32px 36px; font-size: 13px; }
.slip-head { text-align: center; border-bottom: 2px solid #1f3864; padding-bottom: 10px; margin-bottom: 8px; }
.slip-head h2 { margin: 0; font-size: 20px; color: #1f3864; letter-spacing: .5px; }
.slip-sub { font-weight: 700; margin-top: 4px; }
.slip h3 { font-size: 14px; color: #1f3864; margin: 18px 0 6px; }
.slip-t { width: 100%; border-collapse: collapse; }
.slip-t th, .slip-t td { border: 1px solid #b7b7b7; padding: 6px 8px; text-align: left; }
.slip-t thead th { background: #1f3864; color: #fff; }
.slip-t.kv th, .slip-t.kv2 th { background: #eef2f8; font-weight: 600; width: 22%; }
.slip-t.kv2 th { width: 45%; }
.slip-t .num { text-align: right; font-variant-numeric: tabular-nums; }
.slip-t tr.tot td { font-weight: 700; background: #eef2f8; }
.slip-t tr.net th, .slip-t tr.net td { font-weight: 800; background: #dfe8f5; font-size: 14px; }
.slip-note { margin-top: 10px; font-style: italic; }
.slip-foot { margin-top: 26px; }
.slip-foot p { margin: 4px 0; }
.slip-sign { margin-top: 28px !important; }
@media print {
  .sidebar, .sidebar-scrim, .topbar, .no-print, .toast-wrap { display: none !important; }
  .shell, .main, .view { display: block !important; overflow: visible !important; height: auto !important; }
  .view .pad { padding: 0 !important; }
  .slip { border: none; padding: 0; max-width: none; }
  .slip-t thead th, .slip-t th, .slip-t tr.tot td, .slip-t tr.net td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff !important; }
}
@media (max-width: 640px) { .slip { padding: 16px; font-size: 12px; } .slip-t.kv th, .slip-t.kv td { display: block; width: auto; } }
/* ---- v0.5.3 onboarding ---- */
.onb-bar { display: inline-block; width: 120px; height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; vertical-align: middle; }
.onb-bar > span { display: block; height: 100%; background: var(--good, #008844); }
.onb-h { font-size: 13px; margin: 16px 0 6px; }
.onb-steps { list-style: none; margin: 0; padding: 0; }
.onb-step { display: flex; align-items: flex-start; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--border); border-radius: 6px; flex-wrap: wrap; }
.onb-step.mine { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.onb-step.done .onb-t { text-decoration: line-through; color: var(--muted, #87909e); }
.onb-check { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.onb-kind { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--border); color: var(--muted, #87909e); }
.onb-kind svg { width: 12px; height: 12px; }
.onb-kind.ok { background: var(--good, #008844); border-color: var(--good, #008844); color: #fff; }
.onb-b { flex: 1 1 200px; min-width: 0; }
.onb-t { font-weight: 500; }
.onb-t .link-btn { font-weight: 500; text-align: left; }
.onb-owner { font-weight: 600; }
.onb-body, .onb-read { white-space: pre-wrap; margin-top: 6px; padding: 8px 10px; background: var(--hover, rgba(0,0,0,.03)); border-radius: 6px; font-size: 13px; }
.onb-read { max-height: 60vh; overflow: auto; font-size: 14px; }
/* The buttons keep their own size; when the title has no room left they drop to their own line
   rather than squeezing it to one letter a time. */
.onb-act { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; margin-left: auto; flex-wrap: wrap; }
.onb-sec h2 { font-size: 14px; }
/* ---- v0.5.4 SOP educator ---- */
.sop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 16px; }
.sop-card { display: block; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel, #fff); color: inherit; text-decoration: none; }
.sop-card:hover { border-color: var(--brand); }
.sop-card.archived { opacity: .6; }
.sop-code { font-size: 12px; color: var(--muted, #87909e); }
.sop-title { font-weight: 600; margin: 4px 0 8px; }
.sop-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sop-read { max-width: 860px; }
.sop-text { font-size: 14px; line-height: 1.6; }
.sop-text h3 { font-size: 15px; margin: 18px 0 4px; }
.sop-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; border-color: var(--brand); }
.sop-cta > div { flex: 1; min-width: 220px; }
.sop-done { color: var(--good, #008844); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.sop-qs { padding-left: 20px; }
.sop-qs > li { margin: 12px 0; padding: 8px; border-radius: 8px; }
.sop-qs > li.wrong { background: color-mix(in srgb, var(--bad, #d33d44) 10%, transparent); }
.sop-q { font-weight: 600; margin-bottom: 6px; }
.sop-opt { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.sop-opt.right { background: color-mix(in srgb, var(--good, #008844) 14%, transparent); }
.sop-opt.edit .input { flex: 1; }
.sop-qs.edit .row { display: flex; gap: 6px; margin-bottom: 4px; }
.sop-qs.edit .row .input { flex: 1; font-weight: 600; }
.sop-ta { width: 100%; font-family: var(--mono, ui-monospace, monospace); font-size: 13px; }
.sop-file { margin: 8px 0; display: flex; align-items: center; gap: 6px; }
.sop-hist { margin-top: 20px; }
.sop-people { list-style: none; padding: 0; margin: 0; max-height: 260px; overflow: auto; }
.sop-people li { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.sop-matrix th, .sop-matrix td.sop-cell { text-align: center; }
.sop-cell.ok { color: var(--good, #008844); font-weight: 700; }
.sop-cell.warn { color: var(--warn, #e16b16); }
.sop-cell.bad { color: var(--bad, #d33d44); font-weight: 700; }
.good-text { color: var(--good, #008844); }
.field.inline { display: flex; align-items: center; gap: 6px; margin: 0; }
.field.inline .input { width: 70px; }
/* ---- v0.5.5 first-time experience ---- */
.ftux-tour { position: fixed; inset: 0; z-index: 3000; }
.ftux-spot { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(15, 18, 30, .55); transition: all .2s ease; pointer-events: none; }
.ftux-spot[hidden] { display: block !important; left: 50% !important; top: 50% !important; width: 0 !important; height: 0 !important; }
.ftux-card { position: fixed; background: var(--panel, #fff); color: var(--text, #111); border-radius: 12px; padding: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.3); outline: none; }
.ftux-card h3 { margin: 4px 0 6px; font-size: 16px; }
.ftux-card p { margin: 0 0 12px; line-height: 1.5; }
.ftux-btns { display: flex; align-items: center; gap: 6px; }
.ftux-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.ftux-list li { display: flex; gap: 10px; align-items: flex-start; }
.ftux-list svg { width: 18px; height: 18px; flex: none; color: var(--brand); margin-top: 2px; }
.wz-dots { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; counter-reset: wz; }
.wz-dots li { counter-increment: wz; font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--hover, rgba(0,0,0,.05)); color: var(--muted, #87909e); }
.wz-dots li::before { content: counter(wz) ". "; }
.wz-dots li.on { background: var(--brand); color: #fff; }
.wz-dots li.done { color: var(--good, #008844); }
.wz-body { min-height: 180px; }
.wz-foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.wz-inv { display: flex; gap: 6px; margin-bottom: 6px; }
.wz-inv .input:first-child { flex: 1; }
.wz-links { list-style: none; padding: 0; display: grid; gap: 6px; }
.wz-links li { display: flex; align-items: center; gap: 6px; }
.wz-links li span { min-width: 140px; font-size: 13px; }
.wz-links .input { flex: 1; }
.help-tour { margin: 0 0 12px; }
/* ---- v0.5.6 performance reviews ---- */
.banner-info { padding: 10px 14px; border-radius: 8px; background: color-mix(in srgb, var(--brand) 9%, transparent); margin-bottom: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rv-steps { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 10px 0 6px; }
.rv-steps li { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: var(--hover, rgba(0,0,0,.05)); color: var(--muted, #87909e); }
.rv-steps li.done { color: var(--good, #008844); }
.rv-steps li.done::before { content: "✓ "; }
.rv-steps li.on { background: var(--brand); color: #fff; }
.rv-page { max-width: 1000px; }
.rv-table td.rv-cell { min-width: 220px; vertical-align: top; }
.rv-rate { display: inline-flex; gap: 3px; }
.rv-rate label { cursor: pointer; }
.rv-rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rv-rate span { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--border); font-weight: 600; }
.rv-rate input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }
.rv-rate input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.rv-cm { width: 100%; margin-top: 6px; resize: vertical; }
.rv-comment { white-space: pre-wrap; margin-top: 4px; font-size: 13px; }
.rv-score { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: #fff; font-weight: 700; background: #87909e; }
.rv-score.s1 { background: #d33d44; } .rv-score.s2 { background: #e16b16; } .rv-score.s3 { background: #1090e0; } .rv-score.s4 { background: #3db88b; } .rv-score.s5 { background: #008844; }
.rv-result { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; border-color: var(--brand); }
.rv-overall { font-size: 28px; font-weight: 800; }
.rv-band { font-size: 18px; font-weight: 700; }
.rv-hrnote { flex-basis: 100%; white-space: pre-wrap; }
.rv-actions { display: flex; gap: 8px; justify-content: flex-end; margin: 12px 0 20px; position: sticky; bottom: 0; background: var(--bg, #f7f8fa); padding: 10px 0; }
.rv-stats { margin: 0; }
.rv-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 12px; max-height: 280px; overflow: auto; padding: 6px 0; }
.rv-pick label { display: flex; gap: 6px; align-items: center; }
.rv-todo ul, .rv-peers, .rv-peerlist { margin: 0; padding-left: 18px; }
.rv-todo li, .rv-peers li { margin: 4px 0; }
.rv-peerlist { list-style: none; padding: 0; }
.rv-peerlist li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.rv-peerlist .row { display: flex; gap: 8px; align-items: center; }
.gm-row { display: flex; gap: 6px; margin-bottom: 6px; }
.gm-row .input { flex: 1; }
.field.check { display: flex; gap: 8px; align-items: center; }
/* ---- v0.5.7 claims + payments ---- */
.nc-drop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px; border: 1.5px dashed var(--border-strong, #ccc); border-radius: 8px; }
.nc-drop.over { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.nc-files { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.nc-files li { display: flex; align-items: center; gap: 8px; }
.nc-files img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }
.cl-page { max-width: 900px; }
.cl-amount { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.cl-big { font-size: 24px; font-weight: 800; }
.cl-notes { flex-basis: 100%; white-space: pre-wrap; }
.warn-text { color: var(--warn, #e16b16); }
.cl-receipts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.cl-rc img { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.cl-rc .att-ext.big { display: grid; place-items: center; height: 160px; border-radius: 8px; border: 1px solid var(--border); font-size: 18px; }
.cl-rc .small { margin-top: 4px; word-break: break-all; }
.cl-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.cl-steps li { display: flex; flex-direction: column; padding-left: 26px; position: relative; }
.cl-steps li::before { content: ""; position: absolute; left: 4px; top: 3px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border-strong, #bbb); }
.cl-steps li.done::before { background: var(--good, #008844); border-color: var(--good, #008844); }
.cl-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin: 12px 0 24px; }
.pe-files { list-style: none; padding: 0; margin: 0; }
.pe-files li { padding: 4px 0; }
/* ---- v0.5.8 sales inquiries ---- */
/* The toolbar sets its own top margin and none below, so the board needs this gap itself. */
.sl-board { margin-top: 16px; display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.sl-col { background: var(--hover, rgba(0,0,0,.03)); border-radius: 10px; padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.sl-col header { display: flex; align-items: baseline; gap: 6px; padding: 2px 4px; flex-wrap: wrap; }
.sl-won header b { color: var(--good, #008844); } .sl-lost header b { color: var(--muted, #87909e); }
.sl-card { display: block; background: var(--panel, #fff); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: inherit; text-decoration: none; }
.sl-card:hover { border-color: var(--brand); }
.sl-top { display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.sl-top .badge svg { width: 11px; height: 11px; vertical-align: -1px; }
.sl-client { font-weight: 600; margin: 4px 0 2px; }
.sl-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.sl-stages li button { color: inherit; font: inherit; }
.sl-stages li.lost { background: var(--muted, #87909e); }
.sl-note-row { align-items: center; gap: 10px; margin-top: 8px; }
.sl-hist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.sl-hist li { display: flex; gap: 8px; align-items: flex-start; }
.sl-hist li.event { color: var(--muted, #87909e); font-size: 13px; }
@media (max-width: 800px) { .sl-board { grid-template-columns: repeat(6, 240px); } }
.sl-note-row .field.inline .input { width: 150px; }
/* ---- v0.6.0 backups + activity log ---- */
.bk-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; }
.bk-list li { display: flex; align-items: center; gap: 10px; }
.bk-list .mono { flex: 1; }
/* ---- v0.7.0 company records ---- */
.rec-tabs { display: flex; gap: 4px; margin-top: 12px; overflow-x: auto; border-bottom: 1px solid var(--border); }
.rec-tabs a { padding: 8px 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap; }
.rec-tabs a:hover { color: var(--text); }
.rec-tabs a.on { color: var(--text); border-bottom-color: var(--accent); }
.rec-two { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .rec-two { grid-template-columns: minmax(0, 1fr); } }
.rec-due, .rec-kinds, .rec-docs, .rec-money, .rec-steps, .rec-links { list-style: none; padding: 0; margin: 0; }
.rec-due li a { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); color: inherit; text-decoration: none; }
.rec-due li a:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.rec-due li.late .rec-due-date { color: #c0392b; font-weight: 700; }
.rec-due-date { width: 96px; flex: none; font-variant-numeric: tabular-nums; font-size: 13px; }
.rec-kinds li { display: flex; align-items: center; gap: 10px; padding: 7px 2px; border-bottom: 1px solid var(--border); }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border); flex: none; }
.rec-dot.good { background: var(--good); }
.rec-dot.warn { background: var(--warn); }
.rec-group { margin-bottom: 14px; }
.rec-table-wrap { overflow-x: auto; }
.rec-table { width: 100%; border-collapse: collapse; }
.rec-table th, .rec-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.rec-table th { font-size: 11.5px; text-transform: uppercase; color: var(--muted); font-weight: 700; white-space: nowrap; }
.rec-table tr[data-href] { cursor: pointer; }
.rec-table tr[data-href]:hover td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.rec-table a { color: inherit; text-decoration: none; }
.rec-bar { display: inline-block; width: 70px; height: 6px; border-radius: 3px; background: var(--border); vertical-align: middle; overflow: hidden; }
.rec-bar i { display: block; height: 100%; background: var(--good); }
.rec-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.rec-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; color: inherit; text-decoration: none; }
.rec-card:hover { border-color: var(--accent); }
.rec-card-top, .rec-card-foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.rec-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rec-page { display: grid; gap: 14px; }
.rec-info { display: grid; gap: 14px 20px; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
.rec-info .rec-wide, .rec-notes { grid-column: 1 / -1; }
.rec-notes { margin-top: 12px; }
.rec-pre { white-space: pre-wrap; }
.rec-dl { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 6px 16px; margin: 0; }
.rec-dl dt { color: var(--muted); font-size: 13px; }
.rec-dl dd { margin: 0; font-weight: 600; user-select: all; word-break: break-word; }
.rec-kv { display: grid; gap: 6px; }
.rec-kv-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 6px; }
.rec-steps li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rec-steps li .check-line { flex: 1; min-width: 200px; }
.rec-steps li.done .check-line span { color: var(--muted); text-decoration: line-through; }
.rec-step-due { width: 150px; }
.rec-add-row { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0; }
.rec-add-row .input { flex: 1; }
.rec-docs li { display: flex; gap: 12px; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rec-doc-main { min-width: 0; flex: 1; }
.rec-doc-main a { color: inherit; }
.rec-doc-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rec-money li { display: flex; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.rec-money-amt { width: 120px; flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.rec-links li { padding: 6px 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rec-stages { margin-top: 12px; flex-wrap: wrap; }
@media (max-width: 640px) { .rec-kv-row { grid-template-columns: minmax(0, 1fr); } .rec-due-date { width: 80px; } }
.rec-page .panel-head > .muted, .rec-group .panel-head > .muted { margin-left: 10px; }
/* ---- v0.7.1 per-person sidebar features ---- */
.feat-presets { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.feat-list { max-height: 300px; overflow-y: auto; padding-right: 4px; }
.feat-list .check-line { align-items: baseline; gap: 8px; flex-wrap: wrap; }
.feat-list .check-line .muted { flex: 1 1 100%; margin-left: 26px; }
/* The line that says a tick here is not enough on its own: same indent as the hint, under it. */
.feat-list .check-line .warn-text { flex: 1 1 100%; margin-left: 26px; }
/* ---- v0.8.0 ClickUp sync ---- */
.cu-page { max-width: 900px; }
.cu-spaces { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cu-spaces li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.cu-lists { margin-left: 26px; }

/* ---- v0.9.2 WhoopArena event checklist ---- */
.ev-stats .stat.bad .stat-v { color: var(--danger); }
.ev-areas { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.ev-area { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; background: var(--card); }
.ev-area.ready { border-color: var(--good); }
.ev-area.doing { border-color: var(--warn); }
.ev-area.not_needed { opacity: .6; }
.ev-area-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ev-area-head b { min-width: 170px; }
.ev-area-head .input.sm { max-width: 160px; }
.ev-note { margin: 4px 0 0; }
.ev-area .onb-steps { margin-top: 6px; }
.err-log { max-height: 340px; overflow: auto; background: var(--hover); border: 1px solid var(--border); border-radius: 8px; padding: 10px; font-size: 12px; white-space: pre-wrap; word-break: break-word; }

/* ---- v0.9.5 proposals ---- */
.pr-page { max-width: 900px; }
.pr-text textarea { min-height: 84px; }
.pr-lines { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.pr-lines li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pr-lines li > div:first-child { flex: 1; }
.pr-sub td { background: var(--hover); }
.mark-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.mark-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.mark-thumb { width: 108px; height: 34px; display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--border); border-radius: 6px; }
.mark-thumb img { max-width: 100px; max-height: 28px; }

/* ---- v0.9.6 the project page: what it is, where it has got to ---- */
.pj-head { padding-bottom: 4px; }
.pj-crumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.pj-crumb .pj-seg { font-weight: 600; color: var(--text); }
.pj-meta { display: flex; flex-wrap: wrap; gap: 6px 26px; margin: 10px 0 2px; }
.pj-meta > div { display: grid; gap: 1px; }
.pj-meta dt { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.pj-meta dd { margin: 0; font-size: 13.5px; font-weight: 600; }
.pj-meta .pj-owner { display: flex; align-items: center; gap: 6px; font-weight: 600; }

.pj-track { margin: 14px 0 2px; }
.pj-track-head { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 8px; }
.pj-steps {
  --done: 0%;
  list-style: none; margin: 0; padding: 0 0 4px; display: flex; gap: 0;
  overflow-x: auto; scrollbar-width: thin; position: relative;
}
/* the line the dots sit on, filled up to the stage the project has reached */
.pj-steps::before, .pj-steps::after {
  content: ""; position: absolute; top: 13px; height: 2px; border-radius: 2px;
}
.pj-steps::before { left: 0; right: 0; background: var(--border); }
.pj-steps::after { left: 0; width: var(--done); background: var(--brand); }
.pj-steps li { flex: 1 0 auto; min-width: 88px; max-width: 150px; position: relative; }
.pj-steps li button {
  display: grid; justify-items: center; gap: 5px; width: 100%; padding: 0 4px;
  background: none; border: 0; cursor: pointer; font: inherit; color: var(--muted);
}
.pj-dot {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--border); color: var(--muted);
  font-size: 12px; font-weight: 700; line-height: 1;
}
.pj-dot svg { width: 14px; height: 14px; }
.pj-step-name { font-size: 11.5px; line-height: 1.25; text-align: center; }
.pj-steps li.done .pj-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.pj-steps li.done button { color: var(--text); }
.pj-steps li.on .pj-dot { background: var(--bg); border-color: var(--brand); color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.pj-steps li.on button { color: var(--text); }
.pj-steps li.on .pj-step-name { font-weight: 700; }
.pj-steps li button:hover .pj-dot { border-color: var(--brand); }
.pj-steps li button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 8px; }
@media (max-width: 720px) {
  .pj-steps li { min-width: 76px; }
  .pj-meta { gap: 6px 18px; }
}

/* ---- v0.9.7 each segment looks like itself ---- */
.pj-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 99px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  color: var(--seg, var(--brand));
  background: color-mix(in srgb, var(--seg, var(--brand)) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--seg, var(--brand)) 26%, transparent);
}
.pj-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--seg, var(--brand)); }
.pj-chip span { font-weight: 500; opacity: .8; padding-left: 6px; border-left: 1px solid color-mix(in srgb, var(--seg, var(--brand)) 30%, transparent); }
.pj-tab-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--seg, var(--brand)); margin-right: 5px; vertical-align: baseline; }
.pj-tabs .tab { display: inline-flex; align-items: center; }
.pj-tabs .tab.active { color: var(--seg, var(--brand)); box-shadow: inset 0 -2px 0 var(--seg, var(--brand)); }
.pj-tab-note { margin-left: 12px; }

/* the stage track and the header buttons take the segment's colour */
.pj-head .pj-steps::after { background: var(--seg, var(--brand)); }
.pj-head .pj-steps li.done .pj-dot { background: var(--seg, var(--brand)); border-color: var(--seg, var(--brand)); }
.pj-head .pj-steps li.on .pj-dot { border-color: var(--seg, var(--brand)); color: var(--seg, var(--brand)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--seg, var(--brand)) 18%, transparent); }
.pj-head .pj-steps li button:hover .pj-dot { border-color: var(--seg, var(--brand)); }
.pj-head .btn.primary { background: var(--seg, var(--brand)); border-color: var(--seg, var(--brand)); }
.ts .ts-task small { display: block; margin-top: 2px; font-size: 11.5px; }

/* ---- v0.9.9 clients & contacts ---- */
.cl-contacts { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.cl-contacts li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.ts tr.dim td { opacity: .55; }

/* ---- v1.0 the business overview ---- */
.dash { display: grid; gap: 14px; }
.dash-money .stat { gap: 3px; }
.progress.sm { height: 5px; margin: 4px 0 2px; }
.dash-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.dash-grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.dash-grid .panel { margin: 0; }
.dash-seg .panel-head h2 { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--seg, var(--brand)); }
.dash-lines { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; font-size: 13.5px; }
.dash-lines li { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.dash-att { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.dash-att li { display: flex; align-items: flex-start; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.dash-att li:last-child { border-bottom: 0; }
.dash-att-i { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--hover); color: var(--muted); flex: none; }
.dash-att-i svg { width: 13px; height: 13px; }
.dash-att li.late .dash-att-i, .dash-att li.permit .dash-att-i { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.dash-att li.event .dash-att-i, .dash-att li.proposal .dash-att-i { background: color-mix(in srgb, var(--warn, #e08b1f) 16%, transparent); color: var(--warn, #b8770f); }
.dash-att a { color: inherit; }
.dash-up { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.dash-up li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.dash-up li:last-child { border-bottom: 0; }
.dash-when { flex: none; width: 58px; color: var(--muted); font-weight: 600; }
.icon-preview { background: repeating-conic-gradient(#eceef1 0% 25%, #fff 0% 50%) 50%/12px 12px; }
.icon-preview img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.cl-loose { border-left: 3px solid var(--warn, #e08b1f); }

/* ============================================================ IBM Carbon
   The layer that makes this look like Carbon rather than a generic admin panel. It comes last on
   purpose: everything above sets the structure, this sets the look. Carbon v11, White and Gray 100. */

/* ---- square, everywhere except the things that are meant to be round */
.btn, .input, .panel, .modal, .menu, .card, .stat, .seg, .ts-wrap, .icon-btn,
.toast, .dr-intro, .err-log, .logo-preview, .mark-thumb, kbd, .progress, .progress i,
.empty, .tag-admin-row, .pj-offer, .cl-loose, .dash-seg, .dash-att-i, .swatch, .onb-step {
  border-radius: 0;
}

/* ---- buttons: 40px, square, flat */
.btn {
  height: 40px; padding: 0 15px; gap: 8px; font-weight: 400; letter-spacing: .16px;
  border: 1px solid transparent; background: var(--field); color: var(--text);
  transition: background 110ms cubic-bezier(.2, 0, .38, .9);
}
.btn:hover { background: var(--field-hover); }
.btn:active { background: var(--active); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 14px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-strong); }
.btn.primary:active { background: var(--accent-press); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: var(--danger-strong); }
.btn.ghost, .btn.danger-ghost { background: transparent; border-color: transparent; }
.btn.ghost { color: var(--accent-text); }
.btn.ghost:hover { background: var(--hover); }
.btn.danger-ghost { color: var(--danger); }
.btn.danger-ghost:hover { background: var(--danger-tint); }
.btn:focus-visible, .icon-btn:focus-visible, .tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.link-btn { font-weight: 400; color: var(--accent-text); }

/* ---- fields: a grey block with one line under it, which is the Carbon signature */
.input {
  height: 40px; padding: 0 16px; background: var(--field); color: var(--text);
  border: 0; border-bottom: 1px solid var(--border-strong); border-radius: 0;
  transition: background 110ms cubic-bezier(.2, 0, .38, .9);
}
.input:hover { background: var(--field-hover); }
.input:focus { outline: 2px solid var(--accent); outline-offset: -2px; box-shadow: none; border-bottom-color: transparent; }
.input::placeholder { color: var(--faint); opacity: 1; }
.input.sm { height: 32px; padding: 0 12px; font-size: 14px; }
textarea.input { padding: 11px 16px; line-height: 1.43; }
/*
 * A select used to sit 16px from the left and 12px from the right with the browser's own caret
 * jammed into that 12px, so it never looked centred in its own box. The caret is ours now, placed
 * the same 16px from the right as the text is from the left, with room kept clear so a long option
 * never runs underneath it.
 */
select.input {
  appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  background-image: var(--caret);
  background-repeat: no-repeat;
  background-position: right 16px center;
}
select.input.sm { padding-right: 34px; background-position: right 12px center; }
select.input::-ms-expand { display: none; }
.input:disabled { background: var(--field); color: var(--faint); border-bottom-color: var(--border); }
.field { gap: 8px; margin-bottom: 20px; }
.field > span { font-size: 12px; line-height: 1.33; letter-spacing: .32px; font-weight: 400; color: var(--muted); }
.form-grid { gap: 0 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ---- the segmented control, as Carbon's content switcher */
.seg { border: 0; overflow: hidden; }
.seg button {
  height: 40px; padding: 0 16px; background: var(--field); color: var(--muted); font-weight: 400;
  border: 1px solid transparent;
}
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button:hover { background: var(--field-hover); color: var(--text); }
.seg button.on { background: var(--text); color: var(--panel); border-color: var(--text); }
.seg button.on + button { border-left-color: transparent; }

/* ---- tabs: a line under the one you are on */
.tabs { gap: 0; border-bottom: 1px solid var(--border); }
.tab {
  height: 40px; padding: 0 16px; border-radius: 0; color: var(--muted); font-weight: 400;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { background: var(--hover); color: var(--text); }
.tab.active { background: transparent; color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.pj-tabs .tab.active { color: var(--seg, var(--accent)); box-shadow: none; border-bottom-color: var(--seg, var(--accent)); }

/* ---- the sidebar: a bar marks where you are */
.nav-item { border-radius: 0; border-left: 3px solid transparent; }
.nav-item.active { background: var(--active); color: var(--text); font-weight: 600; border-left-color: var(--accent); }
.nav-item.active svg { color: var(--text); }

/* ---- panels are tiles: white on grey, one hairline, no rounding */
.panel { border-radius: 0; box-shadow: none; }
.panel-head h2 { letter-spacing: 0; }

/* ---- tables, as Carbon's data table */
.ts th {
  font-size: 12px; text-transform: none; letter-spacing: .32px; font-weight: 600; color: var(--text);
  background: var(--field); height: 40px;
}
.ts td { font-size: 14px; }
.ts th, .ts td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ts tbody tr:hover { background: var(--hover); }
.ts tfoot td { background: var(--field); }

/* ---- tags stay pills, in Carbon's tints */
.badge { border-radius: 999px; font-weight: 400; font-size: 12px; letter-spacing: .32px; padding: 2px 8px; background: var(--active); color: var(--text); }
.badge.good { background: var(--good-tint); color: var(--good); }
.badge.warn { background: var(--warn-tint); color: var(--warn); }
.badge.bad { background: var(--danger-tint); color: var(--danger); }
.chip, .chip-toggle { border-radius: 999px; font-weight: 400; }
.chip-toggle.on { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-text); }

/* ---- dialogs: square, title in regular weight, buttons the full height of the footer */
.modal { border-radius: 0; box-shadow: var(--shadow-lg); }
.modal-head h2 { font-size: 20px; font-weight: 400; line-height: 1.4; }
.modal-foot .btn { height: 48px; min-width: 110px; }

/* ---- notifications: a bar down the left */
.toast { border-left: 3px solid var(--accent); box-shadow: var(--shadow-lg); }
.toast.good { border-left-color: var(--good); }
.toast.error { border-left-color: var(--danger); }
.dr-intro { border-left: 3px solid var(--accent); border-radius: 0; }
.dr-intro.warn { border-left-color: var(--warn); }

/* ---- progress */
.progress { background: var(--border); }
.progress i { background: var(--accent); }

/* ---- the stage panel had two markers on every line, and hover made them look like links */
.pj-offer-list { list-style: none; }
.pj-offer-list li { display: flex; }
.pj-offer-list .link-btn { color: var(--text); padding: 4px 8px 4px 0; width: 100%; }
.pj-offer-list .link-btn:hover { text-decoration: none; color: var(--accent-text); background: var(--hover); }
.pj-stage-panel .panel-head h2 { display: flex; align-items: baseline; gap: 8px; }
.pj-offer { background: var(--field); border: 0; border-left: 3px solid var(--border-strong); }

/* ---- the client picker was three stacked things in one grid cell */
.field .cl-pick { display: grid; gap: 8px; }

/* ---- on a phone.
   Most of the team open this from the home screen, so the phone is the real client, not an
   afterthought. Carbon's rules for small screens: nothing runs off the side, a dialog takes the
   whole screen, and anything you tap is at least 48px — which is also field-02, Carbon's touch size. */
@media (max-width: 680px) {
  /* one column, always — a four-up row of tiles is what was running off the right edge */
  .stats, .dash-grid, .dash-grid.two, .form-grid, .settings-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .stats { gap: 1px; background: var(--border); }
  .stats > .stat { margin: 0; }

  /* rows of tabs and chips are swiped, not wrapped */
  .tabs, .toolbar > .tabs, .seg { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar, .seg::-webkit-scrollbar { display: none; }
  .tabs .tab { flex: none; }
  .toolbar { gap: 8px 12px; }

  /* Carbon field-02 sizing: 48px for anything a thumb has to hit */
  .btn, .input, .seg button, .tab { height: 48px; }
  .btn.sm, .input.sm { height: 40px; }
  .icon-btn { width: 44px; height: 44px; }
  .icon-btn.tiny { width: 36px; height: 36px; }
  .onb-check, input[type="checkbox"] { width: 20px; height: 20px; }
  /* on a phone they always go below, lined up under the title */
  /* Thumb-sized: a group header you tap to roll up, the dot that changes a subtask's status, and
     the workload chip that opens the day's list. */
  .group-head { padding: 12px 0; }
  /* The dot stays small — a big one would look wrong in the row — but the area a thumb has to hit
     reaches past it, which is what actually matters. */
  .status-dot { width: 24px; height: 24px; position: relative; }
  .status-dot::after { content: ''; position: absolute; inset: -8px; }
  .wl-chip { min-height: 40px; }

  .onb-act { flex-basis: 100%; margin: 4px 0 0 30px; }
  .onb-act .btn { flex: 1 1 auto; justify-content: center; }

  /* A filter that will not fit beside its label goes under it rather than off the edge, where
     `overflow-x: clip` would simply cut it off. */

  .inline-field { flex-wrap: wrap; max-width: 100%; }
  .toolbar > .inline-field { flex: 1 1 100%; min-width: 0; }
  .inline-field .input { flex: 1 1 150px; min-width: 0; max-width: 100%; height: 40px; }
  .seg, .swatches { max-width: 100%; flex-wrap: wrap; }
  .seg { flex-wrap: nowrap; overflow-x: auto; }

  /* Thumb-sized: a star you rate with and a colour you pick were both under 28px. */
  .star { font-size: 30px; padding: 3px 6px; }
  .swatch { width: 36px; height: 36px; }
  .chip, .chip-toggle { min-height: 40px; }

  /* a dialog takes the whole screen, with its buttons pinned where a thumb reaches */
  .modal, .modal.wide {
    width: 100%; max-width: 100%; height: 100%; max-height: 100%; min-height: 0; margin: 0; border-radius: 0;
    display: flex; flex-direction: column;
  }
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal-body { flex: 1 1 auto; min-height: 0; padding-bottom: 16px; }
  .modal-head { padding: 16px; }
  .modal-foot { padding: 0; margin-top: auto; gap: 1px; background: var(--border); }
  .modal-foot .btn { flex: 1; height: 56px; min-width: 0; }
  .modal-foot .btn:not(.primary):not(.danger) { background: var(--field); }

  /* the page itself */
  .page-head { padding: 16px 16px 0; }
  .page-head > p { font-size: 14px; }
  .pad { padding: 16px; }
  h1 { font-size: 24px; }
  .panel { padding: 16px; margin-bottom: 16px; }

  /* tables scroll inside their own box rather than stretching the page */
  .ts-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ts { min-width: 600px; }
  .ts th, .ts td { padding: 12px; }

  /* the project stage track: swipeable, with the dots kept a thumb's width apart */
  .pj-steps li { min-width: 92px; }
  .pj-meta { gap: 10px 20px; }

  /* the business overview reads top to bottom */
  .dash-money .stat { padding: 16px; }
  .dash-att li, .dash-up li { padding: 10px 0; }
  .dash-when { width: 52px; }

  /* nothing sits under the home indicator */
  .modal-foot, .lv-foot, .bulk-bar { padding-bottom: max(0px, env(safe-area-inset-bottom)); }
}

/* a finger is not a mouse: no hover-only affordances on touch */
@media (hover: none) {
  .btn:hover, .tab:hover, .nav-item:hover { background: inherit; }
  .pj-offer-list .link-btn { padding: 10px 8px 10px 0; }
}

/* ---- a grid child may never be wider than its track.
   Without this a grid column is sized to the widest thing inside it, which is what pushed the
   dashboard tiles to 689px on a 375px screen. min-width:0 lets them shrink instead. */
.dash { grid-template-columns: minmax(0, 1fr); }
.dash > *, .dash-grid > *, .stats > *, .form-grid > *, .pj-meta > *, .cl-page > * { min-width: 0; }
.stat, .panel, .dash-seg { min-width: 0; }
.stat-v, .stat-l, .onb-t, .ts-task b { overflow-wrap: anywhere; }

@media (max-width: 680px) {
  /* a page's main action gets its own full-width row instead of dangling under the title */
  .page-title-row:has(> h1) > .btn.primary { flex: 1 0 100%; }

  /* "Stage 2 of 8 · Budget & sponsors" on one line, then the move button under it */
  .pj-track-head { flex-wrap: wrap; row-gap: 10px; }
  .pj-track-head > b, .pj-track-head > span { white-space: nowrap; }
  .pj-track-head .btn { flex: 1 0 100%; }
  .pj-steps li { min-width: 104px; }
  .pj-step-name { line-height: 1.2; }

  /* fact lists stack: the label over the value, rather than a wrapped label with a lonely dash */
  .hr-dl { grid-template-columns: minmax(0, 1fr) !important; gap: 0; }
  .hr-dl dt { padding-top: 12px; }
  .hr-dl dd { margin: 0 0 4px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
  .pj-meta { gap: 12px 24px; }

  /* the segment chip and the status badge belong on their own line, not squeezed against the title */
  .pj-crumb { flex-wrap: wrap; row-gap: 4px; }
}

@media (max-width: 680px) {
  /* the project header, organised: identity, then the one action, then the facts, then the track */
  .pj-head .page-title-row { row-gap: 12px; align-items: flex-start; }
  .pj-head .pj-crumb { width: 100%; }
  .pj-head .pj-edit { display: none; }        /* "Edit details" is in the … menu */
  .pj-head .page-title-row > .btn { flex: 1; }
  .pj-head .page-title-row > .icon-btn { flex: none; }
  .pj-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
  .pj-meta dd { font-size: 14px; }
  .pj-track-head { font-size: 13px; }
}

/* ============================================================ the picker (Carbon dropdown / multiselect / combo box) */
.pk { position: relative; display: block; width: 100%; }
.pk-field {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 40px; padding: 0 12px 0 16px;
  background: var(--field); color: var(--text); border: 0; border-bottom: 1px solid var(--border-strong);
  text-align: left; font: inherit;
}
.pk-field:hover { background: var(--field-hover); }
.pk-field:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pk-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-caret { display: grid; place-items: center; color: var(--text); transition: transform 110ms cubic-bezier(.2, 0, .38, .9); }
.pk-caret svg { width: 16px; height: 16px; }
.pk-field[aria-expanded="true"] .pk-caret { transform: rotate(180deg); }
/* the count, with a cross to clear it — Carbon's "listbox selection" pill */
.pk-count {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 2px 0 8px; border-radius: 999px;
  background: var(--text); color: var(--panel); font-size: 12px; font-weight: 400; flex: none;
}
.pk-count svg { width: 14px; height: 14px; padding: 1px; border-radius: 999px; }
.pk-count:hover svg { background: rgba(255, 255, 255, .25); }
.pk-pop {
  position: absolute; z-index: 40; left: 0; right: 0; top: 100%; background: var(--panel);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); max-height: 280px; overflow: auto;
}
.pk-pop.up { top: auto; bottom: 100%; }
.pk-search { display: flex; align-items: center; gap: 8px; padding: 0 16px; height: 40px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--panel); }
.pk-search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.pk-q { flex: 1; border: 0; background: none; height: 38px; font: inherit; color: inherit; outline: none; }
.pk-list { list-style: none; margin: 0; padding: 0; }
.pk-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 16px; border: 0;
  background: none; text-align: left; font: inherit; color: var(--text); border-bottom: 1px solid var(--border);
}
.pk-opt:hover, .pk-opt.active { background: var(--hover); }
.pk-opt.on { background: var(--active); }
.pk-label { flex: 1; min-width: 0; }
.pk-label small { display: block; font-size: 12px; color: var(--muted); }
.pk-box {
  display: grid; place-items: center; width: 16px; height: 16px; flex: none;
  border: 1px solid var(--text); color: transparent;
}
.pk-box svg { width: 12px; height: 12px; }
.pk-opt.on .pk-box { background: var(--text); border-color: var(--text); color: var(--panel); }
.pk-none { padding: 12px 16px; color: var(--muted); font-size: 13px; }
@media (max-width: 680px) {
  .pk-field { height: 48px; }
  .pk-opt { min-height: 48px; }
  .pk-pop { max-height: 60vh; }
}

/* ---- Carbon breadcrumb */
.bc ol { display: flex; align-items: center; gap: 0; list-style: none; margin: 0; padding: 0; min-width: 0; }
.bc li { display: flex; align-items: center; font-size: 14px; min-width: 0; }
.bc li + li::before { content: "/"; color: var(--faint); padding: 0 8px; }
.bc a { color: var(--accent-text); text-decoration: none; white-space: nowrap; }
.bc a:hover { text-decoration: underline; }
.bc li[aria-current="page"] { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc-more { border: 0; background: none; color: var(--accent-text); padding: 0 2px; font: inherit; line-height: 1; }
.bc-more:hover { text-decoration: underline; }

/* ---- Carbon text input: label, field, helper line, and the error/warning states.
   The helper line sits under the field and is always the same height whether it holds help text,
   an error or nothing, so a form does not jump about as you fill it in. */
.field { position: relative; }
.field > span { display: block; }
.field-wrap { position: relative; display: block; }
.field-wrap > .input { width: 100%; padding-right: 40px; }
.field-wrap > .fi-icon {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: grid; place-items: center;
  width: 16px; height: 16px; pointer-events: none;
}
.field-wrap > .fi-icon svg { width: 16px; height: 16px; }
.field-help { font-size: 12px; line-height: 1.33; letter-spacing: .32px; color: var(--muted); margin-top: 4px; }
.field-help:empty { display: none; }
.field-msg { font-size: 12px; line-height: 1.33; letter-spacing: .32px; margin-top: 4px; }
.field.bad .input, .input.bad, .input[aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: -2px; border-bottom-color: transparent; }
.field.bad .field-msg { color: var(--danger); }
.field.bad .fi-icon { color: var(--danger); }
.field.warn .input { outline: 2px solid var(--warn); outline-offset: -2px; border-bottom-color: transparent; }
.field.warn .field-msg { color: var(--text); }
.field.warn .fi-icon { color: var(--warn); }
.field.bad > span, .field.warn > span { color: var(--muted); }
.input[readonly] { background: transparent; border-bottom-color: var(--border); padding-left: 0; }
/* a counted field puts the count beside its label, the way Carbon does */
.field-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.field-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.field.over .field-count { color: var(--danger); }
/* password reveal */
.fi-eye { position: absolute; right: 0; top: 0; width: 40px; height: 40px; display: grid; place-items: center; background: none; border: 0; color: var(--text); }
.fi-eye:hover { background: var(--field-hover); }
.fi-eye:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 680px) { .fi-eye { width: 48px; height: 48px; } }

/* ---- Carbon button tiers and sizes.
   Carbon has four tiers — primary, secondary, tertiary (outlined), ghost — and a danger version of
   each. Sizes are 32 / 40 / 48; the 48 is what a dialog footer and a phone use. */
.btn.secondary { background: var(--text); border-color: var(--text); color: var(--panel); }
.btn.secondary:hover { background: var(--muted); border-color: var(--muted); }
.btn.tertiary { background: transparent; border-color: var(--accent); color: var(--accent-text); }
.btn.tertiary:hover { background: var(--accent); color: #fff; }
.btn.tertiary:active { background: var(--accent-press); border-color: var(--accent-press); color: #fff; }
.btn.danger-tertiary { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger-tertiary:hover { background: var(--danger); color: #fff; }
.btn.lg { height: 48px; padding: 0 15px; }
.btn.xl { height: 64px; align-items: flex-start; padding-top: 14px; }
.btn:disabled, .btn[disabled], .btn[aria-disabled="true"] {
  background: var(--field); border-color: transparent; color: var(--faint); cursor: not-allowed;
}
.btn.primary:disabled, .btn.secondary:disabled, .btn.tertiary:disabled { background: var(--field); color: var(--faint); border-color: transparent; }
/* Carbon puts the icon at the trailing edge and pushes it to the end of the button */
.btn > svg { width: 16px; height: 16px; flex: none; }
.btn.icon-end { justify-content: space-between; padding-right: 12px; min-width: 128px; }
.btn.icon-only { width: 40px; padding: 0; justify-content: center; }
.btn.icon-only.lg { width: 48px; }
/* a button that is working: the label stays, a spinner replaces the icon */
.btn.busy { pointer-events: none; }
.btn.busy > svg, .btn.busy::after { display: none; }
.btn.busy::before {
  content: ""; width: 16px; height: 16px; flex: none; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 999px; animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* a row of buttons in Carbon sits flush, with a 1px gap */
.btn-set { display: flex; gap: 1px; flex-wrap: wrap; }
.btn-set .btn { flex: 1 1 auto; }

/* ---- Carbon progress indicator (the project stage track).
   Step text is left-aligned under its circle, with the connecting line running between circles:
   complete is a filled check, current is a half-filled ring, still-to-come is an empty ring. */
.pj-steps { --done: 0%; padding-top: 4px; gap: 0; }
.pj-steps::before, .pj-steps::after { display: none; }
.pj-steps li { min-width: 120px; max-width: 200px; }
.pj-steps li button { justify-items: start; gap: 0; padding: 0 16px 0 0; text-align: left; position: relative; }
/* the line to the next step */
.pj-steps li:not(:last-child) button::after {
  content: ""; position: absolute; left: 24px; right: 8px; top: 11px; height: 1px; background: var(--border-strong);
}
.pj-steps li.done button::after { background: var(--accent); }
.pj-steps .pj-dot {
  width: 16px; height: 16px; border: 1px solid var(--border-strong); border-radius: 999px;
  display: grid; place-items: center; font-size: 0; color: transparent; background: var(--bg); margin: 3px 0 6px;
}
.pj-steps .pj-dot svg { width: 16px; height: 16px; }
.pj-steps li.done .pj-dot { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 0; }
.pj-steps li.done .pj-dot svg { color: #fff; }
/* current: Carbon's half-filled ring */
.pj-steps li.on .pj-dot {
  background: var(--bg); border-color: var(--accent); box-shadow: none;
  background-image: linear-gradient(to right, var(--accent) 50%, transparent 50%);
}
.pj-steps li.on button { color: var(--text); }
.pj-steps .pj-step-name { font-size: 14px; line-height: 1.29; white-space: normal; }
.pj-steps li.on .pj-step-name { font-weight: 600; }
.pj-steps li button:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-radius: 0; }
.pj-steps li button.viewing .pj-step-name { text-decoration: underline; text-underline-offset: 3px; }
.pj-head .pj-steps li.done .pj-dot,
.pj-head .pj-steps li.done button::after { background: var(--seg, var(--accent)); border-color: var(--seg, var(--accent)); }
.pj-head .pj-steps li.on .pj-dot { border-color: var(--seg, var(--accent)); background-image: linear-gradient(to right, var(--seg, var(--accent)) 50%, transparent 50%); }
@media (max-width: 680px) { .pj-steps li { min-width: 132px; } }

/* ---- the work-area photo slots.
   The hint sat flush against the dashed edge and broke mid-word; Carbon's smallest gutter is 16px,
   so that is what the empty state gets, with the text centred and given room to wrap properly. */
.ph-slot { border-radius: 0; padding: 16px; gap: 12px; }
.ph-h { align-items: center; min-height: 20px; }
.ph-h b { font-size: 14px; font-weight: 600; }
.ph-empty {
  border-radius: 0; border: 1px dashed var(--border-strong); background: var(--field);
  padding: 16px; text-align: center; gap: 8px;
}
.ph-empty span { max-width: 22ch; line-height: 1.33; }
.ph-img { border-radius: 0; }
.ph-btn { align-self: stretch; justify-content: center; }
.ph-flag { border-radius: 999px; font-weight: 400; }
@media (max-width: 680px) {
  .ph-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ph-slot { padding: 12px; }
  .ph-empty { padding: 12px; }
}

/* ---- the money tiles on the overview.
   Value, label, bar and the "x% of y" line were all 2–3px apart, so nothing read as a group.
   Carbon's spacing scale: 16px round the tile, 8px between the parts, and the bar given its own air. */
.stat { border-radius: 0; padding: 16px; gap: 4px; }
.stat-v { font-size: 28px; font-weight: 400; line-height: 1.25; letter-spacing: 0; }
.stat-l { font-size: 14px; font-weight: 400; color: var(--text); line-height: 1.29; }
.stat .muted.small { font-size: 12px; letter-spacing: .32px; }
.dash-money .stat { gap: 4px; padding: 16px; }
.dash-money .progress, .progress.sm { margin: 12px 0 8px; height: 8px; border-radius: 0; }
.progress, .progress i { border-radius: 0; }
a.stat:hover { border-color: var(--border); background: var(--hover); }
@media (max-width: 680px) {
  .stats { gap: 1px; }
  .stat { padding: 16px; }
  .stat-v { font-size: 26px; }
}

/* ---- where the buttons go.
   Heuristics, not taste: the thing that ends the job sits last, on the right, where the eye finishes
   (Carbon and every OS dialog agree); the way out sits beside it; and a destructive button is pushed
   to the far side so nobody reaches "Delete" while aiming for "Save". */
.modal-foot { display: flex; align-items: stretch; }
.modal-foot .btn.mf-danger { margin-right: auto; }
.modal-foot .btn.primary { order: 9; }

/* On a phone the header was three stacked full-width buttons above the explanation, which pushed the
   words nobody had read yet off the screen. Title, then the explanation, then the actions. */
@media (max-width: 680px) {
  .page-head { display: flex; flex-direction: column; }
  .page-head .page-title-row { display: contents; }
  .page-head .page-title-row > .grow { display: none; }
  .page-head .page-title-row > div:first-child { order: 0; }
  .page-head > p { order: 1; margin: 8px 0 16px; }
  /*
   * They used to be stretched the full width of the screen, which turned a single "+ Task" into a
   * slab of colour heavier than the greeting above it. A button is as wide as its words, sitting
   * under the title where the eye already is.
   */
  .page-head .page-title-row > .btn, .page-head .page-title-row > .icon-btn, .page-head .page-title-row > .menu-host {
    order: 2; width: auto; flex: none; align-self: flex-start; margin-bottom: 8px;
  }
  .page-head .page-title-row > .btn { padding-inline: 20px; }
  .page-head .page-title-row > h1 { order: 0; }
  .page-head .page-title-row > .btn.primary { order: 3; flex: none; align-self: flex-start; margin-bottom: 0; }
  .page-head > .toolbar { order: 4; margin-top: 16px; }
  .modal-foot .btn.mf-danger { margin-right: 0; order: 0; }
}

/* ---- Carbon search.
   It was a bare 32px input pinned to 260px, so on a narrow toolbar the placeholder ran out of the
   box. Carbon's search is the field block with the magnifier inside it, and it gives up its width
   before anything else does. */
.search {
  height: 40px; padding: 0 16px 0 12px; gap: 8px; border: 0; border-bottom: 1px solid var(--border-strong);
  border-radius: 0; background: var(--field); width: auto; flex: 1 1 200px; max-width: 320px; min-width: 0;
}
.search:hover { background: var(--field-hover); }
.search:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; border-bottom-color: transparent; }
.search svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.search input { min-width: 0; font: inherit; height: 100%; }
.search input::placeholder { color: var(--faint); opacity: 1; text-overflow: ellipsis; }
.search.wide { height: 40px; max-width: 560px; }
@media (max-width: 680px) {
  .search { height: 48px; flex: 1 1 100%; max-width: none; }
  .toolbar > .tabs + .grow { display: none; }
}

/* tab labels belong on one line — "All projects" was breaking in two */
.tabs .tab { white-space: nowrap; flex: none; }

/* the month box was 70px wide, which clips "September" and its calendar button */
.field.inline .input { width: auto; min-width: 150px; }
@media (max-width: 680px) {
  /* The month and the button it belongs with stay on one line — but only in the toolbars that
     actually have a month in them. Forcing every toolbar to one line pushed the filters on
     Timesheets and Workload clean off the side of the screen, where they were then clipped. */
  .toolbar:has(> .field.inline) { flex-wrap: nowrap; align-items: flex-end; }
  .toolbar > .tabs { flex: 1 1 auto; }
  .field.inline { flex: 1 1 auto; min-width: 0; margin: 0; }
  .field.inline .input { flex: 1; width: 100%; min-width: 0; }
  .toolbar > .btn, .toolbar > .btn.sm { flex: none; width: auto; }
  .toolbar > .grow { display: none; }
}

/* a count beside a heading is its own word, not part of it */
.panel-head h2 { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.panel-head h2 > svg { flex: none; align-self: center; }
.count { font-weight: 400; letter-spacing: .32px; color: var(--muted); }
/* the offered steps: Carbon's spacing, and the "add all" button kept off the heading */
.pj-offer { padding: 16px; }
.pj-offer .panel-head { margin-bottom: 8px; gap: 12px; }
.pj-offer-list li + li { border-top: 1px solid var(--border); }
.pj-offer-list .link-btn { padding: 8px 8px 8px 0; text-align: left; }

/* the stage track should fit the width it has before it starts scrolling, and the last label
   must never be half a word — the steps share the space and the text wraps instead. */
.pj-steps { padding-bottom: 0; }
.pj-steps li { flex: 1 1 0; min-width: 96px; max-width: none; }
.pj-steps li button { padding-right: 12px; }
.pj-steps li:not(:last-child) button::after { left: 22px; right: 6px; }
.pj-steps .pj-step-name { overflow-wrap: anywhere; }
.pj-steps::-webkit-scrollbar { height: 4px; }
.pj-steps::-webkit-scrollbar-thumb { background: var(--border-strong); }
@media (max-width: 680px) { .pj-steps li { flex: 0 0 auto; min-width: 120px; } }

/* a save bar needs air round it, and the note under it is a separate thought, not a caption */
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin: 16px 0; }
.row-end + p.muted { margin-top: 0; max-width: 72ch; line-height: 1.43; }
.panel + .row-end { margin-top: 0; }
@media (max-width: 680px) {
  .row-end { margin: 16px 0; }
  .row-end .btn { width: 100%; }
}

/* a long tab row scrolls inside itself at any width, instead of widening the page under it */
.toolbar { min-width: 0; }
.tabs { overflow-x: auto; scrollbar-width: none; min-width: 0; }
.tabs::-webkit-scrollbar { display: none; }
.page-head, .view { overflow-x: clip; }
.panel-head { gap: 8px; }
.panel-head > .count { margin-right: auto; }

/* the inline "add a task" row: a field with its own buttons, so it works without an Enter key */
.inline-add { display: flex; align-items: center; gap: 8px; }
.inline-add input {
  flex: 1; min-width: 0; height: 40px; border: 0; border-bottom: 1px solid var(--border-strong);
  border-radius: 0; padding: 0 16px; background: var(--field); box-shadow: none; outline: none;
}
.inline-add input:focus { outline: 2px solid var(--accent); outline-offset: -2px; border-bottom-color: transparent; }
.inline-add .btn { flex: none; }
@media (max-width: 680px) {
  .inline-add { flex-wrap: wrap; }
  .inline-add input { height: 48px; flex: 1 1 100%; }
  .inline-add .btn { flex: 1 1 0; height: 44px; }
}

/* ---- the notification popup, bottom left.
   Deliberately not the toast: a toast is the app answering something you just did and it belongs
   near where you were looking, while this arrives on its own and must never sit over the thing you
   are working on.

   Bottom left was the wrong corner: that is where the sidebar keeps the profile menu, so an
   arriving notification sat on top of the one control people reach for to sign out or open their
   own record. Bottom right, above the toasts. */
#notif-pops {
  position: fixed; right: 16px; left: auto; bottom: 16px; z-index: 92; display: flex; flex-direction: column-reverse;
  gap: 8px; align-items: flex-end; pointer-events: none;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.notif-pop {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; width: min(380px, calc(100vw - 32px));
  padding: 12px 8px 12px 12px; text-align: left; background: var(--panel); color: var(--text);
  border: 1px solid var(--border); border-left: 3px solid var(--accent); box-shadow: var(--shadow-lg);
  animation: np-in .18s cubic-bezier(.2, 0, .38, .9); transition: opacity .25s, transform .25s; cursor: pointer;
}
.notif-pop:hover { background: var(--hover); }
.notif-pop.out { opacity: 0; transform: translateX(12px); }
.notif-pop.more { justify-content: center; font-size: 13px; color: var(--accent-text); border-left-color: var(--border-strong); }
.np-face { flex: none; }
.np-face .notif-icon { display: grid; place-items: center; width: 28px; height: 28px; background: var(--field); color: var(--muted); }
.np-face svg { width: 16px; height: 16px; }
.np-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.np-text { font-size: 14px; line-height: 1.29; overflow-wrap: anywhere; }
.np-task { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.np-x { flex: none; border: 0; background: none; color: var(--muted); padding: 2px; display: grid; place-items: center; }
.np-x:hover { color: var(--text); background: var(--hover); }
.np-x svg { width: 14px; height: 14px; }
@keyframes np-in { from { opacity: 0; transform: translateX(12px); } }
@media (max-width: 680px) {
  #notif-pops { left: 8px; right: 8px; bottom: 8px; align-items: flex-end; }
  .notif-pop { width: 100%; padding: 14px 10px 14px 14px; }
}
@media (prefers-reduced-motion: reduce) { .notif-pop { animation: none; } }

/* ---- hyper-care */
.hc-card { display: block; }
.hc-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.hc-reason { margin: 0 0 8px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.hc-h2 { font-size: 16px; font-weight: 600; margin: 24px 0 12px; }
.hc-h3 { font-size: 14px; font-weight: 600; margin: 16px 0 8px; }
.hc-summary { background: var(--field); padding: 12px 16px; margin: 12px 0 0; border-left: 3px solid var(--good); }
.hc-t { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; vertical-align: middle; }
.hc-t svg { width: 12px; height: 12px; }
.hc-t.yes { background: var(--good-tint); color: var(--good); }
.hc-t.no { background: var(--danger-tint); color: var(--danger); }
.hc-grid td { vertical-align: middle; }
.hc-notes li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.hc-notes li span:first-child { flex: 1; }
@media (max-width: 680px) { .hc-notes li { flex-direction: column; gap: 4px; } }

/* ---- marketing */
.mk-area { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; letter-spacing: .32px; color: var(--text); }
.mk-area i { width: 8px; height: 8px; border-radius: 999px; background: var(--a); flex: none; }
.mk-num { color: var(--muted); font-size: 14px; }
.mk-area-card { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--a); padding: 16px; }
.mk-area-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.mk-area-nums { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 8px; }
.mk-area-nums > div { display: grid; }
.mk-area-nums b { font-size: 20px; font-weight: 400; }
.mk-goal { margin-top: 12px; }
.mk-goal-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 4px; }

/* ---- the content calendar */
.ct-grid .cal-day { min-height: 104px; }
.ct-grid .cal-day.today .cal-num { color: var(--accent); font-weight: 600; }
.ct-chip {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 3px 6px; margin-bottom: 3px; border: 0;
  background: var(--field); color: var(--text); font: inherit; font-size: 12px; text-align: left;
  border-left: 3px solid var(--a);
}
.ct-chip:hover { background: var(--hover); }
.ct-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-chip i { width: 6px; height: 6px; border-radius: 999px; background: var(--a); flex: none; }
.ct-chip.posted { opacity: .65; }
.ct-chip.posted i { background: var(--good); }
.ct-chip.late { border-left-color: var(--danger); }
.ct-loose { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-loose .ct-chip { width: auto; max-width: 260px; }
.ct-line-board { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
.ct-col { background: var(--field); padding: 12px; min-width: 0; }
.ct-col-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ct-card {
  display: grid; gap: 6px; width: 100%; padding: 12px; margin-bottom: 8px; text-align: left; font: inherit;
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--a); color: var(--text);
}
.ct-card:hover { background: var(--hover); }
.ct-card.late { border-left-color: var(--danger); }
.ct-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ct-card-title { font-size: 14px; line-height: 1.29; }
.ct-empty { padding: 8px 0; }
.ct-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.ct-brief { background: var(--field); padding: 12px 16px; margin: 12px 0; }
.ct-line { display: flex; gap: 1px; flex-wrap: wrap; margin-top: 16px; }
.ct-line .btn { flex: 1 1 0; }
@media (max-width: 980px) { .ct-line-board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  .ct-line-board { grid-template-columns: minmax(0, 1fr); }
  .ct-grid .cal-day { min-height: 72px; }
  .ct-chip span { display: none; }
  .ct-chip { width: auto; padding: 4px; }
}

/* ---- outreach */
.or-due { display: grid; gap: 1px; background: var(--border); }
.or-row {
  display: flex; align-items: center; gap: 16px; width: 100%; padding: 12px 16px; text-align: left;
  background: var(--panel); border: 0; border-left: 3px solid var(--a); color: var(--text); font: inherit;
}
.or-row:hover { background: var(--hover); }
.or-row.late { border-left-color: var(--danger); }
.or-when { flex: none; width: 64px; font-size: 13px; font-variant-numeric: tabular-nums; }
.or-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.or-main span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.or-side { flex: none; display: grid; gap: 4px; justify-items: end; text-align: right; }
.or-card { display: grid; gap: 8px; text-align: left; border-left: 3px solid var(--a); }
.or-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.or-card-nums { display: flex; gap: 24px; flex-wrap: wrap; }
.or-card-nums > div { display: grid; }
.or-card-nums b { font-size: 20px; font-weight: 400; }
.or-list-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.or-stats { margin: 16px 0; }
.or-target-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.or-log { background: var(--field); padding: 16px; margin: 16px 0; }
.or-touches li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.ts tr.bad-row td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
@media (max-width: 680px) {
  .or-row { flex-wrap: wrap; gap: 8px; }
  .or-side { justify-items: start; text-align: left; }
  .or-touches li { flex-direction: column; gap: 4px; }
}

/* ---- the ClickUp check: what is wrong, in words */
.cu-diag { border-left: 3px solid var(--good); }
.cu-diag.bad { border-left-color: var(--danger); }
.cu-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cu-checks li { display: flex; align-items: flex-start; gap: 10px; }
.cu-checks li > span:first-child { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; flex: none; }
.cu-checks li > span:first-child svg { width: 12px; height: 12px; }
.cu-checks li.ok > span:first-child { background: var(--good-tint); color: var(--good); }
.cu-checks li.bad > span:first-child { background: var(--danger-tint); color: var(--danger); }
.cu-checks li > span:last-child { display: grid; min-width: 0; }
.cu-checks small { color: var(--muted); overflow-wrap: anywhere; }
/* the person on a quick-added task: narrow, so the title still gets the room */
.inline-add .inline-who { flex: 0 1 200px; min-width: 120px; }
@media (max-width: 680px) { .inline-add .inline-who { flex: 1 1 100%; } }
.add-card .add-who { margin: 8px 0; }

/* ---- checking in */
.ci-card { border-left: 3px solid var(--accent); }
.ci-card.late { border-left-color: var(--danger); }
.ci-card.ok { border-left-color: var(--good); }
.ci-done { display: flex; align-items: center; gap: 16px; }
.ci-time { font-size: 28px; font-variant-numeric: tabular-nums; line-height: 1; }
.ci-done-b { display: grid; gap: 2px; flex: 1; min-width: 0; }
.ci-thumb { width: 56px; height: 56px; object-fit: cover; flex: none; }
@media (max-width: 680px) { .ci-done { gap: 12px; } .ci-time { font-size: 24px; } }/* ---- v1.3.1 segment rename ---- */
/* ---- v1.4.0 lines of work ---- */
.seg-list { list-style: none; margin: 8px 0 0; padding: 0; }
.seg-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.seg-list li:last-child { border-bottom: 0; }
.seg-main { display: flex; flex-direction: column; gap: 2px; min-width: 220px; }
.seg-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--seg, var(--accent)); flex: none; }

/* work scope: roles somebody holds, and the duties each one carries */
a.sc-person { display: block; color: inherit; }
a.sc-person:hover { border-color: var(--accent); text-decoration: none; }
.sc-counts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.sc-roles { display: flex; gap: 8px; flex-wrap: wrap; }
.sc-roles .chip { gap: 6px; border-left: 3px solid var(--c, var(--accent)); }
.sc-role { border-left: 3px solid var(--c, var(--accent)); }
.sc-role .panel-head { align-items: flex-start; gap: 12px; }
.sc-role .panel-head > div { min-width: 0; }
.sc-role .sec-title { margin: 0; }
.sc-duties { display: flex; flex-direction: column; margin: 4px 0 12px; }
.sc-duty { display: flex; align-items: flex-start; gap: 10px; padding: 10px 2px; border-top: 1px solid var(--border); }
.sc-duty:first-child { border-top: 0; }
.sc-tick { flex: none; padding-top: 1px; }
.sc-tick input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--good); }
.sc-duty-main { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sc-duty-title { font-weight: 550; overflow-wrap: anywhere; }
.sc-duty.done .sc-duty-title { color: var(--muted); }
.sc-duty.off .sc-duty-title, .sc-duty.as_needed .sc-duty-title { color: var(--muted); }
.sc-duty-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sc-duty-meta .chip { padding: 1px 8px; font-size: 11.5px; }
/* The day picker stays on one line at 375px: arrows, the date itself, and Today. */
.sc-days { gap: 6px; flex-wrap: nowrap; }
.sc-days .btn.sm { padding: 4px 10px; flex: none; }
.sc-days input[type=date] { flex: 1 1 auto; min-width: 0; }
.sc-detail { overflow-wrap: anywhere; }
.sc-outcome { margin: 0 0 12px; font-size: 13px; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  /* On a phone the counts sit under the name rather than squeezing it to one word per line. */
  .sc-role .panel-head, a.sc-person .panel-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .sc-counts { justify-content: flex-start; }
  .sc-duty { padding: 12px 2px; }
}

/* everyone's leave balances (HR) */
.lv-bal td { vertical-align: top; }
.lv-bal td b { font-size: 15px; font-variant-numeric: tabular-nums; }
.lv-of { display: block; font-size: 11px; line-height: 1.35; margin-top: 1px; }
.lv-detail-row > td { background: var(--hover); padding: 10px 12px; }
.lv-sub { width: 100%; font-size: 12.5px; }
.lv-sub th { font-weight: 600; color: var(--muted); }
.lv-adj { margin: 8px 0 0; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.lv-adj .chip { padding: 1px 8px; font-size: 11.5px; }
.lv-warn {
  margin: 0 0 12px; padding: 12px 16px; border-radius: 8px; font-size: 13px;
  background: color-mix(in srgb, var(--warn) 12%, transparent); border-left: 3px solid var(--warn);
}
@media (max-width: 600px) {
  /* A balance and the sum behind it, rather than eight columns nobody can read on a phone. */
  .lv-bal .lv-of { font-size: 10.5px; }
  .lv-bal th:nth-child(7), .lv-bal td:nth-child(7),
  .lv-bal th:nth-child(8), .lv-bal td:nth-child(8) { display: none; }
}

/* how leave is credited: two ways to run it, one chosen */
.lv-mode { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.lv-mode + .lv-mode { margin-top: 8px; }
.lv-mode:hover { border-color: var(--border-strong); }
.lv-mode.on { border-color: var(--accent); background: var(--accent-tint, var(--hover)); }
.lv-mode input { margin-top: 3px; flex: none; width: 17px; height: 17px; accent-color: var(--accent); }
.lv-mode div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lv-mode span { line-height: 1.45; }

/* what a balance is made of, shown when a person is opened */
.lv-made-of { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.lv-made-of .chip { padding: 2px 9px; font-size: 11.5px; border-left: 3px solid var(--c, var(--accent)); }
/* editing somebody's leave: three ways of saying the same correction */
.tabs.sm { display: inline-flex; gap: 6px; border-bottom: 0; flex-wrap: wrap; }
.tabs.sm .tab {
  height: auto; font-size: 12.5px; padding: 6px 12px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 0;
}
.tabs.sm .tab.active { border-color: var(--accent); background: var(--accent-tint, var(--active)); color: var(--text); }
#ed-sum { min-height: 18px; margin: -4px 0 10px; }

/* the issue portal */
/* Says whose reports are on screen when the list has been narrowed to one person. On a phone the
   picker is off the right edge of the swiped toolbar, so without this the filter is invisible. */
.filter-note { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; color: var(--muted); }
.filter-note .link-btn { padding: 0; min-height: 0; }

.is-list { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.is-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border);
  color: inherit; text-decoration: none;
}
.is-row:first-child { border-top: 0; }
.is-row:hover { background: var(--hover); text-decoration: none; }
.is-kind {
  flex: none; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 4px; background: var(--active); color: var(--muted); min-width: 86px; text-align: center;
}
.is-kind.bug { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }
.is-kind.idea { background: color-mix(in srgb, var(--accent) 13%, transparent); color: var(--accent-text, var(--accent)); }
.is-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.is-main b { overflow-wrap: anywhere; }
.is-meta { overflow-wrap: anywhere; }
.is-one { max-width: 860px; }
.is-detail, .is-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.is-note { border-left: 3px solid var(--accent); }
.is-note p { margin: 4px 0 0; white-space: pre-wrap; }
.is-status { margin-bottom: 12px; }
.is-comments { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.is-c-head { display: flex; align-items: center; gap: 8px; }
.is-c-body { margin: 4px 0 0 30px; white-space: pre-wrap; overflow-wrap: anywhere; }
.is-reply { display: flex; gap: 8px; align-items: flex-end; }
.is-reply textarea { flex: 1; }
@media (max-width: 600px) {
  .is-row { flex-wrap: wrap; gap: 8px; padding: 12px; }
  .is-kind { min-width: 0; }
  .is-main { flex: 1 1 100%; order: 3; }
  .is-reply { flex-direction: column; align-items: stretch; }
}

/* start and stop the clock from My day */
.dr-timer { gap: 6px; padding: 0 10px; }
.dr-timer svg { width: 13px; height: 13px; }
.dr-timer.on { background: var(--danger); border-color: var(--danger); color: #fff; }
.dr-timer.on:hover { background: var(--danger-strong, var(--danger)); }
/* Paused on this row: held, not running. The clock stays so the morning's work is still in view. */
.dr-timer.held { border-color: var(--border); color: var(--muted); }
.dr-timer.held svg { color: var(--muted); }
.dr-timer-t { font-variant-numeric: tabular-nums; min-width: 42px; text-align: left; }

/* photos and files on messages and issues */
.cmp-files { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 8px 0; }
.cmp-file {
  display: inline-flex; align-items: center; gap: 6px; max-width: 220px; padding: 4px 6px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--panel); font-size: 12px;
}
.cmp-file.bad { border-color: var(--danger); color: var(--danger); }
.cmp-file img { width: 28px; height: 28px; object-fit: cover; border-radius: 4px; }
.cmp-file svg { width: 14px; height: 14px; flex: none; }
.cmp-file-n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-clip { flex: none; align-self: flex-end; }
.composer.drop-target { outline: 2px dashed var(--accent); outline-offset: 2px; }

.msg-files, .is-files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.msg-img img, .is-img img {
  max-width: 260px; max-height: 260px; border-radius: 8px; border: 1px solid var(--border); display: block;
}
.is-img img { max-width: 320px; max-height: 320px; }
.msg-file, .is-file {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--panel); color: inherit; font-size: 13px; max-width: 320px;
}
.msg-file:hover, .is-file:hover { border-color: var(--accent); text-decoration: none; }
.msg-file svg, .is-file svg { width: 15px; height: 15px; flex: none; }
.msg-file span:not(.muted), .is-file span:not(.muted) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) {
  .msg-img img { max-width: 200px; max-height: 200px; }
  .is-img img { max-width: 100%; }
}

/* the task's own number, wherever a task is listed */
.task-id {
  flex: none; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums;
  letter-spacing: .01em; user-select: all;
}
.card-title .task-id { font-weight: 400; margin-right: 2px; }
.is-done .task-id { opacity: .6; }
@media (max-width: 640px) {
  /* It stays on a phone. Being able to quote a number is the whole point of having one, and a
     phone is where somebody is most likely to be reading one out. */
  .task-id { font-size: 11px; }
}

/* a refresh that shows it is doing something */
@keyframes spin-once { to { transform: rotate(360deg); } }
.btn.spin svg { animation: spin-once .6s linear; }

/* On a phone it spans the gutters, still centred, and sits above the home indicator. */
@media (max-width: 640px) {
  #toasts { left: 12px; right: 12px; transform: none; bottom: 12px; align-items: center; }
  .toast { max-width: 100%; }
}

/* the two counts on the People page double as filters */
.pp-flag { border: 1px solid transparent; cursor: pointer; font: inherit; font-size: 11.5px; font-weight: 600; }
.pp-flag:hover { border-color: currentColor; }
.pp-flag.on { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }

/* a menu explaining itself: a sentence, not a label */
.menu-note { font-size: 12px; color: var(--muted); padding: 2px 10px 8px; line-height: 1.45; white-space: normal; }

/* photos and files chosen while a task is being written */
.nt-files-row { display: flex; gap: 8px; flex-wrap: wrap; }
.nt-files-row .btn { cursor: pointer; }
.nt-files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
/* The camera button is only meaningful where there is a camera to open. */
@media (hover: hover) and (pointer: fine) { .nt-cam { display: none; } }

/* choosing the task a sub-task belongs to */
/*
 * min-width: 0 again, and the reason dialogs need watching as much as pages: the task titles in
 * this list are long and would not give way, so switching to "a sub-task" grew the whole dialog to
 * 575px on a 320px screen and carried Create and Cancel off the edge with it.
 */
.nt-parent-list { max-height: 180px; overflow-y: auto; overflow-x: hidden; min-width: 0; max-width: 100%; border: 1px solid var(--border); border-top: 0; }
.nt-parent-item { min-width: 0; max-width: 100%; }
.nt-parent-list:empty { display: none; }
.nt-parent-item {
  display: flex; align-items: baseline; gap: 8px; width: 100%; border: 0; background: none;
  padding: 7px 10px; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.nt-parent-item + .nt-parent-item { border-top: 1px solid var(--border); }
.nt-parent-item:hover { background: var(--hover); }
.nt-parent-item.on { background: var(--active); font-weight: 600; }
.nt-parent-item span:last-child { overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- Test & Demo
   Built for a field first: big targets, one question per line, nothing that needs
   two hands or a steady surface. The desk view is the same thing, wider. */
.ts-cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); margin-top: 12px; align-items: stretch; }
/* Cards in a row share a baseline: the button sits on the bottom edge of each, not wherever that
   card's text happened to end. */
.ts-cards > .ts-card { height: 100%; }
.ts-card { background: var(--panel); border: 1px solid var(--border); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.ts-card-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ts-card-t { margin: 0; font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
.ts-card-m { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ts-open { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.ts-open .btn { min-height: 40px; }

.ts-rows { display: flex; flex-direction: column; }
.ts-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 11px 4px;
  text-align: left; font: inherit; color: inherit; cursor: pointer; border-top: 1px solid var(--border); }
.ts-row:first-child { border-top: 0; }
.ts-row:hover { background: var(--hover); }
.ts-row-t { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ts-waiting { border-left: 3px solid var(--warn); }
.ts-note { margin: 8px 0 0; }

.ts-run .ts-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.ts-sub { margin: 18px 0 6px; font-size: .95rem; }
.ts-checks { display: flex; flex-direction: column; margin-top: 8px; }
.ts-check { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.ts-check:first-child { border-top: 0; }
.ts-check-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 180px; }
.ts-check-b { flex: none; }
.ts-check-b .tab { min-height: 40px; min-width: 56px; }
.ts-check.answered .ts-check-l b { color: var(--muted); }

.ts-aims { display: flex; flex-direction: column; gap: 8px; }
.ts-aim { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
.ts-aim input[type=checkbox] { width: 22px; height: 22px; flex: none; }
.ts-aim .input.sm { flex: 1 1 140px; max-width: 220px; height: 40px; }
/*
 * It said width: 100%, which on a phone is right and on a 1600px monitor is a band of blue across
 * the whole screen. A button is as wide as it needs to be; on a narrow screen that happens to be
 * the whole width.
 */
.btn.big { width: 100%; max-width: 420px; min-height: 52px; font-size: 1rem; margin-top: 16px; }

.ts-results { display: flex; flex-direction: column; }
.ts-result { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(90px, 1.2fr) minmax(70px, .8fr);
  gap: 10px; align-items: baseline; padding: 10px 0; border-top: 1px solid var(--border); }
.ts-result:first-child { border-top: 0; }
.ts-hit { color: var(--good); font-weight: 600; }
.ts-miss { color: var(--warn); font-weight: 600; }
.ts-damage { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--danger); background: var(--danger-tint); }
.ts-damage p { margin: 4px 0 0; overflow-wrap: anywhere; }
.ts-notes { margin-top: 10px; overflow-wrap: anywhere; }
.ts-hold { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; padding: 10px 12px;
  border-left: 3px solid var(--warn); background: var(--warn-tint); color: var(--text); }
.ts-hold svg { flex: none; }
.ts-row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ts-give-up { margin-top: 16px; text-align: center; }

.ts-slot { padding: 12px 0; border-top: 1px solid var(--border); }
.ts-slot:first-of-type { border-top: 0; }
.ts-slot.wanted { border-left: 3px solid var(--warn); padding-left: 10px; }
.ts-slot-h { display: flex; flex-direction: column; gap: 2px; }
.ts-slot-files { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.ts-file { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); padding: 4px 6px; max-width: 100%; }
.ts-file img { width: 44px; height: 44px; object-fit: cover; flex: none; }
.ts-file a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.ts-slot-b { display: flex; gap: 8px; flex-wrap: wrap; }
.ts-slot-b .btn { min-height: 44px; }

@media (max-width: 640px) {
  .ts-cards { grid-template-columns: 1fr; }
  /* Stacked on a phone: the label must not stretch, or it pushes its own buttons off the screen. */
  .ts-check { flex-direction: column; align-items: stretch; gap: 8px; }
  .ts-check-l { flex: none; }
  .ts-check-b { display: flex; }
  .ts-check-b .tab { flex: 1 1 0; }
  .ts-result { grid-template-columns: 1fr 1fr; }
  .ts-result b { grid-column: 1 / -1; }
}

/* An issue that turned out to be one already on the list. */
.is-dup-of { border-left: 3px solid var(--border-strong); }
.is-dup-of p { margin: 4px 0 0; }
.is-maybe { border-left: 3px solid var(--warn); background: var(--warn-tint); }
.is-maybe-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 0; border-top: 1px solid var(--border); }
.is-maybe-row a { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.is-maybe-row .btn { flex: none; }

/* Where TaskHub's space membership disagrees with ClickUp's. */
.cu-mem { padding: 10px 0; border-top: 1px solid var(--border); }
.cu-mem:first-of-type { border-top: 0; }
.cu-mem p { margin: 4px 0 0; overflow-wrap: anywhere; }
.cu-mem-do { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* A menu entry that is shown but cannot be chosen, with the reason under it. */
.menu-item.is-off { opacity: .6; cursor: not-allowed; }
.menu-item.is-off:hover { background: none; }
.menu-item .mi-why { display: block; font-size: .78rem; color: var(--muted); line-height: 1.25; white-space: normal; }
.menu-item .mi-label { display: block; min-width: 0; }

/* ---- what a phone actually showed.
   Found by rendering every screen at 320px, which is what an iPhone reports when Display Zoom is
   on — and what several of the team are using. */

/* The crumb trail and the page title were sharing 140px and drawing on top of each other, because
   text-overflow cannot ellipsise the children of a flex row. On a narrow screen only the page you
   are on is named; the trail is no loss, since the hamburger and the back arrow both remain. */
.topbar-title { flex: 0 1 auto; min-width: 0; }
/* Each crumb keeps what spills inside itself. Without this the link's own nowrap text ran straight
   out of its box and was painted over the page title next to it. */
.bc li { overflow: hidden; }
/* A flex box cannot be ellipsised — the dots never appear and the words are simply chopped. The
   crumb you are on is a block for that one reason. */
.bc li[aria-current="page"] { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  /* Only where you are. The trail costs more than it gives at this width, and both the hamburger
     and the screen's own back arrow still go back. */
  .bc li:not([aria-current="page"]) { display: none; }
  .bc li + li::before { content: none; }
}

/* Four notifications stacked up a 568px screen cover the thing you came to read. Two is a nudge;
   the rest wait in the bell, which is where they were going anyway. */
@media (max-width: 680px) {
  #notif-pops { left: 8px; right: 8px; max-height: 45vh; }
  #notif-pops > :nth-child(n+3) { display: none; }
}

/* Belt and braces: nothing inside a dialog may stretch it past the screen. Content that will not
   shrink is the usual cause, and it is better caught here than found later on somebody's phone. */
.modal { max-width: 100vw; }
.modal-body { min-width: 0; max-width: 100%; overflow-x: hidden; }

/* The three places that still ran off the side of a 320px screen, where the part that went over
   the edge could not be scrolled to and so was simply gone. */
@media (max-width: 680px) {
  /* The month, the arrows and "Today" shared one unwrapping row, and "Today" fell off it. */
  .cal-bar { flex-wrap: wrap; row-gap: 8px; }
  .cal-bar h2 { min-width: 0; flex: 1 1 auto; text-align: left; }

  /* The workload legend is three labels and three swatches held on one line by white-space: nowrap. */
  .wl-key { margin-left: 0; white-space: normal; }

  /* A storage path is one long unbroken word, and no amount of flex makes room for it. */
  .settings code.mono, code.mono { overflow-wrap: anywhere; word-break: break-word; }
  .settings li { flex-wrap: wrap; row-gap: 8px; }

  /* The same flex trap as the composer: a long tag name would not give way, so Delete was pushed
     off the right of the row and could not be reached. */
  .tag-admin-row { min-width: 0; }
  /* The tag's own name is the only thing here that can afford to give way; the swatch and the two
     buttons are all fixed. Without min-width: 0 it gave way to nothing and pushed Delete off. */
  .tag-admin-row > .tag-chip { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tag-admin-row > .grow { min-width: 0; }
  .tag-admin-row > .icon-btn { flex: none; }
}

/* ---- thumbs.
   Measured on every screen at 320px, counting the area a finger actually has to hit rather than
   the size of the thing drawn: a control inside a label is as big as its label, and one already
   given a reach-past area is as big as that. 44px is the floor. */
@media (max-width: 680px) {
  /* The small sizes were two and four pixels short across roughly forty controls. */
  .btn.sm, .input.sm, select.input.sm { height: 44px; }
  .swatch.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }

  /*
   * These keep the size they are drawn at and reach past it instead, which is the pattern the
   * status dot already used. Growing them outright would have pushed the buttons in a dense row —
   * a tag with its colour, two icons and its name — back off the edge of the screen.
   */
  .icon-btn.tiny, .swatch, .add-btn { position: relative; }
  .icon-btn.tiny::after, .swatch::after {
    content: ''; position: absolute; inset: -4px;
  }
  /* The dot was reaching 40px; four short. Dots sit 8px apart, so this still does not overlap. */
  .status-dot::after { inset: -10px; }

  /* A standalone row button with nothing beside it can simply be taller. */
  .add-btn { min-height: 44px; }
  .pp-flag, button.badge { min-height: 44px; }
  .chip, .chip-toggle { min-height: 44px; }
  /* A label is the target for the box inside it, so the label is what has to be big enough. */
  label.check-line { min-height: 44px; }
  /* An inline text button keeps its place on the line and reaches above and below it instead. */
  .link-btn { padding-block: 14px; margin-block: -14px; }
  .link-btn.small { padding-block: 15px; margin-block: -15px; }
  /* A select that a view styles itself can still land under the floor; this is the floor. */
  select.input, .view select { min-height: 44px; }
  /* A workload chip opens a person's day; it was four pixels short. */
  .wl-chip { min-height: 44px; }
  /* Width counts as much as height: an icon-only button was 26px across. */
  .btn.sm, .icon-btn { min-width: 44px; }

  /*
   * Left alone on purpose: a task chip in the month grid is 20px tall, and giving it a thumb's
   * worth of height would make a month of them taller than the screen. The chip is a marker of
   * what is on that day, and the day cell behind it opens the day — so the small target has a big
   * one behind it. Week view lists the same tasks at full size.
   */

  /*
   * The row checkbox was the smallest thing in the app at 20px, and the only one not helped by a
   * label, so it is drawn by hand: an 18px box inside a target twice its height. The negative
   * margins keep the row exactly where it was.
   */
  /* Typed selector on purpose: `input[type="checkbox"]` above sets a 20px box and outranks a bare
     class whatever the order, so matching its specificity is the only way through. */
  input[type="checkbox"].row-check {
    appearance: none; -webkit-appearance: none;
    width: 34px; height: 44px; margin: -12px -8px -12px -8px;
    display: grid; place-content: center; background: none; border: 0; cursor: pointer; opacity: 1;
  }
  input[type="checkbox"].row-check::before {
    content: ''; width: 18px; height: 18px; border-radius: 2px;
    border: 2px solid var(--border-strong); background: var(--panel);
  }
  input[type="checkbox"].row-check:checked::before {
    background: var(--accent); border-color: var(--accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E");
    background-size: 13px; background-position: center; background-repeat: no-repeat;
  }
  input[type="checkbox"].row-check:focus-visible { outline: 2px solid var(--accent); outline-offset: -8px; }
}
/* Rating stars are deliberately left at 36px: they sit 2px apart, so reaching past them would make
   each star steal its neighbour's tap and record the wrong score. Wrong is worse than small. */

/* ---- Carbon inline notification, for everything that fails outside a dialog.
   Pinned to the top of the work area rather than written into the page, because a view redraws
   itself after a failed save and would take the message with it. Above the drawer, so a refusal
   from inside the drawer is still readable. */
#err-host {
  position: fixed; z-index: 60; top: 50px; left: 0; right: 0;
  display: flex; justify-content: center; pointer-events: none;
  padding: 10px max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px));
}
/* Clear of the sidebar on wide screens, which is 250px per .shell's own grid. */
@media (min-width: 861px) { #err-host { left: 250px; } }

.inline-note {
  pointer-events: auto; display: flex; align-items: flex-start; gap: 12px;
  width: min(560px, 100%); padding: 14px 12px 14px 14px;
  background: var(--danger-tint); border-left: 3px solid var(--danger); color: var(--text);
  box-shadow: var(--shadow-lg); animation: errIn .16s ease-out;
}
@keyframes errIn { from { opacity: 0; transform: translateY(-6px); } }
.inline-note .in-icon { flex: none; color: var(--danger); line-height: 0; margin-top: 1px; }
.inline-note .in-body { flex: 1 1 auto; min-width: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.inline-note .in-body b { display: block; margin-bottom: 2px; }
.inline-note .in-x { flex: none; margin: -6px -4px 0 0; }

@media (max-width: 680px) {
  /* On a phone it spans the width under the top bar, where the eye already is. */
  #err-host { top: 50px; left: 0; }
  .inline-note { width: 100%; }
}

/* ---- the Team row.
   It was a flat wrapping flex of up to fourteen conditional children, so no two people's rows had
   the same shape and nothing lined up down the page.

   The grid belongs to the LIST, not to each row: a row that owns its own grid sizes its columns to
   its own contents, so every person still ended up different. One grid over all the rows, with the
   rows going `display: contents` so their cells become the grid's own children, is what makes a
   column a column. The tracks are `auto`, so each one is as wide as the widest thing in it across
   everybody — which is also what makes it respond to the content instead of to a number I guessed. */
.people {
  display: grid;
  grid-template-columns:
    minmax(200px, 2fr)  /* who */
    auto                /* reports to */
    auto                /* role */
    auto                /* spaces / sees */
    auto                /* access */
    auto                /* daily report */
    auto;               /* actions */
  /*
   * stretch, not center. Centring makes each cell keep its own content height and sit in the middle
   * of the row — so a name block taller than its row overflowed it and was drawn over the controls
   * underneath. Stretching lets the row grow to its tallest cell; the cells centre their own
   * contents themselves.
   */
  align-items: stretch;
  column-gap: 14px;
}
.person { display: contents; }
.person > * { border-top: 1px solid var(--border); padding: 16px 0; min-width: 0; display: flex; align-items: center; }
.person:first-child > * { border-top: 0; }
.person.inactive > * { opacity: .6; }

/*
 * No percentage width here. A percentage on a grid item makes the grid's intrinsic row height
 * indeterminate: it measured this cell at 32px while its contents were 77px, then stretched the
 * cell to the 32px row and let the name and badges spill over the controls below. The name column
 * is held open by person-b's flex-grow instead, which does not confuse the row sizing.
 */
.tm-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tm-cell { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tm-cell > label { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tm-cell select { min-width: 0; }
.tm-act, .tm-sees { justify-content: flex-end; gap: 6px; flex-wrap: wrap; }
.tm-lab { display: none; }
/* flex: 1 matters — without it the name column collapses to the width of the avatar and the name
   is clipped away entirely, which is how it was lost the first time this was rewritten. */
.person-b { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.person-b b, .person-b span:not(.tm-badges) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.tm-badges:empty { display: none; }

/* Below this the seven columns stop earning their width, and each person becomes a card. The
   controls keep their own labels, because there is no column header to name them. */
@media (max-width: 1100px) {
  /*
   * A card per person, laid out as a flex column rather than a grid. Grid was fighting itself
   * here: sizing a row from a flex child's intrinsic height gave a 32px row holding 77px of
   * content, which then spilled over the controls below. A column has no row sizing to get wrong.
   */
  .people { display: flex; flex-direction: column; gap: 0; }
  .person {
    display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 12px;
    padding: 16px 0; border-top: 1px solid var(--border);
  }
  .person:first-child { border-top: 0; }
  .person > * { border-top: 0; padding: 0; display: flex; align-items: center; }
  .person.inactive { opacity: .6; }
  .person.inactive > * { opacity: 1; }
  .tm-who { align-items: flex-start; }
  .tm-cell:empty { display: none; }
  .tm-lab { display: block; font-size: 12px; color: var(--muted); flex: none; min-width: 86px; }
  .tm-cell > label { flex: 1 1 auto; flex-wrap: wrap; }
  .tm-cell select, .tm-cell > label > select { flex: 1 1 140px; }
  .tm-act, .tm-sees { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
  .person-b b, .person-b span:not(.tm-badges) { white-space: normal; overflow: visible; }
}

/* ---- a run has a measure.
   The checks, their Yes/No/N/A and the button that ends the run were spread across the full width
   of whatever monitor they were opened on, so a question sat on the left and its answer a foot
   away on the right. Reading and answering want the same column. */
.ts-run .page-h, .ts-run > section, .ts-run > .ts-give-up { max-width: 820px; }
.ts-run { padding-bottom: 24px; }

/* ---- vertical rhythm.
   `p { margin: 0 }` is the right reset, but it left every explanatory line sitting flush against
   whatever came after it — the line under "Balance 2026-27" touched the cards with a gap of
   exactly zero, and seven more like it across the app. A paragraph with something after it gets
   room beneath; the last one in a box does not, so no box grows a mystery gap at its foot.
   Scoped to page content and dialogs: inside menus, toasts and rows a paragraph is a line of a
   component, not a paragraph of prose. */
.view p:not(:last-child),
.modal-body p:not(:last-child) { margin-bottom: 12px; }

/* The places a paragraph really is just a line in a component. */
.menu p, .toast p, .inline-note p, .task-row p, .person p, .is-row p,
.lv-card p, .stat p, .ts-card p, .sop-card p, .att-card p,
.page-title-row p, .pr-badges p { margin-bottom: 0; }

/* A page title and its one-line subtitle are a pair; they stay close. */
.page-head h1 + p, .page-h h1 + p { margin-top: 4px; }

/* ---- the header on a phone.
   My work opened with four stacked rows before the first number: greeting, the Task button, the
   Week/Month/Year segment, "Group by" on a full-width row of its own, and "All statuses" pushed
   onto a third. About a quarter of the screen spent before any content.

   The filters become one row you swipe, which is what the tab strips and chip rows in this app
   already do. The "Group by" label goes with it: the select reads "Due date", which says the same
   thing in the space of a control rather than a control plus a caption. Its aria-label stays, so
   it is still named for anyone not reading the screen. */
@media (max-width: 680px) {
  .page-head > .toolbar {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    margin-top: 12px; padding-bottom: 2px;
  }
  .page-head > .toolbar::-webkit-scrollbar { display: none; }
  .page-head > .toolbar > * { flex: 0 0 auto; }
  .page-head > .toolbar > .inline-field { flex: 0 0 auto; width: auto; flex-wrap: nowrap; }
  .page-head > .toolbar > .inline-field > span { display: none; }
  .page-head > .toolbar > .inline-field .input { width: auto; min-width: 132px; }
}

/* ---- the room header on a phone.
   Back button, room icon and "Open space" took 174px of a 320px screen, leaving 92px for the room
   name — so "Production Line - Drone building" wrapped onto four lines and the header grew to
   129px, a quarter of the screen, above the conversation you came to read.

   The name and the line under it each take one line and ellipsise. "Open space" steps aside: it is
   a secondary way to somewhere the sidebar already reaches, and on a phone it was costing a third
   of the width of the title. */
@media (max-width: 680px) {
  .chat-head { align-items: center; }
  .chat-head-b { min-width: 0; }
  .chat-head-b > b,
  .chat-head-b > span { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chat-head > a.btn.sm { display: none; }
}

/* ---- Workload, by person.
   The grid above forecasts hours. This half shows what each person is actually holding, how much
   has gone into it, and how long since anyone touched it. */
.wd-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 16px 0 24px; }
.wd-person {
  display: flex; flex-direction: column; gap: 8px; align-items: stretch; text-align: left;
  padding: 16px; border: 1px solid var(--border); background: var(--panel); color: inherit;
  cursor: pointer; min-width: 0;
}
.wd-person:hover { border-color: var(--border-strong); }
.wd-person.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.wd-p-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wd-p-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.wd-p-n { font-size: 30px; font-weight: 300; line-height: 1.1; font-variant-numeric: tabular-nums; }
.wd-p-n small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.wd-p-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wd-p-foot { border-top: 1px solid var(--border); padding-top: 8px; }

.wd-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.wd-head h2 { margin: 0; }
.wd-pick { margin-top: 24px; }

.wd-tasks { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-top: 12px; }
.wd-task {
  display: flex; flex-direction: column; gap: 8px; align-items: stretch; text-align: left;
  padding: 16px; border: 1px solid var(--border); border-left: 3px solid var(--border-strong);
  background: var(--panel); color: inherit; cursor: pointer; min-width: 0;
}
.wd-task:hover { border-color: var(--border-strong); background: var(--hover); }
.wd-task.late { border-left-color: var(--danger); }
.wd-t-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wd-t-title { font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.wd-t-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 8px; }
.wd-time { font-variant-numeric: tabular-nums; font-weight: 600; }
.wd-time.none { font-weight: 400; color: var(--faint); }
/* How long since anybody touched it — the number this screen exists for. */
.wd-touch { font-size: 12px; }
.wd-touch.warm { color: var(--good); }
.wd-touch.cool { color: var(--warn); }
.wd-touch.cold { color: var(--danger); font-weight: 600; }

@media (max-width: 680px) {
  .wd-people, .wd-tasks { grid-template-columns: minmax(0, 1fr); }
  /* The spacer that pushes the day picker right on desktop just strands it mid-row once
     the header wraps, so drop it and let everything sit on the left margin. */
  .wd-head { display: block; }
  .wd-head .grow { display: none; }
  .wd-head .inline-field { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
}

/* ---- The bell's two tabs (SuperAdmins only). */
/* The panel is a flex column whose list takes the slack, so these two must refuse to shrink —
   left to itself the strip collapses to a few pixels while still holding 40px buttons. */
.notif-tabs { margin: 0 12px 8px; display: flex; flex: none; }
.notif-tabs button { flex: 1 1 0; min-width: 0; }
.nt-count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; line-height: 18px; font-variant-numeric: tabular-nums;
}
.notif-tabs button.on .nt-count { background: rgba(255, 255, 255, 0.28); }
.notif-note { margin: 0 12px 8px; flex: none; }

/* ---- Late days. Four narrow columns and one of prose, so the blanket 720px the timesheet
   tables carry only forces a scrollbar; the reason is the column that should take the slack. */
.ts.ci-late, .ts.rv-late { min-width: 0; }
.ts.ci-late td:last-child, .ts.rv-late td:last-child { text-align: left; white-space: normal; min-width: 0; }
.ts.ci-late th:last-child, .ts.rv-late th:last-child { text-align: left; }
@media (max-width: 480px) {
  /* Four columns and a sentence will not fit a 320px phone at the full 12px gutter, and this is a
     table people read on the way in to work. Tighter cells, and let the day and the badge wrap. */
  .ts.ci-late th, .ts.ci-late td, .ts.rv-late th, .ts.rv-late td { padding: 10px 6px; white-space: normal; }
  /* .ts-task carries a 220px floor for the task column it was built for; here it is the reason,
     and a floor wider than the phone is what pushed the table off the screen. */
  .ts.ci-late .ts-task, .ts.rv-late .ts-task { min-width: 0; }
  .ts.ci-late .badge, .ts.rv-late .badge { white-space: normal; }
}

/* ---- v1.46.0 attendance trends ---- */
.at-chart { display: flex; align-items: flex-end; justify-content: flex-start; gap: 4px; height: 140px; margin: 12px 0 4px; overflow-x: auto; padding-bottom: 2px; }
/* A bar is its own column: the fill grows from the bottom, the date sits under it. */
/* Capped, or a month five days in would draw five bars the width of the page. */
.at-bar { flex: 1 1 0; min-width: 14px; max-width: 56px; height: 100%; display: flex; flex-direction: column; gap: 4px; }
/* The track is what a percentage height is measured against, so the date label underneath keeps
   its room instead of being pushed off by a full-height bar. */
.at-bar-track { flex: 1 1 auto; display: flex; align-items: flex-end; }
.at-bar-fill { width: 100%; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 2px; }
.at-bar.good .at-bar-fill { background: var(--good, #008844); }
.at-bar.warn .at-bar-fill { background: var(--warn, #d98300); }
.at-bar.none .at-bar-fill { background: var(--border); }
.at-bar-x { font-size: 10px; color: var(--muted, #87909e); text-align: center; font-variant-numeric: tabular-nums; }
.sec-h { margin: 32px 0 4px; }
/* Three bar colours mean three things, and a colour on its own is not a label. */
.at-key { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 0; }
.at-key-i { width: 10px; height: 10px; border-radius: 2px; background: var(--brand); margin-left: 8px; }
.at-key-i:first-child { margin-left: 0; }
.at-key-i.good { background: var(--good, #008844); }
.at-key-i.warn { background: var(--warn, #d98300); }

/* ---- v1.49.0: a menu item that is a setting, not a choice ---- */
.menu-item .mi-box { width: 16px; height: 16px; flex: 0 0 auto; margin-right: 8px; border: 1px solid var(--border); border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.menu-item .mi-box svg { width: 12px; height: 12px; opacity: 0; }
.menu-item.checked .mi-box { background: var(--brand); border-color: var(--brand); }
.menu-item.checked .mi-box svg { opacity: 1; }
/* The box is the state now, so the tick at the far end would say it twice. */
.menu-item.has-box .mi-check { display: none; }
.menu-item.is-off .mi-box { opacity: 0.55; }

/* ---- v1.51.0: the check-in photo that follows the press ---- */
.ci-owed { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 12px; border: 1px solid var(--warn, #d98300); border-radius: 6px; }
.ci-owed p { margin: 0; flex: 1 1 200px; }

.ts th.num { text-align: right; }

/* A photo flag in the team's day that can be pressed to see the photo. */
.ph-flag.is-btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 10px; min-height: 22px; padding: 2px 7px; }
.ph-flag.is-btn:hover { filter: brightness(1.08); text-decoration: underline; }
.ph-flag.is-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
