/* ============================================================
   Flux — design system & layout
   ============================================================ */

/* ---- Theme tokens -------------------------------------------------------- */
:root {
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .08), 0 2px 8px rgba(0, 0, 0, .06);
  --shadow-2: 0 8px 30px rgba(0, 0, 0, .18);
  --shadow-card: 0 1px 2px rgba(0,0,0,.10), 0 1px 1px rgba(0,0,0,.06);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --accent: #6c8cff;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0f13;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, rgba(108,140,255,.10), transparent 60%),
             radial-gradient(900px 500px at -10% 110%, rgba(70,211,154,.08), transparent 55%);
  --surface: #16181f;
  --surface-2: #1d2029;
  --surface-3: #242834;
  --column: rgba(255, 255, 255, .03);
  --card: #1e212b;
  --card-hover: #232734;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --text: #e8eaf0;
  --text-dim: #9aa0ad;
  --text-faint: #6b7280;
  --overlay: rgba(8, 9, 12, .6);
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f8;
  --bg-grad: radial-gradient(1200px 600px at 80% -10%, rgba(108,140,255,.14), transparent 60%),
             radial-gradient(900px 500px at -10% 110%, rgba(70,211,154,.12), transparent 55%);
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #f0f1f5;
  --column: rgba(15, 18, 30, .035);
  --card: #ffffff;
  --card-hover: #ffffff;
  --border: rgba(15, 18, 30, .10);
  --border-strong: rgba(15, 18, 30, .18);
  --text: #1a1d27;
  --text-dim: #5b6170;
  --text-faint: #9097a4;
  --overlay: rgba(20, 22, 30, .35);
}

/* ---- Reset -------------------------------------------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font-family: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }

/* keyboard focus ring (mouse clicks stay clean) */
button:focus-visible, a:focus-visible, [contenteditable]:focus-visible, label:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}

/* native checkboxes follow the theme accent */
input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px; height: 16px; flex: none; cursor: pointer;
}

/* motion is a nicety, not a requirement */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .board { scroll-behavior: auto; }
}

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: content-box; }

/* ---- App shell ---------------------------------------------------------- */
#app {
  display: grid;
  grid-template-columns: 252px 1fr;
  height: 100vh;
  transition: grid-template-columns .28s var(--ease);
}
#app.sidebar-collapsed { grid-template-columns: 0px 1fr; }
#app.public-mode { grid-template-columns: 1fr; }
#app.public-mode #sidebar,
#app.public-mode #sidebar-toggle,
#app.public-mode #view-switch,
#app.public-mode #share-btn,
#app.public-mode .topbar-right { display: none; }

/* ---- Sidebar ------------------------------------------------------------ */
#sidebar {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow: hidden;
  min-width: 0;
}
.brand {
  display: flex; align-items: center; gap: 9px;
  padding: 15px 16px 8px;
  font-weight: 700; font-size: 18px; letter-spacing: -.02em;
}
.brand-mark { font-size: 20px; }
.brand-mark img { width: 24px; height: 24px; border-radius: 7px; object-fit: cover; display: block; }
.brand-name { background: linear-gradient(120deg, var(--text), var(--accent)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.sidebar-section { flex: 1; overflow-y: auto; padding: 6px 8px; }
.project-list { display: flex; flex-direction: column; gap: 2px; }
.project-group-head {
  padding: 12px 10px 5px; color: var(--text-faint); font-size: 10.5px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}
.project-group-head.with-action { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.add-project-inline { width: 24px; height: 24px; border-radius: 7px; font-size: 14px; }
.project-group-head:first-child { padding-top: 2px; }

.project-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: var(--radius-sm);
  color: var(--text-dim); cursor: pointer; position: relative;
  transition: background .15s var(--ease), color .15s var(--ease);
  user-select: none;
}
.project-item:hover { background: var(--surface-3); color: var(--text); }
.project-item.active { background: var(--surface-3); color: var(--text); }
.project-item.archived { opacity: .62; }
.project-item.dragging { opacity: .35; }
.project-item.active::before {
  content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 3px; background: var(--proj-color, var(--accent));
}
.project-emoji {
  width: 24px; height: 24px; flex: none; display: grid; place-items: center;
  border-radius: 8px; font-size: 15px;
  background: color-mix(in srgb, var(--proj-color, var(--accent)) 18%, transparent);
}
.project-name { flex: 1; font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-count { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.project-del {
  opacity: 0; font-size: 14px; color: var(--text-faint);
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  transition: opacity .15s, background .15s, color .15s;
}
.project-item:hover .project-del { opacity: 1; }
.project-del:hover { background: color-mix(in srgb, #ff5d5d 22%, transparent); color: #ff8d8d; }

.sidebar-foot {
  display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border);
}

/* ---- Buttons ------------------------------------------------------------ */
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 16px; color: var(--text-dim);
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s, transform .08s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.ghost-btn {
  flex: 1; padding: 8px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500;
  color: var(--text-dim); border: 1px solid var(--border);
  transition: background .15s, color .15s, border-color .15s;
}
.ghost-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }

.btn {
  padding: 9px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  transition: transform .08s, filter .15s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: color-mix(in srgb, #ff5d5d 90%, #000); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }

/* ---- Topbar ------------------------------------------------------------- */
#main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
#topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; flex: none;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.board-title-wrap { display: flex; flex-direction: column; min-width: 0; flex: 0 0 auto; }
.board-title {
  font-size: 20px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1;
  outline: none; border-radius: 6px; padding: 2px 4px; margin: -2px 4px -2px -4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw;
}
.board-title[contenteditable="true"] { background: var(--surface-3); box-shadow: 0 0 0 2px var(--accent); cursor: text; }
.board-meta { font-size: 12px; color: var(--text-faint); padding-left: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-config-btn { width: 30px; height: 30px; font-size: 14px; }
.project-config-modal { width: min(620px, 100%); }
.project-config-body .field-row { align-items: center; }
.project-config-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.project-view-select { max-width: 260px; }

.topbar-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.view-btn { display: inline-flex; align-items: center; gap: 5px; }

/* ---- Collaboration: avatars, share button, members --------------------- */
.avatar {
  display: inline-grid; place-items: center; border-radius: 50%;
  color: #fff; font-weight: 700; flex: none; user-select: none;
  box-shadow: 0 0 0 2px var(--surface); overflow: hidden;
}
.avatar img, .user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.board-members { display: inline-flex; align-items: center; }
.board-members .avatar { margin-left: -7px; }
.board-members .avatar:first-child { margin-left: 2px; }
.avatar-more {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface-3); color: var(--text-dim); font-size: 11px; font-weight: 700;
  margin-left: -7px; box-shadow: 0 0 0 2px var(--surface);
}
.share-btn {
  margin-left: 6px; padding: 7px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 600;
  color: var(--text-dim); border: 1px solid var(--border); white-space: nowrap; flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  transition: background .15s, color .15s, border-color .15s;
}
.share-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.share-btn.readonly { color: var(--text-faint); cursor: default; }
.share-btn.readonly:hover { background: none; border-color: var(--border); color: var(--text-faint); }

.project-members { display: inline-flex; align-items: center; margin-right: 2px; }
.project-members .avatar { margin-left: -6px; box-shadow: 0 0 0 2px var(--surface); }
.project-members .avatar:first-child { margin-left: 0; }

.share-invite { display: flex; gap: 8px; }
.share-invite .input { flex: 1; }
.share-invite .select { width: auto; }
.share-error { color: #ff8d8d; font-size: 12px; min-height: 14px; margin-top: 2px; }

.member-list { display: flex; flex-direction: column; gap: 2px; }
.member-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 6px; border-radius: var(--radius-sm);
}
.member-row:hover { background: var(--surface-3); }
.member-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.member-text { min-width: 0; }
.member-name { font-size: 13.5px; font-weight: 500; }
.member-email { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.member-ctrl { display: flex; align-items: center; gap: 6px; flex: none; }
.member-ctrl .select { width: auto; padding: 6px 8px; font-size: 12.5px; }
.member-role-tag {
  font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: capitalize;
  background: var(--surface-3); padding: 3px 10px; border-radius: 20px;
}

.sync-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; color: var(--text-faint);
  padding: 5px 10px; border-radius: 20px; border: 1px solid var(--border);
  user-select: none; white-space: nowrap;
}
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); transition: background .2s; }
.sync-status[data-state="synced"] { color: #46d39a; border-color: color-mix(in srgb, #46d39a 35%, transparent); }
.sync-status[data-state="synced"] .sync-dot { background: #46d39a; }
.sync-status[data-state="saving"] { color: #ffb454; border-color: color-mix(in srgb, #ffb454 35%, transparent); }
.sync-status[data-state="saving"] .sync-dot { background: #ffb454; animation: pulse 1s var(--ease) infinite; }
.sync-status[data-state="offline"] { color: var(--text-faint); }
@keyframes pulse { 50% { opacity: .35; } }
/* ≤1024 (small laptops, iPad landscape): compact the header — icons over labels */
@media (max-width: 1024px) {
  .board-meta { display: none; }
  .view-btn .vb-label { display: none; }
  .view-btn { padding: 5px 9px; }
  .share-btn .btn-label { display: none; }
  .share-btn { padding: 7px 9px; }
  .search { width: 230px; }
  .search:focus { width: 260px; }
}
.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 11px; font-size: 15px; color: var(--text-faint); pointer-events: none; }
.search {
  width: 320px; padding: 9px 30px 9px 32px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border); font-size: 13px;
  outline: none; transition: border-color .15s, box-shadow .15s, width .2s var(--ease);
}
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); width: 380px; }
.search-clear {
  position: absolute; right: 8px; width: 18px; height: 18px; border-radius: 6px;
  display: none; place-items: center; color: var(--text-faint); font-size: 15px;
}
.search-wrap.has-value .search-clear { display: grid; }
.search-clear:hover { background: var(--surface-3); color: var(--text); }

/* ---- Board -------------------------------------------------------------- */
.board {
  flex: 1; display: flex; gap: 16px; align-items: flex-start;
  padding: 6px 20px 20px; overflow-x: auto; overflow-y: hidden;
  scroll-behavior: smooth;
}

/* Column */
.column {
  width: 300px; flex: none; max-height: 100%;
  display: flex; flex-direction: column;
  background: color-mix(in srgb, var(--stage-color, var(--accent)) 7%, var(--column));
  border: 1px solid color-mix(in srgb, var(--stage-color, var(--accent)) 24%, var(--border));
  border-radius: var(--radius);
  transition: box-shadow .2s, border-color .2s, transform .2s var(--ease);
}
.column.drop-target { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.column.dragging { opacity: .5; }
.column.col-ghost { outline: 2px dashed var(--accent); outline-offset: -2px; }

.column-head {
  display: flex; align-items: center; gap: 8px; padding: 12px 12px 8px;
  cursor: grab; touch-action: none;
  border-radius: var(--radius) var(--radius) 0 0;
}
.column-head:active { cursor: grabbing; }
.column-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--stage-color, var(--accent)); flex: none; }
.column-name {
  flex: 1; font-size: 13.5px; font-weight: 600; letter-spacing: -.01em;
  outline: none; border-radius: 6px; padding: 2px 4px; margin: -2px -4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.column-name[contenteditable="true"] { background: var(--surface-3); box-shadow: 0 0 0 2px var(--accent); cursor: text; }
.column-count {
  font-size: 11px; font-weight: 600; color: var(--text-dim);
  background: color-mix(in srgb, var(--stage-color, var(--accent)) 18%, transparent);
  padding: 2px 7px; border-radius: 20px; font-variant-numeric: tabular-nums;
}
.column-menu { opacity: 0; transition: opacity .15s; width: 26px; height: 26px; }
.column:hover .column-menu { opacity: 1; }

.column-body {
  flex: 1; overflow-y: auto; padding: 4px 8px 8px;
  display: flex; flex-direction: column; gap: 8px; min-height: 12px;
  transition: box-shadow .16s;
}
.column.has-scroll-above .column-body { box-shadow: inset 0 18px 14px -16px color-mix(in srgb, var(--text) 28%, transparent); }
.column.has-scroll-below .column-body { box-shadow: inset 0 -18px 14px -16px color-mix(in srgb, var(--text) 28%, transparent); }
.column.has-scroll-above.has-scroll-below .column-body { box-shadow: inset 0 18px 14px -16px color-mix(in srgb, var(--text) 28%, transparent), inset 0 -18px 14px -16px color-mix(in srgb, var(--text) 28%, transparent); }
.column-empty {
  text-align: center; color: var(--text-faint); font-size: 12.5px;
  padding: 18px 8px; border: 1px dashed var(--border); border-radius: var(--radius-sm);
}

.column-foot { padding: 8px; }
.add-task-btn {
  width: 100%; text-align: left; padding: 9px 10px; border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-faint); font-weight: 500;
  transition: background .15s, color .15s;
}
.add-task-btn:hover { background: var(--surface-3); color: var(--text); }
.add-task-form { padding: 0 8px 8px; }
.add-task-input {
  width: 100%; padding: 10px; border-radius: var(--radius-sm); font-size: 13px;
  background: var(--card); border: 1px solid var(--accent); outline: none; resize: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.add-task-actions { display: flex; gap: 6px; margin-top: 6px; }

/* Add-column tile */
.add-column {
  width: 280px; flex: none; padding: 14px; border-radius: var(--radius);
  border: 1px dashed var(--border-strong); color: var(--text-faint);
  font-size: 13px; font-weight: 600; text-align: left;
  transition: background .15s, color .15s, border-color .15s;
}
.add-column:hover { background: var(--column); color: var(--text); border-color: var(--accent); }

/* ---- Card --------------------------------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 12px; box-shadow: var(--shadow-card); cursor: grab; touch-action: none;
  position: relative; overflow: hidden;
  /* overflow:hidden gives a flex item an automatic min-height:0, which let cards
     squish instead of the column scrolling — pin the size so the column scrolls. */
  flex: 0 0 auto;
  transition: background .15s, border-color .15s, transform .12s var(--ease), box-shadow .15s, opacity .15s;
}
.card.card-new { animation: card-in .22s var(--ease); }
@keyframes card-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.card:hover { background: var(--card-hover); border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-1); }
.card.has-task-color { border-color: var(--task-color); box-shadow: inset 4px 0 0 var(--task-color), var(--shadow-card); }
.card.has-task-color:hover { border-color: var(--task-color); box-shadow: inset 4px 0 0 var(--task-color), var(--shadow-1); }
.card:active { cursor: grabbing; }
.card.dragging { display: none; }

/* faded link-preview background + clickable title */
.card-media {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-size: cover; background-position: center; opacity: .16;
}
[data-theme="light"] .card-media { opacity: .12; }
.card::before { z-index: 2; }
.card.has-media > .card-title,
.card.has-media > .card-link,
.card.has-media > .card-meta { position: relative; z-index: 1; }
a.card-link { color: inherit; text-decoration: none; }
a.card-link:hover { color: var(--accent); text-decoration: underline; }
.card-link-icon { font-size: 10px; margin-left: 4px; opacity: .55; vertical-align: super; }

/* completed task (Board view) */
.card.done { overflow: visible; }
.card.done::after {
  content: "✓"; position: absolute; left: -9px; top: 12px; z-index: 3;
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: #46d39a; color: #fff; font-size: 12px; font-weight: 800;
  box-shadow: 0 0 0 2px var(--surface);
}

/* ---- List view --------------------------------------------------------- */
.board.board--list {
  flex-direction: column; align-items: center; overflow-y: auto; overflow-x: hidden;
  padding: 6px 20px 40px;
}
.board--list .list-toolbar,
.board--list .list-body { width: 100%; max-width: 720px; }
.list-toolbar { display: flex; align-items: center; gap: 10px; padding: 6px 2px 14px; }
.list-toolbar-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.list-seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.list-seg-btn { padding: 5px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-dim); }
.list-seg-btn:hover { color: var(--text); }
.list-seg-btn.sel { background: var(--surface-3); color: var(--text); }

.list-group { margin-bottom: 18px; }
.list-group-head { display: flex; align-items: center; gap: 8px; padding: 6px 6px; }
.list-group-title { font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.list-group-count { font-size: 11px; font-weight: 600; color: var(--text-faint); background: var(--surface-3); padding: 1px 7px; border-radius: 20px; }
.list-rows { display: flex; flex-direction: column; }

.list-row {
  display: flex; align-items: flex-start; gap: 11px; padding: 10px 8px;
  border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 8px;
  transition: background .12s;
}
.list-row:hover { background: var(--surface-2); }
.list-row.has-task-color { box-shadow: inset 4px 0 0 var(--task-color); border-left: 1px solid var(--task-color); }
.list-check {
  width: 19px; height: 19px; flex: none; margin-top: 1px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); color: #fff; font-size: 11px;
  display: grid; place-items: center; transition: background .12s, border-color .12s;
}
.list-check:hover { border-color: var(--accent); }
.list-check.checked { background: var(--accent); border-color: var(--accent); }
.list-row-main { flex: 1; min-width: 0; }
.list-title { font-size: 13.5px; line-height: 1.4; }
a.list-title { color: inherit; text-decoration: none; }
a.list-title:hover { color: var(--accent); text-decoration: underline; }
.list-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.list-pri-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.list-add {
  width: 100%; padding: 9px 8px 9px 38px; margin-top: 2px; border: none; background: none;
  font-size: 13px; color: var(--text); outline: none;
}
.list-add::placeholder { color: var(--text-faint); }
.list-add:focus { background: var(--surface-2); border-radius: 8px; }

/* row drag-reorder (only when grouped by section) */
.board--list[data-list-group="section"] .list-rows[data-stage-id] .list-row { cursor: grab; }
.list-row.dragging { display: none; }
.list-placeholder {
  border: 2px dashed var(--accent); border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  height: var(--ph-h, 42px); margin: 2px 0;
}

/* completed (collapsible) */
.list-group-head.toggle { cursor: pointer; border-radius: 8px; padding-left: 4px; }
.list-group-head.toggle:hover { background: var(--surface-2); }
.list-caret { font-size: 10px; color: var(--text-faint); width: 12px; display: inline-block; }
.list-group.completed .list-row .list-title { color: var(--text-faint); }

/* ---- view switcher + sidebar type glyph -------------------------------- */
.view-switch { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; margin-left: 4px; }
.view-switch:empty { display: none; }
.view-btn { padding: 5px 10px; border-radius: 7px; font-size: 12px; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.view-btn:hover { color: var(--text); }
.view-btn.sel { background: var(--surface-3); color: var(--text); }
.project-type { font-size: 11px; color: var(--text-faint); margin-right: 2px; }

/* ---- global views (sidebar) -------------------------------------------- */
.global-views { padding: 6px 8px 0; }
.global-views:empty { display: none; }
.global-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: var(--radius-sm);
  color: var(--text-dim); cursor: pointer; user-select: none; transition: background .15s, color .15s;
}
.global-item:hover, .global-item.active { background: var(--surface-3); color: var(--text); }
.global-ic { width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--surface-3); font-size: 15px; }
.global-name { font-size: 14px; font-weight: 500; }
.show-archived { margin: 7px 0 0; padding: 6px 9px; border-radius: var(--radius-sm); border: 1px solid var(--border); color: var(--text-faint); font-size: 12px; font-weight: 600; text-align: left; }
.show-archived:hover { background: var(--surface-3); color: var(--text); }

/* ---- calendar lens ----------------------------------------------------- */
.board.board--calendar { flex-direction: column; align-items: stretch; overflow-y: auto; overflow-x: hidden; padding: 6px 20px 24px; }
.cal-toolbar { display: flex; align-items: center; gap: 10px; padding: 4px 2px 12px; }
.cal-month { font-size: 15px; font-weight: 700; min-width: 150px; }
.cal-nav { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); color: var(--text-dim); font-size: 16px; }
.cal-nav:hover { background: var(--surface-3); color: var(--text); }
.cal-today { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.cal-today:hover { background: var(--surface-3); color: var(--text); }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-dow { background: var(--surface); padding: 8px; text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); }
.cal-cell { background: var(--surface); min-height: 104px; padding: 6px; display: flex; flex-direction: column; gap: 3px; }
.cal-cell.out { background: var(--bg); }
.cal-cell.out .cal-daynum { opacity: .45; }
.cal-daynum { font-size: 12px; font-weight: 600; color: var(--text-dim); align-self: flex-start; padding: 2px 6px; border-radius: 6px; }
.cal-cell.today .cal-daynum { background: var(--accent); color: #fff; }
.cal-event { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 6px; background: var(--surface-2); cursor: pointer; font-size: 11.5px; min-width: 0; }
.cal-event:hover { background: var(--surface-3); }
.cal-event.done .cal-event-title { color: var(--text-faint); }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.cal-event-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-more { font-size: 11px; color: var(--text-faint); padding: 1px 6px; }

@media (max-width: 640px) {
  .board.board--calendar { padding: 6px 12px 24px; }
  .cal-cell { min-height: 64px; }
  .cal-event { justify-content: center; padding: 3px; }
  .cal-event-title { display: none; }   /* dots-only on phones to keep the grid usable */
}

/* ---- timeline (Gantt) lens ---------------------------------------------- */
.board.board--timeline {
  flex-direction: column; align-items: stretch; overflow: hidden;
  padding: 6px 20px 20px;
}
.tl-toolbar { display: flex; align-items: center; gap: 10px; padding: 4px 2px 12px; flex: none; }
.tl-toolbar .cal-today { margin-left: 2px; }
.tl-toolbar .cal-today:disabled { opacity: .5; cursor: default; }

.tl-frame {
  flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow: hidden;
}
.tl-scroll { overflow: auto; min-height: 0; overscroll-behavior: contain; }
.tl-inner {
  --tl-label-w: 240px;
  display: grid; grid-template-columns: var(--tl-label-w) max-content;
  width: max-content;
}

/* header */
.tl-corner {
  position: sticky; left: 0; top: 0; z-index: 6;
  background: var(--surface); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border);
  display: flex; align-items: flex-end; padding: 6px 12px;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint);
}
.tl-head { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--border); }
.tl-months { display: flex; height: 26px; }
.tl-month {
  flex: none; display: flex; align-items: center; padding: 0 8px;
  font-size: 11.5px; font-weight: 700; color: var(--text-dim);
  border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden;
}
.tl-month:first-child { border-left: none; }
.tl-month-label { position: sticky; left: calc(var(--tl-label-w) + 8px); }
.tl-days { display: flex; height: 20px; }
.tl-daycell {
  width: var(--tl-day-w); flex: none; text-align: center;
  font-size: 10px; line-height: 20px; color: var(--text-faint); font-variant-numeric: tabular-nums;
  overflow: hidden;
}
.tl-daycell.wknd { background: var(--column); }
.tl-daycell.today { color: var(--accent); font-weight: 800; }

/* label rail */
.tl-labels {
  position: sticky; left: 0; z-index: 4;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.tl-label {
  height: 38px; flex: none; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; cursor: pointer; min-width: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  transition: background .12s;
}
.tl-label:hover { background: var(--surface-2); }
.tl-label-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tl-label-title { font-size: 13px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-label.done .tl-label-title { color: var(--text-faint); text-decoration: line-through; }
.tl-label .dep-icon { flex: none; }

/* lanes */
.tl-lanes { position: relative; }
.tl-lane {
  height: 38px; position: relative;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
}
.tl-lane:hover { background: color-mix(in srgb, var(--accent) 4%, transparent); }

.tl-today-line {
  position: absolute; top: 0; bottom: 0; width: 2px; z-index: 1;
  background: var(--accent); opacity: .75; pointer-events: none;
}
.tl-today-line::before {
  content: ""; position: absolute; top: 0; left: -3px;
  border: 4px solid transparent; border-top-color: var(--accent);
}

/* bars */
.tl-bar {
  position: absolute; top: 7px; height: 24px; z-index: 2; border-radius: 7px;
  background: color-mix(in srgb, var(--bar-color) 28%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--bar-color) 60%, transparent);
  cursor: grab; user-select: none; touch-action: none;
  display: flex; align-items: center; overflow: hidden;
  transition: box-shadow .15s, filter .15s;
}
.tl-bar:hover { box-shadow: var(--shadow-1); filter: brightness(1.06); }
.tl-bar.dragging { cursor: grabbing; box-shadow: var(--shadow-2); z-index: 3; transition: none; }
.tl-bar.done { opacity: .45; }
.tl-bar.point { border-radius: 999px; background: color-mix(in srgb, var(--bar-color) 45%, var(--surface)); }
.tl-bar-fill {
  position: absolute; top: 0; bottom: 0; left: 0; border-radius: 6px 0 0 6px;
  background: color-mix(in srgb, var(--bar-color) 30%, transparent);
  pointer-events: none;
}
.tl-bar-title {
  position: relative; z-index: 1; padding: 0 9px; font-size: 12px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.tl-handle { position: absolute; top: 0; bottom: 0; width: 8px; z-index: 2; cursor: ew-resize; opacity: 0; transition: opacity .12s; }
.tl-handle.l { left: 0; border-radius: 7px 0 0 7px; }
.tl-handle.r { right: 0; border-radius: 0 7px 7px 0; }
.tl-bar:hover .tl-handle { opacity: 1; background: color-mix(in srgb, var(--bar-color) 45%, transparent); }

.tl-drag-tip {
  position: absolute; top: -24px; z-index: 5; padding: 2px 8px; border-radius: 6px;
  background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text);
  font-size: 11px; font-weight: 600; white-space: nowrap; pointer-events: none;
  box-shadow: var(--shadow-1);
}

/* dependency arrows */
.tl-deps { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: visible; }
.tl-deps path { fill: none; stroke: color-mix(in srgb, var(--text-faint) 55%, transparent); stroke-width: 1.5; transition: stroke .12s; }
.tl-deps path.hl { stroke: var(--accent); stroke-width: 2; }

/* unscheduled tray */
.tl-unsched { flex: 0 1 auto; min-height: 0; overflow-y: auto; margin-top: 12px; max-height: 38%; }
.tl-unsched .list-rows { max-width: 760px; }
.tl-empty { flex: none; }

@media (max-width: 640px) {
  .board.board--timeline { padding: 6px 12px 16px; }
  .tl-inner { --tl-label-w: 148px; }
  .tl-label { padding: 0 8px; }
}

/* ---- board loading skeleton -------------------------------------------- */
.board-loading { flex: 1; display: grid; place-items: center; min-height: 240px; width: 100%; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- dashboard (Home) -------------------------------------------------- */
.board.board--home { flex-direction: column; align-items: stretch; overflow-y: auto; overflow-x: hidden; padding: 6px 20px 32px; }
.home-wrap { width: 100%; max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; gap: 26px; }
.home-h { font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
.home-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.home-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; cursor: pointer; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .15s, transform .12s var(--ease), box-shadow .15s;
}
.home-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--proj-color, var(--accent)); }
.home-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-1); }
.home-card-head { display: flex; align-items: center; gap: 9px; }
.home-card-emoji { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: color-mix(in srgb, var(--proj-color, var(--accent)) 18%, transparent); font-size: 16px; }
.home-card-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.home-card-count { font-size: 12.5px; color: var(--text-dim); }
.home-bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.home-bar-fill { height: 100%; background: var(--proj-color, var(--accent)); border-radius: 6px; transition: width .3s var(--ease); }
.home-card-members { display: flex; }
.home-card-members .avatar { margin-left: -6px; }
.home-card-members .avatar:first-child { margin-left: 0; }
.home-card.home-add { align-items: center; justify-content: center; color: var(--text-faint); font-weight: 600; font-size: 13.5px; border-style: dashed; min-height: 116px; }
.home-card.home-add::before { display: none; }
.home-card.home-add:hover { color: var(--text); border-color: var(--accent); transform: none; }

.home-up-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.home-up-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .12s; }
.home-up-row:last-child { border-bottom: none; }
.home-up-row:hover { background: var(--surface-2); }
.home-up-title { flex: 1; min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-up-proj { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }
.home-up-due { font-size: 12px; font-weight: 600; color: var(--text-dim); min-width: 72px; text-align: right; }
.home-up-row.overdue .home-up-due { color: #ff8d8d; }
.home-empty { color: var(--text-faint); font-size: 13.5px; padding: 16px; border: 1px dashed var(--border); border-radius: var(--radius); text-align: center; }

@media (max-width: 640px) {
  .board.board--home { padding: 6px 12px 32px; }
  .home-up-proj { display: none; }
}

/* link preview inside the task editor */
.link-preview { display: flex; gap: 10px; align-items: center; margin-top: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; background: var(--surface-2); }
.link-preview:empty { display: none; }
.link-preview.loading, .link-preview.empty { color: var(--text-faint); font-size: 12.5px; justify-content: center; padding: 12px; }
.link-preview-img { width: 64px; height: 48px; flex: none; border-radius: 6px;
  background-size: cover; background-position: center; background-color: var(--surface-3); }
.link-preview-meta { min-width: 0; }
.link-preview-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-preview-desc { font-size: 12px; color: var(--text-dim); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card.priority-high::before,
.card.priority-medium::before,
.card.priority-low::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.card.priority-high::before { background: #ff6b6b; }
.card.priority-medium::before { background: #ffb454; }
.card.priority-low::before { background: #4cc9f0; }
.card.has-task-color::before { background: var(--task-color); }

.card-title { font-size: 13.5px; line-height: 1.4; font-weight: 500; word-break: break-word; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 9px; }
.card-meta:empty { display: none; }

.tag {
  font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: color-mix(in srgb, var(--accent) 92%, var(--text));
}
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 6px;
  background: var(--surface-3); color: var(--text-dim);
}
.badge.due.soon { background: color-mix(in srgb, #ffb454 24%, transparent); color: #ffcb7a; }
.badge.due.overdue { background: color-mix(in srgb, #ff6b6b 24%, transparent); color: #ff9b9b; }
.lock-badge { background: color-mix(in srgb, #ffb454 20%, transparent); color: #ffce6b; }
.badge.notes::before { content: "≡"; }
a.repo-badge { text-decoration: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.repo-badge:hover { background: var(--surface-3); color: var(--text); }
.repo-ic { opacity: .7; }

/* card drop placeholder */
.card-placeholder {
  border: 2px dashed var(--accent); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  height: var(--ph-h, 44px); margin: 0; flex: none;
  animation: ph-in .12s var(--ease);
}
@keyframes ph-in { from { opacity: 0; } to { opacity: 1; } }

/* drag avatar follows cursor */
.drag-avatar {
  position: fixed; top: 0; left: 0; z-index: 999; pointer-events: none;
  width: 280px; box-shadow: var(--shadow-2);
  opacity: .96;
  animation: none;          /* don't inherit the card-in fade */
  transition: none;         /* JS drives transform every frame; no smoothing lag */
  will-change: transform;   /* promote to its own layer so it composites smoothly */
}

#drag-trash {
  position: fixed; left: 50%; bottom: 18px; z-index: 1000; transform: translate(-50%, 80px);
  padding: 12px 18px; border-radius: 999px; border: 1px solid color-mix(in srgb, #ff5d5d 60%, transparent);
  background: color-mix(in srgb, #ff5d5d 18%, var(--surface)); color: #ffb0b0;
  font-size: 13px; font-weight: 700; box-shadow: var(--shadow-2); opacity: 0; pointer-events: none;
  transition: transform .18s var(--ease), opacity .18s var(--ease), background .12s, color .12s;
}
#drag-trash.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
#drag-trash.hot { background: #ff5d5d; color: #fff; }

/* ---- Modal -------------------------------------------------------------- */
.modal-overlay {
  position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(4px);
  display: grid; place-items: center; z-index: 200; padding: 20px;
  animation: fade .18s var(--ease);
}
.modal-overlay.instant, .modal-overlay.instant .modal { animation: none; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: min(560px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow-2);
  animation: modal-in .22s var(--ease);
}
.task-editor-modal { display: flex; flex-direction: column; overflow: hidden; }
.task-editor-modal .modal-head, .task-editor-modal .modal-sub, .task-editor-modal .modal-foot { flex: none; }
.task-editor-modal .modal-body { min-height: 0; overflow-y: auto; }
.task-editor-modal.has-scroll-above .modal-body { box-shadow: inset 0 18px 14px -16px color-mix(in srgb, var(--text) 28%, transparent); }
.task-editor-modal.has-scroll-below .modal-body { box-shadow: inset 0 -18px 14px -16px color-mix(in srgb, var(--text) 28%, transparent); }
.task-editor-modal.has-scroll-above.has-scroll-below .modal-body { box-shadow: inset 0 18px 14px -16px color-mix(in srgb, var(--text) 28%, transparent), inset 0 -18px 14px -16px color-mix(in srgb, var(--text) 28%, transparent); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 20px 20px 4px; }
.modal-head .icon-btn { margin: -4px -4px 0 0; }
.modal-title-input {
  flex: 1; font-size: 18px; font-weight: 700; letter-spacing: -.02em; line-height: 1.3;
  background: transparent; border: none; outline: none; resize: none; padding: 4px;
  border-radius: 8px;
}
.modal-title-input:focus { background: var(--surface-3); }
.modal-sub { padding: 0 20px; font-size: 12px; color: var(--text-faint); }
.modal-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.section-head .field-label { margin: 0; }
.section-add {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  color: var(--text-faint); border: 1px solid var(--border); font-size: 15px; font-weight: 700;
}
.section-add:hover { color: var(--text); background: var(--surface-3); border-color: var(--border-strong); }
.section-body { display: flex; flex-direction: column; gap: 7px; }
.field-row { display: flex; gap: 12px; }
.field-row > .field { flex: 1; }
.field-row > .input { flex: 1; min-width: 0; }

/* compact property pills (stage · priority · due · tags) */
.prop-row { display: flex; flex-wrap: wrap; gap: 8px; }
.prop {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 7px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 500;
  color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border);
  transition: background .15s, color .15s, border-color .15s;
}
.prop:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.prop.set { color: var(--text); }
.prop-ic { font-size: 12px; line-height: 1; }
.prop-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.prop-caret { font-size: 9px; opacity: .5; }
.prop-tags-label { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.prop-pop {
  position: fixed; z-index: 350; min-width: 170px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: 2px;
  animation: modal-in .14s var(--ease);
}
.prop-pop.tags-pop { min-width: 250px; }
.prop-pop .input { margin-bottom: 4px; }
.pop-opt {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--text); background: none;
}
.pop-opt:hover { background: var(--surface-3); }
.pop-opt.sel { background: var(--surface-3); font-weight: 600; }
.pop-opt.danger { color: #ff8d8d; }

.input, .textarea, .select {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.select {
  appearance: none; cursor: pointer; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238b90a0' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

.priority-group { display: flex; gap: 6px; }
.priority-opt {
  flex: 1; padding: 8px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border); color: var(--text-dim); text-align: center;
  transition: all .12s var(--ease);
}
.priority-opt:hover { border-color: var(--border-strong); }
.priority-opt.sel[data-p="none"] { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.priority-opt.sel[data-p="low"] { background: color-mix(in srgb, #4cc9f0 22%, transparent); color: #4cc9f0; border-color: #4cc9f0; }
.priority-opt.sel[data-p="medium"] { background: color-mix(in srgb, #ffb454 22%, transparent); color: #ffb454; border-color: #ffb454; }
.priority-opt.sel[data-p="high"] { background: color-mix(in srgb, #ff6b6b 22%, transparent); color: #ff6b6b; border-color: #ff6b6b; }

.tags-edit { display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 6px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.tags-edit .tag { display: inline-flex; align-items: center; gap: 5px; }
.tags-edit .tag button { font-size: 13px; line-height: 1; opacity: .7; }
.tags-edit .tag button:hover { opacity: 1; }
.tags-edit input { flex: 1; min-width: 80px; background: transparent; border: none; outline: none; font-size: 13px; padding: 4px; }

.modal-foot {
  display: flex; align-items: center; gap: 10px; padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.modal-foot .spacer { flex: 1; }

/* confirm dialog */
.confirm { width: min(400px, 100%); }
.confirm-body { padding: 22px 22px 8px; }
.confirm-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.confirm-text { font-size: 13.5px; color: var(--text-dim); line-height: 1.5; }

/* help dialog */
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; padding: 4px 0; }
.help-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.help-row span { color: var(--text-dim); }
kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px;
  background: var(--surface-3); border: 1px solid var(--border); border-bottom-width: 2px;
  padding: 2px 7px; border-radius: 6px; color: var(--text);
}

/* emoji picker popover */
.emoji-pop {
  position: absolute; z-index: 300; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-2); padding: 8px;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px;
}
.emoji-pop button { font-size: 18px; width: 34px; height: 34px; border-radius: 8px; }
.emoji-pop button:hover { background: var(--surface-3); }

/* generic dropdown menu (account, project + column options) */
.menu-pop {
  position: absolute; z-index: 300; min-width: 180px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: var(--shadow-2); display: flex; flex-direction: column; gap: 2px;
  animation: modal-in .14s var(--ease);
}
.menu-pop .pop-opt { white-space: nowrap; }
.pop-ic { width: 18px; flex: none; text-align: center; }

.color-pop { position: absolute; z-index: 300; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-2); padding: 8px; display: grid; grid-template-columns: repeat(5, 28px); gap: 6px; }
.color-swatch { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-strong); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.color-swatch.none { background: linear-gradient(135deg, transparent 46%, #ff6b6b 47%, #ff6b6b 53%, transparent 54%), var(--surface-3); }
.color-swatch.sel { outline: 2px solid var(--text); outline-offset: 2px; }

/* ---- Toasts ------------------------------------------------------------- */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
  padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-2); font-size: 13px; font-weight: 500;
  display: flex; align-items: center; gap: 10px; animation: toast-in .25s var(--ease);
}
.toast button { color: var(--accent); font-weight: 600; font-size: 13px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.toast.out { animation: toast-out .2s var(--ease) forwards; }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* ---- Empty board -------------------------------------------------------- */
.board-empty {
  margin: auto; text-align: center; color: var(--text-dim); max-width: 360px;
  display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 8vh;
}
.board-empty .big { font-size: 46px; }
.board-empty h2 { font-size: 18px; color: var(--text); }
.board-empty p { font-size: 13.5px; line-height: 1.6; }

/* ---- Auth screen -------------------------------------------------------- */
.auth-screen {
  position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 24px;
  background: var(--bg); background-image: var(--bg-grad);
}
.auth-card {
  width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow-2); padding: 30px 28px;
  animation: modal-in .25s var(--ease);
}
.auth-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; letter-spacing: -.02em; margin-bottom: 18px; }
.auth-heading { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.auth-sub { font-size: 13.5px; color: var(--text-dim); margin: 5px 0 22px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-error { color: #ff8d8d; font-size: 12.5px; min-height: 16px; }
.auth-submit { width: 100%; padding: 11px; font-size: 14px; }
.auth-toggle { margin-top: 18px; text-align: center; }
.auth-toggle button { color: var(--accent); font-size: 13px; font-weight: 500; }
.auth-toggle button:hover { text-decoration: underline; }

/* ---- User area (sidebar foot) ------------------------------------------- */
.sidebar-foot { flex-direction: column; gap: 10px; align-items: stretch; }
.user-area { display: flex; align-items: center; gap: 10px; }
.user-area:empty { display: none; }
.user-avatar {
  width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--accent), #46d39a);
  overflow: hidden;
}
.avatar-settings-row { display: flex; align-items: center; gap: 12px; }
.avatar-upload { display: inline-flex; align-items: center; cursor: pointer; }
.avatar-hint { font-size: 11.5px; color: var(--text-faint); }
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 11px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-controls { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px; }
.sidebar-controls .sync-status { justify-content: flex-start; min-width: 0; }
.sidebar-controls .sync-label { overflow: hidden; text-overflow: ellipsis; }
.foot-actions { display: flex; gap: 8px; }

/* ---- Checklist (task editor) -------------------------------------------- */
.checklist-head { display: flex; align-items: center; justify-content: space-between; }
.checklist-count { font-size: 11.5px; font-weight: 600; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.checklist-bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.checklist-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #46d39a); border-radius: 6px; transition: width .25s var(--ease); }
.checklist-items { display: flex; flex-direction: column; gap: 4px; }
/* ---- attachments (task editor) ----------------------------------------- */
.attach-list { display: flex; flex-direction: column; gap: 6px; }
.attach-empty { font-size: 13px; color: var(--text-faint); padding: 4px 2px; }
.attach-row { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.attach-row.pending { opacity: .7; }
.attach-row.removing { opacity: .4; }
.attach-thumb {
  width: 38px; height: 38px; flex: none; border-radius: 7px; overflow: hidden;
  display: grid; place-items: center; background: var(--surface-3); font-size: 17px;
  text-decoration: none; color: var(--text-dim);
}
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attach-name { flex: 1; min-width: 0; font-size: 13px; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attach-name:hover { color: var(--accent); text-decoration: underline; }
.attach-meta { font-size: 11.5px; color: var(--text-faint); flex: none; }
.attach-dl { width: 26px; height: 26px; flex: none; border-radius: 6px; display: grid; place-items: center; color: var(--text-faint); font-size: 16px; text-decoration: none; }
.attach-dl:hover { background: var(--surface-3); color: var(--text); }
.attach-del { width: 24px; height: 24px; flex: none; border-radius: 6px; color: var(--text-faint); font-size: 13px; }
.attach-del:hover { background: color-mix(in srgb, #ff5d5d 20%, transparent); color: #ff8d8d; }
.attach-drop {
  display: block; text-align: center; padding: 12px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); color: var(--text-faint); font-size: 12.5px; font-weight: 500;
  cursor: pointer; transition: border-color .15s, color .15s, background .15s;
}
.attach-drop:hover, .attach-drop.over { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent) 6%, transparent); }

/* ---- Files lens (per-project + global) ---------------------------------- */
.board.board--files { flex-direction: column; align-items: center; overflow-y: auto; overflow-x: hidden; padding: 6px 20px 32px; }
.files-wrap { width: 100%; max-width: 860px; display: flex; flex-direction: column; gap: 14px; }
.files-drop { padding: 18px; }
.files-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.files-sort { width: 132px; }
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-list.files-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); align-items: stretch; }
.file-row {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  transition: border-color .15s, background .15s;
}
.file-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.file-thumb { width: 42px; height: 42px; font-size: 19px; }
.file-row--compact { padding: 6px 9px; gap: 9px; }
.file-row--compact .file-thumb { width: 30px; height: 30px; font-size: 15px; }
.file-row--compact .file-chips, .file-row--compact .attach-meta { display: none; }
.file-row--preview { min-height: 184px; flex-direction: column; align-items: stretch; padding: 10px; gap: 8px; }
.file-row--preview .file-thumb { width: 100%; height: 104px; font-size: 30px; }
.file-row--preview .file-main { gap: 0; flex: none; }
.file-title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.file-title-line .attach-name { min-width: 0; }
.file-row--preview .attach-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.file-row--preview .attach-meta, .file-row--preview .file-chips, .file-row--preview .file-action { display: none; }
.file-row--preview .file-download { width: 28px; height: 28px; }
.file-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.file-main .attach-name { font-weight: 500; }
.file-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.file-chip {
  font-size: 10.5px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
  background: color-mix(in srgb, var(--proj-color, var(--accent)) 14%, transparent);
  color: color-mix(in srgb, var(--proj-color, var(--accent)) 90%, var(--text));
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file-chip:hover { background: color-mix(in srgb, var(--proj-color, var(--accent)) 26%, transparent); }
.file-chip.plain { background: var(--surface-3); color: var(--text-faint); cursor: default; }
.file-task-pop { max-width: 320px; max-height: 320px; overflow-y: auto; }
.file-task-pop .pop-opt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.file-pop-empty { font-size: 12.5px; color: var(--text-faint); padding: 10px 12px; }
.attach-existing {
  align-self: flex-start; font-size: 12.5px; font-weight: 500; color: var(--text-faint);
  padding: 6px 10px; border-radius: 8px; margin-top: 2px;
}
.attach-existing:hover { background: var(--surface-3); color: var(--text); }
@media (max-width: 640px) {
  .board.board--files { padding: 6px 12px 32px; }
  .files-toolbar { align-items: stretch; flex-direction: column; }
  .files-sort { width: 100%; }
  .file-row .attach-meta { display: none; }
}

.checklist-item { display: flex; align-items: center; gap: 8px; }
.checklist-check {
  width: 20px; height: 20px; flex: none; border-radius: 6px; border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; font-size: 12px; color: #fff; transition: all .12s var(--ease);
}
.checklist-check.on { background: #46d39a; border-color: #46d39a; }
.checklist-text {
  flex: 1; background: transparent; border: 1px solid transparent; border-radius: 7px;
  padding: 6px 8px; font-size: 13px; outline: none;
}
.checklist-text:hover { border-color: var(--border); }
.checklist-text:focus { border-color: var(--accent); background: var(--surface-2); }
.checklist-item.done .checklist-text { color: var(--text-faint); text-decoration: line-through; }
.checklist-del { opacity: 0; width: 24px; height: 24px; border-radius: 6px; color: var(--text-faint); font-size: 13px; transition: opacity .12s, background .12s, color .12s; }
.checklist-item:hover .checklist-del { opacity: 1; }
.checklist-del:hover { background: color-mix(in srgb, #ff5d5d 20%, transparent); color: #ff8d8d; }
.checklist-add .input { padding: 8px 10px; font-size: 13px; }

.badge.checklist { background: var(--surface-3); color: var(--text-dim); }
.badge.checklist.complete { background: color-mix(in srgb, #46d39a 22%, transparent); color: #6fe3b4; }
.size-badge { background: color-mix(in srgb, var(--accent) 20%, transparent); color: color-mix(in srgb, var(--accent) 90%, var(--text)); }
.dep-icon {
  display: inline-grid; place-items: center; width: 19px; height: 19px;
  border-radius: 50%; font-size: 11px; line-height: 1;
}
.dep-icon.blocked { background: color-mix(in srgb, #ff6b6b 28%, transparent); color: #ff9b9b; }
.dep-icon.blocking { background: color-mix(in srgb, #ffb454 28%, transparent); color: #ffcb7a; }

.dependency-panel { display: flex; flex-direction: column; gap: 8px; }
.dependency-body { display: flex; flex-direction: column; gap: 7px; padding-left: 10px; }
.dependency-section { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dependency-label { flex: none; font-size: 11px; font-weight: 700; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; }
.dependency-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 24px; }
.dependency-empty { font-size: 12.5px; color: var(--text-faint); }
.dependency-chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 4px 8px; border-radius: 999px; background: var(--surface-3);
  color: var(--text); font-size: 12.5px; cursor: pointer;
}
.dependency-chip:hover { background: var(--surface-4); }
.dependency-chip.done { color: var(--text-faint); }
.dependency-chip button { color: var(--text-faint); font-size: 14px; line-height: 1; }
.dependency-chip button:hover { color: #ff8d8d; }
.dep-add { padding: 6px 10px; }
.task-picker-modal { width: min(560px, 100%); }
.task-picker-body { gap: 10px; }
.task-picker-list { display: flex; flex-direction: column; gap: 4px; max-height: min(52vh, 430px); overflow-y: auto; }
.task-picker-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 10px; border-radius: var(--radius-sm); text-align: left; background: var(--surface-2);
}
.task-picker-row:hover { background: var(--surface-3); }
.task-picker-row.done { opacity: .65; }
.task-picker-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; }
.task-picker-meta { flex: none; color: var(--text-faint); font-size: 11.5px; }
.task-picker-empty { padding: 16px; text-align: center; color: var(--text-faint); font-size: 13px; }

.audit-list { display: flex; flex-direction: column; gap: 6px; }
.audit-row { padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.audit-title { font-size: 12.5px; color: var(--text); }
.audit-time { margin-top: 2px; font-size: 11.5px; color: var(--text-faint); }

@media (max-width: 640px) {
  .dependency-body { grid-template-columns: 1fr; }
}

/* ---- Tokens modal ------------------------------------------------------- */
.token-list { display: flex; flex-direction: column; gap: 8px; }
.token-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.token-info { flex: 1; min-width: 0; }
.token-name { font-size: 13.5px; font-weight: 600; }
.token-when { font-size: 11.5px; color: var(--text-faint); }
.token-empty { font-size: 13px; color: var(--text-faint); padding: 8px 2px; }
.token-fresh { background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: var(--radius-sm); padding: 12px; }
.token-fresh-label { font-size: 12.5px; font-weight: 600; margin-bottom: 8px; }
.token-code-row { display: flex; gap: 8px; align-items: center; }
.token-code { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 7px; padding: 8px 10px; overflow-x: auto; white-space: nowrap; }

.video-modal { width: min(860px, 100%); }
.video-player { width: 100%; max-height: 70vh; border-radius: var(--radius-sm); background: #000; }
.file-modal { width: min(900px, 100%); }
.file-viewer-body { gap: 12px; }
.file-tools { display: flex; align-items: center; gap: 8px; min-height: 34px; }
.code-editor-host {
  min-height: 420px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--surface-2);
}
.code-editor-host .cm-editor { height: 420px; background: var(--surface-2); color: var(--text); }
.code-editor-host .cm-scroller { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.markdown-preview {
  min-height: 420px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); overflow: auto; line-height: 1.55;
}
.markdown-preview h1, .markdown-preview h2, .markdown-preview h3 { margin: 0 0 10px; }
.markdown-preview p, .markdown-preview ul, .markdown-preview ol, .markdown-preview pre { margin: 0 0 12px; }
.markdown-preview code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-3); padding: 1px 4px; border-radius: 4px; }
.file-preview-img { max-width: 100%; max-height: 72vh; object-fit: contain; border-radius: var(--radius-sm); background: var(--surface-2); }

/* ---- Settings / Admin --------------------------------------------------- */
.settings-modal { width: min(760px, 100%); height: min(680px, calc(100vh - 40px)); display: flex; flex-direction: column; overflow: hidden; }
.settings-modal .modal-head { flex: none; }
.settings-body { display: grid; grid-template-columns: 170px 1fr; gap: 18px; }
.settings-modal .settings-body { flex: 1; min-height: 0; overflow: hidden; }
.settings-tabs { display: flex; flex-direction: column; gap: 4px; }
.settings-tab {
  text-align: left; padding: 9px 11px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; color: var(--text-dim);
}
.settings-tab:hover, .settings-tab.active { background: var(--surface-3); color: var(--text); }
.settings-panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.settings-modal .settings-tabs, .settings-modal .settings-panel { min-height: 0; overflow-y: auto; }
.settings-msg { min-height: 16px; font-size: 12.5px; color: var(--text-faint); }
.settings-note { font-size: 13px; line-height: 1.45; color: var(--text-dim); }
.custom-fields-list { display: flex; flex-direction: column; gap: 8px; }
.custom-field-row { display: grid; grid-template-columns: minmax(150px, 1fr) 150px minmax(160px, 1fr) auto; gap: 8px; align-items: center; }
.custom-field-row .icon-btn { width: 32px; height: 32px; }
.custom-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.theme-choice { display: inline-flex; align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.account-level { font-size: 16px; font-weight: 700; }
.readonly-value { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-dim); font-size: 13px; }
.usage-meter { display: flex; flex-direction: column; gap: 7px; }
.usage-head { font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.avatar.via-org { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px color-mix(in srgb, #46d39a 70%, transparent); }

.board.board--admin { flex-direction: column; align-items: center; overflow-y: auto; overflow-x: hidden; padding: 6px 20px 32px; }
.admin-wrap { width: 100%; max-width: 1120px; display: flex; flex-direction: column; gap: 28px; }
.admin-section { display: flex; flex-direction: column; gap: 10px; }
.admin-table { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.admin-row { display: grid; grid-template-columns: 1.4fr .9fr .8fr .45fr 1.35fr .7fr; border-bottom: 1px solid var(--border); }
.admin-table.levels .admin-row { grid-template-columns: .8fr 1fr .8fr .65fr .45fr 1fr; }
.admin-row:last-child { border-bottom: none; }
.admin-row:first-child { background: var(--surface-2); color: var(--text-faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.admin-cell { min-width: 0; padding: 9px 10px; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.admin-sub { margin-top: 2px; font-size: 11.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-cell .input, .admin-cell .select { padding: 7px 8px; font-size: 12.5px; }
.admin-create-user { display: grid; grid-template-columns: 1fr 1.3fr 1fr .8fr auto auto; gap: 8px; align-items: center; }
.admin-check { display: flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 12px; }
.admin-org-cell, .admin-actions { display: flex; align-items: center; gap: 7px; }
.admin-org-cell { flex-wrap: wrap; }
.admin-cap { width: 64px; }
.admin-actions .btn { padding: 7px 10px; }
.admin-org-members { flex-basis: 100%; display: flex; flex-direction: column; gap: 6px; }
.admin-org-member-list { display: flex; flex-wrap: wrap; gap: 5px; }
.admin-org-member-list .file-chip button { margin-left: 5px; color: var(--text-faint); }
.admin-org-add { display: flex; gap: 6px; }

/* ---- Responsive --------------------------------------------------------- */

/* ≤820 (iPad portrait & below): the sidebar becomes a slide-in overlay so the
   board gets the full width. Tap the board (or pick a project) to dismiss it. */
@media (max-width: 820px) {
  #app, #app.sidebar-collapsed { grid-template-columns: 1fr; }
  #sidebar {
    position: fixed; z-index: 100; width: min(82vw, 300px); height: 100vh;
    transform: translateX(-100%); transition: transform .28s var(--ease);
    box-shadow: var(--shadow-2);
  }
  #app.sidebar-open #sidebar { transform: none; }
  #app.sidebar-open #main::before {
    content: ""; position: fixed; inset: 0; z-index: 99; background: var(--overlay);
  }
  #topbar { padding: 12px 16px; }
  .board, .board.board--list { padding-left: 16px; padding-right: 16px; }
}

/* ≤640 (phones): header wraps to two tidy rows; search takes its own row. */
@media (max-width: 640px) {
  #topbar { flex-wrap: wrap; padding: 10px 12px; gap: 8px; }
  .topbar-left { flex: 1 1 100%; }
  .topbar-right { flex: 1 1 100%; }
  .board-members { display: none; }               /* avatars live in the share dialog */
  .search-wrap { flex: 1 1 auto; }
  .search, .search:focus { width: 100%; }         /* search fills its own row */
  .board, .board.board--list { padding-left: 12px; padding-right: 12px; }
  .settings-body { grid-template-columns: 1fr; }
  .settings-tabs { flex-direction: row; overflow-x: auto; }
  .admin-create-user { grid-template-columns: 1fr; }
  .admin-row, .admin-table.levels .admin-row { grid-template-columns: 1fr; }
  .admin-row:first-child { display: none; }
  .admin-cell { border-bottom: 1px solid var(--border); }
}
