:root, :root[data-theme="black"] {
  --bg-primary: #0f0f10;
  --bg-secondary: #18181b;
  --bg-tertiary: #1f1f23;
  --bg-card: #18181b;
  --bg-card-hover: #1d1d21;
  --border: #27272a;
  --border-light: #2a2a2e;
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --primary: #818cf8;
  --primary-hover: #7c7ff5;
  --primary-light: #1e1b4b;
  --primary-ink: #0f0f10;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f87171;
  --shadow-sm: 0 2px 4px rgba(0,0,0,.15);
  --shadow: 0 4px 12px rgba(0,0,0,.2);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.3);
  --overlay: rgba(0,0,0,.6);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg-primary: #f8f9fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f3f5;
  --bg-card: #ffffff;
  --bg-card-hover: #fbfbfd;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --text-primary: #1a202c;
  --text-secondary: #64748b;
  --text-tertiary: #94a3b8;
  --primary: #6366f1;
  --primary-hover: #5558e3;
  --primary-light: #eef0ff;
  --primary-ink: #ffffff;
  --success: #059669;
  --warning: #d97706;
  --danger: #ef4444;
  --shadow-sm: 0 2px 4px rgba(0,0,0,.04);
  --shadow: 0 4px 12px rgba(0,0,0,.05);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.08);
  --overlay: rgba(15,23,42,.35);
  color-scheme: light;
}
:root {
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --transition: 200ms cubic-bezier(.4,0,.2,1);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', Roboto, Ubuntu, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg-primary); color: var(--text-primary);
  font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; overflow: hidden;
}
#root { flex: 1; min-height: 0; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* header */
.header { background: var(--bg-secondary); border-bottom: 1px solid var(--border); flex: none; }
.header-row { display: flex; align-items: center; gap: 12px; padding: 10px 20px; min-height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.divider { width: 1px; height: 24px; background: var(--border); }
.board-switch { display: flex; align-items: center; gap: 6px; background: none; border: 0; padding: 6px 8px; border-radius: var(--radius-sm); font-weight: 600; color: var(--text-primary); max-width: 260px; }
.board-switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-switch:hover { background: var(--bg-tertiary); }
.spacer { flex: 1; }
.search { display: flex; align-items: center; gap: 6px; background: var(--bg-tertiary); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 10px; height: 36px; width: 240px; color: var(--text-tertiary); }
.search input { border: 0; background: none; outline: none; width: 100%; color: var(--text-primary); }
.search:focus-within { border-color: var(--primary); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-secondary); font-weight: 500; transition: background var(--transition), border-color var(--transition); white-space: nowrap; }
.btn:hover { background: var(--bg-tertiary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--danger); }
.btn.small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.toggle[aria-pressed="true"] { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.icon-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; background: none; border-radius: var(--radius-sm); color: var(--text-secondary); position: relative; }
.icon-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-tertiary); }
.live.on::before { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent); }
.me-chip { display: inline-flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-tertiary); font-weight: 500; }
.me-chip:hover { border-color: var(--primary); }

.stats { display: flex; gap: 20px; padding: 8px 20px; border-top: 1px solid var(--border-light); font-size: 12px; color: var(--text-secondary); overflow-x: auto; white-space: nowrap; }
.stats b { color: var(--text-primary); font-weight: 600; }

/* dropdown */
.dropdown { position: relative; }
.menu { position: absolute; top: calc(100% + 6px); min-width: 220px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 50; }
.menu.right { right: 0; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; border-radius: var(--radius-sm); color: var(--text-primary); }
.menu-item:hover { background: var(--bg-tertiary); }
.menu-item.active { color: var(--primary); font-weight: 600; }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 0; }
.menu-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-tertiary); padding: 6px 10px 4px; }

/* board */
.board { flex: 1; min-height: 0; display: flex; gap: 16px; padding: 20px; overflow: auto; align-items: flex-start; }
.stack { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.lane { display: flex; gap: 16px; align-items: flex-start; overflow-x: auto; padding-bottom: 8px; }
.lane .column { max-height: none; }
.lane .cards { flex: none; } /* max-height is set in render() to fit three cards */
.stack > .lane:first-child { min-height: calc(100vh - 140px); } /* Team lane starts below the fold */
.team-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-tertiary); margin-top: 10px; }
.column { width: 300px; flex: none; max-height: 100%; display: flex; flex-direction: column; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.column.member { background: color-mix(in srgb, var(--col) 6%, var(--bg-secondary)); border-color: color-mix(in srgb, var(--col) 30%, var(--border)); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px 14px; }
.col-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { font-size: 12px; color: var(--text-tertiary); background: var(--bg-tertiary); border-radius: 999px; padding: 1px 8px; }
.col-sub { padding: 0 14px 8px; font-size: 12px; color: var(--text-tertiary); display: flex; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--text-tertiary); }
.cards { flex: 1; overflow-y: auto; padding: 4px 10px 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.cards.drop { background: color-mix(in srgb, var(--primary) 7%, transparent); border-radius: var(--radius); }
.add-task { margin: 0 10px 10px; border: 1px dashed var(--border); background: none; border-radius: var(--radius-sm); padding: 8px; color: var(--text-tertiary); display: flex; align-items: center; justify-content: center; gap: 6px; }
.add-task:hover { color: var(--primary); border-color: var(--primary); }
.add-column { width: 260px; flex: none; border: 1px dashed var(--border); border-radius: var(--radius-lg); background: none; color: var(--text-tertiary); padding: 16px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.add-column:hover { color: var(--primary); border-color: var(--primary); }
.placeholder { height: 4px; border-radius: 2px; background: var(--primary); flex: none; }

.card { flex: none; position: relative; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 12px 10px 14px; box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition); overflow: hidden; }
.card:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); box-shadow: var(--shadow); }
.card.dragging { opacity: .4; }
.card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--stripe, transparent); }
.card-top { display: flex; align-items: flex-start; gap: 8px; }
.card-title { font-weight: 600; flex: 1; word-break: break-word; }
.card-desc { color: var(--text-secondary); font-size: 13px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg-tertiary); color: var(--text-secondary); border: 1px solid var(--border-light); }
.prio { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.prio.high { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.prio.medium { background: color-mix(in srgb, var(--warning) 16%, transparent); color: var(--warning); }
.prio.low { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.metrics { display: flex; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--text-tertiary); }
.metric { display: inline-flex; align-items: center; gap: 4px; }
.metric svg.i { width: 13px; height: 13px; }
.pips { display: inline-flex; gap: 2px; }
.pip { width: 5px; height: 10px; border-radius: 2px; background: var(--border); }
.pip.on { background: var(--text-secondary); }
.bar { height: 4px; background: var(--bg-tertiary); border-radius: 2px; overflow: hidden; margin-top: 10px; }
.bar > div { height: 100%; background: var(--primary); border-radius: 2px; }
.bar.over > div { background: var(--danger); }
.card-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--text-tertiary); }
.card-foot .spacer { flex: 1; }
.reserve-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--border); background: var(--bg-tertiary); color: var(--text-secondary); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 500; }
.reserve-btn:hover { border-color: var(--primary); color: var(--primary); }

.avatar { --c: var(--primary); width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; background: var(--c); color: #fff; flex: none; box-shadow: 0 0 0 1.5px var(--bg-secondary), 0 0 0 2.5px var(--border); text-transform: uppercase; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.avatar.lg { width: 40px; height: 40px; font-size: 15px; }

/* modal */
.overlay { position: fixed; inset: 0; background: var(--overlay); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 100; backdrop-filter: blur(2px); }
.modal { width: 100%; max-width: 920px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal.narrow { max-width: 440px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 17px; flex: 1; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
.title-input { width: 100%; font-size: 20px; font-weight: 700; border: 1px solid transparent; background: none; border-radius: var(--radius-sm); padding: 4px 8px; margin-left: -8px; }
.title-input:hover { border-color: var(--border); }
.title-input:focus { outline: none; border-color: var(--primary); background: var(--bg-primary); }
label.field { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary); margin: 16px 0 6px; }
.input, textarea.input, select.input { width: 100%; border: 1px solid var(--border); background: var(--bg-primary); border-radius: var(--radius-sm); padding: 8px 10px; outline: none; }
.input:focus { border-color: var(--primary); }
textarea.input { resize: vertical; min-height: 90px; }
.row { display: flex; gap: 8px; align-items: center; }
.seg { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { flex: 1; border: 0; background: var(--bg-primary); padding: 6px 0; color: var(--text-secondary); border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); padding: 0; }
.swatch.on { outline: 2px solid var(--primary); outline-offset: 2px; }
.side-box { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.side-box h3 { margin: 0 0 10px; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.muted { color: var(--text-tertiary); font-size: 12px; }
.log { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border-light); font-size: 13px; }
.log:first-child { border-top: 0; }
.log .grow { flex: 1; min-width: 0; }
.x-btn { border: 0; background: none; color: var(--text-tertiary); padding: 2px; border-radius: 4px; line-height: 0; }
.x-btn:hover { color: var(--danger); background: var(--bg-tertiary); }
.comments { margin-top: 24px; }
.comments h3 { font-size: 14px; margin: 0 0 12px; display: flex; align-items: center; gap: 6px; }
.comment { display: flex; gap: 10px; margin-bottom: 14px; }
.comment .bubble { flex: 1; min-width: 0; background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; }
.comment .who { font-size: 12px; color: var(--text-tertiary); display: flex; gap: 8px; align-items: center; }
.comment .who b { color: var(--text-primary); }
.comment .text { white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.empty { color: var(--text-tertiary); font-size: 13px; padding: 4px 0 12px; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.person { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-primary); font-weight: 600; }
.person:hover { border-color: var(--primary); }

.toast-wrap { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; box-shadow: var(--shadow-lg); font-weight: 500; }
.toast.error { border-color: var(--danger); color: var(--danger); }

@media (max-width: 760px) {
  .header-row { flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .search { order: 10; width: 100%; }
  .hide-sm, .me-chip > span:last-child { display: none !important; }
  .me-chip { padding: 3px; }
  .board { padding: 16px; gap: 12px; }
  .column { width: 82vw; }
  .detail { grid-template-columns: 1fr; }
  .overlay { padding: 0; }
  .modal { border-radius: 0; min-height: 100%; border: 0; }
  .stats { padding: 8px 16px; }
}

/* ---------- accounts ---------- */
img.avatar { object-fit: cover; background: var(--bg-tertiary); padding: 0; }
.avatar.ghost { background: var(--bg-tertiary); color: var(--text-secondary); border: 1px dashed var(--text-tertiary); box-shadow: none; }
.avatar.xl { width: 72px; height: 72px; font-size: 26px; }
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 16px; overflow-y: auto; }
.auth-card { width: 100%; max-width: 400px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 28px; }
.auth-card .logo { justify-content: center; font-size: 20px; margin-bottom: 6px; }
.auth-card h1 { font-size: 17px; text-align: center; margin: 0 0 4px; }
.auth-card .sub { text-align: center; color: var(--text-secondary); margin: 0 0 20px; font-size: 13px; }
.auth-card .btn { width: 100%; margin-top: 18px; height: 40px; }
.auth-card .links { display: flex; justify-content: space-between; margin-top: 16px; font-size: 13px; }
.link { background: none; border: 0; padding: 0; color: var(--primary); font-weight: 500; text-decoration: none; }
.link:hover { text-decoration: underline; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 1em; }
.form-ok { color: var(--success); font-size: 13px; margin-top: 10px; }
.hint { color: var(--text-tertiary); font-size: 12px; margin-top: 4px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 8px 20px; background: color-mix(in srgb, var(--warning) 14%, var(--bg-secondary)); color: var(--text-primary); border-bottom: 1px solid color-mix(in srgb, var(--warning) 35%, var(--border)); font-size: 13px; flex: none; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg-tertiary); color: var(--text-secondary); border: 1px solid var(--border); }
.badge.admin { background: var(--primary-light); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.badge.off { color: var(--danger); }
.people-filter { display: inline-flex; align-items: center; gap: 4px; }
.pf { border: 0; background: none; padding: 0; border-radius: 50%; opacity: .55; transition: opacity var(--transition), transform var(--transition); }
.pf:hover { opacity: 1; }
.pf.on { opacity: 1; transform: scale(1.12); }
.pf.on .avatar { box-shadow: 0 0 0 2px var(--bg-secondary), 0 0 0 4px var(--primary); }
.pf-free { font-size: 11px; border: 1px dashed var(--border); border-radius: 999px; padding: 2px 8px; color: var(--text-secondary); opacity: 1; }
.pf-free.on { border-style: solid; border-color: var(--primary); color: var(--primary); transform: none; }
.due { display: inline-flex; align-items: center; gap: 4px; }
.due.late { color: var(--danger); font-weight: 600; }
.due.soon { color: var(--warning); }
.profile-head { display: flex; gap: 16px; align-items: center; }
.profile-head h2 { margin: 0; font-size: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0; }
.stat { background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.stat b { display: block; font-size: 20px; }
.stat span { font-size: 12px; color: var(--text-tertiary); }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-primary); margin-bottom: 8px; width: 100%; text-align: left; color: var(--text-primary); }
button.list-row:hover { border-color: var(--primary); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow > div:first-child { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stripe { width: 4px; align-self: stretch; border-radius: 2px; flex: none; }
.section-title { font-size: 13px; font-weight: 700; margin: 24px 0 10px; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.code-box { display: flex; align-items: center; gap: 8px; background: var(--bg-primary); border: 1px solid var(--primary); border-radius: var(--radius); padding: 12px; margin-top: 12px; }
.code-box code { font-size: 18px; font-weight: 700; letter-spacing: .08em; flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 760px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .banner { padding: 8px 16px; }
}

/* ---------- notifications, mentions, checklist, files, calendar, report ---------- */
.bell-count { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.notif-menu { width: 360px; max-width: calc(100vw - 24px); max-height: 70vh; overflow-y: auto; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 10px 8px; }
.notif { display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px; border: 0; background: none; border-radius: var(--radius-sm); color: var(--text-primary); font-size: 13px; line-height: 1.4; }
.notif:hover { background: var(--bg-tertiary); }
.notif.unread { background: color-mix(in srgb, var(--primary) 9%, transparent); }
.notif .grow { flex: 1; min-width: 0; }
.notif .excerpt { color: var(--text-secondary); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex: none; margin-top: 6px; }
.mention { color: var(--primary); font-weight: 600; background: var(--primary-light); border-radius: 4px; padding: 0 3px; }
.mention-pop { position: absolute; z-index: 20; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 4px; min-width: 200px; }
.mention-pop button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 8px; border: 0; background: none; border-radius: var(--radius-sm); color: var(--text-primary); text-align: left; }
.mention-pop button:hover, .mention-pop button.on { background: var(--bg-tertiary); }
.view-toggle { display: flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; height: 32px; }
.view-toggle button { border: 0; background: var(--bg-secondary); padding: 0 12px; color: var(--text-secondary); font-size: 13px; font-weight: 500; }
.view-toggle button.on { background: var(--primary-light); color: var(--primary); }
.block-title { font-size: 14px; font-weight: 700; margin: 24px 0 10px; display: flex; align-items: center; gap: 6px; }
.check-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--radius-sm); }
.check-row:hover { background: var(--bg-tertiary); }
.check-row input { width: 16px; height: 16px; accent-color: var(--primary); flex: none; }
.check-row span { flex: 1; word-break: break-word; }
.check-row.done span { text-decoration: line-through; color: var(--text-tertiary); }
.check-row .x-btn { opacity: 0; }
.check-row:hover .x-btn { opacity: 1; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.file { position: relative; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-primary); overflow: hidden; display: flex; flex-direction: column; color: var(--text-primary); text-decoration: none; }
.file:hover { border-color: var(--primary); }
.file .thumb { height: 80px; display: flex; align-items: center; justify-content: center; background: var(--bg-tertiary); color: var(--text-tertiary); }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; }
.file .thumb svg.i { width: 28px; height: 28px; }
.file .meta { padding: 6px 8px; font-size: 12px; }
.file .meta div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file .x-btn { position: absolute; top: 4px; right: 4px; background: var(--bg-secondary); }
details.history { margin-top: 24px; border-top: 1px solid var(--border-light); padding-top: 12px; }
details.history summary { cursor: pointer; color: var(--text-tertiary); font-size: 12px; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.history summary::-webkit-details-marker { display: none; }
details.history summary:hover { color: var(--text-secondary); }
.act { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; font-size: 12px; color: var(--text-secondary); }
.act b { color: var(--text-primary); font-weight: 600; }
.act .when { color: var(--text-tertiary); white-space: nowrap; margin-left: auto; padding-left: 8px; }
.calendar { flex: 1; min-width: 720px; display: flex; flex-direction: column; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; align-self: stretch; }
.cal-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.cal-head h2 { margin: 0 8px; font-size: 16px; min-width: 150px; }
.cal-grid { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: auto; grid-auto-rows: minmax(96px, 1fr); overflow-y: auto; }
.cal-dow { padding: 6px 10px; font-size: 11px; font-weight: 700; color: var(--text-tertiary); text-transform: uppercase; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-secondary); z-index: 1; }
.cal-day { border-right: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.other { background: color-mix(in srgb, var(--bg-primary) 60%, transparent); }
.cal-day.other .num { color: var(--text-tertiary); }
.cal-day.today .num { background: var(--primary); color: var(--primary-ink); }
.cal-day.drop { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.cal-day .num { font-size: 12px; font-weight: 600; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.cal-chip { display: flex; align-items: center; gap: 4px; font-size: 12px; padding: 2px 4px 2px 6px; border-radius: 4px; background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--stripe, var(--border)); cursor: pointer; min-width: 0; }
.cal-chip:hover { border-color: var(--primary); }
.cal-chip > span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip.done > span:first-child { text-decoration: line-through; color: var(--text-tertiary); }
.cal-chip.late { border-left-color: var(--danger); }
.cal-chip .avatar { width: 16px; height: 16px; font-size: 8px; box-shadow: none; }
table.report { width: 100%; border-collapse: collapse; font-size: 13px; }
table.report th, table.report td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border-light); vertical-align: top; }
table.report th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-tertiary); }
table.report td.num, table.report th.num { text-align: right; white-space: nowrap; }
.hbar { height: 8px; border-radius: 4px; background: var(--primary); min-width: 2px; }
.check-label { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.check-label input { accent-color: var(--primary); width: 16px; height: 16px; }
.table-wrap { overflow-x: auto; }
@media (max-width: 760px) {
  .view-toggle { order: 9; }
  .calendar { min-width: 640px; }
}

.card .who-name { font-size: 12px; font-weight: 600; color: var(--text-secondary); max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .who { display: inline-flex; align-items: center; gap: 6px; }
