/* BLOK Board – calm, warm-neutral UI for a small arch-viz studio */
:root {
  --bg: #f2f0ec;
  --surface: #ffffff;
  --surface-2: #f7f5f1;
  --line: #e6e2db;
  --line-2: #d6d0c6;
  --text: #24221f;
  --muted: #77716a;
  --faint: #aba59c;
  --accent: #c9632d;
  --accent-ink: #ad521f;
  --accent-soft: #fbede4;
  --danger: #c2453a;
  --ok: #4f8a5b;
  --client-wait: repeating-linear-gradient(135deg, transparent 0 7px, rgba(60,50,40,.045) 7px 14px);
  --shadow: 0 1px 2px rgba(40,30,20,.05), 0 2px 8px rgba(40,30,20,.04);
  --shadow-lift: 0 2px 4px rgba(40,30,20,.06), 0 10px 24px rgba(40,30,20,.09);
  --shadow-pop: 0 24px 64px rgba(30,20,10,.22), 0 2px 8px rgba(30,20,10,.08);
  --radius: 12px;
  --top-h: 56px;
  --logo-ink: #24221f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161513; --surface: #1f1e1b; --surface-2: #272522; --line: #33302c; --line-2: #45413b;
    --text: #ebe8e3; --muted: #a39d94; --faint: #6d685f;
    --accent: #e07f48; --accent-ink: #ec9462; --accent-soft: #3a2519;
    --danger: #e0675b; --ok: #6fae7b;
    --client-wait: repeating-linear-gradient(135deg, transparent 0 7px, rgba(255,255,255,.035) 7px 14px);
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.2);
    --shadow-lift: 0 2px 4px rgba(0,0,0,.4), 0 10px 24px rgba(0,0,0,.35);
    --shadow-pop: 0 24px 64px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.4);
    --logo-ink: #ebe8e3;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #161513; --surface: #1f1e1b; --surface-2: #272522; --line: #33302c; --line-2: #45413b;
  --text: #ebe8e3; --muted: #a39d94; --faint: #6d685f;
  --accent: #e07f48; --accent-ink: #ec9462; --accent-soft: #3a2519;
  --danger: #e0675b; --ok: #6fae7b;
  --client-wait: repeating-linear-gradient(135deg, transparent 0 7px, rgba(255,255,255,.035) 7px 14px);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.2);
  --shadow-lift: 0 2px 4px rgba(0,0,0,.4), 0 10px 24px rgba(0,0,0,.35);
  --shadow-pop: 0 24px 64px rgba(0,0,0,.6), 0 2px 8px rgba(0,0,0,.4);
  --logo-ink: #ebe8e3;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
b, strong { font-weight: 600; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
/* project numbers & figures: Inter tabular digits (clear 0 vs 8, no mono font) */
.card-top .num, .timer-chip .t-name b, .list-item .grow b, .pick button b, .big-timer .what b, .np-num .mini-input, .fx-row .mini-input,
table:has(td.proj-name) tbody td:first-child b { font-variant-numeric: tabular-nums; letter-spacing: .02em; font-weight: 650; }
:focus-visible { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }

/* scrollbars – thin and quiet */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  height: var(--top-h); padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand-logo {
  width: 22px; height: 25px; flex: none; background: var(--logo-ink);
  -webkit-mask: url("logo-blok.png") center / contain no-repeat; mask: url("logo-blok.png") center / contain no-repeat;
}
.brand-mark { font-weight: 700; letter-spacing: .2em; font-size: 13.5px; }
.brand-sub { color: var(--muted); font-size: 13px; font-weight: 500; margin-left: -3px; }
.tabs { display: flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.tabs button {
  border: 0; background: none; padding: 5px 13px; border-radius: 7px; color: var(--muted); font-weight: 500; font-size: 13.5px; white-space: nowrap;
  transition: background .12s, color .12s;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); font-weight: 600; }
.tabs button[hidden] { display: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; min-width: 0; }
.me-select { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }

/* form controls – one look everywhere */
.me-select select, .field select, .field input, .toolbar select, .toolbar input:not([type="checkbox"]), .mini-input {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 5px 9px; min-height: 32px;
  transition: border-color .12s, box-shadow .12s;
}
.field select, .field input { min-height: 36px; padding: 7px 10px; }
.me-select select:hover, .field select:hover, .field input:hover, .toolbar select:hover, .mini-input:hover { border-color: var(--faint); }
.me-select select:focus, .field select:focus, .field input:focus, .toolbar select:focus, .toolbar input:focus, .mini-input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.icon-btn {
  border: 1px solid var(--line); background: var(--surface); border-radius: 8px; width: 34px; height: 34px; color: var(--muted); font-size: 15px;
  display: grid; place-items: center; flex: none;
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }

.timer-chip {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 4px 0 14px; min-width: 0;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); max-width: 400px; font-size: 13px;
}
.timer-chip.idle { color: var(--muted); }
.timer-chip.running { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.timer-chip .t-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.timer-chip .t-name b { font-family: Inter, system-ui, sans-serif; font-size: 12px; margin-right: 2px; }
.timer-chip .t-time { font-weight: 600; color: var(--accent-ink); }
.timer-chip .btn.small { height: 28px; padding: 0 12px; border-radius: 999px; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-in-out infinite; flex: none; display: inline-block; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.85); } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 6px 13px; font-weight: 500; min-height: 32px;
  transition: border-color .12s, background .12s, color .12s;
}
.btn:hover { border-color: var(--faint); background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: color-mix(in srgb, var(--danger) 50%, transparent); }
.btn.small { padding: 3px 10px; font-size: 12.5px; min-height: 28px; }
.btn.stop { background: var(--text); color: var(--surface); border-color: var(--text); border-radius: 999px; }
.btn.stop:hover { background: color-mix(in srgb, var(--text) 85%, var(--accent)); }

/* ---------- page ---------- */
main { padding: 18px 20px 28px; }
.toolbar { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; margin-bottom: 16px; min-height: 34px; }
.toolbar h1 { font-size: 20px; font-weight: 650; letter-spacing: -.015em; margin: 0 10px 0 0; }
.toolbar .spacer { flex: 1; }
.check { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; user-select: none; cursor: pointer; }
.legend { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 12px; color: var(--faint); }

/* ---------- propozycje feedbacku nad boardem ---------- */
.proposals { flex: none; max-height: 30vh; overflow-y: auto; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.proposals-title { padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.proposal { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.proposal-conf { flex: none; width: 44px; padding: 1px 0; text-align: center; font-size: 11px; font-weight: 600; border-radius: 6px; border: 1px dashed var(--line-2); color: var(--muted); }
.proposal.high .proposal-conf { border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); color: var(--accent-ink); }
.proposal-body { flex: 1; min-width: 0; }
.proposal-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.proposal-task { cursor: pointer; }
.proposal-task:hover { color: var(--accent-ink); }
.proposal-move { color: var(--muted); font-size: 12px; }
.proposal-pick { max-width: 100%; }
.proposal-summary { color: var(--muted); margin-top: 2px; }
.proposal-quote { color: var(--faint); font-size: 12px; margin-top: 2px; }
.proposal-actions { flex: none; display: flex; align-items: center; gap: 6px; }
.proposal-link { font-size: 12px; color: var(--muted); margin-right: 4px; }
@media (max-width: 640px) { .proposal { flex-wrap: wrap; } .proposal-body { flex-basis: 70%; } }

/* ---------- board ---------- */
main:has(> .board) { display: flex; flex-direction: column; height: calc(100dvh - var(--top-h)); padding-bottom: 12px; }
.board {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: stretch;
  flex: 1; min-height: 360px; cursor: grab; user-select: none;
}
body.board-panning, body.board-panning * { cursor: grabbing !important; }
.col {
  --col: #8a8680;
  flex: 0 0 280px; display: flex; flex-direction: column; border-radius: var(--radius); min-height: 0;
  background: color-mix(in srgb, var(--col) 9%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--col) 20%, var(--line));
}
.col.client { background: var(--client-wait), color-mix(in srgb, var(--col) 7%, var(--surface-2)); }
.col.client { opacity: .7; transition: opacity .15s; }
.col.client.drop-over { opacity: 1; }
.col.narrow { flex-basis: 240px; }
.col-head {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 14px; flex: none;
  font-weight: 600; font-size: 13px; letter-spacing: .005em;
  color: #fff; background: var(--col); border-radius: 11px 11px 0 0;
  text-shadow: 0 1px 1px rgba(0,0,0,.12);
}
.col.client .col-head { background: var(--client-wait), var(--col); }
.col-head .count {
  margin-left: auto; font-weight: 600; background: rgba(255,255,255,.22); border-radius: 999px;
  min-width: 24px; height: 20px; padding: 0 7px; font-size: 11.5px; display: grid; place-items: center; text-shadow: none;
}
.col-body { padding: 10px 10px 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 60px; }
.col.collapsed { flex: 0 0 44px; cursor: pointer; border: 0; background: none; }
.col.collapsed .col-head { flex-direction: column; justify-content: flex-start; height: 100%; border-radius: var(--radius); padding: 10px 0; gap: 12px; opacity: .9; }
.col.collapsed:hover .col-head { opacity: 1; }
.col.collapsed .count { margin: 0; }
.col.collapsed .vlabel { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-size: 12.5px; }
.col.drop-over { outline: 2px dashed var(--col); outline-offset: -3px; }

.card {
  background: color-mix(in srgb, var(--col) 17%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--col) 26%, var(--surface)); border-radius: 10px;
  box-shadow: var(--shadow); cursor: grab; position: relative; overflow: hidden; flex: none;
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s;
}
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.card:active { cursor: grabbing; }
.card.dragging { opacity: .4; }
.card.waiting { box-shadow: none; }
.card.hold { opacity: .5; filter: grayscale(1); box-shadow: none; }
.card.hold:hover { opacity: .85; }
.card.running { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow); }
.cover { aspect-ratio: 16 / 9; background: center / cover no-repeat var(--surface-2); border-bottom: 1px solid color-mix(in srgb, var(--col, #888) 20%, transparent); }
.card-in { padding: 11px 12px 10px; }
.card-top { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); min-width: 0; }
.card-top .num {
  flex: none; font-weight: 650; color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: .02em;
  padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--col) 22%, var(--surface));
}
.card-top .proj { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.card-top .badge { margin-left: auto; flex: none; }
.card-name { font-weight: 600; font-size: 14.5px; margin: 7px 0 3px; line-height: 1.32; letter-spacing: -.005em; text-wrap: pretty; }
.card-client { font-size: 12.5px; color: var(--muted); }
.card-meta {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted);
  margin-top: 10px; padding-top: 9px; border-top: 1px solid color-mix(in srgb, var(--col) 20%, transparent);
}
.card-meta .spacer { flex: 1; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; line-height: 18px; padding: 0 7px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.badge.hold { background: var(--text); color: var(--surface); border-color: var(--text); font-weight: 600; letter-spacing: .05em; font-size: 10px; }
.badge.wait { border-style: dashed; border-color: var(--line-2); }
.badge.late { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.badge.high { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); font-weight: 600; }
.badge.fb { cursor: pointer; color: var(--text); border-color: var(--line-2); background: var(--surface); font-weight: 600; }
.badge.fb:hover { border-color: var(--accent); color: var(--accent-ink); }
.avatars { display: flex; }
.av {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 9.5px; font-weight: 700; letter-spacing: .02em;
  color: #fff; border: 2px solid var(--surface); margin-left: -6px; flex: none;
}
.avatars .av:first-child { margin-left: 0; }
.av.empty { background: transparent; border: 1px dashed var(--faint); color: var(--faint); }
.play {
  width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted);
  display: grid; place-items: center; font-size: 9px; flex: none; padding: 0 0 0 1px; transition: all .12s;
}
.play:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.play.on { background: var(--accent); color: #fff; border-color: var(--accent); padding: 0; }

/* ---------- panels & tables ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.panel + .panel { margin-top: 16px; }
.panel h2 { font-size: 13px; font-weight: 600; margin: 0; padding: 13px 16px; border-bottom: 1px solid var(--line); letter-spacing: .01em; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; white-space: nowrap;
  background: var(--surface-2); padding-top: 8px; padding-bottom: 8px;
}
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:has([data-field="client"]) > td:nth-child(2) { min-width: 200px; font-weight: 500; }
tr.hold td { opacity: .45; }
tr.clickable { cursor: pointer; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
tfoot td { font-weight: 600; border-top: 1px solid var(--line-2); border-bottom: 0; background: var(--surface-2); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; min-width: 0; }
.chip i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; flex: none; }
.bar { height: 6px; background: color-mix(in srgb, var(--line) 70%, var(--surface-2)); border-radius: 3px; overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.bar.warn > span { background: var(--accent); }
.bar.over > span { background: var(--danger); }
.mini-input { width: 80px; min-height: 30px; padding: 4px 8px; }
td .mini-input { background: transparent; border-color: transparent; }
td .mini-input:hover { border-color: var(--line-2); background: var(--surface); }
td .mini-input:focus { background: var(--surface); }
.toggle {
  appearance: none; width: 32px; height: 18px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer;
  vertical-align: middle; margin: 0; flex: none; transition: background .15s;
}
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .15s; }
.toggle:checked { background: var(--accent); }
.toggle:checked::after { transform: translateX(14px); }

/* ---------- my day ---------- */
.today-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.big-timer { padding: 22px 22px 18px; display: flex; align-items: center; gap: 18px; }
.big-timer .play { box-shadow: var(--shadow); }
.big-timer .clock { font-size: 38px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.big-timer .what { color: var(--muted); margin-top: 2px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item[data-act="open"]:hover, .list-item .grow[data-act="open"]:hover { background-color: var(--surface-2); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow > div:first-child { overflow: hidden; text-overflow: ellipsis; }
.list-item .grow b { font-family: Inter, system-ui, sans-serif; font-size: 12px; margin-right: 3px; }
.list-item .sub { font-size: 12px; color: var(--muted); }
.stat-row { display: flex; gap: 10px; padding: 0 16px 16px; }
.stat { flex: 1; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.stat .k { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.stat .v { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.empty-note { padding: 20px 16px; color: var(--muted); }

/* ---------- calendar (gantt month) ---------- */
.gcal { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.gcal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.gcal-head div { padding: 8px 10px; font-size: 10.5px; color: var(--muted); text-transform: uppercase; font-weight: 600; letter-spacing: .07em; }
.wk {
  position: relative; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 22px; row-gap: 4px;
  min-height: 132px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.wk:last-child { border-bottom: 0; }
.wk-bg { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(7, 1fr); pointer-events: none; }
.wk-bg div { border-right: 1px solid var(--line); }
.wk-bg div:last-child { border-right: 0; }
.wk-bg .weekend { background: color-mix(in srgb, var(--surface-2) 75%, var(--surface)); }
.wk-bg .other { background: var(--surface-2); }
.wk-bg .today { background: var(--accent-soft); box-shadow: inset 0 2px 0 var(--accent); }
.wk-num { position: relative; text-align: right; padding: 4px 9px 0; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.wk-num.other { color: var(--faint); font-weight: 500; }
.wk-num.today { color: var(--accent-ink); }
.gbar {
  position: relative; margin: 0 3px; padding: 0 8px; border-radius: 6px; line-height: 22px; font-size: 11.5px; font-weight: 500;
  color: #fff; background: var(--bar); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  text-shadow: 0 1px 1px rgba(0,0,0,.2); box-shadow: inset 0 -1px 0 rgba(0,0,0,.08);
  transition: filter .12s;
}
.gbar:hover { filter: brightness(1.07) saturate(1.05); }
.gbar.cont-l { border-top-left-radius: 0; border-bottom-left-radius: 0; margin-left: 0; }
.gbar.cont-r { border-top-right-radius: 0; border-bottom-right-radius: 0; margin-right: 0; }
.gbar.derived { background: repeating-linear-gradient(135deg, var(--bar) 0 8px, color-mix(in srgb, var(--bar) 84%, #fff) 8px 14px); }
.gbar.done { opacity: .5; }
.gbar.held { filter: grayscale(1); opacity: .5; }
.gbar.abs {
  color: var(--muted); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bar) 28%, var(--surface)) 0 6px, color-mix(in srgb, var(--bar) 18%, var(--surface)) 6px 12px);
  text-shadow: none; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bar) 35%, transparent); font-style: italic;
}

/* ---------- drawer ---------- */
.shade { position: fixed; inset: 0; background: rgba(20,16,12,.28); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
.shade.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); background: var(--surface);
  border-left: 1px solid var(--line); z-index: 31; transform: translateX(100%); transition: transform .24s cubic-bezier(.2,.7,.2,1);
  overflow-y: auto; box-shadow: var(--shadow-pop);
}
.drawer.open { transform: none; }
.drawer-head { padding: 18px 22px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.drawer-head .crumb { font-size: 12px; color: var(--muted); }
.drawer-head h3 { margin: 6px 0 0; font-size: 20px; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; }
.drawer-head .x { width: 30px; height: 30px; border-radius: 8px; font-size: 14px; color: var(--muted); }
.drawer-head .x:hover { background: var(--surface-2); color: var(--text); }
.drawer-body { padding: 18px 22px 28px; display: flex; flex-direction: column; gap: 18px; }
.drawer-body > .row:first-child { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.people { display: flex; gap: 6px; flex-wrap: wrap; }
.person-tag {
  border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 11px 3px 3px; display: flex; align-items: center; gap: 7px;
  background: var(--surface); font-size: 13px; transition: all .12s;
}
.person-tag:not(.on) { color: var(--muted); }
.person-tag:not(.on) .av { opacity: .45; filter: grayscale(.6); }
.person-tag .av { margin: 0; width: 22px; height: 22px; border: 0; }
.person-tag:hover { border-color: var(--faint); }
.person-tag.on { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); font-weight: 500; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.entry-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.entry-row:last-child { border-bottom: 0; }
.entry-row .av { margin: 0; border: 0; }
.entry-row .grow { flex: 1; color: var(--muted); }
.entry-row[data-act] { cursor: pointer; }
.entry-row[data-act]:hover .grow { color: var(--accent-ink); }
.today-grid .list-item[data-act="edit-entry"]:hover { background-color: var(--surface-2); }
.timer-chip .t-time[data-act] { cursor: pointer; }
.since-edit { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.since-edit:hover { color: var(--accent-ink); }
.x { border: 0; background: none; color: var(--faint); font-size: 16px; line-height: 1; border-radius: 6px; display: grid; place-items: center; }
.x:hover { color: var(--danger); }
.drawer .cover { border-radius: 10px; border: 1px solid var(--line); }

/* ---------- modal ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 16px;
  background: rgba(20,16,12,.42); backdrop-filter: blur(3px);
}
.modal-wrap.open { display: grid; }
.modal {
  background: var(--surface); border-radius: 16px; width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  box-shadow: var(--shadow-pop); border: 1px solid var(--line); animation: pop .2s cubic-bezier(.2,.7,.2,1);
}
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { padding: 22px 22px 6px; display: flex; gap: 14px; align-items: flex-start; }
.modal-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 18px; flex: none; }
.modal-head h3 { margin: 1px 0 0; font-size: 16.5px; font-weight: 650; letter-spacing: -.01em; }
.modal-head p { margin: 4px 0 0; color: var(--muted); }
.modal-body { padding: 10px 22px 4px; }
.modal-actions { padding: 16px 22px 20px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.pick-search { position: relative; display: block; margin-bottom: 10px; }
.pick-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pick-search input {
  width: 100%; min-height: 36px; padding: 6px 10px 6px 32px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px;
  transition: border-color .12s, box-shadow .12s;
}
.pick-search input:hover { border-color: var(--faint); }
.pick-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.pick [hidden] { display: none !important; }
.pick { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; margin: 0 -4px; padding: 2px 4px; }
.pick button {
  text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 9px 12px;
  display: flex; gap: 8px; align-items: center; transition: border-color .12s, background .12s; flex: none;
}
.pick button b { font-family: Inter, system-ui, sans-serif; font-size: 12px; margin-right: 3px; }
.pick button:hover { border-color: var(--accent); background: var(--accent-soft); }
.pick .sub { color: var(--muted); font-size: 12px; }
.pick > .sub { text-transform: uppercase; letter-spacing: .07em; font-size: 10.5px; font-weight: 600; margin-top: 10px !important; }

.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60; pointer-events: none; }
.toast { background: var(--text); color: var(--surface); padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lift); animation: pop .2s; max-width: calc(100vw - 32px); }

.settings-grid { display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; align-items: center; }
.settings-grid > span { color: var(--muted); }
.demo-box { margin-top: 16px; padding: 14px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--surface-2); }
.demo-box .row { margin-top: 10px; }

/* ---------- tablet / mobile ---------- */
@media (max-width: 900px) {
  :root { --top-h: auto; }
  .topbar { flex-wrap: wrap; gap: 10px 12px; padding: 10px 16px; height: auto; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .tabs button { flex: 1 0 auto; }
  .topbar-right { margin-left: auto; gap: 8px; }
  .timer-chip { max-width: 240px; }
  main { padding: 16px 16px 40px; }
  main:has(> .board) { height: auto; display: block; }
  .board { height: calc(100dvh - 190px); min-height: 420px; scroll-snap-type: x proximity; margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; }
  .col { scroll-snap-align: start; }
  .today-grid { grid-template-columns: 1fr; }
  .gbar { font-size: 10px; padding: 0 4px; }
  .panel { overflow-x: auto; }
  .toolbar .legend { display: none; }
}
@media (max-width: 560px) {
  .me-select > span { display: none; }
  .brand-sub { display: none; }
  .tabs button { flex: 1 1 auto; padding: 5px 6px; font-size: 12.5px; }
  .stat-row .stat:last-child { flex-basis: 100%; }
  .timer-chip { max-width: 190px; padding-left: 12px; }
  .timer-chip.running .t-name { display: none; }
  .col { flex-basis: min(300px, calc(100vw - 56px)); }
  .col.narrow { flex-basis: min(260px, calc(100vw - 72px)); }
  .stat-row { flex-wrap: wrap; }
  .stat { flex: 1 1 calc(50% - 5px); }
  .big-timer { padding: 18px 16px 14px; gap: 14px; }
  .big-timer .clock { font-size: 30px; }
  .gcal-head div { padding: 6px 4px; font-size: 9.5px; letter-spacing: .03em; text-align: center; }
  .wk-num { padding: 3px 4px 0; font-size: 11px; }
  .gbar { margin: 0 1px; border-radius: 4px; font-size: 9.5px; }
  .drawer-head, .drawer-body { padding-left: 16px; padding-right: 16px; }
  .modal-head, .modal-body, .modal-actions { padding-left: 18px; padding-right: 18px; }
  .settings-grid { grid-template-columns: 1fr; gap: 6px; }
  .settings-grid > span { margin-top: 6px; }
}

/* My day: klasy z app.js v5 */
.play.big { width: 52px; height: 52px; font-size: 16px; }
.list-item.hold { opacity: .45; filter: grayscale(1); }
.list-item.waiting { background: var(--client-wait); }
.list-item.waiting:hover { background: var(--client-wait), var(--surface-2); }

/* ---------- Projects: billing / estimate (admin) ---------- */
.est-btn {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-size: 12.5px; font-weight: 500;
  border: 1px solid transparent; background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 2px 10px; min-height: 26px;
  transition: border-color .12s, background .12s, color .12s;
}
.est-btn:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); color: var(--accent-ink); }
.est-low, td.est-low { color: var(--danger) !important; font-weight: 600; }
.est { display: flex; flex-direction: column; gap: 16px; }
.est-mode { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; align-self: flex-start; }
.est-mode .check { padding: 5px 14px; border-radius: 7px; color: var(--muted); font-weight: 500; transition: background .12s, color .12s; }
.est-mode .check input { position: absolute; opacity: 0; pointer-events: none; }
.est-mode .check:has(input:checked) { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 0 0 1px var(--line); }
.est-mode .check:has(input:focus-visible) { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 1px; }
.est .settings-grid .mini-input { min-height: 34px; text-align: right; }
.est-extras { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.est-extras > .sub { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; color: var(--muted); }
.est-extras > .btn { align-self: flex-start; }
.est-extra { flex-wrap: nowrap; }
.est-extra .mini-input { background: var(--surface); min-width: 0; }
.est-extra .x { width: 28px; height: 28px; flex: none; }
.est-extra .x:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.est-summary {
  display: grid; grid-template-columns: 1fr auto; gap: 7px 16px; align-items: baseline;
  padding: 14px 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
}
.est-summary > span { color: var(--muted); font-size: 13px; }
.est-summary > b { text-align: right; font-weight: 600; }
.est-summary > .bar, .est-summary > p { grid-column: 1 / -1; }
.est-summary > .bar { height: 8px; margin-top: 6px; background: color-mix(in srgb, var(--line) 80%, var(--surface)); }
.est-note { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.est-verdict { margin: 2px 0 0; padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; }
.est-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 11%, var(--surface)); }
.est-warn { color: var(--accent-ink); background: var(--accent-soft); }
.est-over { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
/* ---------- currency (EUR / USD) ---------- */
.cur-tag {
  display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; vertical-align: 1px;
  font: 600 9.5px/16px Inter, system-ui, sans-serif; letter-spacing: .06em;
  color: color-mix(in srgb, #3f7fbf 85%, var(--text)); background: color-mix(in srgb, #3f7fbf 12%, var(--surface));
  border: 1px solid color-mix(in srgb, #3f7fbf 28%, transparent);
}
.fx-note { margin-left: 3px; font: 600 9.5px/1 Inter, system-ui, sans-serif; letter-spacing: .07em; color: var(--muted); vertical-align: 1px; }
/* mode switch + currency on one line: the two radios keep the segmented look */
.est-mode:has(.est-cur) { display: flex; align-self: stretch; align-items: center; gap: 0; padding: 0; background: none; border: 0; }
.est-mode:has(.est-cur) .check { background: var(--surface-2); border: 1px solid var(--line); border-radius: 0; padding: 5px 14px; }
.est-mode:has(.est-cur) .check:first-of-type { border-radius: 9px 0 0 9px; border-right: 0; }
.est-mode:has(.est-cur) .check:nth-of-type(2) { border-radius: 0 9px 9px 0; border-left: 0; }
.est-mode:has(.est-cur) .check:has(input:checked) { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.np-billing .est-mode:has(.est-cur) { background: none; }
.est-mode .spacer { flex: 1; min-width: 12px; }
.est-mode .check.est-cur, .est-cur { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.est-cur .mini-input { width: auto; min-height: 30px; padding: 3px 26px 3px 10px; border-radius: 999px; font-weight: 600; font-size: 12.5px; background-color: var(--surface); }
.fx-row { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; max-width: 220px; justify-self: end; }
.settings-grid:has(.fx-row) { grid-template-columns: minmax(150px, 1fr) auto; }
.fx-row .mini-input { font-family: Inter, system-ui, sans-serif; text-align: right; }
.fx-meta { flex-basis: 100%; text-align: right; font-size: 11.5px; color: var(--faint); }
@media (max-width: 560px) {
  .settings-grid:has(.fx-row) { grid-template-columns: 1fr; }
  .fx-row { justify-content: flex-start; justify-self: start; max-width: none; }
  .fx-meta { text-align: left; }
}

/* ---------- New project modal ---------- */
.btn.np-open { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-ink); font-weight: 600; }
.btn.np-open:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.np { display: flex; flex-direction: column; gap: 14px; }
.np [hidden] { display: none !important; }
.np-grid { grid-template-columns: 150px minmax(0, 1fr); gap: 10px 14px; }
.np-billing .np-grid { grid-template-columns: 135px minmax(0, 1fr); }
.np-grid > .mini-input, .np-grid > select.mini-input { width: 100% !important; min-height: 34px; }
.np-grid .check { color: var(--muted); }
.np-grid .check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.np-num { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.np-num .mini-input { min-height: 34px; font-family: Inter, system-ui, sans-serif; font-weight: 600; }
.np-warn {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; line-height: 20px; padding: 0 9px; border-radius: 999px;
  color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
}
.np-warn::before { content: "!"; font-weight: 700; }
.np-newclient { padding: 12px; margin: -4px 0 0; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.np-color {
  appearance: none; -webkit-appearance: none; width: 44px; height: 32px; padding: 3px; cursor: pointer;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface);
}
.np-color::-webkit-color-swatch-wrapper { padding: 0; }
.np-color::-webkit-color-swatch { border: 0; border-radius: 5px; }
.np-color::-moz-color-swatch { border: 0; border-radius: 5px; }
.np-billing { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.np-billing > .sub { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; color: var(--muted); }
.np-billing .est-mode { background: var(--surface); }
.np-billing .est-mode .check:has(input:checked) { background: var(--surface-2); }
.np-billing .mini-input { background: var(--surface); }
.np-grid > span.np-views:not(:first-child) { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.np-grid > .np-hourly.mini-input, .np-grid > #npBudget, .np-grid > #npRate { width: 120px !important; }

@media (max-width: 560px) {
  .np-grid { grid-template-columns: 1fr; gap: 5px; }
  .np-grid > span:not(.np-num):not(.np-views) { margin-top: 6px; }
  .np-grid > span.np-views:not(:first-child) { margin-top: 0; }
  .est .settings-grid { grid-template-columns: 1fr auto; gap: 10px 12px; }
  .est .settings-grid > span { margin-top: 0; }
}

/* ---------- Board palettes (html[data-palette]); "earth" = data.js colours ---------- */
/* soft – light pastels, dark text on column headers */
:root[data-palette="soft"] .col[data-status="pending"]          { --col: #bdb8b1 !important; }
:root[data-palette="soft"] .col[data-status="to do"]            { --col: #f1c7a4 !important; }
:root[data-palette="soft"] .col[data-status="phase 0 - clay"]   { --col: #f2d39a !important; }
:root[data-palette="soft"] .col[data-status="phase 1"]          { --col: #e9df9c !important; }
:root[data-palette="soft"] .col[data-status="phase 2"]          { --col: #d3e2a2 !important; }
:root[data-palette="soft"] .col[data-status="final comments"]   { --col: #bfdeae !important; }
:root[data-palette="soft"] .col[data-status="render"]           { --col: #acd8bc !important; }
:root[data-palette="soft"] .col[data-status="post-production"]  { --col: #a2d2c6 !important; }
:root[data-palette="soft"] .col[data-status^="awaiting"]        { --col: #d2cec8 !important; }
:root[data-palette="soft"] .col[data-status="done"]             { --col: #93cb9f !important; }
:root[data-palette="soft"] .col[data-status="complete"]         { --col: #c6c3bd !important; }
:root[data-palette="soft"] .col { background: color-mix(in srgb, var(--col) 16%, var(--surface-2)); border-color: color-mix(in srgb, var(--col) 45%, var(--line)); }
:root[data-palette="soft"] .col.client { background: var(--client-wait), color-mix(in srgb, var(--col) 14%, var(--surface-2)); }
:root[data-palette="soft"] .col-head { color: #2b2723; text-shadow: none; }
:root[data-palette="soft"] .col-head .count { background: rgba(40,30,20,.1); }
:root[data-palette="soft"] .card { background: color-mix(in srgb, var(--col) 30%, var(--surface)); border-color: color-mix(in srgb, var(--col) 60%, var(--surface)); }
:root[data-palette="soft"] .card-top .num { background: color-mix(in srgb, var(--col) 55%, var(--surface)); }
:root[data-palette="soft"] .card-meta { border-top-color: color-mix(in srgb, var(--col) 50%, transparent); }
@media (prefers-color-scheme: dark) {
  :root[data-palette="soft"]:not([data-theme="light"]) .col-head { background: color-mix(in srgb, var(--col) 42%, var(--surface)); color: var(--text); }
  :root[data-palette="soft"]:not([data-theme="light"]) .col.client .col-head { background: var(--client-wait), color-mix(in srgb, var(--col) 42%, var(--surface)); }
  :root[data-palette="soft"]:not([data-theme="light"]) .col-head .count { background: rgba(255,255,255,.12); }
  :root[data-palette="soft"]:not([data-theme="light"]) .col { background: color-mix(in srgb, var(--col) 7%, var(--surface-2)); border-color: color-mix(in srgb, var(--col) 22%, var(--line)); }
  :root[data-palette="soft"]:not([data-theme="light"]) .card { background: color-mix(in srgb, var(--col) 16%, var(--surface)); border-color: color-mix(in srgb, var(--col) 30%, var(--surface)); }
  :root[data-palette="soft"]:not([data-theme="light"]) .card-top .num { background: color-mix(in srgb, var(--col) 30%, var(--surface)); }
}
:root[data-palette="soft"][data-theme="dark"] .col-head { background: color-mix(in srgb, var(--col) 42%, var(--surface)); color: var(--text); }
:root[data-palette="soft"][data-theme="dark"] .col.client .col-head { background: var(--client-wait), color-mix(in srgb, var(--col) 42%, var(--surface)); }
:root[data-palette="soft"][data-theme="dark"] .col-head .count { background: rgba(255,255,255,.12); }
:root[data-palette="soft"][data-theme="dark"] .col { background: color-mix(in srgb, var(--col) 7%, var(--surface-2)); border-color: color-mix(in srgb, var(--col) 22%, var(--line)); }
:root[data-palette="soft"][data-theme="dark"] .card { background: color-mix(in srgb, var(--col) 16%, var(--surface)); border-color: color-mix(in srgb, var(--col) 30%, var(--surface)); }
:root[data-palette="soft"][data-theme="dark"] .card-top .num { background: color-mix(in srgb, var(--col) 30%, var(--surface)); }

/* slate – cool blue-grey → teal → green; the warm accent stays the only highlight */
:root[data-palette="slate"] .col[data-status="pending"]         { --col: #5f646c !important; }
:root[data-palette="slate"] .col[data-status="to do"]           { --col: #64748a !important; }
:root[data-palette="slate"] .col[data-status="phase 0 - clay"]  { --col: #5a7792 !important; }
:root[data-palette="slate"] .col[data-status="phase 1"]         { --col: #4f7f99 !important; }
:root[data-palette="slate"] .col[data-status="phase 2"]         { --col: #48879b !important; }
:root[data-palette="slate"] .col[data-status="final comments"]  { --col: #438d96 !important; }
:root[data-palette="slate"] .col[data-status="render"]          { --col: #42918b !important; }
:root[data-palette="slate"] .col[data-status="post-production"] { --col: #43927c !important; }
:root[data-palette="slate"] .col[data-status^="awaiting"]       { --col: #8d939b !important; }
:root[data-palette="slate"] .col[data-status="done"]            { --col: #3e8560 !important; }
:root[data-palette="slate"] .col[data-status="complete"]        { --col: #7b8189 !important; }
:root[data-palette="slate"] .col { background: color-mix(in srgb, var(--col) 8%, var(--surface-2)); }
:root[data-palette="slate"] .card { background: color-mix(in srgb, var(--col) 12%, var(--surface)); }

/* ---------- Projects page (table with td.proj-name; works with and without admin € columns) ---------- */
.panel:has(> table td.proj-name) { overflow-x: auto; }
table:has(td.proj-name) { min-width: 640px; }
table:has(td.proj-name) th { position: sticky; top: 0; z-index: 1; }
table:has(td.proj-name) td { padding-top: 12px; padding-bottom: 12px; }
table:has(td.proj-name) tbody td:first-child { width: 1%; padding-right: 4px; }
table:has(td.proj-name) tbody td:first-child b {
  display: inline-block; min-width: 42px; text-align: center; font-size: 12px; font-weight: 600; line-height: 22px; padding: 0 7px;
  border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
}
td.proj-name { font-weight: 600; font-size: 14px; letter-spacing: -.005em; min-width: 200px; }
td.proj-name .badge { margin-left: 6px; vertical-align: 1px; }
@media (min-width: 901px) { td.proj-name { white-space: nowrap; } }
/* client select reads like a chip and sizes to the full client name */
tbody select[data-field="client"] {
  width: auto !important; min-width: 150px; max-width: 280px; field-sizing: content;
  border-radius: 999px; padding: 3px 28px 3px 12px; min-height: 28px; font-size: 13px;
  background: var(--surface-2); border-color: var(--line);
}
tbody select[data-field="client"]:hover { border-color: var(--line-2); background-color: var(--surface); }
/* ON HOLD rows: greyed, with a left marker */
table:has(td.proj-name) tr.hold td { opacity: 1; color: var(--muted); background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
table:has(td.proj-name) tr.hold td:first-child { box-shadow: inset 3px 0 0 var(--faint); }
table:has(td.proj-name) tr.hold td > *:not(.toggle):not(.badge):not(.proj-open) { opacity: .6; filter: grayscale(1); }
/* archive rows (sorted last): separated from the active list */
table:has(td.proj-name) tr.archived td, table:has(td.proj-name) tr[style*="opacity"] td { background: var(--surface-2); }
table:has(td.proj-name) tr:not(.archived):not([style*="opacity"]) + tr:is(.archived, [style*="opacity"]) td { border-top: 2px solid var(--line-2); }
table:has(td.proj-name) tfoot td { padding-top: 11px; padding-bottom: 11px; }

/* archive group (tr.group-row header + tr.archived rows) */
table:has(td.proj-name) tr.group-row td {
  padding: 18px 14px 8px; background: var(--surface); border-top: 1px solid var(--line-2);
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--muted);
}
table:has(td.proj-name) tr.group-row:hover td { background: var(--surface); }
table:has(td.proj-name) tr.group-row + tr td { border-top: 0 !important; }
table:has(td.proj-name) tr.archived td { color: var(--muted); }
table:has(td.proj-name) tr.archived td.proj-name { font-weight: 500; }
table:has(td.proj-name) tr.archived td:first-child b { background: transparent; border-style: dashed; color: var(--muted); }

/* project name toggles the expandable task panel */
.proj-open {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer;
}
.proj-chev { flex: none; width: 11px; font-size: 13px; color: var(--muted); }
.proj-open:hover { color: var(--accent-ink); }
.proj-open:hover .proj-chev { color: inherit; }
tr:has(+ tr.pt-row) td { background: var(--surface-2); border-bottom-color: transparent; }
table:has(td.proj-name) tr.pt-row > td, table:has(td.proj-name) tr.pt-row:hover > td { padding: 0 14px 16px; background: var(--surface-2); }
.pt-panel {
  display: flex; flex-direction: column; gap: 12px; padding: 12px; margin-left: 50px;
  position: sticky; left: 64px; width: min(860px, calc(100vw - 130px));
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow);
}
.pt-panel > .empty-note { padding: 6px 4px; }
.pt-list { display: flex; flex-direction: column; }
.pt-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto 56px; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background .12s;
}
.pt-item + .pt-item { border-top: 1px solid var(--line); }
.pt-item:hover { background: var(--surface-2); }
.pt-tname { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-status {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; line-height: 20px; padding: 0 9px 0 8px;
  border-radius: 999px; white-space: nowrap; color: var(--text);
  background: color-mix(in srgb, var(--col) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--col) 32%, transparent);
}
.pt-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--col); flex: none; }
.pt-item .avatars { justify-self: end; }
.pt-hours { text-align: right; color: var(--muted); font-size: 12px; }
.pt-item.hold { opacity: .5; filter: grayscale(1); }
.pt-item.done .pt-tname { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.pt-item.done .pt-status { opacity: .7; }

/* add-task form (Projects panel and Board quick-add) */
.pt-form { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.pt-fields { gap: 8px; }
.pt-form .mini-input { min-height: 34px; background: var(--surface); }
.pt-name { font-weight: 500; }
.pt-status-sel { width: auto; min-width: 150px; }
.pt-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.pt-date .mini-input { width: 140px; }
.pt-assignees { gap: 6px; }
.pt-assignees .spacer { flex: 1; }
.person-tag.pt-person { cursor: pointer; user-select: none; }
.person-tag.pt-person input { position: absolute; opacity: 0; pointer-events: none; }
.person-tag.pt-person:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); color: var(--text); font-weight: 500; }
.person-tag.pt-person:has(input:checked) .av { opacity: 1; filter: none; }
.person-tag.pt-person:has(input:focus-visible) { outline: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 1px; }
.pt-submit { min-height: 32px; padding: 0 16px; }

/* board: "+" in column header and quick-add modal */
.col-add {
  width: 24px; height: 24px; flex: none; display: grid; place-items: center; padding: 0 0 1px; margin-right: -2px;
  border: 0; border-radius: 7px; background: rgba(255,255,255,.18); color: inherit; font-size: 16px; font-weight: 500; line-height: 1;
  opacity: .75; transition: opacity .12s, background .12s;
}
.col-head:hover .col-add, .col-add:focus-visible { opacity: 1; }
.col-add:hover { background: rgba(255,255,255,.32); }
:root[data-palette="soft"] .col-add { background: rgba(40,30,20,.08); }
:root[data-palette="soft"] .col-add:hover { background: rgba(40,30,20,.16); }
.qt .pt-form { padding: 0; border: 0; background: none; gap: 12px; }
.qt .pt-fields { flex-direction: column; align-items: stretch; }
.qt .pt-fields > .mini-input { width: 100%; min-width: 0 !important; }
.qt .pt-date { justify-content: space-between; }
.qt .pt-date .mini-input { width: 170px; }
.qt .field select { width: 100%; }

@media (max-width: 900px) {
  .pt-panel { margin-left: 0; left: 10px; width: calc(100vw - 54px); }
}
@media (max-width: 560px) {
  .pt-item { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .pt-item .avatars { justify-self: start; }
  .pt-fields > .mini-input, .pt-status-sel { width: 100%; }
  .pt-date { flex: 1 1 100%; justify-content: space-between; }
  .pt-date .mini-input { width: auto; flex: 1; max-width: 200px; }
}

/* ---------- My day ---------- */
/* project colour (--pc) and optional cover thumb on task rows */
.today-grid .list-item[style*="--pc"] { box-shadow: inset 3px 0 0 var(--pc); }
.today-grid .list-item[style*="--pc"] .grow b {
  background: color-mix(in srgb, var(--pc) 14%, var(--surface)); border-color: color-mix(in srgb, var(--pc) 32%, transparent);
}
.li-cover {
  width: 64px; aspect-ratio: 16 / 9; flex: none; border-radius: 6px; background: center / cover no-repeat var(--surface-2);
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.list-item.hold .li-cover, .list-item.waiting .li-cover { display: none; }
main:has(> .today-grid) .toolbar h1 { font-size: 26px; letter-spacing: -.02em; }
main:has(> .today-grid) .toolbar h1 + span { font-size: 13.5px; }
.today-grid > div > .panel:has(.big-timer) {
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 14%, transparent) 0, transparent 55%),
    var(--surface);
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
}
.big-timer { padding: 26px 24px 20px; gap: 20px; }
.big-timer .play.big { width: 60px; height: 60px; font-size: 17px; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 25%, transparent); }
.big-timer .play.big:not(.on) { background: var(--accent); border-color: var(--accent); color: #fff; padding-left: 3px; }
.big-timer .play.big:not(.on):hover { background: var(--accent-ink); }
.big-timer .play.big.on { animation: ring 2.4s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); } 70%, 100% { box-shadow: 0 0 0 12px transparent; } }
.big-timer .clock { font-size: 42px; }
.big-timer .play.on + div .clock { color: var(--accent-ink); }
.big-timer .what b { font-family: Inter, system-ui, sans-serif; font-size: 12.5px; }
.stat-row { gap: 12px; padding: 0 20px 20px; }
.stat {
  position: relative; background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px 11px;
}
.stat::before { content: ""; position: absolute; left: 14px; right: 14px; top: 0; height: 2px; border-radius: 0 0 2px 2px; background: var(--accent); opacity: .55; }
.stat:nth-child(2)::before { background: var(--ok); }
.stat:nth-child(3)::before { background: var(--muted); }
.stat .v { font-size: 22px; margin-top: 2px; }
.today-grid .panel h2 { display: flex; align-items: center; gap: 8px; background: var(--surface-2); }
.today-grid .panel h2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; }
.today-grid .panel:has(.list-item.waiting) h2::before { background: var(--faint); border-radius: 2px; }
.today-grid > .panel h2::before { background: var(--ok); }
.today-grid .list-item { padding: 12px 16px; transition: background-color .12s; }
.today-grid .list-item .grow > div:first-child { font-weight: 500; white-space: nowrap; }
.today-grid .list-item .grow b {
  display: inline-block; font-weight: 600; font-size: 11px; line-height: 19px; padding: 0 6px; margin-right: 6px;
  border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line);
}
.today-grid .list-item .sub { margin-top: 2px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.today-grid .list-item > .mono { flex: none; }
.today-grid .list-item:has(.play):hover { background: var(--surface-2); }
.today-grid .list-item.waiting .grow b { background: var(--surface); }
/* recent entries read as a small timeline */
.today-grid > .panel .list-item { position: relative; padding-left: 34px; }
.today-grid > .panel .list-item::before { content: ""; position: absolute; left: 17px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.today-grid > .panel .list-item::after {
  content: ""; position: absolute; left: 13px; top: 19px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2px solid color-mix(in srgb, var(--ok) 70%, var(--line));
}
.today-grid > .panel .list-item:first-of-type::before { top: 24px; }
.today-grid > .panel .list-item:last-child::before { bottom: calc(100% - 24px); }
.today-grid > .panel .list-item > .mono { font-weight: 600; font-size: 12.5px; }
.today-grid > .panel .list-item { border-bottom-color: transparent; }

@media (max-width: 560px) {
  main:has(> .today-grid) .toolbar h1 { font-size: 22px; }
  .big-timer { padding: 20px 16px 16px; gap: 14px; }
  .big-timer .clock { font-size: 32px; }
  .stat-row { padding: 0 16px 16px; gap: 8px; }
  .today-grid .list-item .grow > div:first-child { white-space: normal; }
  table:has(td.proj-name) td, table:has(td.proj-name) th { padding-left: 10px; padding-right: 10px; }
}
