/* Keif Work styles. Colors are tokens so light and dark themes share every rule. */
:root, [data-theme="light"] {
  --chrome: #eef0f8; --bg: #eef0f8; --panel: #ffffff; --panel-2: #f6f7fb; --row-hover: #f5f6f8; --hover: #dcdfec;
  --border: #c3c6d4; --line: #e1e3eb; --text: #323338; --muted: #676879; --icon: #676879;
  --accent: #0073ea; --accent-hover: #0060b9; --accent-text: #ffffff; --accent-soft: #cce5ff;
  --selected: #cce5ff; --danger: #d83a52; --warn: #e2a400; --ok: #00a35c; --mention: #dbe9fe; --mention-text: #0060b9;
  --shadow: 0 6px 20px rgba(0, 0, 0, .14); --card-shadow: 0 0 0 1px rgba(0, 0, 0, .03), 0 2px 8px rgba(0, 0, 0, .04);
  --overlay: rgba(41, 47, 76, .45); --input: #ffffff;
  --s-not_started: #c4c4c4; --s-working: #fdab3d; --s-review: #0086c0; --s-changes: #e2445c; --s-done: #00c875; --s-text: #ffffff;
  color-scheme: light;
}
[data-theme="dark"] {
  --chrome: #292f4c; --bg: #292f4c; --panel: #181b34; --panel-2: #21243f; --row-hover: #262a47; --hover: #3a3f62;
  --border: #4b4e69; --line: #33375a; --text: #d5d8df; --muted: #9699a6; --icon: #c5c7d0;
  --accent: #0073ea; --accent-hover: #2e8bff; --accent-text: #ffffff; --accent-soft: #133774;
  --selected: #133774; --danger: #ff6b81; --warn: #ffcb4d; --ok: #3ad38f; --mention: #1f3a66; --mention-text: #8cb8ff;
  --shadow: 0 6px 24px rgba(0, 0, 0, .5); --card-shadow: none; --overlay: rgba(5, 7, 20, .6); --input: #21243f;
  --s-not_started: #797e93;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--chrome); color: var(--text); font: 14px/1.45 Figtree, Roboto, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--accent); }
input, textarea, select { background: var(--input); border: 1px solid var(--border); border-radius: 4px; padding: 7px 10px; }
input:hover, textarea:hover, select:hover { border-color: var(--text); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.small svg.i, svg.i.sm { width: 16px; height: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 4px; padding: 7px 14px; border: 1px solid var(--border); background: var(--panel); white-space: nowrap; height: 32px; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.small { padding: 4px 10px; font-size: 13px; height: 28px; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- login (same dark look in both themes) ---------- */
.auth {
  min-height: 100%; display: grid; place-items: center; padding: 24px 16px; color-scheme: dark;
  background:
    radial-gradient(circle at 14% 22%, rgba(46, 63, 214, .55), transparent 32%),
    radial-gradient(circle at 88% 84%, rgba(46, 63, 214, .38), transparent 30%),
    #0b0e1c;
}
.auth form {
  width: 100%; max-width: 420px; display: grid; gap: 14px; padding: 44px 40px 32px; border-radius: 26px; text-align: center;
  background: linear-gradient(180deg, rgba(22, 26, 52, .82), rgba(18, 24, 66, .78));
  border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 30px 80px rgba(0, 0, 0, .55);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); color: #f3f4fa;
}
.auth-mark { display: block; margin: 0 auto 10px; height: 54px; width: auto; }
.auth h1 { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.4px; color: #fff; }
.auth .auth-tag { margin: -6px 0 12px; color: #b7bbd3; font-size: 17px; }
.auth .auth-note { margin: 0 0 4px; color: #b7bbd3; font-size: 13px; }
.auth label { display: block; }
.auth .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.auth input {
  width: 100%; height: 54px; padding: 0 18px; border-radius: 12px; font-size: 16px; color: #fff;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14);
}
.auth input::placeholder { color: #9a9fbd; }
.auth input:hover { border-color: rgba(255, 255, 255, .28); }
.auth input:focus { border-color: #5b6bff; box-shadow: 0 0 0 3px rgba(91, 107, 255, .3); background: rgba(255, 255, 255, .1); }
.auth-btn { height: 54px; border-radius: 12px; background: #2e3fd6; color: #fff; font-size: 17px; font-weight: 600; transition: background .15s, transform .05s; }
.auth-btn:hover { background: #3a4cf0; }
.auth-btn:active { transform: translateY(1px); }
.auth .err { color: #ff8095; min-height: 0; }
.auth .err:empty { display: none; }
.auth .auth-foot { margin: 22px 0 0; color: #9a9fbd; font-size: 13px; }
.err { color: var(--danger); font-size: 13px; min-height: 1em; }

/* ---------- logo ---------- */
.brand, .auth-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-img { display: block; height: 28px; width: auto; }
.auth .logo-img { height: 44px; }
.wordmark-text { font-weight: 700; font-size: 19px; letter-spacing: -.3px; white-space: nowrap; }
.auth .wordmark-text { font-size: 26px; }
[data-theme="dark"] .logo-img { filter: brightness(1.75) saturate(.85); }

/* ---------- app shell (monday layout) ---------- */
.app { display: grid; grid-template-rows: 56px 1fr; height: 100vh; height: 100dvh; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 16px 0 20px; background: var(--chrome); }
.brand { display: flex; align-items: center; text-decoration: none; min-width: 0; }
.top-search { flex: 1; max-width: 560px; margin: 0 auto; position: relative; display: flex; align-items: center; }
.top-search svg { position: absolute; left: 12px; color: var(--icon); pointer-events: none; }
.top-search input { width: 100%; height: 38px; border-radius: 20px; padding-left: 40px; background: var(--panel-2); border-color: transparent; }
[data-theme="light"] .top-search input { background: #e3e6f0; }
.top-search input:hover { border-color: var(--border); }
.top-actions { display: flex; align-items: center; gap: 4px; }
.top-actions .divider { width: 1px; height: 24px; background: var(--border); margin: 0 8px; }
.icon-btn { position: relative; width: 40px; height: 40px; border-radius: 6px; display: grid; place-items: center; color: var(--icon); }
.icon-btn:hover { background: var(--hover); }
.badge { position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--chrome); }
.me-btn { border-radius: 50%; }
.shell { display: flex; min-height: 0; }
.rail { width: 84px; flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; overflow-y: auto; }
.rail button { width: 72px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px; border-radius: 8px; font-size: 12px; color: var(--text); }
.rail button svg { width: 22px; height: 22px; color: var(--icon); }
.rail button:hover { background: var(--hover); }
.rail button[aria-pressed="true"] { background: var(--accent-soft); }
.rail button[aria-pressed="true"] svg { color: var(--accent); }
[data-theme="dark"] .rail button[aria-pressed="true"] svg { color: #8cb8ff; }
.rail hr { width: 48px; border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.board { flex: 1; min-width: 0; overflow: hidden; display: flex; }
.board-card { flex: 1; min-width: 0; background: var(--panel); border-radius: 16px 0 0 0; box-shadow: var(--card-shadow); overflow: auto; padding: 22px 28px 80px; }
.board-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.board-head h1 { margin: 0; font-size: 28px; font-weight: 600; letter-spacing: -.3px; }
.board-sub { color: var(--muted); font-size: 13px; }
.views { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 12px 0 16px; overflow-x: auto; }
.views button { padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--text); white-space: nowrap; border-radius: 4px 4px 0 0; margin-bottom: -1px; }
.views button:hover { background: var(--hover); }
.views button[aria-pressed="true"] { border-bottom-color: var(--accent); font-weight: 500; }
.toolbar { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 22px; }
.split { display: inline-flex; margin-right: 12px; }
.split .btn:first-child { border-radius: 4px 0 0 4px; }
.split .caret { border-radius: 0 4px 4px 0; padding: 0 6px; border-left: 1px solid rgba(255,255,255,.35); }
.tb { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 4px; color: var(--text); white-space: nowrap; }
.tb svg { color: var(--icon); width: 19px; height: 19px; }
.tb:hover { background: var(--hover); }
.tb.on { background: var(--accent-soft); }
.tb .count { background: var(--accent); color: #fff; border-radius: 8px; font-size: 11px; padding: 0 6px; font-weight: 600; }
.tb-search { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px 0 10px; border-radius: 4px; border: 1px solid transparent; }
.tb-search:hover { background: var(--hover); }
.tb-search:focus-within { border-color: var(--accent); background: transparent; }
.tb-search svg { color: var(--icon); width: 19px; height: 19px; }
.tb-search input { border: 0 !important; box-shadow: none !important; background: transparent; padding: 0; width: 70px; transition: width .15s; }
.tb-search input:focus, .tb-search input:not(:placeholder-shown) { width: 180px; }

  /* ---------- groups & table ---------- */
  .group { margin-bottom: 34px; }
  .group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; position: sticky; left: 0; }
  .group-head .chev { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; transition: transform .15s; }
  .group-head .chev:hover { background: var(--hover); }
  .group.collapsed .chev { transform: rotate(-90deg); }
  .group-name { font-size: 18px; font-weight: 500; border-radius: 4px; padding: 0 4px; }
  .group-name[contenteditable="true"] { outline: 1px solid var(--accent); }
  .group-count { color: var(--muted); font-size: 13px; }
  .table-wrap { overflow-x: auto; border-radius: 8px; }
  table.tasks { border-collapse: separate; border-spacing: 0; min-width: 1120px; width: 100%; background: var(--panel); }
  .tasks th, .tasks td { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); height: 40px; padding: 0; text-align: center; font-weight: 400; }
  .tasks th { color: var(--muted); font-size: 13px; padding: 0 8px; border-top: 1px solid var(--line); background: var(--panel); }
  .tasks tr > :first-child { border-left: 6px solid var(--gc); }
  .tasks thead tr > :first-child { border-top-left-radius: 8px; }
  .tasks tr:hover td { background: var(--row-hover); }
  .tasks tr.open td { background: var(--selected); }
  .tasks td.name-cell, .tasks th.name-cell { text-align: left; position: sticky; left: 0; z-index: 1; background: var(--panel); width: 340px; min-width: 260px; }
  .tasks tr:hover td.name-cell { background: var(--row-hover); }
  .tasks tr.open td.name-cell { background: var(--selected); }
  .name-inner { display: flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; height: 40px; }
  .name-inner .tname { flex: 1; min-width: 0; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 0; }
  .name-inner .tname:hover { text-decoration: underline; }
  .bubble { position: relative; width: 32px; height: 30px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); font-size: 17px; flex: none; }
  .bubble:hover { background: var(--panel-2); color: var(--accent); }
  .bubble b { position: absolute; bottom: 1px; right: 0; min-width: 15px; height: 15px; border-radius: 8px; background: var(--muted); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 3px; }
  .bubble.has b { background: var(--accent); }
  .bubble.unseen b { background: var(--danger); }
  .row-menu { width: 26px; height: 26px; border-radius: 6px; color: var(--muted); flex: none; opacity: 0; }
  tr:hover .row-menu, .row-menu:focus { opacity: 1; }
  .row-menu:hover { background: var(--panel-2); }
  .cell-btn { width: 100%; height: 39px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; }
  .cell-btn:disabled { cursor: default; }
  .cell-btn .placeholder { color: var(--muted); opacity: 0; }
  tr:hover .cell-btn:not(:disabled) .placeholder { opacity: .7; }
  td.status-cell { width: 170px; }
  .status { width: 100%; height: 39px; color: var(--s-text); display: grid; place-items: center; font-weight: 500; padding: 0 6px; }
  .s-not_started { background: var(--s-not_started); } .s-working { background: var(--s-working); } .s-review { background: var(--s-review); }
  .s-changes { background: var(--s-changes); } .s-done { background: var(--s-done); }
  button.status:not(:disabled):hover { filter: brightness(1.06); box-shadow: inset 0 0 0 2px rgba(0,0,0,.15); }
  .due { gap: 8px; }
  .due-icon { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; border: 1.5px solid var(--muted); color: var(--muted); }
  .due-icon.overdue { border-color: var(--danger); color: var(--danger); }
  .due-icon.today { border-color: var(--warn); background: var(--warn); color: #fff; }
  .due-icon.done { border-color: var(--ok); background: var(--ok); color: #fff; }
  .files-cell { display: flex; gap: 4px; justify-content: center; align-items: center; }
  .ficon { width: 22px; height: 26px; border-radius: 3px; background: #5559df; display: inline-grid; color: #fff; display: grid; place-items: center; font-size: 8px; font-weight: 700; overflow: hidden; }
  .ficon img { width: 100%; height: 100%; object-fit: cover; }
  .more-files { font-size: 12px; color: var(--muted); }
  td.drop-target { outline: 2px dashed var(--accent); outline-offset: -3px; }
  .notes-input { width: 100%; height: 39px; border: 0; border-radius: 0; background: transparent; padding: 0 10px; text-overflow: ellipsis; }
  .add-row td { height: 38px; }
  .add-row input { width: 100%; border: 0; background: transparent; padding: 0 12px 0 46px; height: 37px; border-radius: 0; }
  .summary-row td { border: 0; height: 34px; background: transparent !important; }
  .summary-row td:first-child { border-left: 0; }
  .sbar { display: flex; height: 22px; margin: 0 8px; border-radius: 3px; overflow: hidden; background: var(--line); }
  .sbar span { height: 100%; }
  .empty { color: var(--muted); padding: 28px 16px; text-align: center; }

  .av { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-size: 12px; font-weight: 600; flex: none; letter-spacing: .3px; }
  .av.sm { width: 24px; height: 24px; font-size: 10px; }
  .av.lg { width: 38px; height: 38px; font-size: 14px; }
  .av.empty-av { background: transparent; border: 1.5px dashed var(--border); color: var(--muted); }

  /* ---------- popovers & menus ---------- */
  .pop { position: fixed; z-index: 60; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); padding: 8px; min-width: 190px; max-height: 360px; overflow-y: auto; }
  .pop .opt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 10px; border-radius: 5px; white-space: nowrap; }
  .pop .opt:hover, .pop .opt.active { background: var(--hover); }
  .pop .opt.status-opt { justify-content: center; color: #fff; margin-bottom: 4px; font-weight: 500; min-width: 170px; }
  .pop .opt.status-opt:hover { filter: brightness(1.06); }
  .pop .sep { height: 1px; background: var(--line); margin: 6px 0; }
  .pop .head { font-size: 12px; color: var(--muted); padding: 4px 10px; }
  .pop input { width: 100%; margin-bottom: 6px; }

  /* ---------- side panel ---------- */
  .scrim { position: fixed; inset: 0; background: var(--overlay); z-index: 40; }
  .panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(720px, 100%); background: var(--panel); z-index: 41; box-shadow: var(--shadow); display: flex; flex-direction: column; }
  .panel-head { padding: 16px 20px 0; }
  .panel-title { display: flex; align-items: center; gap: 10px; }
  .panel-title h2 { flex: 1; margin: 0; font-size: 22px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; border-radius: 4px; padding: 2px 4px; }
  .panel-title h2[contenteditable="true"]:hover { outline: 1px solid var(--border); }
  .panel-title h2[contenteditable="true"]:focus { outline: 2px solid var(--accent); }
  .facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
  .fact { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
  .fact .cell-btn, .fact .status { height: 32px; border: 1px solid var(--line); border-radius: 6px; min-width: 120px; color: var(--text); justify-content: flex-start; }
  .fact .status { color: var(--s-text); border: 0; justify-content: center; display: flex; }
  .fact input[type="date"] { height: 32px; padding: 4px 8px; }
  .ptabs { display: flex; gap: 2px; margin-top: 14px; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .ptabs button { padding: 8px 12px; border-bottom: 2px solid transparent; color: var(--muted); white-space: nowrap; }
  .ptabs button[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
  .panel-body { flex: 1; overflow-y: auto; padding: 16px 20px 40px; background: var(--panel-2); }

  .composer { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; }
  .composer:focus-within { border-color: var(--accent); }
  .composer textarea { width: 100%; border: 0; resize: vertical; min-height: 70px; padding: 12px 14px; background: transparent; border-radius: 8px 8px 0 0; }
  .composer textarea:focus { outline: none; }
  .composer-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-top: 1px solid var(--line); }
  .composer-bar .spacer { flex: 1; }
  .composer.dragging { outline: 2px dashed var(--accent); }
  .pending { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 8px; }
  .chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 4px 3px 8px; font-size: 12px; max-width: 240px; }
  .chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .chip button { width: 20px; height: 20px; border-radius: 4px; color: var(--muted); }
  .chip button:hover { background: var(--hover); }
  .chip progress { width: 50px; }

  .update { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-top: 14px; }
  .update-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 0; }
  .update-head .who { font-weight: 600; }
  .update-head .when { color: var(--muted); font-size: 12px; }
  .update-head .spacer { flex: 1; }
  .update-text { padding: 10px 16px 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
  .update-text .mention { background: var(--mention); color: var(--mention-text); border-radius: 4px; padding: 0 3px; }
  .update-files { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px 16px 6px; }
  .fcard { width: 168px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); text-align: left; }
  .fcard .thumb { height: 120px; display: grid; place-items: center; background: var(--panel-2); position: relative; overflow: hidden; }
  .fcard .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
  .fcard .thumb .ext { font-size: 13px; font-weight: 800; color: #fff; background: #5559df; border-radius: 6px; padding: 10px 8px; }
  .fcard .ver { position: absolute; top: 6px; left: 6px; background: var(--panel); color: var(--text); border-radius: 4px; padding: 0 6px; font-size: 11px; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
  .fcard .meta { padding: 6px 8px; font-size: 12px; }
  .fcard .meta .fname { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fcard .meta .sub { color: var(--muted); display: flex; gap: 6px; align-items: center; }
  .fcard .meta .sub .spacer { flex: 1; }
  .fcard .meta a, .fcard .meta button { color: var(--muted); font-size: 12px; text-decoration: none; }
  .fcard .meta a:hover, .fcard .meta button:hover { color: var(--accent); }
  .update-actions { display: flex; border-top: 1px solid var(--line); margin-top: 8px; }
  .update-actions button { flex: 1; padding: 9px; color: var(--muted); }
  .update-actions button:hover { background: var(--hover); color: var(--text); }
  .update-actions button.liked { color: var(--accent); font-weight: 600; }
  .replies { border-top: 1px solid var(--line); background: var(--panel-2); padding: 6px 14px 12px; border-radius: 0 0 8px 8px; }
  .reply { display: flex; gap: 8px; margin-top: 10px; }
  .reply .bubble-text { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; flex: 1; min-width: 0; }
  .reply .bubble-text .who { font-weight: 600; font-size: 13px; }
  .reply .bubble-text .when { color: var(--muted); font-size: 11px; margin-left: 6px; }
  .reply .tools { font-size: 12px; color: var(--muted); display: flex; gap: 10px; margin-top: 2px; }
  .reply .tools button:hover { color: var(--accent); }
  .reply-box { display: flex; gap: 8px; margin-top: 10px; align-items: flex-start; }
  .reply-box .composer { flex: 1; }
  .reply-box textarea { min-height: 40px; }
  .seen-by { color: var(--muted); font-size: 12px; padding: 0 16px; text-align: right; }

  .files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin-top: 14px; }
  .files-grid .fcard { width: auto; }
  .dropzone { border: 2px dashed var(--border); border-radius: 8px; padding: 22px; text-align: center; color: var(--muted); background: var(--panel); }
  .dropzone.dragging { border-color: var(--accent); background: var(--hover); }
  .activity { list-style: none; padding: 0; margin: 0; }
  .activity li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .activity .when { color: var(--muted); font-size: 12px; white-space: nowrap; min-width: 92px; }

  /* ---------- my work & gallery ---------- */
  .bucket h3 { font-size: 15px; margin: 22px 0 8px; display: flex; gap: 8px; align-items: center; }
  .bucket h3 .n { color: var(--muted); font-weight: 400; }
  .work-item { display: grid; grid-template-columns: 1fr 140px 110px 160px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; overflow: hidden; }
  .work-item > * { padding: 0 12px; }
  .work-item .wname { padding: 10px 12px; text-align: left; min-width: 0; }
  .work-item .wname b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .work-item .wname small { color: var(--muted); }
  .work-item .status { height: 100%; min-height: 48px; padding: 0; }
  .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
  .gallery .fcard { width: auto; }
  .gallery .fcard .thumb { height: 180px; }

  /* ---------- modals ---------- */
  .modal-wrap { position: fixed; inset: 0; background: var(--overlay); z-index: 70; display: grid; place-items: center; padding: 16px; }
  .modal { background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); width: min(640px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 22px 24px; }
  .modal h2 { margin: 0 0 14px; font-size: 20px; }
  .modal h3 { margin: 22px 0 8px; font-size: 15px; }
  .modal .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .modal label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
  .modal label input, .modal label select { width: 100%; min-width: 0; }
  .modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
  .people { width: 100%; border-collapse: collapse; }
  .people td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
  .people tr.inactive { opacity: .5; }
  .hint { color: var(--muted); font-size: 12px; }
  .lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(10, 12, 25, .92); display: flex; flex-direction: column; }
  .lightbox .lb-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #fff; }
  .lightbox .lb-bar .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lightbox .lb-bar a, .lightbox .lb-bar button { color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; padding: 5px 12px; text-decoration: none; }
  .lightbox .lb-body { flex: 1; display: grid; place-items: center; padding: 8px 16px 24px; min-height: 0; }
  .lightbox img, .lightbox video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
  .toast { position: fixed; bottom: 76px; left: 50%; transform: translateX(-50%); background: #323338; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 90; box-shadow: var(--shadow); max-width: calc(100% - 32px); }
  .notif { display: flex; gap: 10px; padding: 10px; border-radius: 6px; align-items: flex-start; width: 100%; text-align: left; white-space: normal; }
  .notif:hover { background: var(--hover); }
  .notif.unread { background: var(--mention); }
  .notif small { color: var(--muted); display: block; }


/* ---------- theme picker & settings ---------- */
.theme-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-opt { border: 2px solid var(--line); border-radius: 8px; padding: 8px; display: grid; gap: 6px; font-size: 13px; text-align: center; }
.theme-opt[aria-pressed="true"] { border-color: var(--accent); }
.theme-opt .prev { height: 46px; border-radius: 5px; display: grid; grid-template-columns: 14px 1fr; overflow: hidden; border: 1px solid var(--line); }
.theme-opt .prev.l { background: #fff; } .theme-opt .prev.l i { background: #eef0f8; }
.theme-opt .prev.d { background: #181b34; } .theme-opt .prev.d i { background: #292f4c; }
.theme-opt .prev.s { background: linear-gradient(135deg, #fff 50%, #181b34 50%); } .theme-opt .prev.s i { background: transparent; }
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.logo-row .pv { width: 180px; height: 52px; border-radius: 6px; display: grid; place-items: center; padding: 6px; }
.logo-row .pv.l { background: #eef0f8; } .logo-row .pv.d { background: #292f4c; }
.logo-row .pv img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-row .pv em { font-size: 12px; color: #8a8ea3; font-style: normal; }
.logo-row .txt { flex: 1; min-width: 140px; font-size: 13px; }

@media (max-width: 760px) {
  .app { grid-template-rows: 52px 1fr 60px; }
  .topbar { padding: 0 8px 0 12px; gap: 8px; }
  .top-search { display: none; }
  .top-actions { margin-left: auto; }
  .top-actions .divider { display: none; }
  .rail { position: fixed; bottom: 0; left: 0; right: 0; width: auto; height: 60px; flex-direction: row; justify-content: space-around; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); background: var(--chrome); border-top: 1px solid var(--line); z-index: 30; gap: 0; }
  .rail hr { display: none; }
  .rail button { width: auto; flex: 1; padding: 4px 2px; font-size: 11px; }
  .board-card { border-radius: 12px 12px 0 0; padding: 14px 14px 90px; }
  .board-head h1 { font-size: 22px; }
  .toolbar { gap: 2px; }
  .tb span:not(.count) { display: none; }
  .tb-search input:focus, .tb-search input:not(:placeholder-shown) { width: 130px; }
  .tasks td.name-cell, .tasks th.name-cell { width: 210px; min-width: 210px; }
  .panel-head { padding: 12px 14px 0; }
  .panel-body { padding: 12px 14px 40px; }
  .work-item { grid-template-columns: 1fr 120px; }
  .work-item .w-extra { display: none; }
  .theme-opts { grid-template-columns: 1fr 1fr 1fr; }
}

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.bucket h3 .dot { margin-right: 2px; }
.tasks th { color: var(--text); font-weight: 400; }
.bubble svg { width: 22px; height: 22px; }
.row-menu { display: grid; place-items: center; }
.cell-btn .placeholder { display: inline-grid; }
.update-actions button, .seen-by, .fcard .meta a, .fcard .meta button, .reply .tools button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seen-by { justify-content: flex-end; width: 100%; }
.app { grid-template-columns: minmax(0, 1fr); }
.shell, .topbar { min-width: 0; }
[data-theme="dark"] .group-name, [data-theme="dark"] .group-head .chev { filter: brightness(1.5) saturate(.9); }
.w-chat { display: inline-flex; gap: 4px; align-items: center; }
@media (max-width: 760px) { .work-item .w-chat { display: none; } }

/* ---------- notifications banner ---------- */
.push-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--accent-soft); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 13px; }
.push-banner > svg { color: var(--accent); }
[data-theme="dark"] .push-banner > svg { color: #8cb8ff; }
.push-banner span { flex: 1; min-width: 200px; }
.push-banner svg.sm { vertical-align: -3px; }
.push-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; margin-bottom: 10px; }
.push-row svg { flex: none; color: var(--accent); }
#pushBox .row { display: flex; gap: 8px; }
.switch-row { display: flex !important; grid-template-columns: none; align-items: center; gap: 8px; color: var(--text) !important; font-size: 13px; margin-bottom: 12px; }
.switch-row input { width: 16px !important; height: 16px; accent-color: var(--accent); }
.link-btn { color: var(--accent); font-size: 12px; text-decoration: underline; }

/* ---------- calendar (due date) ---------- */
.cal { width: 300px; display: grid; gap: 10px; padding: 4px; }
.cal-top { display: flex; justify-content: space-between; align-items: center; }
.cal-input { width: 100%; margin: 0 !important; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav select { padding: 4px 6px; border-color: transparent; background: transparent; font-weight: 500; }
.cal-nav select:hover { border-color: var(--border); }
.cal-nav .spacer { flex: 1; }
.icon-btn.sm { width: 30px; height: 30px; }
svg.cal-prev { transform: rotate(90deg); } svg.cal-next { transform: rotate(-90deg); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-dow { font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-day { height: 36px; border-radius: 6px; font-size: 14px; position: relative; }
.cal-day:hover { background: var(--hover); }
.cal-day.other { color: var(--muted); opacity: .55; }
.cal-day.today::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: 5px; height: 2px; border-radius: 1px; background: var(--accent); }
.cal-day.sel { background: var(--accent); color: #fff; font-weight: 600; }
.cal-day.sel::after { background: #fff; }

/* ---------- task name editing ---------- */
.name-edit { flex: 1; min-width: 0; height: 30px; padding: 0 8px; }
.edit-name { width: 26px; height: 26px; border-radius: 6px; color: var(--muted); display: grid; place-items: center; opacity: 0; flex: none; }
tr:hover .edit-name, .edit-name:focus { opacity: 1; }
.edit-name:hover { background: var(--panel-2); color: var(--accent); }

/* ---------- groups ---------- */
.group.collapsed .chev { transform: rotate(-90deg); }
.group-head .chev svg { width: 18px; height: 18px; }
.group.archived { opacity: .7; }
.group-menu-btn { opacity: .6; }
.group-head:hover .group-menu-btn { opacity: 1; }
.summary-row td.sum { border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); background: var(--panel) !important; }
.summary-row td.sum:nth-child(2) { border-left: 1px solid var(--line); border-bottom-left-radius: 8px; }
.range-pill { display: inline-block; color: #fff; font-size: 12px; font-weight: 500; padding: 3px 12px; border-radius: 12px; white-space: nowrap; max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.files-count { display: inline-flex; flex-direction: column; line-height: 1.1; font-size: 11px; color: var(--muted); }
.files-count b { font-size: 13px; color: var(--text); font-weight: 500; }
.board-foot { display: flex; gap: 10px; flex-wrap: wrap; margin: -10px 0 30px; }
.pop.wide { min-width: 260px; }
.move-row { display: flex; gap: 4px; padding: 2px 6px 4px; }
.move-row .btn { flex: 1; padding: 0 6px; }
.color-row { display: grid; grid-template-columns: repeat(6, 26px); gap: 8px; padding: 4px 10px 6px; }
.color-row button { width: 26px; height: 26px; border-radius: 50%; }
.color-row button.on { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--text); }
.pop.wide { max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }

/* ---------- due-date pie + hover label ---------- */
:root, [data-theme="light"] { --pie-on: #676879; --pie-off: #dcdfec; --tip-bg: #323338; --tip-text: #fff; }
[data-theme="dark"] { --pie-on: #c5c7d0; --pie-off: #3b3f5c; --tip-bg: #ffffff; --tip-text: #323338; }
.pie { width: 18px; height: 18px; flex: none; display: block; }
.pie .pie-off { fill: var(--pie-off); }
.pie .pie-on { fill: var(--pie-on); }
.due-mark { position: relative; display: inline-grid; place-items: center; flex: none; }
.due-inline { display: inline-flex; align-items: center; gap: 6px; }
.due-mark[data-tip]:hover::after, .due-mark[data-tip]:hover::before { opacity: 1; transform: translate(-50%, 0); }
.due-mark[data-tip]::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 9px); transform: translate(-50%, 4px);
  background: var(--tip-bg); color: var(--tip-text); padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 400;
  white-space: nowrap; box-shadow: var(--shadow); pointer-events: none; opacity: 0; transition: opacity .12s, transform .12s; z-index: 20;
}
.due-mark[data-tip]::before {
  content: ""; position: absolute; left: 50%; bottom: calc(100% + 3px); transform: translate(-50%, 4px);
  border: 6px solid transparent; border-bottom: 0; border-top-color: var(--tip-bg); pointer-events: none; opacity: 0; transition: opacity .12s, transform .12s; z-index: 20;
}
@media (max-width: 480px) { .auth form { padding: 36px 22px 26px; border-radius: 22px; } }
