/* ============================================================
   Agency Desk: design system (brand teal #49C4A7)
   Theme is resolved by JS to data-theme="light" | "dark".
   ============================================================ */
:root {
  --brand: #49c4a7;
  --bg: #f6f5f1;
  --bg-2: #efede7;
  --surface: #ffffff;
  --surface-2: #f4f3ee;
  --surface-3: #ebe9e2;
  --line: #e5e2da;
  --line-strong: #d6d2c8;
  --text: #14201c;
  --muted: #5c6a65;
  --faint: #8e9a95;
  --accent: #12806a;          /* text-safe teal for light mode */
  --accent-hover: #0e6f5c;
  --accent-ink: #ffffff;
  --accent-soft: #e2f4ee;
  --accent-line: #b4e3d5;
  --warn: #a85a0c; --warn-soft: #fdf0dd;
  --bad: #b4352a; --bad-soft: #fde7e4;
  --good: #1f7a45; --good-soft: #e2f3e8;
  --info: #2a5f9e; --info-soft: #e5eefa;
  --shadow-sm: 0 1px 2px rgba(20, 32, 28, .06);
  --shadow: 0 1px 2px rgba(20, 32, 28, .05), 0 6px 20px rgba(20, 32, 28, .06);
  --shadow-lg: 0 12px 40px rgba(20, 32, 28, .18);
  --r-sm: 10px; --r: 14px; --r-lg: 20px;
  --side-w: 236px;
  --nav-h: 64px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font-head: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1412;
  --bg-2: #111a17;
  --surface: #151e1b;
  --surface-2: #1b2622;
  --surface-3: #22302b;
  --line: #24322d;
  --line-strong: #31423c;
  --text: #e9f0ed;
  --muted: #9aaba5;
  --faint: #6c7d77;
  --accent: #49c4a7;
  --accent-hover: #5fd3b7;
  --accent-ink: #052820;
  --accent-soft: #14352d;
  --accent-line: #22574a;
  --warn: #f0a75a; --warn-soft: #3a2a15;
  --bad: #f2867b; --bad-soft: #3d1f1c;
  --good: #7fd19f; --good-soft: #17321f;
  --info: #86b4ee; --info-soft: #182a40;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 24px rgba(0, 0, 0, .25);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-family: var(--font-head); letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 14.5px; font-weight: 650; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.num { font-variant-numeric: tabular-nums; }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: initial; }
:root[data-theme="dark"] .only-light { display: none; }

/* ---------- app shell ---------- */
.boot { display: grid; place-items: center; height: 100vh; }
.boot img { width: 56px; height: 56px; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.92); opacity: .7; } }

.shell { min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 60px;
  display: flex; align-items: center; gap: 12px; padding: 0 16px; padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo-lockup { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); }
.logo-lockup img { width: 30px; height: 30px; flex: none; }
.logo-lockup b { font-family: var(--font-head); font-size: 15px; font-weight: 700; }
.account-btn { margin-left: auto; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 4px 4px 10px; border-radius: 999px; cursor: pointer; text-align: right; }
.account-btn:hover { background: var(--surface-2); }
.account-btn .who { line-height: 1.2; }
@media (max-width: 520px) { .account-btn .who { display: none; } }

.main { max-width: 1200px; margin: 0 auto; padding: 18px 16px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 2px 0 18px; }
.page-head .sub { margin-top: 5px; color: var(--muted); font-size: 14px; }
.demo-bar { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: 12.5px; font-weight: 600; padding: 6px 12px; }

/* nav: bottom on phones, sidebar on desktop */
.nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); display: flex; }
.nav .side-logo { display: none; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); font-size: 10.5px; font-weight: 600; position: relative; min-width: 0; text-decoration: none; transition: color .15s; }
.nav a svg { width: 22px; height: 22px; transition: transform .2s var(--ease); }
.nav a.on { color: var(--accent); }
.nav a.on svg { transform: translateY(-1px); }
.nav a:active svg { transform: scale(.9); }
.nav .dot { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }

@media (min-width: 960px) {
  .shell, .shell.has-player { padding: 0 0 0 var(--side-w); }
  .topbar { padding-left: 28px; }
  .topbar .logo-lockup { display: none; }
  .nav { top: 0; right: auto; width: var(--side-w); height: 100vh; flex-direction: column; justify-content: flex-start; gap: 2px; padding: 18px 12px; border-top: 0; border-right: 1px solid var(--line); background: var(--surface); }
  .nav .side-logo { display: flex; padding: 4px 10px 22px; }
  .nav .side-logo img.full { width: 150px; height: auto; }
  .nav a { flex: 0 0 auto; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; font-weight: 550; color: var(--muted); }
  .nav a:hover { background: var(--surface-2); color: var(--text); }
  .nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
  .nav a svg { width: 19px; height: 19px; }
  .nav a.more-link { display: none; }
  .nav a.extra { display: flex !important; }
  .nav .dot { position: static; margin-left: auto; }
  .main { padding: 26px 32px 60px; }
}
@media (max-width: 959px) { .nav a.extra { display: none; } }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-sm); padding: 16px; }
.card.pad-lg { padding: 20px; }
.stack > * + * { margin-top: 12px; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.section-head h2 .count { color: var(--faint); font-weight: 500; margin-left: 6px; font-family: inherit; }
.hint { font-size: 13px; color: var(--muted); }
.grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

/* ---------- buttons ---------- */
.btn { appearance: none; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 12px;
  min-height: 42px; padding: 0 16px; font-weight: 600; font-size: 14.5px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 0 rgba(0,0,0,.05), 0 4px 14px color-mix(in srgb, var(--accent) 28%, transparent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn.soft:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 12%); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.sm { min-height: 36px; padding: 0 12px; border-radius: 10px; font-size: 13.5px; }
.btn.xs { min-height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; }
.btn.lg { min-height: 52px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.sm svg { width: 16px; height: 16px; }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.icon-btn { appearance: none; border: 0; background: transparent; width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); flex: none; transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

/* round media-style buttons (timer, done) */
.rbtn { appearance: none; border: 0; cursor: pointer; flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; position: relative;
  transition: transform .15s var(--ease), background .15s, box-shadow .2s, color .15s; }
.rbtn:active { transform: scale(.9); }
.rbtn svg { width: 20px; height: 20px; }
.rbtn.play { background: var(--accent-soft); color: var(--accent); }
.rbtn.play:hover { background: var(--accent); color: var(--accent-ink); }
.rbtn.play svg { margin-left: 2px; }
.rbtn.play.on { background: var(--accent); color: var(--accent-ink); }
.rbtn.play.on svg { margin-left: 0; }
.rbtn.play.on::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--accent); opacity: .5; animation: ring 1.8s ease-out infinite; }
@keyframes ring { from { transform: scale(.9); opacity: .6; } to { transform: scale(1.25); opacity: 0; } }
.rbtn.done { background: transparent; color: var(--faint); border: 2px solid var(--line-strong); width: 40px; height: 40px; }
.rbtn.done:hover { border-color: var(--good); color: var(--good); background: var(--good-soft); }
.rbtn.done svg { width: 18px; height: 18px; }
.rbtn.light { background: rgba(255,255,255,.16); color: inherit; }
.rbtn.light:hover { background: rgba(255,255,255,.26); }
.rbtn.solid { background: var(--accent-ink); color: var(--accent); }

/* segmented control */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; height: 32px; padding: 0 12px; border-radius: 9px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .15s, color .15s; }
.seg button svg { width: 16px; height: 16px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* chips & pills */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; height: 34px; padding: 0 13px; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); transition: all .15s; }
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .pi { width: 16px; height: 16px; }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill svg { width: 12px; height: 12px; }
.bdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; flex: none; letter-spacing: .02em; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.avatars { display: flex; }
.avatars .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatars .avatar:first-child { margin-left: 0; }

/* platform icons */
.pi { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: middle; }
.pi.lg { width: 22px; height: 22px; }

/* ---------- forms ---------- */
label.field { display: block; min-width: 0; }
label.field > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
input[type=text], input[type=number], input[type=date], input[type=url], input[type=password], input[type=search], input[type=email], textarea {
  width: 100%; height: 44px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); padding: 0 13px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea { height: auto; min-height: 88px; padding: 11px 13px; resize: vertical; line-height: 1.45; }
input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[type=date] { min-width: 0; }
input[type=date]::-webkit-calendar-picker-indicator { opacity: .6; cursor: pointer; }
:root[data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator { filter: invert(1); }
input:disabled, textarea:disabled { opacity: .6; }
.form { display: grid; gap: 14px; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .form .two.stack-sm { grid-template-columns: 1fr; } }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); pointer-events: none; }
.search input { padding-left: 38px; height: 40px; border-radius: 11px; }
.pin-input { font-size: 22px !important; letter-spacing: 10px; font-weight: 700; }

/* custom dropdown (enhances every <select>) */
select.dd-native { display: none !important; }
.dd { appearance: none; height: 44px; width: 100%; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 13px; border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); cursor: pointer; text-align: left; font-weight: 500; transition: border-color .15s, box-shadow .15s; min-width: 0; }
.dd:hover { border-color: var(--faint); }
.dd.open { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.dd .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd .chev { width: 16px; height: 16px; color: var(--faint); flex: none; transition: transform .2s var(--ease); }
.dd.open .chev { transform: rotate(180deg); }
.dd.sm { height: 38px; width: auto; max-width: 240px; border-radius: 11px; font-size: 14px; font-weight: 600; }
.dd[disabled] { opacity: .6; pointer-events: none; }
.dd-menu { position: fixed; z-index: 200; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 6px;
  min-width: 200px; max-width: min(340px, calc(100vw - 24px)); display: flex; flex-direction: column; opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top; transition: opacity .14s, transform .16s var(--ease); }
.dd-menu.up { transform-origin: bottom; transform: translateY(4px) scale(.98); }
.dd-menu.show { opacity: 1; transform: none; }
.dd-menu .dd-search { height: 38px; margin-bottom: 6px; border-radius: 10px; }
.dd-list { overflow-y: auto; overscroll-behavior: contain; }
.dd-opt { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: left; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 14.5px; }
.dd-opt:hover, .dd-opt.hl { background: var(--surface-2); }
.dd-opt.sel { color: var(--accent); font-weight: 650; }
.dd-opt .tick { width: 16px; height: 16px; margin-left: auto; opacity: 0; color: var(--accent); flex: none; }
.dd-opt.sel .tick { opacity: 1; }
.dd-group { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 10px 10px 4px; }
.dd-empty { padding: 12px; color: var(--faint); font-size: 13px; }

/* ---------- empty / skeleton ---------- */
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty .em { font-size: 30px; margin-bottom: 8px; }
.skel { border-radius: var(--r); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.fade-in { animation: fadein .22s var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- My Day ---------- */
.hello h1 { font-size: 26px; }
.hello .date { color: var(--muted); margin-top: 4px; }
.daybar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.daybar .state { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.daybar .state.in { background: var(--good-soft); color: var(--good); }
.daybar .state svg { width: 22px; height: 22px; }
.kpis-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpis-mini .k { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.kpis-mini .k b { display: block; font-size: 22px; font-family: var(--font-head); font-variant-numeric: tabular-nums; }
.kpis-mini .k span { font-size: 12.5px; color: var(--muted); }
.kpis-mini .k.bad b { color: var(--bad); }

/* task rows */
.tasks { display: flex; flex-direction: column; gap: 8px; }
.trow { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.trow:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.trow.running { border-color: var(--accent-line); background: linear-gradient(90deg, var(--accent-soft), var(--surface) 55%); }
.trow .tmain { flex: 1; min-width: 0; cursor: pointer; }
.trow .ttitle { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .tmeta { display: flex; align-items: center; gap: 7px; margin-top: 5px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; row-gap: 5px; }
.trow .tmeta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--faint); }
.trow .live { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.cmt { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); }
.cmt svg { width: 14px; height: 14px; }
.group-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 18px 2px 9px; }
.group-label.bad { color: var(--bad); }
details.more > summary { cursor: pointer; list-style: none; color: var(--muted); font-weight: 600; font-size: 14px; padding: 10px 2px; display: flex; align-items: center; gap: 6px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary svg { width: 16px; height: 16px; transition: transform .2s; }
details.more[open] > summary svg { transform: rotate(180deg); }

.fab { position: fixed; right: 18px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); z-index: 25; width: 56px; height: 56px; border-radius: 18px; border: 0;
  background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 28px color-mix(in srgb, var(--accent) 40%, transparent); display: grid; place-items: center; cursor: pointer; transition: transform .15s var(--ease), bottom .25s var(--ease); }
.fab:active { transform: scale(.92); }
.fab svg { width: 26px; height: 26px; }
@media (min-width: 960px) { .fab { bottom: 28px; right: 28px; } }

/* timer chip in the top bar (shows while a timer runs; never covers the page) */
#player { margin-left: auto; min-width: 0; display: flex; }
#player:empty { display: block; }
.tchip { display: inline-flex; align-items: center; gap: 8px; height: 34px; max-width: 300px; padding: 0 12px 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--accent-line); background: var(--accent-soft); color: var(--accent); font-size: 13px; min-width: 0; }
.tchip:hover { border-color: var(--accent); }
.tchip b { font-variant-numeric: tabular-nums; font-weight: 700; }
.tchip-t { color: var(--text); font-weight: 550; min-width: 0; }
.tdot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #e5484d; animation: blink 1.6s ease-in-out infinite; }
@media (max-width: 600px) { .tchip-t { display: none; } .tchip { padding: 0 10px; } }

/* ---------- list view ---------- */
/* overflow: clip keeps rounded corners without breaking the sticky group headers */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: clip; box-shadow: var(--shadow-sm); }
.lgroup + .lgroup { border-top: 1px solid var(--line); }
.lgroup-head { position: sticky; top: 60px; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--surface-2); font-size: 12.5px; font-weight: 700; color: var(--muted); }
.lgroup-head.today { color: var(--accent); background: var(--accent-soft); }
.lgroup-head .count { margin-left: auto; font-weight: 600; color: var(--faint); }
.lrow { display: grid; grid-template-columns: 28px minmax(0, 1fr) 150px 140px 110px 40px; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.lgroup-head + .lrow { border-top: 0; }
.lrow:hover { background: var(--surface-2); }
.lrow .lt { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow .ls { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.lrow .lwho { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.lrow .lwho span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrow.done .lt { color: var(--faint); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.lhead { display: grid; grid-template-columns: 28px minmax(0, 1fr) 150px 140px 110px 40px; gap: 12px; padding: 10px 16px; font-size: 11.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
@media (max-width: 760px) {
  .lhead { display: none; }
  .lrow { grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "i t d" "i m m"; row-gap: 6px; }
  .lrow > :nth-child(1) { grid-area: i; align-self: start; margin-top: 2px; }
  .lrow > :nth-child(2) { grid-area: t; }
  .lrow > :nth-child(3) { grid-area: m; display: flex; gap: 8px; align-items: center; }
  .lrow > :nth-child(4) { display: none; }
  .lrow > :nth-child(5) { grid-area: d; }
  .lrow > :nth-child(6) { display: none; }
  .lrow .lwho-m { display: inline-flex !important; }
}
.lwho-m { display: none !important; }

/* toolbar */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 200px; max-width: 320px; }
.toolbar .spacer { flex: 1; }
@media (max-width: 640px) { .toolbar .search { max-width: none; flex-basis: 100%; } }

/* ---------- board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(268px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 14px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.col { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; min-height: 240px; scroll-snap-align: start; }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 4px 6px 10px; font-weight: 700; font-size: 13.5px; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; cursor: pointer; box-shadow: var(--shadow-sm); transition: border-color .15s, transform .15s, box-shadow .15s; }
.kcard + .kcard { margin-top: 8px; }
.kcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.kcard .t { font-weight: 650; font-size: 14px; margin: 6px 0 8px; }
.kcard .foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.kcard.overdue { box-shadow: inset 3px 0 0 var(--bad), var(--shadow-sm); }
.kcard.stuck { box-shadow: inset 3px 0 0 var(--warn), var(--shadow-sm); }

/* ---------- calendar month ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.cal .dow { padding: 10px 8px; font-size: 11.5px; font-weight: 700; color: var(--faint); text-align: center; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
.cal .day { min-height: 118px; padding: 6px; display: flex; flex-direction: column; gap: 3px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; min-width: 0; }
.cal .day:nth-child(7n) { border-right: 0; }
.cal .day:hover { background: var(--surface-2); }
.cal .day.out { background: var(--bg-2); cursor: default; }
.cal .day.hol { background: color-mix(in srgb, var(--warn-soft) 60%, var(--surface)); }
.cal .day.sel { background: var(--accent-soft); }
.cal .dn { font-size: 12.5px; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; align-items: center; padding: 2px 2px 4px; }
.cal .day.today .dn b { background: var(--accent); color: var(--accent-ink); border-radius: 999px; min-width: 24px; height: 24px; display: inline-grid; place-items: center; padding: 0 6px; }
.cev { display: flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 3px 6px; border-radius: 7px; background: var(--surface-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.cev .pi { width: 13px; height: 13px; }
.cev.done { opacity: .5; }
.cev.late { background: var(--bad-soft); color: var(--bad); }
.cdots { display: none; gap: 3px; flex-wrap: wrap; justify-content: center; }
.cdots i { width: 6px; height: 6px; border-radius: 50%; }
@media (max-width: 760px) {
  .cal .day { min-height: 54px; align-items: center; padding: 4px 2px; }
  .cal .dn { justify-content: center; padding: 2px 0; }
  .cal .dn .hn, .cal .cev, .cal .more-n { display: none; }
  .cdots { display: flex; }
}

/* ---------- modal sheet & drawer ---------- */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(8, 16, 13, .5); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; }
.modal.show { opacity: 1; }
.sheet { background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; border-radius: 22px 22px 0 0; padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(30px); transition: transform .26s var(--ease); box-shadow: var(--shadow-lg); }
.modal.show .sheet { transform: none; }
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 4px auto 12px; }
@media (min-width: 720px) {
  .modal { align-items: center; padding: 24px; }
  .sheet { border-radius: 22px; padding: 22px 24px 24px; transform: translateY(12px) scale(.98); }
  .sheet::before { display: none; }
}
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.sheet-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }

.drawer-wrap { position: fixed; inset: 0; z-index: 90; background: rgba(8, 16, 13, .45); opacity: 0; transition: opacity .2s; }
.drawer-wrap.show { opacity: 1; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transform: translateX(40px); opacity: .6; transition: transform .28s var(--ease), opacity .2s; }
.drawer-wrap.show .drawer { transform: none; opacity: 1; }
@media (max-width: 719px) {
  .drawer { top: 8px; width: 100vw; border-radius: 22px 22px 0 0; transform: translateY(60px); }
}
.drawer-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px; }
.drawer-foot { flex: none; border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); }
.dtitle { font-size: 19px; font-family: var(--font-head); font-weight: 700; line-height: 1.25; }
.actionbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.steps { display: flex; gap: 4px; margin-top: 14px; }
.steps .s { flex: 1; min-width: 0; text-align: center; font-size: 10.5px; color: var(--faint); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps .s i { display: block; height: 5px; border-radius: 4px; background: var(--surface-3); margin-bottom: 6px; }
.steps .s.done i { background: var(--brand); }
.steps .s.cur i { background: var(--warn); }
.steps .s.cur { color: var(--text); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fact { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.fact .fl { font-size: 11.5px; color: var(--faint); font-weight: 650; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; }
.fact .fv { font-weight: 600; font-size: 14px; min-width: 0; }
.fact .dd, .fact input { height: 36px; border-radius: 9px; background: var(--surface); }

/* conversation */
.thread { display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; gap: 9px; align-items: flex-end; max-width: 88%; }
.msg .bubble { background: var(--surface-2); border-radius: 16px 16px 16px 5px; padding: 9px 12px; font-size: 14.5px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.msg .mname { font-size: 11.5px; color: var(--muted); font-weight: 650; margin: 0 0 3px 4px; }
.msg .mtime { font-size: 11px; color: var(--faint); margin: 3px 0 0 4px; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble { background: var(--accent); color: var(--accent-ink); border-radius: 16px 16px 5px 16px; }
.msg.me .bubble a { color: inherit; text-decoration: underline; }
.msg.me .mname { display: none; }
.msg.me .mtime { text-align: right; margin: 3px 4px 0 0; }
.log { align-self: center; display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--faint); text-align: center; max-width: 92%; padding: 2px 10px; }
.log b { color: var(--muted); font-weight: 650; }
.log.client { color: var(--info); }
.log .q { display: block; color: var(--muted); font-style: italic; }
.day-sep { align-self: center; font-size: 11px; font-weight: 700; color: var(--faint); background: var(--surface-2); padding: 3px 10px; border-radius: 999px; margin: 6px 0 2px; }
.composer { display: flex; align-items: flex-end; gap: 8px; }
.composer textarea { min-height: 44px; max-height: 140px; height: 44px; resize: none; border-radius: 22px; padding: 11px 16px; }
.composer .rbtn { background: var(--accent); color: var(--accent-ink); }
.composer .rbtn:disabled { opacity: .4; }

/* ---------- dashboard (pulse) ---------- */
.hero { display: grid; gap: 14px; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.25fr 1fr 1fr; } }
.stat { display: flex; gap: 16px; align-items: center; }
.stat .big { font-family: var(--font-head); font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.stat .lbl { font-weight: 650; margin-top: 6px; }
.stat .exp { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ringwrap { position: relative; width: 96px; height: 96px; flex: none; }
.ringwrap svg { width: 96px; height: 96px; transform: rotate(-90deg); }
.ringwrap .rv { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 20px; }
.ring-bg { stroke: var(--surface-3); }
.ring-fg { stroke: var(--brand); transition: stroke-dashoffset .8s var(--ease); }
.meter { height: 10px; background: var(--surface-3); border-radius: 99px; overflow: hidden; display: flex; }
.meter > i { display: block; height: 100%; }
.meter.sm { height: 6px; }
.m-accent { background: var(--brand); }
.m-warn { background: var(--warn); }
.m-bad { background: var(--bad); }
.m-muted { background: var(--line-strong); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.ccard { display: flex; flex-direction: column; gap: 12px; }
.ccard .money { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.ccard .money b { color: var(--text); font-size: 15px; display: block; font-variant-numeric: tabular-nums; }
.health { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.health.good { background: var(--good); } .health.warn { background: var(--warn); } .health.bad { background: var(--bad); }
.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid var(--accent-line); font-size: 14px; }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.callout svg { width: 20px; height: 20px; flex: none; color: var(--accent); margin-top: 1px; }
.callout.warn svg { color: var(--warn); }
.alist .arow { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); cursor: pointer; }
.alist .arow:first-child { border-top: 0; padding-top: 2px; }
.alist .arow:hover .lt { color: var(--accent); }
.prow { display: grid; grid-template-columns: 32px minmax(0, 1fr) 90px; gap: 12px; align-items: center; padding: 9px 0; }
.prow + .prow { border-top: 1px solid var(--line); }

/* ---------- team & people ---------- */
.person { display: flex; gap: 14px; align-items: flex-start; }
.person .now { margin-top: 8px; font-size: 12.5px; padding: 6px 10px; background: var(--accent-soft); color: var(--accent); border-radius: 9px; display: flex; align-items: center; gap: 6px; font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status.in::before { background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.status.leave::before { background: var(--info); }
.status.late::before { background: var(--warn); }
.clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.clickable:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }

/* tables (clients settings) */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 11.5px; font-weight: 700; color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; text-transform: uppercase; letter-spacing: .04em; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t .r { text-align: right; }
.qty { width: 74px !important; height: 36px !important; text-align: right; border-radius: 9px !important; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 20px); z-index: 300; transform: translate(-50%, 10px); opacity: 0;
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px);
  transition: opacity .2s, transform .25s var(--ease); pointer-events: none; display: flex; align-items: center; gap: 8px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.up { bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 96px); }
@media (min-width: 960px) { .toast { bottom: 28px; } }

/* ---------- auth screens ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background:
  radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%), var(--bg); }
.auth-box { width: 100%; max-width: 420px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 26px; }
.auth-logo img { width: 230px; height: auto; }
.auth h1 { font-size: 22px; text-align: center; }
.auth .lead { text-align: center; color: var(--muted); margin: 6px 0 22px; }
.auth .card { padding: 22px; border-radius: var(--r-lg); box-shadow: var(--shadow); }
.install-tip { margin-top: 16px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- client approval page ---------- */
.approve { max-width: 560px; margin: 0 auto; padding: 24px 16px 48px; }
.approve .creative { display: grid; place-items: center; min-height: 190px; border-radius: var(--r); background: var(--surface-2); border: 1px dashed var(--line-strong); margin: 16px 0; padding: 16px; text-align: center; }

/* ---------- notifications ---------- */
.bell { position: relative; }
.bell-dot { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff;
  font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); animation: pop .25s var(--ease); }
@keyframes pop { from { transform: scale(.4); } to { transform: none; } }
.nlist { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; }
.nrow { display: flex; gap: 12px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: transparent; padding: 11px 10px; border-radius: 12px; cursor: pointer; position: relative; transition: background .12s; }
.nrow:hover { background: var(--surface-2); }
.nrow.unread { background: var(--accent-soft); }
.nrow.unread::after { content: ""; position: absolute; right: 12px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.nicon { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--muted); }
.nicon svg { width: 16px; height: 16px; }
.nicon.k-client { background: var(--info-soft); color: var(--info); }
.ntext { font-size: 14px; line-height: 1.4; padding-right: 18px; min-width: 0; word-break: break-word; }
.ntime { display: block; font-size: 12px; color: var(--faint); margin-top: 3px; }
.mention { font-weight: 700; color: var(--accent); }
.msg.me .mention { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* ---------- reports ---------- */
table.t.rep td, table.t.rep th { padding-left: 14px; padding-right: 14px; }
.rep-logo { width: 150px; display: block; }
.rep-logo img { width: 100%; height: auto; }
.rep-kpis { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 760px) { .rep-kpis { grid-template-columns: repeat(2, 1fr); } }

/* ---------- print (client report, attendance) ---------- */
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --bg-2: #fff; --surface: #fff; --surface-2: #f4f3ee; --surface-3: #ebe9e2; --line: #ddd; --line-strong: #ccc;
    --text: #111; --muted: #555; --faint: #888; --accent: #12806a; --accent-soft: #e2f4ee; color-scheme: light; }
  .only-dark { display: none !important; } .only-light { display: initial !important; }
  .nav, .topbar, .demo-bar, .no-print, #player, .fab, .toast, #drawer, #modal { display: none !important; }
  .shell, .shell.has-player { padding: 0 !important; }
  .main { max-width: none; padding: 0 !important; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .fade-in { animation: none; }
  tr, .k { break-inside: avoid; }
  @page { margin: 14mm; }
}

/* ============================================================
   v2: workflow, task panel, people, ads, map
   ============================================================ */
.nav-group { display: none; }
@media (min-width: 960px) {
  .nav-group { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); padding: 16px 12px 6px; }
}
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.avatar.more { background: var(--surface-3); color: var(--muted); }
.clickable-text { cursor: pointer; }
.clickable-text:hover { color: var(--accent); }
.pill.live { background: color-mix(in srgb, #e5484d 14%, var(--surface)); color: #d13a3f; }
:root[data-theme="dark"] .pill.live { color: #ff8b8e; }
.blink { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* quick sign-in (practice copy) */
.quick-login { margin-top: 16px; display: grid; gap: 10px; }
.qgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qbtn { display: flex; align-items: center; gap: 9px; text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 9px 10px; cursor: pointer; min-width: 0; transition: border-color .15s, background .15s, transform .1s; }
.qbtn:hover { border-color: var(--accent); background: var(--accent-soft); }
.qbtn:active { transform: scale(.98); }
.qbtn > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.qbtn b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qbtn .tiny { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* task panel */
@media (min-width: 1100px) { .drawer { width: min(1020px, 92vw); } }
.flowbar { display: flex; gap: 0; margin-top: 16px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.flowbar::-webkit-scrollbar { display: none; }
.fstep { flex: 1 0 74px; min-width: 74px; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; border: 0; background: transparent; padding: 4px 2px 6px; border-radius: 12px; color: var(--muted); font: inherit; }
.fstep::before { content: ""; position: absolute; top: 18px; left: calc(-50% + 16px); right: calc(50% + 16px); height: 3px; border-radius: 2px; background: var(--line-strong); }
.fstep:first-child::before { display: none; }
.fstep.done::before, .fstep.now::before { background: var(--brand); }
.fstep .fdot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-2); border: 2px solid var(--line-strong); color: var(--faint); position: relative; z-index: 1; }
.fstep .fdot svg { width: 15px; height: 15px; }
.fstep.done .fdot { background: var(--brand); border-color: var(--brand); color: #052820; }
.fstep.now .fdot { background: var(--warn); border-color: var(--warn); color: #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--warn) 22%, transparent); }
.fstep .flabel { font-size: 12px; font-weight: 650; white-space: nowrap; }
.fstep.now .flabel { color: var(--text); }
.fstep .fwho { display: inline-flex; align-items: center; gap: 4px; min-height: 20px; max-width: 100%; }
.fstep .fwho .tiny { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.fstep { cursor: pointer; }
button.fstep:hover { background: var(--surface-2); }
button.fstep:hover .fdot { border-color: var(--accent); }
.nowcard { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--warn-soft) 70%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent); }
.nowcard.done { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 25%, transparent); }
.nowcard.done svg { width: 18px; height: 18px; color: var(--good); }
.nowtag { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; background: var(--warn); color: #fff; padding: 2px 7px; border-radius: 6px; }
.timerbox { display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.timerbox.on { background: var(--accent-soft); border-color: var(--accent-line); }
.timerbox .tclock { font-family: var(--font-head); font-weight: 700; font-size: 17px; line-height: 1.1; }
.timerbox.on .tclock { color: var(--accent); }
.dtabs { padding: 10px 18px; border-bottom: 1px solid var(--line); flex: none; background: var(--surface); }
.dtabs .seg { width: 100%; }
.dtabs .seg button { flex: 1; justify-content: center; }
.dtabs .seg button { white-space: nowrap; padding: 0 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1099px) {
  /* phones/tablets: the whole panel scrolls as one page; tabs stay pinned */
  .drawer { overflow-y: auto; overscroll-behavior: contain; }
  .drawer-head { flex: none; border-bottom: 0; padding-bottom: 0; }
  .dtabs { position: sticky; top: 0; z-index: 3; margin-top: 12px; }
  .drawer-body { flex: 1 0 auto; overflow: visible; }
}
.dpane { display: none; }
.drawer-body[data-tab="details"] .dpane[data-pane="details"], .drawer-body[data-tab="time"] .dpane[data-pane="time"], .drawer-body[data-tab="chat"] .dpane[data-pane="chat"] { display: block; }
.drawer-body[data-tab="chat"] { display: flex; flex-direction: column; }
.drawer-body[data-tab="chat"] .dcols, .drawer-body[data-tab="chat"] .chatpane { flex: 1; display: flex; flex-direction: column; }
.chathead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.thread-wrap { flex: 1; }
.chatpane .composer { position: sticky; bottom: 0; background: var(--surface); padding: 10px 0 calc(4px + env(safe-area-inset-bottom)); margin-top: 12px; }
@media (min-width: 1100px) {
  .dtabs { display: none; }
  .drawer-body { overflow: hidden; padding: 0; display: block !important; }
  .dcols { display: grid; grid-template-columns: minmax(0, 1fr) 400px; height: 100%; }
  .dleft { overflow-y: auto; padding: 16px 20px; }
  .dleft .dpane { display: block !important; }
  .dleft .dpane + .dpane { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
  .chatpane { display: flex !important; flex-direction: column; border-left: 1px solid var(--line); background: var(--bg-2); padding: 14px 16px 0; min-height: 0; }
  .thread-wrap { overflow-y: auto; min-height: 0; }
  .chatpane .composer { background: var(--bg-2); }
  .drawer-head { max-height: none; }
}
.peoplebox { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.plist { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.prsn { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; background: var(--surface-2); }
.adsbox { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--info-soft) 60%, var(--surface)); border: 1px solid color-mix(in srgb, var(--info) 20%, transparent); }
.adsbox svg { color: var(--info); }
.addtime { margin-top: 16px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }

/* work: kinds of work + board */
.pipetabs { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.pipetabs::-webkit-scrollbar { display: none; }
.ptab { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 12px; cursor: pointer; font-weight: 650; font-size: 14px; color: var(--muted); white-space: nowrap; transition: all .15s; }
.ptab svg { width: 17px; height: 17px; }
.ptab b { font-size: 12px; background: var(--surface-3); border-radius: 999px; padding: 1px 8px; color: var(--muted); }
.ptab:hover { border-color: var(--line-strong); color: var(--text); }
.ptab.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ptab.on b { background: var(--accent); color: var(--accent-ink); }
.board-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-family: var(--font-head); font-weight: 700; font-size: 16px; margin: 18px 2px 10px; }
.board-title:first-child { margin-top: 0; }
.col-hint { padding: 0 6px 10px; line-height: 1.35; }
.col.over { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.kcard.dragging { opacity: .45; }
.kcard[draggable="true"] { cursor: grab; }

/* guide */
.sheet.wide { max-width: 760px; }
.guide-pipe { padding: 14px 0; border-top: 1px solid var(--line); }
.guide-flow { display: flex; flex-direction: column; gap: 0; margin-top: 10px; }
.gstep { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.gnum { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; }
.gnum svg { width: 14px; height: 14px; }
.garrow { width: 2px; height: 14px; background: var(--accent-line); margin: 2px 0 2px 13px; }

/* map */
.mapwrap { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 90px minmax(0, 1fr); align-items: start; }
.mapwrap[data-mode="all"] { align-items: stretch; grid-template-columns: minmax(0, 1fr) clamp(60px, 14vw, 200px) minmax(0, 1fr); }
.mstack { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 10px; }
.mapwrap.focus { grid-template-columns: minmax(0, 300px) 70px minmax(0, 1fr); }
.maplinks { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 0; }
.mcol { display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 1; min-width: 0; }
.mcol.center { position: sticky; top: 80px; }
.mcol-head { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 0 4px 2px; }
.mnode { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .15s, box-shadow .15s, opacity .2s; min-width: 0; }
.mnode.person { border-left: 4px solid var(--c); }
.mnode:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.mnode.big { cursor: default; padding: 16px; flex-wrap: wrap; }
.mnode.big .strong { font-size: 17px; font-family: var(--font-head); }
.mstats { color: var(--muted); margin-top: 3px; }
.cmark { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 28px; height: 28px; flex: none; border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.cmark i { display: block; }
.cmark i:only-child { grid-column: span 2; grid-row: span 2; }
.mlink { fill: none; opacity: .38; transition: opacity .2s; stroke-linecap: round; }
.mlink.focus { opacity: .6; }
.mlink.live { stroke-dasharray: 6 6; animation: dash 1s linear infinite; opacity: .8; }
@keyframes dash { to { stroke-dashoffset: -12; } }
.mapwrap.hl .mlink { opacity: .06; }
.mapwrap.hl .mlink.on { opacity: .9; }
.mapwrap.hl .mnode { opacity: .4; }
.mapwrap.hl .mnode.on { opacity: 1; border-color: var(--accent); }
.mcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-sm); min-width: 0; }
.mcard[style*="--c"] { border-left: 4px solid var(--c); }
.mtasks { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.mtask { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; background: var(--surface-2); cursor: pointer; font-size: 13px; min-width: 0; }
.mtask:hover { background: var(--accent-soft); }
@media (max-width: 760px) {
  .mapwrap { grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); }
  .mapwrap[data-mode="all"] .mnode { flex-direction: column; align-items: flex-start; gap: 6px; padding: 9px 10px; }
  .mapwrap[data-mode="all"] .mnode .pill { display: none; }
  .mapwrap.focus { grid-template-columns: 1fr; }
  .mapwrap.focus .mgap, .mapwrap.focus .maplinks { display: none; }
  .mapwrap.focus .mcol.center { position: static; margin-bottom: 12px; }
  .mapwrap.focus .mcol:not(.center) { padding-left: 16px; border-left: 3px solid var(--accent-line); margin-left: 18px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== 2026-11 simple work table, status dropdowns, simpler task popup ===== */
.spill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; line-height: 1; padding: 6px 10px; border-radius: 999px; white-space: nowrap;
  color: var(--sc); background: color-mix(in srgb, var(--sc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--sc) 35%, transparent); }
.ssel { position: relative; display: inline-block; max-width: 100%; }
.ssel select { appearance: none; -webkit-appearance: none; font: inherit; font-size: 12.5px; font-weight: 600; height: 30px; min-height: 0; width: auto; max-width: 100%;
  padding: 0 28px 0 11px; border-radius: 999px; cursor: pointer; color: var(--sc);
  background: color-mix(in srgb, var(--sc) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--sc) 40%, transparent); box-shadow: none; }
.ssel select:hover { border-color: var(--sc); }
.ssel::after { content: '▾'; position: absolute; right: 11px; top: 50%; transform: translateY(-52%); font-size: 11px; color: var(--sc); pointer-events: none; }
.sdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; vertical-align: 0; }

.wtable-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.wtable { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.wtable th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.wtable td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.wtable tr[data-act] { cursor: pointer; }
.wtable tr[data-act]:hover td { background: var(--surface-2); }
.wtable tr.done td { opacity: .62; }
.wtable .wgroup td { background: var(--bg-2); font-weight: 700; font-size: 13.5px; padding: 9px 12px; position: sticky; top: 0; }
.wtable .wgroup .count { margin-left: 8px; font-weight: 600; color: var(--muted); font-size: 12px; }
.wtable .c-date { width: 78px; } .wtable .c-client { width: 17%; } .wtable .c-status { width: 168px; } .wtable .c-person { width: 15%; } .wtable .c-link { width: 48px; text-align: right; }
.wtable .lt { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wtable .ls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.wtable .ls .pi { width: 15px; height: 15px; }
.wtable.hide-c-client .c-client, .wtable.hide-c-date .c-date, .wtable.hide-c-person .c-person { display: none; }
.late-txt { color: var(--bad); font-weight: 600; }
@media (max-width: 760px) {
  .wtable, .wtable tbody { display: block; }
  .wtable thead { display: none; }
  .wtable tr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .wtable tr.wgroup { display: block; padding: 0; }
  .wtable td { display: block; padding: 0; border: 0; width: auto !important; }
  .wtable .c-work { grid-column: 1 / -1; order: -1; }
  .wtable .c-date, .wtable .c-client { font-size: 12.5px; color: var(--muted); }
  .wtable .c-link { text-align: right; }
  .wtable.hide-c-client .c-client, .wtable.hide-c-date .c-date, .wtable.hide-c-person .c-person { display: none; }
}

.drawer:has(.pbody) { width: min(660px, 100vw); }
.drawer-body.pbody { overflow-y: auto !important; padding: 16px 20px 28px !important; display: block !important; }
.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .pgrid { grid-template-columns: 1fr 1fr; } .pgrid .pf:first-child { grid-column: 1 / -1; } }
.pf .pfl { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.pf .pfv input, .pf .pfv select { width: 100%; }
.pf .ssel, .pf .ssel select { width: 100%; height: 38px; }
.pmain-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.pmore { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.pmore summary { cursor: pointer; font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: space-between; list-style: none; }
.pmore summary::-webkit-details-marker { display: none; }
.pmore summary svg { width: 16px; height: 16px; transition: transform .2s; }
.pmore[open] summary svg { transform: rotate(180deg); }
.pmore .plist { margin: 6px 0 8px; }
.pact { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.pact h3 { margin-bottom: 10px; }
.alog { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.aline { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--muted); }
.aline b { color: var(--text); font-weight: 600; }
.aline .q { font-style: italic; }
.aline .adot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); flex: none; transform: translateY(-1px); }
.atime { font-size: 11.5px; color: var(--faint); margin-left: auto; white-space: nowrap; }
.acomment { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.acomment .atime { margin-left: 0; }
.abody { font-size: 14px; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }

.wfcard { margin-bottom: 14px; }
.wfcard.off { opacity: .6; }
.wfname { font-weight: 700; font-size: 16px; max-width: 320px; }
.strow { display: grid; grid-template-columns: 36px minmax(0, 1fr) minmax(0, 220px) 70px 104px; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
.strow.head { border-top: 0; padding-top: 12px; }
.strow input[type=color] { width: 32px; height: 32px; padding: 2px; border-radius: 8px; cursor: pointer; }
@media (max-width: 640px) { .strow { grid-template-columns: 34px 1fr auto; } .strow > :nth-child(3) { grid-column: 2 / -1; } .strow > :nth-child(4) { display: none; } .strow.head { display: none; } }

/* ===== sheet-style editing, extra columns, paste, guide ===== */
.wtable-wrap.xl { overflow-x: auto; }
.wtable-wrap.xl .wtable { table-layout: auto; min-width: 100%; }
.wtable-wrap.xl td { padding: 4px 6px; }
.wtable-wrap.xl th { padding: 9px 8px; white-space: nowrap; }
.wtable-wrap.xl .c-open { width: 40px; white-space: nowrap; }
.wtable-wrap.xl .c-date { min-width: 136px; }
.wtable-wrap.xl .c-work { min-width: 230px; }
.wtable-wrap.xl .c-x { min-width: 170px; max-width: 260px; }
.wtable-wrap.xl .c-status { min-width: 160px; }
.wtable-wrap.xl .c-person { min-width: 120px; }
.wtable-wrap.xl .c-link { min-width: 190px; text-align: left; }
.wtable-wrap.xl .wgroup td { position: static; }
.wtable-wrap.xl .wg-in { position: sticky; left: 12px; display: inline-flex; align-items: center; gap: 4px; }
.cell { width: 100%; height: 32px; min-height: 0; padding: 4px 7px; font-size: 13.5px; border: 1px solid transparent; background: transparent; border-radius: 7px; box-shadow: none; color: var(--text); }
.cell:hover { border-color: var(--line); }
.cell:focus { border-color: var(--accent); background: var(--surface); outline: none; }
.cell.strong { font-weight: 600; }
select.cell { appearance: none; -webkit-appearance: none; cursor: pointer; }
.cell.saved { border-color: var(--good); }
.wtable .ls { padding-left: 7px; }
.cmt-n { font-size: 11px; color: var(--muted); margin-left: 2px; }
.addrow { margin-left: 12px; font-size: 12.5px; font-weight: 600; color: var(--accent); background: transparent; border: 1px dashed var(--accent-line, var(--line-strong)); border-radius: 999px; padding: 3px 10px; cursor: pointer; }
.addrow:hover { background: var(--accent-soft); }
.pfields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 14px; }
.pfields .field.wide { grid-column: 1 / -1; }
.pfields select { width: 100%; height: 40px; }
@media (max-width: 560px) { .pfields { grid-template-columns: 1fr; } }
.ptable { max-height: 260px; overflow: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; }
.ptable .wtable { table-layout: auto; font-size: 12.5px; }
.ptable td, .ptable th { padding: 5px 8px; }
.flrow { display: grid; grid-template-columns: minmax(0, 1fr) 80px minmax(0, 1.3fr) auto 104px; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .flrow { grid-template-columns: 1fr auto; } .flrow > :nth-child(2), .flrow > :nth-child(3):empty { display: none; } }
.gsteps { display: grid; gap: 10px; margin-top: 10px; }
.gcard { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.gcard .gnum { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--accent-soft); color: var(--accent); }

/* ============================================================
   v3: Projects → Tasks (Zoho-style), task panel
   ============================================================ */
/* Projects page: slim icon menu on computers so the list has room */
@media (min-width: 960px) {
  .shell.pj-mode { --side-w: 72px; }
  .shell.pj-mode .nav { padding: 14px 10px; align-items: stretch; }
  .shell.pj-mode .nav .side-logo, .shell.pj-mode .nav .nav-group { display: none; }
  .shell.pj-mode .nav a { justify-content: center; padding: 11px 0; }
  .shell.pj-mode .nav a span:not(.dot) { display: none; }
  .shell.pj-mode .nav .dot { position: absolute; top: 4px; right: 6px; margin: 0; }
  .shell.pj-mode .topbar { padding-left: 20px; }
}
.shell.pj-mode .main { max-width: none; padding: 0; }
.pj { display: grid; grid-template-columns: minmax(0, 1fr); min-height: calc(100vh - 60px); }
.pj-side { display: none; }
.pj-main { min-width: 0; padding: 16px 16px 40px; }
@media (min-width: 900px) {
  .pj { grid-template-columns: 236px minmax(0, 1fr); }
  .pj-side { display: block; position: sticky; top: 60px; align-self: start; max-height: calc(100vh - 60px); overflow-y: auto; padding: 18px 12px 40px;
    border-right: 1px solid var(--line); background: var(--surface); }
  .pj-main { padding: 26px 32px 80px; }
  .pj-picker { display: none !important; }
}
.pj-side.in-sheet { display: block; position: static; max-height: none; border: 0; padding: 0; background: none; }
.pj-search { position: relative; margin-bottom: 10px; }
.pj-search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--faint); pointer-events: none; }
.pj-search input { height: 38px; padding-left: 34px; border-radius: 10px; font-size: 14px; }
.pj-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 9px; border: 0; background: transparent; color: var(--muted);
  font-size: 14px; font-weight: 550; text-decoration: none; cursor: pointer; text-align: left; min-width: 0; }
.pj-link svg { width: 17px; height: 17px; flex: none; }
.pj-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.pj-link.on { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.pj-link.closed { opacity: .6; }
.pj-link .ellipsis { flex: 1; min-width: 0; }
.pj-new { color: var(--accent); font-weight: 650; }
.pj-pct { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; flex: none; }
.pj-link.on .pj-pct { color: var(--accent); }
.pj-client { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; border-radius: 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 9px 10px; margin-top: 2px; }
.pj-client:hover { background: var(--surface-2); color: var(--text); }
.pj-client svg { width: 14px; height: 14px; flex: none; transform: rotate(-90deg); transition: transform .15s; }
.pj-client[aria-expanded="true"] svg { transform: none; }
.pj-client .ellipsis { flex: 1; min-width: 0; }
.pj-ccount { font-weight: 600; letter-spacing: 0; color: var(--faint); }
.pj-crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; margin-bottom: 6px; }
.pj-crumbs a { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); flex: none; }
.pj-crumbs a svg { width: 16px; height: 16px; }
.pj-vtools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.pj-viewbar h2 { min-width: 0; }
@media (max-width: 700px) { .pj-viewbar { flex-wrap: wrap; } .pj-vtools { justify-content: flex-start; width: 100%; } }
.pj-older { font-size: 13px; margin-top: 12px; color: var(--faint); }
.pj-picker { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 14px; margin-bottom: 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface); color: var(--text); font-weight: 600; cursor: pointer; }
.pj-picker svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.pj-picker .ellipsis { flex: 1; text-align: left; }

.pj-head { display: flex; align-items: flex-start; gap: 16px; }
.pj-head h1 { font-size: 23px; }
.pj-tag { font-size: 12px; font-weight: 650; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 3px 9px; border-radius: 999px; }
.pj-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 14px; color: var(--muted); font-size: 14px; }
.pj-stats b { color: var(--text); font-weight: 650; }
.pj-bar { width: 110px; height: 7px; border-radius: 4px; background: var(--surface-3); overflow: hidden; display: inline-block; margin-right: -10px; }
.pj-bar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.pj-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 26px 0 16px; }
.pj-tools .search { flex: 0 1 240px; }
.pj-tools .search input { height: 36px; }
.pj-group { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
@media (max-width: 759px) {
  .pj-wide { display: none !important; }
  .pj-tools .search { flex-basis: 100%; }
  .pj-tools .btn.primary { margin-left: auto; }
  .pj-tools .grow { display: none; }
}

/* the task list */
.ttable-wrap { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow-x: auto; }
.ttable { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; min-width: 680px; font-size: 14px; }
.ttable col.w-clock { width: 46px; } .ttable col.w-owner { width: 150px; } .ttable col.w-status { width: 168px; }
.ttable col.w-date { width: 96px; } .ttable col.w-x { width: 180px; }
.ttable th { height: 42px; padding: 0 14px; text-align: left; font-size: 12px; font-weight: 650; color: var(--faint); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.ttable th:first-child { border-top-left-radius: 13px; } .ttable th:last-child { border-top-right-radius: 13px; }
.ttable td { height: 52px; padding: 0 14px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.ttable tr:hover td { background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.ttable td[data-act="cell-edit"] { cursor: pointer; }
.ttable td[data-act="cell-edit"]:hover { box-shadow: inset 0 0 0 1px var(--line-strong); border-radius: 6px; }
.ttable td.editing { padding: 0 6px; box-shadow: none !important; }
.ttable td.c-status { padding: 0; }
.ttable td.c-clock { padding: 0; text-align: center; }
.ttable tr.done td { color: var(--faint); }
.ttable .c-x .ellipsis { display: block; }
.ied { width: 100%; height: 36px; border: 1.5px solid var(--accent); border-radius: 8px; padding: 0 9px; background: var(--surface); font-size: 14px; outline: none; }
textarea.ied { height: auto; min-height: 70px; padding: 8px 9px; resize: vertical; }
td.editing textarea.ied { position: relative; z-index: 2; }
.tname { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tname.editing { padding-right: 4px; }
.tlink { border: 0; background: transparent; padding: 0; font: inherit; font-weight: 550; color: var(--text); cursor: pointer; min-width: 0; max-width: 100%; display: flex; text-align: left; }
.tlink:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
tr.done .tlink { color: var(--faint); }
.tmeta { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--faint); flex: none; }
.tmeta svg { width: 13px; height: 13px; }
.tproj { font-size: 12px; color: var(--muted); background: var(--surface-2); padding: 2px 8px; border-radius: 6px; max-width: 170px; flex: none; }
.tname .pill { flex: none; }
.tedit { margin-left: auto; flex: none; width: 28px; height: 28px; border: 0; border-radius: 7px; background: transparent; color: var(--faint); cursor: pointer; display: grid; place-items: center; opacity: 0; }
.tedit svg { width: 14px; height: 14px; }
tr:hover .tedit, .tedit:focus-visible { opacity: 1; }
.tedit:hover { background: var(--surface-3); color: var(--text); }
.tclock { width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--faint); cursor: pointer; display: inline-grid; place-items: center; }
.tclock svg { width: 17px; height: 17px; }
.tclock:hover { background: var(--accent-soft); color: var(--accent); }
.tclock.pz { background: var(--surface-2); color: var(--text); }
.tclock.pz:hover { background: var(--line); color: var(--text); }
.tclock.ok { background: var(--accent); color: #fff; }
.tclock.ok:hover { background: var(--accent); filter: brightness(1.08); color: #fff; }
.trun { display: inline-flex; align-items: center; gap: 4px; }
.trun b { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; color: var(--accent); min-width: 38px; text-align: right; margin-right: 2px; }
.ttable col.w-clock.run { width: 128px; }
.tc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.tp-timer .tclock { width: 26px; height: 26px; }
.tp-timer .tclock svg { width: 14px; height: 14px; }
.tp-timer.on { gap: 6px; padding: 0 4px 0 12px; }
.owner { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.stcell { position: relative; display: flex; align-items: center; justify-content: center; height: 52px; padding: 0 28px 0 12px; background: var(--sc); color: #fff;
  font-size: 13px; font-weight: 650; text-shadow: 0 1px 1px rgba(0, 0, 0, .12); }
.stcell svg { position: absolute; right: 10px; width: 14px; height: 14px; opacity: .85; }
.stcell select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; }
.stcell:hover { filter: brightness(1.06); }
.stcell:has(select:focus-visible) { outline: 2px solid var(--text); outline-offset: -3px; }
tr.done .stcell { opacity: .75; }
.tgroup td { height: 46px; background: var(--bg) !important; }
.tgroup-btn { border: 0; background: transparent; padding: 0; display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 650; color: var(--text); cursor: pointer; }
.tgroup-btn svg { width: 16px; height: 16px; color: var(--faint); transition: transform .15s; }
.tgroup-btn[aria-expanded="false"] svg { transform: rotate(-90deg); }
.tgroup-btn .count { font-weight: 500; color: var(--faint); font-size: 13px; }
.taddrow td { height: 46px; }
.taddrow td, .taddrow:hover td { background: transparent !important; }
.tadd-btn { border: 0; background: transparent; padding: 6px 0; display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tadd-btn svg { width: 15px; height: 15px; }
.tadd-btn:hover { color: var(--accent); }
.tadd-wrap { display: flex; align-items: center; gap: 12px; }
.tadd { flex: 1; max-width: 460px; height: 36px; border: 1.5px solid var(--accent); border-radius: 8px; padding: 0 10px; background: var(--surface); font-size: 14px; outline: none; }
.soon-txt { color: var(--warn); font-weight: 600; }
.ok-txt { color: var(--good); }

/* phones: simple cards */
.tlist { margin-bottom: 20px; }
.tlist > .tgroup-btn { padding: 6px 2px 8px; }
.tcard { display: flex; align-items: center; gap: 12px; padding: 14px; margin-top: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.tcard.done { opacity: .65; }
.tc-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.tc-meta .ellipsis { max-width: 160px; }
.stpill { flex: none; background: var(--sc); color: #fff; font-size: 12px; font-weight: 650; padding: 5px 10px; border-radius: 7px; white-space: nowrap; }
.tlist .taddrow { padding: 10px 4px 0; }
.tlist .tadd-wrap { flex-wrap: wrap; }

/* task panel */
.drawer.tp-drawer { width: min(700px, 100vw); overflow: hidden; }
@media (min-width: 1100px) { .drawer.tp-drawer { width: min(700px, 92vw); } }
.tp { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.tp-top { flex: none; display: flex; gap: 12px; align-items: flex-start; padding: 20px 22px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.tp-crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.tp-crumb a { color: var(--muted); }
.tp-crumb a:hover { color: var(--accent); }
.tp-title { font-size: 21px; margin-top: 6px; line-height: 1.25; word-break: break-word; }
.tp-title.editable { cursor: text; border-radius: 8px; }
.tp-title.editable:hover { background: var(--surface-2); }
.tp-title .ied { font-size: 17px; height: 40px; }
.tp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 12px; }
.tp-timer { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 6px 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface);
  font: inherit; font-size: 13.5px; font-weight: 650; color: var(--text); cursor: pointer; }
button.tp-timer { padding-right: 14px; }
button.tp-timer:hover { border-color: var(--accent); color: var(--accent); }
.tp-timer svg { width: 16px; height: 16px; }
.tp-timer.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.tp-timer b { font-variant-numeric: tabular-nums; min-width: 42px; }
.tp-tbtn { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--warn); color: #fff; display: grid; place-items: center; cursor: pointer; }
.tp-tbtn svg { width: 13px; height: 13px; }
.tp-m { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); }
.tp-m svg { width: 15px; height: 15px; }
.tp-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px calc(40px + env(safe-area-inset-bottom)); background: var(--bg); }
.tp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
.tp-ct { font-family: var(--font-head); font-weight: 650; font-size: 15px; margin-bottom: 10px; }
.tp-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tp-st { display: flex; flex-direction: column; gap: 4px; }
.tp-stsel { position: relative; display: inline-flex; align-items: center; gap: 9px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 650; }
.tp-stsel i { width: 11px; height: 11px; border-radius: 50%; background: var(--sc); flex: none; }
.tp-stsel svg { width: 15px; height: 15px; color: var(--muted); }
.tp-stsel select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.tp-stsel:hover { border-color: var(--sc); }
.tp-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.rte { border: 1px solid var(--line-strong); border-radius: 11px; overflow: hidden; background: var(--surface); }
.rte:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 5px 6px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.rte-b { min-width: 32px; height: 30px; padding: 0 6px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; font-size: 14px; }
.rte-b svg { width: 15px; height: 15px; }
.rte-b:hover { background: var(--surface-3); color: var(--text); }
.rte-body { min-height: 120px; padding: 12px 14px; outline: none; line-height: 1.6; font-size: 14.5px; }
.rte-body:empty::before { content: attr(data-placeholder); color: var(--faint); }
.rte-body ul, .rte-body ol, .rte-view ul, .rte-view ol { padding-left: 22px; margin: 4px 0; }
.rte-view { line-height: 1.6; font-size: 14.5px; }
.ir { display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; min-height: 46px; border-bottom: 1px solid var(--line); }
.ir:last-child { border-bottom: 0; }
.irl { font-size: 13.5px; color: var(--muted); }
.irv { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 10px; margin-left: -10px; border-radius: 8px; font-size: 14px; }
.irv.editable { cursor: pointer; }
.irv.editable:hover { background: var(--surface-2); }
.irv.editing { padding: 4px 0; margin-left: 0; cursor: default; background: transparent !important; }
.irv.editing .ied { flex: 1; width: 100%; min-width: 0; }
.irv .pre { white-space: pre-wrap; }
.irv a.ellipsis { min-width: 0; }
.ir-edit { margin-left: auto; opacity: .55; }
.ir-edit:hover { opacity: 1; }
@media (max-width: 520px) { .ir { grid-template-columns: 1fr; gap: 0; padding: 8px 0; } .tp-top, .tp-body { padding-left: 16px; padding-right: 16px; } }
.tp-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.tp-tabs::-webkit-scrollbar { display: none; }
.tp-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 12px 12px 10px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tp-tabs button:hover { color: var(--text); }
.tp-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tp-panes { padding: 16px 0 4px; }
.tp-pane { display: none; }
.tp-panes[data-tab="comments"] [data-pane="comments"], .tp-panes[data-tab="subtasks"] [data-pane="subtasks"], .tp-panes[data-tab="time"] [data-pane="time"],
.tp-panes[data-tab="links"] [data-pane="links"], .tp-panes[data-tab="history"] [data-pane="history"] { display: block; }
.tp-comments { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.tp-comments .acomment { background: var(--surface); }
.tp-empty { padding: 10px 2px; }
.sub { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; margin-bottom: 6px; }
.sub label { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; font-size: 14px; }
.sub input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.sub.done span { text-decoration: line-through; color: var(--faint); }
.sub-add { display: flex; gap: 8px; margin-top: 10px; }
.sub-add input { flex: 1; height: 40px; }
.linkrow { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); margin-bottom: 6px; }
.linkrow:hover { border-color: var(--accent); text-decoration: none; }
.linkrow svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.linkrow .grow > span { display: block; }

/* new project */
.pj-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pj-kind { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 14px; border: 1.5px solid var(--line-strong); border-radius: 13px; cursor: pointer; background: var(--surface); }
.pj-kind input { position: absolute; opacity: 0; pointer-events: none; }
.pj-kind span { font-size: 13px; color: var(--muted); }
.pj-kind.on { border-color: var(--accent); background: var(--accent-soft); }
.pj-kind:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pj-preview { margin-top: 10px; padding: 11px 13px; border-radius: 11px; font-size: 13.5px; background: var(--surface-2); }
.pj-preview.good { background: var(--good-soft); color: var(--good); }
.pj-preview.info { background: var(--info-soft); color: var(--info); }
.pj-preview.warn { background: var(--warn-soft); color: var(--warn); }
.colpick { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 14.5px; cursor: pointer; }
.colpick input { width: 18px; height: 18px; accent-color: var(--accent); }
.pj-hbtns { display: flex; gap: 8px; flex: none; }
@media (max-width: 759px) { .pj-head { flex-wrap: wrap; } .pj-hbtns .btn.ghost span { display: none; } }
@media (max-width: 899px) {
  .pj-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .pj-head h1 { display: none; }
  .pj-head .row:has(> h1) { gap: 6px !important; }
  .pj-hbtns { order: -1; justify-content: space-between; }
  .pj-stats { margin-top: 2px; gap: 6px 14px; font-size: 13.5px; }
  .pj-tools { margin-top: 16px; gap: 8px; }
}
.tname .tlink { flex: 0 1 auto; min-width: 110px; }
.tname .tproj { flex: 0 4 auto; min-width: 40px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsub { font-size: 12px; color: var(--faint); margin-top: 1px; line-height: 1.2; }
.ttable td.c-task { line-height: 1.3; }

/* ============================================================
   v4: phone fixes, clear date boxes, compact task list
   ============================================================ */
/* Nothing may make the page wider than the phone */
.shell, .main { overflow-x: clip; }
.main > *, .card, .grid > * { min-width: 0; }
/* iPhones zoom in on small text boxes; 16px stops that (and the sideways sliding after it) */
@media (max-width: 759px) {
  input, select, textarea, .ied, .tadd { font-size: 16px !important; }
}
/* Date boxes: a clear calendar button, and the whole box opens the calendar */
input[type=date] { cursor: pointer; position: relative; }
input[type=date]::-webkit-calendar-picker-indicator { opacity: 1; cursor: pointer; width: 18px; height: 18px; padding: 4px; border-radius: 6px;
  background-color: var(--accent-soft); filter: none; }
:root[data-theme="dark"] input[type=date]::-webkit-calendar-picker-indicator { filter: invert(1) hue-rotate(180deg); background-color: rgba(255, 255, 255, .25); }
input[type=date]::-webkit-datetime-edit { padding: 0; }

/* compact task list */
.ttable td { height: 42px; }
.ttable .stcell { height: 42px; }
.ttable th { height: 38px; }
.tgroup td { height: 42px; }
.taddrow td { height: 38px; }
.tclock { width: 28px; height: 28px; }
.tmore { border: 0; background: transparent; padding: 4px 0; margin-right: 18px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--accent); cursor: pointer; }
.tmore:hover { text-decoration: underline; }
.tcard { padding: 11px 13px; margin-top: 6px; }

/* Projects home: this month */
.pj-month { font-size: 23px; min-width: 190px; text-align: center; }
.ptiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 22px 0 20px; }
.ptile { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); font: inherit; color: inherit; }
button.ptile { cursor: pointer; }
button.ptile:hover { border-color: var(--line-strong); background: var(--surface-2); }
.ptile .pl { font-size: 12.5px; color: var(--muted); }
.ptile .pn { font-family: var(--font-head); font-size: 26px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ptile.bad .pn { color: var(--bad); }
.ptable { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; min-width: 640px; font-size: 14px; }
.ptable th { height: 38px; padding: 0 14px; text-align: left; font-size: 12px; font-weight: 650; color: var(--faint); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.ptable th:first-child { border-top-left-radius: 13px; } .ptable th:last-child { border-top-right-radius: 13px; }
.ptable td { height: 54px; padding: 0 14px; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptable tbody tr { cursor: pointer; }
.ptable tbody tr:hover td { background: var(--surface-2); }
.ptable tbody tr:last-child td { border-bottom: 0; }
.ptable .w-type { width: 112px; } .ptable .w-prog { width: 170px; } .ptable .w-late { width: 64px; } .ptable .w-due { width: 96px; } .ptable .w-hrs { width: 90px; } .ptable .w-fee { width: 104px; }
.ptable .pj-bar { margin-right: 0; width: 90px; }
@media (max-width: 759px) {
  .ptiles { grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
  .ptile .pn { font-size: 22px; }
  .pj-month { font-size: 19px; min-width: 0; }
  .ptable { min-width: 0; }
  .ptable thead { display: none; }
  .ptable, .ptable tbody, .ptable tr, .ptable td { display: block; width: 100%; }
  .ptable tr { position: relative; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .ptable tbody tr:last-child { border-bottom: 0; }
  .ptable td { height: auto; padding: 0; border: 0; display: inline-block; width: auto; margin-right: 12px; }
  .ptable td:first-child { display: block; margin: 0 80px 6px 0; }
  .ptable td:nth-child(2) { position: absolute; top: 12px; right: 14px; margin: 0; }
}
/* project tabs: Tasks | Drive */
.pj-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-top: 18px; }
.pj-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; padding: 10px 12px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.pj-tabs button svg { width: 16px; height: 16px; }
.pj-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.pj-tabs .count { font-weight: 500; color: var(--faint); font-size: 12.5px; }
.pj-tabs + .pj-tools { margin-top: 16px; }
.drive-bar { display: flex; align-items: center; gap: 8px; margin: 16px 0 10px; }
.drive-bar svg { width: 15px; height: 15px; vertical-align: -2px; }
.drive-frame { width: 100%; height: min(70vh, 720px); border: 1px solid var(--line); border-radius: 14px; background: #fff; display: block; }
.drive-empty { margin-top: 18px; padding: 26px; max-width: 620px; }
.drive-ico { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 12px; }
.drive-ico svg { width: 24px; height: 24px; }
.drive-steps { margin: 10px 0 16px; padding-left: 20px; line-height: 1.8; }
.drive-form { display: flex; gap: 8px; flex-wrap: wrap; }
.drive-form input { flex: 1 1 260px; }

/* dashboard */
.dash .page-head { align-items: center; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.dcol { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 899px) { .dash-grid { grid-template-columns: minmax(0, 1fr); } }
.dcard { padding: 18px 20px; }
.dhead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cbars { display: grid; gap: 4px; }
.cbar, .wbar, .arow2, .lrow2 { width: 100%; border: 0; background: transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 9px; }
.cbar:hover, .wbar:hover, .arow2:hover, .lrow2:hover { background: var(--surface-2); }
.cbar { display: grid; grid-template-columns: 120px minmax(0, 1fr) 70px; align-items: center; gap: 12px; padding: 8px 8px; }
.cb-name { font-size: 14px; font-weight: 600; }
.cb-track { position: relative; height: 14px; }
.cb-track i, .legend2 i { position: absolute; left: 0; top: 0; height: 14px; border-radius: 4px; }
.cb-fee { background: color-mix(in srgb, var(--brand) 45%, var(--surface-3)); }
.cb-cost { background: var(--accent); height: 8px !important; top: 3px !important; }
.cb-cost.over { background: var(--bad); }
.cb-val { font-size: 13.5px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.legend2 { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.legend2 span { display: inline-flex; align-items: center; gap: 6px; }
.legend2 i { position: static; display: inline-block; width: 14px; height: 10px !important; }
.arow2 { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--line); border-radius: 0; font-size: 14px; }
.arow2 span { flex: 1; }
.arow2 b { font-variant-numeric: tabular-nums; }
.arow2 svg { width: 15px; height: 15px; color: var(--faint); }
.dsub { font-size: 12px; font-weight: 650; color: var(--faint); margin: 14px 8px 4px; text-transform: uppercase; letter-spacing: .06em; }
.lrow2 { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 7px 8px; font-size: 13.5px; }
.lrow2 .muted { max-width: 110px; }
.wbar { display: grid; grid-template-columns: 22px 62px minmax(0, 1fr) 58px; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 7px 8px; }
.wb-name { font-size: 14px; font-weight: 600; }
.wb-track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.wb-track i { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.wb-track i.hi { background: var(--bad); } .wb-track i.lo { background: var(--warn); }
.wb-val { font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.wb-sub { grid-column: 3 / 5; font-size: 12px; color: var(--muted); margin-top: 2px; }
@media (max-width: 520px) { .cbar { grid-template-columns: 86px minmax(0, 1fr) 58px; gap: 8px; } }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 899px) {
  .pj-head.home { flex-direction: row; align-items: center; }
  .pj-head.home h1 { display: block; }
  .pj-head.home .pj-hbtns { order: 0; }
  .pj-head.home .btn span { display: none; }
}
@media (max-width: 520px) { .cbar { grid-template-columns: 104px minmax(0, 1fr) 56px; } }

/* ---------- Round 2 (2026-11-27): adjustable columns, round + button, board, project cards, Finance ---------- */
.ttable { min-width: 0; }
.ttable col.w-fill { width: auto; }
.ttable th { position: relative; }
.ttable th.th-fill { padding: 0 8px; text-align: right; }
.col-rs { position: absolute; top: 0; right: -4px; width: 9px; height: 100%; cursor: col-resize; z-index: 2; touch-action: none; }
.col-rs::after { content: ''; position: absolute; left: 4px; top: 10px; bottom: 10px; width: 1px; background: var(--line-strong); }
.col-rs:hover::after, .col-rs.on::after { width: 3px; left: 3px; background: var(--accent); top: 4px; bottom: 4px; border-radius: 2px; }
body.col-resizing, body.col-resizing * { cursor: col-resize !important; user-select: none; }
.tghead { display: flex; align-items: center; gap: 10px; }
.tplus { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; flex: none; padding: 0; }
.tplus svg { width: 14px; height: 14px; }
.tplus:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.tlist .tghead { margin-top: 14px; }
.tlist .tghead .tplus { margin-left: auto; }
.pj-tools .seg { flex: none; }
.pj-viewbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.pj-viewbar h2 { font-size: 17px; }
.pj-late { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }

/* projects as cards */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.pcard { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); text-decoration: none; min-width: 0; }
.pcard:hover { border-color: var(--line-strong); background: var(--surface-2); text-decoration: none; }
.pcard .pj-tag { flex: none; }
.pc-stats { display: flex; gap: 14px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.pc-stats b { font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; margin-right: 2px; }
.pc-stats .late-txt b { color: var(--bad); }
.pc-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }

/* board (Kanban) */
.kboard { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 12px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.kcol { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; min-width: 0; transition: background .12s, border-color .12s; }
.kcol.over { border-color: var(--accent); background: var(--accent-soft); }
.kc-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 8px; font-size: 14px; }
.kc-head .count { color: var(--faint); font-size: 13px; }
.kc-head .tplus { margin-left: auto; width: 24px; height: 24px; }
.kc-body { display: grid; gap: 8px; }
.kc-body .tadd { max-width: none; width: 100%; }
.kcard { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; display: grid; gap: 6px; min-width: 0; }
.kcard:hover { border-color: var(--line-strong); }
.kcard[draggable="true"] { cursor: grab; }
.kcard.dragging { opacity: .45; }
.kcard.done { opacity: .65; }
.kc-title { font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.kc-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.kc-empty { font-size: 13px; color: var(--faint); padding: 10px 4px; }
@media (max-width: 759px) {
  .kboard { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); overflow: visible; }
  .pj-tools .seg { order: -1; }
}

/* Finance */
.fcard { padding: 18px 20px; margin-bottom: 16px; }
.ftable { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 14px; }
.ftable th { font-size: 12px; font-weight: 650; color: var(--faint); text-align: left; padding: 0 10px 8px; border-bottom: 1px solid var(--line); }
.ftable td { padding: 10px; border-bottom: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftable tr:last-child td { border-bottom: 0; }
.ftable .r { text-align: right; }
.ftable tr[data-act] { cursor: pointer; }
.ftable tr[data-act]:hover td { background: var(--surface-2); }
.ftable td:first-child { width: auto; }
.ftable thead th:first-child { width: 34%; }
.fin-in { width: 150px; }
.fin-in input { width: 112px; height: 36px; text-align: right; margin-left: 6px; }
.fin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.fin-grid .fcard { margin-bottom: 0; }
.ptile.good .pn { color: var(--good); }
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .fcard { padding: 14px 12px; }
  .ftable td, .ftable th { padding-left: 6px; padding-right: 6px; font-size: 13px; }
  .fin-grid { grid-template-columns: minmax(0, 1fr); }
  .fin-in { width: 128px; }
  .fin-in input { width: 96px; }
}
.kboard { grid-auto-columns: minmax(200px, 1fr); }
@media (min-width: 900px) { .pj-side { height: calc(100vh - 60px); } }
@media (min-width: 1400px) { .main { max-width: 1480px; } }

/* Drive inside the app */
.linkish { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.linkish:hover { text-decoration: underline; }
.linkish svg, .drive-bar a svg { width: 14px; height: 14px; }
.drive-bar { flex-wrap: wrap; }
.dcrumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; }
.dcrumbs > svg { color: var(--muted); flex: none; }
.dcrumbs .ellipsis { max-width: 220px; }
.dupload { cursor: pointer; }
.dlist { padding: 4px 0; transition: border-color .12s, background .12s; }
.dlist.over { border-color: var(--accent); background: var(--accent-soft); }
.dfile { display: grid; grid-template-columns: minmax(0, 1fr) 80px 80px auto; align-items: center; gap: 12px; padding: 6px 14px; border-bottom: 1px solid var(--line); }
.dfile:last-child { border-bottom: 0; }
.dfile:hover { background: var(--surface-2); }
.dname { display: flex; align-items: center; gap: 10px; min-width: 0; border: 0; background: none; padding: 4px 0; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; text-decoration: none; }
.dname:hover { color: var(--accent); text-decoration: none; }
.dico { width: 34px; height: 34px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; flex: none; color: var(--muted); }
.dico.folder { color: #e8a317; background: color-mix(in srgb, #e8a317 14%, transparent); }
.dico svg { width: 18px; height: 18px; }
.dthumb { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }
.dempty { display: grid; justify-items: center; gap: 6px; padding: 40px 16px; text-align: center; }
.dempty > svg { width: 28px; height: 28px; color: var(--faint); }
.drive-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; align-items: start; margin-top: 18px; }
.drive-cols .drive-empty { margin-top: 0; max-width: none; }
/* The long "Create a Drive folder" button wraps inside the card on phones instead of sticking out */
.drive-empty .btn.lg { max-width: 100%; white-space: normal; text-align: left; height: auto; padding-top: 10px; padding-bottom: 10px; margin-top: 10px; }
@media (max-width: 520px) { .drive-empty .btn.lg { width: 100%; justify-content: center; text-align: center; } }
.drive-setup { padding: 22px; }
.drive-setup .strong svg { width: 16px; height: 16px; color: var(--good); vertical-align: -3px; }
.drive-setup ol li { margin-bottom: 6px; }
.drive-paste { margin-top: 18px; }
.drive-paste summary, .drive-setup summary { cursor: pointer; }
.copyline { display: flex; align-items: center; gap: 6px; margin: 6px 0; padding: 4px 4px 4px 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; }
.copyline code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 12.5px; }
@media (max-width: 640px) {
  .dfile { grid-template-columns: minmax(0, 1fr) auto; padding: 6px 10px; }
  .dfile .dmeta { display: none; }
  .dfile .btn span { display: none; }
  .drive-cols { grid-template-columns: minmax(0, 1fr); }
  .drive-bar .btn span { display: none; }
}
.dfoot a, .dfoot .linkish { display: inline-flex; align-items: center; gap: 4px; }
.dfoot svg { width: 14px; height: 14px; flex: none; }
.dcrumbs .ellipsis { max-width: min(460px, 60vw); }
.kboard { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); overflow: visible; }
@media (max-width: 759px) { .kboard { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .ftable thead th:first-child { width: 40%; } .kc-empty { padding: 2px 4px; } }
.quiet-r .fade-in { animation: none; }

/* ---------- Calendar view ---------- */
.cal-wrap { margin-top: 6px; }
.cal-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-nav h2 { font-size: 18px; min-width: 150px; text-align: center; }
.cal-key { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.cal-key span { display: inline-flex; align-items: center; gap: 5px; }
.cal-key i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; border: 1px solid var(--line); }
.cal-key .k-we { background: var(--surface-3); }
.cal-key .k-hol { background: color-mix(in srgb, var(--bad) 22%, transparent); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.cal-key .k-fest { background: var(--accent-soft); border-color: var(--accent-line); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.cal-wd { padding: 8px 10px; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.cal-wd.we { color: var(--faint); }
.cal-cell { min-height: 118px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-grid > .cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell.out { background: var(--bg-2); }
.cal-cell.we { background: color-mix(in srgb, var(--surface-3) 55%, var(--surface)); }
.cal-cell.hol { background: color-mix(in srgb, var(--bad) 6%, var(--surface)); }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-cell.over { background: var(--accent-soft); }
.cal-dh { display: flex; align-items: center; justify-content: space-between; min-height: 22px; }
.cal-dn { font-size: 13px; font-weight: 600; color: var(--muted); }
.cal-cell.today .cal-dn { color: var(--accent); }
.cal-plus { border: 0; background: none; color: var(--faint); width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; cursor: pointer; opacity: 0; }
.cal-plus svg { width: 14px; height: 14px; }
.cal-cell:hover .cal-plus, .cal-aday .cal-plus { opacity: 1; }
.cal-plus:hover { background: var(--surface-3); color: var(--text); }
.cal-tag { font-size: 11px; line-height: 1.3; padding: 1px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.cal-tag.hol { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); font-weight: 600; }
.cal-tag.fest { background: var(--accent-soft); color: var(--accent); }
.cal-items { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip { display: flex; align-items: center; min-width: 0; width: 100%; text-align: left; font: inherit; font-size: 12px; padding: 3px 6px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); border-left: 3px solid var(--sc); background: var(--surface-2); color: var(--text); }
.cal-chip:hover { border-color: var(--line-strong); border-left-color: var(--sc); }
.cal-chip.done { opacity: .55; text-decoration: line-through; }
.cal-chip.late { color: var(--bad); }
.cal-chip.dragging { opacity: .4; }
.cal-chip[draggable="true"] { cursor: grab; }
.cal-more { border: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; text-align: left; padding: 2px 4px; cursor: pointer; }
.cal-agenda { display: flex; flex-direction: column; gap: 8px; }
.cal-aday { border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.cal-aday.we { background: color-mix(in srgb, var(--surface-3) 55%, var(--surface)); }
.cal-aday.hol { background: color-mix(in srgb, var(--bad) 6%, var(--surface)); }
.cal-aday.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-ah { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cal-ah b { font-size: 13px; margin-right: 2px; }
.cal-ah .cal-plus { margin-left: auto; }
.cal-aday .cal-chip { font-size: 13px; padding: 6px 8px; }

/* ---------- Task types as cards ---------- */
.tt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tt-card { display: flex; flex-direction: column; gap: 10px; text-align: left; font: inherit; color: inherit; cursor: pointer; margin: 0; }
button.tt-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-sm); }
.tt-card.off { opacity: .6; }
.tt-name { font-family: var(--font-head); font-size: 16px; }
.tt-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tt-st { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--sc) 16%, transparent); color: var(--text); border: 1px solid color-mix(in srgb, var(--sc) 45%, transparent); white-space: nowrap; }
.tt-arrow { color: var(--faint); font-size: 12px; }
.tt-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: auto; }
.tt-new { cursor: default; border-style: dashed; }

/* ============================================================
   Round 5 (2026-11-29): calmer, flatter, tighter (phones first)
   Radius 8–10, no glow, hairline lists, spacing 4/8/12/16/24.
   ============================================================ */
:root { --r-sm: 8px; --r: 10px; --r-lg: 12px; --dbar-h: 52px; }
:root[data-theme="dark"] { --faint: #7f908a; } /* readable small text on dark (≥4.5:1) */
.card { box-shadow: none; }
.btn { border-radius: 8px; }
.btn.sm, .btn.xs { border-radius: 8px; }
.btn.lg { border-radius: 10px; }
.btn.primary { box-shadow: none; }
.btn.primary:active { background: var(--accent-hover); }
.btn:active { transform: none; background: var(--surface-3); }
.fab { border-radius: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, .35); border: 1px solid var(--accent-hover); }
.chip { border-radius: 8px; min-height: 36px; }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.seg { border-radius: 8px; }
.seg button { border-radius: 6px; }
.seg button.on { box-shadow: none; background: var(--surface-3); }
input, select, textarea, .dd { border-radius: 8px; }
.pj-tag { border-radius: 6px; padding: 2px 7px; }
.avatar.me { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.link-chev { display: inline-flex; align-items: center; gap: 2px; }
.link-chev svg { width: 15px; height: 15px; }
.empty-line { padding: 16px 4px; color: var(--muted); font-size: 14px; }
.empty-line .strong { color: var(--text); font-weight: 600; }

/* loading placeholders + error with Try again */
.sk-wrap { padding: 4px 0; }
.shell.pj-mode .sk-wrap { padding: 16px; }
@media (min-width: 900px) { .shell.pj-mode .sk-wrap { padding: 26px 32px; } }
.sk-rows { margin-top: 16px; border-top: 1px solid var(--line); }
.sk-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.skel { border-radius: 6px; }
.err-box { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid color-mix(in srgb, var(--bad) 40%, var(--line)); border-radius: 10px; background: var(--bad-soft); }
.err-box b { display: block; }
.boot .btn { margin-top: 4px; }

/* check-in / timer bar above the bottom menu */
#daybar:empty { display: none; }
.dbar { position: fixed; z-index: 29; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); height: var(--dbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; background: var(--surface); border-top: 1px solid var(--line); }
.dbar.on { background: color-mix(in srgb, var(--good) 9%, var(--surface)); border-top-color: color-mix(in srgb, var(--good) 35%, var(--line)); }
.dbar.warn { background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border-top-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
.dbar-main { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; color: var(--text); font: inherit; font-size: 14px; cursor: pointer; text-align: left; text-decoration: none !important; }
.dbar-main b.num { font-variant-numeric: tabular-nums; font-weight: 700; }
.dbar-t { min-width: 0; }
.dbar-main > .dbar-t.ellipsis { flex: 1; color: var(--muted); }
.dbar-ic svg { width: 20px; height: 20px; color: var(--warn); display: block; }
.dbar .btn { flex: none; }
.pulse { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--good); animation: pulse 1.8s ease-in-out infinite; }
.pulse.lg { width: 14px; height: 14px; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.75); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.shell.has-dbar { padding-bottom: calc(var(--nav-h) + var(--dbar-h) + env(safe-area-inset-bottom) + 16px); }
.shell.has-dbar .fab { bottom: calc(var(--nav-h) + var(--dbar-h) + env(safe-area-inset-bottom) + 12px); }
@media (max-width: 959px) { .shell.has-dbar #player { display: none; } }
.nav a.live svg { color: inherit; }
.nav a.live::after { content: ""; position: absolute; top: 9px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 2px var(--surface); animation: pulse 1.8s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .nav a.live::after { animation: none; } }
@media (min-width: 960px) {
  .dbar { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: min(460px, calc(100vw - var(--side-w) - 120px)); margin-left: calc(var(--side-w) / 2);
    border: 1px solid var(--line); border-radius: 10px; }
  .dbar.on { border-color: color-mix(in srgb, var(--good) 35%, var(--line)); }
  .dbar.warn { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }
  .shell.has-dbar { padding-bottom: 0; }
  .shell.has-dbar .main { padding-bottom: 90px; }
  .shell.has-dbar .fab { bottom: 28px; }
  .nav a.live::after { top: 50%; left: 26px; margin-top: -12px; }
}

/* My Day: hairline list instead of a stack of cards; one row of numbers */
.tasks { gap: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.tasks .trow { border: 0; border-radius: 0; box-shadow: none; border-top: 1px solid var(--line); padding: 12px; gap: 12px; }
.tasks .trow:first-child { border-top: 0; }
.tasks .trow:hover { box-shadow: none; background: var(--surface-2); }
.kpis-mini { display: flex; gap: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.kpis-mini .k { flex: 1; background: none; border: 0; border-radius: 0; padding: 12px 0; border-left: 1px solid var(--line); padding-left: 12px; }
.kpis-mini .k:first-child { border-left: 0; padding-left: 0; }
.kpis-mini .k b { font-size: 20px; }
.daybar .state { border-radius: 10px; }
.daybar .state .pulse { display: block; }
.hello h1 { font-size: 24px; }
.group-label { margin: 24px 2px 8px; }

/* ---------- Projects home: one row per client ---------- */
.ph-bar { display: flex; align-items: center; gap: 4px; min-height: 44px; }
.ph-bar .icon-btn { width: 44px; height: 44px; }
.ph-month { font-size: 20px; white-space: nowrap; margin: 0 2px; }
.m-short { display: none; }
@media (max-width: 599px) { .m-long { display: none; } .m-short { display: inline; } }
.ph-bar .btn.primary { margin-left: 4px; }
.pj-mob-side { display: inline-grid; }
@media (min-width: 900px) { .pj-mob-side { display: none; } }
.ph-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; margin-top: 8px; color: var(--muted); font-size: 14px; }
.dotsep { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--faint); margin: 0 8px; vertical-align: middle; }
.crows { margin-top: 16px; border-top: 1px solid var(--line); }
.crow { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none !important; }
.crow:hover { background: var(--surface-2); }
.crow:active { background: var(--surface-3); }
.crow > svg { width: 18px; height: 18px; color: var(--faint); flex: none; }
.cr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cr-name { font-weight: 650; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cr-sub { display: flex; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; }
.cr-prog { flex: none; width: 64px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 13px; color: var(--muted); }
.cr-prog .num { font-variant-numeric: tabular-nums; }
.cr-bar { width: 100%; height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.cr-bar i { display: block; height: 100%; background: var(--brand); }
.ph-empty { margin-top: 24px; padding: 16px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.ph-empty .btn svg { width: 16px; height: 16px; }
.pj-crumbs { margin: 8px 0 0; }
.menu-list { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.mrow { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; text-decoration: none !important; }
.mrow > span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.mrow svg { width: 18px; height: 18px; color: var(--faint); flex: none; }
.mrow:hover { background: var(--surface-2); }

/* ---------- Inside a project: compact header ---------- */
.pj-head2 { display: flex; align-items: center; gap: 4px; min-width: 0; }
.pj-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 0; font: inherit; color: var(--text); text-align: left; cursor: pointer; min-height: 44px; }
.pj-title h1 { font-size: 20px; line-height: 1.25; min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pj-title svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.pj-head2 .icon-btn { width: 44px; height: 44px; }
.pj-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.pj-picker { display: none !important; }
.pj-tabs { margin-top: 12px; }
.pj-tabs button { min-height: 44px; }
.pj-tabs + .pj-tools { margin-top: 12px; }
.pj-tools { margin: 16px 0 12px; gap: 8px; }
.pj-mob, .pj-mob-flex { display: none !important; }
.pj-desk { display: contents; }
.icon-btn.has { color: var(--accent); }
.fcount { position: absolute; top: 4px; right: 4px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
.pj-tools .icon-btn { position: relative; }
.pj-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 12px; }
.pj-chips .chip span { margin-left: 2px; font-size: 16px; line-height: 1; }
.pj-fsheet { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pj-fsheet .pj-group, .pj-fsheet select { width: 100%; }
.pj-fsheet .pj-group select { flex: 1; }
.pj-fsheet .chip { min-height: 44px; }
.pj-fab { display: none; }
@media (min-width: 900px) { .pj-title { pointer-events: none; } .pj-title svg { display: none; } }
@media (max-width: 759px) {
  .pj-addbtn { display: none !important; }
  .pj-fab { display: grid; }
  .pj-desk { display: none; }
  .pj-mob { display: inline-grid !important; }
  .pj-mob-flex { display: flex !important; }
  .pj-tools { flex-wrap: wrap; gap: 4px; margin: 12px 0 8px; }
  .pj-tools .seg { flex: 1; display: flex; }
  .pj-tools .seg button { flex: 1; justify-content: center; height: 38px; padding: 0; }
  .pj-tools .seg .lbl { display: none; }
  .pj-tools .seg button svg { width: 18px; height: 18px; }
  .pj-tools .icon-btn { width: 44px; height: 44px; }
  .pj-tools .search { display: none; order: 10; flex-basis: 100%; }
  .pj-tools.searching .search { display: block; }
  .pj-tools .grow { display: none; }
  /* task cards become a hairline list */
  .tlist { margin-bottom: 16px; }
  .tlist .tghead { min-height: 44px; }
  .tcard { margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; padding: 12px 4px; }
  .tcard:active { background: var(--surface-2); }
  .tlist .tghead + .tcard { border-top: 1px solid var(--line); }
}

/* ---------- Phone calendar: month grid + the picked day ---------- */
.cal-nav h2 { min-width: 0; }
@media (max-width: 759px) {
  .cal-nav { gap: 4px; margin-bottom: 8px; justify-content: center; }
  .cal-nav .grow { display: none; }
  .cal-nav .icon-btn { width: 44px; height: 44px; }
  .cal-nav h2 { font-size: 17px; white-space: nowrap; min-width: 110px; text-align: center; }
}
.mcal { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 8px 4px 0; touch-action: pan-y; user-select: none; }
.mc-wd, .mc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.mc-wd span { text-align: center; font-size: 11px; font-weight: 650; color: var(--faint); padding-bottom: 4px; }
.mc-wd span.we { color: var(--muted); }
.mc { position: relative; height: 44px; margin: 1px; border: 0; border-radius: 8px; background: none; font: inherit; color: var(--text); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0; }
.mc.out { cursor: default; }
.mc .mn { font-size: 14px; font-variant-numeric: tabular-nums; width: 30px; height: 30px; line-height: 30px; text-align: center; border-radius: 50%; }
.mc.we { background: color-mix(in srgb, var(--surface-3) 70%, transparent); }
.mc.fest { background: var(--accent-soft); }
.mc.hol { background: color-mix(in srgb, var(--bad) 16%, transparent); }
.mc.hol .mn { color: var(--bad); }
.mc.today .mn { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 700; }
.mc.sel .mn { background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: none; }
.mc:focus-visible { outline-offset: 0; }
.mdot { position: absolute; bottom: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.mdot.late { background: var(--bad); }
.mdot.done { background: var(--faint); }
.mk { position: absolute; top: 3px; right: 4px; width: 6px; height: 6px; }
.mk.hol { background: var(--bad); border-radius: 1px; }
.mk.fest { border: 1.5px solid var(--accent); border-radius: 50%; }
.mc-grid .wk-hide { display: none; }
.mcal-handle { display: block; width: 100%; height: 22px; border: 0; background: none; cursor: pointer; padding: 0; }
.mcal-handle i { display: block; margin: 0 auto; width: 32px; height: 4px; border-radius: 2px; background: var(--line-strong); }
.mag { margin-top: 16px; }
.mag-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.mag-head h3 { font-size: 15px; }
.mag-head .btn svg { width: 16px; height: 16px; }
.mag-tag { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 4px 0; color: var(--muted); }
.mag-tag.hol { color: var(--bad); }
.mag-tag .mk { position: static; flex: none; }
.mag-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.mag-head + .mag-row, .mag-tag + .mag-row { border-top: 1px solid var(--line); margin-top: 4px; }
.mag-row:active { background: var(--surface-2); }
.mag-row .sbar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--sc); flex: none; }
.mag-row .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mag-t { font-weight: 600; font-size: 14.5px; }
.mag-s { font-size: 12.5px; color: var(--muted); }
.mag-row.done .mag-t { text-decoration: line-through; color: var(--faint); }
.mag-row > svg { width: 16px; height: 16px; color: var(--faint); flex: none; }
.mag-none { padding: 12px 0; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }

/* ---------- Overview ---------- */
.dash .page-head { margin-bottom: 8px; }
.atwork { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 4px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none !important; font-size: 14px; }
.atwork:hover { background: var(--surface-2); }
.atwork > svg { width: 18px; height: 18px; color: var(--faint); flex: none; }
.atwork .avatars .avatar { border-color: var(--bg); }
.ostats { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 24px; margin: 16px 0 8px; }
.ostat { display: flex; flex-direction: column; gap: 2px; border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; }
button.ostat { cursor: pointer; }
.ostat .ov { font-family: var(--font-head); font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.ostat.big .ov { font-size: 32px; }
.ostat .ol { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ostat.bad .ov { color: var(--bad); }
.onone { margin: 0 0 16px; }
.ostats + .dash-grid, .onone + .dash-grid { margin-top: 24px; }
.cbars2 { border-top: 1px solid var(--line); }
.cbar2 { display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 6px 12px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.cbar2:hover { background: var(--surface-2); }
.cb2-name { font-weight: 600; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cb2-val { font-size: 13.5px; color: var(--muted); }
.cbar2 > svg { width: 16px; height: 16px; color: var(--faint); }
.cb2-track { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.cb2-track i { display: block; height: 100%; background: var(--brand); }
@media (max-width: 759px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .dash .dcard { border: 0; background: none; padding: 0; }
}
@media (max-width: 759px) { .pj-tabs.mob-hide { display: none; } }
.ostat .ol { text-transform: none; letter-spacing: 0; font-size: 12.5px; font-weight: 500; }
.ostat .ov { font-size: 18px; }
.ostat.big .ov { font-size: 28px; }
.ostats { gap: 8px 20px; }
.mc.we { background: color-mix(in srgb, var(--surface-3) 40%, transparent); }
.mc.fest { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.mc.hol { background: color-mix(in srgb, var(--bad) 14%, transparent); }

/* Round 5b: no bar on other screens; Check in / Pause / Resume / End day on the My Day card */
.day-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.daybar .state.brk { background: var(--warn-soft); color: var(--warn); }
.daybar h2 .num { font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .daybar .day-acts { width: 100%; } .daybar .day-acts .btn { flex: 1; } }
.status.brk::before { background: var(--warn); }
