:root {
  --bg: #16171c; --bg2: #1e1f25; --bg3: #26272e; --bg4: #30313a; --line: #34353e; --line2: #44454f;
  --text: #ececf1; --text2: #a9abb6; --text3: #7c7e8a;
  --accent: #4f7cff; --accent2: #3e66e0; --accent-soft: rgba(79,124,255,.16);
  --green: #2bb673; --green-soft: rgba(43,182,115,.16); --red: #f0544f; --red-soft: rgba(240,84,79,.15);
  --amber: #f2a93b; --amber-soft: rgba(242,169,59,.16); --purple: #9b6cf7;
  --radius: 10px; --shadow: 0 10px 30px rgba(0,0,0,.45);
  --side: 248px; --top: 54px;
  color-scheme: dark;
}
:root.light {
  --bg: #f6f7f9; --bg2: #ffffff; --bg3: #f0f1f4; --bg4: #e5e7ec; --line: #e2e4e9; --line2: #cfd2d9;
  --text: #1d1f26; --text2: #5c606c; --text3: #8a8e99;
  --accent-soft: rgba(79,124,255,.12); --shadow: 0 10px 30px rgba(20,25,40,.15);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 18px; } h3 { font-size: 15px; }
.boot { padding: 40px; color: var(--text2); }
.muted { color: var(--text2); } .faint { color: var(--text3); } .small { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.row.wrap > h1.grow, .row.wrap > h2.grow { min-width: max-content; }
.hidden { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.danger-text { color: var(--red); }

/* ---------- inputs & buttons ---------- */
.input, select.input, textarea.input {
  width: 100%; background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none; transition: border-color .15s;
}
.input:focus { border-color: var(--accent); }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.5; }
.input.sm { padding: 5px 8px; font-size: 13px; }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; color: var(--text2); margin-bottom: 4px; font-weight: 550; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 13px; border-radius: 8px; border: 1px solid var(--line2);
  background: var(--bg3); cursor: pointer; font-weight: 550; white-space: nowrap; user-select: none; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--bg4); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent2); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--bg3); }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 7px; }
.btn.icon { padding: 6px; width: 32px; height: 32px; }
.btn:disabled { opacity: .5; cursor: default; }
.chk { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--text3); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; background: transparent; padding: 0; transition: all .12s; }
.chk:hover { border-color: var(--green); color: var(--green); }
.chk svg { width: 11px; height: 11px; opacity: 0; }
.chk:hover svg { opacity: .7; }
.chk.on { background: var(--green); border-color: var(--green); color: #fff; }
.chk.on svg { opacity: 1; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- auth screens ---------- */
.auth-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: var(--shadow); }
.auth-card .logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; margin-bottom: 18px; }
.auth-card .logo img { width: 32px; height: 32px; }
.auth-card p { color: var(--text2); margin: 0 0 16px; }
.err { background: var(--red-soft); color: var(--red); padding: 8px 10px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.ok-box { background: var(--green-soft); color: var(--green); padding: 8px 10px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.qr-box { background: #fff; padding: 12px; border-radius: 12px; display: inline-block; line-height: 0; }
.qr-box img { width: 190px; height: 190px; image-rendering: pixelated; }
.secret { font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--bg3); padding: 8px 10px; border-radius: 8px; word-break: break-all; font-size: 13px; letter-spacing: .05em; user-select: all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--bg3); padding: 12px; border-radius: 10px; margin: 10px 0; user-select: all; }
.code-input { font-size: 22px; letter-spacing: .3em; text-align: center; font-family: ui-monospace, Menlo, monospace; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; height: 100vh; height: 100dvh; }
.side { background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side .brand { display: flex; align-items: center; gap: 9px; padding: 14px 16px; font-weight: 700; font-size: 15.5px; height: var(--top); }
.side .brand img { width: 26px; height: 26px; }
.side nav { padding: 4px 8px; overflow-y: auto; flex: 1; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--text); cursor: pointer; font-weight: 500; text-decoration: none !important; }
.nav-item:hover { background: var(--bg3); }
.nav-item.active { background: var(--accent-soft); color: var(--text); }
.nav-item .badge { margin-left: auto; }
.nav-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 10px 4px; color: var(--text3); font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; }
.dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.badge { background: var(--red); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center; }
.side-foot { border-top: 1px solid var(--line); padding: 8px; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.top { height: var(--top); display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--bg2); flex: none; }
.top .search { max-width: 420px; flex: 1; position: relative; }
.top .search .input { padding-left: 32px; background: var(--bg3); }
.top .search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text3); }
.search-results { position: absolute; top: 40px; left: 0; right: 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 60vh; overflow: auto; z-index: 50; padding: 6px; }
.search-results .sr { padding: 7px 9px; border-radius: 7px; cursor: pointer; display: flex; gap: 8px; align-items: center; }
.search-results .sr:hover { background: var(--bg3); }
.search-results .grp { font-size: 11px; color: var(--text3); text-transform: uppercase; padding: 6px 9px 2px; font-weight: 650; }
.menu-btn { display: none; }
.timer-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--green-soft); color: var(--green); border-radius: 20px; padding: 4px 6px 4px 12px; font-weight: 600; font-size: 13px; max-width: 280px; }
.timer-pill .t { font-variant-numeric: tabular-nums; }
.content { flex: 1; overflow: auto; min-height: 0; position: relative; }
.page { padding: 22px 26px 60px; max-width: 1200px; }
.page.wide { max-width: none; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; text-transform: uppercase; user-select: none; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.avatar.lg { width: 36px; height: 36px; font-size: 14px; }
.avatar.unassigned { background: transparent; border: 1.5px dashed var(--text3); color: var(--text3); }
.avatar.unassigned svg.i { width: 60%; height: 60%; }
.avatars { display: flex; } .avatars .avatar { margin-left: -6px; border: 2px solid var(--bg2); } .avatars .avatar:first-child { margin-left: 0; }

/* ---------- project header & tabs ---------- */
.phead { padding: 14px 24px 0; border-bottom: 1px solid var(--line); background: var(--bg2); flex: none; }
.phead .title-row { display: flex; align-items: center; gap: 10px; }
.phead .ptitle { font-size: 19px; font-weight: 700; }
.proj-icon { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.tabs { display: flex; gap: 2px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { display: flex; align-items: center; gap: 6px; padding: 8px 11px; border-bottom: 2px solid transparent; color: var(--text2); cursor: pointer; white-space: nowrap; font-weight: 550; text-decoration: none !important; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tab.add { color: var(--text3); }
.toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 24px; border-bottom: 1px solid var(--line); flex-wrap: wrap; flex: none; }
.pbody { flex: 1; overflow: auto; min-height: 0; }
.pane { display: flex; flex-direction: column; height: 100%; min-height: 0; }

/* ---------- popover / menus / modal ---------- */
.pop { position: fixed; z-index: 200; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 200px; max-height: 70vh; overflow: auto; }
.pop .mi { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.pop .mi:hover, .pop .mi.kb { background: var(--bg3); }
.pop .mi.danger { color: var(--red); }
.pop .sep { height: 1px; background: var(--line); margin: 5px 2px; }
.pop .ph { font-size: 11.5px; color: var(--text3); padding: 6px 10px 3px; font-weight: 650; text-transform: uppercase; }
.view-menu { width: 620px; max-width: calc(100vw - 24px); padding: 14px; }
.view-menu .vgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.view-menu .vi { display: flex; gap: 12px; padding: 10px; border-radius: 9px; cursor: pointer; align-items: flex-start; }
.view-menu .vi:hover { background: var(--bg3); }
.view-menu .vi svg.i { width: 26px; height: 26px; color: var(--accent); margin-top: 2px; }
.view-menu .vi.added { opacity: .55; }
.view-menu .vi b { display: block; }
.view-menu .vi span { color: var(--text2); font-size: 12.5px; }
.view-menu .vh { color: var(--text2); font-size: 12.5px; margin: 6px 4px 4px; font-weight: 600; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 150; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow: auto; }
.modal { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); width: 100%; max-width: 480px; padding: 22px; }
.modal.wide { max-width: 720px; }
.modal .mfoot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.toast-wrap { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: var(--bg4); border: 1px solid var(--line2); padding: 9px 16px; border-radius: 10px; box-shadow: var(--shadow); font-weight: 550; animation: tin .2s ease; }
.toast.error { background: #4a1d1d; border-color: #7a2c2c; color: #ffc9c7; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- cards & lists ---------- */
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h3 { display: flex; align-items: center; gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.kpi .l { color: var(--text2); font-size: 12.5px; }
.proj-card { cursor: pointer; transition: border-color .12s; text-decoration: none !important; color: var(--text); display: block; }
.proj-card:hover { border-color: var(--line2); }
.progress { height: 6px; border-radius: 4px; background: var(--bg4); overflow: hidden; }
.progress > div { height: 100%; background: var(--green); border-radius: 4px; }
.trow { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; }
.trow:hover { background: var(--bg3); }
.trow .tt { flex: 1; min-width: 0; }
.trow.done .tt { color: var(--text3); text-decoration: line-through; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; background: var(--bg4); color: var(--text2); white-space: nowrap; }
.chip.urgent { background: var(--red-soft); color: var(--red); } .chip.high { background: var(--amber-soft); color: var(--amber); }
.chip.medium { background: var(--accent-soft); color: var(--accent); } .chip.low { background: var(--green-soft); color: var(--green); }
.chip.tag { background: rgba(155,108,247,.15); color: var(--purple); }
.due { font-size: 12.5px; color: var(--text2); white-space: nowrap; }
.due.over { color: var(--red); } .due.today { color: var(--green); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.status-pill.on_track { background: var(--green-soft); color: var(--green); } .status-pill.at_risk { background: var(--amber-soft); color: var(--amber); }
.status-pill.off_track { background: var(--red-soft); color: var(--red); } .status-pill.none, .status-pill.on_hold { background: var(--bg4); color: var(--text2); }
.status-pill.complete { background: var(--accent-soft); color: var(--accent); }
.empty { text-align: center; color: var(--text2); padding: 40px 20px; }
.empty svg.i { width: 36px; height: 36px; color: var(--text3); margin-bottom: 8px; }

/* ---------- list view ---------- */
.ltable { width: 100%; border-collapse: collapse; min-width: 760px; }
.ltable th { text-align: left; font-size: 12px; color: var(--text3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 2; cursor: pointer; user-select: none; white-space: nowrap; }
.ltable td { padding: 0 10px; border-bottom: 1px solid var(--line); height: 38px; vertical-align: middle; }
.ltable tr.task:hover td { background: var(--bg3); }
.ltable tr.task td.name { cursor: pointer; }
.ltable tr.sec td { padding: 14px 10px 6px; border-bottom: 1px solid var(--line); font-weight: 650; font-size: 14.5px; }
.ltable tr.sub td.name { padding-left: 38px; }
.ltable tr.done .tname { color: var(--text3); text-decoration: line-through; }
.ltable .add-row td { color: var(--text3); cursor: pointer; }
.ltable .add-row td:hover { color: var(--text); }
.drag-h { cursor: grab; color: var(--text3); opacity: 0; padding: 2px; touch-action: none; }
tr.task:hover .drag-h { opacity: 1; }
.counts { display: inline-flex; gap: 8px; color: var(--text3); font-size: 12px; margin-left: 6px; }
.counts span { display: inline-flex; align-items: center; gap: 3px; }
.counts svg.i { width: 12px; height: 12px; }

/* ---------- board ---------- */
.board { display: flex; gap: 12px; padding: 16px 24px; align-items: flex-start; height: 100%; min-height: 0; overflow-x: auto; }
.bcol { width: 290px; flex: none; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; display: flex; flex-direction: column; max-height: 100%; }
.bcol-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 650; }
.bcol-h .n { color: var(--text3); font-weight: 500; }
.bcol-body { padding: 4px 8px 8px; overflow-y: auto; min-height: 40px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.bcol.drop-target { border-color: var(--accent); }
.bcard { background: var(--bg3); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; cursor: grab; user-select: none; touch-action: manipulation; transition: border-color .12s; }
.bcard:hover { border-color: var(--line2); }
.bcard.done .bt { color: var(--text3); text-decoration: line-through; }
.bcard .bt { display: flex; gap: 8px; align-items: flex-start; font-weight: 550; }
.bcard .bt .chk { margin-top: 1px; }
.bcard .bm { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.add-card { color: var(--text3); padding: 8px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.add-card:hover { background: var(--bg3); color: var(--text); }
.ghost-card { position: fixed; pointer-events: none; z-index: 400; opacity: .92; transform: rotate(2deg); box-shadow: var(--shadow); }
.placeholder { border: 2px dashed var(--accent); border-radius: 10px; background: var(--accent-soft); }
.dragging-src { opacity: .35; }
.add-col { width: 260px; flex: none; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-left: 1px solid var(--line); border-top: 1px solid var(--line); margin: 0 24px 24px; }
.cal .dow { padding: 6px 8px; font-size: 12px; color: var(--text3); font-weight: 600; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg2); }
.cal .day { min-height: 110px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.cal .day.other { background: rgba(0,0,0,.12); }
:root.light .cal .day.other { background: rgba(0,0,0,.025); }
.cal .day .dn { font-size: 12px; color: var(--text2); padding: 2px 4px; display: flex; justify-content: space-between; align-items: center; }
.cal .day.today .dn b { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; }
.cal .day .plus { opacity: 0; cursor: pointer; color: var(--text3); }
.cal .day:hover .plus { opacity: 1; }
.cal .day.drop-target { background: var(--accent-soft); }
.cal-item { font-size: 12px; padding: 3px 7px; border-radius: 6px; background: var(--bg3); border-left: 3px solid var(--accent); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; user-select: none; }
.cal-item.done { opacity: .5; text-decoration: line-through; }
.cal-item.meeting { border-left-color: var(--purple); }

/* ---------- timeline / gantt ---------- */
.tl-wrap { display: flex; height: 100%; min-height: 0; }
.tl-left { width: 280px; flex: none; border-right: 1px solid var(--line); overflow: hidden; background: var(--bg2); display: flex; flex-direction: column; }
.tl-left .tl-rows { overflow: hidden; flex: 1; }
.tl-right { flex: 1; overflow: auto; position: relative; }
.tl-head { height: 52px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg2); z-index: 5; }
.tl-left .tl-head { display: flex; align-items: flex-end; padding: 0 12px 8px; font-size: 12px; color: var(--text3); font-weight: 600; flex: none; }
.tl-month { position: absolute; top: 4px; font-size: 12px; font-weight: 650; color: var(--text2); white-space: nowrap; padding-left: 6px; }
.tl-dayn { position: absolute; top: 28px; font-size: 11px; color: var(--text3); text-align: center; }
.tl-dayn.today { color: #fff; background: var(--accent); border-radius: 8px; }
.tl-row { height: 36px; border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 12px; gap: 8px; font-size: 13px; cursor: pointer; }
.tl-row.group { font-weight: 650; background: var(--bg3); cursor: default; }
.tl-row:not(.group):hover { background: var(--bg3); }
.tl-grid { position: relative; }
.tl-col { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.tl-col.weekend { background: rgba(255,255,255,.02); }
:root.light .tl-col.weekend { background: rgba(0,0,0,.025); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); z-index: 3; }
.tl-grow { position: absolute; left: 0; right: 0; height: 36px; border-bottom: 1px solid var(--line); }
.tl-grow.group { background: rgba(127,127,127,.06); }
.bar { position: absolute; height: 24px; top: 6px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; padding: 0 8px; white-space: nowrap; overflow: visible; cursor: grab; user-select: none; touch-action: none; z-index: 4; min-width: 10px; }
.bar.done { opacity: .5; }
.bar .lbl { overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.bar .lbl-out { position: absolute; left: 100%; margin-left: 8px; color: var(--text2); pointer-events: none; font-weight: 500; }
.bar .rz { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.bar .rz.l { left: 0; } .bar .rz.r { right: 0; }
.bar.milestone { width: 18px !important; height: 18px; top: 9px; transform: rotate(45deg); border-radius: 3px; padding: 0; min-width: 0; background: var(--amber); }
.bar.milestone .lbl { display: none; }
.bar.milestone .lbl-out { transform: rotate(-45deg); transform-origin: left center; top: 4px; left: 22px; }
.baseline { position: absolute; height: 6px; top: 28px; border-radius: 3px; background: var(--text3); opacity: .55; z-index: 3; }
.dep-svg { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 3; overflow: visible; }
.dep-svg path { fill: none; stroke: var(--text2); stroke-width: 1.5; }
.dep-svg path.late { stroke: var(--red); }

/* ---------- task panel ---------- */
.panel-bg { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.25); }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: 640px; max-width: 100vw; background: var(--bg2); border-left: 1px solid var(--line); z-index: 100; display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pin .18s ease; }
@keyframes pin { from { transform: translateX(30px); opacity: .5; } }
.panel-top { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex: none; }
.panel-body { flex: 1; overflow-y: auto; padding: 16px 22px 30px; }
.panel-title { font-size: 21px; font-weight: 700; width: 100%; background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; margin-left: -7px; resize: none; overflow: hidden; line-height: 1.3; }
.panel-title:hover { border-color: var(--line); } .panel-title:focus { border-color: var(--accent); outline: none; }
.props { display: grid; grid-template-columns: 130px 1fr; gap: 6px 10px; align-items: center; margin: 14px 0 18px; }
.props > .pl { color: var(--text2); font-size: 13px; }
.pv { min-height: 32px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pv .val { padding: 4px 8px; border-radius: 7px; cursor: pointer; border: 1px solid transparent; display: inline-flex; align-items: center; gap: 6px; }
.pv .val:hover { border-color: var(--line2); }
.pv input[type=date], .pv input[type=number], .pv select { background: transparent; border: 1px solid transparent; border-radius: 7px; padding: 4px 6px; }
.pv input[type=date]:hover, .pv input[type=number]:hover, .pv select:hover { border-color: var(--line2); }
.section-h { font-weight: 650; margin: 20px 0 8px; display: flex; align-items: center; gap: 8px; font-size: 14px; }
.desc-view { padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; cursor: text; min-height: 60px; }
.desc-view:hover { border-color: var(--line); }
.sub-row { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.sub-row .st { flex: 1; cursor: pointer; }
.sub-row.done .st { color: var(--text3); text-decoration: line-through; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.att { border: 1px solid var(--line); border-radius: 9px; padding: 8px; display: flex; flex-direction: column; gap: 6px; position: relative; background: var(--bg3); min-width: 0; }
.att .thumb { height: 84px; border-radius: 6px; background: var(--bg4); display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--text3); font-weight: 700; font-size: 13px; }
.att .thumb img { width: 100%; height: 100%; object-fit: cover; }
.att .fn { font-size: 12.5px; font-weight: 550; }
.att .x { position: absolute; top: 4px; right: 4px; opacity: 0; }
.att:hover .x { opacity: 1; }
.dropzone { border: 1.5px dashed var(--line2); border-radius: 10px; padding: 14px; text-align: center; color: var(--text3); cursor: pointer; font-size: 13px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.feed { display: flex; flex-direction: column; gap: 12px; }
.feed .fi { display: flex; gap: 10px; }
.feed .fi .fb { flex: 1; min-width: 0; }
.feed .fi.act { color: var(--text3); font-size: 12.5px; align-items: center; }
.feed .fi.act .avatar { width: 18px; height: 18px; font-size: 8px; }
.comment-box { border-top: 1px solid var(--line); padding: 12px 16px; flex: none; display: flex; gap: 10px; align-items: flex-end; background: var(--bg2); }

/* ---------- markdown ---------- */
.md { word-wrap: break-word; }
.md p { margin: 0 0 .6em; } .md p:last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3 { margin: .8em 0 .4em; }
.md ul, .md ol { margin: 0 0 .6em; padding-left: 22px; }
.md code { background: var(--bg4); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; font-family: ui-monospace, Menlo, monospace; }
.md pre { background: var(--bg3); padding: 10px; border-radius: 8px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md blockquote { border-left: 3px solid var(--line2); margin: 0 0 .6em; padding-left: 10px; color: var(--text2); }
.md li.cb { list-style: none; margin-left: -20px; }
.md .mention { color: var(--accent); font-weight: 600; }
.md hr { border: none; border-top: 1px solid var(--line); }

/* ---------- messages ---------- */
.chat { display: grid; grid-template-columns: 230px 1fr; height: 100%; min-height: 0; }
.chat.embedded { grid-template-columns: 1fr; }
.chans { border-right: 1px solid var(--line); background: var(--bg2); overflow-y: auto; padding: 10px 8px; }
.chat-main { display: flex; flex-direction: column; min-height: 0; }
.chat-log { flex: 1; overflow-y: auto; padding: 16px 24px; display: flex; flex-direction: column; gap: 2px; }
.msg { display: flex; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.msg:hover { background: var(--bg3); }
.msg .mb { flex: 1; min-width: 0; }
.msg .mh { display: flex; align-items: baseline; gap: 8px; }
.msg .mh b { font-weight: 650; }
.msg .del { opacity: 0; }
.msg:hover .del { opacity: 1; }
.msg.cont { padding-top: 0; }
.msg.cont .avatar { visibility: hidden; height: 0; }
.day-sep { text-align: center; color: var(--text3); font-size: 12px; margin: 12px 0 6px; }
.composer { border-top: 1px solid var(--line); padding: 12px 24px; display: flex; flex-direction: column; gap: 8px; }
.composer .pending { display: flex; gap: 6px; flex-wrap: wrap; }
.mention-pop .mi { padding: 5px 8px; }

/* ---------- workload / dashboard / timesheet ---------- */
.wl { width: 100%; border-collapse: collapse; }
.wl th, .wl td { border-bottom: 1px solid var(--line); padding: 8px; text-align: left; }
.wl th { font-size: 12px; color: var(--text3); font-weight: 600; }
.wl td.cell { width: 13%; }
.wl-bar { height: 26px; border-radius: 6px; background: var(--green-soft); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; cursor: pointer; }
.wl-bar.mid { background: var(--amber-soft); color: var(--amber); }
.wl-bar.over { background: var(--red-soft); color: var(--red); }
.wl-bar.zero { background: transparent; color: var(--text3); font-weight: 500; }
.chart { width: 100%; }
.chart text { fill: var(--text2); font-size: 11px; }
.ts { width: 100%; border-collapse: collapse; min-width: 720px; }
.ts th, .ts td { border-bottom: 1px solid var(--line); padding: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.ts th:first-child, .ts td:first-child { text-align: left; }
.ts th { font-size: 12px; color: var(--text3); font-weight: 600; }
.ts tfoot td { font-weight: 700; }
.ts td.has { color: var(--text); font-weight: 600; } .ts td.zero { color: var(--text3); }

/* ---------- split (pages/meetings) ---------- */
.split { display: grid; grid-template-columns: 280px 1fr; height: 100%; min-height: 0; }
.split .sl { border-right: 1px solid var(--line); overflow-y: auto; padding: 10px; background: var(--bg2); }
.split .sr { overflow-y: auto; padding: 20px 28px 50px; min-width: 0; }
.li { padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.li:hover { background: var(--bg3); }
.li.active { background: var(--accent-soft); }
.doc-title { font-size: 24px; font-weight: 700; background: transparent; border: 1px solid transparent; border-radius: 8px; width: 100%; padding: 4px 6px; margin-left: -7px; }
.doc-title:focus { border-color: var(--accent); outline: none; }
.editor { min-height: 360px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; }
.seg { display: inline-flex; background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.seg button { border: none; background: transparent; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-weight: 550; color: var(--text2); }
.seg button.on { background: var(--bg4); color: var(--text); }
.member-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: 12px; color: var(--text3); font-weight: 600; }
.color-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.color-opts button { width: 26px; height: 26px; border-radius: 7px; border: 2px solid transparent; cursor: pointer; }
.color-opts button.on { border-color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; width: 270px; z-index: 120; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; box-shadow: var(--shadow); }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 110; }
  .menu-btn { display: inline-flex; }
  .page { padding: 16px 14px 60px; }
  .phead { padding: 10px 14px 0; } .toolbar { padding: 8px 14px; }
  .board { padding: 12px 14px; }
  .bcol { width: 82vw; }
  .cal { margin: 0 6px 16px; } .cal .day { min-height: 74px; } .cal-item { font-size: 10.5px; padding: 2px 4px; }
  .tl-left { width: 150px; }
  .chat { grid-template-columns: 1fr; } .chans { display: none; }
  .chat-log, .composer { padding-left: 12px; padding-right: 12px; }
  .split { grid-template-columns: 1fr; } .split .sl { max-height: 32vh; border-right: none; border-bottom: 1px solid var(--line); }
  .split .sr { padding: 16px; }
  .props { grid-template-columns: 100px 1fr; }
  .panel-body { padding: 14px 14px 30px; }
  .top .timer-pill .tname { display: none; }
  .view-menu .vgrid { grid-template-columns: 1fr; }
  .hide-m { display: none !important; }
}
