/* Team Tasks — layout and look. Light and dark themes share the tokens below. */

:root {
  color-scheme: light;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-hover: #f2f3f5;
  --bg-active: #e9ebef;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --col-bg: #f3f4f6;
  --line: #e7e8eb;
  --line-strong: #d3d6dc;
  --text: #1e1f21;
  --text-2: #4a4f57;
  --muted: #696d76;
  --faint: #a1a5ad;
  --accent: #4f6bed;
  --accent-hover: #3d58d8;
  --accent-soft: #eef1fe;
  --accent-line: #c9d2fb;
  --create: #f06a5f;
  --ok: #1f9d6b;
  --ok-soft: #e3f5ec;
  --soon: #187c55;
  --danger: #c13e37;
  --danger-soft: #fdeceb;
  --warn-soft: #fff6e0;
  --side-bg: #1e1f21;
  --side-text: #e6e7e9;
  --side-muted: #9da1a8;
  --side-hover: rgba(255, 255, 255, .07);
  --side-active: rgba(255, 255, 255, .13);
  --side-line: rgba(255, 255, 255, .08);
  --pri-high-bg: #fde4e2; --pri-high: #b4232c;
  --pri-medium-bg: #fff0cc; --pri-medium: #8f5a00;
  --pri-low-bg: #dcf2ff; --pri-low: #0f6593;
  --pri-high-dot: #e5484d; --pri-medium-dot: #f0a92e; --pri-low-dot: #3b9fd8;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 4px 12px rgba(16, 24, 40, .08), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, .18), 0 4px 12px rgba(16, 24, 40, .08);
  --focus: 0 0 0 3px rgba(79, 107, 237, .3);
  --side-w: 252px;
  --panel-w: min(560px, 42vw);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1e1f21; --bg-soft: #191a1c; --bg-hover: #2a2b2e; --bg-active: #33353a;
    --surface: #252629; --surface-2: #222326; --col-bg: #232427;
    --line: #34363b; --line-strong: #464950;
    --text: #f1f2f4; --text-2: #c8cbd0; --muted: #9a9fa7; --faint: #6c7179;
    --accent: #7088f6; --accent-hover: #8a9ef8; --accent-soft: rgba(112, 136, 246, .16); --accent-line: rgba(112, 136, 246, .45);
    --ok: #47c48e; --ok-soft: rgba(71, 196, 142, .15); --soon: #47c48e;
    --danger: #f0716a; --danger-soft: rgba(240, 113, 106, .14); --warn-soft: rgba(240, 169, 46, .12);
    --side-bg: #151618; --side-line: rgba(255, 255, 255, .07);
    --pri-high-bg: rgba(229, 72, 77, .2); --pri-high: #ff9b9b;
    --pri-medium-bg: rgba(240, 169, 46, .2); --pri-medium: #f5c36b;
    --pri-low-bg: rgba(59, 159, 216, .2); --pri-low: #8ccdf3;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, .35);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, .5), 0 4px 12px rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1e1f21; --bg-soft: #191a1c; --bg-hover: #2a2b2e; --bg-active: #33353a;
  --surface: #252629; --surface-2: #222326; --col-bg: #232427;
  --line: #34363b; --line-strong: #464950;
  --text: #f1f2f4; --text-2: #c8cbd0; --muted: #9a9fa7; --faint: #6c7179;
  --accent: #7088f6; --accent-hover: #8a9ef8; --accent-soft: rgba(112, 136, 246, .16); --accent-line: rgba(112, 136, 246, .45);
  --ok: #47c48e; --ok-soft: rgba(71, 196, 142, .15); --soon: #47c48e;
  --danger: #f0716a; --danger-soft: rgba(240, 113, 106, .14); --warn-soft: rgba(240, 169, 46, .12);
  --side-bg: #151618; --side-line: rgba(255, 255, 255, .07);
  --pri-high-bg: rgba(229, 72, 77, .2); --pri-high: #ff9b9b;
  --pri-medium-bg: rgba(240, 169, 46, .2); --pri-medium: #f5c36b;
  --pri-low-bg: rgba(59, 159, 216, .2); --pri-low: #8ccdf3;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, .35);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, .5), 0 4px 12px rgba(0, 0, 0, .3);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; font: 400 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
#root { height: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
input, textarea, select { min-width: 0; }
a { color: var(--accent); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--bg-hover); padding: 1px 5px; border-radius: 4px; }
kbd { display: inline-block; min-width: 20px; padding: 1px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px; font: 500 11.5px/16px var(--font); color: var(--text-2); background: var(--surface); text-align: center; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
.ic { width: 18px; height: 18px; flex: none; display: block; }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--muted); }
.sm { font-size: 13px; }
.xs { font-size: 12px; }
p { margin: 0; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none; transition: background-color .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--bg-hover); }
.btn:active { transform: translateY(.5px); }
.btn .ic { width: 16px; height: 16px; }
.btn.primary { background: var(--accent-solid, var(--accent)); border-color: var(--accent-solid, var(--accent)); color: #fff; }
.btn.primary:hover { background: var(--accent-solid-hover, var(--accent-hover)); border-color: var(--accent-solid-hover, var(--accent-hover)); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(.95); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn.active { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.btn.danger-ghost { border-color: transparent; background: var(--danger-soft); color: var(--danger); }
.btn.danger-text { color: var(--danger); }
.btn.lg { height: 42px; font-size: 15px; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.xs { height: 26px; padding: 0 8px; font-size: 12.5px; border-radius: 6px; gap: 4px; }
.btn.xs .ic { width: 14px; height: 14px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.icon-btn { width: 32px; height: 32px; display: inline-grid; place-items: center; flex: none; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); transition: background-color .12s, color .12s, opacity .12s; }
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.xs { width: 24px; height: 24px; border-radius: 6px; }
.icon-btn.xs .ic { width: 16px; height: 16px; }
.icon-btn.starred { color: #e8a317; }
.link { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.link.sm { font-size: 13px; }
.link-plain { border: 0; background: none; padding: 0; text-align: left; color: inherit; font: inherit; max-width: 100%; }
.link-plain:hover { text-decoration: underline; }

/* ---------- Inputs ---------- */
.inp, .fld input, .fld select, .fld textarea { height: 38px; width: 100%; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text); font-size: 14px; transition: border-color .12s, box-shadow .12s; }
.inp.sm { height: 32px; width: auto; padding: 0 8px; font-size: 13.5px; border-radius: 6px; }
.inp:hover, .fld input:hover, .fld select:hover, .fld textarea:hover { border-color: var(--faint); }
.inp:focus, .fld input:focus, .fld select:focus, .fld textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.fld textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span, .fld-label { font-weight: 500; font-size: 13px; color: var(--text-2); }
.chk { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.seg { display: inline-flex; align-self: flex-start; gap: 2px; padding: 3px; border-radius: 9px; background: var(--bg-hover); }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 6px 14px; border-radius: 7px; font-weight: 500; font-size: 13px; color: var(--text-2); }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.sws { display: flex; flex-wrap: wrap; gap: 8px; }
.sw { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: var(--c, #888); transition: transform .1s; }
.sw:hover { transform: scale(1.08); }
.sw.on, .sw[aria-checked="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--c, #888); }

/* ---------- Avatars, dots, pills ---------- */
.av { --c: #8a8f98; width: 26px; height: 26px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: var(--c); color: #fff; font-weight: 600; font-size: 10.5px; letter-spacing: .02em; line-height: 1; user-select: none; }
.av-xs { width: 18px; height: 18px; font-size: 8px; }
.av-sm { width: 22px; height: 22px; font-size: 9px; }
.av-lg { width: 36px; height: 36px; font-size: 13px; }
.av-more { background: var(--bg-active); color: var(--text-2); }
.av-empty { background: transparent; border: 1px dashed var(--faint); color: var(--faint); }
.av-empty .ic { width: 11px; height: 11px; }
.avs { display: inline-flex; align-items: center; }
.avs .av + .av { margin-left: -6px; box-shadow: 0 0 0 2px var(--bg); }
.pdot { width: 10px; height: 10px; flex: none; border-radius: 3px; background: var(--c, #888); }
.pri { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; font-weight: 500; font-size: 12px; white-space: nowrap; }
.pri-high { background: var(--pri-high-bg); color: var(--pri-high); }
.pri-medium { background: var(--pri-medium-bg); color: var(--pri-medium); }
.pri-low { background: var(--pri-low-bg); color: var(--pri-low); }
.pri-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--faint); }
.pri-dot.pri-high { background: var(--pri-high-dot); }
.pri-dot.pri-medium { background: var(--pri-medium-dot); }
.pri-dot.pri-low { background: var(--pri-low-dot); }
.due { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.due.overdue { color: var(--danger); }
.due.soon { color: var(--soon); }
.count { min-width: 18px; padding: 0 6px; border-radius: 9px; font-size: 11.5px; font-weight: 500; line-height: 18px; text-align: center; color: var(--muted); background: var(--bg-hover); }
.tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 500; color: var(--muted); background: var(--bg-hover); }
.badge-i { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.badge-i .ic { width: 14px; height: 14px; }
.badge-i.parent { max-width: 180px; overflow: hidden; }
.badge-i.parent span { overflow: hidden; text-overflow: ellipsis; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.logo { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 8px; background: linear-gradient(135deg, #f06a5f 0%, #f39a52 100%); color: #fff; box-shadow: 0 2px 6px rgba(240, 106, 95, .35); }
.logo .ic { width: 16px; height: 16px; stroke-width: 2.8; }
.brand.big { font-size: 19px; }
.brand.big .logo { width: 34px; height: 34px; border-radius: 10px; }
.brand.big .logo .ic { width: 20px; height: 20px; }

/* ---------- Boot screens ---------- */
#root.boot { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; background: var(--bg-soft); }
.auth { width: min(400px, 100%); }
.auth-card, .boot-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-md); padding: 32px; }
.boot-card { width: min(440px, 100%); }
.auth h1, .boot-card h1 { margin: 22px 0 6px; font-size: 24px; font-weight: 650; letter-spacing: -.02em; }
.auth-form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.auth-msg { font-size: 13.5px; padding: 10px 12px; border-radius: 8px; }
.auth-msg.err { color: var(--danger); background: var(--danger-soft); }
.auth-msg.ok { color: var(--ok); background: var(--ok-soft); }
.auth-switch { margin-top: 18px; text-align: center; color: var(--text-2); font-size: 14px; }
.auth-foot { margin-top: 16px; text-align: center; color: var(--muted); font-size: 13px; }
.boot-actions { display: flex; gap: 8px; margin-top: 20px; }
.boot-load { display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.sm { width: 18px; height: 18px; border-width: 2px; margin: 12px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- App frame ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; background: var(--bg); }
.app.has-panel { grid-template-columns: var(--side-w) minmax(0, 1fr) var(--panel-w); }
.side { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; min-height: 0; background: var(--side-bg); color: var(--side-text); }
.side-scrim { display: none; }
.main { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.panel { grid-column: 3; grid-row: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); border-left: 1px solid var(--line); animation: panel-in .18s ease-out; }
@keyframes panel-in { from { opacity: 0; transform: translateX(16px); } }
#r-pop { position: fixed; top: 0; left: 0; z-index: 80; }
#r-pop:empty { display: none; }
#r-modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
#r-modal:empty { display: none; }

/* ---------- Sidebar ---------- */
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 18px; }
.side-close { display: none; color: var(--side-muted); }
.side-close:hover { background: var(--side-hover); color: var(--side-text); }
.side-create { padding: 8px 14px 10px; }
.create-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px 0 8px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .04); color: var(--side-text); font-weight: 500; font-size: 14px; transition: background-color .12s, border-color .12s; }
.create-btn:hover { background: var(--side-hover); border-color: rgba(255, 255, 255, .26); }
.create-btn .plus { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--create); color: #fff; }
.create-btn .plus .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 12px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.nav-block { padding: 8px 0; border-top: 1px solid var(--side-line); }
.nav-block:first-child { border-top: 0; padding-top: 2px; }
.nav-head { display: flex; align-items: center; justify-content: space-between; height: 30px; padding: 0 4px 0 10px; color: var(--side-muted); font-weight: 600; font-size: 12px; letter-spacing: .01em; }
.nav-head-acts { display: inline-flex; gap: 2px; }
.nav-head .icon-btn, .grp-head .icon-btn, .proj-more { color: var(--side-muted); }
.nav-head .icon-btn:hover, .grp-head .icon-btn:hover, .proj-more:hover { background: var(--side-hover); color: var(--side-text); }
.nav-item, .proj-link { display: flex; align-items: center; gap: 10px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--side-text); font-size: 14px; text-align: left; transition: background-color .1s; }
.nav-item:hover { background: var(--side-hover); }
.nav-item.on { background: var(--side-active); font-weight: 500; }
.nav-item .ic { width: 18px; height: 18px; color: var(--side-muted); }
.nav-item.on .ic { color: var(--side-text); }
.nav-item.soft { color: var(--side-muted); }
.nav-label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nav-item .count, .grp-toggle .count { background: rgba(255, 255, 255, .08); color: var(--side-muted); }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--create); color: #fff; font-weight: 600; font-size: 11px; line-height: 18px; text-align: center; }
.proj-item { position: relative; display: flex; align-items: center; border-radius: 8px; transition: background-color .1s; }
.proj-item:hover { background: var(--side-hover); }
.proj-item.on { background: var(--side-active); }
.proj-item.on .proj-link { font-weight: 500; }
.proj-link { flex: 1; min-width: 0; background: transparent !important; }
.proj-more { margin-right: 4px; opacity: 0; }
.proj-item:hover .proj-more, .proj-item:focus-within .proj-more, .proj-item.on .proj-more { opacity: 1; }
.grp { border-radius: 8px; }
.grp-head { display: flex; align-items: center; gap: 2px; padding-right: 4px; border-radius: 8px; }
.grp-head:hover { background: var(--side-hover); }
.grp-head .icon-btn { opacity: 0; }
.grp-head:hover .icon-btn, .grp-head:focus-within .icon-btn { opacity: 1; }
.grp-toggle { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 6px; border: 0; background: none; color: var(--side-text); font-weight: 600; font-size: 13px; text-align: left; }
.grp-toggle .chev { width: 16px; height: 16px; color: var(--side-muted); }
.grp .proj-item { margin-left: 14px; }
.grp-empty { margin: 0 0 4px 36px; padding: 2px 0 6px; color: var(--side-muted); font-size: 12px; }
.proj-list.ungrouped .grp-empty { margin-left: 10px; }
.sub-head { padding: 10px 10px 4px; color: var(--side-muted); font-size: 12px; }
.side-foot { padding: 8px; border-top: 1px solid var(--side-line); }
.me-btn { display: flex; align-items: center; gap: 10px; width: 100%; height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--side-text); font-weight: 500; font-size: 14px; text-align: left; }
.me-btn:hover { background: var(--side-hover); }
.me-btn > .ic { width: 16px; height: 16px; color: var(--side-muted); }
.side .dnd-ph { height: 2px; margin: 2px 10px; border-radius: 2px; background: var(--accent); }
.side .grp.drop-target { background: var(--side-hover); }

/* ---------- Header ---------- */
.top { flex: none; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 12px 24px 8px; }
.menu-btn { display: none; }
.proj-tile { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--c, var(--accent)); color: #fff; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }
.proj-tile .ic { width: 20px; height: 20px; }
.proj-tile.plain { background: var(--bg-hover); color: var(--text-2); box-shadow: none; }
.title-block { min-width: 0; display: flex; flex-direction: column; }
.title-line { display: flex; align-items: center; gap: 2px; min-width: 0; }
.title-input { min-width: 60px; max-width: 100%; field-sizing: content; padding: 3px 8px; margin-left: -2px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); font-weight: 600; font-size: 20px; letter-spacing: -.01em; text-overflow: ellipsis; }
.title-input:hover { border-color: var(--line-strong); }
.title-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.page-title { margin: 0; font-weight: 600; font-size: 20px; letter-spacing: -.01em; }
.proj-desc { max-width: 560px; margin: 0 0 0 7px; padding: 0 2px; border: 0; background: none; color: var(--muted); font-size: 13px; text-align: left; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.proj-desc:hover { color: var(--text-2); }
label.search { display: flex; align-items: center; gap: 8px; width: 260px; height: 34px; padding: 0 8px 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--muted); transition: border-color .12s, box-shadow .12s, width .2s; }
label.search .ic { width: 16px; height: 16px; }
label.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
label.search input::-webkit-search-cancel-button { cursor: pointer; }
label.search:focus-within { border-color: var(--accent); box-shadow: var(--focus); width: 300px; }
label.search:focus-within kbd { display: none; }
.tabs { display: flex; gap: 4px; padding: 0 22px; }
.tab { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 8px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 500; font-size: 14px; transition: color .12s, border-color .12s; }
.tab .ic { width: 16px; height: 16px; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--text); }
.toolbar { display: flex; align-items: center; gap: 6px; padding: 10px 24px; border-top: 1px solid var(--line); }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 24px 10px; }
.fchip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-hover); font-weight: 500; font-size: 12.5px; }
.banner { display: flex; align-items: center; gap: 10px; padding: 10px 24px; border-top: 1px solid var(--line); background: var(--warn-soft); color: var(--text-2); font-size: 13.5px; }
.banner.danger { background: var(--danger-soft); }
.banner > .ic { width: 16px; height: 16px; }
.banner span { flex: 1; }

/* ---------- Main area ---------- */
.body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.scroll { flex: 1; min-height: 0; overflow: auto; }
.empty { max-width: 420px; margin: 72px auto; padding: 0 20px; text-align: center; color: var(--text-2); }
.empty-ic { width: 60px; height: 60px; margin: 0 auto 18px; display: grid; place-items: center; border-radius: 18px; background: var(--accent-soft); color: var(--accent); }
.empty-ic .ic { width: 28px; height: 28px; }
.empty h3 { margin: 0 0 8px; font-weight: 600; font-size: 18px; color: var(--text); }
.empty p { margin: 0 0 18px; line-height: 1.55; }
.empty.small { margin: 28px auto; }
.empty.small p { margin-bottom: 10px; }

/* ---------- List ---------- */
.list { min-width: 760px; padding: 0 24px 120px; }
.list-head, .row { display: grid; grid-template-columns: minmax(280px, 1fr) 170px 130px 110px 44px; align-items: stretch; }
.list.my .list-head, .list.my .row, .list.search .list-head, .list.search .row { grid-template-columns: minmax(280px, 1fr) 190px 130px 110px 44px; }
.list-head { position: sticky; top: 0; z-index: 3; height: 38px; background: var(--bg); border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 500; font-size: 12.5px; }
.lh { display: flex; align-items: center; padding: 0 10px; border-left: 1px solid var(--line); }
.lh.name { border-left: 0; padding-left: 50px; }
.sec { margin-top: 18px; }
.sec-head { position: sticky; top: 38px; z-index: 2; display: flex; align-items: center; gap: 4px; height: 44px; padding-left: 2px; background: var(--bg); }
.sec-name { min-width: 48px; max-width: 70%; field-sizing: content; padding: 4px 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); font-weight: 600; font-size: 15.5px; text-overflow: ellipsis; }
.sec-name:hover { border-color: var(--line-strong); }
.sec-name:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.sec-count { color: var(--muted); font-size: 13px; padding: 0 4px; }
.sec-acts { display: inline-flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.sec-head:hover .sec-acts, .sec-head:focus-within .sec-acts { opacity: 1; }
.sec-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 8px 0 4px; border: 0; border-radius: 6px; background: none; color: var(--text); font-weight: 600; font-size: 15.5px; }
.sec-btn:hover { background: var(--bg-hover); }
.sec-btn .ic { width: 16px; height: 16px; color: var(--muted); }
.sec-title { white-space: nowrap; }
.my-overdue .sec-title { color: var(--danger); }
.sec-empty { padding: 10px 0 10px 50px; color: var(--muted); font-size: 13.5px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec.dragging { opacity: .45; }
.row { position: relative; min-height: 38px; border-bottom: 1px solid var(--line); background: var(--bg); cursor: pointer; transition: background-color .08s; }
.sec-head + .row, .sec-head + .dnd-ph + .row, .list-head + .row, .sec-head + .composer { border-top: 1px solid var(--line); }
.row:hover { background: var(--bg-hover); }
.row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.row.open { background: var(--accent-soft); }
.row.dragging { opacity: .45; }
.cell { display: flex; align-items: center; min-width: 0; padding: 0 10px; border-left: 1px solid var(--line); }
.c-name { gap: 6px; padding: 0 8px 0 0; border-left: 0; }
.c-more { justify-content: center; padding: 0; }
.grip, .grip-space { width: 22px; flex: none; display: grid; place-items: center; align-self: stretch; color: var(--faint); }
.grip { cursor: grab; opacity: 0; }
.grip .ic { width: 14px; height: 14px; }
.row:hover .grip { opacity: 1; }
.check { width: 18px; height: 18px; flex: none; display: grid; place-items: center; padding: 0; border: 1.2px solid var(--faint); border-radius: 50%; background: transparent; color: var(--faint); transition: background-color .12s, border-color .12s, color .12s, transform .12s; }
.check .ic { width: 11px; height: 11px; stroke-width: 2.6; }
.check:hover { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.check.on { border-color: var(--ok); background: var(--ok); color: #fff; }
.check.on:hover { filter: brightness(1.05); }
.check:active { transform: scale(.88); }
.check.sm { width: 16px; height: 16px; }
.check.sm .ic { width: 10px; height: 10px; }
.check.ghost { opacity: .6; pointer-events: none; }
.row-title, .composer-input { min-width: 40px; max-width: 100%; field-sizing: content; height: 28px; padding: 0 6px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--text); font-size: 14px; text-overflow: ellipsis; }
.row-title:hover { border-color: var(--line-strong); }
.row-title:focus, .composer-input:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: var(--focus); }
.row.done .row-title { color: var(--muted); }
.composer-input { flex: 1; field-sizing: fixed; border-color: var(--accent); background: var(--surface); }
.row.composer { display: flex; cursor: default; background: var(--bg); }
.row.composer .c-name { flex: 1; padding-right: 10px; }
.row-badges { display: inline-flex; align-items: center; gap: 10px; flex: none; min-width: 0; padding-left: 2px; }
.row-badges:empty { display: none; }
.row-open { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; flex: none; height: 24px; padding: 0 4px 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; opacity: 0; transition: opacity .12s; }
.row-open .ic { width: 14px; height: 14px; }
.row-open:hover { background: var(--bg-active); color: var(--text); }
.row:hover .row-open, .row:focus-within .row-open, .row.open .row-open { opacity: 1; }
.who { display: flex; align-items: center; gap: 6px; max-width: 100%; height: 28px; padding: 0 6px 0 3px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font-size: 13px; }
.who:hover { background: var(--bg-active); }
.who-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.who-empty { width: 22px; height: 22px; display: grid; place-items: center; border: 1px dashed var(--faint); border-radius: 50%; color: var(--faint); opacity: 0; }
.who-empty .ic { width: 12px; height: 12px; }
.row:hover .who-empty, .who:focus-visible .who-empty { opacity: 1; }
.proj-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 24px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 13px; }
.proj-chip:hover { background: var(--bg-active); }
.proj-chip span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.due-wrap { position: relative; display: inline-flex; max-width: 100%; }
.due-btn { height: 26px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font-size: 13px; white-space: nowrap; }
.due-btn:hover { background: var(--bg-active); }
.due-btn.overdue { color: var(--danger); }
.due-btn.soon { color: var(--soon); }
.due-btn.unset { color: var(--faint); opacity: 0; display: grid; place-items: center; }
.due-btn.unset .ic { width: 16px; height: 16px; }
.row:hover .due-btn.unset, .due-btn.unset:focus-visible { opacity: 1; }
.date-hidden { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
.pri-btn { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border: 0; border-radius: 999px; font-weight: 500; font-size: 12px; white-space: nowrap; }
.pri-btn.pri-none { padding: 0 8px; background: transparent; color: var(--faint); }
.pri-btn:hover { filter: brightness(.96); box-shadow: 0 0 0 1px var(--line-strong); }
.pri-empty { opacity: 0; }
.row:hover .pri-empty { opacity: 1; }
.row-more { opacity: 0; }
.row:hover .row-more, .row:focus-within .row-more { opacity: 1; }
.add-row { display: flex; align-items: center; gap: 8px; width: 100%; height: 38px; padding: 0 8px 0 0; border: 0; border-bottom: 1px solid transparent; background: transparent; color: var(--muted); font-size: 14px; text-align: left; }
.add-row .ic { width: 16px; height: 16px; margin-left: 1px; }
.add-row:hover { color: var(--text); background: var(--bg-hover); }
.add-sec { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; height: 36px; padding: 0 12px 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-weight: 600; font-size: 15px; }
.add-sec:hover { background: var(--bg-hover); color: var(--text); }
.add-sec-row { margin-top: 20px; }
.add-sec-input { width: min(420px, 100%); height: 36px; padding: 0 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 600; font-size: 15px; box-shadow: var(--focus); }
.add-sec-input:focus { outline: none; }
.list-sub { display: flex; align-items: center; gap: 8px; margin: 24px 0 10px; font-weight: 600; font-size: 15px; }
.proj-results { display: flex; flex-wrap: wrap; gap: 8px; }
.proj-result { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font-weight: 500; }
.proj-result:hover { border-color: var(--line-strong); background: var(--bg-hover); }
.list .dnd-ph { height: 0; border-top: 2px solid var(--accent); margin: -1px 0; position: relative; z-index: 4; }
.secs > .dnd-ph { height: 0; border-top: 3px solid var(--accent); margin: 10px 0; }

/* ---------- Board ---------- */
.board-scroll { overflow-x: auto; overflow-y: hidden; background: var(--bg-soft); }
.board { display: flex; align-items: flex-start; gap: 14px; height: 100%; padding: 16px 24px 20px; width: max-content; min-width: 100%; }
.col { flex: 0 0 290px; width: 290px; max-height: 100%; display: flex; flex-direction: column; border-radius: 12px; background: var(--col-bg); }
.col.dragging { opacity: .45; }
.col-head { display: flex; align-items: center; gap: 4px; padding: 8px 8px 6px 6px; }
.col-head .sec-name { font-size: 14.5px; max-width: 180px; }
.col-body { flex: 1 1 auto; min-height: 48px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 2px 8px 10px; scrollbar-width: thin; }
.card { position: relative; flex: none; padding: 12px 12px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }
.card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.card.open { border-color: var(--accent-line); box-shadow: 0 0 0 1px var(--accent-line), var(--shadow-md); }
.card.dragging { opacity: .45; transform: rotate(1deg); }
.card.done .card-title { color: var(--muted); }
.card-top { display: flex; align-items: flex-start; gap: 8px; padding-right: 22px; }
.card-top .check { margin-top: 2px; }
.card-title { min-width: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.card-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; min-height: 22px; }
.card-more { position: absolute; top: 8px; right: 6px; opacity: 0; }
.card:hover .card-more, .card:focus-within .card-more { opacity: 1; }
.card.composer { padding: 8px; cursor: default; border-color: var(--accent); box-shadow: var(--focus); }
.card.composer .composer-input { width: 100%; height: auto; min-height: 44px; padding: 4px; border: 0; box-shadow: none; resize: none; line-height: 1.4; font-family: inherit; }
.add-card { display: flex; align-items: center; gap: 6px; flex: none; height: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; text-align: left; }
.add-card .ic { width: 16px; height: 16px; }
.add-card:hover { background: var(--bg-active); color: var(--text); }
.col-add { flex: 0 0 290px; }
.add-col { display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; padding: 0 12px; border: 1px dashed var(--line-strong); border-radius: 12px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; }
.add-col:hover { border-color: var(--faint); color: var(--text); background: var(--col-bg); }
.col-add .add-sec-input { width: 100%; }
.col-body > .dnd-ph { flex: none; height: 44px; border: 2px dashed var(--accent-line); border-radius: 10px; background: var(--accent-soft); }
.board > .dnd-ph { flex: 0 0 290px; align-self: stretch; border: 2px dashed var(--accent-line); border-radius: 12px; background: var(--accent-soft); }

/* ---------- Calendar ---------- */
.cal-view { display: flex; flex-direction: column; }
.cal-bar { display: flex; align-items: center; gap: 6px; padding: 12px 24px; }
.cal-title { margin: 0 0 0 6px; font-weight: 600; font-size: 17px; }
.cal { flex: 1; display: flex; flex-direction: column; min-height: 560px; padding: 0 24px 24px; }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0 0 6px; color: var(--muted); font-weight: 500; font-size: 12px; }
.cal-dow > div { padding-left: 8px; }
.cal-grid { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: minmax(116px, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.day { min-width: 0; display: flex; flex-direction: column; gap: 3px; padding: 4px 5px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transition: background-color .1s; }
.day.weekend { background: var(--surface-2); }
.day.other { background: var(--bg-soft); }
.day.over { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.day-head { display: flex; align-items: center; justify-content: space-between; }
.day-n { min-width: 26px; height: 24px; padding: 0 6px; border: 0; border-radius: 999px; background: transparent; color: var(--text-2); font-weight: 500; font-size: 12.5px; }
.day-n:hover { background: var(--bg-hover); }
.day.other .day-n { color: var(--muted); }
.day.today .day-n { background: var(--accent-solid, var(--accent)); color: #fff; }
.day-add { opacity: 0; }
.day:hover .day-add, .day-add:focus-visible { opacity: 1; }
.day-tasks { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chip { --c: var(--accent); display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0; height: 24px; padding: 0 6px; border: 0; border-left: 3px solid var(--c); border-radius: 5px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); color: var(--text); font-weight: 500; font-size: 12px; text-align: left; white-space: nowrap; }
.chip span { overflow: hidden; text-overflow: ellipsis; }
.chip .ic { width: 12px; height: 12px; color: var(--ok); }
.chip:hover { background: color-mix(in srgb, var(--c) 24%, var(--surface)); }
.chip.done { color: var(--muted); background: var(--bg-hover); }
.chip.dragging { opacity: .45; }
.more-link { align-self: flex-start; height: 22px; padding: 0 6px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-weight: 500; font-size: 12px; }
.more-link:hover { background: var(--bg-hover); color: var(--text); }

/* ---------- Inbox, Trash, Archive ---------- */
.page, .feed-wrap { max-width: 880px; margin: 0 auto; padding: 20px 24px 80px; }
.feed-wrap { max-width: 780px; }
.page-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-bar p { max-width: 560px; }
.tlist { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.trow { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.trow:last-child { border-bottom: 0; }
.trow-ic { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--c, var(--bg-hover)); color: #fff; }
.trow-ic.task { background: var(--bg-hover); color: var(--muted); }
.trow-ic .ic { width: 18px; height: 18px; }
.trow-main { flex: 1; min-width: 0; }
.trow-title { display: block; font-weight: 500; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.trow-sub { color: var(--muted); font-size: 13px; }
.trow-acts { display: flex; flex: none; gap: 6px; }
.feed { display: flex; flex-direction: column; }
.ib-item { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px 14px 22px; border-radius: 12px; cursor: pointer; transition: background-color .1s; }
.ib-item + .ib-item::after { content: ''; position: absolute; top: 0; left: 22px; right: 16px; border-top: 1px solid var(--line); }
.ib-item:hover { background: var(--bg-hover); }
.ib-item:hover::after, .ib-item:hover + .ib-item::after { border-color: transparent; }
.ib-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ib-item.unread::before { content: ''; position: absolute; left: 7px; top: 24px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ib-main { flex: 1; min-width: 0; }
.ib-line { color: var(--text-2); }
.ib-line b { color: var(--text); font-weight: 600; }
.ib-task { display: flex; align-items: center; gap: 8px; margin-top: 4px; min-width: 0; font-weight: 500; color: var(--text); }
.ib-task .ic { width: 16px; height: 16px; color: var(--ok); }
.ib-title { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ib-proj { display: inline-flex; align-items: center; gap: 6px; flex: none; color: var(--muted); font-weight: 400; font-size: 13px; }
.ib-quote { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--line-strong); border-radius: 0 8px 8px 0; background: var(--surface-2); color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.ib-time { flex: none; color: var(--muted); font-size: 12.5px; white-space: nowrap; }

/* ---------- Task details panel ---------- */
.panel-top { display: flex; align-items: center; gap: 4px; min-height: 56px; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--line); }
.complete-btn .ic { width: 15px; height: 15px; }
.complete-btn:hover { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.complete-btn.on { border-color: transparent; background: var(--ok-soft); color: var(--ok); }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 28px 28px; }
.done-banner { display: flex; align-items: center; gap: 8px; margin: -18px -28px 16px; padding: 10px 28px; background: var(--ok-soft); color: var(--ok); font-weight: 500; font-size: 13.5px; }
.done-banner .ic { width: 16px; height: 16px; }
.crumb { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; margin: 0 0 6px -6px; height: 26px; padding: 0 8px 0 4px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 13px; }
.crumb:hover { background: var(--bg-hover); color: var(--text); }
.crumb .ic { width: 15px; height: 15px; }
.crumb span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.panel-title { display: block; width: calc(100% + 18px); margin: 0 -9px; padding: 6px 8px; overflow: hidden; resize: none; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--text); font-weight: 600; font-size: 22px; line-height: 1.3; letter-spacing: -.01em; }
.panel-title:hover { border-color: var(--line-strong); }
.panel-title:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.fields { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 12px; margin: 18px 0 24px; }
.f-label { padding-top: 7px; color: var(--muted); font-size: 13px; }
.f-val { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 34px; min-width: 0; }
.f-val select.inp { max-width: 220px; }
.person-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 4px 0 4px; border-radius: 999px; background: var(--bg-hover); font-size: 13px; }
.chip-x { width: 20px; height: 20px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.chip-x:hover { background: var(--bg-active); color: var(--text); }
.chip-x .ic { width: 12px; height: 12px; }
.quick { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.date-inp.overdue { color: var(--danger); }
.pri-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.pri-opt { height: 28px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text-2); font-weight: 500; font-size: 12.5px; }
.pri-opt:hover { border-color: var(--line-strong); background: var(--bg-hover); }
.pri-opt[aria-pressed="true"] { border-color: transparent; }
.pri-opt.pri-none[aria-pressed="true"] { background: var(--bg-active); color: var(--text); }
.pri-opt.pri-low[aria-pressed="true"] { background: var(--pri-low-bg); color: var(--pri-low); }
.pri-opt.pri-medium[aria-pressed="true"] { background: var(--pri-medium-bg); color: var(--pri-medium); }
.pri-opt.pri-high[aria-pressed="true"] { background: var(--pri-high-bg); color: var(--pri-high); }
.pri-opt:not([aria-pressed="true"]) { background: transparent; }
.block { margin-top: 24px; }
.block-label { margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.block-label .muted { margin-left: 6px; font-weight: 400; font-size: 13px; }
.notes { display: block; width: 100%; min-height: 96px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); line-height: 1.55; resize: none; }
.notes:hover { border-color: var(--line-strong); }
.notes:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.notes::placeholder, .sub-add::placeholder, .comment-box textarea::placeholder { color: var(--faint); }
.links { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.links a { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; max-width: 100%; font-size: 13px; text-decoration: none; }
.links a:hover { text-decoration: underline; }
.links .ic { width: 14px; height: 14px; }
.subs { border-top: 1px solid var(--line); }
.sub { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 2px 0 6px; border-bottom: 1px solid var(--line); }
.sub:hover { background: var(--bg-hover); }
.sub-title { flex: 1; min-width: 0; height: 28px; padding: 0 6px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--text); font-size: 14px; }
.sub-title:hover { border-color: var(--line-strong); }
.sub-title:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: var(--focus); }
.sub.done .sub-title { color: var(--muted); }
.sub .icon-btn { opacity: 0; }
.sub:hover .icon-btn, .sub:focus-within .icon-btn { opacity: 1; }
.sub-add-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding-left: 6px; color: var(--muted); }
.sub-add-row .ic { width: 16px; height: 16px; }
.sub-add { flex: 1; height: 34px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--text); font-size: 14px; }
.sub-add:hover { border-color: var(--line); }
.sub-add:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.feed-block { margin-top: 28px; padding-top: 4px; border-top: 1px solid var(--line); }
.tabs.sm { padding: 0; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.tabs.sm .tab { height: 36px; font-size: 13.5px; }
.tabs.sm .count { margin-left: 2px; }
.feed-list { display: flex; flex-direction: column; gap: 4px; }
.feed-empty { padding: 8px 0 0 28px; font-size: 13.5px; }
.act-line { display: flex; align-items: flex-start; gap: 10px; padding: 4px 0; color: var(--muted); font-size: 13px; }
.act-line .av { margin-top: 1px; }
.act-line b { color: var(--text-2); font-weight: 600; }
.cmt { display: flex; gap: 10px; padding: 10px 0; }
.cmt-main { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: center; gap: 8px; min-height: 24px; font-size: 13px; }
.cmt-head b { font-weight: 600; }
.cmt-head time { color: var(--muted); }
.cmt-acts { display: inline-flex; gap: 2px; margin-left: auto; opacity: 0; }
.cmt:hover .cmt-acts, .cmt:focus-within .cmt-acts { opacity: 1; }
.cmt-body { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.cmt-edit { width: 100%; min-height: 64px; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--surface); color: var(--text); resize: none; line-height: 1.5; box-shadow: var(--focus); }
.cmt-edit:focus { outline: none; }
.btn-row { display: flex; gap: 6px; margin-top: 6px; }
.panel-foot { display: flex; align-items: flex-start; gap: 10px; padding: 12px 20px 14px; border-top: 1px solid var(--line); background: var(--surface-2); }
.panel-foot > .av { margin-top: 6px; }
.comment-box { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 6px 6px 6px 10px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); transition: border-color .12s, box-shadow .12s; }
.comment-box:focus-within { border-color: var(--accent); box-shadow: var(--focus); }
.comment-box textarea { width: 100%; min-height: 24px; max-height: 200px; padding: 4px 0; border: 0; outline: 0; background: transparent; color: var(--text); resize: none; line-height: 1.5; }
.comment-acts { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

/* ---------- Popovers and menus ---------- */
.pop { position: fixed; min-width: 220px; max-width: min(320px, calc(100vw - 16px)); max-height: min(460px, calc(100vh - 16px)); overflow-y: auto; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-lg); animation: pop-in .12s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.pop-people { width: 300px; }
.pop-filter { width: 280px; }
.pop-day { width: 290px; }
.mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 6px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font-size: 14px; text-align: left; }
.mi:hover, .mi:focus { outline: none; background: var(--bg-hover); }
.mi:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.mi > .ic { width: 16px; height: 16px; color: var(--muted); }
.mi.danger, .mi.danger > .ic { color: var(--danger); }
.mi-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.mi-label small { display: block; overflow: hidden; color: var(--muted); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.mi > .mi-check { color: var(--accent); }
.mi.day-task.done .mi-label { color: var(--muted); }
.sep { height: 1px; margin: 6px 4px; background: var(--line); }
.sw-row { display: grid; grid-template-columns: repeat(6, 26px); justify-content: space-between; gap: 8px; padding: 8px 10px; }
.pop-h { padding: 8px 10px 4px; color: var(--muted); font-weight: 600; font-size: 12px; }
.pop-h.big { color: var(--text); font-size: 14px; padding-bottom: 8px; }
.pop-sec + .pop-sec { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line); }
.pop-scroll { max-height: 180px; overflow-y: auto; }
.pop-foot { display: flex; justify-content: flex-end; margin-top: 4px; padding: 6px 4px 2px; border-top: 1px solid var(--line); }
.pop-search { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; padding: 0 10px; border-bottom: 1px solid var(--line); color: var(--muted); }
.pop-search .ic { width: 16px; height: 16px; }
.pop-search input { flex: 1; height: 38px; border: 0; outline: 0; background: transparent; color: var(--text); }
.pop-list { display: flex; flex-direction: column; }
.pop-empty { padding: 12px 10px; color: var(--muted); font-size: 13.5px; }

/* ---------- Dialogs ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(12, 14, 18, .48); animation: fade .15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { position: relative; width: min(480px, 100%); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px 24px 22px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-lg); animation: modal-in .16s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h2 { margin: 0; font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.modal-head .icon-btn { margin-right: -8px; }
.modal-text { margin-top: 8px; color: var(--text-2); line-height: 1.55; }
.modal-fields { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.modal-actions { display: flex; flex-direction: row-reverse; flex-wrap: wrap; justify-content: flex-start; gap: 8px; margin-top: 24px; }
.keys { display: grid; grid-template-columns: 1fr; gap: 2px; margin: 16px 0; }
.keys > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.keys dt { display: flex; align-items: center; gap: 4px; }
.keys dd { margin: 0; color: var(--text-2); }
.plus-sep { color: var(--muted); font-size: 12px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; width: max-content; max-width: calc(100vw - 32px); transform: translateX(-50%); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 560px; padding: 8px 8px 8px 14px; border-radius: 12px; background: #24262a; color: #f3f4f6; box-shadow: 0 12px 32px rgba(0, 0, 0, .28); font-size: 14px; pointer-events: auto; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.toast-ic { width: 18px; height: 18px; color: #5fd3a0; }
.toast-text { min-width: 0; }
.toast-act { flex: none; height: 28px; padding: 0 10px; border: 0; border-radius: 7px; background: rgba(255, 255, 255, .1); color: #fff; font-weight: 600; font-size: 13.5px; }
.toast-act:hover { background: rgba(255, 255, 255, .18); }
.toast-x { color: rgba(255, 255, 255, .6); }
.toast-x:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* ---------- Drag and drop ---------- */
.dnd-ph { pointer-events: none; }
[data-drag][draggable="true"] { -webkit-user-drag: element; }

/* ---------- Touch screens: no hover, so show the controls that hover would reveal ---------- */
@media (hover: none) {
  .proj-more, .grp-head .icon-btn, .row-more, .card-more, .sec-acts, .sub .icon-btn, .cmt-acts, .day-add, .row-open, .due-btn.unset, .who-empty { opacity: 1; }
  .grip { display: none; }
  .row-open span { display: none; }
}

/* ---------- Medium screens: the task panel floats over the list ---------- */
@media (max-width: 1180px) {
  .app.has-panel { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; width: min(560px, 76vw); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); }
  label.search { width: 200px; }
  label.search:focus-within { width: 240px; }
}

/* ---------- Phones and small tablets ---------- */
@media (max-width: 760px) {
  .app, .app.has-panel { grid-template-columns: minmax(0, 1fr); }
  .main { grid-column: 1; }
  .side { position: fixed; top: 0; bottom: 0; left: 0; z-index: 50; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease, box-shadow .22s; }
  .side-open .side { transform: none; box-shadow: var(--shadow-lg); }
  .side-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, .42); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .side-open .side-scrim { opacity: 1; pointer-events: auto; }
  .side-close, .menu-btn { display: inline-grid; }
  .panel { inset: 0; width: 100%; border-left: 0; }
  .top-row { flex-wrap: wrap; gap: 6px 8px; min-height: 0; padding: 10px 12px 8px; }
  .top-row .grow { display: none; }
  .title-block { flex: 1; }
  .title-input, .page-title { font-size: 18px; }
  .proj-tile { width: 32px; height: 32px; border-radius: 9px; }
  .proj-tile .ic { width: 17px; height: 17px; }
  .av-lg { width: 32px; height: 32px; }
  .proj-desc { display: none; }
  label.search, label.search:focus-within { order: 10; width: 100%; }
  label.search kbd { display: none; }
  .tabs { padding: 0 8px; overflow-x: auto; }
  .toolbar { padding: 8px 12px; gap: 4px; overflow-x: auto; }
  .filter-bar { padding: 0 12px 8px; }
  .banner { padding: 10px 12px; flex-wrap: wrap; }
  .hide-sm { display: none !important; }
  .list { min-width: 0; padding: 0 8px 100px; }
  .list-head { display: none; }
  .row, .list.my .row, .list.search .row { grid-template-columns: minmax(0, 1fr) auto auto; min-height: 44px; }
  .row .c-who, .row .c-pri { display: none; }
  .cell { border-left: 0; padding: 0 2px; }
  .sec-head { top: 0; }
  .sec-name { max-width: 60%; }
  .row-badges { display: none; }
  .row-open { display: none; }
  .lh.name, .sec-empty { padding-left: 30px; }
  .grip-space { width: 6px; }
  .board { padding: 12px; gap: 10px; }
  .col, .col-add { flex-basis: min(290px, 84vw); width: min(290px, 84vw); }
  .cal-bar { padding: 10px 12px; }
  .cal { padding: 0 6px 16px; min-height: 480px; }
  .cal-grid { grid-auto-rows: minmax(84px, 1fr); }
  .day { padding: 3px 2px; }
  .day-add { display: none; }
  .chip { height: 18px; padding: 0 3px; font-size: 10.5px; border-left-width: 2px; }
  .chip .ic { display: none; }
  .page, .feed-wrap { padding: 12px 12px 80px; }
  .page-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .trow { flex-wrap: wrap; padding: 12px; }
  .trow-acts { width: 100%; padding-left: 48px; }
  .ib-item { padding: 12px 10px 12px 20px; }
  .ib-time { display: none; }
  .panel-top { padding: 8px 10px 8px 14px; }
  .panel-body { padding: 14px 16px 24px; }
  .done-banner { margin: -14px -16px 14px; padding: 10px 16px; }
  .fields { grid-template-columns: 88px minmax(0, 1fr); }
  .panel-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  .panel-foot > .av { display: none; }
  .modal { padding: 18px 18px 20px; }
  .modal-actions .btn { flex: 1 1 auto; }
  .toasts { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .toast { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- When the task panel sits beside the list, drop the priority column to make room ---------- */
@media (min-width: 1181px) {
  .app.has-panel .list { min-width: 0; }
  .app.has-panel .list-head, .app.has-panel .row,
  .app.has-panel .list.my .list-head, .app.has-panel .list.my .row,
  .app.has-panel .list.search .list-head, .app.has-panel .list.search .row { grid-template-columns: minmax(220px, 1fr) 150px 120px 40px; }
  .app.has-panel .row .c-pri, .app.has-panel .list-head .lh:nth-child(4) { display: none; }
  .app.has-panel .row-open { display: none; }
}

/* ---------- Long lists ---------- */
.row, .card { content-visibility: auto; contain-intrinsic-size: auto 38px; }
.card { contain-intrinsic-size: auto 90px; }
.row.composer, .card.composer, .row.open, .card.open { content-visibility: visible; }
.show-more { display: flex; align-items: center; gap: 8px; width: 100%; height: 38px; padding: 0 0 0 30px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--accent); font-weight: 500; font-size: 13.5px; text-align: left; }
.show-more .ic { width: 16px; height: 16px; }
.show-more:hover { background: var(--bg-hover); }
.col-body .show-more { justify-content: center; padding: 0; border: 0; border-radius: 8px; height: 34px; flex: none; }

/* ---------- Multi-select ---------- */
.row.selected { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.row.selected:hover { background: var(--accent-soft); }
.card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm); }
.bulk-bar { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 40; display: flex; align-items: center; gap: 2px; padding: 6px; background: #24262a; color: #f3f4f6; border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.28), 0 2px 6px rgba(0,0,0,.2); animation: bulk-in .18s ease-out; max-width: calc(100% - 32px); }
@keyframes bulk-in { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.bulk-count { padding: 0 10px 0 8px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.bulk-sep { width: 1px; align-self: stretch; margin: 4px 4px; background: rgba(255,255,255,.16); }
.bulk-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: inherit; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.bulk-btn svg, .bulk-x svg { width: 16px; height: 16px; }
.bulk-btn:hover, .bulk-x:hover { background: rgba(255,255,255,.1); }
.bulk-btn:focus-visible, .bulk-x:focus-visible { outline: 2px solid #8ab4ff; outline-offset: 1px; }
.bulk-btn.danger { color: #ff9b94; }
.bulk-btn.danger:hover { background: rgba(255,110,100,.16); }
.bulk-x { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer; }
.has-bulk .toasts { bottom: 84px; }
@media (max-width: 760px) {
  .bulk-bar { left: 8px; right: 8px; bottom: 12px; transform: none; max-width: none; justify-content: space-between; }
  @keyframes bulk-in { from { opacity: 0; } to { opacity: 1; } }
  .bulk-btn span { display: none; }
  .bulk-btn { padding: 0 7px; }
  .bulk-count { padding: 0 4px; font-size: 12px; }
  .bc-long { display: none; }
  .bulk-sep { margin: 4px 2px; }
}

/* ---------- Home ---------- */
.home { max-width: 1080px; margin: 0 auto; padding: 22px 28px 96px; }
.home-hero { text-align: center; margin: 6px 0 28px; }
.home-date { color: var(--text-2); font-weight: 500; font-size: 14px; }
.home-hello { margin: 4px 0 16px; font-weight: 500; font-size: 32px; letter-spacing: -.015em; color: var(--text); }
.home-stats { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 14px; padding: 9px 20px; border-radius: 999px; background: var(--bg-soft); color: var(--text-2); font-size: 13.5px; }
.home-stats b { color: var(--text); font-weight: 600; }
.hs-sep { width: 1px; height: 14px; background: var(--line-strong); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.widget { min-width: 0; padding: 18px 20px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.w-team { grid-column: 1 / -1; }
.w-head { display: flex; align-items: center; gap: 10px; min-height: 32px; margin-bottom: 6px; }
.w-head h3 { margin: 0; font-weight: 600; font-size: 17px; }
.link-h { padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; }
.link-h:hover { text-decoration: underline; text-underline-offset: 3px; }
.w-tabs { display: flex; gap: 18px; margin: 4px 0 4px; border-bottom: 1px solid var(--line); }
.w-tab { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-weight: 500; font-size: 13.5px; cursor: pointer; }
.w-tab:hover { color: var(--text); }
.w-tab.on { color: var(--text); }
.w-tab.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--text); }
.w-count { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 9px; background: var(--danger-soft); color: var(--danger); font-size: 11px; font-weight: 600; }
.w-list { display: flex; flex-direction: column; }
.w-task { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 6px; margin: 0 -6px; border-bottom: 1px solid var(--line); border-radius: 0; cursor: pointer; }
.w-task:last-child { border-bottom: 0; }
.w-task:hover, .w-task.open { background: var(--bg-hover); }
.w-task:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.w-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; }
.w-task.done .w-title { color: var(--muted); }
.w-proj { flex: none; max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--c, var(--accent)) 16%, transparent); color: var(--text-2); font-size: 12px; font-weight: 500; }
.w-due { flex: none; min-width: 64px; text-align: right; color: var(--muted); font-size: 12.5px; }
.w-due.overdue { color: var(--danger); }
.w-due.soon { color: var(--soon); }
.w-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px 10px; color: var(--muted); text-align: center; }
.w-empty .ic { width: 28px; height: 28px; color: var(--faint); }
.w-more, .w-add { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 6px; border: 0; border-radius: 8px; background: none; color: var(--text-2); font: inherit; font-size: 13.5px; cursor: pointer; }
.w-more:hover, .w-add:hover { background: var(--bg-hover); color: var(--text); }
.w-more .ic, .w-add .ic { width: 15px; height: 15px; }
.p-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; margin-top: 6px; }
.p-tile { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px; border: 0; border-radius: 12px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.p-tile:hover { background: var(--bg-hover); }
.p-ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 11px; background: var(--c, var(--accent)); color: #fff; }
.p-ic .ic { width: 20px; height: 20px; }
.p-tile.new .p-ic { background: none; border: 1.5px dashed var(--line-strong); color: var(--muted); }
.p-tile.new:hover .p-ic { border-color: var(--text-2); color: var(--text); }
.p-tile.new .p-name { color: var(--text-2); }
.p-text { display: flex; flex-direction: column; min-width: 0; }
.p-name { display: flex; align-items: center; gap: 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; font-size: 14px; }
.p-star { width: 13px; height: 13px; flex: none; color: #f1b31c; }
.p-sub { color: var(--muted); font-size: 12.5px; }
.t-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px; margin-top: 6px; }
.t-person { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px; border-radius: 10px; }
.t-text { display: flex; flex-direction: column; min-width: 0; }
.t-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 500; font-size: 13.5px; }
.t-sub { color: var(--muted); font-size: 12.5px; }
.t-late { color: var(--danger); }
@media (max-width: 1000px) { .home-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .home { padding: 14px 12px 88px; }
  .home-hello { font-size: 25px; }
  .home-stats { border-radius: 14px; padding: 8px 14px; }
  .hs-sep { display: none; }
  .widget { padding: 14px 14px 10px; border-radius: 14px; }
  .w-proj { display: none; }
  .p-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Tags ---------- */
.ttags { display: inline-flex; gap: 4px; min-width: 0; overflow: hidden; }
.ttag { display: inline-flex; align-items: center; height: 24px; max-width: 180px; border-radius: 6px; background: color-mix(in srgb, var(--c, #888) 20%, transparent); color: var(--text); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.ttag.sm { height: 20px; padding: 0 7px; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; display: inline-block; line-height: 20px; }
.ttag.more { background: var(--bg-hover); color: var(--muted); }
.ttag-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; padding: 0 4px 0 9px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.ttag-name:hover { text-decoration: underline; text-underline-offset: 2px; }
.ttag-x { display: grid; place-items: center; width: 20px; height: 20px; margin-right: 2px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--text-2); cursor: pointer; }
.ttag-x:hover { background: color-mix(in srgb, var(--c, #888) 30%, transparent); color: var(--text); }
.ttag-x .ic { width: 12px; height: 12px; }
.ttag-dot { width: 10px; height: 10px; flex: none; border-radius: 3px; background: var(--c, #888); }
.tags-val { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.card-tags .ttags { flex-wrap: wrap; }
.row-badges .ttags { flex: 0 1 auto; }
.row-badges .ttag.sm { max-width: 110px; }
.app.has-panel .row-badges .ttags { display: none; }
@media (max-width: 1180px) { .row-badges .ttags { display: none; } }

/* ---------- Subtasks in the list ---------- */
.sub-toggle { height: 22px; padding: 0 6px; margin: 0 -2px; border: 0; border-radius: 6px; background: none; font: inherit; font-size: 12px; cursor: pointer; }
.sub-toggle:hover, .sub-toggle.on { background: var(--bg-hover); color: var(--text); }
.sub-toggle .sub-chev { width: 12px; height: 12px; }
.sub-indent { width: 26px; flex: none; position: relative; align-self: stretch; }
.sub-indent::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 50%; width: 10px; border-left: 1.5px solid var(--line-strong); border-bottom: 1.5px solid var(--line-strong); border-bottom-left-radius: 6px; }
.row.subrow .row-title { font-size: 13.5px; }
.row.subrow .check { width: 16px; height: 16px; }
.sub-add-inline { display: flex; min-height: 36px; }
.sub-add-inline .c-name { display: flex; align-items: center; gap: 8px; flex: 1; color: var(--muted); }
.sub-add-inline .ic { width: 14px; height: 14px; }
.sub-inline { flex: 1; min-width: 0; height: 30px; padding: 0 6px; border: 1px solid transparent; border-radius: 6px; background: none; color: var(--text); font: inherit; font-size: 13.5px; }
.sub-inline::placeholder { color: var(--muted); }
.sub-inline:hover { border-color: var(--line); }
.sub-inline:focus { outline: none; border-color: var(--accent-line); background: var(--surface); }

/* ---------- Project overview ---------- */
.overview { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; max-width: 1180px; padding: 22px 24px 96px; }
.ov-main, .ov-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ov-card { padding: 18px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.ov-h { margin: 0 0 10px; font-weight: 600; font-size: 16px; }
.ov-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ov-row .ov-h { margin: 0; }
.ov-desc { width: 100%; min-height: 80px; resize: none; padding: 10px 12px; margin: 0 -12px; width: calc(100% + 24px); border: 1px solid transparent; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 14.5px; line-height: 1.6; }
.ov-desc:hover { border-color: var(--line); }
.ov-desc:focus { outline: none; border-color: var(--accent-line); background: var(--bg); }
.ov-status { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-weight: 500; font-size: 12.5px; }
.ov-status .ic { width: 14px; height: 14px; }
.ov-status.ok { background: var(--ok-soft); color: var(--soon); }
.ov-status.risk { background: var(--danger-soft); color: var(--danger); }
.ov-status.none { background: var(--bg-hover); color: var(--muted); }
.ov-progress { display: flex; align-items: center; gap: 12px; }
.ov-progress .ov-bar { height: 10px; }
.ov-pct { font-weight: 600; font-size: 15px; min-width: 42px; text-align: right; }
.ov-bar { position: relative; flex: 1; height: 6px; overflow: hidden; border-radius: 999px; background: var(--bg-hover); }
.ov-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: var(--ok); transition: width .3s ease; }
.ov-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.ov-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--bg-soft); }
.ov-stat b { font-weight: 600; font-size: 22px; }
.ov-stat span { color: var(--muted); font-size: 12.5px; }
.ov-stat.bad b { color: var(--danger); }
.ov-secs { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.ov-sec { display: grid; grid-template-columns: minmax(0, 160px) minmax(0, 1fr) 48px; align-items: center; gap: 12px; font-size: 13.5px; }
.ov-sec-name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-2); }
.ov-sec-n { color: var(--muted); text-align: right; font-size: 12.5px; }
.ov-feed { display: flex; flex-direction: column; margin: 0 -8px; }
.ov-act { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border: 0; border-radius: 10px; background: none; color: inherit; font: inherit; font-size: 13.5px; line-height: 1.45; text-align: left; cursor: pointer; }
.ov-act:hover { background: var(--bg-hover); }
.ov-act-text { flex: 1; min-width: 0; color: var(--text-2); }
.ov-act-text b { color: var(--text); font-weight: 600; }
.ov-act-task { color: var(--text); font-weight: 500; }
.ov-act time { flex: none; color: var(--muted); font-size: 12px; }
.ov-people { display: flex; flex-direction: column; gap: 2px; }
.ov-person { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.ov-note { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; color: var(--muted); font-size: 12.5px; }
.ov-note .ic { width: 14px; height: 14px; }
.ov-side .w-task { margin: 0 -8px; padding: 0 8px; }
.ov-side .w-proj { display: none; }
.ov-meta { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.ov-meta div { display: flex; justify-content: space-between; gap: 10px; }
.ov-meta span { color: var(--muted); }
.ov-meta b { font-weight: 500; text-align: right; }
@media (max-width: 1100px) { .overview { grid-template-columns: minmax(0, 1fr); } .ov-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .overview { padding: 14px 12px 88px; gap: 14px; } .ov-main, .ov-side { gap: 14px; } .ov-card { padding: 14px; } .ov-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ov-stat { padding: 8px 10px; } .ov-stat b { font-size: 18px; } .ov-sec { grid-template-columns: minmax(0, 110px) minmax(0, 1fr) 40px; } }

/* ---------- Timeline ---------- */
.tl { flex: 1; min-height: 0; overflow: auto; position: relative; --dw: 32px; --tlname: 280px; }
.tl-inner { position: relative; min-width: 100%; min-height: 100%; display: flex; flex-direction: column; }
.tl-head { position: sticky; top: 0; z-index: 6; display: flex; background: var(--bg); border-bottom: 1px solid var(--line); }
.tl-corner { position: sticky; left: 0; z-index: 2; flex: none; width: var(--tlname); display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 0 12px 8px 24px; background: var(--bg); border-right: 1px solid var(--line); color: var(--muted); font-weight: 500; font-size: 12.5px; }
.tl-scale { flex: 1; min-width: 0; }
.tl-months { display: flex; height: 28px; }
.tl-month { flex: none; display: flex; align-items: center; padding: 0 8px; overflow: clip; border-left: 1px solid var(--line); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.tl-month span { position: sticky; left: calc(var(--tlname) + 8px); }
.tl-days { display: flex; height: 34px; }
.tl-day { flex: none; width: var(--dw); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-2); font-size: 11.5px; line-height: 1.15; }
.tl-day small { color: var(--faint); font-size: 9.5px; }
.tl-day.we { background: var(--bg-soft); }
.tl-day.today { color: #fff; }
.tl-day.today { background: var(--accent-solid, var(--accent)); border-radius: 8px; }
.tl-day.today small { color: rgba(255,255,255,.8); }
.tl-body { position: relative; flex: 1; padding-bottom: 60px; }
.tl-bar.narrow .tl-label { visibility: hidden; }
.tl-today { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--accent); opacity: .55; z-index: 3; pointer-events: none; }
.tl-sec { display: flex; height: 36px; align-items: flex-end; border-bottom: 1px solid var(--line); }
.tl-sec-name { position: sticky; left: 0; padding: 0 12px 7px 24px; font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.tl-row { display: flex; height: 40px; border-bottom: 1px solid var(--line); }
.tl-name { position: sticky; left: 0; z-index: 4; flex: none; width: var(--tlname); display: flex; align-items: center; gap: 8px; padding: 0 12px 0 24px; background: var(--bg); border-right: 1px solid var(--line); cursor: pointer; }
.tl-row:hover .tl-name, .tl-row.open .tl-name { background: var(--bg-hover); }
.tl-name:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.tl-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13.5px; }
.tl-row.done .tl-title { color: var(--muted); }
.tl-lane { position: relative; flex: 1; cursor: default; background-image: repeating-linear-gradient(90deg, transparent 0 calc(var(--dw) * 5), var(--bg-soft) calc(var(--dw) * 5) calc(var(--dw) * 7)); }
.tl-lane.unscheduled { cursor: copy; }
.tl-lane.unscheduled:hover::after { content: 'Click a day to set the due date'; position: sticky; left: calc(var(--tlname) + 12px); display: inline-block; margin-top: 11px; color: var(--muted); font-size: 12px; pointer-events: none; }
.tl-bar { position: absolute; top: 7px; height: 26px; display: flex; align-items: center; min-width: 12px; border-radius: 7px; background: color-mix(in srgb, var(--c, var(--accent)) 82%, #000 0%); color: #fff; font-size: 12.5px; font-weight: 500; cursor: grab; touch-action: none; user-select: none; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tl-bar.late { background: var(--danger); }
.tl-bar.done { background: color-mix(in srgb, var(--c, var(--accent)) 35%, var(--bg)); color: var(--text-2); }
.tl-bar.dragging { cursor: grabbing; box-shadow: 0 6px 16px rgba(0,0,0,.22); z-index: 5; }
.tl-label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 4px; padding: 0 4px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; pointer-events: none; }
.tl-label .ic { width: 13px; height: 13px; flex: none; }
.tl-h { flex: none; align-self: stretch; width: 8px; cursor: ew-resize; border-radius: 7px; }
.tl-bar:hover .tl-h { background: rgba(255,255,255,.28); }
.tl-tip { display: none; position: absolute; left: 0; bottom: calc(100% + 6px); padding: 4px 8px; border-radius: 6px; background: #24262a; color: #fff; font-size: 12px; white-space: nowrap; pointer-events: none; }
.tl-bar.dragging .tl-tip:not(:empty) { display: block; }
.tl-after { position: absolute; top: 12px; color: var(--text-2); font-size: 12.5px; white-space: nowrap; pointer-events: none; }
.tl-empty { position: sticky; left: 0; padding: 40px 24px; color: var(--muted); }
.tl-hint { display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; }
.tl-hint .ic { width: 15px; height: 15px; }
@media (max-width: 760px) { .tl { --tlname: 150px; } .tl-name { padding-left: 12px; } .tl-name .av-stack, .tl-name .avs { display: none; } .tl-corner { padding-left: 12px; } .tl-corner span { display: none; } .tl-hint { display: none; } }

/* ---------- Mentions ---------- */
.pop-mention { min-width: 240px; }
.pop-mention .mi.on { background: var(--bg-active); }
.mention { padding: 0 3px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-weight: 500; }

/* ---------- Sortable column headers ---------- */
.lh-btn { justify-content: flex-start; gap: 4px; border-top: 0; border-right: 0; border-bottom: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.lh-btn:hover { color: var(--text); background: var(--bg-hover); }
.lh-btn.on { color: var(--text); }
.lh-ic { width: 13px; height: 13px; }
.side .proj-item.over { background: var(--side-active); box-shadow: inset 0 0 0 2px var(--accent); border-radius: 8px; }

/* ---------- Inbox filters ---------- */
.ib-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ib-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.ib-chip:hover { border-color: var(--line-strong); color: var(--text); }
.ib-chip.on { border-color: var(--text); background: var(--text); color: var(--bg); }
.ib-n { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 9px; background: var(--accent-solid, var(--accent)); color: #fff; font-size: 11px; }
.ib-sub { margin: 6px 0 4px; }
.ib-day { margin: 18px 0 4px 22px; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.ib-item .ib-check { position: absolute; right: 16px; top: 40px; opacity: 0; transition: opacity .1s; }
.ib-item:hover .ib-check, .ib-item .ib-check:focus-visible, .ib-item .ib-check.on { opacity: 1; }
.ib-item.open { background: var(--bg-hover); }
@media (hover: none) { .ib-item .ib-check { opacity: 1; } }

/* ---------- Project status ---------- */
.on_track { --st-fg: var(--soon); --st-bg: var(--ok-soft); }
.at_risk { --st-fg: var(--pri-medium); --st-bg: var(--pri-medium-bg); }
.off_track { --st-fg: var(--pri-high); --st-bg: var(--pri-high-bg); }
.on_hold { --st-fg: var(--pri-low); --st-bg: var(--pri-low-bg); }
.st-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border: 0; border-radius: 999px; background: var(--st-bg); color: var(--st-fg); font: inherit; font-size: 12px; font-weight: 600; white-space: nowrap; }
.st-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
button.st-pill { cursor: pointer; margin-left: 4px; }
button.st-pill:hover { filter: brightness(.96); }
.st-pill.none { --st-fg: var(--text-2); --st-bg: transparent; border: 1px dashed var(--line-strong); }
.st-pill.none::before { display: none; }
.st-pill.none:hover { --st-fg: var(--text); border-style: solid; filter: none; }
.st-txt { color: var(--st-fg); font-weight: 600; }
.ov-pstatus { border-top: 3px solid var(--st-fg, var(--line)); }
.st-empty { margin: 4px 0 12px; }
.st-post { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.st-body { min-width: 0; flex: 1; }
.st-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; font-size: 13px; }
.st-meta time { font-size: 12px; }
.st-text { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); font-size: 14px; line-height: 1.5; }
.st-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.st-label { margin-right: 2px; color: var(--muted); font-size: 12.5px; }
.st-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.st-btn:hover { border-color: var(--st-fg); color: var(--text); }
.st-btn.on { border-color: var(--st-fg); background: var(--st-bg); color: var(--st-fg); font-weight: 600; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-fg); }
.st-compose { margin-top: 10px; }
.st-input { width: 100%; min-height: 76px; resize: vertical; line-height: 1.5; }
.st-actions { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.st-history { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.st-history summary { cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 500; padding: 4px 0; }
.st-history summary:hover { color: var(--text); }
.st-history .st-post { padding: 6px 0; }
.st-history .st-text { color: var(--text-2); font-size: 13px; }
@media (max-width: 720px) { .top button.st-pill.none { display: none; } .st-hint { display: none; } }

/* ---------- Calendar bars for tasks with a start date ---------- */
.chip-ph { display: block; height: 24px; flex: none; }
.chip.span { width: auto; position: relative; }
.chip.span:not(.s-end):not(.s-cut) { margin-right: -6px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.chip.span:not(.s-start) { margin-left: -5px; border-left-width: 0; padding-left: 11px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.chip.span.s-cut { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.chip.span[aria-hidden="true"] span { display: none; }
.chip.span:hover, .chip.span.hl { background: color-mix(in srgb, var(--c) 24%, var(--surface)); }
.chip.span.done.hl, .chip.span.done:hover { background: var(--line); }
.chip.span { overflow: visible; }
.chip .span-label { position: relative; z-index: 1; pointer-events: none; flex: none; max-width: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; padding-right: 8px; }
@media (max-width: 720px) {
  .chip-ph { height: 18px; }
  .chip.span:not(.s-end):not(.s-cut) { margin-right: -3px; }
  .chip.span:not(.s-start) { margin-left: -2px; padding-left: 5px; }
}

/* ---------- Group overview (portfolio) ---------- */
.grp-chev { flex: none; display: grid; place-items: center; width: 24px; height: 32px; margin-left: 2px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--side-muted); cursor: pointer; }
.grp-chev:hover { color: var(--side-text); }
.grp-chev .chev { width: 16px; height: 16px; }
.grp-head .grp-toggle { padding-left: 2px; }
.grp-head.on { background: var(--side-active); }
.proj-desc.plain { cursor: default; }
.pf { max-width: 1180px; margin: 0 auto; padding: 20px 24px 40px; }
.pf-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pf-sum { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--text-2); font-size: 13.5px; }
.pf-sum-i { display: inline-flex; align-items: center; gap: 6px; }
.pf-sum-i b { color: var(--text); font-weight: 600; }
.st-dot.none { background: var(--line-strong); }
.pf-table { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.pf-row { display: grid; grid-template-columns: minmax(200px, 1.6fr) minmax(150px, 1fr) minmax(140px, 1fr) 70px 80px minmax(150px, 1.2fr) 64px; align-items: center; gap: 12px; min-height: 52px; padding: 6px 16px; border-top: 1px solid var(--line); }
.pf-row:first-child { border-top: 0; }
.pf-row:not(.pf-head):hover { background: var(--bg-hover); }
.pf-head { min-height: 38px; background: var(--surface-2); color: var(--muted); font-weight: 500; font-size: 12px; }
.pf-link { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-weight: 500; font-size: 14px; text-align: left; cursor: pointer; }
.pf-link:hover .pf-title { text-decoration: underline; text-underline-offset: 2px; }
.pf-ic { --c: var(--accent); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--c); color: #fff; }
.pf-ic .ic { width: 15px; height: 15px; }
.pf-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-st { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pf-st .st-pill { margin-left: 0; }
.pf-when { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pf-prog { display: flex; align-items: center; gap: 8px; }
.pf-prog .ov-bar { flex: 1; }
.pf-pct { width: 36px; text-align: right; color: var(--text-2); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pf-num { text-align: right; font-variant-numeric: tabular-nums; }
.pf-num.bad { color: var(--danger); font-weight: 600; }
.pf-k { display: none; }
.pf-next { min-width: 0; }
.pf-task { display: flex; align-items: baseline; gap: 8px; min-width: 0; max-width: 100%; padding: 0; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.pf-task .w-due { flex: none; font-size: 12.5px; }
.pf-task-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-task:hover .pf-task-t { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.pf-owner { display: flex; justify-content: flex-end; }
.pf-foot { margin-top: 12px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
@media (max-width: 980px) {
  .pf-row { grid-template-columns: minmax(160px, 1.5fr) minmax(130px, 1fr) minmax(110px, 1fr) 56px 70px; }
  .pf-next, .pf-owner, .pf-head > :nth-child(6), .pf-head > :nth-child(7) { display: none; }
}
@media (max-width: 720px) {
  .pf { padding: 14px 12px 32px; }
  .pf-head { display: none; }
  .pf-row { grid-template-columns: 1fr auto; grid-template-areas: "name st" "prog prog" "open over"; gap: 8px 12px; padding: 12px 14px; }
  .pf-name { grid-area: name; min-width: 0; }
  .pf-st { grid-area: st; }
  .pf-when { display: none; }
  .pf-prog { grid-area: prog; }
  .pf-num { text-align: left; font-size: 13px; }
  .pf-num:nth-child(4) { grid-area: open; }
  .pf-num:nth-child(5) { grid-area: over; text-align: right; }
  .pf-k { display: inline; margin-right: 6px; color: var(--muted); font-weight: 400; }
}

/* ---------- Teammate page ---------- */
button.t-person, button.ov-person { width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
button.t-person:hover, button.ov-person:hover { background: var(--bg-hover); }
button.ov-person { display: flex; align-items: center; gap: 10px; padding: 6px 8px; margin: 0 -8px; width: calc(100% + 16px); border-radius: 10px; }
.pp-group { display: flex; align-items: baseline; gap: 6px; margin: 16px 0 4px; color: var(--text-2); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.pp-group:first-of-type { margin-top: 4px; }
.pp-group.bad { color: var(--danger); }
.pp-more { margin: 6px 0 0 8px; }
.pp-proj { display: flex; align-items: center; gap: 10px; width: calc(100% + 16px); margin: 0 -8px; padding: 8px; border: 0; border-radius: 8px; background: none; color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.pp-proj:hover { background: var(--bg-hover); }
.pp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.overview.person .ov-stats { margin-top: 0; }
.overview.person .ov-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .overview.person .ov-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Accessibility ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
h2.ov-h, h2.list-sub { font-size: inherit; }
.ov-h { font-size: 16px; }
.list-sub { font-size: 15px; }
h3.pp-group { font-size: 12px; }
/* White text on the accent color needs a deeper blue in dark mode. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --accent-solid: #5c70ca; --accent-solid-hover: #4f63bd; } }
:root[data-theme="dark"] { --accent-solid: #5c70ca; --accent-solid-hover: #4f63bd; }

/* ---------- Team workload ---------- */
.tm-intro { margin: 0 0 12px; }
.tm-row { grid-template-columns: minmax(200px, 1.4fr) minmax(120px, 1fr) 60px 72px 84px 104px minmax(160px, 1.3fr); }
.tm-row .pf-link .av { flex: none; }
.ov-fill.late { background: var(--pri-medium-dot); }
.tm-un { margin-top: 18px; }
@media (max-width: 1100px) { .tm-row { grid-template-columns: minmax(170px, 1.4fr) minmax(100px, 1fr) 56px 70px 80px; } .tm-row .tm-done, .tm-row .pf-next, .tm-row.pf-head > :nth-child(6), .tm-row.pf-head > :nth-child(7) { display: none; } }
@media (max-width: 720px) {
  .tm-row { grid-template-columns: 1fr auto auto; grid-template-areas: "name name name" "prog prog prog" "open over week"; }
  .tm-row .pf-prog { grid-area: prog; }
  .tm-row .pf-num:nth-child(3) { grid-area: open; }
  .tm-row .pf-num:nth-child(4) { grid-area: over; text-align: left; }
  .tm-row .tm-week { grid-area: week; display: block; text-align: right; }
}

/* ---------- Calendar week view ---------- */
.cal-seg { align-self: center; }
.seg.sm .seg-btn { padding: 4px 12px; font-size: 12.5px; }
.cal-grid.week { grid-auto-rows: minmax(440px, 1fr); }
.cal-grid.week .day-n { width: auto; padding: 0 8px; border-radius: 12px; }
.cal-grid.week .day.today .day-n { padding: 0 8px; }
@media (max-width: 720px) {
  .cal-grid.week { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; }
  .cal-grid.week .day { min-height: 64px; }
  .cal-grid.week .chip { height: 26px; font-size: 12.5px; padding: 0 8px; }
  .cal-grid.week .chip.span { margin-left: 0; margin-right: 0; border-radius: 5px; border-left-width: 3px; padding-left: 8px; }
  .cal-grid.week .chip.span[aria-hidden="true"] span { display: inline; }
  .cal-grid.week .chip-ph { display: none; }
  .cal-grid.week .chip .span-label { width: auto !important; }
  .cal-dow.week { display: none; }
  .cal-bar { flex-wrap: wrap; row-gap: 8px; }
  .cal-title { font-size: 15px; white-space: nowrap; }
  .cal-seg { margin-left: auto; }
}

/* ---------- Reorder subtasks in the panel ---------- */
.sub .sub-grip { width: 14px; margin-left: -4px; align-self: center; height: 24px; cursor: grab; opacity: 0; }
.sub:hover .sub-grip, .sub:focus-within .sub-grip { opacity: 1; }
.sub.dragging { opacity: .45; }
.subs > .dnd-ph { height: 0; border-top: 2px solid var(--accent); margin: -1px 0; position: relative; z-index: 2; }
@media (hover: none) { .sub .sub-grip { opacity: .6; } }

/* ---------- List: group by assignee / due date / priority ---------- */
.gb-name { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 4px 6px; font-size: 15.5px; font-weight: 600; color: var(--text); min-width: 0; }
.gb-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gb-name .gb-pri { pointer-events: none; height: 24px; }
.sec.gb { border-radius: 8px; transition: background-color .12s ease, box-shadow .12s ease; }
.sec.gb.over { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.sec.gb.over .sec-head { background: transparent; }
@media (max-width: 720px) {
  /* Group and Sort shrink to icons on phones; the label stays for screen readers. */
  .toolbar { position: relative; }
  .toolbar .tb-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* ---------- Home: tasks I've assigned ---------- */
.home-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.w-assigned .w-who { flex: none; display: inline-flex; }
.w-empty.sm { padding: 18px 10px; font-size: 13px; }
.w-foot { padding: 10px 0 2px; font-size: 12.5px; }

/* ---------- Overview: completed per week ---------- */
.ov-trend { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.ov-sub { margin: 0; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
.tr-plot { position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; height: 128px; padding-top: 32px; margin-top: 6px; border-bottom: 1px solid var(--line-strong); }
.tr-col { position: relative; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.tr-col:hover { background: var(--bg-hover); border-radius: 6px 6px 0 0; }
.tr-bar { display: block; width: min(28px, 70%); min-height: 0; border-radius: 4px 4px 0 0; background: var(--accent-solid, var(--accent)); opacity: .55; transition: height .3s ease; }
.tr-col.cur .tr-bar { opacity: 1; }
.tr-bar.zero { height: 0; }
.tr-n { margin-bottom: 4px; font-size: 12px; font-weight: 600; color: var(--text); }
.tr-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 3; padding: 5px 8px; border-radius: 6px; background: var(--text); color: var(--bg); font-size: 12px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s ease; box-shadow: var(--shadow-sm); }
.tr-col:hover .tr-tip { opacity: 1; }
.tr-col:first-child .tr-tip { left: 0; transform: none; }
.tr-col:last-child .tr-tip { left: auto; right: 0; transform: none; }
.tr-axis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; margin-top: 6px; }
.tr-axis span { overflow: hidden; color: var(--muted); font-size: 11.5px; text-align: center; white-space: nowrap; text-overflow: ellipsis; }
.tr-axis span:last-child { color: var(--text-2); font-weight: 500; }
@media (max-width: 760px) { .tr-axis span:nth-child(odd):not(:last-child) { visibility: hidden; } }

/* ---------- Hide the sidebar on larger screens ---------- */
.side-hide { margin-left: auto; color: var(--side-muted); }
.side-hide:hover { background: var(--side-hover); color: var(--side-text); }
@media (min-width: 761px) {
  .app.side-hidden { grid-template-columns: minmax(0, 1fr); }
  .app.side-hidden.has-panel { grid-template-columns: minmax(0, 1fr) var(--panel-w); }
  .app.side-hidden .side { display: none; }
  .app.side-hidden .main { grid-column: 1; }
  .app.side-hidden .panel { grid-column: 2; }
  .app.side-hidden .menu-btn { display: inline-grid; }
}
@media (min-width: 761px) and (max-width: 1180px) { .app.side-hidden.has-panel { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .side-hide { display: none; } }

/* ---------- CSV import ---------- */
.imp { margin-top: 12px; }
.imp-file { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft, var(--bg)); font-weight: 500; overflow: hidden; }
.imp-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-file .ic { flex: none; color: var(--muted); }
.imp-list { margin: 12px 0 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.imp-list li + li { margin-top: 4px; }

/* ---------- Phones: bottom tab bar ---------- */
.tabbar { display: none; }
@media (max-width: 760px) {
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 18px rgba(0, 0, 0, .05); }
  .tb-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 52px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-size: 11px; font-weight: 500; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tb-item .ic { width: 22px; height: 22px; }
  .tb-item:active { background: var(--bg-hover); }
  .tb-item.on { color: var(--text); font-weight: 600; }
  .tb-item.on .ic { color: var(--accent-solid, var(--accent)); }
  .tb-badge { position: absolute; top: 5px; left: calc(50% + 5px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #c13e37; color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
  .main { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
  .has-bulk .main { padding-bottom: 0; }
  .has-bulk .tabbar, .app:has(.main input:focus, .main textarea:focus) .tabbar { display: none; }
  .toasts { bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* ---------- Timeline zoom ---------- */
.tl-zoom { align-self: center; margin-right: 4px; }
.tl.z-week { --dw: 12px; }
.tl.z-month { --dw: 5px; }
.tl.z-month .tl-lane { background-image: repeating-linear-gradient(90deg, transparent 0 calc(var(--dw) * 7 - 1px), var(--line) calc(var(--dw) * 7 - 1px) calc(var(--dw) * 7)); }
.tl-wk { flex: none; display: flex; align-items: center; min-width: 0; padding-left: 6px; border-left: 1px solid var(--line); color: var(--text-2); font-size: 11.5px; white-space: nowrap; overflow: hidden; }
.tl-wk.today { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.z-month .tl-wk { padding-left: 3px; font-size: 10.5px; }
@media (max-width: 720px) { .tl-zoom .seg-btn { padding: 4px 9px; } }

/* ---------- Calendar: tasks without a due date ---------- */
.cal-main { flex: 1; display: flex; align-items: flex-start; min-height: 0; }
.cal-main > .cal { flex: 1; min-width: 0; align-self: stretch; }
.cal-tray { position: sticky; top: 8px; flex: none; display: flex; flex-direction: column; width: 260px; max-height: calc(100vh - 220px); margin: 0 24px 24px -8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.tray-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 10px 0 14px; }
.tray-head h3 { margin: 0; font-size: 14px; font-weight: 600; }
.tray-hint { margin: 4px 14px 8px; color: var(--muted); font-size: 12px; }
.tray-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 8px 10px; }
.tray-item { --c: var(--accent); display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 8px; border-radius: 8px; cursor: grab; }
.tray-item:hover { background: var(--bg-hover); }
.tray-item:focus-visible { outline: none; box-shadow: var(--focus); }
.tray-item.dragging { opacity: .45; }
.tray-dot { flex: none; width: 8px; height: 8px; border-radius: 3px; background: var(--c); }
.tray-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.tray-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 8px; color: var(--muted); font-size: 12.5px; text-align: center; }
.tray-more { padding: 6px 8px; }
@media (max-width: 760px) { .cal-tray { display: none; } }

/* ---------- Search: filter chips ---------- */
.sf-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: 24px 0 10px; }
.sf-head .list-sub { margin: 0 auto 0 0; }
.sf-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.sf-chip { height: 28px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.sf-chip:hover { border-color: var(--muted); color: var(--text); }
.sf-chip.on { border-color: var(--text); background: var(--text); color: var(--bg); }
.sf-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line-strong); }
@media (max-width: 760px) { .sf-sep { display: none; } }

/* ---------- Completing a task: a little confetti ---------- */
.burst { position: fixed; z-index: 120; width: 0; height: 0; pointer-events: none; }
.burst i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 2px; animation: burst .62s cubic-bezier(.16, .8, .3, 1) forwards; }
.burst i:nth-child(3n) { border-radius: 50%; }
.burst i:nth-child(4n) { width: 4px; height: 8px; }
@keyframes burst {
  0% { transform: translate(0, 0) scale(.6); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(140deg) scale(.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .burst { display: none; } }

/* ---------- Loading: skeleton of the app ---------- */
.sk-app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; background: var(--bg); }
.sk-side { display: flex; flex-direction: column; gap: 12px; padding: 18px 16px; background: var(--side-bg); color: var(--side-text); }
.sk-side .brand { margin-bottom: 8px; }
.sk-side .sk { background: rgba(255, 255, 255, .08); }
.sk-main { display: flex; flex-direction: column; min-width: 0; }
.sk-top { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.sk-list { display: flex; flex-direction: column; gap: 0; padding: 18px 24px; }
.sk-row { display: flex; align-items: center; gap: 12px; height: 42px; border-bottom: 1px solid var(--line); }
.sk { position: relative; display: block; flex: none; height: 12px; overflow: hidden; border-radius: 6px; background: var(--bg-hover); }
.sk::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--surface) 65%, transparent), transparent); animation: sk-shine 1.4s ease-in-out infinite; }
.sk-side .sk::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); }
@keyframes sk-shine { to { transform: translateX(100%); } }
.sk-btn { width: 96px; height: 34px; border-radius: 999px; }
.sk-nav { width: 70%; height: 14px; }
.sk-nav:nth-of-type(2n) { width: 55%; }
.sk-h { width: 120px; height: 14px; margin: 18px 0 10px; }
.sk-side .sk-h { width: 60px; height: 10px; margin: 10px 0 0; }
.sk-ic { width: 36px; height: 36px; border-radius: 10px; }
.sk-title { width: 180px; height: 18px; }
.sk-search { width: 240px; height: 32px; border-radius: 999px; }
.sk-c { width: 16px; height: 16px; border-radius: 50%; }
.sk-t { width: 46%; }
.sk-row:nth-child(3n) .sk-t { width: 34%; }
.sk-row:nth-child(3n + 1) .sk-t { width: 58%; }
.sk-a { width: 22px; height: 22px; margin-left: auto; border-radius: 50%; }
.sk-d { width: 64px; }
.sk-slow { display: flex; align-items: center; gap: 12px; padding: 14px 24px 0; }
.sk-slow p { margin: 0; }
@media (prefers-reduced-motion: reduce) { .sk::after { display: none; } }
@media (max-width: 760px) {
  .sk-app { grid-template-columns: minmax(0, 1fr); }
  .sk-side { display: none; }
  .sk-search { display: none; }
  .sk-top, .sk-list { padding-left: 14px; padding-right: 14px; }
}

/* ---------- Dragging several selected tasks ---------- */
.drag-count { position: fixed; top: -100px; left: -100px; padding: 6px 12px; border-radius: 8px; background: var(--accent-solid, var(--accent)); color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- Home: what's new ---------- */
.whats-new { margin: 0 0 20px; padding: 16px 20px; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.wn-head { display: flex; align-items: center; gap: 8px; }
.wn-head .ic { color: var(--accent-solid, var(--accent)); }
.wn-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.wn-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 24px; margin: 10px 0 0; padding: 0 0 0 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.wn-list b { color: var(--text); font-weight: 600; }

/* ---------- Skip link and offline notice ---------- */
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 200; padding: 8px 14px; border: 0; border-radius: 8px; background: var(--accent-solid, var(--accent)); color: #fff; font: inherit; font-weight: 600; transform: translateY(-200%); transition: transform .15s ease; }
.skip-link:focus { transform: none; outline: none; box-shadow: var(--focus); }
.body:focus { outline: none; }
.offline-bar { position: fixed; top: 0; left: 50%; z-index: 150; transform: translateX(-50%); margin-top: 8px; padding: 8px 16px; border-radius: 999px; background: #3b3f46; color: #fff; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); max-width: calc(100vw - 24px); text-align: center; }
.offline-bar[hidden] { display: none; }

/* ---------- Project header: people ---------- */
.proj-people { display: inline-flex; align-items: center; margin-right: 12px; padding: 3px 6px; border: 0; border-radius: 999px; background: none; cursor: pointer; }
.proj-people:hover { background: var(--bg-hover); }

/* ---------- Due date picker ---------- */
.pop-date { width: 272px; padding: 8px; }
.dp-quick { display: grid; gap: 2px; padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.dp-q { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 30px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent; color: var(--text); font-size: 13px; text-align: left; }
.dp-q small { color: var(--muted); font-size: 12px; }
.dp-q:hover, .dp-q:focus-visible { background: var(--bg-hover); }
.dp-q:focus-visible { outline: none; box-shadow: var(--focus); }
.dp-q.on { color: var(--accent); font-weight: 600; }
.dp-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 6px; }
.dp-head b { font-size: 13px; font-weight: 600; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-wd { display: grid; place-items: center; height: 22px; color: var(--muted); font-size: 11px; font-weight: 600; }
.dp-day { display: grid; place-items: center; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dp-day:hover { background: var(--bg-hover); }
.dp-day:focus-visible { outline: none; box-shadow: var(--focus); }
.dp-day.past:not(.on) { color: var(--text-2); }
.dp-day.other:not(.on) { color: var(--muted); }
.dp-day.today { color: var(--accent); font-weight: 700; }
.dp-day.on { background: var(--accent-solid, var(--accent)); color: #fff; font-weight: 600; }
.dp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; margin-top: 6px; padding: 6px 2px 0; border-top: 1px solid var(--line); }
.due-chip { height: 22px; margin: 0 -4px; padding: 0 4px; border: 0; border-radius: 6px; background: transparent; font-size: 12.5px; }
.due-chip:hover { background: var(--bg-hover); }
.due-chip:focus-visible { outline: none; box-shadow: var(--focus); }
.date-btn { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.date-btn .ic { width: 15px; height: 15px; color: var(--muted); }
.date-btn.unset { color: var(--muted); }
.date-btn.overdue { color: var(--danger); }
