/* ============================================================
   BirrProjects Lab — design system (light-first, dark-ready)
   BismiLLAH Ar-Rahman Ar-Raheem.
   Mobile-native-first: 44px targets, safe areas, bottom nav,
   sheets on mobile / drawers on desktop, spring micro-motion.
   ============================================================ */

:root {
  --font: 'Inter', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', ui-monospace, Menlo, Consolas, monospace;

  --bg: #f6f7f4;
  --bg-elev: #ffffff;
  --bg-sunken: #eef0ea;
  --bg-hover: rgba(28, 35, 51, 0.045);
  --line: rgba(28, 35, 51, 0.10);
  --line-strong: rgba(28, 35, 51, 0.18);
  --ink: #1c2333;
  --ink-2: #4c5568;
  --ink-3: #8a92a6;
  --brand: #b8860b;
  --brand-strong: #9a6f08;
  --brand-soft: rgba(184, 134, 11, 0.12);
  --brand-ink: #7c5a06;
  --accent: #3d8b5f;
  --accent-soft: rgba(61, 139, 95, 0.12);
  --danger: #b3402f;
  --danger-soft: rgba(179, 64, 47, 0.10);
  --warn: #b8860b;
  --warn-soft: rgba(184, 134, 11, 0.12);
  --info: #46689b;
  --info-soft: rgba(70, 104, 155, 0.12);
  --gold-grad: linear-gradient(135deg, #d4af37, #b8860b);

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px;
  --sh-1: 0 1px 2px rgba(20, 24, 38, 0.06), 0 1px 6px rgba(20, 24, 38, 0.05);
  --sh-2: 0 4px 14px rgba(20, 24, 38, 0.10), 0 1px 3px rgba(20, 24, 38, 0.07);
  --sh-3: 0 18px 50px rgba(20, 24, 38, 0.18), 0 4px 12px rgba(20, 24, 38, 0.10);
  --tap: 44px;
  --sidebar-w: 248px;
  --dur: 180ms;
  --spring: cubic-bezier(0.34, 1.4, 0.5, 1);
}
[data-theme="dark"] {
  --bg: #12151d;
  --bg-elev: #1a1f2b;
  --bg-sunken: #0e1118;
  --bg-hover: rgba(226, 230, 240, 0.06);
  --line: rgba(226, 230, 240, 0.10);
  --line-strong: rgba(226, 230, 240, 0.20);
  --ink: #e8ebf2;
  --ink-2: #b3bac9;
  --ink-3: #7c8496;
  --brand: #d4af37;
  --brand-strong: #e2c04d;
  --brand-soft: rgba(212, 175, 55, 0.14);
  --brand-ink: #e2c04d;
  --accent: #4ea374;
  --accent-soft: rgba(78, 163, 116, 0.16);
  --danger: #e06a56;
  --danger-soft: rgba(224, 106, 86, 0.14);
  --warn: #d4af37;
  --warn-soft: rgba(212, 175, 55, 0.14);
  --info: #6f94c7;
  --info-soft: rgba(111, 148, 199, 0.16);
  --gold-grad: linear-gradient(135deg, #e2c04d, #b8860b);
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 1px 6px rgba(0, 0, 0, 0.3);
  --sh-2: 0 4px 14px rgba(0, 0, 0, 0.45), 0 1px 3px rgba(0, 0, 0, 0.35);
  --sh-3: 0 18px 50px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 14.5px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand-ink); text-decoration: none; }
::selection { background: var(--brand-soft); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; } }

/* scrollbars */
.scroll-y { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.scroll-y::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-y::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
.scroll-y::-webkit-scrollbar-track { background: transparent; }

/* ── boot splash ── */
.boot-splash { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 18px; }
.boot-mark { width: 64px; height: 64px; border-radius: 18px; background: #1c2333; color: #d4af37; display: grid; place-content: center; font-size: 34px; font-weight: 800; box-shadow: var(--sh-2); animation: bootPulse 1.6s var(--spring) infinite alternate; }
.boot-line { width: 120px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; position: relative; }
.boot-line::after { content: ''; position: absolute; inset: 0; width: 40%; background: var(--gold-grad); border-radius: 3px; animation: bootSlide 1.1s ease-in-out infinite; }
.boot-note { color: var(--ink-3); font-size: 12.5px; margin: 0; }
@keyframes bootPulse { from { transform: scale(0.97); } to { transform: scale(1.03); } }
@keyframes bootSlide { from { left: -40%; } to { left: 100%; } }

/* ── app shell ── */
.app-root { min-height: 100dvh; }
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }
.sidebar { background: var(--bg-elev); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; }
.sidebar-head { padding: 18px 16px 12px; display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: #1c2333; color: #d4af37; display: grid; place-content: center; font-weight: 800; font-size: 19px; flex: none; }
[data-theme="dark"] .logo-mark { background: #232b3d; }
.logo-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.logo-sub { font-size: 11px; color: var(--ink-3); margin-top: -2px; }
.side-nav { flex: 1; padding: 6px 10px 16px; display: flex; flex-direction: column; gap: 2px; }
.side-sec { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); padding: 14px 10px 6px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 0 12px; height: var(--tap); border-radius: 10px; color: var(--ink-2); font-weight: 500; cursor: pointer; border: none; background: none; width: 100%; text-align: left; transition: background var(--dur), color var(--dur), transform 90ms var(--spring); }
.side-link:hover { background: var(--bg-hover); color: var(--ink); }
.side-link:active { transform: scale(0.985); }
.side-link.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.side-link .ic { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.side-link .count { margin-left: auto; font-size: 11px; background: var(--bg-sunken); border-radius: 20px; padding: 1px 8px; color: var(--ink-3); }
.side-foot { padding: 10px 14px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gold-grad); color: #141821; display: grid; place-content: center; font-weight: 700; font-size: 13px; flex: none; }
.avatar.lg { width: 38px; height: 38px; font-size: 16px; }
.foot-name { font-size: 13px; font-weight: 600; line-height: 1.2; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot-role { font-size: 11px; color: var(--ink-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 58px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); display: flex; align-items: center; gap: 12px; padding: 0 18px; position: sticky; top: 0; z-index: 30; }
.topbar h1 { font-size: 16px; font-weight: 700; margin: 0; letter-spacing: -0.01em; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .crumb { color: var(--ink-3); font-weight: 500; }
.content { padding: 22px; flex: 1; max-width: 1280px; width: 100%; margin: 0 auto; }
.content.full { max-width: none; }

.icon-btn { width: var(--tap); height: var(--tap); border-radius: 10px; border: none; background: none; display: grid; place-content: center; cursor: pointer; color: var(--ink-2); transition: background var(--dur), transform 90ms var(--spring); flex: none; }
.icon-btn:hover { background: var(--bg-hover); color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 19px; height: 19px; }

/* mobile chrome */
.m-top { display: none; }
.tabbar { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .m-top { display: flex; align-items: center; gap: 10px; height: calc(56px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 14px 0; position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
  .m-top h1 { flex: 1; font-size: 16px; margin: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .content { padding: 16px 14px calc(88px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: color-mix(in srgb, var(--bg-elev) 92%, transparent); backdrop-filter: blur(18px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .tab { display: grid; place-items: center; gap: 2px; height: 52px; border: none; background: none; color: var(--ink-3); font-size: 10px; font-weight: 600; cursor: pointer; border-radius: 12px; transition: color var(--dur), transform 90ms var(--spring); }
  .tab:active { transform: scale(0.93); }
  .tab.active { color: var(--brand-ink); }
  .tab svg { width: 21px; height: 21px; }
}

/* ── primitives ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--bg-elev); color: var(--ink); font-weight: 600; font-size: 13.5px; cursor: pointer; transition: background var(--dur), transform 90ms var(--spring), box-shadow var(--dur), border-color var(--dur); white-space: nowrap; }
.btn:hover { background: var(--bg-hover); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: #1c2333; border-color: #1c2333; color: #f0e6c8; box-shadow: var(--sh-1); }
[data-theme="dark"] .btn.primary { background: var(--gold-grad); border-color: transparent; color: #161a24; }
.btn.primary:hover { background: #2a3247; }
[data-theme="dark"] .btn.primary:hover { filter: brightness(1.06); }
.btn.gold { background: var(--gold-grad); border-color: transparent; color: #161a24; }
.btn.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.ghost { background: none; border-color: transparent; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn.icon { width: 40px; padding: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn svg { width: 16px; height: 16px; }

.card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.card.pad { padding: 18px; }
.card-title { font-size: 13px; font-weight: 700; letter-spacing: 0.02em; color: var(--ink-2); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }

.input, .select, textarea.input { width: 100%; height: 42px; border-radius: 11px; border: 1px solid var(--line-strong); background: var(--bg-elev); padding: 0 12px; transition: border-color var(--dur), box-shadow var(--dur); }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.hint { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--bg-sunken); color: var(--ink-2); white-space: nowrap; }
.chip.brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip.green { background: var(--accent-soft); color: var(--accent); }
.chip.red { background: var(--danger-soft); color: var(--danger); }
.chip.gold { background: var(--warn-soft); color: var(--brand-ink); }
.chip.blue { background: var(--info-soft); color: var(--info); }
.chip.clickable { cursor: pointer; border: none; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.badge-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 20px; background: var(--brand-soft); color: var(--brand-ink); font-size: 11px; font-weight: 700; display: inline-grid; place-content: center; }

.kbd { font-family: var(--mono); font-size: 11px; background: var(--bg-sunken); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; color: var(--ink-2); }

.empty { display: grid; place-content: center; justify-items: center; gap: 10px; padding: 48px 20px; text-align: center; color: var(--ink-3); }
.empty .ic { width: 44px; height: 44px; opacity: 0.4; }
.empty h3 { margin: 0; font-size: 15px; color: var(--ink-2); }
.empty p { margin: 0; font-size: 13px; max-width: 380px; }

.skeleton { background: linear-gradient(90deg, var(--bg-sunken) 25%, var(--bg-hover) 50%, var(--bg-sunken) 75%); background-size: 200% 100%; animation: skSh 1.3s infinite; border-radius: 8px; }
@keyframes skSh { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-card { height: 92px; margin-bottom: 12px; }
.sk-row { height: 14px; margin-bottom: 10px; }
.sk-row.w60 { width: 60%; } .sk-row.w40 { width: 40%; }

/* toasts */
.toasts { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #1c2333; color: #eef0f4; padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 500; box-shadow: var(--sh-3); animation: toastIn 0.28s var(--spring); max-width: min(480px, 90vw); pointer-events: auto; display: flex; gap: 8px; align-items: center; }
.toast.err { background: #6e2b20; }
.toast.ok { background: #1e4d35; }
[data-theme="dark"] .toast { background: #2a3247; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transform: translateY(8px); transition: all 0.25s; }

/* modal / sheet */
.overlay { position: fixed; inset: 0; background: rgba(10, 13, 20, 0.5); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 18px; animation: fadeIn 0.18s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--bg-elev); border-radius: var(--r-xl); box-shadow: var(--sh-3); width: 100%; max-width: 560px; max-height: min(86dvh, 720px); display: flex; flex-direction: column; animation: popIn 0.24s var(--spring); overflow: hidden; border: 1px solid var(--line); }
@keyframes popIn { from { opacity: 0; transform: translateY(18px) scale(0.97); } to { opacity: 1; transform: none; } }
.modal-head { padding: 16px 18px 0; display: flex; align-items: center; gap: 10px; }
.modal-head h2 { margin: 0; font-size: 16px; flex: 1; }
.modal-body { padding: 14px 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px 16px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .overlay { padding: 0; align-items: flex-end; }
  .modal { max-width: none; border-radius: 22px 22px 0 0; max-height: 92dvh; animation: sheetUp 0.3s var(--spring); }
  @keyframes sheetUp { from { transform: translateY(40%); opacity: 0.6; } to { transform: none; opacity: 1; } }
}

/* drawer (task detail desktop) */
.drawer-overlay { position: fixed; inset: 0; background: rgba(10, 13, 20, 0.35); z-index: 90; animation: fadeIn 0.18s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--bg-elev); border-left: 1px solid var(--line); box-shadow: var(--sh-3); z-index: 95; display: flex; flex-direction: column; animation: slideL 0.26s var(--spring); }
@keyframes slideL { from { transform: translateX(60px); opacity: 0.5; } to { transform: none; opacity: 1; } }
@media (max-width: 640px) {
  .drawer { width: 100%; border-radius: 22px 22px 0 0; top: max(6dvh, 40px); animation: sheetUp 0.3s var(--spring); border: none; }
}

/* ── board ── */
.board-wrap { display: flex; gap: 14px; overflow-x: auto; align-items: flex-start; padding-bottom: 12px; scrollbar-width: thin; }
.board-col { flex: 0 0 272px; background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px; max-height: calc(100dvh - 210px); display: flex; flex-direction: column; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.col-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.col-name { font-weight: 700; font-size: 12.5px; letter-spacing: 0.02em; }
.col-count { margin-left: auto; font-size: 11px; color: var(--ink-3); background: var(--bg-elev); border-radius: 12px; padding: 1px 8px; }
.col-cards { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 40px; padding: 2px; border-radius: 10px; }
.col-cards.drag-over { outline: 2px dashed var(--brand); outline-offset: -2px; background: var(--brand-soft); }
.task-card { background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; cursor: pointer; box-shadow: var(--sh-1); transition: transform 110ms var(--spring), box-shadow var(--dur), border-color var(--dur); touch-action: manipulation; }
.task-card:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); transform: translateY(-1px); }
.task-card.dragging { opacity: 0.45; transform: scale(0.98) rotate(1.5deg); }
.task-card .t-title { font-weight: 600; font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.task-card .t-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.task-card .t-key { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.prio-flag { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.prio-low { background: var(--ink-3); } .prio-medium { background: var(--info); } .prio-high { background: var(--warn); } .prio-urgent { background: var(--danger); }
.t-assign { margin-left: auto; display: flex; }
.t-assign .avatar { width: 22px; height: 22px; font-size: 10px; border: 2px solid var(--bg-elev); }
.t-assign .avatar + .avatar { margin-left: -7px; }
.progress-mini { height: 4px; background: var(--bg-sunken); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.progress-mini > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.3s var(--spring); }
@media (max-width: 640px) { .board-col { flex-basis: 82vw; } }

/* ── list / table ── */
.rows { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-elev); overflow: hidden; }
.row-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background var(--dur); }
.row-item:last-child { border-bottom: none; }
.row-item:hover { background: var(--bg-hover); }
.row-item .grow { flex: 1; min-width: 0; }
.row-title { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-elev); overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { text-align: left; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-elev); }
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr { cursor: pointer; transition: background var(--dur); }
table.data tbody tr:hover { background: var(--bg-hover); }

/* grids */
.grid { display: grid; gap: 14px; }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .grid.c4 { grid-template-columns: repeat(2, 1fr); } .grid.c3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid.c2, .grid.c3, .grid.c4 { grid-template-columns: 1fr; } }

.stat { padding: 16px; }
.stat .v { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.stat .k { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.stat .trend { font-size: 11px; margin-top: 4px; color: var(--ink-3); }

/* ── login ── */
.auth-wrap { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 22px; padding: 20px; background: radial-gradient(1200px 500px at 50% -10%, var(--brand-soft), transparent), var(--bg); }
.auth-card { width: min(400px, 100%); background: var(--bg-elev); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--sh-2); padding: 26px; }
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-head .logo-mark { margin: 0 auto 12px; width: 52px; height: 52px; font-size: 28px; border-radius: 15px; }
.auth-head h1 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.auth-head p { margin: 6px 0 0; color: var(--ink-3); font-size: 13px; }
.auth-foot { text-align: center; color: var(--ink-3); font-size: 11.5px; max-width: 380px; line-height: 1.6; }

/* ── markdown ── */
.md { font-size: 14px; line-height: 1.65; overflow-wrap: break-word; }
.md h1, .md h2, .md h3 { letter-spacing: -0.01em; margin: 18px 0 8px; }
.md h1 { font-size: 19px; } .md h2 { font-size: 16px; } .md h3 { font-size: 14.5px; }
.md p { margin: 8px 0; }
.md ul, .md ol { padding-left: 22px; margin: 8px 0; }
.md code { font-family: var(--mono); font-size: 12.5px; background: var(--bg-sunken); border-radius: 5px; padding: 1px 5px; }
.md pre { background: var(--bg-sunken); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; }
.md blockquote { border-left: 3px solid var(--brand); margin: 10px 0; padding: 2px 14px; color: var(--ink-2); background: var(--brand-soft); border-radius: 0 8px 8px 0; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* segmented control */
.seg { display: inline-flex; background: var(--bg-sunken); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: none; background: none; height: 32px; padding: 0 14px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); cursor: pointer; transition: all var(--dur); }
.seg button.active { background: var(--bg-elev); color: var(--ink); box-shadow: var(--sh-1); }

/* command palette */
.cmdk-overlay { position: fixed; inset: 0; background: rgba(10, 13, 20, 0.45); backdrop-filter: blur(4px); z-index: 150; display: flex; justify-content: center; padding-top: 12dvh; }
.cmdk { width: min(600px, 92vw); background: var(--bg-elev); border-radius: 16px; border: 1px solid var(--line-strong); box-shadow: var(--sh-3); overflow: hidden; animation: popIn 0.2s var(--spring); max-height: 60dvh; display: flex; flex-direction: column; }
.cmdk input { height: 52px; border: none; border-bottom: 1px solid var(--line); background: none; padding: 0 18px; font-size: 15px; outline: none; width: 100%; }
.cmdk-list { overflow-y: auto; padding: 8px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; cursor: pointer; font-size: 13.5px; }
.cmdk-item.sel, .cmdk-item:hover { background: var(--brand-soft); color: var(--brand-ink); }
.cmdk-item .k { margin-left: auto; }

/* vault */
.secret-mask { font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.12em; background: var(--bg-sunken); border: 1px dashed var(--line-strong); padding: 10px 12px; border-radius: 10px; color: var(--ink-3); }
.secret-open { font-family: var(--mono); font-size: 12.5px; background: var(--bg-sunken); border: 1px solid var(--line); padding: 10px 12px; border-radius: 10px; white-space: pre-wrap; word-break: break-all; max-height: 240px; overflow: auto; }

/* pills for filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filters .select { width: auto; height: 34px; font-size: 12.5px; padding: 0 26px 0 10px; border-radius: 9px; }

/* section head */
.sec-head { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.sec-head h2 { margin: 0; font-size: 15px; }
.sec-head .spacer { flex: 1; }

/* activity */
.act-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; align-items: baseline; }
.act-item:last-child { border-bottom: none; }
.act-actor { font-weight: 700; }
.act-what { color: var(--ink-2); }
.act-when { margin-left: auto; color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }

/* comment */
.comment { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment .avatar { width: 28px; height: 28px; font-size: 12px; }
.comment .who { font-size: 12px; color: var(--ink-3); }
.comment .who b { color: var(--ink); font-size: 13px; }
.comment .body { font-size: 13.5px; margin-top: 2px; white-space: pre-wrap; word-break: break-word; }
.comment.agent .avatar { background: linear-gradient(135deg, #46689b, #7c8496); color: #fff; }

/* priority pill + selects on cards */
.prio-pill { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 1px 7px; border-radius: 6px; }
.prio-pill.low { background: var(--bg-sunken); color: var(--ink-3); }
.prio-pill.medium { background: var(--info-soft); color: var(--info); }
.prio-pill.high { background: var(--warn-soft); color: var(--brand-ink); }
.prio-pill.urgent { background: var(--danger-soft); color: var(--danger); }

/* misc utility */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.mt0 { margin-top: 0; } .mb0 { margin-bottom: 0; }
.hide { display: none !important; }
.w100 { width: 100%; }
.center { text-align: center; }
.danger-text { color: var(--danger); }
.ok-text { color: var(--accent); }

/* inline icon constraints (any svg inside chips/titles/lists stays 1em-ish) */
.card-title svg, .cmdk-item .ic svg, .empty .ic svg, .row-item svg, .chip svg, .toast svg, .sec-head svg, .m-top svg, .tabbar svg { width: 16px; height: 16px; flex: none; }
.task-card svg { width: 13px; height: 13px; flex: none; }
.act-item svg, .comment svg { width: 14px; height: 14px; flex: none; }
