/* team-tasks — Ditto brand: near-black canvas, signature lime accent,
   Chakra Petch (display/UI) + Space Mono (labels). Matches ops.ditto.live
   + directory.ditto.live. */
@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  --accent: #EAF044;          /* Ditto lime */
  --accent-dim: #c2c733;
  --green: #5DAF4A;           /* completed */
  --red: #E26A6A;
  --amber: #F58A3F;
  --blue: #3FA9F5;
  --bg: #0a0a0a;
  --canvas: #0d0d0d;
  --panel: #121212;
  --panel-2: #161616;
  --elevated: #1b1b1b;
  --border: #242424;
  --border-strong: #333333;
  --text: #f6f6f6;
  --muted: #9c9c9c;
  --faint: #5f5f5f;
  --hover: #1a1a1a;
  --chip: #1e1e1e;
  --shadow: 0 2px 8px rgba(0,0,0,.5), 0 12px 36px rgba(0,0,0,.4);
  --radius: 8px;
  --sidebar-w: 264px;
  --mono: 'Space Mono', monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Chakra Petch', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 14px; color: var(--text); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #383838; }

/* ---- App shell ---- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; height: 100vh; }

/* ---- Sidebar ---- */
.sidebar { background: var(--panel); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; }
.brand { display: flex; align-items: center; gap: 11px; padding: 18px 20px 14px; font-weight: 700; font-size: 17px; letter-spacing: .04em; text-transform: uppercase; }
.brand svg { width: 26px; height: 26px; flex: none; }
.nav { padding: 4px 12px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 7px;
  color: var(--muted); text-decoration: none; font-weight: 500; cursor: pointer; border: none; background: none;
  width: 100%; text-align: left;
}
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: rgba(234,240,68,.10); color: var(--accent); font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; opacity: .85; font-size: 13px; }
.nav-section {
  display: flex; align-items: center; justify-content: space-between; padding: 18px 18px 6px;
  color: var(--faint); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-family: var(--mono);
}
.nav-section-actions { display: flex; align-items: center; gap: 2px; }
.nav-section button { border: none; background: none; color: var(--faint); font-size: 17px; line-height: 1; padding: 0 4px; border-radius: 5px; }
.nav-section button:hover { background: var(--hover); color: var(--accent); }
.proj-list { overflow-y: auto; padding: 0 12px 16px; flex: 1; }
.proj-item { display: flex; align-items: center; gap: 11px; padding: 8px 12px; border-radius: 7px; cursor: grab; color: var(--muted); font-weight: 500; }
.proj-item:active { cursor: grabbing; }
.proj-item.dragging { opacity: .5; cursor: grabbing; }
.proj-item:hover { background: var(--hover); color: var(--text); }
.proj-item.active { background: var(--hover); color: var(--text); }
.proj-item.active .nm { color: var(--text); }
.proj-dot { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.proj-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; min-width: 0; }
/* cross-team sharing indicator on a project row — compact icon, team name in title */
.proj-shared { flex: none; font-size: 11px; line-height: 1; color: var(--accent);
  border: 1px solid rgba(234,240,68,.45); border-radius: 5px; padding: 2px 5px; cursor: help; }
.proj-shared.in { color: var(--muted); border-color: var(--border-strong); }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }

/* ---- Main ---- */
.main { display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.topbar { padding: 16px 32px 0; border-bottom: 1px solid var(--border); background: var(--bg); }
.topbar-row { display: flex; align-items: center; gap: 14px; }
.title-wrap { display: flex; align-items: center; gap: 12px; }
.proj-badge { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; color: #0a0a0a; font-weight: 700; font-size: 12px; }
h1.page-title { font-size: 20px; font-weight: 700; letter-spacing: .01em; margin: 0; }
.spacer { flex: 1; }
.tabs { display: flex; gap: 4px; margin-top: 14px; }
.tab { padding: 9px 14px; border: none; background: none; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #0a0a0a; font-size: 12px; font-weight: 700; flex: none; user-select: none; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.btn { border: 1px solid var(--border-strong); background: var(--elevated); color: var(--text); padding: 8px 14px; border-radius: 7px; font-weight: 600; }
.btn:hover { background: #232323; border-color: #444; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0a0a0a; }
.btn.primary:hover { background: #f2f85a; }

.content { flex: 1; overflow: auto; }

/* ---- List view ---- */
.list-wrap { padding: 8px 32px 80px; max-width: 1680px; margin: 0 auto; }
.list-head {
  display: grid; grid-template-columns: 1fr 150px 130px 110px 34px; gap: 8px; padding: 8px 12px;
  color: var(--faint); font-size: 11px; font-weight: 700; font-family: var(--mono); letter-spacing: .06em;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 1;
}
.section-block { margin-top: 14px; }
.section-title { display: flex; align-items: center; gap: 8px; padding: 6px 12px; font-weight: 600; font-size: 14px; letter-spacing: .02em; }
.section-title .caret { color: var(--faint); transition: transform .15s; cursor: pointer; }
.section-block.collapsed .caret { transform: rotate(-90deg); }
.section-block.collapsed .task-row, .section-block.collapsed .add-row { display: none; }
.section-title .count { color: var(--faint); font-weight: 700; font-size: 12px; font-family: var(--mono); }
/* editable section / column names */
.sec-name { border-radius: 6px; padding: 2px 6px; margin: -2px -6px; outline: none; cursor: text; min-width: 30px; }
.sec-name:hover { background: var(--hover); }
.sec-name:focus { background: var(--elevated); box-shadow: inset 0 0 0 1.5px var(--accent); cursor: text; }
.sec-name.muted-name { color: var(--faint); cursor: default; }
.sec-name.muted-name:hover { background: none; }
/* hover "..." section menu */
.menu-wrap { position: relative; margin-left: auto; }
.section-title .menu-wrap, .column-head .menu-wrap { opacity: 0; transition: opacity .12s; }
.section-title:hover .menu-wrap, .column-head:hover .menu-wrap, .menu-wrap.open { opacity: 1; }
.sec-more { border: none; background: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 2px 7px; border-radius: 6px; }
.sec-more:hover { background: var(--hover); color: var(--text); }
.ctx-menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: var(--elevated); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow); min-width: 168px; padding: 4px; z-index: 30; }
/* DIRECT child only: a .menu-wrap.open must not force-display .ctx-menu nested
   deeper (e.g. the share popover is itself a .menu-wrap.open, and a descendant
   selector here made BOTH inner pickers' menus show regardless of their own
   open state → overlapping dropdowns). */
.menu-wrap.open > .ctx-menu { display: block; }
.ctx-item { display: block; width: 100%; text-align: left; border: none; background: none; color: var(--text); padding: 8px 10px; border-radius: 6px; font-weight: 500; font-size: 13px; }
.ctx-item:hover { background: var(--hover); }
.ctx-item.danger { color: var(--red); }
.ctx-item.danger:hover { background: rgba(226,106,106,.14); }
.task-row { display: grid; grid-template-columns: 1fr 150px 130px 110px 34px; gap: 8px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.task-row:hover { background: var(--hover); }
.task-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.task-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; border-radius: 6px; padding: 2px 6px; margin: -2px -6px; outline: none; cursor: text; }
.task-title:focus { white-space: normal; overflow: visible; background: var(--elevated); box-shadow: inset 0 0 0 1.5px var(--accent); }
.task-row.done .task-title { color: var(--faint); text-decoration: line-through; }
.row-del { border: none; background: none; color: var(--faint); font-size: 13px; padding: 4px 6px; border-radius: 6px; opacity: 0; line-height: 1; }
.task-row:hover .row-del, .card:hover .row-del { opacity: .7; }
.row-del:hover { opacity: 1; background: rgba(226,106,106,.16); }
.card .row-del { margin-left: auto; }
.check { width: 19px; height: 19px; border-radius: 50%; border: 1.6px solid #3a3a3a; flex: none; display: grid; place-items: center; color: transparent; background: transparent; transition: all .12s; }
.check:hover { border-color: var(--green); }
.check.done { background: var(--green); border-color: var(--green); color: #0a0a0a; }
.cell { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.due-pill { padding: 3px 9px; border-radius: 20px; background: var(--chip); font-weight: 600; font-size: 12px; font-family: var(--mono); color: var(--muted); }
.due-pill.today { background: rgba(234,240,68,.14); color: var(--accent); }
.due-pill.overdue { background: rgba(226,106,106,.16); color: var(--red); }
.prio { padding: 3px 9px; border-radius: 6px; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; font-family: var(--mono); }
.prio.high { background: rgba(226,106,106,.16); color: var(--red); }
.prio.medium { background: rgba(245,138,63,.16); color: var(--amber); }
.prio.low { background: rgba(63,169,245,.16); color: var(--blue); }
.add-row { display: flex; align-items: center; gap: 11px; padding: 9px 12px; color: var(--faint); }
.add-row input { border: none; outline: none; background: none; width: 100%; padding: 2px 0; color: var(--text); }
.add-row input::placeholder { color: var(--faint); }
.add-row .plus { width: 19px; text-align: center; }
.add-section-btn { margin: 18px 0 0 12px; color: var(--muted); background: none; border: none; font-weight: 600; }
.add-section-btn:hover { color: var(--accent); }

/* ---- Custom fields (List columns + header) ---- */
.cf-head-cell { display: flex; align-items: center; gap: 4px; min-width: 0; position: relative; }
.cf-head-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-head-menu { opacity: 0; transition: opacity .12s; margin-left: 0; }
.list-head .cf-head-cell:hover .cf-head-menu, .cf-head-menu.open { opacity: 1; }
.cf-more { font-size: 14px; padding: 0 4px; color: var(--faint); }
.cf-add-cell { display: flex; align-items: center; justify-content: center; }
.cf-add-btn { border: 1px dashed var(--border-strong); background: none; color: var(--muted); width: 22px; height: 22px; border-radius: 6px; line-height: 1; padding: 0; font-size: 14px; }
.cf-add-btn:hover { color: var(--accent); border-color: var(--accent); }
.cf-cell { min-width: 0; }
.cf-input { width: 100%; min-width: 0; border: 1px solid transparent; border-radius: 6px; padding: 4px 6px; background: none; color: var(--text); font-size: 13px; }
.cf-input:hover { border-color: var(--border); background: var(--elevated); }
.cf-input:focus { border-color: var(--accent); outline: none; background: var(--elevated); }
.cf-cell .cf-select { background: var(--elevated); }
.cf-cell .cf-select option { background: var(--panel); }
.cf-cell .cf-date { color-scheme: dark; }
.cf-cell .cf-text::placeholder { color: var(--faint); }

/* ---- Custom fields (detail "Fields" section) ---- */
.cf-detail-row { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 10px; padding: 6px 0; }
.cf-detail-lbl { color: var(--muted); font-weight: 600; font-size: 12px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-detail-input { border: 1px solid transparent; border-radius: 7px; padding: 7px 9px; background: none; color: var(--text); width: 100%; }
.cf-detail-input.cf-select { background: var(--elevated); }
.cf-detail-input.cf-select option { background: var(--panel); }
.cf-detail-input.cf-date { color-scheme: dark; }
.cf-detail-input:hover { border-color: var(--border); }
.cf-detail-input:focus { border-color: var(--accent); outline: none; background: var(--elevated); }

/* ---- Board view ---- */
.board { display: flex; gap: 14px; padding: 18px 28px 80px; align-items: flex-start; overflow-x: auto; height: 100%; }
.column { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; width: 290px; flex: none; max-height: 100%; display: flex; flex-direction: column; }
.column-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 8px; font-weight: 600; }
.column-head .count { color: var(--faint); font-weight: 700; font-family: var(--mono); font-size: 12px; }
.column-body { padding: 4px 10px 10px; overflow-y: auto; min-height: 24px; }
.card { background: var(--elevated); border: 1px solid var(--border); border-radius: 10px; padding: 11px 12px; margin-bottom: 8px; cursor: pointer; }
.card:hover { border-color: var(--border-strong); }
.card.dragging { opacity: .4; }
.column.drag-over { outline: 1.5px dashed var(--accent); outline-offset: -4px; }
.card-title { font-weight: 600; margin-bottom: 8px; display: flex; gap: 9px; align-items: flex-start; }
.card-title .task-title { flex: 1; white-space: normal; }
.card.done .task-title { color: var(--faint); text-decoration: line-through; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.col-add { padding: 6px 12px 12px; color: var(--faint); font-weight: 600; background: none; border: none; text-align: left; }
.col-add:hover { color: var(--accent); }
.add-section-col { flex: none; height: fit-content; margin-top: 4px; padding: 12px 16px; min-width: 200px; color: var(--muted); font-weight: 600; background: var(--panel); border: 1px dashed var(--border-strong); border-radius: 12px; text-align: left; }
.add-section-col:hover { color: var(--accent); border-color: var(--accent); }

/* ---- Calendar ---- */
.cal-wrap { padding: 18px 32px 60px; max-width: 1680px; margin: 0 auto; }
.cal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--border); gap: 1px; }
.cal-dow { background: var(--panel); padding: 8px; text-align: center; font-weight: 700; font-size: 11px; color: var(--muted); font-family: var(--mono); letter-spacing: .06em; }
.cal-cell { min-height: 108px; background: var(--bg); padding: 6px; }
.cal-cell.out { background: var(--panel); color: var(--faint); }
.cal-date { font-weight: 700; font-size: 12px; margin-bottom: 4px; font-family: var(--mono); color: var(--muted); }
.cal-cell.today .cal-date { color: #0a0a0a; background: var(--accent); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.cal-task { font-size: 12px; padding: 3px 7px; border-radius: 6px; margin-bottom: 3px; color: #0a0a0a; font-weight: 600; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-task.done { opacity: .5; text-decoration: line-through; }

/* ---- My Tasks ---- */
.mt-group { margin: 8px auto; max-width: 1400px; padding: 0 32px; }
.mt-group h3 { font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border); padding-bottom: 8px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }

/* ---- Task detail slide-over ---- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.overlay.open { opacity: 1; pointer-events: auto; }
.detail { position: fixed; top: 0; right: 0; height: 100vh; width: 520px; max-width: 92vw; background: var(--panel); border-left: 1px solid var(--border); box-shadow: var(--shadow); z-index: 50; transform: translateX(100%); transition: transform .24s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; }
.detail.open { transform: translateX(0); }
.detail-top { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.detail-complete { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong); background: var(--elevated); border-radius: 7px; padding: 6px 11px; font-weight: 600; color: var(--muted); }
.detail-complete.done { background: rgba(93,175,74,.15); border-color: var(--green); color: var(--green); }
.detail-body { padding: 20px; overflow-y: auto; flex: 1; }
.detail-title { font-size: 22px; font-weight: 700; border: none; outline: none; width: 100%; background: none; color: var(--text); margin-bottom: 18px; }
.field { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 10px; padding: 8px 0; }
.field label { color: var(--muted); font-weight: 600; font-size: 12px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em; }
.field select, .field input { border: 1px solid transparent; border-radius: 7px; padding: 7px 9px; background: none; color: var(--text); }
.field select { background: var(--elevated); }
.field select option { background: var(--panel); }
.field select:hover, .field input:hover { border-color: var(--border); }
.field select:focus, .field input:focus { border-color: var(--accent); outline: none; background: var(--elevated); }
.field input[type=date] { color-scheme: dark; }
.detail-section { margin-top: 22px; }
.detail-section h4 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 10px; font-family: var(--mono); }
.desc { width: 100%; min-height: 80px; border: 1px solid var(--border); border-radius: 8px; padding: 10px; resize: vertical; outline: none; background: var(--elevated); color: var(--text); }
.desc:focus { border-color: var(--accent); }
.subtask { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.subtask .check { width: 17px; height: 17px; }
.subtask span.t { flex: 1; }
.subtask.done span.t { color: var(--faint); text-decoration: line-through; }
.subtask .del, .comment-del { border: none; background: none; color: var(--faint); opacity: 0; }
.subtask:hover .del { opacity: 1; }
.comment { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.comment .body { font-size: 13px; }
.comment .who { font-weight: 700; font-size: 13px; }
.comment .when { color: var(--faint); font-size: 11px; margin-left: 6px; font-family: var(--mono); }
.comment-box { display: flex; gap: 10px; margin-top: 12px; }
.comment-box input { flex: 1; border: 1px solid var(--border-strong); border-radius: 8px; padding: 9px 11px; outline: none; background: var(--elevated); color: var(--text); }
.comment-box input:focus { border-color: var(--accent); }
.icon-btn { border: none; background: none; color: var(--muted); font-size: 18px; padding: 6px; border-radius: 6px; line-height: 1; }
.icon-btn:hover { background: var(--hover); color: var(--accent); }
.empty { color: var(--faint); text-align: center; padding: 60px 20px; }

/* ---- Login ---- */
.login { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(1100px 560px at 70% -10%, rgba(234,240,68,.06), var(--bg)); }
.login-card { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 40px; width: 380px; box-shadow: var(--shadow); text-align: center; }
.login-card svg { width: 52px; height: 52px; margin: 0 auto 16px; display: block; }
.login-card h1 { font-size: 22px; letter-spacing: .04em; margin: 0 0 6px; text-transform: uppercase; }
.login-card p { color: var(--muted); margin: 0 0 24px; }
.login-card .btn.primary { width: 100%; padding: 12px; font-size: 15px; }
.login-err { background: rgba(226,106,106,.14); color: var(--red); border-radius: 8px; padding: 10px; margin-bottom: 16px; font-weight: 600; font-size: 13px; }

/* ---- Modals (new project + import) ---- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; place-items: center; z-index: 60; }
.modal-back.open { display: grid; }
.modal { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 24px; width: 400px; box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 16px; letter-spacing: .02em; }
.modal label.lbl { display: block; color: var(--muted); font-size: 12px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em; margin: 12px 0 6px; }
.modal input, .modal select { width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px; margin-bottom: 4px; outline: none; background: var(--elevated); color: var(--text); }
.modal input:focus, .modal select:focus { border-color: var(--accent); }
.modal .hint { color: var(--faint); font-size: 12px; margin: 4px 0 8px; }
.modal .hint a { color: var(--accent); }
.swatches { display: flex; gap: 8px; margin: 8px 0 18px; }
.swatch { width: 26px; height: 26px; border-radius: 7px; cursor: pointer; border: 2px solid transparent; }
.swatch.sel { border-color: var(--text); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.modal .status { font-size: 13px; color: var(--muted); margin-top: 10px; min-height: 18px; }
.modal .status.err { color: var(--red); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -2px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* assignee autocomplete */
.ac-wrap { position: relative; }
.ac-menu { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--elevated); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; z-index: 70; display: none; }
.ac-menu.open { display: block; }
.ac-opt { display: flex; align-items: center; gap: 9px; padding: 8px 10px; cursor: pointer; }
.ac-opt:hover { background: var(--hover); }
.ac-opt.active { background: rgba(234,240,68,.18); box-shadow: inset 3px 0 0 var(--accent); }
.ac-opt.active .em { color: var(--muted); }
/* keyboard-highlight for the .tag-opt pickers (follower / tag / blocker / team / share) */
.tag-opt.active, .tag-create.active { background: rgba(234,240,68,.18); box-shadow: inset 3px 0 0 var(--accent); }
.ac-opt .em { color: var(--faint); font-size: 11px; font-family: var(--mono); }

/* ---- Topbar global search ---- */
.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap .search-ico { position: absolute; left: 10px; font-size: 12px; opacity: .6; pointer-events: none; }
#globalSearch { width: 248px; border: 1px solid var(--border-strong); background: var(--panel); color: var(--text); border-radius: 8px; padding: 8px 12px 8px 30px; outline: none; transition: width .18s, border-color .12s; }
#globalSearch::placeholder { color: var(--faint); }
#globalSearch:focus { border-color: var(--accent); width: 320px; }
#globalSearch::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ---- Project star ---- */
.proj-item .proj-star { margin-left: auto; border: none; background: none; color: var(--faint); font-size: 14px; line-height: 1; padding: 2px 4px; border-radius: 5px; opacity: 0; flex: none; }
.proj-item:hover .proj-star, .proj-item .proj-star.on { opacity: 1; }
.proj-item .proj-star.on { color: var(--accent); }
.proj-item .proj-star:hover { color: var(--accent); background: var(--hover); }

/* Let the project NAME use the full row: the ⋯ menu + star overlay the right
   edge on hover (or when pinned) instead of reserving layout width, so a name
   like "Series C Tracker" shows in full whenever it fits. */
.proj-item { gap: 8px; position: relative; }
.proj-item .nm { flex: 0 1 auto; min-width: 0; }   /* hug content; don't grow into the controls' zone */
.proj-item .menu-wrap { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); margin: 0; }
.proj-item .proj-star { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); margin: 0; }
/* On hover the ⋯/★ controls occupy the right edge, so hide the share chip then
   (it's a passive indicator) to avoid overlap; it returns when not hovering. */
.proj-item:hover .proj-shared { opacity: 0; }
.proj-item:has(.proj-star.on) { padding-right: 30px; }   /* room for the pinned star (Starred group) */
.proj-group-label { color: var(--faint); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; font-family: var(--mono); padding: 12px 12px 4px; }
.proj-group-label:first-child { padding-top: 2px; }
.star-btn { border: none; background: none; color: var(--faint); font-size: 18px; line-height: 1; padding: 2px 4px; border-radius: 6px; align-items: center; }
.star-btn:hover { color: var(--accent); background: var(--hover); }
.star-btn.on { color: var(--accent); }

/* ---- Sort / filter bar ---- */
.sf-bar { display: flex; align-items: center; gap: 8px; padding: 12px 0 4px; flex-wrap: wrap; }
.sf-sel { border: 1px solid var(--border-strong); background: var(--elevated); color: var(--text); border-radius: 7px; padding: 6px 9px; font-weight: 600; font-size: 12px; outline: none; }
.sf-sel:hover { border-color: #444; }
.sf-sel:focus { border-color: var(--accent); }
.sf-sel option { background: var(--panel); }
.sf-spacer { flex: 1; }
.board-wrap { display: flex; flex-direction: column; height: 100%; }
.board-wrap .sf-bar.in-board { padding: 12px 28px 0; flex: none; }
.board-wrap .board { flex: 1; min-height: 0; }
.sf-toggle { border: 1px solid var(--border-strong); background: var(--elevated); color: var(--muted); border-radius: 7px; padding: 6px 12px; font-weight: 600; font-size: 12px; }
.sf-toggle:hover { border-color: #444; color: var(--text); }
.sf-toggle.on { border-color: var(--accent); color: var(--accent); background: rgba(234,240,68,.10); }

/* ---- Tag chips ---- */
.tag-chips { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.task-main .tag-chips { margin-left: 4px; }
.card > .tag-chips { margin: 2px 0 8px; }
.tag-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; font-family: var(--mono); letter-spacing: .02em;
  color: var(--tc, #9c9c9c); background: color-mix(in srgb, var(--tc, #5b6b8c) 16%, transparent); border: 1px solid color-mix(in srgb, var(--tc, #5b6b8c) 32%, transparent); }
.tag-chips.sm .tag-chip { font-size: 10px; padding: 1px 7px; }
.tag-x { border: none; background: none; color: inherit; opacity: .6; font-size: 10px; line-height: 1; padding: 0; }
.tag-x:hover { opacity: 1; }
.card-likes { color: var(--red); font-size: 12px; font-weight: 700; font-family: var(--mono); }

/* ---- Tags editor in detail ---- */
.tags-edit { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tag-add, .flw-add { border: 1px dashed var(--border-strong); background: none; color: var(--muted); border-radius: 7px; padding: 4px 10px; font-weight: 600; font-size: 12px; }
.tag-add:hover, .flw-add:hover { border-color: var(--accent); color: var(--accent); }
.flw-add { border-radius: 50%; width: 26px; height: 26px; padding: 0; font-size: 15px; line-height: 1; }
.tag-menu, .flw-menu { left: 0; right: auto; min-width: 232px; padding: 8px; }
.detail-menu .ctx-menu { right: 0; }
.tag-search { width: 100%; border: 1px solid var(--border-strong); background: var(--panel); color: var(--text); border-radius: 7px; padding: 7px 9px; outline: none; margin-bottom: 8px; }
.tag-search:focus { border-color: var(--accent); }
.tag-swatches { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.swatch.sm { width: 18px; height: 18px; border-radius: 5px; }
.tag-list { max-height: 220px; overflow-y: auto; }
.tag-opt { display: flex; align-items: center; gap: 8px; }
.tag-dot { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.tag-create { color: var(--accent); font-weight: 700; }
.ctx-empty { color: var(--faint); padding: 8px 10px; font-size: 12px; }

/* submenu (move-to-project) */
.ctx-sub { position: relative; }
.ctx-sub > .ctx-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ctx-sub .sub-caret { color: var(--faint); }
.ctx-menu.submenu { display: none; position: absolute; right: 100%; top: -5px; margin-right: 4px; min-width: 180px; }
.ctx-sub:hover > .ctx-menu.submenu { display: block; }

/* Inline "Move to project" expander — expands DOWN inside the menu instead of
   a side-flyout (flyouts get clipped by ancestor overflow). */
.ctx-movewrap > .ctx-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ctx-movewrap > .ctx-item .sub-caret { color: var(--faint); margin-left: auto; }
.ctx-submenu-inline { display: none; max-height: 240px; overflow-y: auto; }
.ctx-movewrap.open > .ctx-submenu-inline { display: block; }
.ctx-submenu-inline .ctx-item { padding-left: 22px; font-size: 13px; }
.ctx-item .proj-dot { width: 10px; height: 10px; }
.ctx-item { display: flex; align-items: center; gap: 8px; }

/* row/card ⋯ menu (reuses .menu-wrap / .sec-more / .ctx-menu) */
.row-actions { justify-content: flex-end; }
.task-row .menu-wrap, .card .menu-wrap { opacity: 0; }
.task-row:hover .menu-wrap, .card:hover .menu-wrap, .menu-wrap.open { opacity: 1; }
.card .card-title .menu-wrap { margin-left: auto; }

/* ---- Likes button ---- */
.like-btn { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-strong); background: var(--elevated); color: var(--muted); border-radius: 7px; padding: 6px 11px; font-weight: 700; font-size: 13px; }
.like-btn:hover { border-color: var(--red); color: var(--red); }
.like-btn.liked { border-color: var(--red); color: var(--red); background: rgba(226,106,106,.14); }
.like-btn .heart { font-size: 14px; }

/* ---- Followers ---- */
.followers-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flw-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--elevated); border: 1px solid var(--border); border-radius: 20px; padding: 3px 9px 3px 4px; font-size: 12px; font-weight: 600; }
.flw-name { color: var(--text); }
.flw-x { border: none; background: none; color: var(--faint); font-size: 11px; padding: 0 2px; line-height: 1; }
.flw-x:hover { color: var(--red); }
.flw-empty { color: var(--faint); font-size: 13px; }
.flw-add-wrap { position: relative; }

/* ---- Dependencies (Blocked by / Blocking) ---- */
.dep-section .dep-h2 { margin-top: 18px; }
.dep-empty { color: var(--faint); font-size: 13px; padding: 2px 0 6px; }
.dep-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; font-size: 13px; }
.dep-ico { font-size: 12px; opacity: .8; flex: none; }
.dep-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dep-row.done .dep-title { color: var(--faint); text-decoration: line-through; }
.dep-check { color: var(--green); font-weight: 700; font-size: 12px; }
.dep-x { border: none; background: none; color: var(--faint); font-size: 11px; padding: 0 2px; line-height: 1; opacity: 0; }
.dep-row:hover .dep-x { opacity: 1; }
.dep-x:hover { color: var(--red); }
.dep-add { display: inline-block; margin-top: 6px; }
.dep-add .dep-add-btn { width: auto; height: auto; border-radius: 7px; padding: 4px 10px; font-size: 12px; }

/* ---- Attachments (task detail) ---- */
.att-section .att-list { display: flex; flex-direction: column; gap: 2px; }
.att-empty { color: var(--faint); font-size: 13px; padding: 2px 0 6px; }
.att-row { display: flex; align-items: center; gap: 6px; border-radius: 7px; }
.att-row:hover { background: var(--hover); }
.att-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 6px 8px;
  border-radius: 7px; text-decoration: none; color: var(--text); }
.att-ico { font-size: 14px; flex: none; opacity: .9; }
.att-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 500; }
.att-link:hover .att-name { color: var(--accent); }
.att-size { flex: none; color: var(--faint); font-size: 11px; font-family: var(--mono); }
.att-x { border: none; background: none; color: var(--faint); font-size: 11px; line-height: 1;
  padding: 4px 7px; border-radius: 6px; flex: none; opacity: 0; }
.att-row:hover .att-x { opacity: 1; }
.att-x:hover { color: var(--red); background: rgba(226,106,106,.16); }
.att-add-wrap { margin-top: 8px; }
.att-add { border: 1px dashed var(--border-strong); background: none; color: var(--muted);
  border-radius: 7px; padding: 6px 12px; font-weight: 600; font-size: 12px; }
.att-add:hover { border-color: var(--accent); color: var(--accent); }
.att-add:disabled { opacity: .6; cursor: default; border-color: var(--border-strong); color: var(--muted); }

/* ---- "Blocked" chip (list rows / board cards) ---- */
.blocked-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700;
  font-family: var(--mono); color: var(--muted); background: var(--chip); border: 1px solid var(--border);
  border-radius: 6px; padding: 1px 7px; white-space: nowrap; letter-spacing: .02em; }

/* ---- Activity feed ---- */
.activity-feed { display: flex; flex-direction: column; }
.act-empty { color: var(--faint); font-size: 13px; padding: 4px 0 8px; }
.act-event { display: flex; gap: 10px; padding: 8px 0; align-items: flex-start; border-top: 1px solid var(--border); }
.act-text { font-size: 13px; color: var(--muted); line-height: 1.5; }
.act-text .who { color: var(--text); font-weight: 700; }
.act-text .act-detail { color: var(--muted); }
.act-text .when { display: block; color: var(--faint); font-size: 11px; font-family: var(--mono); margin-top: 2px; }
.mention { color: var(--accent); font-weight: 700; }
.mention-wrap { flex: 1; }
.mention-wrap input { width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; padding: 9px 11px; outline: none; background: var(--elevated); color: var(--text); }
.mention-wrap input:focus { border-color: var(--accent); }

/* ---- Search results ---- */
.search-results { padding: 16px 32px 80px; max-width: 1400px; margin: 0 auto; }
.search-summary { color: var(--muted); font-family: var(--mono); font-size: 12px; letter-spacing: .04em; margin-bottom: 6px; }
.search-h { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); margin: 22px 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.search-projs { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.search-proj { display: inline-flex; align-items: center; gap: 9px; border: 1px solid var(--border); background: var(--panel); color: var(--text); border-radius: 9px; padding: 9px 14px; font-weight: 600; }
.search-proj:hover { border-color: var(--accent); }
.search-row { grid-template-columns: 1fr 200px 130px 40px; }
.search-row .check { cursor: default; }
.search-row .task-title.sr-done { color: var(--faint); text-decoration: line-through; }

/* ---- Teams (sidebar grouping) ---- */
#newTeamBtn { font-size: 13px; }
#browseTeamsBtn { font-size: 13px; }
.team-group { margin-top: 2px; border-radius: 8px; border-left: 2px solid transparent; }
/* drag-to-move drop target highlight (Feature A) */
.team-group.drop-target { background: rgba(234,240,68,.08); border-left-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(234,240,68,.35); }
.team-group.drop-target .team-head { color: var(--accent); }
.team-head {
  display: flex; align-items: center; gap: 7px; padding: 7px 10px 5px 8px; border-radius: 7px; cursor: pointer;
  color: var(--faint); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-family: var(--mono);
}
.team-head:hover { background: var(--hover); color: var(--muted); }
.team-caret { color: var(--faint); transition: transform .15s; font-size: 10px; flex: none; }
.team-group.collapsed .team-caret { transform: rotate(-90deg); }
.team-group.collapsed .team-body { display: none; }
.team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-count { color: var(--faint); font-weight: 700; margin-left: 2px; }
/* pending join-request cue on the team header */
.team-req-badge { margin-left: 6px; flex: none; min-width: 16px; height: 16px; padding: 0 5px; border-radius: 8px;
  background: var(--accent); color: #0a0a0a; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  font-family: var(--mono); letter-spacing: 0; }
.team-head .menu-wrap { margin-left: auto; opacity: 0; transition: opacity .12s; }
.team-head:hover .menu-wrap, .team-head .menu-wrap.open { opacity: 1; }
.team-head .sec-more { font-size: 14px; padding: 0 5px; }
.team-body { display: flex; flex-direction: column; }
.team-empty { color: var(--faint); font-size: 11px; padding: 4px 12px 6px 24px; font-family: var(--mono); }
.team-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; background: var(--accent); }
.team-dot.none { background: var(--faint); }

/* project-row "⋯" menu (move to team) */
.proj-item { position: relative; }
.proj-item .proj-menu { opacity: 0; margin-left: auto; transition: opacity .12s; }
.proj-item:hover .proj-menu, .proj-item .proj-menu.open { opacity: 1; }
.proj-item .proj-menu + .proj-star { margin-left: 0; }
.proj-more { border: none; background: none; color: var(--muted); font-size: 15px; line-height: 1; padding: 0 5px; border-radius: 6px; }
.proj-more:hover { background: var(--hover); color: var(--text); }

/* ---- Topbar team pill ---- */
.team-pill { position: relative; align-items: center; }
.team-pill-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); background: var(--elevated);
  color: var(--muted); border-radius: 20px; padding: 4px 10px; font-weight: 600; font-size: 12px; font-family: var(--mono); letter-spacing: .03em; }
.team-pill-btn:hover { border-color: var(--accent); color: var(--accent); }
.team-pill-btn.empty { border-style: dashed; }
.team-pill-btn .sub-caret { color: var(--faint); font-size: 10px; }
.team-pill .ctx-menu { left: 0; right: auto; }

/* ---- Team modal: members editor ---- */
.team-members-edit { margin-top: 6px; }
.team-members-list { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.team-members-edit .flw-add-wrap { display: inline-block; }
#teamMemberAdd { position: relative; }

/* pending join requests (approver UI) */
.team-requests { margin-bottom: 6px; }
.team-requests-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.team-req-row { display: flex; align-items: center; gap: 9px; border: 1px solid var(--border); border-radius: 9px; padding: 7px 10px; background: var(--panel-2); }
.team-req-who { flex: 1; min-width: 0; }
.team-req-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-req-em { color: var(--muted); font-size: 11px; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-req-actions { display: flex; gap: 6px; flex: none; }
.team-req-approve, .team-req-deny { padding: 5px 12px; font-size: 12px; }

/* ---- Sidebar "+ Create" button + menu ---- */
.create-wrap { position: relative; padding: 6px 12px 0; margin: 0; }
.create-btn { display: flex; align-items: center; gap: 9px; width: 100%; justify-content: center;
  background: var(--accent); color: #0a0a0a; border: none; border-radius: 8px; padding: 10px 12px;
  font-weight: 700; font-size: 14px; letter-spacing: .01em; }
.create-btn:hover { background: #f2f85a; }
.create-btn .ico { font-size: 15px; line-height: 1; }
#createMenu { left: 12px; right: 12px; top: calc(100% + 2px); min-width: 0; }
#createMenu .ci { display: inline-block; width: 18px; text-align: center; opacity: .8; }

/* Inbox nav badge */
.nav-badge { margin-left: auto; background: var(--accent); color: #0a0a0a; font-family: var(--mono);
  font-size: 10px; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px;
  display: inline-grid; place-items: center; }

/* ---- Subtask / comment badges ---- */
.task-badges { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.tbadge { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 11px;
  font-weight: 700; font-family: var(--mono); background: var(--chip); border-radius: 12px; padding: 1px 7px; white-space: nowrap; }
.card-meta .task-badges { gap: 6px; }

/* ---- List row disclosure + inline subtasks ---- */
.row-disc { border: none; background: none; color: var(--faint); font-size: 11px; line-height: 1; flex: none;
  width: 16px; padding: 2px; border-radius: 4px; transition: transform .12s; }
.row-disc:hover { color: var(--text); background: var(--hover); }
.row-disc.open { transform: rotate(90deg); color: var(--accent); }
.task-main .row-disc { margin-right: -4px; }
.subtask-panel { padding: 6px 12px 10px 64px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.012); }
.sp-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.sp-row .check { width: 16px; height: 16px; }
.sp-row .t { font-size: 13px; }
.sp-row.done .t { color: var(--faint); text-decoration: line-through; }
.sp-empty, .sp-loading { color: var(--faint); font-size: 12px; padding: 2px 0 6px; font-family: var(--mono); }
.sp-addrow { display: flex; align-items: center; gap: 9px; padding: 4px 0 0; }
.sp-plus { color: var(--faint); width: 16px; text-align: center; }
.sp-add { border: none; outline: none; background: none; color: var(--text); font-size: 13px; width: 100%; padding: 2px 0; }
.sp-add::placeholder { color: var(--faint); }

/* ---- Nested child tasks ---- */
/* Progress badge ("✓ done/total") on detail heading, list rows, board cards */
.child-progress { display: inline-flex; align-items: center; color: var(--muted); font-size: 11px; font-weight: 700;
  font-family: var(--mono); letter-spacing: .02em; }
h4 .child-progress { color: var(--faint); font-size: 11px; margin-left: 6px; letter-spacing: 0; }
.task-main .child-progress { flex: none; background: var(--chip); border-radius: 12px; padding: 1px 7px; }

/* Detail slide-over: parent breadcrumb back-link */
.detail-breadcrumb { display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box;
  border: 1px solid var(--border); border-left: 3px solid var(--accent); background: rgba(255,255,255,.03);
  padding: 9px 12px; margin-bottom: 12px; border-radius: 8px; cursor: pointer; text-align: left;
  color: #EDEDED; font-family: var(--mono); }
.detail-breadcrumb:hover { background: rgba(234,240,68,.09); border-color: var(--accent); }
.detail-breadcrumb .bc-arrow { color: var(--accent); font-size: 15px; font-weight: 700; }
.detail-breadcrumb .bc-label { color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: .06em; }
.detail-breadcrumb .bc-title { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Detail slide-over: secondary "Checklist" sub-heading */
.detail-subhead { margin-top: 16px !important; }

/* Detail slide-over: a real child-task row (full task) */
.child-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.child-row .check { width: 17px; height: 17px; }
.child-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
  border-radius: 6px; padding: 2px 6px; margin: -2px -6px; }
.child-title:hover { color: var(--accent); background: var(--hover); }
.child-row.done .child-title { color: var(--faint); text-decoration: line-through; }
.child-row .due-pill { flex: none; }
.child-noassignee { color: var(--faint); width: 22px; text-align: center; flex: none; font-size: 13px; }

/* Board card: expand caret + nested child mini-cards */
.card-expand { border: none; background: none; color: var(--faint); font-size: 11px; line-height: 1; flex: none;
  width: 18px; height: 18px; padding: 0; border-radius: 4px; transition: transform .12s; }
.card-expand:hover { color: var(--text); background: var(--hover); }
.card-expand.open { transform: rotate(90deg); color: var(--accent); }
.card-child-badge { background: var(--chip); border-radius: 12px; padding: 1px 7px; }
.card-children { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; padding-left: 10px;
  border-left: 2px solid var(--border-strong); }
.card-children.collapsed { display: none; }
.child-card { display: flex; align-items: center; gap: 8px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 9px; cursor: pointer; }
.child-card:hover { border-color: var(--border-strong); }
.child-card .check { width: 16px; height: 16px; }
.child-card-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; font-size: 13px; }
.child-card.done .child-card-title { color: var(--faint); text-decoration: line-through; }

/* List view: indented child-task rows panel */
.child-panel { padding: 4px 12px 8px 64px; border-bottom: 1px solid var(--border); background: rgba(255,255,255,.012); }
.child-list-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.child-list-row .check { width: 16px; height: 16px; }
.child-list-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; cursor: pointer;
  border-radius: 6px; padding: 2px 6px; margin: -2px -6px; }
.child-list-title:hover { color: var(--accent); background: var(--hover); }
.child-list-row.done .child-list-title { color: var(--faint); text-decoration: line-through; }
.child-list-row .due-pill { flex: none; }
.child-list-row .child-noassignee { color: var(--faint); width: 22px; text-align: center; flex: none; font-size: 13px; }

/* ---- Project status pill (topbar) + Overview status control ---- */
.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 20px; padding: 3px 11px;
  font-weight: 700; font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em;
  color: var(--sc, var(--muted)); background: color-mix(in srgb, var(--sc, #888) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--sc, #888) 34%, transparent); cursor: default; }
.status-pill .status-dot, .status-choice .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sc, var(--muted)); flex: none; }

/* ---- Project Overview tab ---- */
.ov-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 22px; padding: 24px 32px 80px; max-width: 1400px; margin: 0 auto; align-items: start; }
.ov-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.ov-main .ov-card:last-child, .ov-side .ov-card:last-child { margin-bottom: 0; }
.ov-h { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0 0 12px; font-family: var(--mono); }
.ov-desc { width: 100%; min-height: 90px; border: 1px solid var(--border); border-radius: 8px; padding: 11px;
  resize: vertical; outline: none; background: var(--elevated); color: var(--text); line-height: 1.5; }
.ov-desc:focus { border-color: var(--accent); }
.status-note { min-height: 56px; margin-top: 12px; }
.status-choices { display: flex; gap: 8px; flex-wrap: wrap; }
.status-choice { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong);
  background: var(--elevated); color: var(--muted); border-radius: 8px; padding: 8px 13px; font-weight: 600; font-size: 13px; }
.status-choice:hover { border-color: var(--sc); color: var(--text); }
.status-choice.sel { border-color: var(--sc); color: var(--sc); background: color-mix(in srgb, var(--sc) 14%, transparent); }
.ov-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ov-stat { background: var(--elevated); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.ov-stat-n { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.ov-stat-l { color: var(--muted); font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; margin-top: 2px; }
.ov-stat.ok .ov-stat-n { color: var(--green); }
.ov-stat.bad .ov-stat-n { color: var(--red); }
.ov-meta { display: flex; flex-direction: column; gap: 12px; }
.ov-meta-row { display: flex; align-items: center; gap: 12px; }
.ov-meta-k { color: var(--muted); font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; width: 76px; flex: none; }
.ov-meta-v { font-weight: 600; font-size: 13px; }
.ov-team { display: inline-flex; align-items: center; gap: 7px; }
.ov-avatars { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }

/* ---- Timeline (Gantt) ---- */
.tl-wrap { padding: 18px 28px 80px; overflow-x: auto; position: relative; }
/* dependency arrows overlay — spans the full scroll content, scrolls with the
   bars, never intercepts clicks */
.tl-arrows { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 1; overflow: visible; }
.tl-arrow { fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: .42; }
.tl-arrow-head { fill: var(--accent); opacity: .55; }
.tl-row { display: flex; align-items: stretch; min-height: 38px; }
.tl-header { position: sticky; top: 0; z-index: 2; background: var(--bg); border-bottom: 1px solid var(--border); }
.tl-label { flex: none; display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 0; color: var(--text); font-weight: 500;
  position: sticky; left: 0; background: var(--bg); z-index: 1; cursor: pointer; }
.tl-label-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.tl-track-wrap { position: relative; }
.tl-scale { position: relative; }
.tl-mseg { position: absolute; top: 0; height: 34px; border-left: 1px solid var(--border); box-sizing: border-box; padding: 5px 0 0 5px; overflow: hidden; }
.tl-mseg-lbl { font-size: 10px; font-weight: 700; color: var(--accent); font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.tl-today-line { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--accent); opacity: .5; z-index: 2; }
.tl-day { flex: none; border-left: 1px solid var(--border); padding: 4px 0 6px; text-align: center; position: relative; min-height: 36px; }
.tl-day.wknd { background: rgba(255,255,255,.018); }
.tl-day.today { background: rgba(234,240,68,.08); }
.tl-month { display: block; font-size: 9px; font-weight: 700; color: var(--accent); font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; }
.tl-dnum { font-size: 10px; color: var(--faint); font-family: var(--mono); }
.tl-section { font-weight: 700; font-size: 12px; color: var(--muted); font-family: var(--mono); text-transform: uppercase;
  letter-spacing: .06em; padding: 14px 0 6px; position: sticky; left: 0; }
.tl-track { position: relative; height: 38px; border-bottom: 1px solid var(--border);
  background-image: repeating-linear-gradient(90deg, transparent, transparent calc(var(--tlgrid, 30px) - 1px), var(--border) calc(var(--tlgrid, 30px) - 1px), var(--border) var(--tlgrid, 30px)); }
.tl-bar { position: absolute; top: 7px; height: 22px; border-radius: 7px; display: flex; align-items: center; padding: 0 9px;
  background: var(--bc, var(--accent)); color: #0a0a0a; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.35); overflow: hidden; }
.tl-bar:hover { filter: brightness(1.08); }
.tl-bar.done { opacity: .55; }
.tl-bar.overdue { outline: 1.5px solid var(--red); outline-offset: 1px; }
.tl-bar-t { font-size: 11px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* milestone marker (single-date tasks): diamond + label beside it, always visible */
.tl-ms { position: absolute; top: 9px; display: flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap; }
.tl-ms-dot { width: 13px; height: 13px; background: var(--bc, var(--accent)); transform: rotate(45deg); border-radius: 2px; flex: none; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.tl-ms-t { font-size: 11px; font-weight: 600; color: var(--text); }
.tl-ms:hover .tl-ms-t { color: var(--accent); }
.tl-ms.done { opacity: .55; }
.tl-ms.overdue .tl-ms-dot { background: var(--red); }
.tl-nodate { position: absolute; left: 4px; top: 11px; font-size: 10px; color: var(--faint); font-family: var(--mono); cursor: pointer; }
.tl-corner { color: var(--faint); font-size: 11px; font-weight: 700; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.tl-label-spacer { width: 15px; flex: none; }
.tl-due { font-size: 10px; font-weight: 700; font-family: var(--mono); color: var(--muted); margin-left: auto; padding-left: 8px; }
.tl-due.overdue { color: var(--red); }
.tl-due.today { color: var(--accent); }

/* ---- Dashboard (Asana-style widget grid) ---- */
.dash-wrap { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 24px 32px 80px; max-width: 1680px; margin: 0 auto; align-items: start; }
.dash-span-2 { grid-column: 1 / -1; }
.dash-span-all { grid-column: 1 / -1; }

/* top stat-card row spans full width with its own auto-fit grid */
.dash-stats { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dash-stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px 18px 16px; position: relative; overflow: hidden; }
.dash-stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--border-strong); }
.dash-stat.accent::before { background: var(--accent); }
.dash-stat.ok::before { background: var(--green); }
.dash-stat.bad::before { background: var(--red); }
.dash-stat-n { font-size: 38px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.dash-stat.accent .dash-stat-n { color: var(--accent); }
.dash-stat.ok .dash-stat-n { color: var(--green); }
.dash-stat.bad .dash-stat-n { color: var(--red); }
.dash-stat-l { color: var(--muted); font-size: 11px; margin-top: 8px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; }

.dash-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px; min-width: 0; }
.dash-empty-big { color: var(--faint); text-align: center; padding: 44px 16px; font-family: var(--mono); font-size: 13px; }

/* inline-SVG chart primitives */
.chart { width: 100%; height: auto; overflow: visible; display: block; }
.chart-lbl { fill: var(--muted); font-size: 11px; font-family: var(--mono); }
.chart-tick { fill: var(--faint); font-size: 10px; font-family: var(--mono); }
.chart-val { fill: var(--text); font-size: 11px; font-weight: 700; font-family: var(--mono); }
.chart-empty { fill: var(--faint); font-size: 12px; font-family: var(--mono); }
.chart-grid { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.chart-axis { stroke: var(--border-strong); stroke-width: 1; shape-rendering: crispEdges; }
.chart-bar { transition: opacity .12s; }
.chart-bar:hover { opacity: .82; }
.chart-avatar-txt { font-size: 9px; font-weight: 700; font-family: var(--mono); }
.donut-total { fill: var(--text); font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.donut-sub { fill: var(--faint); font-size: 10px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; }

@media (max-width: 1280px) {
  .dash-wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .dash-wrap { grid-template-columns: minmax(0, 1fr); }
  .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- Inbox (Asana-style) ---- */
.inbox-wrap { padding: 16px 32px 80px; max-width: 1100px; margin: 0 auto; }
.inbox-toolbar { display: flex; align-items: center; gap: 10px; padding: 4px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.inbox-tabs { display: flex; gap: 4px; }
.inbox-tab { border: none; background: none; color: var(--muted); font-weight: 600; font-size: 13px; padding: 7px 12px; border-radius: 7px; }
.inbox-tab:hover { color: var(--text); background: var(--hover); }
.inbox-tab.active { color: var(--accent); background: rgba(234,240,68,.10); }
.inbox-act { border: 1px solid var(--border-strong); background: var(--elevated); color: var(--muted); border-radius: 7px; padding: 6px 12px; font-weight: 600; font-size: 12px; }
.inbox-act:hover { color: var(--text); border-color: #444; }
.inbox-group-label { color: var(--faint); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-family: var(--mono); padding: 16px 4px 6px; }
.inbox-list { display: flex; flex-direction: column; }
.inbox-item { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 9px; cursor: pointer; position: relative; border: 1px solid transparent; }
.inbox-item:hover { background: var(--hover); border-color: var(--border); }
.inbox-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex: none; box-shadow: 0 0 0 3px rgba(234,240,68,.12); }
.inbox-dot.off { background: transparent; box-shadow: none; }
.inbox-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; flex: none; background: var(--chip); border: 1px solid var(--border); }
.inbox-ico.ik-done { background: rgba(93,175,74,.16); border-color: rgba(93,175,74,.3); }
.inbox-ico.ik-comment { background: rgba(63,169,245,.14); border-color: rgba(63,169,245,.28); }
.inbox-ico.ik-due { background: rgba(245,138,63,.14); border-color: rgba(245,138,63,.28); }
.inbox-ico.ik-assign { background: rgba(234,240,68,.12); border-color: rgba(234,240,68,.28); }
.inbox-ico.ik-mention { background: rgba(155,109,210,.16); border-color: rgba(155,109,210,.3); }
.inbox-body { flex: 1; min-width: 0; }
.inbox-sentence { font-size: 13.5px; line-height: 1.35; color: var(--text); }
.inbox-who { font-weight: 700; }
.inbox-verb { color: var(--muted); }
.inbox-item.unread .inbox-verb { color: var(--text); }
.inbox-meta { display: flex; align-items: center; gap: 9px; margin-top: 3px; min-width: 0; }
.inbox-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em; flex: none; }
.inbox-task { color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-when { color: var(--faint); font-size: 11px; font-family: var(--mono); flex: none; }
.inbox-archive { border: none; background: none; color: var(--faint); font-size: 13px; padding: 4px 6px; border-radius: 6px; opacity: 0; flex: none; line-height: 1; }
.inbox-item:hover .inbox-archive { opacity: .8; }
.inbox-archive:hover { opacity: 1; background: var(--hover); color: var(--text); }
.inbox-empty { color: var(--faint); text-align: center; padding: 56px 20px; font-size: 14px; }

/* ---- Trash ---- */
.trash-wrap { padding: 16px 32px 80px; max-width: 1100px; margin: 0 auto; }
.trash-head { padding: 4px 0 14px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.trash-title { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 4px; }
.trash-sub { color: var(--muted); font-size: 13px; }
.trash-list { display: flex; flex-direction: column; }
.trash-item { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 9px; border: 1px solid transparent; }
.trash-item:hover { background: var(--hover); border-color: var(--border); }
.trash-ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 12px; flex: none; background: var(--chip); border: 1px solid var(--border); }
.trash-ico.tk-task { background: rgba(234,240,68,.10); border-color: rgba(234,240,68,.26); }
.trash-ico.tk-project { background: rgba(63,169,245,.12); border-color: rgba(63,169,245,.26); }
.trash-body { flex: 1; min-width: 0; }
.trash-row-title { font-size: 13.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-meta { display: flex; align-items: center; gap: 9px; margin-top: 3px; min-width: 0; }
.trash-chip { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em; flex: none; }
.trash-when { color: var(--faint); font-size: 11px; font-family: var(--mono); }
.trash-when.warn { color: var(--amber); }
.trash-when.danger { color: var(--red); }
.trash-actions { display: flex; align-items: center; gap: 6px; flex: none; opacity: 0; }
.trash-item:hover .trash-actions { opacity: 1; }
.trash-act { border: 1px solid var(--border-strong); background: var(--elevated); color: var(--muted); border-radius: 7px; padding: 6px 11px; font-weight: 600; font-size: 12px; }
.trash-act.restore:hover { color: var(--accent); border-color: var(--accent); background: rgba(234,240,68,.10); }
.trash-act.danger { color: var(--red); }
.trash-act.danger:hover { border-color: var(--red); background: rgba(226,106,106,.14); }
.trash-empty { color: var(--faint); text-align: center; padding: 56px 20px; }
.trash-empty-ico { font-size: 34px; opacity: .5; margin-bottom: 10px; }
.trash-empty-title { color: var(--muted); font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.trash-empty-hint { font-size: 13px; max-width: 380px; margin: 0 auto; }

/* ---- Browse teams modal ---- */
.browse-modal { width: 460px; }
.browse-sub { color: var(--muted); font-size: 13px; margin: -6px 0 14px; }
.browse-list { display: flex; flex-direction: column; gap: 8px; max-height: 380px; overflow-y: auto; }
.browse-row { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.browse-meta { flex: 1; min-width: 0; }
.browse-name { font-weight: 700; font-size: 14px; }
.browse-desc { color: var(--muted); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.browse-join { padding: 6px 16px; }
.browse-joined { color: var(--green); font-weight: 700; font-size: 13px; font-family: var(--mono); flex: none; }
/* muted "awaiting approval" pill (join now requires a member to approve) */
.browse-requested { color: var(--muted); font-weight: 700; font-size: 12px; font-family: var(--mono); flex: none;
  border: 1px solid var(--border-strong); border-radius: 20px; padding: 5px 12px; background: var(--elevated); white-space: nowrap; }

/* ==================================================================== */
/* v7: Insights nav, Project Sharing, Portfolios, Goals                 */
/* ==================================================================== */

/* ---- Insights sidebar section ---- */
.nav-section.nav-section-plain { justify-content: flex-start; }
.nav.nav-insights { padding-top: 0; padding-bottom: 2px; }

/* ---- Small status pill variant (portfolios + goals) ---- */
.status-pill.sm { font-size: 10px; padding: 2px 9px; }
.status-pill.sm .status-dot { width: 6px; height: 6px; }

/* ---- Project topbar "Share" button + popover ---- */
.page-share { position: relative; }
.share-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-strong);
  background: var(--elevated); color: var(--text); border-radius: 8px; padding: 5px 11px; font-weight: 600; font-size: 12px; }
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-ico { font-size: 11px; opacity: .85; }
.share-count { background: var(--chip); color: var(--muted); border-radius: 10px; padding: 0 7px; font-family: var(--mono);
  font-size: 10px; font-weight: 700; min-width: 18px; text-align: center; }
.share-pop { left: 0; right: auto; min-width: 320px; max-width: 360px; padding: 14px; }
.share-head { margin-bottom: 12px; }
.share-title { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-sub { color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.4; }

/* ---- Access-mode selector (Feature B) ---- */
.share-access { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.share-access-opt { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  border: 1px solid var(--border-strong); background: var(--elevated); border-radius: 9px; padding: 9px 11px; color: var(--text); }
.share-access-opt:hover { border-color: #444; }
.share-access-opt.sel { border-color: var(--accent); background: rgba(234,240,68,.10); }
.share-access-opt .sa-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; margin-top: 3px;
  border: 1.6px solid var(--faint); background: transparent; }
.share-access-opt.sel .sa-dot { border-color: var(--accent); box-shadow: inset 0 0 0 2.5px var(--accent); }
.share-access-opt .sa-dot.team { border-radius: 3px; }
.share-access-opt .sa-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.share-access-opt .sa-t { font-weight: 600; font-size: 13px; }
.share-access-opt .sa-t strong { font-weight: 700; }
.share-access-opt.sel .sa-t { color: var(--accent); }
.share-access-opt .sa-d { color: var(--muted); font-size: 11px; font-family: var(--mono); letter-spacing: .02em; }

.share-people { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }
.share-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 7px; }
.share-row:hover { background: var(--hover); }
.share-person { flex: 1; min-width: 0; }
.share-name { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-em { color: var(--faint); font-size: 11px; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-role { color: var(--muted); font-size: 11px; font-family: var(--mono); flex: none; }
.share-role.owner { color: var(--accent); }
/* restricted team row — team members are excluded in private mode (Feature B) */
.share-role.restricted { color: var(--faint); }
.share-row.restricted .share-name { color: var(--muted); }
.share-row.restricted .share-em { color: var(--faint); font-style: italic; }
.share-row.restricted { opacity: .85; }
.share-x { border: none; background: none; color: var(--faint); font-size: 12px; padding: 3px 5px; border-radius: 5px; flex: none; opacity: 0; }
.share-row:hover .share-x { opacity: .8; }
.share-x:hover { opacity: 1; background: rgba(226,106,106,.16); color: var(--red); }
.share-add-label { color: var(--faint); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-family: var(--mono); margin: 12px 0 6px; }
.share-add.flw-add-wrap { display: block; }
.share-add .flw-add { width: 100%; text-align: left; border: 1px dashed var(--border-strong); background: var(--elevated);
  color: var(--muted); border-radius: 8px; padding: 8px 12px; font-weight: 600; }
.share-add .flw-add:hover { border-color: var(--accent); color: var(--accent); }
.share-add .flw-menu { left: 0; right: 0; top: calc(100% + 4px); z-index: 120; }
/* When a picker inside the share popover is open, lift its whole wrap (and its
   absolutely-positioned dropdown) above the sibling sections below it — otherwise
   later sections (e.g. "Move to another team") paint over the dropdown's top,
   so it reads as "behind the card". */
.share-pop .menu-wrap.open { z-index: 100; }
/* ---- Share with a team (Feature C) ---- */
.share-team-add .flw-menu .tag-opt { align-items: center; }
.share-team-add .flw-menu .tag-opt .team-dot { width: 11px; height: 11px; border-radius: 3px; }
.share-team-add .flw-menu .tag-opt .em { color: var(--faint); font-size: 11px; font-family: var(--mono); }
/* shared-team access rows reuse .share-row; show ✕ on hover like people rows,
   and tint the role chip to read as a granted scope rather than the owner accent. */
.share-row.shared-team .share-role { color: var(--muted); }
.share-move { display: block; position: relative; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.share-move-btn { display: inline-flex; align-items: center; gap: 8px; width: 100%; border: 1px solid var(--border-strong);
  background: var(--elevated); color: var(--text); border-radius: 8px; padding: 8px 12px; font-weight: 600; font-size: 12px; }
.share-move-btn:hover { border-color: var(--accent); }
.share-move-btn .sub-caret { margin-left: auto; color: var(--faint); font-size: 10px; }
.share-move .ctx-menu { left: 0; right: 0; top: calc(100% + 4px); }

/* ---- Insights views shared shell (Portfolios + Goals) ---- */
.insights-wrap { padding: 22px 32px 80px; max-width: 1400px; margin: 0 auto; }
.insights-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.insights-title { font-size: 20px; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.insights-sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.insights-empty { color: var(--faint); text-align: center; padding: 60px 20px; }
.insights-empty .ie-ico { font-size: 38px; margin-bottom: 12px; opacity: .75; }

/* ---- Portfolios ---- */
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.pf-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px; min-width: 0; }
.pf-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.pf-name { font-size: 16px; font-weight: 700; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-menu-wrap { margin-left: auto; opacity: .5; }
.pf-menu-wrap:hover, .pf-menu-wrap.open { opacity: 1; }
.pf-rollup { display: flex; height: 9px; border-radius: 6px; overflow: hidden; background: var(--chip); gap: 2px; }
.pf-seg { display: block; }
.pf-seg.empty { background: var(--chip); }
.pf-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 9px 0 14px; }
.pf-leg { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 11px; font-family: var(--mono); }
.pf-leg-dot { width: 8px; height: 8px; border-radius: 3px; }
.pf-projects { display: flex; flex-direction: column; gap: 2px; }
.pf-empty { color: var(--faint); font-size: 12px; font-family: var(--mono); padding: 6px 4px 8px; }
.pf-proj { display: flex; align-items: center; gap: 9px; padding: 8px 6px; border-radius: 8px; cursor: pointer; }
.pf-proj:hover { background: var(--hover); }
.pf-proj-name { flex: 1; min-width: 0; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-nostatus { color: var(--faint); font-size: 10px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .05em; flex: none; }
.pf-x { border: none; background: none; color: var(--faint); font-size: 12px; padding: 3px 5px; border-radius: 5px; flex: none; opacity: 0; }
.pf-proj:hover .pf-x { opacity: .8; }
.pf-x:hover { opacity: 1; background: rgba(226,106,106,.16); color: var(--red); }
.pf-add { display: inline-block; margin-top: 10px; }
.pf-add-btn { border: 1px dashed var(--border-strong); background: none; color: var(--muted); border-radius: 8px; padding: 7px 12px; font-weight: 600; font-size: 12px; }
.pf-add-btn:hover { border-color: var(--accent); color: var(--accent); }
.pf-add-menu { left: 0; right: auto; min-width: 220px; max-height: 280px; overflow-y: auto; }

/* ---- Goals ---- */
.goal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.goal-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; min-width: 0; }
.goal-top { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.goal-menu-wrap { margin-left: auto; opacity: .5; }
.goal-menu-wrap:hover, .goal-menu-wrap.open { opacity: 1; }
.goal-name { font-size: 16px; font-weight: 700; margin: 0 0 6px; line-height: 1.3; }
.goal-desc { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 0 0 14px; }
.goal-prog-row { display: flex; align-items: center; gap: 10px; margin-top: auto; }
.goal-prog { flex: 1; height: 8px; background: var(--chip); border-radius: 5px; overflow: hidden; }
.goal-prog-fill { height: 100%; border-radius: 5px; transition: width .2s; }
.goal-prog-n { font-family: var(--mono); font-weight: 700; font-size: 12px; color: var(--text); flex: none; min-width: 38px; text-align: right; }
.goal-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.goal-owner { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.goal-target { color: var(--faint); font-size: 11px; font-family: var(--mono); }

/* ---- Goal editor modal ---- */
.goal-modal { width: 460px; }
.goal-modal textarea { width: 100%; }
.goal-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.goal-modal-grid > div { display: flex; flex-direction: column; }
.goal-prog-edit { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.goal-prog-edit input[type=range] { flex: 1; accent-color: var(--accent); }
.goal-prog-out { font-family: var(--mono); font-weight: 700; font-size: 13px; min-width: 44px; text-align: right; }

/* ==================================================================== */
/* Messages tab (per-project announcement board)                        */
/* ==================================================================== */
.msg-wrap { padding: 22px 32px 80px; max-width: 820px; margin: 0 auto; }
.msg-composer { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 20px; }
.msg-title-inp { width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; padding: 9px 11px; background: var(--elevated); color: var(--text); outline: none; font-weight: 600; }
.msg-title-inp:focus { border-color: var(--accent); }
.msg-title-inp::placeholder { color: var(--faint); }
.msg-body-inp { width: 100%; min-height: 72px; border: 1px solid var(--border-strong); border-radius: 8px; padding: 10px 11px; margin-top: 10px;
  background: var(--elevated); color: var(--text); outline: none; resize: vertical; line-height: 1.5; font-family: inherit; }
.msg-body-inp:focus { border-color: var(--accent); }
.msg-body-inp::placeholder { color: var(--faint); }
.msg-composer-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.msg-post { padding: 8px 20px; }
.msg-list { display: flex; flex-direction: column; gap: 12px; }
.msg-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.msg-head { display: flex; align-items: center; gap: 10px; }
.msg-byline { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.msg-author { font-weight: 700; font-size: 13px; }
.msg-when { color: var(--faint); font-size: 11px; font-family: var(--mono); }
.msg-del { border: none; background: none; color: var(--faint); font-size: 13px; padding: 4px 7px; border-radius: 6px; flex: none; opacity: 0; line-height: 1; }
.msg-card:hover .msg-del { opacity: .7; }
.msg-del:hover { opacity: 1; background: rgba(226,106,106,.16); color: var(--red); }
.msg-title { font-weight: 700; font-size: 15px; margin-top: 12px; letter-spacing: .01em; }
.msg-body { color: var(--text); font-size: 13.5px; line-height: 1.55; margin-top: 6px; white-space: pre-wrap; word-wrap: break-word; }
.msg-empty { color: var(--faint); text-align: center; padding: 50px 20px; font-size: 14px; }

/* ==================================================================== */
/* Automations tab (per-project workflow rules)                         */
/* ==================================================================== */
.auto-wrap { padding: 22px 32px 80px; max-width: 820px; margin: 0 auto; }
.auto-note { color: var(--muted); font-size: 12px; font-family: var(--mono); letter-spacing: .03em; margin-bottom: 16px; }
.auto-builder { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 18px; margin-bottom: 20px; }
.auto-builder .ov-h { margin-bottom: 14px; }
.auto-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.auto-lbl { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-family: var(--mono); width: 48px; flex: none; }
.auto-sel { border: 1px solid var(--border-strong); background: var(--elevated); color: var(--text); border-radius: 8px; padding: 8px 10px; font-weight: 600; font-size: 13px; outline: none; }
.auto-sel:hover { border-color: #444; }
.auto-sel:focus { border-color: var(--accent); }
.auto-sel option { background: var(--panel); }
.auto-inp { border: 1px solid var(--border-strong); background: var(--elevated); color: var(--text); border-radius: 8px; padding: 8px 10px; font-size: 13px; outline: none; min-width: 200px; flex: 1; }
.auto-inp:hover { border-color: #444; }
.auto-inp:focus { border-color: var(--accent); }
.auto-inp::placeholder { color: var(--faint); }
.auto-config { display: inline-flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.auto-config .auto-inp { width: 100%; }
.auto-builder-actions { display: flex; justify-content: flex-end; margin-top: 6px; }
.auto-list { display: flex; flex-direction: column; gap: 10px; }
.auto-rule { display: flex; align-items: center; gap: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.auto-rule.off { opacity: .6; }
.auto-rule-main { flex: 1; min-width: 0; }
.auto-rule-name { font-weight: 700; font-size: 12px; color: var(--muted); font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 3px; }
.auto-sentence { font-size: 13.5px; line-height: 1.4; color: var(--text); }
.auto-sentence strong { color: var(--accent); font-weight: 700; }
.auto-del { border: none; background: none; color: var(--faint); font-size: 13px; padding: 5px 7px; border-radius: 6px; flex: none; line-height: 1; opacity: 0; }
.auto-rule:hover .auto-del { opacity: .7; }
.auto-del:hover { opacity: 1; background: rgba(226,106,106,.16); color: var(--red); }
.auto-empty { color: var(--faint); text-align: center; padding: 50px 20px; font-size: 14px; }

/* toggle switch (styled checkbox) */
.auto-switch { position: relative; display: inline-flex; flex: none; width: 38px; height: 21px; cursor: pointer; }
.auto-toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
.auto-slider { position: absolute; inset: 0; background: var(--chip); border: 1px solid var(--border-strong); border-radius: 20px; transition: background .15s, border-color .15s; }
.auto-slider::before { content: ""; position: absolute; left: 2px; top: 2px; width: 15px; height: 15px; border-radius: 50%; background: var(--faint); transition: transform .15s, background .15s; }
.auto-toggle-input:checked + .auto-slider { background: rgba(234,240,68,.18); border-color: var(--accent); }
.auto-toggle-input:checked + .auto-slider::before { transform: translateX(17px); background: var(--accent); }
.auto-toggle-input:focus-visible + .auto-slider { box-shadow: 0 0 0 2px rgba(234,240,68,.4); }

/* ---- Admin "View as user" (read-only impersonation) ---- */
/* Fixed, unmistakable banner: thin lime top border + dark bar + eye glyph. */
.view-as-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 38px; display: flex; align-items: center; gap: 12px;
  padding: 0 18px;
  background: linear-gradient(180deg, #1c1c12 0%, #161608 100%);
  border-top: 3px solid var(--accent);
  border-bottom: 1px solid var(--border-strong);
  box-shadow: 0 2px 14px rgba(0,0,0,.55);
  font-family: var(--mono); font-size: 12.5px; color: var(--text);
}
.view-as-banner .va-eye { font-size: 15px; line-height: 1; filter: drop-shadow(0 0 4px rgba(234,240,68,.5)); }
.view-as-banner .va-msg { letter-spacing: .02em; }
.view-as-banner .va-msg strong { color: var(--accent); font-weight: 700; }
.view-as-banner .va-ro {
  text-transform: uppercase; letter-spacing: .14em; font-size: 10px; font-weight: 700;
  color: #0a0a0a; background: var(--accent); border-radius: 4px; padding: 2px 7px;
}
.view-as-banner .va-stop {
  margin-left: auto; border: 1px solid var(--accent); background: transparent; color: var(--accent);
  font-family: var(--mono); font-weight: 700; font-size: 11px; letter-spacing: .06em;
  padding: 4px 14px; border-radius: 6px;
}
.view-as-banner .va-stop:hover { background: var(--accent); color: #0a0a0a; }
.view-as-banner .va-stop:disabled { opacity: .5; cursor: default; }
/* Push the app down so the fixed banner never covers the chrome. */
body.viewing-as .app { height: calc(100vh - 38px); margin-top: 38px; }

/* Admin entry point: the eye button in the sidebar foot, menu opens upward. */
.view-as-wrap { position: relative; flex: none; }
.view-as-wrap.open > .icon-btn { color: var(--accent); background: var(--hover); }
/* Pin to the bottom-left of the viewport so it sits inside the 264px sidebar
   no matter where the eye button lands in the foot row (anchoring to the button
   itself overflowed: the sidebar is only ~as wide as the menu). */
/* Divider between the additive "Share with a team" picker and the destructive
   "Move to another team" control in the share popover. */
.share-move-sep { height: 1px; background: var(--border-strong); margin: 12px 0 8px; }

.view-as-wrap .view-as-menu {
  position: fixed; left: 12px; right: auto; bottom: 60px; top: auto;
  width: 240px; max-width: calc(100vw - 24px); max-height: 60vh; overflow-y: auto;
  padding: 8px; z-index: 60;
}

/* Read-only treatment: neutralize the obvious write affordances. Reads and
   navigation are untouched. The server also 403s any write that slips through. */
body.viewing-as .create-wrap,
body.viewing-as .nav-section-actions,
body.viewing-as .add-section-btn,
body.viewing-as .add-section-col,
body.viewing-as .col-add,
body.viewing-as .add-row,
body.viewing-as .msg-composer,
body.viewing-as .sec-more,
body.viewing-as .tag-add,
body.viewing-as .flw-add-wrap,
body.viewing-as .share-add,
body.viewing-as .star-btn,
body.viewing-as .comment-box,
body.viewing-as .detail-complete { display: none !important; }
/* Keep completion checkboxes VISIBLE (they convey status) but non-clickable. */
body.viewing-as .check { pointer-events: none; }
/* Detail pane sits below the fixed banner; nudge it + its close affordances. */
body.viewing-as .detail { top: 38px; height: calc(100vh - 38px); }
body.viewing-as .detail-title { pointer-events: none; }
/* Make remaining inline-edit / drag affordances inert and dimmed. */
body.viewing-as .task-title,
body.viewing-as .sec-name,
body.viewing-as .card,
body.viewing-as .proj-item { cursor: default; }
body.viewing-as .task-title[contenteditable],
body.viewing-as .sec-name[contenteditable] { pointer-events: none; }
body.viewing-as [draggable="true"] { -webkit-user-drag: none; }
/* The ⋯ task/row menus stay hidden (.sec-more above); detail-pane edit
   controls inherit the same neutered styling via these classes. */

/* ============================================================================
   Keyboard shortcuts (Asana-style) — see the matching block in app.js.
   ============================================================================ */

/* List-view keyboard focus ring. Distinct from :hover (bg only) and from the
   accent text used elsewhere — an inset lime ring on the row. */
.task-row.kbfocus {
  box-shadow: inset 2px 0 0 0 var(--accent), inset 0 0 0 1px rgba(234,240,68,.45);
  background: rgba(234,240,68,.06);
}
.task-row.kbfocus:hover { background: rgba(234,240,68,.10); }

/* Reusable little key chip (used in the hint chip and help overlay). */
.kbk {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  font-family: var(--mono); font-size: 11px; line-height: 1;
  color: var(--accent); background: var(--chip);
  border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 4px;
}

/* Tab-prefix hint chip — bottom-left, fades in while prefix mode is armed. */
.kb-hint {
  position: fixed; left: 16px; bottom: 16px; z-index: 1200;
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px;
  max-width: 460px; padding: 8px 10px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  background: var(--elevated); border: 1px solid var(--accent-dim);
  border-radius: 8px; box-shadow: var(--shadow);
  opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}
.kb-hint.show { opacity: 1; transform: translateY(0); }
.kb-hint b { color: var(--accent); font-family: var(--mono); }
.kb-hint .kbk { margin-left: 6px; }

/* Discreet launcher button — bottom-right. */
.kb-launcher {
  position: fixed; right: 16px; bottom: 16px; z-index: 1100;
  width: 34px; height: 34px; display: grid; place-items: center;
  font-size: 16px; color: var(--muted);
  background: var(--elevated); border: 1px solid var(--border-strong);
  border-radius: 50%; box-shadow: var(--shadow);
  transition: color .15s, border-color .15s;
}
.kb-launcher:hover { color: var(--accent); border-color: var(--accent); }

/* Help overlay — centered card over a dimmed backdrop. */
.kbh-back {
  position: fixed; inset: 0; z-index: 1300;
  display: none; place-items: center;
  background: rgba(0,0,0,.66); backdrop-filter: blur(2px);
  padding: 24px;
}
.kbh-back.open { display: grid; }
.kbh-card {
  width: 720px; max-width: 100%; max-height: 84vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: var(--shadow);
  padding: 18px 22px 22px;
}
.kbh-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kbh-head h3 {
  margin: 0; font-size: 16px; letter-spacing: -.01em;
  display: flex; align-items: center; gap: 8px;
}
.kbh-head h3::before {
  content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent);
}
.kbh-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 28px;
}
.kbh-group { padding: 6px 0; }
.kbh-group h4 {
  margin: 4px 0 8px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--faint); font-family: var(--mono);
}
.kbh-row {
  display: grid; grid-template-columns: 110px 1fr; align-items: center;
  gap: 10px; padding: 4px 0;
}
.kbh-keys { display: flex; gap: 4px; flex-wrap: wrap; }
.kbh-desc { color: var(--muted); font-size: 13px; }
@media (max-width: 560px) { .kbh-cols { grid-template-columns: 1fr; } }

/* While viewing-as, the delete/assign shortcuts no-op in JS; nothing to style. */
