/* ---------- Tokens ---------- */
:root {
  --bg: #F3F3F6;
  --surface: #FFFFFF;
  --surface-2: #F7F7FA;
  --col-bg: #F9F9FB;
  --hover: #ECECF1;
  --border: #E8E8EE;
  --border-strong: #D9D9E2;
  --text: #15151C;
  --text-2: #4A4A57;
  --muted: #8A8A98;
  --accent: #6B4EFF;
  --accent-hover: #5A3DF0;
  --on-accent: #FFFFFF;
  --ink: #15151C;
  --on-ink: #FFFFFF;
  --danger: #E5484D;
  --success: #22A06B;
  --warn: #E08A00;
  --info: #3B7BFF;
  --shadow-sm: 0 1px 2px rgba(20, 20, 40, .04);
  --shadow: 0 1px 2px rgba(20, 20, 40, .04), 0 10px 24px -10px rgba(20, 20, 40, .14);
  --shadow-lg: 0 30px 70px -20px rgba(20, 20, 40, .35);
  --scrim: rgba(18, 18, 28, .28);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E0E12;
    --surface: #17171C;
    --surface-2: #1E1E25;
    --col-bg: #131318;
    --hover: #25252D;
    --border: #2A2A33;
    --border-strong: #3A3A45;
    --text: #F1F1F4;
    --text-2: #C4C4CE;
    --muted: #868694;
    --accent: #8B72FF;
    --accent-hover: #9C86FF;
    --ink: #F1F1F4;
    --on-ink: #15151C;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 24px -10px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .8);
    --scrim: rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E0E12;
  --surface: #17171C;
  --surface-2: #1E1E25;
  --col-bg: #131318;
  --hover: #25252D;
  --border: #2A2A33;
  --border-strong: #3A3A45;
  --text: #F1F1F4;
  --text-2: #C4C4CE;
  --muted: #868694;
  --accent: #8B72FF;
  --accent-hover: #9C86FF;
  --ink: #F1F1F4;
  --on-ink: #15151C;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 24px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .8);
  --scrim: rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* Project / member colors */
.c-violet { --c: #7B5CFF; }
.c-orange { --c: #F2780C; }
.c-pink   { --c: #E5487D; }
.c-green  { --c: #1F9D66; }
.c-blue   { --c: #3B7BFF; }
.c-amber  { --c: #D99A00; }

/* Tones for pills & stats */
.t-violet { --t: var(--accent); }
.t-red    { --t: var(--danger); }
.t-blue   { --t: var(--info); }
.t-green  { --t: var(--success); }
.t-amber  { --t: var(--warn); }

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.i { flex: none; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.grow { flex: 1; }
.muted { color: var(--muted); }
.sm { font-size: 12.5px; }
.min0 { min-width: 0; }
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-gap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px 16px;
}
.main { min-width: 0; padding: 28px 36px 56px; }
.mobile-bar { display: none; align-items: center; gap: 12px; margin-bottom: 18px; }
.mobile-title { font-weight: 700; font-size: 16px; }
.scrim { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40;
    background: var(--bg); transform: translateX(-100%);
    transition: transform .25s cubic-bezier(.2, .8, .2, 1);
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .scrim.show { display: block; position: fixed; inset: 0; z-index: 39; background: var(--scrim); }
  .main { padding: 16px 16px 48px; }
  .mobile-bar { display: flex; }
}

/* ---------- Sidebar ---------- */
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 16px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: var(--ink); color: var(--on-ink);
}
.brand-mark svg { stroke-width: 2.6; }
.brand-name { font-weight: 600; }
.brand-sub { font-size: 12px; color: var(--muted); }

.search-trigger {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 38px;
  padding: 0 8px 0 11px; margin-bottom: 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  transition: border-color .15s;
}
.search-trigger:hover { border-color: var(--border-strong); }
kbd {
  margin-left: auto; font: 500 11px/1 Inter, system-ui, sans-serif; padding: 4px 6px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 40px;
  padding: 0 10px; border-radius: 12px; text-align: left;
  color: var(--text-2); font-weight: 500;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--ink); color: var(--on-ink); box-shadow: 0 8px 18px -8px rgba(0, 0, 0, .45); }
.nav-item > span:not(.proj-icon):not(.count):not(.switch) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .count { font-size: 12px; color: var(--muted); font-weight: 500; }
.nav-item.active .count { color: inherit; opacity: .65; }
.nav-item.dim { color: var(--muted); }

.nav-section {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 6px 6px 10px;
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}

.proj-icon {
  width: 22px; height: 22px; border-radius: 7px; flex: none;
  display: grid; place-items: center;
  background: var(--c); color: #fff; font-size: 11px; font-weight: 700;
}
.proj-icon.lg { width: 38px; height: 38px; border-radius: 12px; font-size: 15px; box-shadow: 0 6px 14px -6px var(--c); }
.proj-icon.xl { width: 52px; height: 52px; border-radius: 16px; font-size: 21px; box-shadow: 0 10px 22px -10px var(--c); }

.sidebar-foot { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.switch { position: relative; width: 32px; height: 18px; flex: none; border-radius: 99px; background: var(--border-strong); transition: background .2s; }
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s;
}
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(14px); }

.user-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px;
  border-radius: 18px; background: var(--ink); color: var(--on-ink);
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .5);
}
.user-card .av { box-shadow: none; }
.uc-text { flex: 1; min-width: 0; }
.uc-text .name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-text .sub { font-size: 12px; opacity: .6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card .icon-btn { color: inherit; background: color-mix(in srgb, var(--on-ink) 12%, transparent); }
.user-card .icon-btn:hover { background: color-mix(in srgb, var(--on-ink) 22%, transparent); color: inherit; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px; border-radius: 12px;
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 10px 22px -10px var(--accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { background: var(--surface); border: 1px solid var(--border); }
.btn.ghost:hover { background: var(--hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }

.icon-btn {
  width: 36px; height: 36px; border-radius: 11px; flex: none;
  display: grid; place-items: center; color: var(--text-2);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.sm { width: 26px; height: 26px; border-radius: 8px; }
.icon-btn.outlined { background: var(--surface); border: 1px solid var(--border); }

.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 12px; outline: none;
  border: 1px solid var(--border); background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: var(--border-strong); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.input.sm { height: 34px; border-radius: 10px; font-size: 13px; }
.input.lg { height: 48px; font-size: 16px; }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: none; line-height: 1.5; }
select.input { cursor: pointer; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid-2 { grid-template-columns: 1fr; } }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border-radius: 9px; font-size: 12.5px; font-weight: 500; color: var(--text-2);
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }

.check {
  width: 20px; height: 20px; flex: none; border-radius: 7px;
  display: grid; place-items: center;
  border: 1.5px solid var(--border-strong); background: var(--surface); color: transparent;
  transition: background .15s, border-color .15s, color .15s;
}
.check svg { stroke-width: 3.2; }
.check:hover { border-color: var(--success); color: color-mix(in srgb, var(--success) 50%, transparent); }
.check.on { background: var(--success); border-color: var(--success); color: #fff; }

/* ---------- Pills, avatars, progress ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px;
  border-radius: 99px; border: 1px solid var(--border); background: var(--surface);
  font-size: 12px; font-weight: 500; color: var(--text-2); white-space: nowrap;
}
.pill.tone { background: color-mix(in srgb, var(--t) 12%, transparent); color: var(--t); border-color: transparent; }
.pill.proj { background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); border-color: transparent; font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.st-todo { color: var(--muted); }
.st-doing { color: var(--warn); }
.st-done { color: var(--success); }
.ps-active { color: var(--success); }
.ps-paused { color: var(--warn); }
.ps-completed { color: var(--info); }

.av {
  --s: 26px; width: var(--s); height: var(--s); border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  background: var(--c, var(--muted)); color: #fff;
  font-size: calc(var(--s) * .38); font-weight: 600; letter-spacing: .01em;
  box-shadow: 0 0 0 2px var(--surface);
}
.av.empty { background: transparent; border: 1.5px dashed var(--border-strong); color: var(--muted); box-shadow: none; }
.av.more { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.av-stack { display: inline-flex; }
.av-stack .av + .av { margin-left: -8px; }

.progress { height: 6px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--accent)); transition: width .3s; }

.empty-state {
  padding: 28px 16px; text-align: center; color: var(--muted);
  border: 1.5px dashed var(--border-strong); border-radius: 16px;
}

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 26px; }
h1 { font-size: 30px; font-weight: 400; letter-spacing: -.025em; line-height: 1.15; }
h1 strong { font-weight: 700; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.sub { color: var(--muted); margin-top: 6px; }
.head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.crumbs a:hover { color: var(--text); }
.crumbs span { color: var(--text); font-weight: 500; }

.block { margin-top: 30px; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 500; font-size: 13px; }
.link:hover { color: var(--text); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-sm); }
.panel.pad { padding: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* ---------- Home ---------- */
.home { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.home-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 28px; }
@media (max-width: 1200px) {
  .home { grid-template-columns: minmax(0, 1fr); }
  .home-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
}

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { padding: 16px 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.stat-icon {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--t) 13%, transparent); color: var(--t);
}
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.stat-label { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }

.proj-list { padding: 6px; }
.proj-row {
  display: grid; grid-template-columns: minmax(0, 1.7fr) 110px minmax(110px, 1fr) 84px 96px;
  align-items: center; gap: 16px; padding: 12px; border-radius: 16px;
  transition: background .15s;
}
.proj-row:hover { background: var(--surface-2); }
.pr-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pr-name b { font-weight: 600; }
.pr-progress { display: flex; align-items: center; gap: 10px; }
.pr-progress .progress { flex: 1; }
.pr-next { text-align: right; }
.new-row {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  height: 44px; margin-top: 4px; border-radius: 14px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--accent); font-weight: 600;
  transition: background .15s;
}
.new-row:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
@media (max-width: 760px) {
  .proj-row { grid-template-columns: minmax(0, 1fr) auto; }
  .proj-row .hide-sm { display: none; }
}

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 12px; border-radius: 14px; font-size: 11.5px; color: var(--muted);
  transition: background .15s;
}
.day b { font-size: 15px; font-weight: 600; color: var(--text); }
.day:hover { background: var(--hover); }
.day.today:not(.sel) b { color: var(--accent); }
.day.sel { background: var(--accent); color: color-mix(in srgb, var(--on-accent) 75%, transparent); box-shadow: 0 10px 20px -10px var(--accent); }
.day.sel b { color: var(--on-accent); }
.day .has { position: absolute; bottom: 5px; width: 4px; height: 4px; border-radius: 50%; background: currentColor; }

.mini-head { font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 16px 2px 8px; }
.mini-list { display: flex; flex-direction: column; gap: 6px; }
.mini-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
  border-radius: 14px; border: 1px solid var(--border); background: var(--surface);
  transition: border-color .15s;
}
.mini-item:hover { border-color: var(--border-strong); }
.mini-item .t { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-item.done .t { text-decoration: line-through; color: var(--muted); }
.mini-item .swatch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }

.timeline { position: relative; }
.timeline li { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.timeline li:not(:last-child)::before {
  content: ""; position: absolute; left: 15px; top: 34px; bottom: 2px; width: 1.5px; background: var(--border);
}
.tl-icon {
  width: 32px; height: 32px; border-radius: 10px; flex: none; display: grid; place-items: center;
  background: var(--c); color: #fff; box-shadow: 0 6px 12px -6px var(--c);
}
.tl-icon svg { stroke-width: 2.2; }
.tl-text { font-size: 13px; color: var(--text-2); line-height: 1.55; padding-top: 1px; }
.tl-text b { color: var(--text); font-weight: 600; }
.tag { padding: 1px 7px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font-weight: 500; }
time { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Task card ---------- */
.task-card {
  display: flex; flex-direction: column; gap: 8px; padding: 14px; cursor: pointer;
  border-radius: 18px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-sm);
  transition: box-shadow .18s, border-color .18s, transform .18s;
}
.task-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-1px); }
.task-card.dragging { opacity: .35; transform: none; }
.tc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.task-card h3 { font-size: 14.5px; font-weight: 600; line-height: 1.35; letter-spacing: -.005em; overflow-wrap: anywhere; }
.task-card.done h3 { text-decoration: line-through; color: var(--muted); }
.tc-notes {
  color: var(--muted); font-size: 13px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tc-foot { display: flex; align-items: center; gap: 10px; margin-top: 2px; color: var(--muted); font-size: 12px; }
.meta { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Project ---------- */
.ph-left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.ph-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ph-meta { display: flex; align-items: center; gap: 12px; margin-top: 8px; color: var(--muted); font-size: 13px; }
.ph-meta .progress { width: 120px; }

.board { display: grid; grid-template-columns: repeat(3, minmax(270px, 1fr)); gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.col { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: 22px; background: var(--col-bg); border: 1px solid var(--border); }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 4px 8px; }
.col-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.count-badge {
  min-width: 22px; height: 20px; padding: 0 7px; border-radius: 99px;
  display: inline-grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border); font-size: 11.5px; font-weight: 600; color: var(--text-2);
}
.col-body { display: flex; flex-direction: column; gap: 8px; min-height: 40px; }
.col-body:empty::after {
  content: "Drop tasks here"; display: grid; place-items: center; height: 80px;
  border: 1.5px dashed var(--border-strong); border-radius: 16px; color: var(--muted); font-size: 13px;
}
.add-row {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 38px; padding: 0 10px;
  border-radius: 12px; color: var(--muted); font-weight: 500;
  transition: background .15s, color .15s;
}
.add-row:hover { background: var(--surface); color: var(--text); }

.list { overflow: hidden; }
.group + .group { border-top: 1px solid var(--border); }
.group-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px 10px; font-weight: 600; }
.list-row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto 104px 28px;
  align-items: center; gap: 14px; padding: 10px 18px; cursor: pointer;
  border-top: 1px solid var(--border); background: var(--surface);
  transition: background .15s;
}
.list-row:hover { background: var(--surface-2); }
.list-row.dragging { opacity: .35; }
.list-row .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row.done .t { text-decoration: line-through; color: var(--muted); }
.lr-tags { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.group-body:empty::after { content: "No tasks"; display: block; padding: 10px 18px 10px 52px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.group-add { padding: 4px 8px 8px; border-top: 1px solid var(--border); }
.group-add .add-row:hover { background: var(--surface-2); }
@media (max-width: 640px) {
  .list-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .list-row .lr-tags, .list-row .lr-av { display: none; }
}

/* ---------- Calendar ---------- */
.cal { overflow: hidden; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-dow div { padding: 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cal-cell {
  min-height: 124px; padding: 8px; display: flex; flex-direction: column; gap: 6px;
  border-top: 1px solid var(--border); border-left: 1px solid var(--border);
  transition: background .15s;
}
.cal-cell:nth-child(7n + 1) { border-left: 0; }
.cal-cell.out { background: var(--surface-2); }
.cal-cell.out .num { color: var(--muted); }
.cal-cell.drop-hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.cal-top { display: flex; align-items: center; justify-content: space-between; }
.num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.cal-cell.today .num { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 14px -6px var(--accent); }
.cal-add { opacity: 0; }
.cal-cell:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.chips { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.chip {
  display: flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 8px; cursor: pointer;
  background: color-mix(in srgb, var(--c) 13%, transparent); font-size: 12px; font-weight: 500;
  transition: background .15s;
}
.chip:hover { background: color-mix(in srgb, var(--c) 22%, transparent); }
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); flex: none; }
.chip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.done { opacity: .55; }
.chip.done span { text-decoration: line-through; }
.chip.dragging { opacity: .3; }
@media (max-width: 700px) {
  .cal-dow div { padding: 10px 4px; text-align: center; font-size: 10.5px; }
  .cal-cell { min-height: 72px; padding: 4px; align-items: center; }
  .cal-add { display: none; }
  .chips { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .chip { padding: 0; background: none; }
  .chip span { display: none; }
  .chip::before { width: 8px; height: 8px; }
}

/* ---------- Drawer ---------- */
#drawer-root { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.drawer-backdrop { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .25s; }
.drawer {
  position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(500px, calc(100% - 24px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 26px; box-shadow: var(--shadow-lg);
  transform: translateX(calc(100% + 24px)); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
#drawer-root.open { pointer-events: auto; }
#drawer-root.open .drawer-backdrop { opacity: 1; }
#drawer-root.open .drawer { transform: none; }
.drawer-head { display: flex; align-items: center; gap: 4px; padding: 14px 14px 10px 22px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 6px 24px 24px; }
.title-row { display: flex; align-items: flex-start; gap: 12px; }
.title-row .check { margin-top: 7px; }
.title-input {
  flex: 1; border: 0; outline: none; resize: none; background: none; padding: 0; overflow: hidden;
  font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3;
}
.title-input::placeholder { color: var(--muted); }
.props { display: flex; flex-direction: column; gap: 4px; margin: 20px 0 8px; padding: 6px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.prop { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 44px; }
.prop-label { color: var(--muted); font-size: 13px; }
.prop .input { max-width: 240px; }
.d-section { margin-top: 20px; }
.d-section h4 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.d-section h4 span { font-weight: 500; }
.d-section .progress { margin-bottom: 10px; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.checklist li .icon-btn { opacity: 0; }
.checklist li:hover .icon-btn, .checklist li .icon-btn:focus-visible { opacity: 1; }
.cl-text { flex: 1; min-width: 0; height: 32px; border: 0; outline: none; background: none; border-radius: 8px; padding: 0 6px; margin-left: -6px; }
.cl-text:focus { background: var(--surface-2); }
.checklist li.done .cl-text { text-decoration: line-through; color: var(--muted); }
.add-item { width: 100%; height: 36px; margin-top: 4px; border: 0; outline: none; background: none; color: var(--text); padding: 0 2px; }
.add-item::placeholder { color: var(--muted); }
.created { margin-top: 28px; }

/* ---------- Modal ---------- */
#modal-root { display: none; }
#modal-root.open { display: flex; position: fixed; inset: 0; z-index: 60; align-items: flex-start; justify-content: center; padding: 12vh 16px 16px; }
.modal-backdrop { position: absolute; inset: 0; background: var(--scrim); animation: fade .2s; }
.modal {
  position: relative; width: min(460px, 100%); max-height: 80vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow-lg);
  animation: pop .22s cubic-bezier(.2, .8, .2, 1);
}
.modal.wide { width: min(560px, 100%); }
.modal.search-modal { width: min(580px, 100%); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-form { display: flex; flex-direction: column; gap: 16px; padding: 20px 22px 22px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin: -4px -8px -4px 0; }
.modal-head h3 { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.swatches { display: flex; gap: 10px; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span {
  display: block; width: 30px; height: 30px; border-radius: 10px; background: var(--c); cursor: pointer;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 2px transparent; transition: box-shadow .15s;
}
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c); }
.swatch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 4px; }

.members { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.members li { display: flex; align-items: center; gap: 10px; }
.members .av { box-shadow: none; }

.search-bar { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.search-bar input { flex: 1; height: 56px; border: 0; outline: none; background: none; font-size: 16px; color: var(--text); }
.results { padding: 8px; max-height: 50vh; overflow-y: auto; }
.res-group { padding: 10px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.res { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 12px; text-align: left; }
.res.active { background: var(--hover); }
.res .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.res-empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- Helpers added for accounts ---------- */
.center { text-align: center; }
.nowrap { flex-wrap: nowrap; }
.t-red-text { color: var(--danger); }
.t-amber-text { color: var(--warn); }
.form-error { color: var(--danger); font-size: 13px; font-weight: 500; }
code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .95em; }
.nav-empty { padding: 6px 10px; font-size: 12.5px; color: var(--muted); }
.ph-meta .sep { width: 1px; height: 14px; background: var(--border-strong); }
.ph-meta b { color: var(--text); font-weight: 600; }

/* ---------- Sign in ---------- */
body.signed-out .app, body.signed-out .mobile-bar { display: none; }
body:not(.signed-out) .auth { display: none; }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; padding: 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 26px; box-shadow: var(--shadow);
}
.auth-card h1 { font-size: 24px; font-weight: 700; }
.auth-card .btn { width: 100%; height: 44px; }
.brand-mark.lg { width: 48px; height: 48px; border-radius: 15px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80; max-width: calc(100% - 32px);
  padding: 11px 16px; border-radius: 14px; background: var(--ink); color: var(--on-ink);
  font-weight: 500; box-shadow: var(--shadow-lg);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Team ---------- */
.team-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 6px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: 13px;
}
.team-btn:hover { background: var(--hover); }
.team-btn .av { box-shadow: 0 0 0 2px var(--surface); }
.creds { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.creds div { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.creds code { font-size: 15px; font-weight: 600; padding: 3px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); }

/* ---------- Manager report ---------- */
.report { margin-bottom: 20px; padding: 6px 18px 18px; }
.report.collapsed { padding-bottom: 6px; }
.report-head { display: flex; align-items: center; gap: 12px; width: 100%; height: 48px; text-align: left; color: var(--muted); }
.report-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--text); }
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 6px 0 18px; }
.kpi { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.kpi.t-red .kpi-value, .kpi.t-amber .kpi-value, .kpi.t-green .kpi-value { color: var(--t); }
.kpi-label { font-size: 12.5px; color: var(--muted); }
.kpi .progress { margin-top: 4px; background: var(--surface); }
.report-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.report h4 { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.report h4 .muted { font-weight: 400; margin-left: 4px; }
.workload { display: flex; flex-direction: column; gap: 8px; }
.workload li { display: grid; grid-template-columns: auto 72px 1fr auto; align-items: center; gap: 10px; }
.wl-name { font-size: 13px; font-weight: 500; }
.wl-bar { height: 8px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; }
.wl-bar i { display: flex; justify-content: flex-end; height: 100%; min-width: 0; border-radius: inherit; background: var(--c, var(--accent)); }
.wl-bar b { display: block; height: 100%; background: var(--danger); }
.wl-num { min-width: 70px; text-align: right; color: var(--text-2); }
.attention { display: flex; flex-direction: column; gap: 6px; }
.attention li {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--border); transition: border-color .15s, background .15s;
}
.attention li:hover { border-color: var(--border-strong); background: var(--surface-2); }
.attention .t { flex: 1; min-width: 0; font-weight: 500; font-size: 13px; }
@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 800px) {
  .report-cols { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- People ---------- */
.people { padding: 6px; }
.people-row {
  display: grid; grid-template-columns: minmax(0, 1.4fr) 130px minmax(0, 2fr) 68px;
  align-items: center; gap: 16px; padding: 12px; border-radius: 16px;
}
.people-row:not(.head):hover { background: var(--surface-2); }
.people-row.head { padding: 8px 12px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.pp-projects { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-actions { display: flex; justify-content: flex-end; gap: 2px; }
@media (max-width: 760px) {
  .people-row { grid-template-columns: minmax(0, 1fr) 110px; }
  .people-row.head, .pp-projects { display: none; }
  .pp-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- v1 additions ---------- */
button.link { padding: 0; }
.link.center { justify-content: center; width: 100%; }
fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset.plain:disabled .seg button, fieldset.plain:disabled .check { cursor: default; opacity: .75; }

/* Notifications */
.bell { position: relative; }
.bell .badge {
  position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 99px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg);
}
.notes-panel {
  position: fixed; z-index: 45; top: 64px; left: 16px; width: min(380px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 88px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg);
  animation: pop .18s cubic-bezier(.2, .8, .2, 1);
}
.notes-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 10px; }
.notes-list { overflow-y: auto; padding: 0 8px 8px; }
.notes-empty { padding: 8px 10px 14px; }
.note { position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 10px; border-radius: 14px; text-align: left; }
.note:hover { background: var(--surface-2); }
.note.unread { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.note.unread::after { content: ""; position: absolute; top: 16px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.note .av { box-shadow: none; }
.note-icon {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: color-mix(in srgb, var(--t, var(--muted)) 14%, transparent); color: var(--t, var(--muted));
}
.note-text { flex: 1; min-width: 0; padding-right: 14px; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.note-text b { color: var(--text); font-weight: 600; }
.mobile-bar .bell .badge { box-shadow: 0 0 0 2px var(--surface); }

/* Filters, banners, archived */
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .input { width: auto; min-width: 150px; }
.filter-label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 500; margin-right: 2px; }
.banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 18px; border-radius: 14px;
  background: color-mix(in srgb, var(--warn) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 25%, var(--border));
  color: var(--text-2); font-size: 13.5px;
}
.banner.sm { margin: 0 0 14px; padding: 8px 12px; font-size: 12.5px; }
.archived-row { display: flex; align-items: center; gap: 8px; padding-right: 8px; }
.archived-row .proj-row { flex: 1; min-width: 0; }
.col-body.ro:empty::after { content: "No tasks"; }

/* Attachments */
.attachments { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.attachments li { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; }
.att-thumb { width: 40px; height: 40px; flex: none; border-radius: 9px; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; font-weight: 500; }
.att-name:hover .ellipsis { text-decoration: underline; }
.add-file {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; border-radius: 12px;
  border: 1.5px dashed var(--border-strong); color: var(--text-2); font-size: 13px; font-weight: 500; text-align: left;
}
.add-file:hover { border-color: var(--accent); color: var(--text); }
.add-file .muted { font-weight: 400; }
.drawer.file-hover { box-shadow: var(--shadow-lg), inset 0 0 0 3px var(--accent); }

/* Comments */
.comments { display: flex; flex-direction: column; gap: 14px; }
.comment { display: flex; gap: 10px; }
.comment .av { box-shadow: none; }
.comment-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.comment-head time { display: inline; margin: 0; }
.comment-head .link { margin-left: auto; font-size: 12px; }
.comment-body { margin-top: 2px; font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.mention { color: var(--accent); font-weight: 600; }
.composer {
  position: relative; display: flex; align-items: flex-end; gap: 8px; padding: 12px 14px 14px;
  border-top: 1px solid var(--border); background: var(--surface);
}
.composer textarea { min-height: 42px; max-height: 160px; padding: 10px 12px; overflow-y: auto; }
.composer .send { width: 42px; height: 42px; border-radius: 12px; background: var(--accent); color: var(--on-accent); }
.composer .send:hover { background: var(--accent-hover); color: var(--on-accent); }
.mention-menu {
  position: absolute; left: 14px; bottom: calc(100% - 6px); width: min(280px, calc(100% - 28px)); padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
}
.mention-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border-radius: 10px; font-size: 13px; font-weight: 500; text-align: left; }
.mention-item .av { box-shadow: none; }
.mention-item.active, .mention-item:hover { background: var(--hover); }
.link-code { display: block; font-size: 12.5px; word-break: break-all; user-select: all; }

/* Touch dragging */
[data-drag] { -webkit-touch-callout: none; }
@media (pointer: coarse) { [data-drag] { user-select: none; -webkit-user-select: none; } }
.drag-ghost {
  position: fixed; z-index: 70; margin: 0; pointer-events: none; opacity: .95;
  transform: rotate(2deg) scale(1.03); box-shadow: var(--shadow-lg) !important;
}
body.touch-dragging { overflow: hidden; }

/* ---------- Phones ---------- */
@media (max-width: 700px) {
  h1 { font-size: 24px; }
  .page-head { margin-bottom: 18px; align-items: flex-start; }
  .head-actions { width: 100%; }
  .head-actions .btn.primary { margin-left: auto; }
  .ph-left { gap: 12px; }
  .proj-icon.xl { width: 44px; height: 44px; font-size: 18px; border-radius: 14px; }
  .ph-meta { flex-wrap: wrap; row-gap: 4px; }
  .ph-meta .sep { display: none; }
  .team-btn span { display: none; }
  .team-btn { padding: 0 6px; }
  .seg button { padding: 0 9px; }

  /* Board: one column at a time, swipe sideways between them. */
  .board {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 86%;
    scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px;
  }
  .col { scroll-snap-align: start; }

  .filters .input { min-width: 0; flex: 1; }
  .filter-label { display: none; }

  /* Drawer and dialogs take the whole screen. */
  .drawer { inset: 0; width: 100%; border-radius: 0; border: 0; }
  .drawer-body { padding: 4px 16px 20px; }
  .prop { grid-template-columns: 76px minmax(0, 1fr); }
  .prop .seg { overflow-x: auto; max-width: 100%; }
  .checklist li .icon-btn, .comment-head .link { opacity: 1; }
  #modal-root.open { padding: 8vh 12px 12px; }
  .modal-form { padding: 18px 16px 18px; }
  .notes-panel { top: 64px; left: 12px; right: 12px; width: auto; }

  .icon-btn.sm { width: 32px; height: 32px; }
  .home-side { grid-template-columns: minmax(0, 1fr); }
}

/* Clickable home counts and the task-list tabs */
a.stat { color: inherit; transition: box-shadow .18s, border-color .18s, transform .18s; }
a.stat:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-1px); }
.seg a {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border-radius: 9px; font-size: 12.5px; font-weight: 500; color: var(--text-2); white-space: nowrap;
}
.seg a:hover { color: var(--text); }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.seg.tabs { margin-bottom: 16px; max-width: 100%; overflow-x: auto; }
.seg.tabs .count-badge { height: 18px; min-width: 20px; font-size: 11px; }

/* ---------- Client dashboard: managing it inside the app ---------- */
.modal.xl { width: min(980px, 100%); }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.share-list { max-height: 240px; overflow-y: auto; padding: 4px; border: 1px solid var(--border); border-radius: 14px; }
.share-item {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 7px 8px; border-radius: 10px;
  font-weight: 400; color: var(--text); cursor: pointer;
}
.share-item:hover { background: var(--surface-2); }
.share-item input { width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.share-item > .muted { max-width: 40%; }
.pad-sm { padding: 8px; }
.switch-btn { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.switch-btn:hover { color: var(--text); }
.client-meta { color: var(--accent); }
.share-file { color: var(--muted); }
.share-file.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.preview-frame { max-height: 64vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 20px; background: var(--bg); }
.preview-frame .cv-wrap { padding: 24px 20px; }
@media (max-width: 700px) {
  .share-grid { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
}

/* ---------- Client dashboard: the page clients see ---------- */
.cv-wrap { max-width: 860px; margin: 0 auto; padding: 40px 20px 56px; }
.cv { display: flex; flex-direction: column; gap: 14px; }
.cv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.cv-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cv-ws { font-size: 13px; font-weight: 500; color: var(--muted); }
.cv-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cv-updated { margin: -4px 0 6px; }
.cv-section { padding: 20px 22px; }
.cv-section h2 { margin-bottom: 12px; }
.cv-note { border-left: 4px solid var(--c, var(--accent)); }
.cv-body { font-size: 15px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.cv-progress { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 28px; }
.cv-pct { font-size: 52px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.cv-pct span { font-size: 26px; color: var(--muted); margin-left: 2px; }
.cv-bar { height: 12px; border-radius: 99px; overflow: hidden; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.cv-bar i { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--accent)); }
.cv-counts { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 13.5px; color: var(--text-2); }
.cv-counts b { color: var(--text); font-size: 15px; }
.cv-group { margin: 16px 0 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cv-group:first-of-type { margin-top: 0; }
.cv-task { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--border); }
.cv-list .cv-task:first-child { border-top: 0; }
.cv-task .t { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.cv-task.done .t { color: var(--text-2); }
.cv-st { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--muted); background: var(--surface-2); }
.cv-task.doing .cv-st { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.cv-task.done .cv-st { color: #fff; background: var(--success); }
.cv-files { display: flex; flex-direction: column; gap: 8px; }
.cv-file { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 14px; color: var(--text-2); }
.cv-file:hover { border-color: var(--border-strong); background: var(--surface-2); }
.cv-file .t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }
.cv-file-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); flex: none; }
.cv-history li { padding: 12px 0; border-top: 1px solid var(--border); }
.cv-history li:first-child { border-top: 0; padding-top: 0; }
.cv-history time { margin: 0 0 4px; }
.cv-foot { margin-top: 8px; text-align: center; font-size: 12.5px; color: var(--muted); }
.cv-message { padding: 28px; text-align: center; }
.cv-message h1 { font-size: 22px; font-weight: 700; }
@media (max-width: 600px) {
  .cv-wrap { padding: 24px 16px 40px; }
  .cv-progress { grid-template-columns: 1fr; gap: 14px; }
  .cv-pct { font-size: 44px; }
}

/* ---------- Document previews ---------- */
.type-tile {
  display: grid; place-items: center; width: 100%; height: 100%;
  background: color-mix(in srgb, var(--t, var(--muted)) 12%, var(--surface)); color: var(--t, var(--muted));
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
}
.cv-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.cv-doc {
  display: flex; flex-direction: column; height: 100%; overflow: hidden;
  border: 1px solid var(--border); border-radius: 16px; background: var(--surface);
  transition: box-shadow .18s, border-color .18s, transform .18s;
}
.cv-doc:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-1px); }
.cv-thumb { display: block; height: 150px; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.cv-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.cv-thumb .type-tile { font-size: 22px; }
.cv-doc-info { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.cv-doc-info .t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.cv-dl { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--text-2); background: var(--surface-2); }
.cv-doc:hover .cv-dl { color: var(--on-accent); background: var(--c, var(--accent)); }
.att-thumb img { object-position: top center; }
.att-thumb .type-tile { font-size: 10px; }
.share-thumb { width: 30px; height: 30px; flex: none; border-radius: 7px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.share-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.share-thumb .type-tile { font-size: 8px; }
@media (max-width: 600px) { .cv-docs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cv-thumb { height: 120px; } }
.pdf-pending { display: block; width: 100%; height: 100%; }
.pdf-canvas { display: block; width: 100%; height: auto; }

/* ---------- Client page: two columns with links and meetings ---------- */
.cv-wrap { max-width: 1200px; container: cv / inline-size; }
.cv-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 860px; margin: 0 auto; }
.cv-layout.has-aside {
  max-width: none; grid-template-columns: minmax(0, 1fr) 320px; align-items: start;
  grid-template-areas: "head ." "main aside" "foot foot";
}
.cv-layout.has-aside > .cv-head { grid-area: head; }
.cv-layout.has-aside > .cv { grid-area: main; }
.cv-layout.has-aside > .cv-foot { grid-area: foot; }
.cv-aside { grid-area: aside; display: flex; flex-direction: column; gap: 14px; position: sticky; top: 20px; }
.cv-head { align-items: center; }
.cv-updated { margin: 4px 0 0; }
.cv-theme { width: 36px; height: 36px; }
.cv-side-title { display: flex; align-items: center; gap: 8px; }
.cv-side-title svg { color: var(--muted); }
.cv-links { display: flex; flex-direction: column; gap: 6px; }
.cv-link {
  display: flex; align-items: center; gap: 12px; padding: 8px 10px; margin: 0 -10px; border-radius: 12px; color: var(--muted);
  transition: background .15s;
}
.cv-link:hover { background: var(--surface-2); color: var(--text); }
.cv-link .t { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.link-tile {
  width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--t, var(--muted)) 14%, var(--surface)); color: var(--t, var(--text-2));
  font-weight: 700; font-size: 15px;
}
.cv-meeting { padding: 12px 0; border-top: 1px solid var(--border); }
.cv-meeting:first-of-type { border-top: 0; padding-top: 0; }
.cv-meeting-label { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.cv-meeting-date { margin-top: 4px; font-weight: 600; font-size: 15px; }
.cv-meeting.next .cv-meeting-date { font-size: 18px; letter-spacing: -.01em; color: var(--c, var(--accent)); }
@container cv (max-width: 860px) {
  .cv-layout.has-aside { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "aside" "main" "foot"; }
  .cv-aside { position: static; }
}

/* ---------- Client view panel: links and meetings editor ---------- */
.link-list { display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 1px solid var(--border); border-radius: 14px; }
.link-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; font-weight: 400; color: var(--text); }
.link-row:hover { background: var(--surface-2); }
.link-row .link-tile { width: 30px; height: 30px; font-size: 13px; border-radius: 8px; }
.link-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) auto; gap: 8px; }
.meet-grid { display: flex; flex-direction: column; gap: 10px; }
.meet-grid .field { font-weight: 400; }
@media (max-width: 600px) { .link-add { grid-template-columns: 1fr; } }

/* ---------- Meetings from Google Calendar ---------- */
.meet-card { cursor: pointer; border-left: 3px solid var(--info); }
.meet-card .join { height: 32px; }
.mini-item.meet { cursor: pointer; border-left: 3px solid var(--info); }
.mini-item.meet .icon-btn { color: var(--info); }
.mini-time { flex: none; min-width: 52px; font-size: 12.5px; font-weight: 600; color: var(--info); }
.chip.meet { --c: var(--info); background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 35%, transparent); }
.chip.meet:hover { background: color-mix(in srgb, var(--info) 10%, transparent); }
.chip.meet b { font-weight: 700; color: var(--info); }
.connect-google {
  display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 12px; padding: 10px 12px; border-radius: 14px; text-align: left;
  border: 1.5px dashed color-mix(in srgb, var(--info) 45%, var(--border)); color: var(--info); font-size: 13px; font-weight: 600;
}
.connect-google:hover { background: color-mix(in srgb, var(--info) 7%, transparent); }
.connect-google .muted { font-weight: 400; }
.connect-google.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }

/* ---------- New task popup ---------- */
.modal.task-modal { width: min(640px, 100%); max-height: 86vh; }
#modal-root.open:has(.task-modal) { padding-top: 7vh; }
.task-modal.file-hover { box-shadow: var(--shadow-lg), inset 0 0 0 3px var(--accent); }
.nt-props { margin: 0; }
.nt-props .prop .input { max-width: 260px; }
.task-modal textarea.input { min-height: 76px; }
.task-modal .checklist { margin-bottom: 2px; }
.task-modal .checklist li { font-weight: 400; color: var(--text); }
.task-modal .checklist .check { cursor: default; }
.task-modal .checklist .cl-text { display: flex; align-items: center; }
.nt-files { display: flex; flex-direction: column; gap: 6px; }
.nt-files li { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--border); border-radius: 12px; font-weight: 400; color: var(--text); }
.nt-files .type-tile { width: 34px; height: 34px; flex: none; border-radius: 8px; font-size: 9px; }
.nt-files .min0 { display: flex; flex-direction: column; font-size: 13px; }
@media (max-width: 700px) {
  .modal.task-modal { max-height: none; }
  .nt-props .prop .input { max-width: none; }
}
