/* Joga Carpenter – Projects. Light, Material-style. Body text 16px, touch targets 44px+. */
:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --line: #e4e0d8;
  --line-2: #d2ccc1;
  --text: #1d1b18;
  --text-2: #5e5951;
  --text-3: #8a847a;
  --primary: #a35200;
  --primary-ink: #ffffff;
  --primary-soft: #fdebd8;
  --primary-soft-ink: #6e3700;
  --green: #1e7a3c; --green-soft: #e3f3e7;
  --red: #b3261e; --red-soft: #fbe5e3;
  --amber: #8a5a00; --amber-soft: #fff1d4;
  --blue: #2457a6; --blue-soft: #e4ecf8;
  --grey-soft: #eeece8;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 1px 1px rgba(40, 30, 10, .04);
  --nav-h: 64px;
  --top-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.small { font-size: 13px; }
.strong { font-weight: 650; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── App frame ─────────────────────────────────────────── */
#top {
  position: sticky; top: 0; z-index: 20; background: rgba(246, 245, 242, .94);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent; padding-top: var(--safe-t);
}
#top.scrolled { border-bottom-color: var(--line); }
.topbar { display: flex; align-items: center; gap: 4px; height: var(--top-h); max-width: 980px; margin: 0 auto; padding: 0 8px 0 12px; }
.topbar h1 { font-size: 20px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .sub { font-size: 13px; color: var(--text-2); font-weight: 500; display: block; }
.iconbtn {
  width: 44px; height: 44px; border-radius: 22px; border: 0; background: transparent; display: inline-grid;
  place-items: center; color: var(--text); flex: none;
}
.iconbtn:active { background: var(--grey-soft); }
.iconbtn svg { width: 24px; height: 24px; }
.avatar { width: 34px; height: 34px; border-radius: 17px; background: var(--primary-soft); color: var(--primary-soft-ink);
  display: grid; place-items: center; font-weight: 700; font-size: 14px; }

main { max-width: 980px; margin: 0 auto; padding: 4px 16px calc(var(--nav-h) + var(--safe-b) + 88px); }
main.no-nav { padding-bottom: calc(var(--safe-b) + 96px); }

#nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface);
  border-top: 1px solid var(--line); padding-bottom: var(--safe-b);
}
#nav .in { display: flex; max-width: 640px; margin: 0 auto; height: var(--nav-h); }
#nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-2); font-size: 12px; font-weight: 600; letter-spacing: .1px;
}
#nav a .pill { width: 56px; height: 30px; border-radius: 15px; display: grid; place-items: center; transition: background .15s; }
#nav a svg { width: 22px; height: 22px; }
#nav a.on { color: var(--text); }
#nav a.on .pill { background: var(--primary-soft); color: var(--primary-soft-ink); }

.fab {
  position: fixed; right: max(16px, calc(50% - 474px)); bottom: calc(var(--nav-h) + var(--safe-b) + 16px); z-index: 25;
  height: 56px; padding: 0 20px 0 16px; border-radius: 18px; border: 0; background: var(--primary); color: var(--primary-ink);
  display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 16px;
  box-shadow: 0 3px 8px rgba(120, 60, 0, .25), 0 1px 3px rgba(0, 0, 0, .12);
}
.fab svg { width: 24px; height: 24px; }
.no-nav ~ .fab, body.no-nav .fab { bottom: calc(var(--safe-b) + 16px); }

/* ── Building blocks ───────────────────────────────────── */
.section { margin-top: 22px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 2px 8px; gap: 8px; }
.section-head h2 { font-size: 17px; font-weight: 700; }
.section-head a, .linkbtn { font-size: 15px; font-weight: 600; color: var(--primary); background: none; border: 0; padding: 6px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card.pad { padding: 14px 16px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.row {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; min-height: 56px; border-top: 1px solid var(--line);
  background: var(--surface); width: 100%; text-align: left; border-left: 0; border-right: 0; border-bottom: 0;
}
.row:first-child { border-top: 0; }
button.row:active, a.row:active, .row.tap:active { background: var(--surface-2); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.row .t.wrap { white-space: normal; }
.row .s { font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .s.wrap { white-space: normal; }
.row .end { text-align: right; flex: none; }
.row .amt { font-weight: 650; }
.group-label { font-size: 13px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .6px;
  padding: 14px 4px 6px; }
.empty { text-align: center; color: var(--text-2); padding: 28px 16px; font-size: 15px; }
.empty b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px;
  font-size: 13px; font-weight: 650; white-space: nowrap; background: var(--grey-soft); color: var(--text-2); border: 0;
}
.chip.going { background: var(--green-soft); color: var(--green); }
.chip.finishing { background: var(--blue-soft); color: var(--blue); }
.chip.waiting { background: var(--amber-soft); color: var(--amber); }
.chip.completed { background: var(--grey-soft); color: var(--text-2); }
.chip.needed { background: var(--amber-soft); color: var(--amber); }
.chip.ordered { background: var(--blue-soft); color: var(--blue); }
.chip.delivered, .chip.paid { background: var(--green-soft); color: var(--green); }
.chip.invoiced { background: var(--amber-soft); color: var(--amber); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.auto { background: var(--grey-soft); color: var(--text-2); }
button.chip { height: 32px; padding: 0 12px; border-radius: 16px; }
.dot { width: 8px; height: 8px; border-radius: 4px; flex: none; display: inline-block; }
.dot.going { background: var(--green); } .dot.finishing { background: var(--blue); }
.dot.waiting { background: #d08a00; } .dot.completed { background: var(--text-3); }

/* filter chips (scroll sideways) */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 10px; margin: 0 -16px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.fchip {
  height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--text-2); white-space: nowrap; flex: none;
}
.fchip.on { background: var(--primary-soft); border-color: var(--primary-soft); color: var(--primary-soft-ink); }
.fchip .n { opacity: .7; margin-left: 4px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.kpi .l { font-size: 13px; color: var(--text-2); font-weight: 600; }
.kpi .v { font-size: 22px; font-weight: 750; margin-top: 2px; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .h { font-size: 13px; color: var(--text-2); margin-top: 1px; }
@media (min-width: 760px) { .kpis.four { grid-template-columns: repeat(4, 1fr); } }

/* quick actions */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick button {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 4px 8px; display: flex;
  flex-direction: column; align-items: center; gap: 4px; font-size: 13px; font-weight: 650; color: var(--text); box-shadow: var(--shadow);
}
.quick button svg { width: 24px; height: 24px; color: var(--primary); }
.quick button:active { background: var(--surface-2); }

/* project card */
.pcards { display: grid; gap: 10px; }
@media (min-width: 760px) { .pcards { grid-template-columns: 1fr 1fr; } }
.pcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px 12px; box-shadow: var(--shadow); color: var(--text); }
.pcard:active { background: var(--surface-2); }
.pcard .top { display: flex; align-items: flex-start; gap: 10px; }
.pcard .name { font-weight: 700; font-size: 17px; flex: 1; min-width: 0; }
.pcard .who { font-size: 14px; color: var(--text-2); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .stats { display: flex; gap: 14px; margin-top: 8px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.pcard .stats b { color: var(--text); font-weight: 650; }
.pcard .stats .warn b, .pcard .stats .warn { color: var(--red); }
.bar { height: 8px; border-radius: 4px; background: var(--grey-soft); overflow: hidden; margin-top: 10px; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--primary); }
.bar.ok > i { background: #3f9b5a; } .bar.warn > i { background: #d08a00; } .bar.bad > i { background: var(--red); }
.barline { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-top: 5px; gap: 8px; }

/* attention */
.att { display: flex; gap: 12px; align-items: flex-start; }
.att .dot { margin-top: 7px; width: 10px; height: 10px; border-radius: 5px; }
.att .dot.red { background: var(--red); } .att .dot.amber { background: #d08a00; } .att .dot.info { background: var(--blue); }

/* project header + tabs */
.phead { padding: 2px 2px 10px; }
.phead .line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 15px; color: var(--text-2); margin-top: 6px; }
.phead .line a { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.phead .line svg { width: 18px; height: 18px; }
.tabs {
  position: sticky; top: calc(var(--top-h) + var(--safe-t)); z-index: 15; background: var(--bg);
  display: flex; gap: 2px; overflow-x: auto; margin: 0 -16px; padding: 0 12px; border-bottom: 1px solid var(--line); scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; padding: 0 12px; height: 46px; display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 650;
  color: var(--text-2); border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs a.on { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .n { font-size: 12px; background: var(--grey-soft); color: var(--text-2); border-radius: 9px; padding: 0 6px; height: 18px; line-height: 18px; }
.tabs a.on .n { background: var(--primary-soft); color: var(--primary-soft-ink); }
.tabs .n.red { background: var(--red-soft); color: var(--red); }

/* tally */
.tally .big { font-size: 30px; font-weight: 780; letter-spacing: -.5px; line-height: 1.1; }
.tally .grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.tally .grid3 .l { font-size: 12px; color: var(--text-2); font-weight: 600; }
.tally .grid3 .v { font-size: 16px; font-weight: 700; }
.split { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: 15px; }
.kv .k { color: var(--text-2); }
.kv .v { text-align: right; font-weight: 600; }
.catbars { display: grid; gap: 9px; }
.catbar .top { display: flex; justify-content: space-between; font-size: 14px; }
.catbar .bar { margin-top: 4px; height: 6px; }
.details { display: grid; grid-template-columns: 112px 1fr; gap: 8px 12px; font-size: 15px; }
.details .k { color: var(--text-2); }
.details .v { min-width: 0; overflow-wrap: anywhere; }
.miss { display: flex; flex-wrap: wrap; gap: 8px; }
.miss button { border: 1px dashed var(--line-2); background: var(--surface); border-radius: 10px; height: 36px; padding: 0 12px; font-size: 14px; font-weight: 600; color: var(--primary); }

/* SOQ bullets */
.soq .row { min-height: 50px; padding-top: 9px; padding-bottom: 9px; }
.bullet { width: 6px; height: 6px; border-radius: 3px; background: var(--text-2); flex: none; margin-top: 2px; }
.qty { font-weight: 700; color: var(--text); }

/* to-do checkbox */
.check { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-2); background: var(--surface); flex: none; display: grid; place-items: center; padding: 0; }
.check.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.check svg { width: 18px; height: 18px; }
.checkhit { width: 44px; height: 44px; margin: -9px -9px -9px -9px; display: grid; place-items: center; border: 0; background: none; flex: none; }
.row.done .t { color: var(--text-3); text-decoration: line-through; }

/* ── Sheet (bottom on phone, centred on desktop) ───────── */
.scrim { position: fixed; inset: 0; background: rgba(20, 15, 5, .38); z-index: 50; opacity: 0; transition: opacity .18s; }
.scrim.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--surface); border-radius: 20px 20px 0 0;
  max-height: calc(100dvh - var(--safe-t) - 24px); display: flex; flex-direction: column; transform: translateY(100%);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -4px 24px rgba(0, 0, 0, .12);
}
.sheet.open { transform: none; }
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 8px auto 0; flex: none; }
.sheet .head { display: flex; align-items: center; padding: 4px 8px 4px 18px; flex: none; }
.sheet .head h2 { font-size: 19px; font-weight: 700; flex: 1; }
.sheet .body { overflow-y: auto; padding: 4px 18px 12px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet .foot { display: flex; gap: 10px; padding: 10px 18px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); flex: none; background: var(--surface); }
@media (min-width: 700px) {
  .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 560px; border-radius: 20px; transform: translate(-50%, -46%); opacity: 0;
    transition: transform .18s, opacity .18s; max-height: 88vh; }
  .sheet.open { transform: translate(-50%, -50%); opacity: 1; }
  .sheet .grab { display: none; }
  .sheet .foot { padding-bottom: 12px; border-radius: 0 0 20px 20px; }
}

/* ── Forms ─────────────────────────────────────────────── */
.btn {
  height: 48px; padding: 0 20px; border-radius: 12px; border: 0; background: var(--primary); color: var(--primary-ink);
  font-weight: 650; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:active { filter: brightness(.94); }
.btn.grow { flex: 1; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); }
.btn.danger { background: var(--surface); color: var(--red); border: 1px solid #e8b9b4; }
.btn.small { height: 38px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.btn[disabled] { opacity: .55; }
.btn svg { width: 20px; height: 20px; }
.form { display: grid; gap: 12px; }
.frow { display: grid; grid-template-columns: 1fr; gap: 10px; }
.frow.c2 { grid-template-columns: 1fr 1fr; }
.frow.c3 { grid-template-columns: 1fr 1fr 1fr; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > label, .field > .lab { font-size: 13px; font-weight: 650; color: var(--text-2); }
.field .req { color: var(--primary); }
.inp {
  width: 100%; height: 46px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); padding: 0 12px;
  font-size: 16px; outline: none; transition: border-color .12s, box-shadow .12s; min-width: 0; -webkit-appearance: none; appearance: none;
}
select.inp { padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235e5951' stroke-width='1.8'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
input[type=date].inp, input[type=time].inp { display: flex; align-items: center; }
textarea.inp { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.4; }
.inp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(163, 82, 0, .14); }
.field.err .inp { border-color: var(--red); }
.field .msg { font-size: 13px; color: var(--red); }
.field .hint { font-size: 13px; color: var(--text-3); }
.money { position: relative; }
.money::before { content: "$"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.money .inp { padding-left: 24px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: inline-flex; align-items: center; height: 38px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--surface); font-size: 15px; font-weight: 600; color: var(--text-2);
}
.seg input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-soft-ink); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px rgba(163, 82, 0, .2); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; }
.switch .txt { font-size: 15px; font-weight: 600; }
.switch .txt small { display: block; font-weight: 400; color: var(--text-2); font-size: 13px; }
.switch input { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 14px; background: var(--line-2); position: relative; flex: none; transition: background .15s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 11px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { transform: translateX(20px); }
.more-btn { justify-self: start; background: none; border: 0; color: var(--primary); font-weight: 650; font-size: 15px; padding: 6px 0; }
.calc { background: var(--primary-soft); color: var(--primary-soft-ink); border-radius: 10px; padding: 10px 12px; font-weight: 650; font-size: 15px; }
.formerr { background: var(--red-soft); color: var(--red); border-radius: 10px; padding: 10px 12px; font-size: 15px; font-weight: 600; }
.searchbox { position: relative; }
.searchbox svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--text-3); }
.searchbox .inp { padding-left: 40px; height: 44px; border-radius: 12px; }

/* activity */
.act .row { align-items: flex-start; }
.act .ic { width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; flex: none; background: var(--grey-soft); color: var(--text-2); margin-top: 2px; }
.act .ic svg { width: 18px; height: 18px; }
.act .ic.create { background: var(--green-soft); color: var(--green); }
.act .ic.update { background: var(--blue-soft); color: var(--blue); }
.act .ic.delete, .act .ic.warn { background: var(--red-soft); color: var(--red); }
.act .d { font-size: 15px; line-height: 1.35; color: var(--text); overflow-wrap: anywhere; }
.act .m { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* menu */
.menu { position: fixed; z-index: 60; background: var(--surface); border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.16); border: 1px solid var(--line); min-width: 220px; padding: 6px 0; }
.menu button { display: flex; width: 100%; align-items: center; gap: 12px; height: 46px; padding: 0 16px; border: 0; background: none; font-size: 16px; text-align: left; }
.menu button:active { background: var(--surface-2); }
.menu button svg { width: 20px; height: 20px; color: var(--text-2); }
.menu button.red { color: var(--red); }

/* toast */
#toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 84px); transform: translate(-50%, 20px); opacity: 0;
  background: #2b2824; color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 15px; font-weight: 600; z-index: 70;
  transition: all .2s; pointer-events: none; max-width: calc(100% - 32px); box-shadow: 0 4px 16px rgba(0,0,0,.2); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { background: var(--red); }

/* login */
.login { max-width: 400px; margin: 0 auto; padding: 12vh 20px 40px; }
.login .logo { width: 64px; height: 64px; border-radius: 18px; background: var(--primary); display: grid; place-items: center; margin-bottom: 18px; }
.login .logo svg { width: 38px; height: 38px; color: #fff; }
.login h1 { font-size: 28px; font-weight: 780; }
.login p { color: var(--text-2); margin: 4px 0 24px; }

.skeleton { height: 18px; border-radius: 6px; background: linear-gradient(90deg, #eceae5, #f5f3ef, #eceae5); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.spacer { height: 8px; }
.stack { display: grid; gap: 10px; }
.hr { height: 1px; background: var(--line); margin: 12px 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* keep everything inside the phone width (grid items may not grow past the screen) */
.pcards, .form, .frow, .kpis, .stack { grid-template-columns: minmax(0, 1fr); }
.frow.c2, .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.frow.c3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
@media (min-width: 760px) { .pcards { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pcards > *, .kpis > *, .frow > * { min-width: 0; }
html, body { overflow-x: hidden; }

/* ── v2.1: tighter spacing, colour tags, alerts ───────────── */
main { padding-top: 2px; }
.section { margin-top: 16px; }
.section-head { margin-bottom: 6px; }
.section-head h2 { display: flex; align-items: center; gap: 6px; }
.section-head h2 svg { width: 20px; height: 20px; color: var(--primary); }
.row { padding: 9px 12px; min-height: 50px; gap: 10px; }
.kpis { gap: 8px; }
.kpi { padding: 10px 12px; }
.kpi .v { font-size: 21px; }
.pcards { gap: 8px; }
.pcard { padding: 11px 12px 10px; }
.pcard .stats { margin-top: 6px; gap: 12px; }
.bar { margin-top: 8px; }
.group-label { padding: 10px 4px 4px; }
.phead { padding-bottom: 6px; }
.phead .line { margin-top: 4px; }
.card.pad { padding: 12px 14px; }
.empty { padding: 20px 12px; }

/* alert colours: red = act now, amber = check, blue = missing info */
.atag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 750;
  white-space: nowrap; flex: none; letter-spacing: .2px; }
.atag.red { background: var(--red); color: #fff; }
.atag.amber { background: var(--amber-soft); color: var(--amber); border: 1px solid #f0cf8a; }
.atag.info { background: var(--blue-soft); color: var(--blue); }
.row.att { border-left: 4px solid transparent; }
.row.att.red { border-left-color: var(--red); background: #fff8f7; }
.row.att.amber { border-left-color: #d89a1c; }
.row.att.info { border-left-color: #6d93cf; }
.row.late { box-shadow: inset 4px 0 0 var(--red); background: #fff8f7; }
.pcard.al-red { border-color: #e5a29c; box-shadow: inset 4px 0 0 var(--red), var(--shadow); }
.pcard.al-amber { box-shadow: inset 4px 0 0 #d89a1c, var(--shadow); }

.alerts { display: grid; gap: 6px; margin: 2px 0 8px; }
.alert { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; font-size: 14px; font-weight: 600;
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-left-width: 4px; }
.alert.red { border-color: #e5a29c; border-left-color: var(--red); background: #fff6f5; }
.alert.amber { border-left-color: #d89a1c; background: #fffaf0; }
.alert.info { border-left-color: #6d93cf; }

/* home: jump-to-project strip + 3 quick actions */
.pstrip { display: flex; gap: 8px; overflow-x: auto; margin: 4px -16px 10px; padding: 2px 16px; scrollbar-width: none; }
.pstrip::-webkit-scrollbar { display: none; }
.pstrip a { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 13px; border-radius: 19px; background: var(--surface);
  border: 1px solid var(--line-2); color: var(--text); font-weight: 650; font-size: 14px; max-width: 220px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; box-shadow: var(--shadow); }
.pstrip a.al-red { border-color: var(--red); background: #fff6f5; }
.pstrip a.al-amber { border-color: #d89a1c; }
.quick.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quick button { flex-direction: row; justify-content: center; padding: 11px 6px; gap: 6px; font-size: 14px; }
.quick button svg { width: 20px; height: 20px; }

/* my to-dos stand out */
.mytodos .list { border: 1.5px solid #e9b980; background: #fffaf3; }
.mytodos .row { background: transparent; }
.mytodos .row.late { background: #fff3f1; }

/* activity: compact rows, type tags, money tags */
.act .row { padding: 7px 12px; min-height: 0; gap: 10px; }
.act .ic { width: 26px; height: 26px; border-radius: 13px; margin-top: 1px; }
.act .ic svg { width: 15px; height: 15px; }
.act .d { font-size: 14.5px; line-height: 1.32; }
.act .m { font-size: 12.5px; margin-top: 1px; }
.etag { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 5px; margin-right: 6px; vertical-align: 1px; letter-spacing: .2px; }
.etag.todo { background: #ede4fb; color: #5b2fa8; }
.etag.exp { background: var(--red-soft); color: var(--red); }
.etag.inc { background: var(--green-soft); color: var(--green); }
.etag.time { background: var(--blue-soft); color: var(--blue); }
.etag.soq { background: var(--amber-soft); color: var(--amber); }
.etag.proj { background: var(--primary-soft); color: var(--primary-soft-ink); }
.act .row.is-todo { box-shadow: inset 3px 0 0 #7c4dce; }
.mtag { display: inline-block; font-weight: 750; color: #135e2d; background: #dff1e4; border-radius: 5px; padding: 0 5px; white-space: nowrap; }
.arrow { color: var(--primary); }
.alerts { gap: 5px; }
.alert { padding: 6px 10px; min-height: 38px; }
.alert .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.alerts.folded .extra { display: none; }
.more-al { justify-self: start; padding: 2px 2px; font-size: 14px; }
.alerts { grid-template-columns: minmax(0, 1fr); }
.alert { min-width: 0; }

/* ── v2.2: new / pending / overdue tags, time summary, work tags ── */
.newsbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.newsbar.small { margin: 6px 0 0; }
.ntag2 { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 13px; font-weight: 750; white-space: nowrap; }
.ntag2.new { background: var(--blue-soft); color: var(--blue); }
.ntag2.todo { background: #ede4fb; color: #5b2fa8; }
.ntag2.pending { background: var(--amber-soft); color: var(--amber); }
.ntag2.overdue { background: var(--red); color: #fff; }
.ntag2.ok { background: var(--green-soft); color: var(--green); }
.newsbar.small .ntag2 { height: 22px; font-size: 12px; padding: 0 8px; }
.ntag { display: inline-block; font-size: 11px; font-weight: 800; color: #fff; background: var(--blue); border-radius: 5px; padding: 1px 6px; margin-right: 6px; vertical-align: 2px; letter-spacing: .3px; }
.newdot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; background: var(--blue); margin-left: 2px; }
.pstrip .cnt { background: var(--blue); color: #fff; font-size: 11px; font-weight: 800; border-radius: 9px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; padding: 0 5px; margin-left: 2px; }
.row .c { width: 58px; text-align: right; flex: none; font-size: 15px; }
.row .c.w { width: 74px; }
.row.thead { min-height: 0; padding-top: 7px; padding-bottom: 7px; background: var(--surface-2); font-size: 12px; font-weight: 700; color: var(--text-2); text-transform: uppercase; letter-spacing: .4px; }
.row.thead .c { font-size: 12px; }
.wtags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.wtags span { font-size: 12px; font-weight: 650; background: var(--primary-soft); color: var(--primary-soft-ink); border-radius: 6px; padding: 1px 7px; }
.wtags.big span { font-size: 14px; padding: 5px 10px; border-radius: 8px; }
.seg.tags span { height: 34px; padding: 0 11px; font-size: 14px; }
.seg.tags label.hidden { display: none; }
.more-tags { height: 34px; padding: 0 12px; border-radius: 10px; border: 1px dashed var(--line-2); background: none; color: var(--primary); font-weight: 650; font-size: 14px; }

/* v2.3: activity text 1.5 pt smaller */
.act .d { font-size: 13px; line-height: 1.3; }
.act .m { font-size: 11px; }
.act .row { padding: 6px 12px; }
.etag { font-size: 10px; padding: 0 5px; }
.mtag { padding: 0 4px; }
