/* Atlas — calm daylight design system. Mars & Co ground #f8fbf6, ink #110e0d, accent #ca3832. */
:root {
  --ground: #f8fbf6;
  --ink: #16130f;
  --ink-soft: #4c463f;
  --muted: #8a8378;
  --card: #ffffff;
  --line: #e7e3da;
  --accent: #ca3832;
  --red: #e5484d; --red-bg: #fdecec;
  --amber: #f59e0b; --amber-bg: #fdf1de;
  --green: #16a34a; --green-bg: #e7f6ed;
  --blue: #4361ee; --blue-bg: #e8ecfe;
  --violet: #7c3aed; --violet-bg: #f0e9fe;
  --orange: #ea6a17; --orange-bg: #fdeede;
  --pink: #db2777; --pink-bg: #fce8f1;
  --yellow: #eab308; --yellow-bg: #fbf3d3;
  --slate: #64748b; --slate-bg: #eef1f5;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(22, 19, 15, .05), 0 4px 14px rgba(22, 19, 15, .04);
  /* neutral sub-tokens (themeable) */
  --card-soft: #fdfdfb;
  --row-hover: #fcfbf7;
  --line-soft: #f1eee6;
  --nav-active: #f3ece9;
  --unread-bg: #fdf7ef;
  --quote-bg: #f6f3ec;
  --quote-bg-hover: #f1ede3;
  --accent-soft: #fdf5f4;
  --well: #f3f1ea;
  --well-hover: #efece2;
  /* liquid glass (Orbit recipe) */
  --glass-bg: rgba(255, 255, 255, .55);
  --glass-bd: rgba(255, 255, 255, .7);
  --glass-hl: rgba(255, 255, 255, .85);
  --glass-sheen: rgba(255, 255, 255, .5);
  --glass-shadow: 0 10px 34px rgba(31, 38, 55, .16);
}

/* ---- Dark theme ---- */
html[data-theme="dark"] {
  --ground: #0f1218;
  --ink: #e7e9ee;
  --ink-soft: #b6bcc6;
  --muted: #7c8390;
  --card: #191d26;
  --line: #2a2f3a;
  --card-soft: #1e222c;
  --row-hover: #20252f;
  --line-soft: #242833;
  --nav-active: #33232a;
  --unread-bg: #1e2233;
  --quote-bg: #1e222c;
  --quote-bg-hover: #232833;
  --accent-soft: #2a1f22;
  --well: #14171e;
  --well-hover: #191d25;
  --red: #f0616a; --red-bg: rgba(229, 72, 77, .18);
  --amber: #eab758; --amber-bg: rgba(245, 158, 11, .18);
  --green: #33c07e; --green-bg: rgba(22, 163, 74, .2);
  --blue: #6d86ff; --blue-bg: rgba(67, 97, 238, .22);
  --violet: #a887f7; --violet-bg: rgba(124, 58, 237, .24);
  --orange: #f2953f; --orange-bg: rgba(234, 106, 23, .2);
  --pink: #ee6faa; --pink-bg: rgba(219, 39, 119, .2);
  --yellow: #e8c34a; --yellow-bg: rgba(234, 179, 8, .2);
  --slate: #8b93a1; --slate-bg: rgba(100, 116, 139, .26);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 14px rgba(0, 0, 0, .28);
  --glass-bg: rgba(40, 38, 34, .45);
  --glass-bd: rgba(255, 255, 255, .14);
  --glass-hl: rgba(255, 255, 255, .16);
  --glass-sheen: rgba(255, 255, 255, .2);
  --glass-shadow: 0 12px 38px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
html[data-theme="dark"] .flash { background: var(--green-bg); border-color: #2c5540; color: #9fd4b4; }
html[data-theme="dark"] .g2-today-line { opacity: .8; }
* { box-sizing: border-box; margin: 0; }
[x-cloak] { display: none !important; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--ground); color: var(--ink);
  font-size: 14px; line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

/* ---- Shell ---- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex-shrink: 0; background: var(--card);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; padding: 18px 16px 14px; letter-spacing: .2px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800;
}
.brand-logo { display: inline-block; flex-shrink: 0; vertical-align: middle; }
.login-brand .brand-logo { margin-right: 2px; }
.sidebar nav { display: flex; flex-direction: column; padding: 6px 8px; gap: 2px; flex: 1; }
.sidebar nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border-radius: 8px; color: var(--ink-soft); font-weight: 500;
}
.sidebar nav a:hover { background: var(--ground); color: var(--ink); }
.sidebar nav a.active { background: var(--nav-active); color: var(--accent); font-weight: 600; }
.sidebar nav a.soon { color: var(--muted); cursor: default; }
.sidebar nav a.soon:hover { background: none; }
.sidebar nav a em { font-style: normal; font-size: 10px; margin-left: auto; background: var(--slate-bg); color: var(--muted); border-radius: 99px; padding: 1px 7px; }
.nav-ico { width: 18px; text-align: center; opacity: .75; }
.sidebar-foot { display: flex; align-items: center; gap: 9px; padding: 12px 14px; border-top: 1px solid var(--line); }
.foot-meta { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.foot-meta strong { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foot-meta span { font-size: 11px; color: var(--muted); }
.linkish { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; }
.linkish:hover { color: var(--accent); }
.foot-user { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; border-radius: 8px; padding: 3px 4px; margin: -3px -4px; }
.foot-user:hover { background: var(--slate-bg); }

/* Profile photo avatars */
.avatar-photo { object-fit: cover; background: var(--card); }
.profile-photo-row { display: flex; align-items: center; gap: 18px; }
.profile-photo-preview .avatar { box-shadow: 0 0 0 3px var(--card), 0 0 0 4px var(--line); }
.profile-photo-controls { flex: 1; min-width: 0; }
.profile-sep { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.hue-swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.hue-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.hue-swatch:hover { transform: scale(1.1); }
.hue-swatch-active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--card), 0 0 0 3px var(--ink); }

/* People / user management */
.people-add .pa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.people-add label { display: block; margin-bottom: 3px; }
.people-add input, .people-add select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 13.5px; }
.invite-link-panel { border-color: var(--green); }
.invite-copy { display: flex; gap: 8px; }
.invite-copy input { flex: 1; min-width: 0; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); color: var(--ink-soft); font-size: 12.5px; font-family: ui-monospace, monospace; }
.people-table { width: 100%; border-collapse: collapse; }
.people-table td { padding: 11px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.people-table tr:first-child td { border-top: none; }
.pt-user { display: flex; align-items: center; gap: 11px; }
.pt-meta { display: flex; flex-direction: column; line-height: 1.35; }
.pt-meta strong { font-size: 13.5px; }
.pt-role select { padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--card); color: var(--ink); font-size: 12.5px; }
.pt-actions { text-align: right; white-space: nowrap; }
.pt-actions form { display: inline; margin-left: 6px; }
.prow-off { opacity: 0.55; }
@media (max-width: 640px) { .people-add .pa-grid { grid-template-columns: 1fr; } .pt-user { max-width: 150px; } }

/* Audit log */
.aud-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.aud-filters .search-input { flex: 1; min-width: 180px; }
.aud-filters select, .aud-filters input[type=date] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 12.5px; }
.aud-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.aud-tbl th { text-align: left; padding: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); }
.aud-tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.aud-when { white-space: nowrap; line-height: 1.3; }
.aud-sum { color: var(--ink-soft); word-break: break-word; }
.aud-ip { font-family: ui-monospace, monospace; font-size: 12px; color: var(--muted); }
.aud-act { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.aud-neutral { background: var(--slate-bg); color: var(--ink-soft); }
.aud-ok { background: var(--green-bg); color: var(--green); }
.aud-danger { background: var(--red-bg); color: var(--red); }
.aud-pager { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 16px; }
.is-disabled { opacity: .4; pointer-events: none; }

/* KB slash-menu blocks (view mode) */
.kb-body ul.kb-check { list-style: none; padding-left: 4px; }
.kb-body ul.kb-check li { position: relative; padding-left: 28px; margin: 5px 0; cursor: pointer; }
.kb-body ul.kb-check li::before { content: ""; position: absolute; left: 0; top: 2px; width: 17px; height: 17px; border: 2px solid var(--line); border-radius: 5px; background: var(--card); }
.kb-body ul.kb-check li.done::before { background: var(--green); border-color: var(--green); }
.kb-body ul.kb-check li.done::after { content: "✓"; position: absolute; left: 3px; top: 1px; color: #fff; font-size: 12px; font-weight: 700; }
.kb-body ul.kb-check li.done { color: var(--muted); text-decoration: line-through; }
.kb-body details.kb-toggle { border-left: 3px solid var(--line); padding: 2px 0 2px 12px; margin: 8px 0; }
.kb-body details.kb-toggle summary { cursor: pointer; font-weight: 600; }
.kb-body a.kb-btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; padding: 8px 18px; border-radius: 8px; }
.kb-body a.kb-btn:hover { filter: brightness(1.05); }

/* KB slash-menu: link-to-project/task picker overlay */
.kb-ref-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: flex-start; justify-content: center; z-index: 9000; padding-top: 12vh; }
.kb-ref-box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; width: 460px; max-width: 92vw; box-shadow: 0 18px 50px rgba(0,0,0,.3); overflow: hidden; }
.kb-ref-box input { width: 100%; border: none; border-bottom: 1px solid var(--line); padding: 14px 16px; font-size: 14px; background: var(--card); color: var(--ink); outline: none; }
.kb-ref-results { max-height: 320px; overflow-y: auto; }
.kb-ref-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: none; padding: 10px 16px; font-size: 13.5px; color: var(--ink); cursor: pointer; }
.kb-ref-item:hover { background: var(--slate-bg); }
.kb-ref-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--slate); border-radius: 99px; padding: 2px 8px; flex-shrink: 0; }
.kb-ref-empty { padding: 14px 16px; }
.kb-ref-hint { padding: 8px 16px; border-top: 1px solid var(--line); }

.main { flex: 1; min-width: 0; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 26px 0;
}
.topbar h1 { font-size: 21px; font-weight: 700; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.back-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink-soft); font-size: 18px; line-height: 1; text-decoration: none; cursor: pointer; transition: background .14s, border-color .14s, color .14s; }
.back-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.content { padding: 16px 26px 40px; display: flex; flex-direction: column; gap: 16px; }

/* ---- Panels & stats ---- */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.panel-flush { padding: 6px 0 10px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.panel-flush .panel-head { padding: 10px 18px 0; }
.panel-head h2 { font-size: 14.5px; font-weight: 700; }
.panel-link { font-size: 12.5px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.col-stack { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } .sidebar { display: none; } }

.stat-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 900px) { .stat-row { grid-template-columns: repeat(3, 1fr); } }

/* LIQUID GLASS stat tiles (Orbit recipe: frosted card + sheen + colour glow behind). */
.stat-row { position: relative; z-index: 0; }
.stat-row::before {
  content: ''; position: absolute; inset: -30px -10px; z-index: -1; pointer-events: none; filter: blur(14px);
  background:
    radial-gradient(30% 75% at 7% 50%, rgba(107, 114, 128, .18), transparent 70%),
    radial-gradient(30% 75% at 25% 50%, rgba(214, 69, 69, .17), transparent 70%),
    radial-gradient(30% 75% at 42% 50%, rgba(217, 154, 38, .17), transparent 70%),
    radial-gradient(30% 75% at 59% 50%, rgba(63, 157, 99, .17), transparent 70%),
    radial-gradient(30% 75% at 76% 50%, rgba(202, 56, 50, .15), transparent 70%),
    radial-gradient(30% 75% at 93% 50%, rgba(59, 116, 196, .17), transparent 70%);
}
.stat {
  position: relative; overflow: hidden;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid var(--glass-bd);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hl), inset 0 0 18px rgba(255, 255, 255, .03);
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background:
    radial-gradient(120% 80% at 0% 0%, var(--glass-sheen), rgba(255, 255, 255, 0) 45%),
    linear-gradient(160deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 60%);
}
.stat > * { position: relative; z-index: 1; }
.stat:hover { transform: translateY(-2px); }
.stat-num { font-size: 24px; font-weight: 750; display: block; letter-spacing: -.5px; }
.stat-label { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.stat-red .stat-num { color: var(--red); }
.stat-amber .stat-num { color: var(--amber); }
.stat-green .stat-num { color: var(--green); }

/* ---- Insights charts ---- */
.charts-row { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .charts-row { grid-template-columns: 1fr; } }
.chart-box { position: relative; }

/* ---- Health strip ---- */
.health-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; }
.health-card {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px;
  display: flex; flex-direction: column; gap: 7px; background: var(--card);
  transition: transform .08s ease, box-shadow .08s ease;
}
.health-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); color: inherit; }
.hc-red { border-left: 3px solid var(--red); }
.hc-amber { border-left: 3px solid var(--amber); }
.hc-green { border-left: 3px solid var(--green); }
.hc-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.hc-name { font-weight: 650; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hc-meta { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.hc-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-soft); }
.hc-reason { font-size: 10.5px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 6px; }

/* ---- Dots, pills, chips, avatars ---- */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-red { background: var(--red); box-shadow: 0 0 0 3px var(--red-bg); }
.dot-amber { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg); }
.dot-green { background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); }
.pill { font-size: 10.5px; font-weight: 600; border-radius: 99px; padding: 2px 9px; white-space: nowrap; }
/* Solid, vibrant status/stage pills (ClickUp-style pop). Yellow keeps dark text for contrast. */
.pill-slate { background: var(--slate); color: #fff; }
.pill-violet { background: var(--violet); color: #fff; }
.pill-blue { background: var(--blue); color: #fff; }
.pill-orange { background: var(--orange); color: #fff; }
.pill-pink { background: var(--pink); color: #fff; }
.pill-yellow { background: var(--yellow); color: #3d3100; }
.pill-green { background: var(--green); color: #fff; }
.pill-red { background: var(--red); color: #fff; }
.avatar {
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; flex-shrink: 0;
  background: hsl(var(--hue, 210), 42%, 47%);
}
.avatar-empty { background: var(--slate-bg); color: var(--muted); }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 5px 14px; font-size: 12.5px; font-weight: 550; color: var(--ink-soft); }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip-active { background: var(--ink); border-color: var(--ink); color: var(--ground); }
.chip-active:hover { color: var(--ground); }
.chip-sm { font-size: 10.5px; font-weight: 600; border-radius: 99px; padding: 2px 8px; }
.chip-retainer { background: var(--violet-bg); color: var(--violet); }
.chip-one_time { background: var(--blue-bg); color: var(--blue); }
.chip-recurring { background: var(--green-bg); color: var(--green); }
.count-badge { font-size: 10px; font-weight: 700; background: var(--slate-bg); color: var(--ink-soft); border-radius: 99px; padding: 1px 7px; margin-left: 6px; }
.ref { font-size: 10.5px; color: var(--muted); font-weight: 650; letter-spacing: .3px; white-space: nowrap; }
.muted { color: var(--muted); }
.muted-sm { color: var(--muted); font-size: 11.5px; }
.overdue-text { color: var(--red); font-weight: 650; font-size: 12px; }
.empty { color: var(--muted); padding: 14px 4px; font-size: 13px; }
.panel-flush .empty { padding: 14px 18px; }

/* ---- Progress ---- */
.progress { height: 5px; border-radius: 99px; background: var(--slate-bg); overflow: hidden; min-width: 60px; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--green); }
.progress-cell { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-soft); }

/* ---- Projects toolbar (Notion-style) ---- */
.ptoolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; flex-wrap: wrap; }
.ptoolbar .view-tabs { border-bottom: none; margin-bottom: 0; }
.ptoolbar-sub { display: flex; align-items: center; margin-bottom: 12px; }
.tbar { display: flex; align-items: center; gap: 4px; padding-bottom: 4px; }
.tbar-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 7px 13px; font-size: 12px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.tbar-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tbar-on { color: var(--accent); }
.tico { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.tbar-new { display: inline-flex; align-items: center; background: var(--accent); color: #fff; border-radius: 8px; padding: 7px 13px; font-size: 12.5px; font-weight: 650; margin-left: 4px; }
.tbar-new:hover { background: #b32e29; color: #fff; }
.tbar-pop { position: relative; }
.pop { position: absolute; top: 100%; right: 0; margin-top: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 24px rgba(22,19,15,.12); min-width: 200px; padding: 6px; z-index: 30; }
.pop-head { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; padding: 5px 8px 6px; }
.pop-item { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px; border-radius: 7px; font-size: 12.5px; color: var(--ink-soft); }
.pop-item:hover { background: var(--ground); color: var(--ink); }
.pop-active { background: var(--nav-active); color: var(--accent); font-weight: 600; }
.pop-dir { color: var(--accent); font-weight: 700; }

/* ---- Value chips (dimension values, scrollable) ---- */
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; }
.chips-scroll .chip { flex-shrink: 0; }
.chip-n { font-size: 10px; opacity: .65; margin-left: 3px; }

/* ---- View-mode switcher (Table | List | Board) ---- */
.vswitch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-right: 4px; }
.vsw { display: inline-flex; align-items: center; padding: 6px 9px; color: var(--muted); }
.vsw:hover { background: var(--ground); color: var(--ink); }
.vsw-active { background: var(--ink); color: #fff; }
.vsw-active:hover { background: var(--ink); color: #fff; }

/* ---- Project board ---- */
.pboard { align-items: flex-start; }
.pcol-wrap { min-width: 250px; width: 250px; }
.pcard-name { font-weight: 650; font-size: 13px; display: block; line-height: 1.3; }
.pcard-name:hover { color: var(--accent); }
.pcard .pclient { margin: 2px 0 6px; }
.pcard-prog { margin-bottom: 7px; }
.pcard-side { display: inline-flex; align-items: center; gap: 6px; }
.hp-red { background: var(--red-bg); color: var(--red); }
.hp-amber { background: var(--amber-bg); color: var(--amber); }
.hp-green { background: var(--green-bg); color: var(--green); }
.pcol-new { display: block; text-align: center; border: 1px dashed var(--line); border-radius: 8px; padding: 7px; font-size: 12px; color: var(--muted); }
.pcol-new:hover { color: var(--accent); border-color: var(--accent); }
.sl-chooser { position: absolute; left: 8px; top: 8px; z-index: 50; }
.pcard { position: relative; }

/* ---- List view (tasks under project headers) ---- */
.lv-proj { padding: 6px 0 10px; border-bottom: 1px solid var(--line); }
.lv-proj:last-child { border-bottom: none; }
.lv-head { display: flex; align-items: center; gap: 9px; padding: 10px 18px 6px; }
.lv-name { font-weight: 700; font-size: 13.5px; }
.lv-newtask { display: inline-block; font-size: 12px; color: var(--muted); padding: 6px 18px 0; background: none; border: none; cursor: pointer; font-family: inherit; text-align: left; }
.lv-newtask:hover { color: var(--accent); }

/* ---- Modal + tab customization ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(22,19,15,.34); display: flex; align-items: flex-start; justify-content: center; padding-top: 8vh; z-index: 100; }
.modal { background: var(--card); border-radius: 14px; box-shadow: 0 12px 48px rgba(22,19,15,.22); width: 560px; max-width: 92vw; padding: 22px 24px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { font-size: 16px; font-weight: 700; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); justify-content: flex-end; }
.tabcfg-list { margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.tabcfg-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--card-soft); }
.tabcfg-drag { cursor: grab; color: var(--muted); font-size: 14px; }
.tabcfg-vis { display: flex; }
.tabcfg-label { border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; font-size: 13px; font-weight: 600; width: 190px; }
.tabcfg-desc { flex: 1; }

/* ---- Stage manager ---- */
.st-list { max-height: 54vh; overflow-y: auto; padding-right: 2px; }
.stage-row { gap: 8px; padding: 5px 8px; }
.stage-row:hover { border-color: #ddd6c8; }
.st-ghost { opacity: .45; }
.st-name { flex: 1; min-width: 0; border: 1px solid transparent; border-radius: 7px; padding: 6px 9px; font-size: 13px; font-weight: 600; background: none; font-family: inherit; color: var(--ink); }
.stage-row:hover .st-name, .st-name:focus { border-color: var(--line); background: var(--card); outline: none; }
.st-dots { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.st-dotpick { width: 15px; height: 15px; border-radius: 50%; border: none; padding: 0; cursor: pointer; opacity: .4; flex-shrink: 0; transition: transform .1s, opacity .1s; }
.st-dotpick:hover { opacity: .85; transform: scale(1.15); }
.st-dotpick.sel { opacity: 1; box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px currentColor; }
.st-end { width: 64px; display: flex; justify-content: flex-end; flex-shrink: 0; }
.st-lock { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; background: var(--slate-bg); color: var(--muted); border-radius: 99px; padding: 3px 8px; }
.st-del { width: 26px; height: 26px; border: none; background: none; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 13px; }
.st-del:hover { background: var(--red-bg); color: var(--red); }
.st-add { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 10px; padding: 9px; border: 1.5px dashed var(--line); border-radius: 9px; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.st-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---- Chat ---- */
.chat-wrap { display: flex; gap: 0; height: calc(100vh - 118px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-side { width: 230px; flex-shrink: 0; border-right: 1px solid var(--line); overflow-y: auto; padding: 10px 8px; background: var(--row-hover); }
.chat-side-head { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; padding: 10px 10px 4px; }
.chat-chan { display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 8px; font-size: 12.5px; color: var(--ink-soft); }
.chat-chan:hover { background: var(--ground); color: var(--ink); }
.chat-chan-active { background: var(--red-bg); color: var(--accent); font-weight: 650; }
.chan-hash { color: var(--muted); font-weight: 700; }
.chan-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-unread { font-style: normal; font-size: 10px; font-weight: 750; background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 7px; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.chat-title { font-size: 14px; }
.chat-hint { margin-left: auto; }
.chat-thread { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { display: flex; gap: 10px; }
.chat-msg-main { min-width: 0; flex: 1; }
.chat-msg-head { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.chat-acts { display: none; gap: 6px; margin-left: auto; }
.chat-msg:hover .chat-acts { display: inline-flex; }
.chat-act { border: 1px solid var(--line); background: var(--card); border-radius: 7px; padding: 2px 8px; font-size: 11px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.chat-act:hover { border-color: var(--green); color: var(--green); }
.chat-act-del:hover { border-color: var(--red); color: var(--red); }
.chat-msg-body { font-size: 13px; line-height: 1.5; color: var(--ink); word-wrap: break-word; }
.chat-msg-body a { color: var(--blue); text-decoration: underline; }
.chat-mention { background: var(--yellow-bg); color: var(--yellow); border-radius: 4px; padding: 0 3px; font-weight: 650; }
.chat-task-chip { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; font-size: 11px; font-weight: 700; background: var(--green-bg); color: var(--green); border-radius: 99px; padding: 2px 9px; }
.chat-compose { display: flex; gap: 8px; align-items: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); }
.chat-compose textarea { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-family: inherit; font-size: 13px; resize: none; min-height: 40px; }
.chat-compose textarea:focus { outline: none; border-color: var(--muted); }
.em-unread { background: var(--accent) !important; color: #fff !important; }
.chat-attach-btn { border: 1px solid var(--line); background: var(--card); border-radius: 10px; width: 40px; height: 40px; font-size: 16px; cursor: pointer; flex-shrink: 0; }
.chat-attach-btn:hover { border-color: var(--muted); }
.chat-quote { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; border: none; border-left: 3px solid var(--accent); background: var(--quote-bg); border-radius: 6px; padding: 5px 10px; margin: 3px 0 4px; font-size: 11.5px; cursor: pointer; text-align: left; max-width: 480px; font-family: inherit; }
.chat-quote:hover { background: var(--quote-bg-hover); }
.chat-quote strong { color: var(--accent); font-size: 11px; }
.chat-quote span { color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 440px; }
.chat-img { display: block; max-width: 320px; max-height: 260px; border-radius: 10px; border: 1px solid var(--line); margin: 4px 0; cursor: zoom-in; }
.chat-file { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--card-soft); border-radius: 10px; padding: 7px 12px; margin: 4px 0; font-size: 12.5px; max-width: 380px; }
.chat-file:hover { border-color: var(--muted); }
.chat-file-ico { font-size: 16px; }
.chat-file-name { font-weight: 650; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chat-pending { padding: 8px 16px 0; }
.chat-strip { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-left: 3px solid var(--accent); background: var(--row-hover); border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.chat-strip-ico { font-size: 14px; }
.chat-strip-img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.chat-strip-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); }
.chat-hl { background: var(--yellow-bg); border-radius: 10px; transition: background 1s; }

/* ---- Files ---- */
.file-up { display: flex; gap: 8px; align-items: center; }
.file-input { font-size: 12px; color: var(--ink-soft); max-width: 260px; }
.file-input-sm { max-width: 220px; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 14px; }
.file-card { border: 1px solid var(--line); border-radius: 10px; background: var(--card-soft); overflow: hidden; display: flex; flex-direction: column; }
.file-thumb { display: block; width: 100%; height: 120px; border: none; padding: 0; background: var(--slate-bg); cursor: zoom-in; }
.file-thumb img { width: 100%; height: 120px; object-fit: cover; display: block; }
.file-thumb-icon { display: flex; align-items: center; justify-content: center; font-size: 38px; cursor: pointer; text-align: center; line-height: 120px; }
.file-meta { padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.file-name { font-size: 12px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-acts { display: flex; gap: 4px; justify-content: flex-end; padding: 2px 8px 8px; }
.file-acts a, .file-acts button { border: none; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.file-acts a:hover { color: var(--ink); background: var(--slate-bg); }
.file-acts button:hover { color: var(--red); background: var(--red-bg); }
.lightbox { position: fixed; inset: 0; background: rgba(17,14,13,.82); z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: zoom-out; padding: 4vh 4vw; }
.lightbox img { max-width: 100%; max-height: 88vh; border-radius: 8px; box-shadow: 0 18px 60px rgba(0,0,0,.4); }
.lightbox-title { color: #f8fbf6; font-size: 12.5px; }

/* task panel attachments */
.task-files { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; }
.tf-head { font-weight: 700; text-transform: uppercase; letter-spacing: .4px; font-size: 10px !important; margin-bottom: 6px; }
.tf-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12.5px; }
.tf-thumb { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.tf-ico { width: 34px; text-align: center; font-size: 18px; }
.tf-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 550; }
.tf-name:hover { color: var(--accent); }
.tf-dl { color: var(--muted); }
.tf-dl:hover { color: var(--ink); }
.tf-up { display: flex; gap: 8px; align-items: center; margin-top: 6px; }

/* ---- Docs ---- */
.doc-list { display: flex; flex-direction: column; margin-top: 6px; }
.doc-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--line-soft); border-radius: 8px; }
.doc-row:last-child { border-bottom: none; }
.doc-row:hover { background: var(--ground); }
.doc-title { font-size: 13px; font-weight: 650; color: var(--ink); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.doc-head-side { display: flex; gap: 8px; }
.doc-title-input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 16px; font-weight: 700; font-family: inherit; margin-bottom: 10px; }
.doc-title-input:focus { outline: none; border-color: var(--muted); }
.doc-view-title { font-size: 19px; font-weight: 750; margin-bottom: 4px; }

/* ---- Settings hub ---- */
.set-section { margin-bottom: 8px; }
.set-section-head { font-size: 10.5px; letter-spacing: .8px; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 7px; margin-bottom: 16px; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.set-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 18px 12px 14px; border-radius: 14px; border: 1px solid transparent; }
.set-card:hover { background: var(--card); border-color: var(--line); box-shadow: var(--shadow); color: inherit; }
.set-ico { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; font-size: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 4px; }
.set-label { font-size: 12.5px; font-weight: 650; }
.set-desc { font-size: 11px; color: var(--muted); line-height: 1.35; }
.set-card-soon { opacity: .55; cursor: default; }
.set-card-soon:hover { background: none; border-color: transparent; box-shadow: none; }
.set-soon { font-style: normal; font-size: 9px; font-weight: 700; text-transform: uppercase; background: var(--slate-bg); color: var(--muted); border-radius: 99px; padding: 1px 6px; vertical-align: 2px; }

/* theme picker */
.theme-pick { display: flex; gap: 14px; }
.theme-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 18px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 650; color: var(--ink); }
.theme-card:hover { border-color: var(--muted); }
.theme-card-active { border-color: var(--accent); }
.theme-preview { width: 120px; height: 70px; border-radius: 9px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 5px; padding: 8px; }
.theme-preview-light { background: #f8fbf6; }
.theme-preview-light span { display: block; height: 10px; border-radius: 4px; background: #fff; border: 1px solid #e7e3da; }
.theme-preview-dark { background: #131210; }
.theme-preview-dark span { display: block; height: 10px; border-radius: 4px; background: #1d1b18; border: 1px solid #33302a; }

/* members & access */
.mem-list { display: flex; flex-direction: column; gap: 8px; }
.mem-row { border: 1px solid var(--line); border-radius: 12px; background: var(--card-soft); padding: 10px 14px; }
.mem-main { display: flex; align-items: center; gap: 11px; }
.mem-meta { display: flex; flex-direction: column; line-height: 1.3; flex: 1; min-width: 0; }
.mem-scope { flex-shrink: 0; }
.mem-config { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 10px; }
.mem-scope-pick { display: flex; gap: 18px; margin-bottom: 10px; }
.mem-radio { display: flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; }
.mem-projects { border: 1px solid var(--line); border-radius: 10px; max-height: 46vh; overflow-y: auto; }
.mem-proj-head, .mem-proj-row { display: grid; grid-template-columns: 1fr 70px 70px; align-items: center; gap: 8px; padding: 6px 12px; }
.mem-proj-head { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); }
.mem-proj-row { border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.mem-proj-row:last-child { border-bottom: none; }
.mem-proj-row:hover { background: var(--row-hover); }
.mem-proj-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* service catalog */
.cat-block { margin-bottom: 14px; }
.cat-pillar { font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.cat-services { display: flex; flex-wrap: wrap; gap: 6px; }

/* chat channel management + storage */
.chat-side-head-btn { display: flex; align-items: center; justify-content: space-between; }
.chan-add { border: 1px solid var(--line); background: var(--card); border-radius: 6px; width: 20px; height: 20px; font-size: 12px; line-height: 1; cursor: pointer; color: var(--muted); }
.chan-add:hover { color: var(--accent); border-color: var(--accent); }
.chat-usage { flex-shrink: 0; }
.ch-members { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; max-height: 38vh; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; margin-top: 4px; }
.stor-list { display: flex; flex-direction: column; gap: 12px; }
.stor-meta { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.stor-name { font-size: 13px; font-weight: 650; }
.stor-bar { height: 8px; border-radius: 99px; background: var(--slate-bg); overflow: hidden; }
.stor-fill { height: 100%; border-radius: 99px; background: var(--blue); }

/* whiteboard island */
.wb-page { display: flex; flex-direction: column; gap: 10px; }
.wb-mount { height: calc(100vh - 150px); min-height: 480px; }
.wb-mount > div { height: 100%; }
/* The board is always a light canvas (cream cards), so its text/controls must stay dark
   and native widgets light — regardless of the app's dark theme (else note/checklist text
   inherits the page's light ink and vanishes on the light cards). */
#atlasBoard {
  color-scheme: light;
  /* Tailwind preflight is off for the island, so seed the ring base vars the ring-* utilities
     read (they inherit to every card); without these, ALL ring outlines render nothing —
     card borders, the selection ring, pin/avatar rings. Utility classes still override per-element. */
  --tw-ring-inset: ;
  --tw-ring-offset-width: 0px;
  --tw-ring-offset-color: #f7f5ed;
  --tw-ring-color: rgb(202 56 50 / .5);
}
#atlasBoard textarea, #atlasBoard input { color: #110e0d; }
#atlasBoard textarea::placeholder, #atlasBoard input::placeholder { color: #989ea3; }
.wb-toolbar::-webkit-scrollbar { width: 6px; }
.wb-toolbar::-webkit-scrollbar-thumb { background: #cfc9bd; border-radius: 99px; }
.wb-toolbar { scrollbar-width: thin; }

/* ---- Bell dropdown ---- */
.bell-wrap { position: relative; }
.bell { border: none; background: none; cursor: pointer; font-size: 15px; position: relative; padding: 4px 6px; }
.bell-panel { position: absolute; right: 0; top: 34px; width: 360px; max-width: 86vw; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 44px rgba(22,19,15,.18); z-index: 120; overflow: hidden; }
.bell-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.bell-feed { max-height: 420px; overflow-y: auto; }
.bell-feed .notif-row { padding: 9px 14px; }
.notif-unread { background: var(--unread-bg); }

/* ---- View tabs (Notion-style grouping tabs) ---- */
.view-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.vtab { padding: 8px 15px; font-size: 13px; font-weight: 550; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; border-radius: 7px 7px 0 0; }
.vtab:hover { background: var(--ground); color: var(--ink); }
.vtab-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.vtab-active:hover { background: none; color: var(--accent); }
.ctl-collapse { font-size: 11.5px; color: var(--muted); }
.ctl-collapse:hover { color: var(--accent); }
.group-row { cursor: pointer; }
.group-row td { background: var(--well); }
.group-row:hover td { background: var(--well-hover); }
.group-row .caret { display: inline-block; transition: transform .12s ease; color: var(--muted); margin-right: 4px; }
.group-row .caret-open { transform: rotate(90deg); }

/* ---- Control bar (filter-sort-group) ---- */
.control-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 2px 2px 0; }
.ctl { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.ctl-select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 12.5px; font-weight: 500; background: var(--card); color: var(--ink); text-transform: none; letter-spacing: 0; }
.ctl-dir { border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--ink-soft); background: var(--card); }
.ctl-dir:hover { border-color: var(--accent); color: var(--accent); }
.ctl-count { margin-left: auto; font-size: 11.5px; color: var(--muted); }

/* ---- Portfolio table ---- */
.table-scroll { overflow-x: auto; }
.ptable { width: 100%; border-collapse: collapse; min-width: 860px; }
.th-sort { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.th-sort:hover { color: var(--accent); }
.th-arrow { color: var(--accent); font-size: 9px; }
.group-row td { background: var(--well); padding: 7px 14px !important; border-bottom: 1px solid var(--line); }
.group-label { font-weight: 700; font-size: 12px; }
.svc-line { font-size: 12.5px; font-weight: 550; }
.ptable th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 650; padding: 10px 12px 6px; border-bottom: 1px solid var(--line); }
.ptable td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ptable tbody:last-child tr:last-child td { border-bottom: none; }
.prow { cursor: pointer; }
.prow:hover { background: var(--row-hover); }
.td-caret { width: 26px; padding-right: 0 !important; }
.caret { display: inline-block; transition: transform .12s ease; color: var(--muted); }
.caret-open { transform: rotate(90deg); }
.pname { display: flex; align-items: center; gap: 8px; font-weight: 620; }
.pname a:hover { color: var(--accent); }
.pclient { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.th-progress { width: 130px; }
.expand-row td { background: var(--row-hover); padding-top: 2px; }
.expand-loading { padding: 8px 0; }
.expand-tasks { padding: 6px 0 10px; }
.expand-open { display: inline-block; font-size: 12px; color: var(--accent); font-weight: 600; margin-top: 8px; }

/* ---- Task rows ---- */
.trow { display: flex; align-items: center; gap: 12px; padding: 7px 18px; border-bottom: 1px solid var(--line-soft); }
.expand-tasks .trow { padding: 6px 4px; }
.trow:last-child { border-bottom: none; }
.trow-link:hover { background: var(--row-hover); }
.trow-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.trow-people { display: flex; gap: 3px; align-items: center; min-width: 40px; }
.trow-due { font-size: 11.5px; color: var(--ink-soft); min-width: 46px; text-align: right; }
.status-select { border: 1px solid var(--line); border-radius: 7px; background: var(--card); font-size: 11.5px; padding: 3px 6px; color: var(--ink-soft); }
.status-group { padding-top: 6px; }
.status-head { padding: 8px 18px 4px; display: flex; align-items: center; gap: 8px; }

/* ---- Attention / done lists ---- */
.attn-list { list-style: none; }
.attn-item { display: flex; align-items: center; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--line-soft); }
.attn-item:hover { background: var(--row-hover); }
.attn-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.sub-head { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 12px 0 4px; }
.sub-red { color: var(--red); }
.sub-pink { color: var(--pink); }
.done-row { display: flex; gap: 12px; align-items: flex-start; padding: 7px 2px; border-bottom: 1px solid var(--line-soft); }
.done-row:last-child { border-bottom: none; }
.done-row:hover { background: var(--row-hover); }
.done-count { background: var(--green-bg); color: var(--green); font-weight: 750; border-radius: 8px; min-width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.done-row strong { display: block; font-size: 12.5px; }

/* ---- 3-week window ---- */
.window-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.window-day { border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 10px; display: flex; flex-direction: column; gap: 4px; }
.window-day.is-today { border-color: var(--accent); background: var(--accent-soft); }
.window-day.is-weekend { background: var(--card-soft); }
.window-date { font-size: 11px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .4px; display: flex; gap: 6px; }
.window-date em { font-style: normal; color: var(--accent); }
.window-item { font-size: 11.5px; padding: 3px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wi-task { background: var(--blue-bg); }
.wi-deadline { background: var(--red-bg); font-weight: 600; }

/* ---- Project page ---- */
.proj-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.proj-head-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.proj-title { font-size: 17px; font-weight: 700; }
.proj-head-side { display: flex; align-items: center; gap: 12px; }
.tab-row { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
.tab { padding: 7px 14px; font-size: 13px; font-weight: 550; color: var(--ink-soft); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab-active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }
.tab-soon { color: var(--muted); opacity: .55; cursor: default; }
.about-grid { display: grid; grid-template-columns: 90px 1fr; gap: 7px 12px; font-size: 13px; }
.about-grid dt { color: var(--muted); font-size: 12px; }
.scope-text { font-size: 13px; color: var(--ink-soft); white-space: pre-line; }

/* ---- Top scroll proxy ---- */
.top-scroll { overflow-x: auto; overflow-y: hidden; height: 12px; }
.top-scroll::-webkit-scrollbar { height: 9px; }
.top-scroll::-webkit-scrollbar-thumb { background: #d6d0c4; border-radius: 99px; }
.top-scroll::-webkit-scrollbar-track { background: transparent; }

/* ---- Tasks toolbar (switcher left, compact add right) ---- */
.tasks-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tasks-bar .quick-add { margin-left: auto; flex-wrap: nowrap; }
.qa-title-sm { flex: 0 1 220px; min-width: 140px; }
.btn-inline { width: auto !important; margin: 0 !important; padding: 8px 16px !important; }

/* ---- Task quick-add & edit ---- */
.quick-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.qa-title { flex: 1; min-width: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; font-size: 13px; background: var(--card-soft); }
.qa-title:focus { outline: 2px solid #e9c2c0; border-color: var(--accent); }
.qa-select, .qa-date { border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; font-size: 12.5px; background: var(--card-soft); color: var(--ink-soft); }
.qa-narrow { width: 90px; }
.btn-inline { width: auto; margin: 0; padding: 8px 18px; }
.trow-click { cursor: pointer; }
.trow-click:hover { background: var(--row-hover); }
.task-edit { background: var(--row-hover); border-bottom: 1px solid var(--line); padding: 12px 18px; display: flex; gap: 14px; align-items: flex-start; }
.task-edit-form { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.te-row { display: flex; gap: 10px; flex-wrap: wrap; }
.te-title { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; font-weight: 600; }
.te-row label { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.te-row select, .te-row input[type=date] { border: 1px solid var(--line); border-radius: 7px; padding: 5px 7px; font-size: 12.5px; background: var(--card); }
.te-row textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; resize: vertical; }
.te-actions { display: flex; gap: 8px; }
.btn-ghost { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; font-size: 12.5px; cursor: pointer; color: var(--ink-soft); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-danger { background: none; border: 1px solid #eecfcf; color: var(--red); border-radius: 8px; padding: 8px 14px; font-size: 12.5px; cursor: pointer; }
.btn-danger:hover { background: var(--red-bg); }

/* ---- Gantt / Timeline (frozen-left grid + scrollable chart) ---- */
.g2-scroll { overflow-x: auto; }
.g2 { display: inline-block; min-width: 100%; }
.g2-row { display: flex; align-items: stretch; border-bottom: 1px solid var(--line-soft); min-height: 34px; }
.g2c { position: sticky; z-index: 2; flex-shrink: 0; display: flex; align-items: center; gap: 7px; padding: 4px 10px; background: var(--card); border-right: 1px solid var(--line); font-size: 12.5px; }
.g2c-title { left: 0; width: 240px; }
.g2c-dur { left: 240px; width: 56px; justify-content: center; color: var(--ink-soft); font-size: 11.5px; gap: 1px; }
.g2c-start { left: 296px; width: 112px; color: var(--muted); font-size: 11px; }
.g2c-end { left: 408px; width: 112px; color: var(--muted); font-size: 11px; }
.g2c-sub { padding-left: 30px; }
.g2-track { position: relative; flex-shrink: 0; }
.g2-head { border-bottom: 1px solid var(--line); }
.g2-head .g2c { z-index: 4; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.g2-prow { background: var(--card); }
.g2-prow:hover { background: var(--row-hover); }
.g2-prow:hover .g2c { background: var(--row-hover); }
.g2-prow .caret { cursor: pointer; color: var(--muted); }
.g2-pname { font-weight: 650; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g2-trow { background: var(--row-hover); }
.g2-trow .g2c { background: var(--row-hover); transition: background .4s; }
.g2-trow.tl-saved .g2c { background: var(--green-bg); }

/* ---- Timeline inline editing ---- */
.tl-drag { cursor: grab; color: #cfc9bd; font-size: 12px; flex-shrink: 0; margin-left: -20px; }
.tl-drag:hover { color: var(--ink); }
.tl-edit { border: 1px solid transparent; border-radius: 6px; background: none; font-family: inherit; font-size: 12px; color: var(--ink); padding: 3px 5px; min-width: 0; }
.g2-trow:hover .tl-edit, .tl-edit:focus { border-color: var(--line); background: var(--card); outline: none; }
.tl-title { flex: 1; font-weight: 550; }
.tl-dur { width: 40px; text-align: center; padding: 3px 2px; -moz-appearance: textfield; appearance: textfield; }
.tl-dur::-webkit-outer-spin-button, .tl-dur::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tl-d { font-size: 11px; color: var(--muted); }
.tl-date { width: 100%; font-size: 10.5px; color: var(--ink-soft); padding: 3px 4px; }
.tl-date::-webkit-calendar-picker-indicator { padding: 0; margin: 0; }
.g2-tt { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g2-tick { position: absolute; top: 5px; font-size: 10px; color: var(--muted); padding-left: 5px; }
.g2-tick strong { color: var(--ink-soft); }
.g2-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); opacity: .6; z-index: 1; }
.g2-bar { position: absolute; top: 8px; height: 16px; border-radius: 5px; z-index: 1; opacity: .55; }
.gb-red { background: var(--red); }
.gb-amber { background: var(--amber); }
.gb-green { background: var(--green); }
.g2-bar.clip-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.g2-bar.clip-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.g2-bar-label { position: absolute; top: 8px; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; z-index: 1; }
.g2-diamond { position: absolute; top: 10px; width: 11px; height: 11px; background: var(--ink); transform: rotate(45deg) translateX(-50%); border-radius: 2px; z-index: 1; }
.g2-diamond.gd-done { background: var(--green); }
.g2-taskbar { position: absolute; top: 10px; height: 13px; border-radius: 4px; z-index: 1; }
.gt-open { background: var(--blue); }
.gt-done { background: var(--green); opacity: .5; }
.gt-overdue { background: var(--red); }
.g2-task-after { position: absolute; top: 7px; display: flex; align-items: center; gap: 5px; white-space: nowrap; z-index: 1; }
.g2-tt-label { font-size: 11px; color: var(--ink-soft); }
.g2-loading { padding: 7px 10px 7px 30px; background: var(--row-hover); border-bottom: 1px solid var(--line-soft); font-size: 11.5px; color: var(--muted); }
.gantt-unscheduled { padding: 12px 14px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ms-diamond { width: 9px; height: 9px; background: var(--ink); transform: rotate(45deg); border-radius: 2px; display: inline-block; flex-shrink: 0; }
.ms-diamond.gd-done { background: var(--green); }

/* ---- Board ---- */
.board { display: flex; gap: 10px; align-items: stretch; overflow-x: auto; padding-bottom: 10px; }
.board-col-wrap { min-width: 216px; width: 216px; flex-shrink: 0; background: var(--well); border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; }
.board-col-head { display: flex; align-items: center; gap: 7px; padding: 2px 4px 8px; }
/* the sortable list fills the whole column so a drop lands anywhere in it, not just on the card stack */
.board-col { flex: 1; min-height: 120px; display: flex; flex-direction: column; gap: 7px; align-content: flex-start; }
.board-full { min-height: 60vh; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: grab; box-shadow: 0 1px 2px rgba(22, 19, 15, .05); }
.card:active { cursor: grabbing; }
.card-ghost { opacity: .4; }
.card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.card-title { display: block; font-size: 12.5px; line-height: 1.35; margin-bottom: 6px; color: var(--ink); font-weight: 550; }
a.card-title:hover { color: var(--accent); }
.card-foot { display: flex; justify-content: space-between; align-items: center; }
.board-more { padding: 4px; text-align: center; }

/* ClickUp-style board interactions */
.board-add { padding-top: 6px; }
.board-add-btn { width: 100%; border: none; background: none; text-align: left; padding: 7px 8px; border-radius: 8px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.board-add-btn:hover { background: var(--slate-bg); color: var(--ink); }
.board-composer .bc-title { width: 100%; border: 1px solid var(--accent); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; background: var(--card); color: var(--ink); outline: none; }
.board-composer .bc-project { width: 100%; margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; font-size: 12px; background: var(--card); color: var(--ink-soft); }

/* ---- Persistent time-tracker widget (bottom-left, survives navigation) ---- */
.timer-widget { position: fixed; left: 16px; bottom: 16px; z-index: 7500; }
.timer-widget .timer-live { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px 8px 12px; box-shadow: 0 8px 26px rgba(0,0,0,.16); min-width: 190px; }
.timer-idle .timer-live { display: none; }
.timer-widget:not(.timer-idle) .timer-launch { display: none; }
.timer-launch { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 8px 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.timer-launch:hover { border-color: var(--accent); color: var(--accent); }
.timer-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex-shrink: 0; }
.timer-running .timer-dot { background: var(--red); animation: timerPulse 1.4s ease-in-out infinite; }
@keyframes timerPulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .timer-running .timer-dot { animation: none; } }
.timer-body { flex: 1; min-width: 0; }
.timer-clock { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--ink); }
.timer-label { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.timer-ctrls { display: flex; gap: 4px; }
.timer-btn { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); cursor: pointer; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.timer-btn:hover { border-color: var(--accent); color: var(--accent); }
.timer-stop:hover { border-color: var(--red); color: var(--red); }
.timer-toast { position: absolute; bottom: 100%; left: 0; margin-bottom: 8px; background: var(--green); color: #fff; font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 8px; white-space: nowrap; }

/* task-row / card start-timer button */
.timer-go { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 13px; padding: 2px 4px; border-radius: 6px; }
.timer-go:hover { color: var(--red); background: var(--red-bg); }
.card-actions { display: flex; align-items: center; gap: 4px; }
.card-timer { opacity: 0; }
.card:hover .card-timer { opacity: 1; }

/* estimate vs logged (task editor) */
.te-time { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.est-inputs { display: inline-flex; align-items: center; gap: 4px; }
.est-inputs input { width: 52px; }
.est-inputs span { color: var(--muted); font-size: 12px; }
.te-metric { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.te-metric strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.est-bar { display: inline-block; width: 90px; height: 6px; border-radius: 99px; background: var(--slate-bg); overflow: hidden; vertical-align: middle; }
.est-bar-wide { width: 150px; }
.est-fill { display: block; height: 100%; background: var(--green); }
.est-fill.est-near { background: var(--orange); }
.est-fill.est-over { background: var(--red); }

/* ---- Reports + timesheet ---- */
.rep-nav { margin-bottom: 14px; }
.rep-filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.rep-filters .tf { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); }
.rep-filters input, .rep-filters select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 12.5px; }
.rep-row { display: grid; grid-template-columns: 200px 1fr 84px 110px; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line); }
.rep-row:last-child { border-bottom: none; }
.rep-label { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-person { display: flex; align-items: center; gap: 8px; }
.rep-bar-wrap { height: 10px; border-radius: 99px; background: var(--slate-bg); overflow: hidden; }
.rep-bar { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.rep-bar-low { background: var(--blue); }
.rep-bar-ok { background: var(--green); }
.rep-bar-over { background: var(--red); }
.rep-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: 13px; }
.rep-sub { text-align: right; }
.rep-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rep-table th { text-align: left; padding: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); }
.rep-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rep-plink { font-weight: 600; }
.tp-idle { margin-top: 12px; padding: 9px 12px; background: var(--orange-bg); border-radius: 8px; color: var(--ink-soft); }

/* ---- Timeline Phase-2: baseline, critical path, dependency arrows, workload heat ---- */
.g2-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.g2-legend { display: inline-flex; align-items: center; gap: 12px; margin-left: 10px; }
.g2-lg { display: inline-flex; align-items: center; gap: 5px; }
.g2-lg::before { content: ""; width: 14px; height: 8px; border-radius: 2px; display: inline-block; }
.g2-lg-crit::before { background: var(--red); }
.g2-lg-base::before { background: none; border: 1.5px solid var(--muted); height: 5px; }
.g2-lg-heat::before { background: linear-gradient(to right, var(--blue-bg), var(--blue)); }

.g2-baseline { position: absolute; top: 50%; height: 5px; transform: translateY(-50%); margin-top: 11px;
  border: 1.5px solid var(--muted); border-radius: 3px; background: transparent; opacity: .7; }
.g2-baseline-slip { border-color: var(--red); }
.g2-taskbar.gt-critical { box-shadow: 0 0 0 2px var(--red); }
.g2-crit-dot { color: var(--red); font-size: 9px; margin-right: 3px; }

.g2-deps { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 6; overflow: visible; }
.g2-dep { fill: none; stroke: var(--muted); stroke-width: 1.4; opacity: .65; }
.g2-dep-crit { stroke: var(--red); stroke-width: 1.8; opacity: .9; }
#tlAr path { fill: var(--muted); }
#tlArC path { fill: var(--red); }

.g2-heat-row { height: 26px; }
.g2-heat { position: absolute; top: 4px; height: 16px; border-radius: 3px; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; }
.g2-heat.lv0 { background: transparent; }
.g2-heat.lv1 { background: color-mix(in srgb, var(--blue) 28%, transparent); color: var(--ink-soft); }
.g2-heat.lv2 { background: color-mix(in srgb, var(--blue) 50%, transparent); }
.g2-heat.lv3 { background: color-mix(in srgb, var(--blue) 74%, transparent); }
.g2-heat.lv4 { background: var(--blue); }

.te-deps .dep-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dep-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--slate-bg); border-radius: 99px; padding: 3px 6px 3px 10px; font-size: 11.5px; font-weight: 600; }
.dep-x { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 0 2px; }
.dep-x:hover { color: var(--red); }
.dep-add { padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink-soft); font-size: 12px; }
@media (max-width: 640px) { .rep-row { grid-template-columns: 130px 1fr 70px; } .rep-sub { display: none; } }

.ts-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.ts-range { font-weight: 600; font-size: 14px; }
.ts-total strong { font-size: 18px; margin: 0 4px; font-variant-numeric: tabular-nums; }
.ts-add { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ts-add select, .ts-add input[type=text], .ts-add input[type=date], .ts-add input[type=number] { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 12.5px; }
.ts-add input[type=text] { flex: 1; min-width: 160px; }
.ts-dur { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
.ts-h, .ts-m { width: 52px; }
.ts-day { padding: 12px 16px; }
.ts-weekend { opacity: .7; }
.ts-day-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.ts-day-total { font-variant-numeric: tabular-nums; }
.ts-entry { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.ts-entry-main { flex: 1; min-width: 0; font-size: 13px; }
.ts-entry-min { font-weight: 600; font-variant-numeric: tabular-nums; }
.ts-entry-src { text-transform: capitalize; }
.ts-empty { padding: 4px 0; }
.ts-viewtoggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ts-viewtoggle .vt { padding: 6px 14px; font-size: 12.5px; color: var(--ink-soft); text-decoration: none; }
.ts-viewtoggle .vt-active { background: var(--ink); color: var(--ground); }

/* weekly grid */
.ts-grid-wrap { overflow-x: auto; }
.ts-grid { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 620px; }
.ts-grid th, .ts-grid td { border: 1px solid var(--line); padding: 0; text-align: center; }
.ts-grid thead th { padding: 7px 6px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: var(--well); }
.ts-grid thead th span { display: block; font-size: 13px; color: var(--ink); font-weight: 700; }
.tg-proj { text-align: left !important; padding: 8px 10px !important; font-weight: 550; white-space: nowrap; }
.tg-weekend { opacity: .6; }
.tg-cell { width: 100%; border: none; background: none; text-align: center; padding: 9px 4px; font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; outline: none; }
.tg-cell:focus { background: var(--accent-bg, rgba(202,56,50,.08)); box-shadow: inset 0 0 0 2px var(--accent); }
.ts-grid tfoot td, .tg-total { font-weight: 700; font-variant-numeric: tabular-nums; background: var(--well); padding: 8px 6px; }
.ts-grid-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.tg-addproj { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 12.5px; }
.ts-grid-foot .btn-inline { margin-left: auto; }
.card-prio { border: none; background: none; padding: 0; cursor: pointer; line-height: 1; }
.card-prio-idle .prio-flag { color: var(--line); font-size: 13px; }
.card:hover .card-prio-idle .prio-flag { color: var(--muted); }
.card-addppl { width: 18px; height: 18px; border-radius: 50%; border: 1px dashed var(--muted); background: none; color: var(--muted); font-size: 11px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; opacity: 0; transition: opacity .12s; }
.card:hover .card-addppl { opacity: 1; }
.card-date { border: none; background: none; padding: 0; font-size: 11.5px; color: var(--ink-soft); cursor: pointer; }
.card-date-empty { opacity: 0; font-size: 12px; }
.card:hover .card-date-empty { opacity: .7; }
.card-pop { position: absolute; z-index: 8000; width: 240px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgba(0,0,0,.22); padding: 6px; }
.cp-head { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 9px 4px; }
.cp-row { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 9px; border-radius: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.cp-row:hover { background: var(--slate-bg); }
.cp-btn { border: none; background: none; text-align: left; }
.cp-row input[type=checkbox] { accent-color: var(--accent); }
.cp-date { width: calc(100% - 18px); margin: 4px 9px 6px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 12.5px; }

/* ---- Tasks module (workspace-wide board) ---- */
.tboard-controls { display: flex; flex-direction: column; gap: 12px; }
.tboard-controls .chip-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ttotal { margin-left: auto; }
.tfilters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.tf { display: flex; flex-direction: column; gap: 3px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.tf select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-size: 12.5px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--ink); background: var(--card); min-width: 130px; }
.tf-clear { align-self: center; font-size: 12px; color: var(--muted); }
.tf-clear:hover { color: var(--accent); }
.tboard-lane { margin-top: 8px; }
.tboard-lane-head { display: flex; align-items: center; gap: 8px; padding: 6px 2px; }
.tboard-lane-name { font-size: 13.5px; font-weight: 700; }
.tboard-scroll { overflow-x: auto; }
.tcard-proj { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; min-width: 0; }
.tcard-proj-name { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard-tag { flex-shrink: 0; font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; background: var(--slate-bg); color: var(--ink-soft); border-radius: 99px; padding: 1px 7px; }

/* ---- In-page search ---- */
.psearch-input { border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px; font-size: 12.5px; background: var(--card); color: var(--ink); min-width: 170px; }
.psearch-input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.tboard-search { margin-left: auto; }
.tboard-mine { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid transparent; flex-shrink: 0; }
.tboard-mine:hover { border-color: var(--line); }
.tboard-mine-on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
/* while searching, the project table ignores group-collapse so matches always show */
.ptable.searching .group-row { display: none; }
.ptable.searching .prow { display: table-row !important; }
.ptable.searching .expand-row { display: none !important; }
.ptable.searching .prow.prow-hide { display: none !important; }
.group-row:hover td { background: var(--well-hover); }

/* ---- Archive browser ---- */
.arch-controls .panel-head { align-items: center; }
.arch-search .search-input { min-width: 240px; }
.arch-period-head { font-size: 12.5px; font-weight: 700; padding: 9px 18px 7px; color: var(--ink); background: var(--well); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; display: flex; align-items: center; gap: 8px; }
.arch-group { margin-bottom: 14px; }
.arch-row td { padding: 9px 14px; }
.arch-row:hover { background: var(--row-hover); }

/* ---- Knowledge Base ---- */
.kb-wrap { display: flex; height: calc(100vh - 96px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kb-side { width: 264px; flex-shrink: 0; border-right: 1px solid var(--line); background: var(--card-soft); overflow-y: auto; padding-bottom: 12px; }
.kb-side-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); position: sticky; top: 0; background: var(--card-soft); z-index: 1; }
.kb-new { border: 1px solid var(--line); background: var(--card); border-radius: 6px; width: 22px; height: 22px; font-size: 13px; cursor: pointer; color: var(--muted); }
.kb-new:hover { color: var(--accent); border-color: var(--accent); }
.kb-tree-list { list-style: none; margin: 0; padding: 0; }
.kb-tree > .kb-tree-list { min-height: 20px; }
.kb-tree-list .kb-tree-list { margin-left: 14px; border-left: 1px solid var(--line-soft); min-height: 4px; }
/* empty child list = a droppable zone under a leaf page, so you can nest into any page */
.kb-node > .kb-tree-list:empty { min-height: 12px; margin-left: 22px; }
.kb-collapsed > .kb-tree-list { display: none; }
.kb-node-row { display: flex; align-items: center; gap: 2px; padding: 3px 8px 3px 4px; border-radius: 7px; margin: 1px 6px; }
.kb-node-row:hover { background: var(--row-hover); }
.kb-node-active { background: var(--nav-active) !important; }
.kb-node-active .kb-node-title { color: var(--accent); font-weight: 650; }
.kb-caret { border: none; background: none; cursor: pointer; color: var(--muted); font-size: 10px; width: 16px; height: 16px; flex-shrink: 0; transition: transform .12s; }
.kb-node:not(.kb-collapsed) > .kb-node-row > .kb-caret { transform: rotate(90deg); }
.kb-caret-empty { width: 16px; flex-shrink: 0; }
.kb-node-link { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-soft); padding: 2px 0; }
.kb-node-link:hover { color: var(--ink); }
.kb-node-icon { flex-shrink: 0; font-size: 13px; }
.kb-node-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-node-add { opacity: 0; }
.kb-node-row:hover .kb-node-add { opacity: 1; }
.kb-node-add button { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 3px; }
.kb-node-add button:hover { color: var(--accent); }
.kb-drag-ghost { opacity: .4; }

.kb-main { flex: 1; min-width: 0; overflow-y: auto; }
.kb-empty { max-width: 460px; margin: 12vh auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.kb-empty-emoji { font-size: 46px; }
.kb-empty h2 { font-size: 20px; font-weight: 750; }
.kb-cover { height: 200px; background-size: cover; background-position: center; position: relative; }
.kb-cover-actions { position: absolute; right: 14px; bottom: 12px; }
.kb-cover-btn { display: inline-block; background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 8px; padding: 6px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.kb-cover-btn:hover { background: rgba(0,0,0,.72); }
.kb-doc-inner { max-width: 860px; margin: 0 auto; padding: 24px 40px 80px; }
.kb-cover + .kb-doc-inner { padding-top: 18px; }
.kb-icon-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; position: relative; }
.kb-icon-btn { border: none; background: none; font-size: 40px; line-height: 1; cursor: pointer; padding: 0; }
.kb-icon-pick { position: absolute; top: 48px; left: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 4px; width: 260px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px; box-shadow: var(--shadow); }
.kb-icon-pick button { border: none; background: none; font-size: 20px; cursor: pointer; width: 30px; height: 30px; border-radius: 7px; }
.kb-icon-pick button:hover { background: var(--row-hover); }
.kb-add-cover { font-size: 12px; color: var(--muted); cursor: pointer; }
.kb-add-cover:hover { color: var(--accent); }
.kb-title-input { width: 100%; border: none; background: none; font-size: 34px; font-weight: 800; letter-spacing: -.5px; color: var(--ink); padding: 4px 0; outline: none; font-family: inherit; }
.kb-crumbs { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }
.kb-crumbs a:hover { color: var(--accent); }
.kb-view-head { display: flex; align-items: center; gap: 12px; }
.kb-view-icon { font-size: 40px; line-height: 1; }
.kb-view-title { font-size: 34px; font-weight: 800; letter-spacing: -.5px; }
.kb-view-meta { display: flex; align-items: center; gap: 10px; margin: 8px 0 20px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.kb-view-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.kb-body { font-size: 15px; line-height: 1.65; }
.kb-body img { max-width: 100%; height: auto; border-radius: 8px; }
@media (max-width: 900px) { .kb-side { display: none; } .kb-doc-inner { padding: 20px; } }
.view-toggle { display: inline-flex; gap: 2px; background: var(--well); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.vt { padding: 5px 14px; font-size: 12px; font-weight: 600; color: var(--ink-soft); border-radius: 7px; }
.vt:hover { color: var(--ink); background: var(--row-hover); }
.vt-active { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: var(--shadow); }
.vt-active:hover { background: var(--card); color: var(--ink); }

.row-done { opacity: .5; }
.row-done .trow-title { text-decoration: line-through; }

/* ---- HQ hover-edit ---- */
.hq-box { position: relative; }
.box-edit { position: absolute; top: 12px; right: 14px; opacity: 0; transition: opacity .12s ease; background: var(--card); border: 1px solid var(--line); border-radius: 7px; padding: 3px 9px; font-size: 13px; color: var(--ink-soft); cursor: pointer; text-decoration: none; }
.hq-box:hover .box-edit { opacity: 1; }
.box-edit:hover { color: var(--accent); border-color: var(--accent); }
.hq-edit-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.hq-edit-row input[type=text], .hq-edit-row input[type=date], .hq-edit-row select { border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; font-size: 12.5px; background: var(--card-soft); }
.he-grow { flex: 1; }
.he-mid { width: 180px; }
.he-kind { width: 78px; }
.he-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.he-del:hover { color: var(--red); }
.hq-box .te-actions { margin-top: 12px; }
.scope-rich { font-size: 13px; color: var(--ink-soft); line-height: 1.55; overflow-x: auto; }
.scope-rich table { border-collapse: collapse; margin: 8px 0; }
.scope-rich td, .scope-rich th { border: 1px solid var(--line); padding: 5px 9px; }
.scope-rich p { margin-bottom: 7px; }
.scope-rich ul, .scope-rich ol { padding-left: 20px; margin-bottom: 7px; }
.tox-tinymce { border-radius: 8px !important; border-color: var(--line) !important; }

/* ---- HQ blocks ---- */
.hq-line { display: flex; align-items: center; gap: 10px; padding: 6px 2px; border-bottom: 1px solid var(--line-soft); }
.hq-line:last-child { border-bottom: none; }
.hq-text { flex: 1; font-size: 12.5px; }
.hq-done { color: var(--muted); }
.req-got { color: var(--green); font-weight: 800; }
.req-wait { color: var(--muted); }
.req-no { color: var(--red); font-weight: 800; }
.pm-amt { min-width: 44px; font-size: 11.5px; }

/* ---- Search + bell ---- */
.topbar-side { display: flex; align-items: center; gap: 12px; }
.search-input { border: 1px solid var(--line); border-radius: 99px; padding: 7px 14px; font-size: 12.5px; width: 250px; background: var(--card); }
.search-input:focus { outline: 2px solid #e9c2c0; border-color: var(--accent); }
.bell { position: relative; font-size: 16px; text-decoration: none; }
.bell-count { position: absolute; top: -6px; right: -8px; background: var(--accent); color: #fff; font-size: 9.5px; font-weight: 700; border-radius: 99px; padding: 1px 5px; }
.notif-row { display: flex; align-items: center; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--line-soft); }
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: var(--row-hover); }
.notif-ico { width: 22px; text-align: center; }
.notif-text { flex: 1; font-size: 12.5px; min-width: 0; }

/* ---- Comments ---- */
.task-comments { flex-basis: 100%; border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 10px; }
.task-edit { flex-wrap: wrap; }
.comment { display: flex; gap: 9px; padding: 5px 0; }
.comment-body { flex: 1; }
.comment-meta { font-size: 11.5px; }
.comment-text { font-size: 12.5px; color: var(--ink-soft); white-space: pre-line; }
.comment-form { display: flex; gap: 8px; margin-top: 8px; }
.comment-form input { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 7px 11px; font-size: 12.5px; background: var(--card); }

/* ---- Project form ---- */
.form-panel { max-width: 760px; }
.f-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.f-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.f-grid input, .f-grid select, .f-grid textarea { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; background: var(--card-soft); font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--ink); }
.f-grid input:focus, .f-grid select:focus, .f-grid textarea:focus { outline: 2px solid #e9c2c0; border-color: var(--accent); }
.f-wide { grid-column: 1 / -1; }
.f-link { font-size: 11px; color: var(--accent); cursor: pointer; text-transform: none; letter-spacing: 0; }
.form-actions { margin-top: 16px; }
.btn-edit { padding: 6px 14px; text-decoration: none; }
.chip-new { border-style: dashed; color: var(--accent); }

/* ---- Flash + Trash ---- */
.flash { background: var(--green-bg); border: 1px solid #cfe6d8; color: #2c6b45; border-radius: var(--radius); padding: 10px 14px; font-size: 13px; display: flex; align-items: center; justify-content: space-between; }
.flash-x { background: none; border: none; color: inherit; font-size: 18px; cursor: pointer; line-height: 1; }
.chip-trash { border-style: dashed; color: var(--muted); }
.chip-trash:hover { border-color: var(--red); color: var(--red); }
.trash-row { display: flex; align-items: center; gap: 14px; padding: 11px 2px; border-bottom: 1px solid var(--line-soft); }
.trash-row:last-child { border-bottom: none; }
.trash-main { flex: 1; min-width: 0; }
.trash-main strong { display: block; font-size: 13.5px; }
.trash-meta { display: flex; align-items: center; gap: 10px; }
.trash-actions { display: flex; gap: 8px; }

/* ---- Login ---- */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--ground); }
.login-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 34px 34px 30px; width: 350px; }
.login-brand { padding: 0 0 4px; font-size: 20px; }
.login-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }
.login-card label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-soft); margin: 12px 0 4px; }
.login-card input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 13.5px; background: var(--card-soft); }
.login-card input:focus { outline: 2px solid #e9c2c0; border-color: var(--accent); }
.btn-primary { width: 100%; margin-top: 18px; background: var(--accent); color: #fff; border: none; border-radius: 8px; padding: 10px; font-size: 13.5px; font-weight: 650; cursor: pointer; }
.btn-primary:hover { background: #b32e29; }
.form-error { color: var(--red); font-size: 12px; margin-top: 8px; }
