/* ============================================================
   Design tokens v2 (ONM-418 — sage palette, full token set)
   Dark-first. Warm charcoal + sage accent.
   User selected Option C: sage #6ea98a.
   ============================================================ */
:root {
  /* Background layers */
  --bg:               #111315;
  --bg-elevated:      #191c1f;
  --surface:          #202429;
  --surface-hover:    #272c31;
  --surface-active:   #2e343a;
  --surface-elevated: #242830;   /* modals, popovers */

  /* Borders */
  --border:           #272c31;
  --border-strong:    #333a40;

  /* Text */
  --text:             #e8eaec;
  --text-strong:      #ffffff;
  --text-muted:       #7a8490;
  --text-dim:         #52595f;

  /* Accent — sage green (ONM-418, Option C) */
  --accent:           #6ea98a;
  --accent-hover:     #85c0a0;
  --accent-soft:      rgba(110, 169, 138, 0.12);
  --accent-secondary: #6d8dff;

  /* Semantic */
  --success:          #5db87a;
  --warn:             #e6a832;
  --danger:           #eb5757;

  /* Priority */
  --priority-urgent:  #eb5757;
  --priority-high:    #f2994a;
  --priority-medium:  #b0b8c0;
  --priority-low:     #6b7280;
  --priority-none:    #3e4550;

  /* Status */
  --status-backlog:   #8899aa;
  --status-todo:      #c8d0d8;
  --status-progress:  #d8a84e;
  --status-done:      #5db87a;
  --status-cancelled: #6b7280;
  --status-triage:    #f59e0b;

  /* Corner radii */
  --radius-sm:  4px;   /* inline badges, tags */
  --radius:     6px;   /* inputs, rows, small cards */
  --radius-md:  8px;   /* cards, dropdowns, popovers */
  --radius-lg:  12px;  /* modals, dialogs */

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.45);
  --shadow-md:  0 4px 14px rgba(0, 0, 0, 0.45);
  --shadow-lg:  0 8px 30px rgba(0, 0, 0, 0.55);

  /* Focus ring */
  --focus-ring: 0 0 0 2px var(--accent-soft), 0 0 0 3px var(--accent);

  /* Motion */
  --duration-fast: 80ms;
  --duration-base: 150ms;
  --ease-out:      cubic-bezier(0.2, 0, 0, 1);

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", monospace;

  /* Density */
  --row-h:     32px;
  --sidebar-w: 220px;
}

/* ============================================================
   Light mode token overrides (ONM-418 — sage palette)
   Applied when <html data-theme="light"> is set.
   Warm off-white ink palette; sage accent adjusted for contrast.
   ============================================================ */
[data-theme="light"] {
  /* Background layers — warm off-white paper tone */
  --bg:               #f7f5f0;
  --bg-elevated:      #ffffff;
  --surface:          #f0ede8;
  --surface-hover:    #e8e5e0;
  --surface-active:   #dedad5;
  --surface-elevated: #ffffff;

  /* Borders */
  --border:           #dedad5;
  --border-strong:    #ccc9c3;

  /* Text — dark ink */
  --text:             #202225;
  --text-strong:      #0d0e10;
  --text-muted:       #6b6c72;
  --text-dim:         #9a9ba0;

  /* Accent — sage darkened for WCAG AA on warm white */
  --accent:           #3a7a5a;
  --accent-hover:     #2a6a4a;
  --accent-soft:      rgba(58, 122, 90, 0.10);
  --accent-secondary: #4a6acc;

  /* Semantic */
  --success:          #2d8a4e;
  --warn:             #c47d10;
  --danger:           #cc3333;

  /* Priority — readable on light */
  --priority-medium:  #666666;
  --priority-none:    #aaaaaa;

  /* Status */
  --status-done:      #2d8a4e;

  /* Shadows — lighter on light bg */
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.12);
  --shadow-lg:  0 8px 24px rgba(0, 0, 0, 0.16);
}

/* Form controls inherit theme in light mode (ONM-385) */
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text);
}

/* ============================================================
   Reset & base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Global focus ring (ONM-418) */
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { background: none; border: none; color: inherit; font: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ============================================================
   App layout
   ============================================================ */
.app { display: flex; height: 100vh; overflow: hidden; }

/* ============================================================
   Sidebar
   ============================================================ */

/* ONM-415: hide sidebar on login page; center content */
.app.no-sidebar .sidebar { display: none !important; }
.app.no-sidebar #view {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  font-weight: 500;
  font-size: 13px;
}

.workspace-switcher:hover { background: var(--surface-hover); }

.workspace-avatar {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
}

.workspace-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.workspace-actions { display: flex; gap: 4px; }

.icon-btn {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.icon-btn:hover { background: var(--surface-active); color: var(--text); }

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0 12px;
}

.nav-group {
  margin-bottom: 10px;
}

.nav-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.nav-section button { color: var(--text-dim); padding: 0; }
.nav-section button:hover { color: var(--text); }

/* Collapsible sidebar sections (ONM-316) */
.section-toggle {
  cursor: pointer;
  user-select: none;
}

.section-toggle:hover {
  color: var(--text);
}

.section-collapsed .section-items {
  display: none;
}

.nav-section .chevron {
  margin-left: auto;
  transition: transform 0.15s;
  font-size: 10px;
  color: var(--text-dim);
}

.nav-section .chevron.collapsed {
  transform: rotate(-90deg);
}

nav.nav-list a, nav.nav-list .nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  color: var(--text-muted);
  border-radius: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  height: 26px;
  cursor: pointer;
  position: relative;
}

nav.nav-list a:hover,
nav.nav-list .nav-link:hover { background: var(--surface-hover); color: var(--text); }

/* ONM-384: left accent rail + tinted bg instead of full-width fill */
nav.nav-list a.active,
nav.nav-list .nav-link.active {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--text-strong);
  box-shadow: inset 2px 0 0 var(--accent);
}

nav.nav-list a .icon,
nav.nav-list .nav-link .icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
}

nav.nav-list a.active .icon,
nav.nav-list .nav-link.active .icon { color: var(--accent); }

.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-count {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--surface-active);
  padding: 1px 6px;
  border-radius: 9px;
  min-width: 18px;
  text-align: center;
}

.nav-count.highlight {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.nav-sub {
  margin-left: 18px;
  border-left: 1px solid var(--border);
}

.team-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
}

.team-header:hover { background: var(--surface-hover); }

.team-avatar {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.chevron {
  width: 14px;
  height: 14px;
  color: var(--text-dim);
  transition: transform 0.15s;
}

.chevron.collapsed { transform: rotate(-90deg); }

.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--border);
}

/* ONM-473: constrain footer Settings link to match nav-list icon sizing */
.sidebar-footer .footer-settings-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.4;
  min-height: 26px;
  cursor: pointer;
}

.sidebar-footer .footer-settings-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.sidebar-footer .footer-settings-link.active {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--text-strong);
  box-shadow: inset 2px 0 0 var(--accent);
}

.sidebar-footer .footer-settings-link .icon,
.sidebar-footer .footer-settings-link .icon svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-footer .footer-settings-link.active .icon { color: var(--accent); }

.footer-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  width: 100%;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.footer-user-btn:hover { background: var(--surface-hover); }
.footer-user-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-switcher-menu {
  width: 260px;
  bottom: auto;
}

.user-switcher-menu .popup-item {
  padding: 6px 8px;
}

.user-switcher-menu .popup-item.selected {
  background: var(--accent-soft);
  color: var(--accent);
}

.user-switcher-menu .popup-item .popup-item-sub {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-dim);
}

.popup-divider {
  height: 1px;
  background: var(--border);
  margin: 6px 0;
}

.popup-section-header {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 8px 12px 4px;
}

.popup-item-with-submenu {
  position: relative;
}

.popup-chevron {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
}

.team-badge-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.team-submenu {
  min-width: 140px;
  z-index: 100;
}

.popup-hint {
  padding: 4px 8px 6px;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* ============================================================
   Main content area
   ============================================================ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 44px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumb .crumb {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
}

.breadcrumb .sep { color: var(--text-dim); }

.topbar-right { display: flex; gap: 6px; align-items: center; }

/* Tabs */
.tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.tab:hover { background: var(--surface-hover); color: var(--text); }
.tab.active { background: var(--surface-active); color: var(--text-strong); }

.tabs-right {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.btn:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn.ghost {
  border-color: transparent;
  background: transparent;
}
.btn.ghost:hover { background: var(--surface-hover); }

.kbd {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  padding: 1px 4px;
  color: var(--text);
  margin-left: 4px;
}

/* View body */
.view-body {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  color: var(--text-dim);
}

.empty-state .empty-icon svg { width: 32px; height: 32px; }

.empty-state h3 {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 13px;
  max-width: 380px;
  line-height: 1.5;
  margin-bottom: 18px;
}

.empty-state .actions {
  display: flex;
  gap: 8px;
}

/* ============================================================
   Filter bar (used by My Issues, etc.)
   ============================================================ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 4px 3px 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 9999px;
  font-size: 11px;
  color: var(--text-muted);
}

.filter-chip .chip-x {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1;
}

.filter-chip .chip-x:hover { background: var(--surface-active); color: var(--text); }

.filter-add {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
}

.filter-add:hover { color: var(--text); border-color: var(--text-muted); }

.filter-spacer { flex: 1; }

/* ============================================================
   Issue list / table
   ============================================================ */
/* Group drag-to-reorder (ONM-265) */
.issue-group { }
.issue-group.group-dragging { opacity: 0.4; }
.issue-group.group-drag-over > .group-header {
  outline: 2px solid var(--accent, #5e6ad2);
  outline-offset: -2px;
}
/* Drag-to-swimlane: issue row dropped on a group header to change state (ONM-278) */
.group-header.swimlane-drag-over {
  background: var(--accent-soft, rgba(94,106,210,0.14));
  outline: 2px dashed var(--accent, #5e6ad2);
  outline-offset: -2px;
}
.group-drag-handle {
  cursor: grab;
  color: var(--text-dim);
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.1s;
  user-select: none;
}
.group-header:hover .group-drag-handle { opacity: 1; }
.group-drag-handle:active { cursor: grabbing; }
.group-order-reset { font-size: 14px; }

.group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  position: sticky;
  top: 0;
  z-index: 5;
}

.group-header .state-icon { width: 14px; height: 14px; }
/* ONM-481: constrain bare SVG icons (e.g. saved-view icon) inside group headers */
.group-header .group-icon { display: inline-flex; align-items: center; width: 16px; height: 16px; flex-shrink: 0; }
.group-header .group-icon svg { width: 16px; height: 16px; }
.group-header .group-name { color: var(--text); font-weight: 600; }
.group-header .group-count { color: var(--text-dim); }
.group-header .group-add {
  width: 20px; height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
/* ONM-320: move + button next to count, not far right */
.group-header .group-add-inline { margin-left: 2px; }
.group-header .group-add:hover { background: var(--surface-active); color: var(--text); }

/* ONM-320: Bottom inline add row */
.group-add-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 16px;
  font-size: 12px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s;
}
.issue-group:hover .group-add-bottom { opacity: 1; }
.group-add-bottom:hover { color: var(--text); background: var(--surface-hover); }
.group-add-bottom svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ONM-319: Stable column header for issue lists */
.issue-list-header {
  display: grid;
  grid-template-columns: 16px 16px 24px 70px 22px 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 2;
}
.ilh-col {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.issue-row {
  display: grid;
  /* drag-handle | checkbox | priority | identifier | state-icon | title | project | due | assignee */
  grid-template-columns: 16px 16px 24px 70px 22px 1fr auto auto auto;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  height: var(--row-h);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
  transition: background 0.05s;
}

.issue-row:hover { background: var(--surface-hover); }
.issue-row.drag-over { background: var(--surface-active); outline: 2px solid var(--accent, #5e6ad2); }
.issue-row.dragging { opacity: 0.4; }

/* Drag handle — visible on hover for sub-issues (ONM-236) */
.drag-handle {
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  cursor: grab;
  opacity: 0;
  font-size: 12px;
  transition: opacity 0.1s;
}
.issue-row:hover .drag-handle { opacity: 1; }
.issue-row .drag-handle:active { cursor: grabbing; }

/* Drop-to-root zone: hidden unless a drag is in progress */
.drop-to-root {
  display: none;
  padding: 6px 16px;
  font-size: 11px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  cursor: default;
}
.drop-to-root.drag-over {
  background: var(--surface-active);
  color: var(--text-muted);
  display: block;
}

.issue-row .priority-icon {
  width: 14px; height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.issue-row .identifier {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0;
}

.issue-row .state-icon {
  width: 14px; height: 14px;
}

.issue-row .title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.unread-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #4ea7fc;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
  flex-shrink: 0;
}

.issue-row .meta {
  font-size: 11px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.issue-row .due {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.issue-row .due.overdue {
  background: rgba(235, 87, 87, 0.12);
  color: var(--priority-urgent);
}

.issue-row .due.due-soon {
  background: rgba(242, 201, 76, 0.14);
  color: #c49a0a;
}

.avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

/* ============================================================
   Issue detail (split view)
   ============================================================ */
.detail-split {
  display: grid;
  grid-template-columns: 200px 1fr 260px; /* ONM-326: narrower sibling list */
  height: 100%;
  overflow: hidden;
  transition: grid-template-columns 0.2s;
}
/* ONM-326: collapsed sidebar */
.detail-split.sidebar-collapsed {
  grid-template-columns: 0 1fr 260px;
}
.detail-split.sidebar-collapsed .detail-list {
  overflow: hidden;
  border: none;
  padding: 0;
}

.detail-list {
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-elevated);
  transition: all 0.2s;
}
.detail-list.collapsed {
  width: 0;
  min-width: 0;
  padding: 0;
  border: none;
}
.detail-list-collapse {
  cursor: pointer;
  transition: transform 0.2s;
}
.detail-list.collapsed .detail-list-collapse { transform: rotate(180deg); }

/* ONM-326: metadata chips below title */
.issue-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 24px 12px;
}
.issue-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--surface);
  transition: background var(--duration-fast) var(--ease-out);
}
.issue-meta-chip:hover { background: var(--surface-active); color: var(--text); }
.issue-meta-chip.overdue { color: var(--priority-urgent); border-color: var(--priority-urgent); }
.issue-meta-chip svg { width: 12px; height: 12px; }

/* ONM-326: v2 property rows — fully clickable with label */
.prop-row-v2 {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  gap: 8px;
  transition: background var(--duration-fast) var(--ease-out);
}
.prop-row-v2:hover { background: var(--surface-hover); }
.prop-icon-v2 {
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text-dim);
}
.prop-icon-v2 svg { width: 14px; height: 14px; }
.prop-label-v2 {
  font-size: 12px;
  color: var(--text-dim);
  width: 70px;
  flex-shrink: 0;
}
.prop-value-v2 {
  font-size: 13px;
  color: var(--text);
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
}
.prop-empty-text {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
}

.detail-list-header {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--bg-elevated);
}

.sibling-row {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.sibling-row:hover { background: var(--surface-hover); }
.sibling-row.active { background: var(--surface-active); }

.sibling-state {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(235, 87, 87, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.sibling-state svg { width: 14px; height: 14px; }

.sibling-body { min-width: 0; flex: 1; }

.sibling-title {
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.4;
}

.sibling-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-dim);
}

.detail-main {
  overflow-y: auto;
  padding: 24px 36px 60px;
  max-width: 760px;
  width: 100%;
  justify-self: center;
}

.issue-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.3;
  outline: none;
  color: var(--text-strong);
}

.issue-title:focus { background: var(--surface); border-radius: var(--radius); padding: 4px 8px; margin: -4px -8px 16px; }

.issue-description {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 30px;
}

.issue-description p { margin: 0 0 12px; }
.issue-description ul { padding-left: 24px; margin: 0 0 12px; }
.issue-description li { margin-bottom: 4px; }
.issue-description code {
  background: var(--surface);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 0.9em;
}
.issue-description pre {
  background: var(--surface);
  padding: 12px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 12px;
}
.issue-description pre code { background: none; padding: 0; }
.issue-description a { color: var(--accent); }
.issue-description a:hover { text-decoration: underline; }
.issue-description .placeholder { color: var(--text-dim); font-style: italic; cursor: text; }

/* ONM-466: visible edit affordance for description area */
.issue-description {
  border-radius: var(--radius);
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
  border: 1px solid transparent;
  padding: 4px 6px;
  margin-left: -7px;
}
.issue-description:hover {
  background: var(--surface-hover);
  border-color: var(--border);
  cursor: text;
}

.desc-edit-wrapper {
  margin-bottom: 30px;
}

.fmt-toolbar {
  display: flex;
  gap: 2px;
  padding: 4px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
}

.fmt-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1.4;
  font-family: inherit;
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.fmt-btn:hover {
  background: var(--surface-active);
  color: var(--text);
  border-color: var(--border);
}

/* ONM-467: hide toolbar when comment box is empty and unfocused */
.comment-box .fmt-toolbar {
  border-radius: var(--radius) var(--radius) 0 0;
  margin-bottom: 0;
  display: none;
}
.comment-box:focus-within .fmt-toolbar,
.comment-box.has-content .fmt-toolbar {
  display: flex;
}

.desc-edit-textarea {
  width: 100%;
  min-height: 120px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}

.desc-edit-textarea:focus {
  border-color: var(--accent);
}

/* Comment box toolbar integration */
.comment-box {
  display: flex;
  flex-direction: column;
}

.comment-box textarea {
  border-radius: 0 0 var(--radius) var(--radius);
}

.issue-attachments {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-bottom: 24px;
}

.attachments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.attachment-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.1s;
}

.attachment-card:hover { border-color: var(--border-strong); }

.attachment-card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  position: relative;
}

.attachment-icon, .attachment-icon-fallback {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  flex-shrink: 0;
  object-fit: cover;
}

.attachment-icon-fallback {
  background: var(--surface-active);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.attachment-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.attachment-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-title:hover { color: var(--accent); text-decoration: underline; }

.attachment-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-delete-btn {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s, color 0.1s, background 0.1s;
  flex-shrink: 0;
}

.attachment-card:hover .attachment-delete-btn { opacity: 1; }
.attachment-delete-btn:hover { color: var(--priority-urgent); background: var(--surface-active); }

/* Rich modal: only renders when metadata has title/messages/attributes */
.attachment-modal {
  padding: 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attachment-modal-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.attachment-attributes {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 12px;
  font-size: 12px;
}

.attachment-attributes dt {
  color: var(--text-muted);
  font-weight: 500;
}

.attachment-attributes dd {
  color: var(--text);
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.attachment-messages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attachment-message {
  padding: 8px 10px;
  background: var(--surface);
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 12px;
}

.attachment-message-subject {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}

.attachment-message-body {
  color: var(--text);
  line-height: 1.5;
  font-family: var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
}

.attachment-message-timestamp {
  margin-top: 4px;
  color: var(--text-dim);
  font-size: 11px;
}

.issue-sub-actions {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-bottom: 32px;
}

.activity-section h3.activity-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.activity-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.activity-avatar { flex-shrink: 0; }

.activity-text {
  font-size: 12px;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
}

.activity-text strong { color: var(--text); font-weight: 500; }

.activity-time { color: var(--text-dim); margin-left: 4px; }

/* Anchor comments (ONM-264) */
.anchor-comment-btn {
  position: absolute;
  background: var(--accent, #5e6ad2);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.anchor-comment-btn:hover { opacity: 0.9; }
.anchor-preview {
  padding: 8px 16px;
  background: var(--surface);
  border-left: 3px solid var(--accent, #5e6ad2);
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}
.comment-anchor-badge {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  border-left: 2px solid var(--accent, #5e6ad2);
  padding: 2px 6px;
  margin: 4px 0;
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.anchor-margin {
  position: absolute;
  right: -28px;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.anchor-indicator {
  cursor: pointer;
  font-size: 14px;
  opacity: 0.7;
}
.anchor-indicator:hover { opacity: 1; }

.activity-item.comment .comment-body {
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

/* History events — slimmer than comments */
.activity-item.history { align-items: center; }

.activity-item.history .activity-text {
  font-size: 12px;
  color: var(--text-muted);
}

.activity-item.history .activity-text strong {
  color: var(--text);
  font-weight: 500;
}

.activity-extra {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

.inline-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--text);
  margin: 0 2px;
}
.inline-state svg { width: 11px; height: 11px; }

.inline-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 9px;
  font-size: 11px;
  color: var(--text);
  margin: 0 2px;
}

.inline-label .label-dot { width: 6px; height: 6px; }

.activity-item.comment .comment-body p { margin: 0 0 8px; }
.activity-item.comment .comment-body p:last-child { margin-bottom: 0; }

.comment-box {
  margin-top: 20px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.comment-box textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 10px 12px;
  resize: vertical;
  min-height: 50px;
}

.comment-box-actions {
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* Properties panel */
.detail-props {
  border-left: 1px solid var(--border);
  padding: 16px;
  overflow-y: auto;
  background: var(--bg);
}

.prop-section { margin-bottom: 20px; }

.prop-section-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: none;
  margin-bottom: 8px;
}

.prop-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}

.prop-row:hover { background: var(--surface-hover); }

.prop-icon {
  width: 16px; height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.prop-icon.overdue { color: var(--priority-urgent); }
.prop-icon svg { width: 14px; height: 14px; }

.prop-value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.prop-row-empty .prop-value { color: var(--text-muted); }

.prop-empty-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  width: 100%;
  text-align: left;
}

.prop-empty-btn:hover { background: var(--surface-hover); color: var(--text); }

.label-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Popup menus */
.popup-menu,
.popup-container {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 200px;
  box-shadow: var(--shadow-md);
  z-index: 1000;
}

/* Keyboard-focused popup item (ONM-371 popup primitive) */
.popup-item.focused,
[data-popup-item].focused {
  background: var(--surface-hover);
  outline: none;
}

.popup-title {
  padding: 4px 8px 8px;
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.popup-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}

.popup-item:hover { background: var(--surface-hover); }

.popup-icon {
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.popup-project-picker { min-width: 240px; max-width: 320px; }

.popup-search-wrap {
  padding: 4px 6px 6px;
}

.popup-search-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  padding: 5px 8px;
  outline: none;
}

.popup-search-input:focus { border-color: var(--accent); }

.popup-project-list { max-height: 220px; overflow-y: auto; }

.popup-project-empty {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   Members table
   ============================================================ */
.members-table { padding: 8px 0; }

.members-row {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) 100px 90px minmax(150px, 1fr) 100px;
  gap: 16px;
  align-items: center;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.members-row.members-head {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 4;
  padding-top: 8px;
  padding-bottom: 8px;
}

.members-row:not(.members-head):hover { background: var(--surface-hover); }

.col-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.member-name-block { min-width: 0; overflow: hidden; }
.member-name { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-handle { font-size: 11px; color: var(--text-muted); }

.role-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 11px;
}
.role-pill.admin { background: var(--accent-soft); color: var(--accent); }

.col-joined, .col-last { color: var(--text-muted); font-size: 12px; }

.team-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 4px;
  background: var(--surface);
  border-radius: 9px;
  font-size: 11px;
  color: var(--text);
  margin-right: 4px;
}

.online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #26b25f;
  margin-right: 4px;
  vertical-align: middle;
}

.sort-arrow { color: var(--text-dim); font-size: 9px; margin-left: 2px; }

/* ============================================================
   Inbox / Notifications
   ============================================================ */
.inbox-list { padding: 0; }

.inbox-bucket-header {
  padding: 10px 24px 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid var(--border);
}

/* ONM-322: Restructured inbox row hierarchy */
.notif-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  position: relative;
}

.notif-row:hover { background: var(--surface-hover); }

/* Unread: accent left border */
.notif-row.unread {
  background: rgba(94, 106, 210, 0.05);
  border-left: 3px solid var(--accent);
  padding-left: 17px;
}
.notif-row.unread:hover { background: rgba(94, 106, 210, 0.09); }

.notif-avatar { flex-shrink: 0; }

.notif-body { min-width: 0; }

.notif-top-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  flex-wrap: wrap;
}

.notif-actor-verb {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.notif-actor {
  font-weight: 500;
  color: var(--text);
}

.notif-issue-pill {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}

.notif-issue-title {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  min-width: 48px;
}

.notif-time {
  color: var(--text-dim);
  font-size: 11px;
  white-space: nowrap;
}

.notif-hover-actions {
  display: none;
}
.notif-row:hover .notif-hover-actions { display: flex; gap: 4px; }

.notif-action-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 2px 5px;
  font-size: 11px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out);
}
.notif-action-btn:hover { background: var(--surface-active); color: var(--text); }

.notif-snippet {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 12px;
  align-self: flex-start;
}

/* ============================================================
   Projects table
   ============================================================ */
.projects-list { padding: 0; }

/* ONM-323: added last-update column */
.projects-row {
  display: grid;
  grid-template-columns: minmax(250px, 2fr) 80px 140px 80px 80px 80px 80px;
  gap: 16px;
  align-items: center;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

/* ONM-323: Portfolio stats bar */
.portfolio-stats-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-wrap: wrap;
}
.portfolio-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.portfolio-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 500;
}
.portfolio-chips-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  flex-shrink: 0;
}

.projects-row.projects-head {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  background: var(--bg-elevated);
  padding-top: 8px;
  padding-bottom: 8px;
  position: sticky;
  top: 0;
  z-index: 4;
}

.project-row { cursor: pointer; }
.project-row:hover { background: var(--surface-hover); }

.col-pname {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.project-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.project-icon svg { width: 14px; height: 14px; }

.pname-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.col-pmilestones, .col-pstart, .col-pend, .col-pteam, .col-plastupdate { color: var(--text-muted); font-size: 12px; }

/* ONM-323: clickable initiative project count chip */
.initiative-proj-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  padding: 1px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
}
.initiative-proj-chip:hover { background: var(--surface-active); color: var(--text); }

/* Progress bar for project rows (ONM-304) */
.col-pprogress {
  display: flex;
  align-items: center;
  gap: 6px;
}

.proj-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--surface-active);
  border-radius: 3px;
  overflow: hidden;
}

.proj-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.2s;
}

.proj-progress-pct {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 28px;
  text-align: right;
}

/* Projects board view (ONM-304) */
.proj-board-columns {
  display: flex;
  gap: 16px;
  padding: 16px;
  overflow-x: auto;
  height: 100%;
  align-items: flex-start;
}

.proj-board-col {
  flex-shrink: 0;
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proj-board-col-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 0;
}

.proj-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}

.proj-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.proj-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.proj-card-name {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proj-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.4;
}

.proj-card-footer {
  display: flex;
  align-items: center;
  gap: 6px;
}

.proj-card-date {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
  flex-shrink: 0;
}

.proj-view-toggle.active {
  color: var(--accent);
  background: var(--surface-active);
}

.project-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.project-group-header .group-name { color: var(--text); font-weight: 600; }
.project-group-header .group-count { color: var(--text-dim); }

.state-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ============================================================
   Settings layout
   ============================================================ */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  height: 100%;
}

.settings-nav {
  border-right: 1px solid var(--border);
  padding: 16px 8px;
  background: var(--bg-elevated);
  overflow-y: auto;
}

.settings-link {
  display: block;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 2px;
  cursor: pointer;
}

.settings-link:hover { background: var(--surface-hover); color: var(--text); }
.settings-link.active { background: var(--surface-active); color: var(--text-strong); }

.settings-content {
  overflow-y: auto;
  padding: 32px 36px;
  max-width: 700px;
}

/* ONM-324: Dark-theme settings form inputs — stacked label above input */
.settings-content label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.settings-content input[type="text"],
.settings-content input[type="number"],
.settings-content input[type="email"],
.settings-content input[type="date"],
.settings-content input[type="color"],
.settings-content input[type="time"],
.settings-content select,
.settings-content textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  height: 36px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.settings-content textarea { height: auto; resize: vertical; }
.settings-content input[type="color"] { height: 36px; padding: 2px 6px; }
.settings-content input:focus,
.settings-content select:focus,
.settings-content textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-faint, rgba(94,106,210,0.2));
}
.settings-content input:disabled,
.settings-content select:disabled,
.settings-content textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.settings-content .settings-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
  display: block;
}
/* Dirty state indicator */
.settings-dirty-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(94,106,210,0.08);
  border: 1px solid var(--accent-faint, rgba(94,106,210,0.2));
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.settings-dirty-bar .btn { flex-shrink: 0; }

.settings-section { margin-bottom: 40px; }

.settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.settings-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 6px;
}

.settings-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.settings-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  margin-bottom: 4px;
}

/* Developer collapsed section (ONM-409) */
.developer-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.developer-section-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  user-select: none;
}

.developer-section-summary::-webkit-details-marker { display: none; }
.developer-section-summary::before { content: '›'; color: var(--text-muted); transition: transform var(--duration-fast) var(--ease-out); display: inline-block; }
details[open] > .developer-section-summary::before { transform: rotate(90deg); }

.developer-section-label { color: var(--text); }

.developer-section-body { padding: 0 16px 16px; }

/* "For developers" badge (ONM-409) */
.badge-dev {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Label rows */
.labels-list { display: flex; flex-direction: column; }

.label-row {
  display: grid;
  grid-template-columns: 24px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.label-row:hover { background: var(--surface-hover); }

.label-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.label-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.label-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.label-delete:hover { color: var(--priority-urgent); }

/* ONM-325: v2 label rows with kebab and usage count */
.label-row-v2 {
  grid-template-columns: 24px 1fr auto auto;
}
.label-usage-count {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 32px;
  text-align: right;
}
.label-kebab {
  opacity: 0;
  transition: opacity 0.1s;
  font-size: 16px;
  line-height: 1;
}
.label-row:hover .label-kebab { opacity: 1; }

/* ONM-325: popup menu for label actions */
.popup-item-danger { color: var(--priority-urgent); }
.popup-item-danger:hover { background: rgba(235,87,87,0.1); }

/* Color grid for label dialog */
.color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.color-swatch {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s;
  padding: 0;
}

.color-swatch:hover { transform: scale(1.08); }
.color-swatch.selected { border-color: var(--text); }

/* ============================================================
   Status list (shared) — team workflow, workspace defaults, project statuses
   ============================================================ */
.settings-section-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.status-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  cursor: default;
}
.status-row:last-child { border-bottom: none; }
.status-row:hover { background: var(--surface-hover); }
.status-row.dragging { opacity: 0.4; }
.status-row.drag-over { box-shadow: inset 0 2px 0 var(--accent); }

.status-row .drag-handle {
  cursor: grab;
  color: var(--text-dim);
  user-select: none;
  padding: 0 4px;
}
.status-row .drag-handle:active { cursor: grabbing; }

.status-row-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-row-info {
  flex: 1;
  min-width: 0;
}

.status-row-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
}

.status-row-type {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 2px;
  font-family: var(--mono, monospace);
}

.status-row-delete:hover {
  color: var(--priority-urgent);
}

.settings-hint {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 12px;
}

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 420px;
  max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 14px; font-weight: 600; color: var(--text); }

.modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-body label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.modal-body input {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  width: 100%;
  outline: none;
  transition: border-color 0.1s;
}

.modal-body input:focus { border-color: var(--accent); }

/* ONM-385: native select, date, and textarea controls inside modals */
.modal-body select,
.modal-body input[type="date"],
.modal-body textarea {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text);
  width: 100%;
  outline: none;
  transition: border-color 0.1s;
  -webkit-appearance: none;
  appearance: none;
  color-scheme: dark;
}

.modal-body select:focus,
.modal-body input[type="date"]:focus,
.modal-body textarea:focus { border-color: var(--accent); }

[data-theme="light"] .modal-body select,
[data-theme="light"] .modal-body input[type="date"],
[data-theme="light"] .modal-body textarea {
  color-scheme: light;
}

.modal-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.modal-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* New issue modal — bigger, no rigid form */
.new-issue-modal {
  width: 620px;
  max-width: calc(100vw - 32px);
}

.new-issue-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.new-issue-team {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
}

.new-issue-team .chev { width: 12px; height: 12px; color: var(--text-muted); }

.new-issue-id { color: var(--text-muted); font-size: 12px; }

.new-issue-header .icon-btn {
  margin-left: auto;
}

.new-issue-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.new-issue-title {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-strong);
  font-size: 18px;
  font-weight: 500;
  padding: 0;
  width: 100%;
}

.new-issue-title::placeholder { color: var(--text-dim); }

.new-issue-desc {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  padding: 0;
  width: 100%;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.new-issue-desc::placeholder { color: var(--text-dim); }

.new-issue-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}

.prop-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

.prop-pill:hover { background: var(--surface-hover); }

.prop-pill .prop-icon { color: var(--text-muted); }

.new-issue-spacer { flex: 1; }

.popup-icon-blank { width: 18px; height: 18px; display: inline-block; }

/* ============================================================
   Status / priority icons
   ============================================================ */
.state-icon { display: inline-block; }
.state-icon.backlog circle { stroke: var(--status-backlog); }
.state-icon.todo circle { stroke: var(--status-todo); }
.state-icon.unstarted circle { stroke: var(--status-todo); }
.state-icon.started circle { stroke: var(--status-progress); }
.state-icon.started .arc { fill: var(--status-progress); }
.state-icon.completed circle { fill: var(--status-done); stroke: var(--status-done); }
.state-icon.cancelled circle { fill: var(--status-cancelled); stroke: var(--status-cancelled); }
.state-icon.triage circle { stroke: var(--status-triage); }

.priority-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 12px;
}
.priority-bars span {
  display: inline-block;
  width: 2.5px;
  background: var(--priority-none);
  border-radius: 1px;
}
.priority-bars .b1 { height: 30%; }
.priority-bars .b2 { height: 60%; }
.priority-bars .b3 { height: 100%; }

.priority-bars.urgent span { background: var(--priority-urgent); }
.priority-bars.high  .b1, .priority-bars.high .b2, .priority-bars.high .b3 { background: var(--text-muted); }
.priority-bars.high  .b1, .priority-bars.high .b2, .priority-bars.high .b3 { background: var(--text); }
.priority-bars.normal .b1, .priority-bars.normal .b2 { background: var(--text); }
.priority-bars.low .b1 { background: var(--text); }

/* ============================================================
   Loading / status
   ============================================================ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  font-size: 12px;
  gap: 8px;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast-host {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12px;
  box-shadow: var(--shadow-md);
  animation: slide-up 0.2s ease-out;
}
.toast.error { border-color: var(--priority-urgent); }

@keyframes slide-up {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ============================================================
   Cycles
   ============================================================ */

/* Index — sections of cycle rows */
.cycle-section {
  margin-bottom: 8px;
}

.cycle-section-header {
  padding: 12px 24px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.cycle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  gap: 24px;
}

.cycle-row:hover { background: var(--surface-hover); }

.cycle-row-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.cycle-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}

.cycle-name-block { min-width: 0; }
.cycle-name { font-size: 13px; color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cycle-dates { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.cycle-progress-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.cycle-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
}

.cycle-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}

.cycle-progress-pct {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 32px;
  text-align: right;
}

/* Detail view */
.cycle-detail-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.cycle-detail-meta { min-width: 0; flex: 1; }

.cycle-detail-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-strong);
  display: flex;
  align-items: center;
  gap: 10px;
}

.cycle-detail-dates {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.cycle-detail-desc {
  font-size: 13px;
  color: var(--text);
  margin-top: 8px;
  max-width: 640px;
  line-height: 1.5;
}

.cycle-status-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
}

.cycle-status-badge.active { background: rgba(38, 178, 95, 0.15); color: #26b25f; }
.cycle-status-badge.future { background: rgba(94, 106, 210, 0.15); color: var(--accent); }
.cycle-status-badge.past { background: var(--surface); color: var(--text-muted); }

.cycle-stats {
  display: flex;
  gap: 12px;
}

.cycle-stat {
  background: var(--surface);
  border-radius: 6px;
  padding: 10px 14px;
  text-align: center;
  min-width: 64px;
}

.cycle-stat-num {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.cycle-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ONM-329: cycle preview card */
.cycle-preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  max-width: 340px;
  margin: 16px auto;
  text-align: left;
}
.cycle-preview-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.cycle-preview-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.cycle-preview-bar {
  height: 6px;
  background: var(--surface-active);
  border-radius: 3px;
}
.cycle-preview-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}

/* Burndown chart */
.cycle-burndown {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.cycle-burndown.empty {
  padding: 24px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.burndown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.burndown-header h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.burndown-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.burndown-key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.burndown-swatch {
  display: inline-block;
  width: 10px;
  height: 2px;
  border-radius: 1px;
}

.burndown-swatch.scope { background: var(--text-muted); }
.burndown-swatch.completed { background: var(--accent); }
.burndown-swatch.ideal { background: var(--text-dim); }

.burndown-svg {
  width: 100%;
  height: 200px;
  display: block;
}

.burndown-grid { stroke: var(--border); stroke-width: 1; }
.burndown-axis-label { fill: var(--text-dim); font-size: 10px; text-anchor: end; }
.burndown-ideal {
  fill: none;
  stroke: var(--text-dim);
  stroke-width: 1;
  stroke-dasharray: 4 3;
}
.burndown-scope { fill: none; stroke: var(--text-muted); stroke-width: 1.5; }
.burndown-completed { fill: none; stroke: var(--accent); stroke-width: 2; }

.burndown-x-labels {
  position: relative;
  height: 14px;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
}

.burndown-x-labels span {
  position: absolute;
  transform: translateX(-50%);
}

.cycle-issues {
  padding: 8px 0;
}

/* ============================================================
   Reactions (on comments + future targets)
   ============================================================ */

.comment-reactions {
  margin-top: 6px;
  /* When there are no reactions, the row is hidden until the comment is
     hovered — keeps the comment area visually quiet. */
  opacity: 0;
  transition: opacity 0.1s;
  pointer-events: none;
}

.activity-item.comment:hover .comment-reactions,
.comment-reactions.has-reactions {
  opacity: 1;
  pointer-events: auto;
}

.reactions-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.reaction-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.reaction-pill:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
}

.reaction-pill.reacted {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--text);
}

.reaction-emoji {
  font-size: 13px;
  line-height: 1;
}

.reaction-count {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--text-muted);
}

.reaction-pill.reacted .reaction-count {
  color: var(--accent);
  font-weight: 600;
}

.reaction-add-btn {
  width: 22px;
  height: 22px;
  border-radius: 11px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.1s, color 0.1s, border-color 0.1s;
}

.reaction-add-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  border-color: var(--text-muted);
}

.reaction-add-icon {
  font-size: 16px;
  line-height: 1;
}

/* Emoji picker popover */
.emoji-picker-popover {
  position: fixed;
  z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  box-shadow: var(--shadow-md);
}

.emoji-pick-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.emoji-pick-btn:hover {
  background: var(--surface-hover);
}

/* ============================================================
   Project detail + project updates
   ============================================================ */

/* Health badge — used on the project detail header and on cards */
.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

.health-badge.muted {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.health-badge-btn {
  cursor: pointer;
  transition: opacity 0.15s, filter 0.15s;
}

.health-badge-btn:hover {
  filter: brightness(1.15);
}

.health-quick-picker {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.health-quick-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  border-radius: 6px;
  transition: background var(--duration-fast) var(--ease-out);
  white-space: nowrap;
}

.health-quick-option:hover {
  background: var(--surface-3, #2d2d3d);
}

.health-quick-option.active {
  background: var(--surface-3, #2d2d3d);
  font-weight: 600;
}

.health-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.health-dot.health-dot-empty {
  background: transparent;
  border: 1px dashed var(--border-strong);
}

/* Project list: tighten health dot next to icon */
.col-pname .health-dot {
  margin-left: 2px;
  margin-right: 2px;
}

.health-dot-btn {
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
}
.health-dot-btn:hover {
  opacity: 0.75;
  outline: 2px solid var(--border-strong);
  outline-offset: 1px;
  border-radius: 50%;
}

/* Project detail header */
.project-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}

/* ONM-327: consolidated header block */
.project-detail-header-v2 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.project-detail-row1 {
  display: flex;
  align-items: center;
  gap: 12px;
}
.project-detail-row1 .project-icon { width: 32px; height: 32px; }

.project-detail-row2 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.project-header-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ONM-327: thin metrics strip */
.project-metrics-strip {
  display: flex;
  gap: 20px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.project-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.project-metric-num {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
}
.project-metric-lbl {
  font-size: 11px;
  color: var(--text-dim);
}

.project-detail-meta { min-width: 0; flex: 1; }

.project-detail-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.project-detail-title-row .project-icon {
  width: 32px;
  height: 32px;
}

.project-detail-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-strong);
  margin: 0;
}

.project-detail-sub {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.project-state-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  text-transform: capitalize;
  border: none;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}
.project-state-pill:hover {
  background: var(--surface-2, #2d2d3d);
}

.project-detail-desc {
  margin-top: 12px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  max-width: 640px;
}

.project-stats {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* Section headers within project detail */
.project-updates-section,
.project-issues-section {
  padding: 0 0 16px;
}

.project-settings-section {
  padding: 0 24px 24px;
}

.reminder-stale-badge {
  background: rgba(242, 201, 76, 0.12);
  border: 1px solid rgba(242, 201, 76, 0.4);
  color: #f2c94c;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border);
}

.section-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

/* Updates timeline */
.project-updates-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 24px;
}

.project-update-card {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.project-update-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-update-meta { min-width: 0; flex: 1; }

.project-update-author {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}

.project-update-health {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 500;
}

.project-update-timestamp {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.project-update-delete {
  opacity: 0;
  transition: opacity 0.1s;
}

.project-update-card:hover .project-update-delete {
  opacity: 1;
}

.project-update-body {
  margin-top: 10px;
  padding-left: 38px;  /* align with author name (32px avatar + 6px gap) */
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
}

.project-update-body p {
  margin: 0 0 8px;
}

.project-update-body p:last-child {
  margin-bottom: 0;
}

.project-update-body a {
  color: var(--accent);
}

.project-update-body a:hover {
  text-decoration: underline;
}

.project-update-reactions {
  margin-top: 10px;
  padding-left: 38px;
}

/* Project update diff section */
.pu-diff-section {
  margin: 8px 0 4px 38px;
  font-size: 12px;
  color: var(--text-muted);
}
.pu-diff-summary {
  cursor: pointer; list-style: none;
  color: var(--text-muted);
  user-select: none;
}
.pu-diff-summary:hover { color: var(--text); }
.pu-diff-body {
  margin-top: 6px;
  padding: 8px 12px;
  background: var(--surface-raised, #1e1e28);
  border-radius: var(--radius-sm);
  line-height: 1.6;
}

/* Project update comments */
.pu-comments-section {
  padding-left: 38px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pu-comment {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 13px;
}
.pu-comment-avatar { flex-shrink: 0; }
.pu-comment-body { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.pu-comment-author { font-weight: 600; color: var(--text); }
.pu-comment-text { color: var(--text); }
.pu-comment-time { font-size: 11px; }
.pu-comment-toggle {
  background: none; border: none; cursor: pointer;
  font-size: 12px; padding: 2px 0; color: var(--text-muted);
  text-align: left;
}
.pu-comment-toggle:hover { color: var(--text); }
.pu-comment-form {
  display: none; flex-direction: column; gap: 6px;
  margin-top: 4px;
}
.pu-comment-input {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 8px 10px;
  font-size: 13px; color: var(--text); resize: vertical;
  min-height: 52px;
}

/* Issues section inside project detail */
.project-issues-list {
  border-top: 1px solid var(--border);
}

/* Post update modal */
.post-update-modal { width: 540px; max-width: calc(100vw - 32px); }

.post-update-modal textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
  outline: none;
}

.post-update-modal textarea:focus { border-color: var(--accent); }

.health-picker {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.health-pick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.health-pick:hover {
  border-color: var(--text-muted);
}

.health-pick.selected {
  border-color: var(--health-color);
  background: color-mix(in srgb, var(--health-color) 12%, transparent);
}

/* ----------------------------------------------------------------------- */
/* Documents                                                               */
/* ----------------------------------------------------------------------- */

/* Small button variant used in section headers. */
.btn-small {
  font-size: 12px;
  padding: 3px 10px;
  height: 26px;
  line-height: 1;
  margin-left: auto;
}

.docs-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.doc-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  cursor: pointer;
  transition: background 120ms;
}

.doc-row:hover {
  background: var(--surface);
}

.doc-row-icon {
  width: 16px;
  height: 16px;
  color: var(--muted);
  display: flex;
  align-items: center;
}

.doc-row-icon svg {
  width: 16px;
  height: 16px;
}

.doc-row-title {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-row-meta {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* ONM-328: table-style docs list */
.doc-table-row {
  display: grid;
  grid-template-columns: 2fr 100px 120px 120px 40px;
  gap: 12px;
  align-items: center;
}
.col-dtitle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.col-dupdated, .col-dauthor, .col-dlocation { font-size: 12px; color: var(--text-muted); }
.col-dactions { display: flex; justify-content: flex-end; }
.doc-row-kebab {
  opacity: 0;
  transition: opacity 0.1s;
  font-size: 16px;
}
.doc-row:hover .doc-row-kebab { opacity: 1; }

.docs-table-header {
  display: grid;
  grid-template-columns: 2fr 100px 120px 120px 40px;
  gap: 12px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ONM-328: toolbar v2 with search */
.docs-toolbar-v2 {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.docs-search-wrap { flex: 1; }
.docs-search-input {
  width: 100%;
  max-width: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
  font-size: 13px;
  color: var(--text);
  outline: none;
}
.docs-search-input:focus { border-color: var(--accent); }
.docs-toolbar-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Document folder tree (ONM-223) */
.docs-toolbar {
  padding: 8px 14px;
  background: var(--bg);
  display: flex;
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.folder-section {
  background: var(--bg);
}

.folder-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  list-style: none;
  user-select: none;
}

.folder-summary:hover { background: var(--surface-hover); }

.folder-icon { color: var(--muted); width: 14px; flex-shrink: 0; }
.folder-name { flex: 1; }

.folder-action {
  opacity: 0;
  transition: opacity 0.1s;
}
.folder-summary:hover .folder-action { opacity: 1; }

.delete-folder-btn { color: var(--danger, #eb5757); }

.folder-body {
  padding-left: 20px;
  border-left: 2px solid var(--border);
  margin-left: 14px;
}

/* Doc-section embedded in project / initiative detail */
.project-docs-section {
  margin-bottom: 24px;
}

/* Doc detail page */
.doc-detail-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}

.doc-title-input {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 28px;
  font-weight: 600;
  color: var(--text);
  padding: 8px 0;
  outline: none;
}

.doc-title-input:focus {
  border-bottom: 1px solid var(--border);
}

.doc-meta-row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.doc-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ONM-298: replaced split grid with single-pane + toggle */
.doc-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 60vh;
}

/* Single-pane toggle layout */
.doc-editor-pane {
  min-height: 60vh;
  position: relative;
}

.doc-editor-pane[data-mode="edit"] .doc-content-input { display: block; }
.doc-editor-pane[data-mode="edit"] .doc-content-preview { display: none; }

.doc-editor-pane[data-mode="preview"] .doc-content-input { display: none; }
.doc-editor-pane[data-mode="preview"] .doc-content-preview {
  display: block;
  cursor: text;
  min-height: 60vh;
}

.doc-mode-toggle-wrap {
  margin-left: auto;
}

.doc-mode-toggle {
  font-size: 12px;
  padding: 3px 10px;
}

.doc-content-input {
  width: 100%;
  min-height: 60vh;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  outline: none;
}

.doc-content-input:focus {
  border-color: var(--accent);
}

.doc-content-preview {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.doc-content-preview h1 { font-size: 22px; margin: 0 0 8px; }
.doc-content-preview h2 { font-size: 18px; margin: 12px 0 6px; }
.doc-content-preview h3 { font-size: 15px; margin: 10px 0 4px; }
.doc-content-preview p { margin: 6px 0; }
.doc-content-preview code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
.doc-content-preview pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  overflow-x: auto;
  margin: 8px 0;
}
.doc-content-preview pre code {
  background: transparent;
  border: 0;
  padding: 0;
}
.doc-content-preview a {
  color: var(--accent);
  text-decoration: underline;
}
.doc-content-preview .muted {
  color: var(--muted);
  font-style: italic;
}

.doc-archived-banner {
  background: color-mix(in srgb, #eb5757 12%, transparent);
  border: 1px solid color-mix(in srgb, #eb5757 30%, transparent);
  color: #c84040;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

.doc-collab-bar {
  height: 20px;
  margin-bottom: 4px;
}

.doc-presence {
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 880px) {
  .doc-editor-grid {
    grid-template-columns: 1fr;
  }
}

/* ----------------------------------------------------------------------- */
/* Favorites — sidebar section + star toggle                               */
/* ----------------------------------------------------------------------- */

.favorite-star {
  background: transparent;
  border: 1px solid transparent;
  width: 28px;
  height: 28px;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color 150ms, background 150ms;
}

.favorite-star:hover {
  color: var(--text);
  background: var(--surface);
}

.favorite-star.favorited {
  color: #f2c94c;
}

.favorite-star.favorited:hover {
  color: #d4a900;
}

.favorite-star svg {
  width: 16px;
  height: 16px;
}

.nav-link.favorite-row {
  /* Same as other nav-links but allows text truncation for long titles */
}

.nav-link.favorite-row .nav-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Favorite folders (ONM-224) */
.fav-folder {
  display: block;
}
.fav-folder > summary { list-style: none; }
.fav-folder > summary::-webkit-details-marker { display: none; }
.fav-folder-summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
}
.fav-folder-summary:hover { background: var(--hover); color: var(--text); }
.fav-folder-children { padding-left: 8px; }

/* ----------------------------------------------------------------------- */
/* Webhooks settings page                                                  */
/* ----------------------------------------------------------------------- */

.settings-help {
  padding: 12px 16px;
  background: color-mix(in srgb, #f2c94c 8%, transparent);
  border: 1px solid color-mix(in srgb, #f2c94c 30%, transparent);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text);
  margin: 16px 24px;
}

.webhooks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 24px;
}

.webhook-row {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  background: var(--bg);
}

.webhook-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.webhook-row-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.webhook-row-actions {
  display: flex;
  gap: 6px;
}

.webhook-row-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.webhook-row-meta code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--text);
}

.webhook-secret {
  font-family: ui-monospace, monospace;
}

.webhook-state {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9px;
  font-weight: 500;
}

.webhook-state-enabled {
  background: color-mix(in srgb, #26b25f 14%, transparent);
  color: #19794a;
}

.webhook-state-disabled {
  background: var(--surface);
  color: var(--muted);
}

.webhook-health {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 9px;
  font-weight: 500;
}

.webhook-health-healthy {
  background: color-mix(in srgb, #26b25f 14%, transparent);
  color: #19794a;
}

.webhook-health-failing {
  background: color-mix(in srgb, #eb5757 14%, transparent);
  color: #c84040;
}

.webhook-health-pending {
  background: var(--surface);
  color: var(--muted);
}

.resource-types {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  vertical-align: middle;
}

.resource-type {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: ui-monospace, monospace;
}

.resource-type-unwired {
  opacity: 0.55;
  text-decoration: line-through;
}

.resource-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.resource-type-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}

.resource-type-pick:hover {
  background: var(--surface);
}

.resource-type-pick input[type="checkbox"] {
  cursor: pointer;
}

.resource-type-warn {
  color: #f2c94c;
  font-size: 11px;
  margin-left: auto;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 4px;
}

.modal-wide {
  max-width: 600px;
  width: 90%;
}

.secret-callout {
  background: color-mix(in srgb, #f2c94c 8%, transparent);
  border: 1px solid color-mix(in srgb, #f2c94c 30%, transparent);
  border-radius: 6px;
  padding: 16px;
  margin: 12px 0;
}

.secret-display {
  display: block;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--bg);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 13px;
  word-break: break-all;
  margin: 12px 0;
  user-select: all;
}

/* ----------------------------------------------------------------------- */
/* Sub-issues                                                              */
/* ----------------------------------------------------------------------- */

.sub-issues-list {
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}

.sub-issues-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  background: var(--bg);
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.sub-issues-progress {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  padding: 1px 8px;
  background: var(--surface);
  border-radius: 9px;
}

.sub-issue-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  transition: background 120ms;
}

.sub-issue-row:last-child {
  border-bottom: 0;
}

.sub-issue-row:hover {
  background: var(--bg);
}

.sub-issue-id {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  min-width: 80px;
}

.sub-issue-title {
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crumb.crumb-link {
  text-decoration: none;
  color: var(--muted);
  cursor: pointer;
}

.crumb.crumb-link:hover {
  color: var(--text);
  text-decoration: underline;
}

/* Sub-issue indentation in the team issues list. The grid columns stay
   fixed — we just push the priority icon (first cell) over by adding
   left padding on the entire row. Subtle visual cue + a vertical guide
   line so the hierarchy reads at a glance. */
.issue-row.issue-row-indent-1 { padding-left: 24px; }
.issue-row.issue-row-indent-2 { padding-left: 48px; }
.issue-row.issue-row-indent-3 { padding-left: 72px; }
.issue-row.issue-row-indent-4 { padding-left: 96px; }

.issue-row[class*="issue-row-indent-"] {
  position: relative;
}

.issue-row[class*="issue-row-indent-"]::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.issue-row.issue-row-indent-2::before { left: 36px; }
.issue-row.issue-row-indent-3::before { left: 60px; }
.issue-row.issue-row-indent-4::before { left: 84px; }

/* Sub-progress badge ("2/4") next to a parent's title. */
.title .sub-progress {
  display: inline-block;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  padding: 1px 6px;
  background: var(--surface);
  border-radius: 8px;
  color: var(--muted);
  margin-left: 6px;
  vertical-align: middle;
}

/* ----------------------------------------------------------------------- */
/* Issue relations                                                         */
/* ----------------------------------------------------------------------- */

.relation-group {
  margin-bottom: 8px;
}

.relation-group-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.relation-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 12px;
  transition: background 120ms;
  position: relative;
}

.relation-chip:hover {
  background: var(--bg);
}

.relation-chip .relation-id {
  font-family: ui-monospace, monospace;
  color: var(--muted);
}

.relation-chip .relation-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.relation-remove {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
  border-radius: 3px;
  opacity: 0;
  transition: opacity 120ms;
}

.relation-chip:hover .relation-remove {
  opacity: 1;
}

.relation-remove:hover {
  color: #eb5757;
  background: color-mix(in srgb, #eb5757 10%, transparent);
}

/* ----------------------------------------------------------------------- */
/* Estimates (team settings)                                               */
/* ----------------------------------------------------------------------- */

.estimate-scale-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.estimate-scale-option {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  background: var(--bg);
  transition: background 120ms, border-color 120ms;
}

.estimate-scale-option:hover {
  background: var(--surface);
}

.estimate-scale-option.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, var(--bg));
}

.estimate-scale-option input[type="radio"] {
  margin-top: 3px;
  cursor: pointer;
}

.estimate-scale-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.estimate-scale-preview {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: var(--muted);
  padding: 2px 6px;
  background: var(--surface);
  border-radius: 3px;
}

.estimate-scale-desc {
  font-size: 12px;
  color: var(--muted);
}

.settings-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  margin-left: 22px;
}

/* ----------------------------------------------------------------------- */
/* SLA pill                                                                */
/* ----------------------------------------------------------------------- */

.sla-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.sla-value {
  font-size: 12px;
  font-weight: 500;
}

/* SLA settings form */
.sla-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
}

.sla-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sla-form-row label {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.sla-form-row input,
.sla-form-row select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  max-width: 240px;
  color-scheme: dark;
}

[data-theme="light"] .sla-form-row input,
[data-theme="light"] .sla-form-row select {
  color-scheme: light;
}

/* SLA timeline (ONM-239) */
.sla-history-section { margin-top: 4px; }
.sla-history-toggle {
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  padding: 2px 0;
}
.sla-history-toggle:hover { color: var(--text); }
.sla-history-body { padding: 6px 0; display: flex; flex-direction: column; gap: 4px; }
.sla-history-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
}

/* Project context menu (ONM-291) */
.project-caret-btn {
  opacity: 0.4;
  transition: opacity 0.15s;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  flex-shrink: 0;
}
.project-detail-title-row:hover .project-caret-btn,
.project-caret-btn:hover { opacity: 1; }

.project-ctx-menu .popup-item.selected {
  background: var(--surface-hover);
  font-weight: 500;
}

.state-dot-planned  { width:10px;height:10px;border-radius:50%;background:#7a7a8c;display:inline-block; }
.state-dot-started  { width:10px;height:10px;border-radius:50%;background:#f2c94c;display:inline-block; }
.state-dot-paused   { width:10px;height:10px;border-radius:50%;background:#bbbbbb;display:inline-block; }
.state-dot-completed { width:10px;height:10px;border-radius:50%;background:var(--status-done);display:inline-block; }
.state-dot-cancelled { width:10px;height:10px;border-radius:50%;background:#6b7280;display:inline-block; }

/* ============================================================
   Bulk actions (ONM-301)
   ============================================================ */

/* Checkbox in issue row — hidden by default, visible on hover */
.issue-row .bulk-checkbox {
  opacity: 0;
  width: 14px;
  height: 14px;
  cursor: pointer;
  accent-color: var(--accent);
  transition: opacity 0.1s;
  justify-self: center;
}

.issue-row:hover .bulk-checkbox,
.issue-row .bulk-checkbox:checked {
  opacity: 1;
}

/* Floating action bar */
.bulk-action-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  z-index: 2500;
  white-space: nowrap;
}

.bulk-action-bar.hidden { display: none; }

.bulk-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bulk-actions select {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  outline: none;
}

.bulk-actions select:hover { border-color: var(--accent); }

/* ============================================================
   Inline issue creation row (ONM-305)
   ============================================================ */

.inline-create-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: var(--row-h);
  border-bottom: 1px solid var(--border);
  background: var(--surface-hover);
}

.inline-create-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
  caret-color: var(--accent);
}

.inline-create-input::placeholder { color: var(--text-dim, var(--text-muted)); }

.inline-create-hint {
  font-size: 11px;
  color: var(--text-dim, var(--text-muted));
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================================
   Board view (ONM-303)
   ============================================================ */

.view-toggle-btn.active {
  color: var(--accent);
  background: var(--surface-active);
}

.board-view-active {
  overflow: hidden;
  /* Allow horizontal scroll on narrow viewports so all columns are reachable */
  overflow-x: auto;
}

.board-columns {
  display: flex;
  gap: 12px;
  padding: 16px;
  height: 100%;
  overflow-x: auto;
  align-items: flex-start;
  scroll-snap-type: x mandatory;
}
/* ONM-321: right-edge fade gradient when board overflows */
.board-view-active {
  position: relative;
}
.board-view-active::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 48px;
  height: 100%;
  background: linear-gradient(to right, transparent, var(--bg));
  pointer-events: none;
  z-index: 1;
}

.board-column {
  flex-shrink: 0;
  width: 280px; /* ONM-321: min 280px */
  scroll-snap-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 130px);
}

.board-col-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}

.board-col-header .state-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.board-col-name { flex: 1; }

.board-col-count {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-active);
  border-radius: 10px;
  padding: 0 6px;
}

/* ONM-321: board column add button + empty state */
.board-col-add {
  margin-left: 2px;
  width: 20px; height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.1s;
}
.board-column:hover .board-col-add { opacity: 1; }
.board-col-add:hover { background: var(--surface-active); color: var(--text); }

.board-col-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 12px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  min-height: 60px;
}

.board-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 48px;
  transition: background var(--duration-fast) var(--ease-out);
}

.board-col-body.board-drop-over {
  background: var(--surface-active);
}

.board-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}

.board-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.board-card.dragging {
  opacity: 0.4;
}

.board-card-title {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 6px;
  word-break: break-word;
}

.board-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.board-card-id {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono, monospace);
  flex: 1;
}

.board-card-priority { display: flex; align-items: center; }

.board-card-avatar { display: flex; align-items: center; }

/* ============================================================
   My Issues Activity tab (ONM-296)
   ============================================================ */

.activity-feed { padding: 0 16px; }

.activity-date-section { margin-bottom: 16px; }

.activity-date-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 0 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.activity-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.activity-row:hover { background: var(--surface-hover); border-radius: 4px; }

.activity-row.notif-unread .activity-dot { width: 8px; height: 8px; }
.activity-row.notif-read .activity-dot { opacity: 0.4; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.activity-text {
  flex: 1;
  line-height: 1.4;
}

.activity-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ============================================================
   Keyboard shortcut help modal (ONM-299)
   ============================================================ */

.shortcuts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3100;
}

.shortcuts-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.shortcuts-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.shortcuts-close {
  font-size: 18px;
  line-height: 1;
}

.shortcuts-body {
  overflow-y: auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.shortcuts-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shortcuts-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.shortcuts-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.shortcuts-keys {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
  min-width: 90px;
}

.shortcut-kbd {
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--font-mono, monospace);
  color: var(--text);
  white-space: nowrap;
}

.shortcuts-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================================
   Global search modal (ONM-300)
   ============================================================ */

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 15vh;
  z-index: 3000;
}

.search-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  width: 560px;
  max-width: calc(100vw - 32px);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.search-input-wrap svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

#search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  caret-color: var(--accent);
}

#search-input::placeholder { color: var(--text-dim, var(--text-muted)); }

.search-esc-hint {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
}

.search-results {
  overflow-y: auto;
  padding: 4px 0;
}

.search-hint {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.search-error { color: var(--danger, #eb5757); }

.search-group-label {
  padding: 6px 16px 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  cursor: pointer;
  border-radius: 0;
  outline: none;
}

.search-result-item:hover,
.search-result-item.focused {
  background: var(--surface-hover, var(--surface));
}

.search-result-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-result-icon svg { width: 14px; height: 14px; }

.search-result-id {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono, monospace);
  flex-shrink: 0;
}

.search-result-title {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Command palette extensions (ONM-366) */
#cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text);
  caret-color: var(--accent);
}

#cmd-input::placeholder {
  color: var(--text-dim, var(--text-muted));
  font-size: 12px;
}

.cmd-palette-modal {
  width: 620px;
}

.cmd-icon {
  color: var(--text-muted);
  font-size: 13px;
}

.cmd-hint {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Mobile layout fixes (ONM-309) */
@media (max-width: 480px) {
  .issue-row {
    /* On narrow screens: hide drag-handle and checkbox columns, shrink identifier */
    grid-template-columns: 0 0 24px 56px 22px 1fr auto auto auto;
  }

  .issue-row .drag-handle,
  .issue-row .bulk-checkbox {
    display: none;
  }

  .issue-row .title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
}

/* ----------------------------------------------------------------------- */
/* ----------------------------------------------------------------------- */
/* Filter bar + filter popover (ONM-317)                                   */
/* ----------------------------------------------------------------------- */

.filter-chips-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-active);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.filter-chip-remove {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  line-height: 1;
}

.filter-chip-remove:hover { color: var(--text); }

.filter-clear-all {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
  text-decoration: underline;
}

.filter-clear-all:hover { color: var(--text); }

.filter-popover {
  position: fixed;
  z-index: 9000;
  background: var(--bg-elevated, #1e1e2e);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  min-width: 220px;
  max-height: 400px;
  overflow-y: auto;
}

.filter-popover-inner { padding: 8px 0; }

.filter-section {
  padding: 4px 0;
}

.filter-section + .filter-section {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 8px;
}

.filter-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 2px 12px 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text);
}

.filter-option:hover { background: var(--surface-hover); }

.filter-option input[type="checkbox"] {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.filter-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--text-dim);
}

.groupby-option.groupby-active {
  color: var(--accent, #5e6ad2);
  font-weight: 600;
}

.groupby-check {
  width: 14px;
  display: inline-block;
  color: var(--accent, #5e6ad2);
  font-size: 12px;
}

/* ----------------------------------------------------------------------- */
/* @mention autocomplete dropdown (ONM-315)                                */
/* ----------------------------------------------------------------------- */

.mention-dropdown {
  position: fixed;
  z-index: 9999;
  background: var(--bg-elevated, #1e1e2e);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  overflow: hidden;
}

.mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.05s;
}

.mention-item:hover,
.mention-item.active {
  background: var(--surface-active);
}

.mention-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent, #5e6ad2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.mention-name {
  color: var(--text);
  flex-shrink: 0;
}

.mention-email {
  color: var(--text-muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ----------------------------------------------------------------------- */
/* Project view mode toggle + timeline (ONM-314)                           */
/* ----------------------------------------------------------------------- */

.proj-view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-left: 8px;
}

.proj-view-btn {
  background: transparent;
  border: none;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: background var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}

.proj-view-btn:last-child { border-right: none; }

.proj-view-btn.active {
  background: var(--surface-active);
  color: var(--text);
  font-weight: 600;
}

.proj-view-btn:hover:not(.active) {
  background: var(--surface-hover);
  color: var(--text);
}

.timeline-container {
  overflow-x: auto;
  padding: 0 16px 24px;
}

.timeline-header {
  display: flex;
  gap: 0;
  margin-bottom: 4px;
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--border);
  min-height: 32px;
}

.timeline-row-label {
  width: 220px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 12px;
  overflow: hidden;
}

.timeline-id {
  color: var(--text-muted);
  flex-shrink: 0;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
}

.timeline-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.timeline-track {
  position: relative;
  flex: 1;
  min-width: 700px;
  height: 32px;
}

.timeline-week-label {
  position: absolute;
  top: 4px;
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

.timeline-bar {
  position: absolute;
  top: 8px;
  height: 16px;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.1s, transform 0.1s;
  min-width: 8px;
}

.timeline-bar:hover {
  opacity: 1;
  transform: scaleY(1.1);
}

.timeline-bar-stub {
  border-radius: 50%;
  width: 8px !important;
}

.timeline-today {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: #eb5757;
  z-index: 1;
  pointer-events: none;
}

.timeline-body {
  position: relative;
}

/* ONM-331: Login page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-card {
  width: 360px;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.login-logo { margin-bottom: 4px; }

.login-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.login-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
}

.login-field input {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 14px;
  color: var(--text);
  box-sizing: border-box;
}

.login-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.login-error {
  font-size: 13px;
  color: #eb5757;
  background: rgba(235,87,87,0.08);
  border: 1px solid rgba(235,87,87,0.25);
  border-radius: 5px;
  padding: 8px 10px;
}

.login-submit {
  width: 100%;
  justify-content: center;
  padding: 9px;
}

.login-mode-toggle {
  background: none;
  border: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 0;
}

.login-mode-toggle:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.login-mode-toggle:disabled {
  cursor: wait;
  opacity: 0.65;
}

/* =========================================================
   Home dashboard  (ONM-353)
   ========================================================= */

.home-body {
  padding: 24px;
  overflow-y: auto;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 1100px;
}

.home-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.widget-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.widget-link {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}

.empty-state-sm {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
}

.home-projects-list,
.home-project-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-project-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.home-project-row:hover {
  background: var(--surface-hover);
}

.proj-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.proj-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proj-due,
.proj-updated {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.proj-progress-label {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* =========================================================
   Team overview  (ONM-353)
   ========================================================= */

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 24px;
  max-width: 1100px;
  overflow-y: auto;
}

.overview-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.overview-section--full {
  grid-column: 1 / -1;
}

.overview-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.overview-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.overview-section-link {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: none;
}

.overview-projects,
.overview-docs {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.overview-project-row,
.overview-doc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.overview-project-row:hover,
.overview-doc-row:hover {
  background: var(--surface-hover);
}

.doc-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-meta {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Bookmarks */

.bookmark-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.bookmark-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 13px;
  cursor: default;
  user-select: none;
}

.bookmark-row:hover {
  background: var(--surface-hover);
}

.bookmark-row.dragging {
  opacity: 0.5;
}

.drag-handle {
  color: var(--text-muted);
  cursor: grab;
  font-size: 14px;
}

.bookmark-link {
  flex: 1;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bookmark-link:hover {
  text-decoration: underline;
}

.bookmark-desc {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.bookmark-delete-btn {
  opacity: 0;
  transition: opacity 0.1s;
}

.bookmark-row:hover .bookmark-delete-btn {
  opacity: 1;
}

.bookmark-add-btn {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.bookmark-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0 8px;
}

/* =========================================================
   Configurable home dashboard widgets  (ONM-354)
   ========================================================= */

.home-widget {
  position: relative; /* anchor for remove button */
}

.home-widget.dragging {
  opacity: 0.4;
}

.home-widget-add {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  border-style: dashed;
  border-color: var(--border);
}

.add-widget-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 8px 16px;
}

.add-widget-btn:hover {
  color: var(--text);
}

.widget-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  transition: opacity 0.1s;
  font-size: 16px;
  color: var(--text-muted);
}

.home-widget:hover .widget-remove {
  opacity: 1;
}

.widget-content {
  /* wrapper so each widget type can style its inner content */
}

/* Widget picker modal */
.widget-picker-modal {
  max-width: 480px;
}

.widget-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 16px;
}

.widget-picker-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}

.widget-picker-card:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
}

.widget-picker-label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}

.widget-picker-desc {
  font-size: 11px;
  color: var(--text-muted);
}

/* Cycle progress widget */
.cycle-widget-name {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
}

.cycle-progress {
  margin-bottom: 4px;
}

.cycle-widget-pct {
  font-size: 11px;
  color: var(--text-muted);
}

/* ============================================================
   Mobile responsive layout (ONM-378)
   Breakpoint: ≤640px — sidebar collapses, hamburger appears.
   ============================================================ */
@media (max-width: 640px) {
  :root { --sidebar-w: 260px; }

  /* Sidebar slides off-screen by default */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: none;
    /* ONM-464: remove from flex flow so main content fills full width */
    min-width: 0;
    width: var(--sidebar-w);
  }

  /* Reveal sidebar when .app has .sidebar-open */
  .app.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow-md), 4px 0 20px rgba(0,0,0,0.4);
  }

  /* Dim overlay behind open sidebar */
  .app.sidebar-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
  }

  /* Main content fills full width */
  .main {
    width: 100%;
    min-width: 0;
  }

  /* Hamburger button — only visible on mobile */
  .mobile-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    flex-shrink: 0;
    box-shadow: 0 0 0 1px var(--border);
  }

  .mobile-nav-btn:hover { background: var(--surface-hover); }

  /* Topbar: push breadcrumb right so it clears the fixed hamburger (ONM-478) */
  .topbar {
    padding-left: 48px;
  }

  /* Issue detail: collapse the 3-panel layout on mobile (ONM-432) */
  .detail-split {
    flex-direction: column;
  }

  .detail-list {
    display: none;
  }

  /* Properties panel: full-width at bottom on mobile */
  .detail-props {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 40vh;
    overflow-y: auto;
  }

  /* Tables: allow horizontal scroll rather than clipping */
  .projects-list,
  .issues-table,
  table {
    min-width: 0;
    overflow-x: auto;
  }

  /* Narrow column widths in list views */
  .col-pname { flex: 1; min-width: 120px; }
  .col-pmilestones,
  .col-pstart,
  .col-pend,
  .col-plastupdate,
  .col-pteam { display: none; }

  /* Dashboard widgets: stack to single column */
  .home-widgets-grid { grid-template-columns: 1fr !important; }

  /* Modals: full-screen on mobile */
  .modal {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  /* Team overview: stack cards to single column (ONM-435) */
  .overview-grid {
    grid-template-columns: 1fr;
  }

  /* My work tabs: prevent icon buttons being clipped at right edge (ONM-437) */
  .tabs {
    overflow: hidden;
    padding: 10px 8px;
  }
  .tab {
    flex-shrink: 1;
    min-width: 0;
    padding: 4px 6px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tabs-right {
    flex-shrink: 0;
  }

  /* Documents list: hide secondary columns, let title fill width (ONM-436) */
  .doc-table-row,
  .docs-table-header {
    grid-template-columns: 1fr 40px;
  }
  .col-dupdated,
  .col-dauthor,
  .col-dlocation { display: none; }
  .col-dtitle {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Initiative detail: stat cards wrap to 2x2 grid, breadcrumb truncates (ONM-434) */
  .project-stats {
    flex-wrap: wrap;
    gap: 8px;
  }
  .cycle-stat {
    min-width: 60px;
  }
  .breadcrumb {
    overflow: hidden;
    min-width: 0;
    flex: 1;
  }
  .breadcrumb span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }

  /* Settings: stack nav + content vertically (ONM-433) */
  .settings-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .settings-nav {
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    white-space: nowrap;
    padding: 8px;
    display: flex;
    gap: 4px;
  }
  .settings-link {
    display: inline-block;
    white-space: nowrap;
    margin-bottom: 0;
  }
}

/* Desktop: hide the mobile hamburger button */
@media (min-width: 641px) {
  .mobile-nav-btn { display: none; }
}

/* Fixed position on mobile — always accessible regardless of scroll */
#mobile-nav-btn {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 201;
}

/* ============================================================
   Issue top properties summary — ONM-492
   Compact clickable row above the description showing status,
   priority, assignee, and due date. The right rail remains for
   full property editing; this row is the primary edit surface
   in narrow contexts (drawer, mobile).
   ============================================================ */

.issue-top-props {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0 24px 14px;
}

.top-prop {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--surface);
  transition: background var(--duration-fast) var(--ease-out);
  user-select: none;
}

.top-prop:hover { background: var(--surface-active); color: var(--text); }
.top-prop.overdue { color: var(--priority-urgent); border-color: var(--priority-urgent); }
.top-prop.top-prop-empty { opacity: 0.6; }
.top-prop svg { width: 12px; height: 12px; }

/* In drawer context the right rail is hidden, so top-props becomes the
   primary edit surface — make it slightly more prominent. */
.issue-drawer-body .issue-top-props {
  padding: 0 20px 12px;
}

/* ============================================================
   Issue drawer — ONM-490
   Right-side panel that opens over the list context.
   ============================================================ */

.issue-drawer-overlay {
  position: fixed;
  inset: 0;
  /* Transparent backdrop — list stays visible behind the panel */
  background: rgba(0, 0, 0, 0);
  z-index: 300;
  pointer-events: none; /* allow clicks to pass through to list until panel open */
  display: flex;
  justify-content: flex-end;
}

.issue-drawer-overlay.open {
  pointer-events: auto;
  /* Dim backdrop subtly so the panel stands out */
  background: rgba(0, 0, 0, 0.25);
  transition: background 0.2s;
}

.issue-drawer-panel {
  width: min(600px, 100vw);
  max-width: 100vw;
  height: 100%;
  background: var(--bg);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.2s var(--ease-out, ease-out);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
}

.issue-drawer-overlay.open .issue-drawer-panel {
  transform: translateX(0);
}

.issue-drawer-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.issue-drawer-close {
  font-size: 18px;
  line-height: 1;
  color: var(--text-muted);
}
.issue-drawer-close:hover { color: var(--text); }

.issue-drawer-fullpage {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  margin-left: auto;
}
.issue-drawer-fullpage:hover { color: var(--accent); }

.issue-drawer-body {
  flex: 1;
  overflow-y: auto;
  /* Issue detail renders .detail-split inside; override to single-column layout
     since the drawer is always narrow. */
}

/* Inside the drawer, collapse the 3-panel split to a single scrollable column. */
.issue-drawer-body .detail-split {
  display: flex;
  flex-direction: column;
  height: auto;
  overflow: visible;
}

.issue-drawer-body .detail-list {
  display: none; /* hide sibling list — drawer is too narrow */
}

.issue-drawer-body .detail-props {
  width: 100%;
  border-left: none;
  border-top: 1px solid var(--border);
  max-height: none;
}

.issue-drawer-body .detail-main {
  padding: 16px 20px 40px;
  max-width: 100%;
  width: 100%;
}

@media (max-width: 640px) {
  /* On mobile, full-screen sheet instead of side panel */
  .issue-drawer-panel {
    width: 100vw;
    border-left: none;
  }
}
