/* TAG Team Pro — one stylesheet, light + dark, phone to desktop. */
:root {
  --brand: #4f46e5;
  --brand-soft: color-mix(in srgb, var(--brand) 12%, transparent);
  --brand-ink: color-mix(in srgb, var(--brand) 80%, #000);
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f1f3f6; --surface-3: #e9ecf1;
  --border: #e3e6eb; --border-strong: #cfd4dc;
  --text: #111827; --muted: #6b7280; --faint: #9ca3af;
  --danger: #dc2626; --danger-soft: #fef2f2; --warn: #d97706; --warn-soft: #fffbeb; --ok: #059669; --ok-soft: #ecfdf5;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / .06);
  --shadow: 0 1px 3px rgb(16 24 40 / .08), 0 1px 2px rgb(16 24 40 / .04);
  --shadow-lg: 0 16px 40px rgb(16 24 40 / .16), 0 4px 10px rgb(16 24 40 / .06);
  --r: 10px; --r-sm: 7px; --r-lg: 14px;
  --sidebar: 256px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1016; --surface: #151922; --surface-2: #1b202b; --surface-3: #242a36;
    --border: #272d39; --border-strong: #353d4c; --text: #e8eaef; --muted: #9aa3b2; --faint: #6b7385;
    --danger: #f87171; --danger-soft: #3a1618; --warn: #fbbf24; --warn-soft: #33270c; --ok: #34d399; --ok-soft: #0f2c22;
    --brand-soft: color-mix(in srgb, var(--brand) 22%, transparent);
    --brand-ink: color-mix(in srgb, var(--brand) 55%, #fff);
    --shadow: 0 1px 3px rgb(0 0 0 / .4); --shadow-lg: 0 16px 40px rgb(0 0 0 / .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1016; --surface: #151922; --surface-2: #1b202b; --surface-3: #242a36;
  --border: #272d39; --border-strong: #353d4c; --text: #e8eaef; --muted: #9aa3b2; --faint: #6b7385;
  --danger: #f87171; --danger-soft: #3a1618; --warn: #fbbf24; --warn-soft: #33270c; --ok: #34d399; --ok-soft: #0f2c22;
  --brand-soft: color-mix(in srgb, var(--brand) 22%, transparent);
  --brand-ink: color-mix(in srgb, var(--brand) 55%, #fff);
  --shadow: 0 1px 3px rgb(0 0 0 / .4); --shadow-lg: 0 16px 40px rgb(0 0 0 / .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.015em; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.xs { font-size: 12px; }
.pad { padding: 16px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.spacer { flex: 1; }
.icon { flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; display: inline-block; }
.dot.lg { width: 12px; height: 12px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
.boot { display: grid; place-items: center; height: 100vh; }
.eyebrow { font-size: 12px; color: var(--muted); font-weight: 550; display: flex; gap: 8px; align-items: center; margin-bottom: 2px; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--surface); font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; text-decoration: none !important; color: var(--text); box-shadow: var(--shadow-sm); }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, #000); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.success { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger.ghost { color: var(--danger); background: transparent; margin-right: auto; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 12px; gap: 4px; }
.btn.block { width: 100%; height: 40px; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; text-decoration: none !important; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn.xs { width: 22px; height: 22px; border-radius: 5px; }
.icon-btn.light { color: #fff; }
.icon-btn.light:hover { background: rgb(255 255 255 / .15); }
.input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; transition: border-color .12s, box-shadow .12s; }
textarea.input { height: auto; padding: 9px 12px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input.sm { height: 32px; font-size: 13px; padding: 0 10px; width: auto; }
select.input { padding-right: 28px; }
.field { display: grid; gap: 6px; }
.field > label { font-weight: 600; font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); }
.form-stack { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.form-actions.left { justify-content: flex-start; }
.toggle-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.toggle-label.sm { font-size: 13px; color: var(--muted); }
.toggle-label input { width: 16px; height: 16px; accent-color: var(--brand); }
.check-list { display: grid; gap: 8px; }
.check-list.cols { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.form-error { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; }
.notice { display: flex; gap: 8px; padding: 12px; border-radius: var(--r-sm); }
.notice.success { background: var(--ok-soft); color: var(--ok); }
kbd { border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; font-size: 11px; color: var(--muted); background: var(--surface); }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 3px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 550; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.chip.xs { height: 20px; font-size: 11px; padding: 0 7px; }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.pri-low { background: var(--surface-3); color: var(--muted); }
.pri-medium { background: #eff6ff; color: #2563eb; }
.pri-high { background: var(--warn-soft); color: var(--warn); }
.pri-urgent { background: var(--danger-soft); color: var(--danger); }
:root[data-theme="dark"] .pri-medium { background: #172554; color: #93c5fd; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pri-medium { background: #172554; color: #93c5fd; } }
.label-chip { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11px; font-weight: 600; color: var(--lc); background: color-mix(in srgb, var(--lc) 14%, transparent); white-space: nowrap; }
.role-owner { background: var(--brand-soft); color: var(--brand-ink); }
.role-admin { background: var(--ok-soft); color: var(--ok); }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.due.overdue { color: var(--danger); font-weight: 600; }
.due.today { color: var(--warn); font-weight: 600; }
.meta-count { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--muted); }
.meta-count.ok { color: var(--ok); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; margin-left: auto; }
.count { color: var(--faint); font-weight: 600; font-size: 12px; margin-left: 6px; }
.mini-count { margin-left: auto; font-size: 11px; font-weight: 700; padding: 0 6px; border-radius: 8px; }
.mini-count.overdue { color: var(--danger); background: var(--danger-soft); }

/* ---------- avatars ---------- */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 650; flex: none; object-fit: cover; letter-spacing: .01em; user-select: none; }
.avatar.empty { background: transparent; border: 1.5px dashed var(--border-strong); width: 22px; height: 22px; }
.avatar.more { background: var(--surface-3); color: var(--muted); width: 28px; height: 28px; font-size: 11px; }
.avatar-wrap { position: relative; display: inline-flex; flex: none; }
.presence { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; border: 2px solid var(--surface); }
.avatar-stack { display: flex; }
.avatar-stack > * { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.avatar-stack > *:first-child { margin-left: 0; }

/* ---------- layout ---------- */
.layout { display: flex; height: 100vh; height: 100dvh; }
.sidebar { width: var(--sidebar); flex: none; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 12px 10px; overflow-y: auto; gap: 6px; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.main { flex: 1; overflow-y: auto; outline: none; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 8px; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; }
.brand-mark.lg { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; }
.brand-logo { width: 30px; height: 30px; border-radius: 8px; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 15px; flex: 1; }
.close-nav { display: none; }
.search-trigger { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--r-sm); color: var(--muted); cursor: pointer; margin: 0 2px 6px; }
.search-trigger span { flex: 1; text-align: left; }
.search-trigger:hover { border-color: var(--border-strong); }
.nav-main { display: grid; gap: 1px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r-sm); color: var(--text); font-weight: 520; text-decoration: none !important; }
.nav-item .icon { color: var(--muted); }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 620; }
.nav-item.active .icon { color: var(--brand-ink); }
.nav-item.project { height: 30px; font-size: 13px; gap: 9px; padding-left: 28px; }
.nav-section { margin-top: 14px; display: grid; gap: 2px; }
.nav-section-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 10px; font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.nav-team-head { display: flex; align-items: center; justify-content: space-between; padding-right: 4px; }
.nav-team-head .icon-btn { opacity: 0; }
.nav-team-head:hover .icon-btn, .nav-team-head .icon-btn:focus-visible { opacity: 1; }
.nav-team-toggle { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border: 0; background: none; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text); border-radius: 6px; flex: 1; text-align: left; }
.nav-team-toggle .icon { color: var(--faint); }
.nav-empty { border: 0; background: none; color: var(--faint); font-size: 12px; padding: 4px 0 4px 30px; cursor: pointer; text-align: left; }
.nav-empty:hover { color: var(--brand-ink); }
.nav-hint { font-size: 12px; color: var(--muted); padding: 4px 10px; }
.sidebar-foot { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.me-button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; background: none; border-radius: var(--r-sm); cursor: pointer; text-align: left; color: var(--muted); }
.me-button:hover { background: var(--surface-2); }
.me-text { flex: 1; display: grid; min-width: 0; }
.me-name { font-weight: 600; color: var(--text); }
.mobile-bar { display: none; }
.scrim { display: none; }

.page { max-width: 1180px; margin: 0 auto; padding: 28px 32px 64px; }
.page.narrow { max-width: 820px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .muted { margin-top: 4px; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); padding: 18px 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.link-sm { font-size: 13px; font-weight: 550; }
.section { margin-top: 28px; }
.section-head { margin-bottom: 12px; }
.empty-page { display: grid; place-items: center; gap: 12px; min-height: 60vh; text-align: center; padding: 24px; }

/* ---------- home ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; display: grid; gap: 2px; }
.stat-n { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 550; }
.stat.danger .stat-n { color: var(--danger); }
.stat.warn .stat-n { color: var(--warn); }
.stat.ok .stat-n { color: var(--ok); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.task-group + .task-group { margin-top: 6px; }
.group-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 4px 4px; }
.card.flush .group-title { padding: 14px 18px 6px; }
.group-title.danger { color: var(--danger); }
.task-row { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-radius: var(--r-sm); cursor: pointer; min-height: 42px; }
.card.flush .task-row { padding: 8px 18px; border-radius: 0; border-top: 1px solid var(--border); }
.task-row:hover { background: var(--surface-2); }
.task-row-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 520; }
.task-row.done .task-row-title { color: var(--muted); text-decoration: line-through; }
.task-row-meta { display: flex; align-items: center; gap: 10px; flex: none; }
.proj-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); max-width: 160px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; cursor: pointer; flex: none; color: transparent; padding: 0; transition: all .15s var(--ease); }
.check:hover { border-color: var(--ok); color: var(--ok); }
.check.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.project-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; display: grid; gap: 14px; color: var(--text); text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s var(--ease); }
.project-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.pc-top { display: flex; gap: 12px; align-items: center; min-width: 0; }
.pc-text { display: grid; min-width: 0; }
.pc-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 750; flex: none; }
.pc-icon.lg { width: 46px; height: 46px; border-radius: 12px; font-size: 20px; }
.pc-foot { display: flex; justify-content: space-between; align-items: center; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.progress.sm { height: 4px; }
.progress span { display: block; height: 100%; background: var(--brand); border-radius: 3px; transition: width .3s var(--ease); }
.activity-list { display: grid; gap: 2px; }
.activity-item { display: flex; gap: 10px; padding: 8px 0; align-items: flex-start; }
.activity-item + .activity-item { border-top: 1px solid var(--border); }
.activity-text { min-width: 0; font-size: 13px; }
.empty { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 36px 20px; }
.empty-icon { width: 46px; height: 46px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-ink); display: grid; place-items: center; margin-bottom: 4px; }
.empty .btn { margin-top: 8px; }
.empty p { max-width: 380px; }
.skeleton-list { display: grid; gap: 10px; padding: 14px; }
.skeleton { height: 36px; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skeleton.short { width: 60%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- project ---------- */
.project-page { max-width: none; padding-bottom: 24px; display: flex; flex-direction: column; min-height: 100%; }
.project-head { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.ph-left { display: flex; gap: 14px; align-items: center; min-width: 0; }
.ph-text { min-width: 0; }
.ph-desc { margin-top: 2px; max-width: 720px; }
.ph-right { display: flex; align-items: center; gap: 16px; }
.ph-progress { display: grid; gap: 4px; width: 120px; justify-items: end; }
.ph-progress .progress { width: 100%; }
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-filters { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
.search-input { width: 180px; }
.segmented { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border: 0; background: none; border-radius: 7px; font-weight: 560; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.project-body { flex: 1; min-height: 0; }

.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 16px; min-height: 60vh; scroll-snap-type: x proximity; }
.board-col { width: 300px; flex: none; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; max-height: calc(100vh - 220px); scroll-snap-align: start; }
.board-col.is-done { background: color-mix(in srgb, var(--ok) 6%, var(--surface-2)); }
.col-head { display: flex; align-items: center; gap: 2px; padding: 10px 8px 6px 14px; }
.col-head h2 { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
.col-done-icon { color: var(--ok); }
.col-cards { display: flex; flex-direction: column; gap: 8px; padding: 4px 8px 4px; overflow-y: auto; min-height: 40px; }
.col-add { display: flex; align-items: center; gap: 6px; margin: 4px 8px 8px; padding: 8px; border: 0; border-radius: var(--r-sm); background: none; color: var(--muted); cursor: pointer; font-weight: 550; font-size: 13px; }
.col-add:hover { background: var(--surface-3); color: var(--text); }
.board-add-col { flex: none; width: 220px; height: 46px; display: flex; align-items: center; justify-content: center; gap: 6px; border: 1.5px dashed var(--border-strong); border-radius: var(--r-lg); background: none; color: var(--muted); cursor: pointer; font-weight: 550; }
.board-add-col:hover { color: var(--text); border-color: var(--muted); }
.card-task { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; box-shadow: var(--shadow-sm); cursor: pointer; display: grid; gap: 8px; transition: box-shadow .15s, border-color .15s, transform .15s var(--ease); position: relative; overflow: hidden; }
.card-task:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.card-task.dragging { opacity: .4; transform: rotate(1deg); }
.card-task.done .card-title { color: var(--muted); text-decoration: line-through; }
.card-task.pri-edge-urgent { box-shadow: inset 3px 0 0 var(--danger), var(--shadow-sm); }
.card-task.pri-edge-high { box-shadow: inset 3px 0 0 var(--warn), var(--shadow-sm); }
.card-cover { margin: -10px -12px 0; height: 120px; background: var(--surface-3); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-labels { display: flex; gap: 4px; flex-wrap: wrap; }
.card-title-row { display: flex; gap: 8px; align-items: flex-start; }
.card-title-row .check { margin-top: 1px; width: 18px; height: 18px; }
.card-title { font-weight: 540; line-height: 1.4; word-break: break-word; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 22px; }
.card-meta:empty { display: none; }
.drop-marker { height: 3px; border-radius: 2px; background: var(--brand); margin: -2px 2px; flex: none; }
.inline-add { background: var(--surface); border: 1px solid var(--brand); border-radius: var(--r); padding: 8px; display: grid; gap: 8px; box-shadow: 0 0 0 3px var(--brand-soft); }
.inline-input { border: 0 !important; box-shadow: none !important; padding: 2px 4px; resize: none; }
.inline-actions { display: flex; gap: 6px; }

.list-view { overflow-x: auto; }
.list-row { display: grid; grid-template-columns: minmax(260px, 1fr) 180px 120px 110px; gap: 12px; align-items: center; padding: 8px 18px; border-top: 1px solid var(--border); cursor: pointer; min-height: 44px; min-width: 700px; }
.list-row:hover { background: var(--surface-2); }
.list-row.head { cursor: default; font-size: 12px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-top: 0; min-height: 38px; }
.list-row.head:hover { background: none; }
.list-row.done .lc-title > .truncate { color: var(--muted); text-decoration: line-through; }
.lc-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lc-labels { display: flex; gap: 4px; }
.lc-who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.list-group-head { padding: 14px 18px 8px; border-top: 1px solid var(--border); background: var(--surface-2); }
.list-group-head h2 { font-size: 13px; }
.list-add { display: flex; align-items: center; gap: 6px; padding: 10px 18px 10px 48px; border: 0; border-top: 1px solid var(--border); background: none; width: 100%; color: var(--muted); cursor: pointer; font-size: 13px; text-align: left; }
.list-add:hover { color: var(--text); background: var(--surface-2); }
.list-rows .inline-add { margin: 8px 18px; }

.calendar-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 14px; align-items: start; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; }
.cal-nav { display: flex; gap: 4px; align-items: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-grid.names { border-top: 1px solid var(--border); }
.cal-name { padding: 6px 8px; font-size: 11px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.cal-cell { min-height: 112px; border-top: 1px solid var(--border); border-left: 1px solid var(--border); padding: 4px; display: flex; flex-direction: column; gap: 3px; min-width: 0; transition: background .12s; }
.cal-cell:nth-child(7n+1) { border-left: 0; }
.cal-cell.other { background: var(--surface-2); }
.cal-cell.other .cal-day span { color: var(--faint); }
.cal-cell.drop { background: var(--brand-soft); }
.cal-day { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 4px; }
.cal-cell.today .cal-day span { background: var(--brand); color: #fff; border-radius: 10px; padding: 0 7px; }
.cal-add { opacity: 0; }
.cal-cell:hover .cal-add, .cal-add:focus-visible { opacity: 1; }
.cal-task { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--pc); background: var(--surface-2); border-radius: 4px; padding: 3px 6px; font-size: 12px; font-weight: 520; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-cell.other .cal-task { background: var(--surface-3); }
.cal-task:hover { background: var(--surface-3); }
.cal-task.done { text-decoration: line-through; color: var(--muted); }
.cal-more { border: 0; background: none; font-size: 11px; color: var(--muted); cursor: pointer; text-align: left; padding: 0 6px; }
.cal-side { position: sticky; top: 0; display: grid; gap: 8px; }
.cal-undated { display: grid; gap: 4px; max-height: 60vh; overflow-y: auto; }

/* ---------- drawer (task detail) ---------- */
.drawer { position: fixed; inset: 0; z-index: 40; background: rgb(15 23 42 / .28); display: flex; justify-content: flex-end; animation: fade .15s; }
.drawer.out { animation: fadeout .18s forwards; }
.drawer.out .drawer-panel { animation: slideout .18s forwards; }
.drawer-panel { width: min(680px, 100%); height: 100%; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slidein .22s var(--ease); position: relative; }
.drawer-panel.dropping::after { content: "Drop to attach"; position: absolute; inset: 10px; border: 2px dashed var(--brand); border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 85%, transparent); display: grid; place-items: center; font-weight: 650; color: var(--brand-ink); pointer-events: none; }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
@keyframes slideout { to { transform: translateX(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
.drawer-loading { padding: 24px; display: grid; gap: 12px; }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.crumb { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); max-width: 220px; }
.drawer-scroll { flex: 1; overflow-y: auto; padding: 18px 26px 24px; }
.task-title { width: 100%; border: 1px solid transparent; border-radius: var(--r-sm); background: none; font: 700 22px/1.3 var(--font); letter-spacing: -.01em; color: var(--text); padding: 4px 8px; margin: 0 -8px 10px; resize: none; overflow: hidden; }
.task-title:hover { border-color: var(--border); }
.task-title:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.props { display: grid; gap: 2px; margin-bottom: 18px; }
.prop { display: grid; grid-template-columns: 120px 1fr; align-items: center; min-height: 38px; }
.prop-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.prop-value { min-width: 0; }
.prop-input { height: 32px; border: 1px solid transparent; background: none; border-radius: var(--r-sm); padding: 0 8px; font: inherit; color: var(--text); cursor: pointer; max-width: 100%; }
.prop-input:hover { background: var(--surface-2); }
.prop-input:focus { outline: none; border-color: var(--brand); }
.pri-text-high { color: var(--warn); font-weight: 600; } .pri-text-urgent { color: var(--danger); font-weight: 600; } .pri-text-medium { color: #2563eb; font-weight: 600; }
.with-avatar { display: flex; align-items: center; gap: 4px; padding-left: 6px; }
.prop-labels { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-left: 8px; }
.task-section { border-top: 1px solid var(--border); padding: 16px 0; display: grid; gap: 10px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section-title h3 { font-size: 13px; }
.notes { width: 100%; min-height: 80px; border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; font: inherit; line-height: 1.6; background: var(--surface); color: var(--text); resize: none; overflow: hidden; }
.notes:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.subtasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.subtasks li { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 6px; }
.subtasks li:hover { background: var(--surface-2); }
.subtasks li input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--ok); flex: none; }
.sub-title { flex: 1; border: 0; background: none; font: inherit; color: var(--text); padding: 4px; border-radius: 4px; }
.sub-title:focus { outline: none; background: var(--surface); box-shadow: 0 0 0 2px var(--brand-soft); }
.subtasks li.done .sub-title { color: var(--muted); text-decoration: line-through; }
.subtasks li .icon-btn { opacity: 0; }
.subtasks li:hover .icon-btn, .subtasks li .icon-btn:focus-visible { opacity: 1; }
.dropzone { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 18px; border: 1.5px dashed var(--border-strong); border-radius: var(--r); background: none; color: var(--muted); cursor: pointer; }
.dropzone:hover { border-color: var(--brand); color: var(--brand-ink); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.file-grid.sm { grid-template-columns: repeat(auto-fill, minmax(130px, 180px)); margin-top: 6px; }
.file-tile { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); position: relative; display: flex; align-items: center; }
.file-tile.image { flex-direction: column; align-items: stretch; }
.thumb { border: 0; padding: 0; background: var(--surface-3); height: 100px; cursor: zoom-in; display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.file-cap { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 8px; font-size: 12px; }
.file-link { display: flex; align-items: center; gap: 10px; padding: 10px; flex: 1; min-width: 0; color: var(--text); text-decoration: none !important; }
.file-ext { width: 36px; height: 36px; border-radius: 7px; background: var(--brand-soft); color: var(--brand-ink); font-size: 10px; font-weight: 750; display: grid; place-items: center; flex: none; }
.file-info { display: grid; min-width: 0; font-size: 13px; }
.file-del { margin-left: auto; flex: none; margin-right: 4px; }
.upload-progress { display: grid; gap: 6px; }
.upload-item { display: grid; gap: 4px; font-size: 12px; }
.timeline { display: grid; gap: 12px; }
.tl-activity { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding-left: 10px; flex-wrap: wrap; }
.tl-activity strong { color: var(--text); font-weight: 600; }
.tl-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.comment { display: flex; gap: 10px; }
.comment-body { flex: 1; min-width: 0; background: var(--surface-2); border-radius: var(--r); padding: 8px 12px; }
.comment-head { display: flex; align-items: center; gap: 8px; }
.comment-del { margin-left: auto; opacity: 0; }
.comment:hover .comment-del, .comment-del:focus-visible { opacity: 1; }
.comment-text, .msg-text { line-height: 1.55; word-wrap: break-word; overflow-wrap: anywhere; }
.mention { color: var(--brand-ink); background: var(--brand-soft); border-radius: 4px; padding: 0 3px; font-weight: 600; }

/* composer */
.composer { border-top: 1px solid var(--border); padding: 10px 14px 8px; background: var(--surface); position: relative; }
.composer-row { display: flex; align-items: flex-end; gap: 6px; border: 1px solid var(--border-strong); border-radius: var(--r); padding: 4px; background: var(--surface); }
.composer-row:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.composer-input { flex: 1; border: 0; resize: none; font: inherit; padding: 7px 4px; background: none; color: var(--text); max-height: 200px; min-height: 34px; }
.composer-input:focus { outline: none; }
.composer-hint { margin-top: 4px; padding-left: 2px; }
.composer-files { display: flex; flex-wrap: wrap; gap: 6px; }
.composer-files:not(:empty) { margin-bottom: 6px; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 220px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 2px 2px 2px 8px; font-size: 12px; }
.file-chip.uploading { opacity: .6; }
.mention-menu { position: absolute; bottom: calc(100% - 4px); left: 50px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 4px; min-width: 220px; z-index: 5; }

/* ---------- messages ---------- */
.chat { display: grid; grid-template-columns: 300px minmax(0, 1fr); height: 100%; }
.chat-list { border-right: 1px solid var(--border); background: var(--surface); overflow-y: auto; padding: 16px 10px; }
.chat-list-head { display: flex; justify-content: space-between; align-items: center; padding: 0 6px 12px; }
.chat-list-head h1 { font-size: 20px; }
.chat-group { margin-bottom: 14px; display: grid; gap: 1px; }
.chat-group-title { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 4px 8px; }
.chat-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); color: var(--text); text-decoration: none !important; }
.chat-item:hover { background: var(--surface-2); }
.chat-item.active { background: var(--brand-soft); }
.chat-item.unread strong { font-weight: 750; }
.chat-item-text { flex: 1; display: grid; min-width: 0; }
.chat-item-top { display: flex; justify-content: space-between; gap: 6px; }
.chan-icon { width: 32px; height: 32px; border-radius: 9px; color: #fff; display: grid; place-items: center; flex: none; font-weight: 700; }
.chat-pane { display: flex; flex-direction: column; min-height: 0; height: 100%; background: var(--surface); }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.chat-head .back { display: none; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; }
.chat-empty { margin: auto; }
.load-older { align-self: center; margin-bottom: 8px; }
.day-sep { display: flex; align-items: center; gap: 12px; margin: 14px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.day-sep::before, .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.msg { display: flex; gap: 10px; padding: 4px 8px; margin: 0 -8px; border-radius: 8px; position: relative; }
.msg:not(.grouped) { margin-top: 8px; }
.msg:hover { background: var(--surface-2); }
.msg-body { flex: 1; min-width: 0; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-time-side { width: 34px; flex: none; text-align: right; opacity: 0; font-size: 10px; padding-top: 3px; }
.msg:hover .msg-time-side { opacity: 1; }
.msg-del { position: absolute; right: 8px; top: 4px; opacity: 0; }
.msg:hover .msg-del, .msg-del:focus-visible { opacity: 1; }
.msg-deleted { font-style: italic; }

/* ---------- inbox ---------- */
.notif { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 18px; border: 0; border-top: 1px solid var(--border); background: none; text-align: left; cursor: pointer; }
.notif:first-child { border-top: 0; }
.notif:hover { background: var(--surface-2); }
.notif.unread { background: color-mix(in srgb, var(--brand) 4%, var(--surface)); }
.notif.unread .notif-text > span:first-child { font-weight: 620; }
.notif-avatar { position: relative; flex: none; }
.notif-kind { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--brand); border: 2px solid var(--surface); }
.notif-kind.k-completed { background: var(--ok); }
.notif-kind.k-mention { background: #ec4899; }
.notif-kind.k-comment { background: #0ea5e9; }
.notif-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }

/* ---------- settings ---------- */
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { display: grid; gap: 2px; position: sticky; top: 0; }
.settings-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text); font-weight: 520; text-decoration: none !important; }
.settings-link .icon { color: var(--muted); }
.settings-link:hover { background: var(--surface-3); }
.settings-link.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 620; }
.settings-content { display: grid; gap: 16px; min-width: 0; }
.settings-card { display: grid; gap: 14px; }
.settings-card > h2 { font-size: 16px; }
.settings-card > p.muted { margin-top: -8px; }
.avatar-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-preview { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; border: 1px solid var(--border); }
.color-input { width: 48px; height: 36px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 2px; background: var(--surface); cursor: pointer; }
.people-list { display: grid; }
.person-row { display: grid; grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.person-row:first-child { border-top: 0; }
.person-row.disabled { opacity: .55; }
.person-text { display: grid; min-width: 0; }
.invite-link { display: grid; grid-template-columns: 160px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.invite-link code, .secret code, .kv code { background: var(--surface-2); border: 1px solid var(--border); padding: 6px 8px; border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; min-width: 0; }
.secret { display: flex; gap: 8px; align-items: center; }
.secret code { flex: 1; user-select: all; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.integration-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.int-tile { border: 1px solid var(--border); border-radius: var(--r); padding: 14px; display: grid; gap: 6px; background: var(--surface-2); }
.int-tile .icon { color: var(--brand-ink); }
.code-example summary { cursor: pointer; font-weight: 600; font-size: 13px; color: var(--brand-ink); }
.code-example pre { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: var(--r); overflow-x: auto; margin: 10px 0 0; line-height: 1.5; }
.label-manager { display: grid; gap: 6px; margin-bottom: 10px; }
.label-row { display: flex; gap: 8px; align-items: center; }
.label-row input[type=color] { width: 32px; height: 32px; border: 1px solid var(--border); border-radius: 6px; padding: 2px; background: none; }
.label-row .input { flex: 1; }
.color-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--text); }
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.template { display: grid; gap: 4px; text-align: left; border: 1.5px solid var(--border); border-radius: var(--r); padding: 12px; background: var(--surface); cursor: pointer; }
.template:hover { border-color: var(--border-strong); }
.template.on { border-color: var(--brand); background: var(--brand-soft); }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgb(15 23 42 / .4); display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.overlay.out { animation: fadeout .15s forwards; }
.modal { width: min(460px, 100%); max-height: calc(100vh - 32px); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .18s var(--ease); }
.modal.wide { width: min(640px, 100%); }
@keyframes pop { from { transform: scale(.97) translateY(6px); opacity: 0; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 8px 20px; }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 8px 20px 16px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.popover { position: fixed; z-index: 80; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 4px; min-width: 200px; max-height: 70vh; overflow-y: auto; animation: pop .12s var(--ease); display: grid; gap: 1px; }
.popover > .input { margin: 4px; width: calc(100% - 8px); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; font-size: 13px; color: var(--text); }
.menu-item .icon { color: var(--muted); }
.menu-item:hover, .menu-item.active { background: var(--surface-2); }
.menu-item.danger, .menu-item.danger .icon { color: var(--danger); }
.menu-check { margin-left: auto; color: var(--brand-ink) !important; }
.check-item input { accent-color: var(--brand); }
.menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
.menu-label { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 6px 10px 2px; }
.person-results { display: grid; gap: 1px; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #111827; color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 520; animation: toastin .22s var(--ease); max-width: calc(100vw - 32px); }
.toast.error { background: #b91c1c; }
.toast.success::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #34d399; flex: none; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .3s; }
.toast-action { border: 0; background: rgb(255 255 255 / .15); color: #fff; border-radius: 6px; padding: 3px 9px; cursor: pointer; font-weight: 650; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgb(0 0 0 / .88); display: grid; place-items: center; padding: 56px 16px 16px; animation: fade .15s; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 80px); object-fit: contain; border-radius: 6px; cursor: zoom-out; }
.lb-bar { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 10px; padding: 10px 14px; color: #fff; }
.lb-bar > span { flex: 1; }
.palette-overlay { place-items: start center; padding-top: 12vh; }
.palette { width: min(600px, 100%); background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .15s var(--ease); }
.palette-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.palette-input { flex: 1; border: 0; background: none; font: inherit; font-size: 16px; color: var(--text); }
.palette-input:focus { outline: none; }
.palette-results { max-height: 55vh; overflow-y: auto; padding: 6px; }
.palette-group { font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; padding: 8px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 7px; cursor: pointer; text-align: left; color: var(--text); }
.palette-item .icon { color: var(--muted); }
.palette-item.active { background: var(--brand-soft); }
.pi-text { display: grid; min-width: 0; }

/* ---------- auth ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 16px; padding: 24px 16px; background: radial-gradient(1200px 500px at 50% -10%, var(--brand-soft), transparent), var(--bg); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; box-shadow: var(--shadow-lg); display: grid; gap: 14px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.auth-logo { height: 44px; max-width: 180px; object-fit: contain; }
.auth-ws { font-weight: 700; font-size: 17px; }
.auth-card h1 { font-size: 22px; }
.auth-form { display: grid; gap: 14px; margin-top: 4px; }
.auth-alt { display: grid; gap: 12px; justify-items: center; font-size: 13px; margin-top: 4px; }
.auth-alt .btn { width: 100%; }

/* ---------- phones & tablets ---------- */
@media (max-width: 1000px) {
  .home-grid { grid-template-columns: 1fr; }
  .calendar-wrap { grid-template-columns: 1fr; }
  .cal-side { position: static; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; z-index: 50; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s var(--ease); box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgb(15 23 42 / .35); }
  .close-nav { display: inline-grid; }
  .nav-team-head .icon-btn { opacity: 1; }
  .mobile-bar { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 8px; background: var(--surface); border-bottom: 1px solid var(--border); flex: none; padding-top: env(safe-area-inset-top); }
  .mobile-title { flex: 1; font-weight: 700; text-align: center; }
  .page { padding: 18px 16px 48px; }
  h1 { font-size: 21px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .task-row-meta .proj-chip, .task-row-meta .meta-count { display: none; }
  .board { margin: 0 -16px; padding: 0 16px 16px; scroll-snap-type: x mandatory; }
  .board-col { width: 84vw; max-height: none; }
  .toolbar { gap: 8px; }
  .toolbar-filters { order: 3; flex-basis: 100%; }
  .search-input { flex: 1; width: auto; min-width: 0; }
  .ph-progress, .avatar-stack { display: none; }
  .cal-cell { min-height: 74px; }
  .cal-task { font-size: 10px; padding: 2px 4px; }
  .cal-name { font-size: 10px; padding: 4px; }
  .chat { grid-template-columns: 1fr; }
  .chat.has-active .chat-list { display: none; }
  .chat:not(.has-active) .chat-pane { display: none; }
  .chat-head .back { display: inline-grid; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .settings-link { white-space: nowrap; }
  .person-row { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .person-row .person-teams, .person-row .avatar-stack { display: none; }
  .invite-link, .kv { grid-template-columns: 1fr; }
  .drawer-scroll { padding: 14px 16px 20px; }
  .prop { grid-template-columns: 100px 1fr; }
  .modal { max-height: calc(100dvh - 32px); }
  .composer-hint { display: none; }
  .msg-del, .comment-del, .subtasks li .icon-btn { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
