/* Timebook — app shell: fixed left sidebar, scrolling work area. Quiet neutrals, one iris accent, tinted status chips. */
:root {
  --bg: #f6f6f8; --surface: #ffffff; --surface-2: #f9f9fb; --hover: #f2f2f6;
  --fg: #17171c; --fg2: #50505c; --muted: #8a8a96;
  --line: #ebebf0; --line2: #dcdce3;
  --accent: #5b5bd6; --accent-hover: #4b4bc4; --accent-fg: #ffffff; --accent-soft: #eeeefc; --accent-ink: #4545b8;
  --s-meter: #9fc4ee; --s-up: #2a78d6; --s-man: #1baf7a; --s-non: #eb6834; --s-rework: #d4537e; --s-idle: #e9e9ef; --s-idle-ink: #c9c9d3;
  --good: #0ca30c; --good-ink: #0b7a2a; --warn: #fab219; --warn-ink: #8a5a00; --serious: #ec835a; --serious-ink: #b2471c; --crit: #d03b3b; --crit-ink: #c02d2d;
  --shadow: 0 1px 2px rgba(20, 20, 40, .04), 0 1px 1px rgba(20, 20, 40, .02);
  --shadow-lg: 0 12px 32px -12px rgba(20, 20, 40, .18), 0 2px 6px rgba(20, 20, 40, .05);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --r: 12px; --r-sm: 8px; --side: 236px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0e0e11; --surface: #16161a; --surface-2: #1b1b20; --hover: #212127;
  --fg: #ededf0; --fg2: #b3b3bd; --muted: #7e7e8a; --line: #25252c; --line2: #33333b;
  --accent: #8c8cf3; --accent-hover: #a0a0f6; --accent-fg: #101018; --accent-soft: #23233f; --accent-ink: #b0b0fa;
  --s-meter: #2d5585; --s-up: #3987e5; --s-man: #199e70; --s-non: #d95926; --s-rework: #c2416d; --s-idle: #24242b; --s-idle-ink: #3a3a44;
  --good-ink: #3fcf5e; --warn-ink: #fab219; --serious-ink: #f09a76; --crit-ink: #f07272;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 40px -12px rgba(0, 0, 0, .6);
  color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0e0e11; --surface: #16161a; --surface-2: #1b1b20; --hover: #212127;
  --fg: #ededf0; --fg2: #b3b3bd; --muted: #7e7e8a; --line: #25252c; --line2: #33333b;
  --accent: #8c8cf3; --accent-hover: #a0a0f6; --accent-fg: #101018; --accent-soft: #23233f; --accent-ink: #b0b0fa;
  --s-meter: #2d5585; --s-up: #3987e5; --s-man: #199e70; --s-non: #d95926; --s-rework: #c2416d; --s-idle: #24242b; --s-idle-ink: #3a3a44;
  --good-ink: #3fcf5e; --warn-ink: #fab219; --serious-ink: #f09a76; --crit-ink: #f07272;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 40px -12px rgba(0, 0, 0, .6);
  color-scheme: dark; }

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "ss01"; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num, .kpi-val, .t td.r { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
h1 { font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: -0.025em; margin: 0; text-wrap: balance; }
h2 { font-size: 14px; font-weight: 500; letter-spacing: -0.005em; margin: 0; }
.sub, .head p { color: var(--muted); }
.head p { margin: 4px 0 0; font-size: 14px; }
.ico { font-size: 9px; line-height: 1; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- shell ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: calc(18px + env(safe-area-inset-top, 0px)) 12px calc(14px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; color: var(--fg); text-decoration: none; font-weight: 650; font-size: 16px; letter-spacing: -0.02em; }
.brand-mark { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; }
.brand-mark svg.i { width: 15px; height: 15px; stroke-width: 2.2; }
.nav { display: grid; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 500; color: var(--muted); padding: 14px 10px 6px; text-transform: uppercase; letter-spacing: .06em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); color: var(--fg2); text-decoration: none; font-weight: 500; }
.nav a:hover { background: var(--hover); color: var(--fg); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); }
.nav a .badge { margin-left: auto; }
.me { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 6px 0; display: grid; gap: 8px; }
.me-row { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; border-radius: 8px; }
a.me-row { padding: 4px; margin: -4px; }
a.me-row:hover { background: var(--hover); }
a.me-row:hover b { color: var(--accent-ink); }
.me-row div { min-width: 0; }
.me-row b { display: block; font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-row small { color: var(--muted); font-size: 12px; }
.me-links { display: flex; gap: 4px; }
.me-links a, .me-links button { flex: 1; text-align: center; font-size: 12px; padding: 5px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--fg2); text-decoration: none; }
.me-links a:hover, .me-links button:hover { background: var(--hover); color: var(--fg); }
.me-links form { flex: 1; display: flex; }

.wrap { margin-left: var(--side); padding: 28px max(32px, env(safe-area-inset-right, 0px)) 64px 32px; display: grid; gap: 18px; max-width: calc(1240px + var(--side)); }
.wrap > * { min-width: 0; }
.guest .side { display: none; }
.guest .wrap { margin-left: 0; max-width: none; }

@media (max-width: 860px) {
  .side { position: sticky; inset: auto; top: 0; width: auto; height: auto; flex-direction: row; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: calc(10px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 10px max(14px, env(safe-area-inset-left, 0px)); border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0; flex: 1; }
  .nav { order: 3; width: 100%; display: flex; overflow-x: auto; scrollbar-width: none; gap: 4px; margin: 0 -4px; }
  .nav a { white-space: nowrap; padding: 6px 10px; }
  .nav-label { display: none; }
  .me { margin: 0; border: 0; padding: 0; display: flex; align-items: center; }
  .me-row div { display: none; }
  .me-links a, .me-links button { flex: none; }
  .wrap { margin-left: 0; padding: 18px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px)); }
}

/* ---------- page header & period bar ---------- */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px 20px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 13px; }
.back:hover { color: var(--fg); }
.pbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--hover); border-radius: 10px; }
.seg a, .seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; color: var(--fg2); text-decoration: none; font-weight: 500; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg a:hover { color: var(--fg); }
.seg [aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: var(--shadow), 0 0 0 1px var(--line); }
.ibtn { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line2);
  background: var(--surface); color: var(--fg); text-decoration: none; font-weight: 500; font-size: 13px; box-shadow: var(--shadow); }
a.ibtn:hover { background: var(--hover); }
.ibtn[aria-disabled="true"] { opacity: .4; box-shadow: none; }
.plabel { font-weight: 600; min-width: 150px; text-align: center; font-size: 13px; }

/* ---------- cards, KPIs ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 4px; box-shadow: var(--shadow); }
.kpi-label { font-size: 12.5px; color: var(--fg2); display: flex; align-items: center; gap: 7px; font-weight: 500; }
.kpi-val { font-size: 26px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.15; }
.kpi-val small { font-size: 13px; color: var(--muted); font-weight: 400; margin-left: 3px; letter-spacing: 0; }
.kpi-sub { font-size: 12px; color: var(--muted); }
.sw { width: 9px; height: 9px; border-radius: 3px; flex: none; display: inline-block; }

/* ---------- charts ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--fg2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; }
.tip { position: absolute; pointer-events: none; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 12px; min-width: 180px; z-index: 3; box-shadow: var(--shadow-lg); }
.tip b { display: block; margin-bottom: 6px; font-weight: 600; }
.tip div { display: flex; justify-content: space-between; gap: 12px; color: var(--fg2); }
.tip div span:first-child { display: inline-flex; align-items: center; gap: 6px; min-width: 0; line-height: 1.4; }
.tip div span.num { white-space: nowrap; flex: none; align-self: flex-start; line-height: 1.4; }
.tip div + div { margin-top: 3px; }
.tip .tip-sub { margin: 1px 0 7px; color: var(--muted); font-size: 11.5px; line-height: 1.4; white-space: pre-line; }
.tip .tip-sub:last-child { margin-bottom: 0; }

/* ---------- tables ---------- */
.tscroll { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: 0; }
.t th.r, .t td.r { text-align: right; }
.sort-h { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; color: inherit; font: inherit; border-radius: 4px; }
.sort-h:hover { color: var(--fg); }
.sort-h:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sort-i { width: 8px; height: 10px; flex: none; opacity: .35; background: currentColor; clip-path: polygon(50% 0, 100% 40%, 0 40%, 0 60%, 100% 60%, 50% 100%); }
th[aria-sort="ascending"] .sort-h, th[aria-sort="descending"] .sort-h { color: var(--fg); }
th[aria-sort="ascending"] .sort-i { opacity: 1; clip-path: polygon(50% 0, 100% 55%, 0 55%); }
th[aria-sort="descending"] .sort-i { opacity: 1; clip-path: polygon(0 45%, 100% 45%, 50% 100%); }
.t td.r { white-space: nowrap; }
.t tr.click { cursor: pointer; }
.t tr.click:hover td { background: var(--surface-2); }
.t tfoot td { font-weight: 600; border-top: 1px solid var(--line2); border-bottom: 0; }
.who { display: flex; align-items: center; gap: 10px; min-width: 160px; color: inherit; text-decoration: none; }
.who small { display: block; color: var(--muted); font-size: 12px; }
.av { width: 28px; height: 28px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: inline-grid; place-items: center; font-size: 11px; font-weight: 600; flex: none; letter-spacing: 0; }
.av-stack { display: inline-flex; }
.av-stack .av { width: 24px; height: 24px; font-size: 10px; box-shadow: 0 0 0 2px var(--surface); }
.av-stack .av + .av { margin-left: -6px; }
.task { max-width: 340px; }
.task small { display: block; color: var(--muted); }

.ubar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.ubar .track { flex: 1; height: 6px; border-radius: 99px; background: var(--s-idle); overflow: hidden; display: flex; gap: 2px; }
.ubar .fill { height: 100%; border-radius: 99px; }
.ubar .num { font-size: 12px; width: 40px; text-align: right; color: var(--fg2); }

/* ---------- pills, chips, notices ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--hover); color: var(--fg2); white-space: nowrap; font-weight: 500; line-height: 1.6; }
.pill .sw { width: 7px; height: 7px; border-radius: 50%; }
.pill.st-good, .pill.st-warn, .pill.st-serious, .pill.st-crit { background: color-mix(in srgb, currentColor 11%, transparent); }
.st-good { color: var(--good-ink); } .st-warn { color: var(--warn-ink); } .st-serious { color: var(--serious-ink); } .st-crit { color: var(--crit-ink); }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line2); border-radius: 99px; padding: 3px 10px; font-size: 12.5px; color: var(--fg); text-decoration: none; }
a.chip:hover, button.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
button.chip { cursor: pointer; font: inherit; font-size: 12.5px; }
/* Count bubbles: one iOS red everywhere (sidebar, tabs, bottom bar) */
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff3b30; color: #fff; font-size: 11px; font-weight: 600; font-family: var(--font); line-height: 1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge { background: #ff453a; } }
:root[data-theme="dark"] .badge { background: #ff453a; }
.notice { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; font-size: 13px; padding: 12px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.notice > b:first-child { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.notice-error { border-color: color-mix(in srgb, var(--crit) 40%, var(--line)); background: color-mix(in srgb, var(--crit) 6%, var(--surface)); }
.notice details summary { cursor: pointer; }
.empty { color: var(--muted); padding: 22px 0; text-align: center; font-size: 13px; }

/* ---------- forms & buttons ---------- */
form.f, .f { display: grid; gap: 14px; }
.f label { display: grid; gap: 6px; align-content: start; font-size: 12.5px; color: var(--fg2); font-weight: 500; }
input:not([type=checkbox]):not([type=radio]), select, textarea {
  background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r-sm); padding: 8px 11px; min-width: 0; font-size: 14px; color: var(--fg);
  box-shadow: var(--shadow); transition: border-color .12s, box-shadow .12s; }
input:not([type=checkbox]):not([type=radio]):hover, select:hover { border-color: color-mix(in srgb, var(--fg) 22%, var(--line2)); }
input:not([type=checkbox]):not([type=radio]):focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
input::placeholder { color: var(--muted); }
select { appearance: none; padding-right: 32px; background-image: 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='%238a8a96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; }
.f input:not([type=checkbox]):not([type=radio]), .f select { width: 100%; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .g2, .g3 { grid-template-columns: 1fr; } }
.hint { margin: 0; font-size: 12.5px; color: var(--muted); }
.err { color: var(--crit-ink); font-size: 13px; }
.err:empty { display: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--accent); color: var(--accent-fg); border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 8px 14px; font-weight: 500; font-size: 13.5px; text-decoration: none; white-space: nowrap; box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .12); transition: background .12s; }
.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--fg); border-color: var(--line2); box-shadow: var(--shadow); }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { padding: 5px 10px; font-size: 12.5px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.link { border: 0; background: none; color: var(--accent-ink); padding: 2px 4px; font-size: 12.5px; font-weight: 500; text-decoration: none; }
.link:hover { text-decoration: underline; }
.link.del { color: var(--crit-ink); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.checks label { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; font-weight: 400; color: var(--fg); font-size: 13.5px; }
.fs { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; min-width: 0; }
.fs:disabled { opacity: .5; }

/* Toggle chips: a checkbox styled as a selectable person chip */
.picks { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { position: relative; display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 7px !important; padding: 4px 12px 4px 4px; border: 1px solid var(--line2); border-radius: 99px;
  background: var(--surface); color: var(--fg2) !important; font-weight: 500 !important; font-size: 13px !important; cursor: pointer; user-select: none; transition: background .12s, border-color .12s; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick .av { width: 22px; height: 22px; font-size: 9.5px; background: var(--hover); color: var(--muted); }
.pick:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line2)); }
.pick:has(input:checked) { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-ink) !important; }
.pick:has(input:checked) .av { background: var(--accent); color: var(--accent-fg); }
.pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Log screen ---------- */
.daybar { display: grid; gap: 10px; }
.daybar .track { height: 10px; background: var(--s-idle); border-radius: 99px; display: flex; gap: 2px; overflow: hidden; }
.daybar .track > div { height: 100%; }
.daybar-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.daybar-top b { font-size: 26px; font-weight: 500; letter-spacing: -0.03em; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.wd { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 10px 4px 8px; text-align: center; display: grid; gap: 1px; color: var(--fg); text-decoration: none; box-shadow: var(--shadow); transition: border-color .12s, background .12s; }
a.wd:hover { border-color: var(--line2); background: var(--surface-2); }
.wd small { color: var(--muted); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.wd > span:nth-child(2) { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.wd .num { font-size: 12px; color: var(--fg2); }
.wd > span:last-child { font-size: 11px; line-height: 1; min-height: 11px; }
.wd.sel { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.wd.miss { background: color-mix(in srgb, var(--crit) 5%, var(--surface)); border-color: color-mix(in srgb, var(--crit) 30%, var(--line)); }
.wd.miss .num { color: var(--crit-ink); font-weight: 500; }
.wd.future { opacity: .45; box-shadow: none; }
.subbox { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 2px; }
form.subbox { display: grid; gap: 12px; align-items: stretch; }
.entry { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; padding-top: 0; }
.entry .h { font-family: var(--mono); font-weight: 500; font-size: 13px; min-width: 44px; padding: 3px 0; text-align: center; border-radius: 6px; background: var(--hover); flex: none; }
.entry .body { flex: 1; min-width: 0; }
.entry .meta { color: var(--muted); font-size: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.entry.pending { opacity: .55; }

/* ---------- Setup ---------- */
.req { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); }
.req-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
details.req > summary { list-style: none; cursor: pointer; }
details.req > summary::-webkit-details-marker { display: none; }
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .split { grid-template-columns: minmax(0, 1fr); } }
.plist { display: grid; gap: 2px; padding: 6px; }
.plist a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border-radius: var(--r-sm); text-decoration: none; color: var(--fg); }
.plist a:hover { background: var(--hover); }
.plist a[aria-current="true"] { background: var(--accent-soft); }
.plist a b { font-weight: 500; font-size: 13.5px; }
.plist a small { color: var(--muted); font-size: 12px; grid-column: 1; }
.plist a .pill { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.plist-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 6px 12px; }
.section { display: grid; gap: 12px; padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--line); }
.section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.section-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.section-h p { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }
.mods { display: grid; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.mod { display: grid; grid-template-columns: minmax(0, 1fr) 120px 80px auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line); background: var(--surface); }
.mod:first-child { border-top: 0; }
.mod-h { background: var(--surface-2); font-size: 12px; color: var(--muted); font-weight: 500; padding: 8px 12px; }
.mod input:not([type=checkbox]) { box-shadow: none; border-color: transparent; background: transparent; }
.mod input:not([type=checkbox]):hover { border-color: var(--line2); }
.mod input:not([type=checkbox]):focus { background: var(--surface); }
.mod .used { font-family: var(--mono); font-size: 12.5px; color: var(--fg2); text-align: right; }
.mod.add { background: var(--surface-2); }
.mod.add input:not([type=checkbox]) { background: var(--surface); border-color: var(--line2); }
.mod .arch { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) { .mod { grid-template-columns: 1fr 90px; } .mod .used, .mod .arch { display: none; } .mod-h { display: none; } }

/* ---------- misc ---------- */
details.how { font-size: 13px; color: var(--fg2); }
details.how summary { cursor: pointer; font-weight: 500; color: var(--fg); }
details.how dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 12px 0 0; }
details.how dt { font-weight: 500; color: var(--fg); }
details.how dd { margin: 0; }
@media (max-width: 600px) { details.how dl { grid-template-columns: 1fr; } details.how dd { margin-bottom: 6px; } }
.auth { display: grid; place-items: center; min-height: 80vh; padding-block: 40px; }
.auth form { width: 100%; max-width: 380px; padding: 28px; }
.auth .brand { justify-content: center; padding-bottom: 6px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; z-index: 40; box-shadow: var(--shadow-lg); }
textarea.csv { width: 100%; height: 120px; font-family: var(--mono); font-size: 11px; }
body.loading::after { content: ""; position: fixed; left: 0; right: 0; top: env(safe-area-inset-top, 0px); height: 2px; z-index: 50; background: var(--accent); transform-origin: left; animation: tb-load 1.2s ease-out infinite; }
@keyframes tb-load { from { transform: scaleX(0); } to { transform: scaleX(.9); } }
@media (prefers-reduced-motion: reduce) { body.loading::after { animation: none; transform: scaleX(.6); } * { transition: none !important; } }
.viewer { display: flex; align-items: center; gap: 8px; color: var(--fg2); font-size: 13px; font-weight: 500; }
.viewer select { min-width: 200px; }
.entry .meta form { display: inline; }
.switch select { width: 100%; font-size: 13px; padding: 6px 30px 6px 10px; }
.switched { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r);
  background: color-mix(in srgb, var(--warn) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); font-size: 13px; }
@media (max-width: 860px) { .switch { display: none; } }
.card.requests { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 8%, transparent), var(--shadow); }
.card.requests h2 { display: inline-flex; align-items: center; gap: 8px; }
.rqs { display: grid; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.rq { display: grid; gap: 12px; padding: 14px 16px; background: var(--surface); border-top: 1px solid var(--line); }
.rq:first-child { border-top: 0; }
.rq-h { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.rq-h b { font-weight: 500; font-size: 14px; }
.rq-meta { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.rq-meta .av { width: 22px; height: 22px; font-size: 9.5px; }
.rq-approve { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.rq-approve label { display: grid; gap: 4px; font-size: 12px; color: var(--fg2); font-weight: 500; flex: 1 1 160px; max-width: 260px; }
.rq-approve label input, .rq-approve label select { width: 100%; }
.rq-all { margin-top: 12px; }
@media (max-width: 600px) { .rq-meta { margin-left: 0; width: 100%; } .rq-approve label { max-width: none; } }

/* Company logo */
.brand { flex-direction: column; align-items: flex-start; gap: 4px; padding: 2px 8px 16px; }
.brand-logo { display: block; width: 116px; height: auto; max-width: 100%; }
.brand-icon { display: none; width: 30px; height: 30px; }
.brand-app { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-left: 2px; }
.auth-brand { display: grid; justify-items: center; gap: 6px; padding-bottom: 8px; }
.auth-brand img { width: 140px; height: auto; max-width: 100%; }
.auth-brand span { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.auth h1 { text-align: center; font-size: 20px; }
@media (max-width: 860px) {
  .brand { flex-direction: row; align-items: center; gap: 8px; padding: 0; }
  .brand-logo { display: none; }
  .brand-icon { display: block; }
  .brand-app { font-size: 15px; letter-spacing: -0.01em; text-transform: none; color: var(--fg); padding: 0; }
}

/* Reports */
/* Group labels sit close to their tiles (the page's 18px gap minus 8px) and well clear of the group above (18px + 14px) */
.report-group { font-size: 12px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 14px 0 -8px; scroll-margin-top: 80px; }
.head + .report-group { margin-top: 2px; }
.report-card .kpi-label { align-items: flex-start; }
.report-card .kpi-label svg.i { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--accent-ink); }
.report-card.is-chart .kpi-label svg.i { color: var(--good-ink); }
.report-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
/* Report tiles share the dashboard tile look: label with a small icon, then a muted line */
.report-card { display: grid; align-content: start; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); text-decoration: none; color: var(--fg); transition: border-color .12s, box-shadow .12s; }
.report-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent), var(--shadow); }
table.report.wide th, table.report.wide td { white-space: nowrap; }
.t .heat-h { text-align: center; font-size: 11px; padding-inline: 4px; }
.t td.heat { text-align: center; font-family: var(--mono); font-size: 12px; padding: 8px 4px; min-width: 44px; background: color-mix(in srgb, var(--accent) calc(var(--a) * 55%), transparent); }
.t td.heat-leave { color: var(--fg2); background: var(--hover); font-family: var(--font); font-weight: 600; }
.t td.heat-missing { color: var(--crit-ink); background: color-mix(in srgb, var(--crit) 8%, transparent); font-weight: 700; }
.t td.heat-off { background: repeating-linear-gradient(45deg, transparent 0 4px, var(--hover) 4px 6px); }
.t tr.group-start td { border-top: 1px solid var(--line2); }
.review-note { margin-top: 6px; padding: 6px 10px; border-left: 3px solid var(--crit); background: color-mix(in srgb, var(--crit) 6%, transparent); border-radius: 4px; font-size: 12.5px; color: var(--fg2); }
.bulkbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); position: sticky; top: env(safe-area-inset-top, 0px); z-index: 4; box-shadow: var(--shadow); }
details.sendback { display: inline-block; margin-left: 6px; position: relative; }
details.sendback > summary { list-style: none; cursor: pointer; display: inline; }
details.sendback > summary::-webkit-details-marker { display: none; }
details.sendback form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; display: flex; gap: 6px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); width: 320px; }
details.sendback input { flex: 1; min-width: 0; }
details.sendback form { flex-wrap: wrap; }
details.sendback .hint { flex-basis: 100%; white-space: normal; text-align: left; font-size: 12px; }
.appr .card-h { margin-bottom: 8px; }
.seg .pill { padding: 0 7px; font-size: 11px; }

/* Dashboard */
.dash-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.dash-stat { display: grid; gap: 4px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); color: var(--fg); text-decoration: none; }
a.dash-stat:hover { border-color: var(--line2); background: var(--surface-2); }
.dash-stat.is-alert { border-color: color-mix(in srgb, var(--crit) 35%, var(--line)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--crit) 7%, transparent), var(--shadow); }
.dash-stat.is-alert .kpi-val { color: var(--crit-ink); }
.dash-bar { height: 6px; border-radius: 99px; background: var(--s-idle); overflow: hidden; margin-top: 6px; }
.dash-bar span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
.dash-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--fg); text-decoration: none; }
.dash-row:first-of-type { border-top: 0; padding-top: 2px; }
a.dash-row:hover .grow { color: var(--accent-ink); }
.dash-row .grow { flex: 1; min-width: 0; }
.dash-row .grow small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row .num { font-size: 12.5px; color: var(--fg2); white-space: nowrap; }
.dash-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.head .btn svg.i { width: 16px; height: 16px; }

/* Report highlights, colour targets and notes */
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.insight { display: grid; gap: 3px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); border-left: 4px solid var(--line2); min-width: 0; }
.insight-label { font-size: 12px; color: var(--fg2); font-weight: 500; }
.insight-val { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.insight-sub { font-size: 12px; color: var(--muted); }
.insight.tone-good { border-left-color: var(--good); } .insight.tone-good .insight-val { color: var(--good-ink); }
.insight.tone-warn { border-left-color: var(--warn); } .insight.tone-warn .insight-val { color: var(--warn-ink); }
.insight.tone-crit { border-left-color: var(--crit); } .insight.tone-crit .insight-val { color: var(--crit-ink); }
.t td.tone-good .cellval { color: var(--good-ink); font-weight: 600; }
.t td.tone-warn .cellval { color: var(--warn-ink); font-weight: 600; }
.t td.tone-crit .cellval, .t td.tone-crit { color: var(--crit-ink); font-weight: 600; }
.t tfoot td.tone-good { color: var(--good-ink); } .t tfoot td.tone-warn { color: var(--warn-ink); }
.cellbar { display: inline-block; vertical-align: middle; width: 54px; height: 6px; border-radius: 99px; background: var(--s-idle); overflow: hidden; margin-right: 8px; }
.cellbar span { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
td.tone-good .cellbar span { background: var(--good); } td.tone-warn .cellbar span { background: var(--warn); } td.tone-crit .cellbar span { background: var(--crit); }
.t tr.subtotal td { background: var(--surface-2); font-weight: 600; border-bottom: 1px solid var(--line2); }
.t td.heat-over { box-shadow: inset 0 0 0 2px var(--accent); font-weight: 400; }
.tone-legend { margin-top: 12px; }
.tone-legend .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.tone-good { background: var(--good); } .dot.tone-warn { background: var(--warn); } .dot.tone-crit { background: var(--crit); }
.explain h2 { margin-bottom: 12px; }
.explain dl { display: grid; grid-template-columns: minmax(150px, max-content) 1fr; gap: 10px 22px; margin: 0 0 12px; font-size: 13.5px; }
.explain dt { font-weight: 500; color: var(--fg); }
.explain dd { margin: 0; color: var(--fg2); line-height: 1.55; max-width: 75ch; }
@media (max-width: 640px) { .explain dl { grid-template-columns: 1fr; gap: 2px; } .explain dd { margin-bottom: 10px; } }
table.report td, table.report th { white-space: nowrap; }
.thread { display: grid; gap: 6px; margin-top: 6px; }
.thread .review-note, .thread .member-reply { margin: 0; }
.review-note b, .member-reply b { font-weight: 600; color: var(--fg); margin-right: 6px; }
.approval-note { margin-top: 6px; padding: 6px 10px; border-left: 3px solid var(--good); background: color-mix(in srgb, var(--good) 7%, transparent); border-radius: 4px; font-size: 12.5px; color: var(--fg2); }
.thread .approval-note { margin: 0; }
.approval-note b { font-weight: 600; color: var(--fg); margin-right: 6px; }
/* Approve / Send back as round icon buttons (name in the tooltip) */
details.sendback > summary.act-ico { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; vertical-align: middle; cursor: pointer; transition: background .15s; }
summary.act-ico svg.i { width: 16px; height: 16px; stroke-width: 2.2; }
summary.act-approve { color: var(--good-ink); background: color-mix(in srgb, var(--good) 12%, transparent); }
summary.act-approve:hover, details[open] > summary.act-approve { background: color-mix(in srgb, var(--good) 22%, transparent); }
summary.act-sendback { color: var(--serious-ink); background: color-mix(in srgb, var(--serious) 14%, transparent); }
summary.act-sendback:hover, details[open] > summary.act-sendback { background: color-mix(in srgb, var(--serious) 26%, transparent); }
summary.act-delete { color: var(--crit-ink); background: color-mix(in srgb, var(--crit) 10%, transparent); }
summary.act-delete:hover, details[open] > summary.act-delete { background: color-mix(in srgb, var(--crit) 20%, transparent); }
.btn.danger { background: var(--crit); border-color: var(--crit); color: #fff; }
.btn.danger:hover { background: color-mix(in srgb, var(--crit) 85%, #000); }
.member-reply { padding: 6px 10px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 4px; font-size: 12.5px; color: var(--fg2); }
.td .member-reply, td .member-reply { margin-top: 6px; }
.reply-box > summary { cursor: pointer; display: inline-block; list-style: none; }
.reply-box > summary::-webkit-details-marker { display: none; }
.reply-box[open] > summary { display: none; }
.reply-box textarea { width: 100%; font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: var(--r-sm); background: var(--surface); color: var(--fg); resize: vertical; }
.reply-box textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }

/* Report charts */
:root { --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --cat-4: #eda100; --cat-5: #e87ba4; --cat-6: #008300; --cat-7: #6250d6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; --cat-6: #008300; --cat-7: #9085e9; } }
:root[data-theme="dark"] { --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --cat-4: #c98500; --cat-5: #d55181; --cat-6: #008300; --cat-7: #9085e9; }
.viz { position: relative; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.viz-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.viz-h h3 { margin: 0; font-size: 14px; font-weight: 500; }
.hb { position: relative; display: grid; gap: 7px; }
.hb-row { display: grid; grid-template-columns: minmax(110px, 190px) minmax(0, 1fr) 104px; align-items: center; gap: 12px; font-size: 12.5px; cursor: default; }
.hb-row:hover .hb-track { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent); }
.hb-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg); }
.hb-label small { display: block; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; }
.hb-track { position: relative; display: flex; gap: 2px; height: 14px; border-radius: 4px; background: var(--hover); overflow: visible; }
.hb-seg { height: 100%; min-width: 2px; }
.hb-seg:first-child { border-radius: 4px 0 0 4px; } .hb-seg:last-of-type { border-radius: 0 4px 4px 0; } .hb-seg:only-of-type { border-radius: 4px; }
.hb-marker { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: var(--fg); border-radius: 2px; }
.hb-goal { position: absolute; top: -3px; bottom: -3px; border-left: 2px dashed var(--good); pointer-events: none; }
.hb-head { height: 14px; }
.hb-axis { background: none; height: 14px; }
.hb-goal-label { position: absolute; bottom: 0; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--good-ink); white-space: nowrap; }
.hb-val { text-align: right; color: var(--fg2); font-size: 12px; white-space: nowrap; }
@media (max-width: 600px) { .hb-row { grid-template-columns: 88px minmax(0, 1fr) 78px; gap: 8px; } .hb-val { font-size: 11px; } }
.appr-day { display: grid; gap: 10px; }
.appr-day-h { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px 16px; flex-wrap: wrap; padding: 0 2px; }
.appr-day-h h2 { font-size: 15px; margin-bottom: 2px; }
.appr-day-h .who h2 { margin-bottom: 0; }
.appr-right { gap: 10px; }
.task-link { color: inherit; text-decoration: none; }
.text-link { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; cursor: pointer; }
.task-link:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.t td.c-nonup { text-align: center; }

/* Visual reports */
.viz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.viz-panel.is-wide { grid-column: 1 / -1; }
@media (max-width: 1000px) { .viz-grid { grid-template-columns: minmax(0, 1fr); } }
.viz-panel .viz-h { margin-bottom: 6px; }
.viz-panel .viz-h h2 { font-size: 14px; }
.viz-insight { margin: 0 0 16px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border-left: 3px solid var(--line2); font-size: 13.5px; color: var(--fg); line-height: 1.5; }
.viz-insight.tone-good { border-left-color: var(--good); } .viz-insight.tone-warn { border-left-color: var(--warn); } .viz-insight.tone-crit { border-left-color: var(--crit); }
.tip-float { position: fixed; z-index: 60; max-width: 320px; }
.tip .tip-note { margin: 6px 0 0; padding-top: 6px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11.5px; line-height: 1.45; }
/* Tooltips keep the normal arrow pointer (no question mark, no text cursor) */
[data-tip], .clamp { cursor: default; }
a[data-tip], button[data-tip], tr[data-tip], .dash-stat[data-tip] { cursor: pointer; }
.kpi[data-tip]:hover, .dash-stat[data-tip]:hover { border-color: var(--line2); }
.has-tip { display: inline-flex; border-radius: 99px; }

/* Softer horizontal bar charts: thin rounded bars, calmer colours, more air */
.hb { gap: 12px; }
.hb-row { gap: 16px; font-size: 12.5px; padding: 2px 6px; margin: 0 -6px; border-radius: 6px; }
.hb-row:not(.hb-head):hover { background: var(--hover); }
.hb-row:hover .hb-track { box-shadow: none; }
.hb-label { color: var(--fg2); }
.hb-row:hover .hb-label { color: var(--fg); }
.hb-track { height: 8px; border-radius: 99px; background: color-mix(in srgb, var(--hover) 70%, transparent); gap: 3px; }
.hb-seg { opacity: .82; }
.hb-seg:first-child { border-radius: 99px 0 0 99px; } .hb-seg:last-of-type { border-radius: 0 99px 99px 0; } .hb-seg:only-of-type { border-radius: 99px; }
.hb-row:hover .hb-seg { opacity: 1; }
.hb-goal { top: -5px; bottom: -5px; border-left: 1px dashed color-mix(in srgb, var(--good) 70%, transparent); }
.hb-goal-label { font-weight: 500; font-size: 10.5px; color: color-mix(in srgb, var(--good-ink) 85%, var(--muted)); }
.hb-marker { top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--fg2); }
.hb-val { color: var(--muted); font-size: 11.5px; }
.hb-row:hover .hb-val { color: var(--fg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hb-seg { opacity: .72; } }
:root[data-theme="dark"] .hb-seg { opacity: .72; }

/* Softer still */
.hb { gap: 14px; }
.hb-track { height: 6px; background: color-mix(in srgb, var(--hover) 45%, transparent); gap: 2px; }
.hb-seg { opacity: .62; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hb-seg { opacity: .55; } }
:root[data-theme="dark"] .hb-seg { opacity: .55; }
.hb-row:hover .hb-seg { opacity: .95; }
.hb-goal { border-left-color: color-mix(in srgb, var(--good) 45%, transparent); }
.hb-label { color: color-mix(in srgb, var(--fg2) 85%, transparent); font-size: 12px; }
.hb-val { color: color-mix(in srgb, var(--muted) 85%, transparent); }
.viz-panel .legend { opacity: .85; }

/* Heatmap matrix and calendar */
.mx { display: grid; gap: 3px; font-size: 12px; overflow-x: auto; }
.mx-h { text-align: center; color: var(--muted); font-size: 11px; padding-bottom: 4px; }
.mx-label { color: var(--fg2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: center; padding-right: 8px; }
.mx-c { height: 26px; border-radius: 5px; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; color: var(--fg2);
  background: color-mix(in srgb, var(--accent) calc(var(--a) * 60%), transparent); }
.mx-c:hover { outline: 2px solid var(--accent); }
.mx-off { background: repeating-linear-gradient(45deg, transparent 0 4px, var(--hover) 4px 6px); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal-h { text-align: center; font-size: 11px; color: var(--muted); }
.cal-c { min-height: 52px; border-radius: 8px; padding: 6px 8px; display: grid; align-content: space-between; font-size: 11px; background: var(--hover); }
.cal-c b { font-weight: 600; color: var(--fg2); font-size: 12px; }
.cal-c small { font-family: var(--mono); color: var(--fg); font-size: 11.5px; }
.cal-good { background: color-mix(in srgb, var(--good) calc(var(--a) * 35%), var(--surface)); }
.cal-warn { background: color-mix(in srgb, var(--warn) calc(var(--a) * 45%), var(--surface)); }
.cal-crit { background: color-mix(in srgb, var(--crit) calc(var(--a) * 45%), var(--surface)); }
.cal-off { background: repeating-linear-gradient(45deg, transparent 0 4px, var(--hover) 4px 6px); }
.cal-c:hover { outline: 2px solid var(--accent); }
.mx-c.mx-low { color: var(--warn-ink); font-weight: 600; }

/* Birthdays and work anniversaries */
.celebrate { position: relative; overflow: hidden; display: flex; gap: 18px; align-items: center; padding: 22px 24px; border-color: color-mix(in srgb, var(--accent) 22%, var(--line)); background: linear-gradient(120deg, var(--accent-soft), var(--surface) 70%); }
.celebrate.anniversary { border-color: color-mix(in srgb, var(--warn) 30%, var(--line)); background: linear-gradient(120deg, color-mix(in srgb, var(--warn) 14%, var(--surface)), var(--surface) 70%); }
.celebrate h2 { font-size: 19px; margin: 0 0 4px; }
.celebrate p { margin: 0 0 6px; font-size: 15px; color: var(--fg); max-width: 62ch; }
.celebrate-mark { font-size: 44px; line-height: 1; flex: none; animation: celebrate-pop .7s cubic-bezier(.3, 1.6, .5, 1) both; }
.celebrate-ico { font-size: 18px; width: 28px; text-align: center; flex: none; }
.celebrate-row form { flex: none; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; top: -10px; width: 7px; height: 11px; border-radius: 2px; opacity: 0; animation: confetti-fall 2.6s ease-in forwards; }
.confetti i:nth-child(4n+1) { background: var(--accent); } .confetti i:nth-child(4n+2) { background: var(--warn); }
.confetti i:nth-child(4n+3) { background: var(--s-man); } .confetti i:nth-child(4n) { background: var(--s-non); }
.confetti i:nth-child(1) { left: 6%; animation-delay: .05s; } .confetti i:nth-child(2) { left: 13%; animation-delay: .4s; }
.confetti i:nth-child(3) { left: 21%; animation-delay: .15s; } .confetti i:nth-child(4) { left: 29%; animation-delay: .6s; }
.confetti i:nth-child(5) { left: 36%; animation-delay: .25s; } .confetti i:nth-child(6) { left: 44%; animation-delay: .75s; }
.confetti i:nth-child(7) { left: 51%; animation-delay: .1s; } .confetti i:nth-child(8) { left: 58%; animation-delay: .5s; }
.confetti i:nth-child(9) { left: 65%; animation-delay: .3s; } .confetti i:nth-child(10) { left: 72%; animation-delay: .85s; }
.confetti i:nth-child(11) { left: 79%; animation-delay: .2s; } .confetti i:nth-child(12) { left: 86%; animation-delay: .65s; }
.confetti i:nth-child(13) { left: 92%; animation-delay: .35s; } .confetti i:nth-child(14) { left: 97%; animation-delay: .9s; }
@keyframes confetti-fall {
  0% { opacity: 0; transform: translateY(0) rotate(0); }
  10% { opacity: .9; }
  100% { opacity: 0; transform: translateY(150px) rotate(320deg); }
}
@keyframes celebrate-pop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } .celebrate-mark { animation: none; } }
@media (max-width: 600px) { .celebrate { flex-direction: column; align-items: flex-start; } .celebrate-row { flex-wrap: wrap; } }

/* ---------- settings (Setup → Rules & holidays) ---------- */
.settings { display: grid; gap: 18px; }
.settings .card-h { margin-bottom: 4px; }
.settings .card-h .hint { margin-top: 3px; }
.set { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 10px 32px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.set:last-child { padding-bottom: 0; }
.set-wide { grid-template-columns: minmax(0, 1fr); align-items: start; }
.set-t { display: grid; gap: 3px; min-width: 0; font-weight: 400; }
.set-t b { font-size: 13.5px; font-weight: 500; color: var(--fg); }
.set-c { min-width: 0; }
.set-c input, .set-c select { width: 100%; }
.set-c.picks { justify-content: flex-end; }
.set-unit { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.set-unit input { width: 96px !important; }
.set-check, label.set-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.set-check > input[type=checkbox] { margin-top: 2px; flex: none; }
.set > .set-check { padding: 0; border: 0; }
.settings textarea { width: 100%; resize: vertical; font-size: 13px; line-height: 1.5; }
.hol-list { display: grid; gap: 0; }
.hol { display: flex; align-items: center; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.hol .num { width: 120px; color: var(--fg2); }
.hol .grow { flex: 1; min-width: 0; }
.hol-add { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hol-add input[type=date] { width: 170px; }
.hol-add input[name=name] { flex: 1; min-width: 180px; }
.save-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 6px 24px rgba(0, 0, 0, .08), var(--shadow); }
@media (max-width: 700px) {
  .set { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .set-c.picks, .set-unit { justify-content: flex-start; }
  .hol-add input[type=date], .hol-add input[name=name], .hol-add .btn { width: 100%; flex: 1 1 100%; }
  .save-bar .hint { display: none; }
  .save-bar .btn { width: 100%; }
}

/* ---------- Upwork contracts & IDs ---------- */
.ctrs { display: grid; gap: 8px; }
.ctr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 190px) auto 64px; gap: 8px; align-items: center; }
.ctr-h { font-size: 12px; color: var(--muted); font-weight: 500; }
.ctr .link.del { justify-self: start; }
.ctr-id { grid-template-columns: minmax(0, 1fr) 110px auto 64px; }
.ctr.add { padding-top: 8px; border-top: 1px dashed var(--line2); }
@media (max-width: 640px) {
  .ctr { grid-template-columns: minmax(0, 1fr) auto; }
  .ctr > input, .ctr > select { grid-column: 1 / -1; }
  .ctr-h { display: none; }
  .ctr-id > .sub { grid-column: auto; }
  .ctr + .ctr:not(.add) { padding-top: 10px; border-top: 1px solid var(--line); }
  /* Upwork IDs: name and Save on one line, usage and Remove small underneath */
  .ctr-id { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name save" "meta del"; row-gap: 4px; }
  .ctr-id > input { grid-area: name; grid-column: auto; }
  .ctr-id > .btn { grid-area: save; }
  .ctr-id > .sub { grid-area: meta; font-size: 12px; }
  .ctr-id > .link.del, .ctr-id > span:last-child { grid-area: del; justify-self: end; font-size: 12.5px; padding: 0; }
  .ctr-id.add { grid-template-areas: "name save"; }
  .ctr-id.add > span { display: none; }
}

.stack { display: grid; gap: 18px; align-content: start; min-width: 0; }

/* ---------- projects: actions ---------- */
.head-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.back-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.task-add { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line2); }
details.archived summary { display: flex; align-items: baseline; gap: 10px 14px; flex-wrap: wrap; cursor: pointer; list-style: none; }
details.archived summary::-webkit-details-marker { display: none; }
details.archived summary h2::before { content: '▸'; display: inline-block; width: 14px; color: var(--muted); transition: transform .15s; }
details.archived[open] summary h2::before { transform: rotate(90deg); }
@media (max-width: 600px) { .task-add { grid-template-columns: minmax(0, 1fr) 110px; } .task-add .btn { grid-column: 1 / -1; } }
.nav a.nav-sub { margin-left: 18px; padding-left: 12px; font-size: 13.5px; position: relative; }
.nav a.nav-sub::before { content: ''; position: absolute; left: -6px; top: -2px; bottom: 50%; width: 10px; border-left: 1px solid var(--line2); border-bottom: 1px solid var(--line2); border-bottom-left-radius: 6px; }
@media (max-width: 860px) { .nav a.nav-sub { margin-left: 0; padding-left: 10px; } .nav a.nav-sub::before { display: none; } }
.task-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 13px; }
.task-meta b { color: var(--fg); font-weight: 600; }
.meter { display: grid; gap: 10px; padding: 12px 14px; border: 1px dashed color-mix(in srgb, var(--s-up) 45%, var(--line2)); border-radius: var(--r-sm); background: color-mix(in srgb, var(--s-up) 4%, var(--surface)); }
.meter-toggle { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-weight: 400 !important; color: var(--fg) !important; font-size: 13.5px !important; cursor: pointer; }
.meter-toggle[hidden] { display: none !important; }
.meter-toggle input { margin-top: 2px; }
.meter-toggle b { font-weight: 600; }

/* ---------- New task button and pop-up ---------- */
.side-new { margin: 0 6px 6px; justify-content: center; }
dialog.modal { width: min(440px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog.modal::backdrop { background: rgba(15, 15, 25, .38); }
dialog.modal > form { padding: 18px 20px 20px; }
dialog.now-modal .now-f { padding: 0; }
.modal-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-h h2 { font-size: 16px; }
.modal-x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--muted); padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.modal-x:hover { background: var(--hover); color: var(--fg); }
@media (max-width: 860px) { .side-new { margin: 0; padding: 6px 10px; white-space: nowrap; } }
.ph { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; }
.ph code { font-family: var(--mono); font-size: 12px; padding: 2px 6px; border-radius: 5px; background: var(--hover); color: var(--fg2); cursor: default; }
.appr-complete { display: grid; gap: 6px; justify-items: start; margin-bottom: 6px; }
.appr-complete .sub { font-size: 12px; }
.progress-acts { display: inline-flex; }
.t.tight td { padding: 6px 10px; }

/* Period bar: on phones it fits one line — compact Day/Week/Month tabs, the date without the year (tap it for today) */
.plabel-short { display: none; }
a.plabel { color: inherit; text-decoration: none; }
@media (max-width: 640px) {
  .head > .period { width: 100%; }
  .period { display: flex; flex-wrap: nowrap; gap: 4px; }
  .period > .seg { flex: none; padding: 2px; }
  .period > .seg a { padding: 6px 8px; font-size: 12.5px; }
  .period .plabel-long, .period .ptoday { display: none; }
  .period .plabel-short { display: inline; }
  .period .plabel { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
  .period .ibtn { height: 32px; min-width: 30px; padding: 0 6px; }
}

/* Stat blocks: always two to a row on phones */
@media (max-width: 640px) {
  .kpis, .dash-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi, .dash-stat { padding: 12px 14px; }
  .kpi-val { font-size: 22px; }
  .kpi-val small { display: inline-block; }
  .kpi-label, .kpi-sub { overflow-wrap: anywhere; }
  .dash-top > :last-child:nth-child(odd), .kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* ---------- Phones: slim top bar + bottom tab bar ---------- */
.mob-me, .tabbar, .side-gear, .side-team { display: none; }
@media (max-width: 860px) {
  .side { flex-wrap: nowrap; padding-bottom: 8px; }
  .side > .nav, .side > .me { display: none; }
  .side-new { width: 34px; height: 34px; padding: 0; border-radius: 50%; justify-content: center; }
  .side-new .side-new-label { display: none; }
  .side-new svg.i { margin: 0; }
  .side-gear, .side-team { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--fg2); background: var(--hover); }
  .side-gear[aria-current="page"], .side-team[aria-current="page"] { color: var(--accent-ink); background: var(--accent-soft); }
  .side-gear svg.i, .side-team svg.i { width: 19px; height: 19px; }
  .mob-me { display: block; position: relative; }
  .mob-me > summary { list-style: none; cursor: pointer; width: 34px; height: 34px; font-size: 12px; }
  .mob-me > summary::-webkit-details-marker, .tab-more > summary::-webkit-details-marker { display: none; }
  /* Menus: an iOS-style list — icon tiles, roomy rows, hairline separators */
  .mob-pop { position: absolute; right: 0; top: calc(100% + 10px); z-index: 30; width: 250px; display: grid; padding: 6px 0; border-radius: 20px; overflow: hidden; }
  .mob-pop .me-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px 12px; border-bottom: .5px solid var(--glass-line); }
  .mob-pop .me-row div { display: block; min-width: 0; }
  .mob-pop .me-row b { font-size: 15px; font-weight: 600; }
  .mob-pop .me-row .av { width: 38px; height: 38px; font-size: 13px; }
  .mob-pop form { display: block; margin: 0; }
  .mob-pop a, .mob-pop button { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 16px; border: 0; border-radius: 0; background: none;
    color: var(--fg); text-decoration: none; font: inherit; font-size: 15px; font-weight: 400; letter-spacing: -0.01em; text-align: left; cursor: pointer; }
  .mob-pop a + a::before, .mob-pop a + form button::before, .mob-pop form + a::before { content: ""; position: absolute; top: 0; left: 58px; right: 0; border-top: .5px solid var(--glass-line); }
  .mob-pop svg.i { width: 28px; height: 28px; padding: 5px; flex: none; border-radius: 8px; color: var(--accent-ink); background: var(--accent-soft); stroke-width: 1.8; }
  .mob-pop a:active, .mob-pop button:active, .mob-pop a:hover, .mob-pop button:hover { background: var(--hover); }
  .mob-pop button[type="submit"] svg.i { color: var(--crit-ink); background: color-mix(in srgb, var(--crit) 12%, transparent); }
  .mob-pop a[aria-current="page"] { font-weight: 600; color: var(--accent-ink); }
  .mob-pop button[type="submit"] { color: var(--crit-ink); }
  .mob-pop select { width: calc(100% - 32px); margin: 8px 16px; }
  .tab-more .mob-pop { top: auto; bottom: calc(100% + 12px); right: 0; }

  /* Liquid glass, Apple style: a clear capsule that lenses the page behind it, with a bright rim and specular highlights */
  :root { --glass-tint: rgba(255, 255, 255, .12); --glass-rim: rgba(255, 255, 255, .75); --glass-spec: rgba(255, 255, 255, .95); --glass-glow: rgba(255, 255, 255, .28);
    --glass-pill: rgba(255, 255, 255, .55); --glass-line: rgba(0, 0, 0, .07); --glass-shadow: 0 12px 34px rgba(20, 20, 40, .16), 0 2px 8px rgba(20, 20, 40, .08); --glass-ink: #1d1d1f; --glass-menu: #fbfbfd; }
  .tabbar, .mob-pop { position: fixed;
    background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 55%), var(--glass-tint);
    -webkit-backdrop-filter: blur(5px) saturate(210%) brightness(1.06); backdrop-filter: blur(5px) saturate(210%) brightness(1.06);
    border: .5px solid var(--glass-rim);
    box-shadow: inset 0 1.5px 1px -0.5px var(--glass-spec), inset 0 -1px 1px -0.5px var(--glass-glow), inset 1px 0 1px -0.5px var(--glass-glow), inset -1px 0 1px -0.5px var(--glass-glow),
      inset 0 0 18px var(--glass-glow), var(--glass-shadow); }
  /* A menu can't blur through the glass bar it sits in (Safari), so menus are near-solid frosted panels */
  .mob-pop { position: absolute; background: var(--glass-menu); }
  .tabbar { display: flex; left: max(14px, env(safe-area-inset-left, 0px)); right: max(14px, env(safe-area-inset-right, 0px));
    bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 25; padding: 3px; border-radius: 999px; isolation: isolate; overflow: visible;
    transition: transform .45s cubic-bezier(.3, 1.3, .5, 1), opacity .3s ease; }
  .tabbar::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
    background: radial-gradient(120% 90% at 18% -20%, rgba(255, 255, 255, .55), transparent 55%), radial-gradient(90% 80% at 95% 130%, rgba(255, 255, 255, .25), transparent 60%); mix-blend-mode: soft-light; }
  body.tabbar-away .tabbar { transform: translateY(calc(100% + 24px + env(safe-area-inset-bottom, 0px))) scale(.92); opacity: 0; pointer-events: none; }
  .tabbar > a, .tab-more > summary { flex: 1; position: relative; display: grid; justify-items: center; gap: 1px; padding: 5px 2px 4px; color: var(--glass-ink);
    text-decoration: none; font-size: 10px; font-weight: 600; letter-spacing: -0.01em; border-radius: 999px; cursor: pointer; list-style: none;
    transition: background .25s, color .25s, transform .2s; -webkit-tap-highlight-color: transparent; }
  .tabbar > a:active, .tab-more > summary:active { transform: scale(.94); }
  .tabbar svg.i { width: 21px; height: 21px; stroke-width: 1.4; }
  .tabbar > a, .tab-more > summary { font-weight: 400; }
  .tabbar [aria-current="page"] { color: var(--accent); background: var(--glass-pill);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .9), inset 0 -1px 1px rgba(0, 0, 0, .04), 0 1px 4px rgba(20, 20, 40, .08); }
  .tabbar .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .8); }
  .tab-more { flex: 1; display: flex; position: relative; }
  .wrap { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 860px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --glass-tint: rgba(40, 40, 46, .38); --glass-rim: rgba(255, 255, 255, .22); --glass-spec: rgba(255, 255, 255, .38); --glass-glow: rgba(255, 255, 255, .07);
    --glass-pill: rgba(255, 255, 255, .14); --glass-line: rgba(255, 255, 255, .1); --glass-shadow: 0 12px 34px rgba(0, 0, 0, .5); --glass-ink: #f5f5f7; --glass-menu: #232328; }
  :root:not([data-theme="light"]) .tabbar [aria-current="page"] { color: var(--accent-ink); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .25); }
  :root:not([data-theme="light"]) .tabbar .badge { box-shadow: none; }
}
@media (max-width: 860px) and (prefers-reduced-motion: reduce) { .tabbar { transition: opacity .2s; } body.tabbar-away .tabbar { transform: none; } }
@media (max-width: 860px) and (prefers-reduced-transparency: reduce) {
  .tabbar, .mob-pop { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (max-width: 860px) {
  .tabbar > a:nth-last-child(n+6), .tabbar > a:nth-last-child(n+6) ~ a { font-size: 9px; letter-spacing: -0.02em; }
  .tabbar > a:nth-last-child(n+6) svg.i, .tabbar > a:nth-last-child(n+6) ~ a svg.i { width: 20px; height: 20px; }
  .tabbar > a span { white-space: nowrap; }
}

/* Report cards on phones: two to a row (three on wider phones), same padding as the dashboard tiles */
@media (max-width: 640px) {
  .report-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .report-card { padding: 12px 14px; }
  .report-card .kpi-sub { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}
@media (min-width: 520px) and (max-width: 640px) { .report-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Tab bar counts: a small soft pill instead of a dark red disc */
@media (max-width: 860px) {
  .tabbar .badge { top: 3px; left: calc(50% + 7px); min-width: 0; height: 15px; padding: 0 5px; border-radius: 8px; font: 600 9.5px/15px var(--font); letter-spacing: 0;
    background: #ff3b30; color: #fff; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .9); }
}
@media (max-width: 860px) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tabbar .badge { background: #ff453a; box-shadow: 0 0 0 1.5px rgba(30, 30, 34, .9); }
}

/* Phones: lighter table text, so long task lists read calmly */
@media (max-width: 860px) {
  .t td { font-size: 12.5px; color: var(--fg2); }
  .t td:first-child, .t td:first-child a { color: var(--fg); font-weight: 400 !important; }
  .t th { font-size: 11.5px; }
  .brand { margin-right: auto; }
}

/* Approvals on phones: filters on one row; each entry as a stacked card instead of a wide table */
.c-asg-l { display: none; }
@media (max-width: 640px) {
  .appr-filters { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; width: 100%; }
  .appr-filters select { width: 100%; min-width: 0; height: 36px; padding: 0 24px 0 10px; font-size: 12.5px; text-overflow: ellipsis; background-position: right 8px center; }
  .appr .tscroll { overflow: visible; }
  .appr .t thead { display: none; }
  .appr .t, .appr .t tbody { display: block; }
  .appr .t tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "time time" "proj hrs" "work work" "upid uph" "asg asg" "act act"; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  .appr .t tr:last-child { border-bottom: 0; padding-bottom: 2px; }
  .appr .t td { display: block; padding: 0; border: 0; min-width: 0 !important; white-space: normal !important; }
  .appr .t td.c-proj { grid-area: proj; font-weight: 500; color: var(--fg); }
  .appr .t td.c-time { grid-area: time; font-size: 12px; color: var(--muted); }
  .appr .t td.c-time .sub { display: inline; margin-left: 4px; }
  .appr-list .t tr { grid-template-areas: "who date" "proj hrs" "work work" "upid uph" "asg asg" "act act"; }
  .appr .t td.c-who { grid-area: who; font-weight: 500; }
  .appr .t td.c-date { grid-area: date; text-align: right; font-size: 12.5px; color: var(--fg2); }
  .appr .t td.c-date .sub { display: inline; margin-left: 4px; }
  .appr .t td.c-hrs { grid-area: hrs; font-size: 15px; color: var(--fg); }
  .appr .t td.c-work { grid-area: work; color: var(--fg2); }
  .appr .t td.c-upid { grid-area: upid; font-size: 12.5px; }
  .appr .t td.c-uph { grid-area: uph; align-self: center; font-size: 12.5px; }
  .appr .t td.is-empty { display: none; }
  .appr .t td.c-nonup { grid-area: upid; grid-column: 1 / -1; text-align: left; }
  .appr .t td.c-asg { grid-area: asg; align-self: center; text-align: left; font-size: 12px; color: var(--muted); }
  .c-asg-l { display: inline; }
  .appr .t td.c-act { grid-area: act; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-top: 4px; }
  .appr .t td.c-act .link { font-size: 14px; padding: 6px 0; }
  .appr .t td.c-act summary.act-ico { width: 36px; height: 36px; }
  .appr .t td.c-act details.sendback { margin: 0; position: static; }
  .appr .t td.c-act details.sendback form { position: static; width: auto; margin-top: 8px; box-shadow: none; }
  .appr .t td.c-act details.sendback[open] { flex-basis: 100%; }
  .appr .card-h { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 640px) {
  .pbar > nav.seg { width: 100%; display: flex; }
  .pbar > nav.seg a { flex: 1; justify-content: center; padding: 6px 4px; font-size: 12.5px; gap: 4px; }
  .pbar > nav.seg .badge, .pbar > nav.seg .pill { min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
}
@media (max-width: 640px) {
  /* Phones: one row of tabs that scrolls sideways, fading at the edges, instead of a block of wrapped tabs */
  .setup-tabs { display: flex !important; flex-wrap: nowrap !important; width: calc(100% + 32px); max-width: none; margin: 0 -16px; padding: 3px 16px; border-radius: 0;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 16px; scrollbar-width: none; background: none; gap: 6px;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent 100%); }
  .setup-tabs::-webkit-scrollbar { display: none; }
  .setup-tabs a { flex: none; scroll-snap-align: start; padding: 7px 13px; font-size: 13.5px; border-radius: 99px; background: var(--hover); }
  .setup-tabs a[aria-pressed="true"] { background: var(--fg); color: var(--bg); box-shadow: none; }
}

/* Report cells with a hover breakdown */
.t td.tipcell { cursor: default; color: var(--fg2); text-decoration: underline dotted color-mix(in srgb, var(--muted) 60%, transparent); text-underline-offset: 3px; min-width: 220px; white-space: normal !important; line-height: 1.45; }

/* Approvals: left-early claims to confirm */
.left-claims { margin-bottom: 22px; }
.claim-actions { display: flex; gap: 6px; flex: none; }
.left-claims .left-at { font-weight: 500; color: var(--fg); }
.claim-actions form { margin: 0; }
@media (max-width: 640px) { .left-claims .dash-row { flex-wrap: wrap; } .claim-actions { width: 100%; padding-left: 38px; } }

/* Setup → Report access grid */
.access-grid th.c, .access-grid td.c { text-align: center; width: 1%; white-space: nowrap; padding-left: 14px; padding-right: 14px; }
.access-grid .access-all { display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 11.5px; color: var(--muted); margin-top: 4px; font-weight: 400; cursor: pointer; }
.access-grid tr.access-group td { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--hover); padding-top: 6px; padding-bottom: 6px; }
.access-grid input[type=checkbox] { width: 16px; height: 16px; }

/* Instant table search (Projects) */
.table-search { width: 220px; margin-left: auto; margin-right: 12px; }
@media (max-width: 640px) { .table-search { width: 100%; margin: 8px 0 0; order: 3; } }

/* Tasks: inline status picker */
.task-status { margin: 0; }
.task-status select { padding: 4px 26px 4px 10px; font-size: 12.5px; border-radius: 999px; min-width: 112px; background-position: right 8px center; }
.task-status select.status-complete { color: var(--good-ink); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); background-color: color-mix(in srgb, var(--good) 7%, var(--surface)); }
.task-status select.status-reopened { color: var(--warn-ink); border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background-color: color-mix(in srgb, var(--warn) 9%, var(--surface)); }

/* Dashboard: one-line Shopify update */
.shopify-line { display: flex; align-items: center; gap: 10px; margin: -4px 0 8px; padding: 8px 12px 8px 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--fg2); text-decoration: none; font-size: 13px; min-width: 0; box-shadow: var(--shadow); }
.shopify-line:hover { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); }
.shopify-tip { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn-ink); }
.shopify-tip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shopify-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--fg); }
.shopify-read { flex: none; color: var(--accent-ink); font-size: 12.5px; }
.shopify-x { all: unset; flex: none; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 2px; border-radius: 4px; }
.shopify-x:hover { color: var(--fg); }
@media (max-width: 640px) { .shopify-read { display: none; } }

/* Tasks grouped by project */
.task-groups tr.group-h td { background: none; padding: 26px 10px 8px; border-bottom: 1px solid var(--line); }
.task-groups tbody:first-of-type tr.group-h td { padding-top: 12px; }
.task-groups tr.group-h:hover td { background: none; }
.task-groups .group-name { display: inline-flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 500; font-size: 14px; text-decoration: none; letter-spacing: -0.01em; }
.task-groups .group-name:hover { color: var(--accent-ink); }
.task-groups .group-name .i { width: 16px; height: 16px; color: var(--muted); }
.task-groups .group-meta { margin-left: 10px; display: inline-flex; gap: 6px; vertical-align: 1px; }
.task-groups .group-meta span { font-size: 11.5px; color: var(--fg2); background: var(--hover); border-radius: 999px; padding: 2px 8px; }
.task-groups tr.click td:first-child { padding-left: 34px; }

/* Project page: tasks first on the left, number tiles and side cards on the right */
.proj-side .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.proj-side .kpi { padding: 12px 14px; }
.proj-side .kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.proj-side .kpi-val { font-size: 22px; }
@media (max-width: 1100px) { .proj-side .kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }

/* Project page: add an Upwork contract in place */
.card-links { display: inline-flex; gap: 12px; }
.ctr-add-form { display: grid; gap: 10px; padding: 0 0 14px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.icon-del { all: unset; cursor: pointer; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; color: var(--muted); }
.icon-del:hover { color: var(--crit-ink); background: color-mix(in srgb, var(--crit) 9%, transparent); }
.icon-del .i { width: 15px; height: 15px; }
#contracts td.r { width: 1%; padding-left: 4px; padding-right: 4px; }

/* Log time: "What did you work on?" starts at two lines and grows as they type */
#description { min-height: calc(2lh + 20px); resize: vertical; field-sizing: content; max-height: 14lh; line-height: 1.45; }

/* Log time: Upwork billing on Upwork projects */
.upwork-box { display: grid; gap: 12px; }
.upwork-fields { display: grid; gap: 12px; }
.upwork-extra { margin: 0; font-size: 13px; color: var(--fg2); background: var(--hover); border-radius: 8px; padding: 8px 10px; }
#hours-row.is-off { opacity: .45; }
.upwork-line { display: block; margin-top: 6px; padding: 5px 10px; border-left: 3px solid var(--accent); border-radius: 4px; font-size: 12px; color: var(--fg2); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.task small.upwork-line { color: var(--fg2); }
/* Long comments: three lines, the full text in a tooltip on hover (or tap on phones) */
.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.clamp:focus { outline: none; }
.tip-long { max-width: 380px; }
.tip .tip-text { margin: 0; color: var(--fg2); font-size: 12.5px; line-height: 1.5; white-space: normal; }
.upwork-line.uw-billed { border-left-color: var(--good); background: color-mix(in srgb, var(--good) 11%, transparent); }
.upwork-line.uw-none { border-left-color: var(--crit); background: color-mix(in srgb, var(--crit) 10%, transparent); }
.upwork-line.uw-meter { border-left-color: var(--s-up); background: color-mix(in srgb, var(--s-up) 12%, transparent); }
.meta .upwork-line { flex-basis: 100%; }
.entry-kind { justify-self: start; }

/* Dashboard: weekly Shopify quiz (just for fun) */
.quiz { margin-top: 18px; position: relative; overflow: hidden; border-top: 0; }
.quiz::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--cat-1), var(--cat-7), var(--cat-5), var(--cat-2), var(--cat-4), var(--cat-3)); }
.quiz h2 { display: flex; align-items: center; gap: 8px; }
.quiz-badge { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-size: 12px; font-weight: 600; color: #fff; background: var(--cat-5); transform: rotate(-8deg); }
.quiz-rules { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; margin: 0 0 14px; font-size: 12.5px; }
.quiz-rules span:not(.sub) { padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--cat-2) 12%, transparent); color: var(--fg); }
.quiz-rules span:nth-child(3) { background: color-mix(in srgb, var(--cat-3) 14%, transparent); }
.quiz-rules .sub { font-size: 12px; }
.quiz-q:nth-child(3n+1) .quiz-n { background: color-mix(in srgb, var(--cat-1) 18%, transparent); color: var(--fg); }
.quiz-q:nth-child(3n+2) .quiz-n { background: color-mix(in srgb, var(--cat-5) 18%, transparent); color: var(--fg); }
.quiz-q:nth-child(3n+3) .quiz-n { background: color-mix(in srgb, var(--cat-4) 20%, transparent); color: var(--fg); }
.quiz-opt span { transition: border-color .12s, background .12s, transform .12s; }
.quiz-opt:hover span { border-color: color-mix(in srgb, var(--cat-7) 50%, var(--line)); transform: translateY(-1px); }
.quiz-go { border: 0; border-radius: 999px; padding: 10px 20px; color: #fff; font-weight: 500; background: linear-gradient(90deg, var(--cat-7), var(--cat-5), var(--cat-2)); background-size: 200% 100%; background-position: 0 0; box-shadow: 0 4px 14px color-mix(in srgb, var(--cat-7) 35%, transparent); transition: transform .15s, background-position .4s, box-shadow .15s; }
.quiz-go:hover { transform: translateY(-1px) rotate(-1deg); background-position: 100% 0; box-shadow: 0 6px 18px color-mix(in srgb, var(--cat-5) 40%, transparent); }
.quiz-go:active { transform: scale(.98); }
.quiz > summary { list-style: none; cursor: pointer; margin-bottom: 0; }
.quiz > summary::-webkit-details-marker { display: none; }
.quiz[open] > summary { margin-bottom: 14px; }
.quiz-form, .quiz-results { display: grid; gap: 16px; }
.quiz-q { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.quiz-q legend, .quiz-legend { margin: 0 0 2px; padding: 0; font-weight: 500; font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.quiz-n { flex: none; width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11px; background: var(--accent-soft); color: var(--accent-ink); }
.quiz-opts { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 28px; }
.quiz-opt { display: inline-flex !important; align-items: center; gap: 0 !important; cursor: pointer; font-weight: 400 !important; }
.quiz-opt input { position: absolute; opacity: 0; pointer-events: none; }
.quiz-opt span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--fg); background: var(--surface); }
.quiz-opt input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.quiz-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.quiz-bar { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-left: 28px; padding: 6px 10px; border-radius: 8px; overflow: hidden; font-size: 13px; background: var(--hover); }
.quiz-fill { position: absolute; inset: 0 auto 0 0; background: color-mix(in srgb, var(--muted) 18%, transparent); }
.quiz-bar.is-right .quiz-fill { background: color-mix(in srgb, var(--good) 22%, transparent); }
.quiz-bar.is-mine:not(.is-right) .quiz-fill { background: color-mix(in srgb, var(--crit) 16%, transparent); }
.quiz-label, .quiz-pct { position: relative; }
.quiz-pct { color: var(--fg2); font-size: 12px; }
.quiz-tag { font-weight: 500; font-size: 11px; margin-left: 6px; padding: 1px 6px; border-radius: 999px; }
.quiz-tag.ok { color: var(--good-ink); background: color-mix(in srgb, var(--good) 14%, transparent); }
.quiz-tag.you { color: var(--accent-ink); background: var(--accent-soft); }
.quiz-quip { margin: 0 0 0 28px; font-size: 13px; color: var(--fg); }
.quiz-quip .sub { display: block; font-size: 12px; margin-top: 2px; }
.quiz-foot { display: grid; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 13px; }
.quiz-stats { display: flex; flex-wrap: wrap; gap: 16px; color: var(--fg2); }
.quiz-stats b { color: var(--fg); font-weight: 500; }
.quiz-leaders { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.quiz-leader .pill { font-size: 11px; }
.quiz-foot .link { padding: 0; justify-self: start; font-size: 12.5px; }
.quiz-opt.is-dunno span { border-style: dashed; color: var(--fg2); }

/* Dashboard: "Take the quiz" shortcut */
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.quiz-cta { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--fg); text-decoration: none; background: var(--surface); border: 2px solid transparent; background-image: linear-gradient(var(--surface), var(--surface)), linear-gradient(90deg, var(--cat-1), var(--cat-7), var(--cat-5), var(--cat-2), var(--cat-4), var(--cat-3)); background-origin: border-box; background-clip: padding-box, border-box; box-shadow: var(--shadow); transition: transform .15s; }
.quiz-cta:hover { transform: translateY(-1px) rotate(-1deg); }
.quiz-cta:not(.is-done) .quiz-badge { animation: quiz-wiggle 2.4s ease-in-out infinite; }
.quiz-cta.is-done { font-weight: 400; color: var(--fg2); }
@keyframes quiz-wiggle { 0%, 80%, 100% { transform: rotate(-8deg); } 85% { transform: rotate(10deg); } 90% { transform: rotate(-14deg); } 95% { transform: rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .quiz-cta .quiz-badge { animation: none !important; } }

/* Account page: two columns on wide screens */
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; max-width: 1000px; }
.account-grid > .card { margin: 0; }
@media (max-width: 900px) { .account-grid { grid-template-columns: minmax(0, 1fr); } }
#push-card .btn-row { margin: 0; }

/* Setup → Upwork IDs: profile cards (admin only) */
.uw-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; align-items: start; }
.card.uw-card { display: grid; gap: 10px; padding: 14px 16px; }
.uw-head { display: flex; gap: 10px; align-items: center; }
.uw-head .av { width: 36px; height: 36px; font-size: 12px; flex: none; }
.uw-photo { display: block; border-radius: 50%; object-fit: cover; padding: 0; background: var(--hover); }
.uw-contracts { text-decoration: underline dotted color-mix(in srgb, var(--muted) 70%, transparent); text-underline-offset: 3px; }
.uw-head h3 { font-size: 14px; font-weight: 500; margin: 0; line-height: 1.3; }
.uw-head .sub { margin: 1px 0 0; font-size: 12px; }
.uw-name { color: var(--fg); text-decoration: none; }
.uw-name:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.uw-badge { flex: none; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 99px; white-space: nowrap; color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.uw-badge-top_rated_plus { color: #c2306f; background: color-mix(in srgb, #e2508c 14%, transparent); }
.uw-badge-top_rated { color: var(--s-up); background: color-mix(in srgb, var(--s-up) 14%, transparent); }
.uw-badge-rising_talent { color: var(--good-ink); background: color-mix(in srgb, var(--good) 12%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .uw-badge-top_rated_plus { color: #f07aab; } }
:root[data-theme="dark"] .uw-badge-top_rated_plus { color: #f07aab; }
.uw-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.uw-stats div { display: grid; gap: 1px; }
.uw-stats b { font-size: 15px; font-weight: 500; color: var(--fg); font-family: var(--mono); white-space: nowrap; }
.uw-stats span { font-size: 11px; color: var(--muted); }
.uw-empty { margin: 0; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.uw-month { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; color: var(--fg2); }
.uw-month b { font-weight: 500; color: var(--fg); font-family: var(--mono); }
.uw-month-l { color: var(--muted); }
.uw-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.uw-updated { font-size: 11.5px; color: var(--muted); }
.uw-updated.is-stale { color: var(--warn-ink); }
.uw-edit > summary { list-style: none; cursor: pointer; }
.uw-edit > summary::-webkit-details-marker { display: none; }
.uw-edit[open] { flex-basis: 100%; order: 3; }
.uw-edit[open] > summary { display: none; }
.uw-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.uw-form label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
.uw-form .wide { grid-column: 1 / -1; }
.card.uw-add { gap: 8px; border-style: dashed; }
.uw-add h3 { font-size: 14px; font-weight: 500; margin: 0; }
@media (max-width: 640px) { .uw-cards { grid-template-columns: 1fr; } }

/* Setup → Team: people two to a row; an opened card spans the row for its edit form */
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
.people-grid .person-card { align-content: start; }
.people-grid .person-card[open] { grid-column: 1 / -1; }
.person-card > summary { min-height: 100%; }
@media (max-width: 640px) {
  .people-grid { gap: 6px; }
  .people-grid .person-card { padding: 10px; }
  .person-card > summary { gap: 6px !important; }
  .person-card > summary .who { width: 100%; }
  .person-card > summary .who .av { display: none; }
  .person-card > summary .who small { white-space: normal; }
  .person-card > summary .pill { font-size: 11px; padding: 1px 7px; }
}

/* Dashboard: idle time by reason, this month */
.idle-card { margin-top: 0; }
.idle-reasons { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 28px; }
.idle-reason-h { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.idle-reason-h .sub { font-size: 11.5px; margin-left: 4px; }

/* Remarks on an entry: who, when, what. Red = sent back (grey once approved), blue = reply or change, green = approval message */
.rm { margin-top: 6px; padding: 6px 10px; border-left: 3px solid var(--line2); border-radius: 4px; font-size: 12.5px; color: var(--fg2); background: color-mix(in srgb, var(--fg) 4%, transparent); }
.rm-h { display: flex; gap: 8px; align-items: baseline; margin-bottom: 1px; }
.rm-h b { font-weight: 600; color: var(--fg); }
.rm-when { font-size: 11px; color: var(--muted); white-space: nowrap; }
.rm-body { white-space: pre-line; overflow-wrap: anywhere; }
.rm-sentback { border-left-color: var(--crit); background: color-mix(in srgb, var(--crit) 6%, transparent); }
.rm-reply { border-left-color: var(--accent); background: color-mix(in srgb, var(--accent) 7%, transparent); }
.rm-approved { border-left-color: var(--good); background: color-mix(in srgb, var(--good) 7%, transparent); }
.rm-old { border-left-color: var(--line2); background: color-mix(in srgb, var(--fg) 4%, transparent); color: var(--muted); }
.rm-earlier { display: inline-block; margin-top: 6px; font-size: 11.5px; color: var(--muted); text-decoration: underline dotted; text-underline-offset: 3px; }
.rm-earlier:hover { color: var(--accent-ink); }
.spent-split { font-size: 11px; line-height: 1.35; white-space: nowrap; font-family: var(--sans, inherit); }

/* "What are you on?" button (members): red until set, then a green border that shrinks as the ETA nears */
.now-slot { display: flex; justify-content: flex-end; margin: 0 0 10px; }
.now-btn { --p: 1; position: relative; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: 99px; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 500; color: var(--fg); background: var(--surface); box-shadow: var(--shadow); white-space: nowrap; }
.now-btn::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.now-btn.is-due::before { background: var(--crit); }
.now-btn.is-due { color: var(--crit-ink); animation: now-pulse 2.4s ease-in-out infinite; }
.now-btn.is-running::before { padding: 2.5px; background: conic-gradient(from -45deg, var(--ring, var(--good)) calc(var(--p) * 360deg), color-mix(in srgb, var(--ring, var(--good)) 38%, transparent) 0); transition: background .6s; }
/* Time left: green, then yellow, dark yellow and red as the ETA gets close. */
.now-btn.is-running { --ring: #22a447; }
.now-btn.is-running[data-left="half"] { --ring: #e5c100; }
.now-btn.is-running[data-left="low"] { --ring: #d48806; }
.now-btn.is-running[data-left="last"] { --ring: var(--crit); }
.now-btn.is-running .now-btn-label { font-family: var(--mono); font-size: 12.5px; }
.now-btn-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.now-btn.is-running .now-btn-dot { background: var(--ring); }
@keyframes now-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--crit) 35%, transparent), var(--shadow); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--crit) 0%, transparent), var(--shadow); } }
@media (prefers-reduced-motion: reduce) { .now-btn.is-due { animation: none; } }
.now-btn-mob { display: none; }
@media (max-width: 860px) { .now-slot, .head .now-btn:not(.now-btn-mob), .head .bc-btn:not(.bc-btn-mob) { display: none; } .now-btn-mob { display: inline-flex; height: 34px; padding: 0 12px; font-size: 12px; margin-left: auto; } }
dialog.now-modal { width: min(480px, calc(100vw - 32px)); }
.now-pill { display: inline-flex; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 500; background: color-mix(in srgb, currentColor 12%, transparent); }
.now-pill.tone-good, .now-chip.tone-good { color: var(--good-ink); } .now-pill.tone-warn, .now-chip.tone-warn { color: var(--warn-ink); }
.now-pill.tone-crit, .now-chip.tone-crit { color: var(--crit-ink); } .now-pill.tone-muted, .now-chip.tone-muted { color: var(--muted); }
.now-f { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.now-f label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
.now-f .wide { grid-column: 1 / -1; }
.now-status { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.now-status legend { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; padding: 0; }
.now-chip { display: inline-flex !important; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line2); border-radius: 99px; cursor: pointer; font-size: 13px !important; background: var(--surface); }
.now-chip input { margin: 0; accent-color: currentColor; }
.now-chip:has(input:checked) { border-color: currentColor; background: color-mix(in srgb, currentColor 10%, transparent); }
.now-summary { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 14px; font-size: 13px; color: var(--fg2); }
.now-summary b { font-weight: 500; font-family: var(--mono); color: var(--fg); }
.now-summary .st-crit b, .now-summary .st-warn b { color: inherit; }
.now-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; align-items: start; margin-bottom: 14px; }
.card.now-card { display: grid; gap: 8px; padding: 14px 16px; }
.now-card-h { display: flex; gap: 10px; align-items: center; }
.now-card-h b { display: block; font-weight: 500; font-size: 14px; }
.now-card-h small { font-size: 11.5px; color: var(--muted); }
.now-task .task-link { font-weight: 500; }
.now-task .sub { font-size: 12px; }
.now-eta { font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px; }
.now-card.is-stale { opacity: .62; }
.now-card.is-blocked { border-color: color-mix(in srgb, var(--crit) 45%, var(--line)); }
.now-card.is-late:not(.is-blocked) { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
@media (max-width: 640px) { .now-f { grid-template-columns: 1fr; } .now-grid { grid-template-columns: 1fr; } }
.quiz-cta-wrap { position: relative; display: inline-flex; }
.quiz-cta-x { position: absolute; top: -7px; right: -7px; margin: 0; }
.quiz-cta-x button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border-radius: 50%; border: 1px solid var(--line2); background: var(--surface); color: var(--muted); font-size: 13px; line-height: 1; cursor: pointer; box-shadow: var(--shadow); opacity: .85; }
.quiz-cta-x button:hover { color: var(--fg); opacity: 1; }

/* Quick messages: megaphone for the admin and managers, banner for the people who get one */
.bc-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line2); border-radius: 50%; background: var(--surface); color: var(--fg2); cursor: pointer; box-shadow: var(--shadow); }
.bc-btn:hover { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 40%, var(--line2)); }
.bc-btn svg.i { width: 18px; height: 18px; }
.bc-btn-mob { display: none; }
@media (max-width: 860px) { .bc-btn-mob { display: grid; width: 34px; height: 34px; box-shadow: none; background: var(--hover); border: 0; } }
dialog.bc-modal { width: min(480px, calc(100vw - 32px)); }
.bc-to { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.bc-to legend { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; padding: 0; }
.bc-people { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; max-height: 220px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.bc-people label { display: flex !important; align-items: center; gap: 6px; font-size: 13px; color: var(--fg); }
.bc-banner { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-left: 3px solid var(--accent); border-radius: var(--r-sm); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); font-size: 13.5px; }
.bc-banner > svg.i { width: 18px; height: 18px; color: var(--accent-ink); margin-top: 2px; }
.bc-banner b { font-weight: 500; }
.bc-body { margin-top: 2px; color: var(--fg); white-space: pre-line; overflow-wrap: anywhere; }
.bc-x { border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.bc-x:hover { color: var(--fg); }
@media (max-width: 640px) { .bc-people { grid-template-columns: 1fr; } }
.now-wrap { padding: 18px 20px 20px; display: grid; gap: 12px; }
.now-cur { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--hover); }
.now-cur b { font-weight: 500; }
.now-cur .sub { font-size: 12.5px; }
.now-cur-eta { font-size: 12.5px; margin-top: 4px; }
.now-cur.is-idle { background: color-mix(in srgb, var(--crit) 8%, transparent); }
.now-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.now-acts form { margin: 0; }
.now-acts-foot { padding-top: 10px; border-top: 1px solid var(--line); }
.now-sec { padding-top: 6px; border-top: 1px solid var(--line); }
.now-btn.is-idle { color: var(--muted); }
.now-btn.is-idle::before { background: color-mix(in srgb, var(--fg) 25%, transparent); }
.now-btn.is-idle .now-btn-dot { background: var(--muted); }
.now-idle { border-color: color-mix(in srgb, var(--crit) 40%, var(--line)); margin-bottom: 14px; }
.now-idle-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; }
.now-idle-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 0; color: inherit; text-decoration: none; }
.now-idle-row b { font-weight: 500; }
.now-idle-row .sub { font-size: 12px; }
.now-flag { margin: 0; font-size: 12px; color: var(--fg2); }
.now-flag.tone-good { color: var(--good-ink); } .now-flag.tone-warn { color: var(--warn-ink); }
.badge.badge-soft { background: var(--hover); color: var(--fg2); box-shadow: inset 0 0 0 1px var(--line2); }
/* Not productive: slate icon and label, its remark in the same tone */
summary.act-np { color: #6b6b8a; background: color-mix(in srgb, #6b6b8a 13%, transparent); }
summary.act-np:hover, details[open] > summary.act-np { background: color-mix(in srgb, #6b6b8a 24%, transparent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) summary.act-np { color: #a9a9c8; } }
:root[data-theme="dark"] summary.act-np { color: #a9a9c8; }
.np-btn { background: #6b6b8a; } .np-btn:hover { background: #57577a; }
.np-pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 500; color: #6b6b8a; background: color-mix(in srgb, #6b6b8a 13%, transparent); white-space: nowrap; }
.np-undo { display: inline; margin: 0 0 0 6px; } .np-undo .link { font-size: 12px; padding: 0; }
.rm-unproductive { border-left-color: #6b6b8a; background: color-mix(in srgb, #6b6b8a 8%, transparent); }
.np-field { display: flex !important; align-items: center; gap: 8px; flex-basis: 100%; font-size: 12.5px; color: var(--muted); }
.np-field input { width: 90px; flex: none; }

/* Report tables: the header row, the first column (Member, Project…) and the totals stay in view while scrolling */
.report-scroll { max-height: calc(100vh - 170px); overflow: auto; overscroll-behavior: contain; margin: 0; padding: 0; }
.report-scroll .t.report thead th { position: sticky; top: 0; z-index: 2; background: var(--surface); box-shadow: inset 0 -1px 0 var(--line); }
.report-scroll .t.report tfoot td { position: sticky; bottom: 0; z-index: 2; background: var(--surface); box-shadow: inset 0 1px 0 var(--line2); }
.report-scroll .t.report tr > :first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: inset -1px 0 0 var(--line); }
.report-scroll .t.report thead tr > :first-child, .report-scroll .t.report tfoot tr > :first-child { z-index: 3; }
@media (max-width: 640px) { .report-scroll { max-height: calc(100vh - 140px); } .report-scroll .t.report tr > :first-child { max-width: 46vw; } }
.t td.heat-click { cursor: pointer; padding: 0; }
.heat-link { display: block; padding: 8px 4px; color: inherit; text-decoration: none; }
.t td.heat-click:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.t td.heat .heat-p { display: block; font-weight: 400; font-size: 13px; }
.t td.heat .heat-l { display: block; font-size: 10.5px; color: var(--fg2); opacity: .8; margin-top: 1px; }
.t td.heat.heat-click .heat-link { padding: 6px 4px; }

/* ---------- Move tasks to another project ---------- */
.row-acts { display: inline-flex; align-items: center; gap: 6px; }
.row-acts details.sendback { margin: 0; }
details.move-one select { flex: 1; min-width: 0; }
.t th.tpick, .t td.tpick { width: 34px; padding-right: 0; cursor: default; }
.t td.tpick input, .t th.tpick input { appearance: auto; -webkit-appearance: checkbox; width: 16px; height: 16px; min-height: 0; padding: 0; margin: 0; border-radius: 3px; box-shadow: none; accent-color: var(--accent, #5b5bd6); cursor: pointer; vertical-align: middle; }
.task-move { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line2); }
.task-move select { flex: 1; min-width: 160px; max-width: 320px; }
.task-move .err { flex-basis: 100%; }
.task-move-note { margin: 6px 0 0; font-size: 12px; }

/* ---------- Work type: Designing / Development / Rework, with a colour dot ---------- */
.wt { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--fg2); white-space: nowrap; }
.wt-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--muted); }
.wt-dot.wt-design { background: var(--cat-7); }
.wt-dot.wt-dev { background: var(--cat-1); }
.wt-dot.wt-fix { background: var(--cat-2); }
.wt-line { margin-top: 3px; }
.wt-form { display: inline; margin: 0; }
.wt-pick { position: relative; cursor: pointer; border-radius: 6px; padding: 1px 4px 1px 2px; margin-left: -2px; }
.wt-pick:hover, .wt-pick:focus-within { background: var(--hover); color: var(--fg); }
.wt-caret { width: 12px; height: 12px; margin-left: 1px; flex: none; fill: none; stroke: var(--fg2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wt-pick select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; font-size: 13px; }

/* ---------- Score cards (admin) ---------- */
.sc { max-width: 720px; margin: 0 auto; display: grid; gap: 22px; padding: 24px 26px; }
.sc h3 { font-size: 13px; font-weight: 500; color: var(--fg2); margin: 0 0 8px; }
.sc-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.sc-who { display: flex; align-items: center; gap: 12px; }
.sc-who .av { width: 42px; height: 42px; font-size: 14px; font-weight: 500; }
.sc-who b { display: block; font-size: 17px; font-weight: 500; }
.sc-who small, .sc-when small { color: var(--fg2); font-size: 13px; }
.sc-when { display: grid; justify-items: end; gap: 4px; }
.sc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sc-k { background: var(--hover); border-radius: var(--r); padding: 10px 12px; display: grid; gap: 1px; }
.sc-k span { font-size: 12px; color: var(--fg2); }
.sc-k b { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; }
.sc-k small { font-size: 11.5px; color: var(--muted); }
.sc-days { display: grid; gap: 7px; margin-bottom: 8px; }
.sc-day { display: grid; grid-template-columns: 36px minmax(0, 1fr) 96px; align-items: center; gap: 10px; font-size: 13px; }
.sc-day > .num { text-align: right; }
.sc-track { height: 12px; background: var(--s-idle); border-radius: 4px; display: flex; gap: 2px; overflow: hidden; }
.sc-track > div { height: 100%; }
.sc-note { font-size: 12px; color: var(--fg2); }
.sc-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.sc-t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sc-t td { padding: 5px 0; border-top: 1px solid var(--line); }
.sc-t tr:first-child td { border-top: 0; }
.sc-t .r { text-align: right; padding-left: 12px; }
.sc-note-box textarea { width: 100%; resize: vertical; }
.sc-foot { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 640px) { .sc { padding: 18px 16px; } .sc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sc-two { grid-template-columns: 1fr; } .sc-day { grid-template-columns: 32px minmax(0, 1fr) 84px; } }
@media print {
  .side, .tabbar, .no-print, .side-team, .side-gear, .mob-me, .now-btn-mob, .bc-btn-mob, .flash { display: none !important; }
  body, main, .main { background: #fff !important; padding: 0 !important; margin: 0 !important; }
  .sc { box-shadow: none; border: 0; max-width: none; }
  .sc-note-box textarea { border: 0; padding: 0; resize: none; }
  .sc-note-box textarea:placeholder-shown { display: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Attendance & Breaks ---------- */
.att-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.att-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--fg2); }
.att-chip b { font-size: 15px; font-weight: 500; color: var(--fg); }
.att-chip.is-on { border-color: color-mix(in srgb, var(--crit) 40%, var(--line)); color: var(--crit-ink); }
.att-chip.is-on b { color: var(--crit-ink); }
.att-chip.is-est { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); color: var(--warn-ink); }
.att-t td { white-space: nowrap; }
.att-flag { margin: 1px 4px 1px 0; }
.att-t tr.is-sel td { background: var(--accent-soft); }
.att-line { margin: 0; font-size: 14px; color: var(--fg2); }
.att-line b { font-size: 18px; font-weight: 500; color: var(--fg); }
.att-tl { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 6px; }
.att-p { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13.5px; position: relative; }
.att-p::before { content: ""; position: absolute; left: -20px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--fg2); }
.att-p.is-ignored { opacity: .55; }
.att-time { min-width: 64px; }
.att-dir.is-in { color: var(--good-ink); background: color-mix(in srgb, currentColor 11%, transparent); }
.att-dir.is-out { color: var(--serious-ink); background: color-mix(in srgb, currentColor 11%, transparent); }
.att-gap { font-size: 12.5px; color: var(--fg2); padding: 2px 0 2px 74px; }
.att-gap.is-lunch { color: var(--accent-ink); }
.att-t tr.group-h td { background: none; padding: 22px 10px 8px; border-bottom: 1px solid var(--line); font-size: 13px; }
.att-t tr.group-h:hover td { background: none; }
.att-t .group-name { font-weight: 500; color: var(--fg); }
.att-chips { align-items: center; }
.att-csv { margin-left: auto; }
.att-now { font-size: 12.5px; white-space: nowrap; }
