/* ============================================================
   Project Management Demo — dark theme
   ============================================================ */

/* data-cloak: hide elements until WildflowerJS resolves their bindings.
   WF removes the attribute after first bind. Without this rule the cloak
   attribute is a no-op and any data-show element flashes its un-gated
   default before the binding evaluates (visible during the few-frames
   gap between DOM parse and component scan). */
[data-cloak] { display: none !important; }

:root {
    --pm-bg:           #0e0e12;
    --pm-bg-elev:      #16161c;
    --pm-bg-elev-2:    #1d1d24;
    --pm-bg-hover:     #22222b;
    --pm-bg-active:    #2a2a35;
    --pm-border:       #25252e;
    --pm-border-soft:  #1d1d24;
    --pm-text:         #d8d8e0;
    --pm-text-dim:     #a0a0b0;   /* WCAG AA on --pm-bg/elev backgrounds */
    --pm-text-muted:   #8a8a9a;   /* bumped from #5a5a6a (failed contrast on dark bgs) */
    --pm-accent:       #5b8def;
    --pm-accent-soft:  rgba(91, 141, 239, 0.15);
    --pm-accent-strong:#3a6dd9;   /* darker variant for white-text-on-accent (button bg) */
    --pm-success:      #4cc9a3;
    --pm-warn:         #f0a04b;
    --pm-danger:       #e85d75;
    --pm-radius:       6px;
    --pm-sidebar-w:    240px;
    --pm-detail-w:     400px;
}

.pm-app.theme-light {
    --pm-bg:           #ffffff;
    --pm-bg-elev:      #f7f7f9;
    --pm-bg-elev-2:    #ededf2;
    --pm-bg-hover:     #f0f0f5;
    --pm-bg-active:    #e6e6ee;
    --pm-border:       #d8d8e0;
    --pm-border-soft:  #ededf2;
    --pm-text:         #1a1a22;
    --pm-text-dim:     #5a5a68;   /* WCAG AA on light backgrounds */
    --pm-text-muted:   #6a6a78;   /* bumped from #9a9aaa */
}

* { box-sizing: border-box; }

body, html {
    background: var(--pm-bg);
    color: var(--pm-text);
}

button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

a { color: inherit; text-decoration: none; }

/* ============================================================
   Layout shell
   ============================================================ */

.pm-app {
    display: grid;
    grid-template-columns: var(--pm-sidebar-w) 1fr;
    grid-template-rows: 100vh;
    background: var(--pm-bg);
    color: var(--pm-text);
}

.pm-app.has-detail {
    grid-template-columns: var(--pm-sidebar-w) 1fr var(--pm-detail-w);
}

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

.pm-sidebar {
    background: var(--pm-bg-elev);
    border-right: 1px solid var(--pm-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
}

.pm-sidebar-header {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--pm-border-soft);
    gap: 8px;
}

.pm-workspace {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.pm-workspace-icon {
    width: 22px; height: 22px;
    background: linear-gradient(135deg, #5b8def, #9b6dff);
    border-radius: 5px;
    display: grid; place-items: center;
    color: white;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}

.pm-workspace-name {
    font-weight: 600;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pm-icon-btn {
    width: 24px; height: 24px;
    display: grid; place-items: center;
    border-radius: 4px;
    color: var(--pm-text-dim);
    font-size: 14px;
}
.pm-icon-btn:hover { background: var(--pm-bg-hover); color: var(--pm-text); }

.pm-sidebar-nav {
    padding: 8px 8px 4px;
    display: flex;
    flex-direction: column;
}

.pm-nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--pm-radius);
    color: var(--pm-text-dim);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.08s, color 0.08s;
}
.pm-nav-item:hover { background: var(--pm-bg-hover); color: var(--pm-text); }
.pm-nav-item.is-active {
    background: var(--pm-bg-active);
    color: var(--pm-text);
    font-weight: 500;
}
.pm-nav-icon {
    width: 16px; display: inline-grid; place-items: center;
    color: var(--pm-text-muted);
    font-size: 13px;
    flex-shrink: 0;
}
.pm-nav-item.is-active .pm-nav-icon { color: var(--pm-accent); }
.pm-nav-label { flex: 1; }
.pm-nav-count {
    font-size: 11px;
    color: var(--pm-text-muted);
    background: var(--pm-bg-elev-2);
    padding: 1px 6px;
    border-radius: 10px;
    font-variant-numeric: tabular-nums;
}

.pm-sidebar-section {
    padding: 4px 8px;
    margin-top: 8px;
}
.pm-sidebar-section-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--pm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 8px 2px;
}

.pm-project-list { display: flex; flex-direction: column; }
.pm-project-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px;
    border-radius: var(--pm-radius);
    color: var(--pm-text-dim);
    font-size: 13px;
    cursor: pointer;
}
.pm-project-item:hover { background: var(--pm-bg-hover); color: var(--pm-text); }
.pm-project-item.is-active { background: var(--pm-bg-active); color: var(--pm-text); font-weight: 500; }

.pm-saved-views { display: flex; flex-direction: column; }
.pm-saved-view-item {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 8px;
    border-radius: var(--pm-radius);
    color: var(--pm-text-dim);
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    position: relative;
}
.pm-saved-view-item:hover { background: var(--pm-bg-hover); color: var(--pm-text); }
.pm-saved-view-delete {
    background: transparent;
    border: none;
    color: var(--pm-text-muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    padding: 0 4px;
    transition: opacity 0.1s;
}
.pm-saved-view-item:hover .pm-saved-view-delete { opacity: 1; }
.pm-saved-view-delete:hover { color: var(--pm-danger); }

.pm-project-icon {
    width: 18px; height: 18px;
    border-radius: 4px;
    display: grid; place-items: center;
    color: white;
    font-size: 11px;
    flex-shrink: 0;
}

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

.pm-fav-btn {
    background: transparent;
    border: none;
    color: var(--pm-text-muted);
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0;
    transition: opacity 0.1s, color 0.1s;
}
.pm-project-item:hover .pm-fav-btn { opacity: 1; }
.pm-fav-btn.is-on {
    opacity: 1;
    color: #f0c54b;
}
.pm-fav-btn:hover { color: #f0c54b; }

/* Sidebar Favorites list: small × button reveals on row hover and
   removes the item from favorites without navigating. Shared by the
   project rows (toggleFavoriteProject) and the starred-issue rows
   (toggleStarredIssue). */
.pm-fav-remove {
    background: transparent;
    border: none;
    color: var(--pm-text-muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    margin-left: 2px;
    opacity: 0;
    transition: opacity 0.1s, color 0.1s;
}
.pm-project-item:hover .pm-fav-remove { opacity: 1; }
.pm-fav-remove:hover { color: var(--pm-danger); }

/* Subtle divider between starred-project rows and starred-issue rows
   inside the Favorites section. Only rendered when both groups have
   members (showFavoritesDivider). */
.pm-favorites-divider {
    height: 1px;
    background: var(--pm-border-soft);
    margin: 4px 12px;
}

/* Starred-issue rows reuse pm-project-item layout but show the issue's
   status icon instead of a project color square. The status-icon
   coloring already comes from the s-<status> class on the span. */
.pm-fav-issue-item .pm-status-icon {
    width: 18px; height: 18px;
    display: grid; place-items: center;
    font-size: 13px;
    flex-shrink: 0;
}

/* Star toggle in the issue-detail header. Filled + accent when on,
   outlined + muted when off. Same size envelope as the other detail
   header icon buttons. */
.pm-detail-star {
    background: transparent;
    border: none;
    color: var(--pm-text-muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    margin-left: 4px;
    transition: color 0.1s;
}
.pm-detail-star:hover { color: #f0c54b; }
.pm-detail-star.is-on { color: #f0c54b; }

.pm-sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid var(--pm-border-soft);
    display: flex; flex-direction: column; gap: 4px;
}

.pm-text-btn {
    text-align: left;
    color: var(--pm-text-muted);
    font-size: 12px;
    padding: 4px 6px;
    border-radius: 4px;
}
.pm-text-btn:hover { color: var(--pm-text); background: var(--pm-bg-hover); }
.pm-text-btn-danger { color: var(--pm-text-muted); }
.pm-text-btn-danger:hover { color: #ff8a8a; background: var(--pm-bg-hover); }

/* ============================================================
   Main area
   ============================================================ */

.pm-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.pm-header {
    display: flex; align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--pm-border);
    gap: 12px;
    background: var(--pm-bg);
}

.pm-header-left { flex: 1; min-width: 0; }
.pm-header-title { font-size: 24px; font-weight: 600; color: var(--pm-text); }
.pm-header-subtitle { font-size: 16px; color: var(--pm-text-dim); margin-top: 2px; }
.pm-header-right { display: flex; gap: 8px; }

/* Mobile hamburger — only visible when the sidebar is in drawer mode
   (<=900px). At wider widths the sidebar is always visible so the toggle
   is unnecessary. */
.pm-hamburger {
    display: none;
    background: transparent;
    border: 1px solid var(--pm-border);
    color: var(--pm-text);
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 6px 10px;
}
.pm-hamburger:hover { background: var(--pm-bg-hover); }

.pm-btn-primary, .pm-btn-secondary, .pm-btn-danger {
    padding: 6px 12px;
    border-radius: var(--pm-radius);
    font-size: 12px;
    font-weight: 500;
    transition: background 0.1s;
}
.pm-btn-primary { background: var(--pm-accent-strong); color: white; }
.pm-btn-primary:hover { background: var(--pm-accent); }
.pm-btn-secondary { background: var(--pm-bg-elev); color: var(--pm-text); border: 1px solid var(--pm-border); }
.pm-btn-secondary:hover { background: var(--pm-bg-hover); }
.pm-btn-danger { background: var(--pm-danger); color: white; }
.pm-btn-danger:hover { filter: brightness(1.1); }
.pm-modal-confirm { max-width: 420px; }
.pm-confirm-message { margin: 0; line-height: 1.5; color: var(--pm-text); font-size: 14px; }

/* Toolbar */
.pm-toolbar {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--pm-border);
    background: var(--pm-bg);
}
.pm-view-switch {
    display: flex; gap: 2px;
    background: var(--pm-bg-elev);
    border-radius: var(--pm-radius);
    padding: 2px;
}
.pm-view-btn {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--pm-text-dim);
}
.pm-view-btn:hover { color: var(--pm-text); }
.pm-view-btn.is-active { background: var(--pm-bg-active); color: var(--pm-text); }
.pm-filter-area { flex: 1; }

/* ============================================================
   Issue list
   ============================================================ */

.pm-issues, .pm-board, .pm-settings {
    overflow: auto;
    flex: 1;
}

.pm-issue-row {
    display: grid;
    /* Columns: checkbox · status-cell · ref · priority-cell · title ·
       labels · saving · due · assignee-cell. Status/priority cells are
       wider than the bare icon to give the hover-hit-target room. */
    grid-template-columns: 22px 32px 90px 28px 1fr auto auto auto auto;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--pm-border-soft);
    cursor: pointer;
    transition: background 0.08s;
}
.pm-issue-row:hover { background: var(--pm-bg-hover); }
.pm-issue-row.is-selected { background: var(--pm-bg-active); }
.pm-issue-row.is-checked { background: rgba(58, 109, 217, 0.08); }

.pm-row-check {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px;
    border: 1.5px solid var(--pm-border);
    border-radius: 3px;
    font-size: 11px; line-height: 1;
    color: transparent;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.1s, background 0.1s;
}
.pm-row-check:hover { border-color: var(--pm-text-muted); }
.pm-row-check.is-checked {
    background: var(--pm-accent);
    border-color: var(--pm-accent);
    color: #fff;
}

.pm-status-icon {
    font-size: 22px;
    line-height: 1;
    color: var(--pm-text-muted);
    text-align: center;
    /* Slight optical lift — the unicode circle glyphs sit a couple of px
       below the text baseline at this size; nudging them up keeps row
       alignment with the title text. */
    transform: translateY(-1px);
    display: inline-block;
}
.pm-status-icon.s-done { color: var(--pm-success); }
.pm-status-icon.s-in_progress { color: var(--pm-warn); }
.pm-status-icon.s-in_review { color: var(--pm-accent); }
.pm-status-icon.s-cancelled { color: var(--pm-text-muted); opacity: 0.6; }

.pm-issue-ref {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--pm-text-muted);
    font-variant-numeric: tabular-nums;
}

.pm-priority-icon {
    text-align: center;
    font-weight: 600;
    color: var(--pm-text-muted);
    font-size: 18px;
    line-height: 1;
}
.pm-priority-icon.p-1 { color: var(--pm-danger); }
.pm-priority-icon.p-2 { color: var(--pm-warn); }
.pm-priority-icon.p-3 { color: var(--pm-text-dim); }

.pm-issue-title {
    color: var(--pm-text);
    font-size: 13px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pm-issue-title-wrap {
    display: flex; align-items: center; gap: 6px;
    min-width: 0;
}

.pm-triage-summary {
    font-size: 11px;
    color: #f0a04b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.pm-issue-row.is-done .pm-issue-title,
.pm-issue-row.is-cancelled .pm-issue-title {
    color: var(--pm-text-dim);
    text-decoration: line-through;
    text-decoration-color: var(--pm-text-muted);
}

.pm-labels { display: flex; gap: 4px; }
.pm-issue-labels { display: inline-flex; gap: 4px; align-items: center; }

/* Filter bar selects */
.pm-filter-area { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }
.pm-filter-text { max-width: 240px; }
.pm-filter-chip {
    background-color: var(--pm-bg-2, var(--pm-bg));
    /* Shared down-chevron arrow for both native <select>s and the
       button-based popover triggers (assignee, label). The buttons
       no longer carry an inline ▾ glyph — this background-image is
       the single source so all four chips line up identically. */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5' viewBox='0 0 8 5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%239ca3af'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    color: var(--pm-text);
    border: 1px solid var(--pm-border);
    border-radius: 6px;
    padding: 4px 22px 4px 8px;
    font-size: 12px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.pm-filter-chip:hover { background-color: var(--pm-bg-hover); }
.pm-filter-chip:focus { outline: 2px solid var(--pm-accent, #5a7eff); outline-offset: 1px; }
.pm-filter-chip.is-active { border-color: var(--pm-accent); background-color: var(--pm-bg-active, var(--pm-bg-hover)); }
.pm-filter-clear { color: var(--pm-text-muted); }

/* Assignee popover — replaces a native <select> so the dynamic list of
   teammates can be rendered through data-list rather than imperative DOM. */
.pm-filter-assignee { position: relative; display: inline-flex; }
.pm-filter-assignee-trigger {
    display: inline-flex; align-items: center; gap: 6px;
    max-width: 200px;
}
.pm-filter-assignee-trigger > span:first-child {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* .pm-filter-caret rule retired — the arrow now comes from the
   background-image on .pm-filter-chip for full select/button parity. */
.pm-filter-popover {
    position: absolute; top: calc(100% + 4px); left: 0;
    z-index: 30;
    min-width: 200px; max-height: 280px; overflow-y: auto;
    background: var(--pm-bg);
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    padding: 4px;
    display: flex; flex-direction: column; gap: 1px;
}
.pm-filter-popover-row {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 8px;
    border: none; background: transparent;
    border-radius: 6px;
    text-align: left; cursor: pointer;
    font: inherit; color: var(--pm-text);
}
.pm-filter-popover-row:hover,
.pm-filter-popover-row.is-cursor { background: var(--pm-bg-hover); }
.pm-filter-popover-row.is-current {
    background: var(--pm-bg-active, var(--pm-bg-hover));
    color: var(--pm-accent);
}
.pm-filter-popover-row.is-cursor.is-current {
    box-shadow: inset 2px 0 0 var(--pm-accent);
}

/* Bulk-bar's popovers (assignee + label) stay mounted at all times and
   toggle via visibility rather than display:none. data-list rows render
   once at bulk-bar mount, so opening the popover is purely CSS — no
   reactive re-render. No transition: matches the instant appearance of
   the adjacent native <select>s. */
.pm-bulk-popover {
    visibility: hidden;
    pointer-events: none;
}
.pm-bulk-popover.is-open {
    visibility: visible;
    pointer-events: auto;
}

/* Activity feed in detail pane */
.pm-activity { margin-top: 16px; }
.pm-activity-row {
    display: grid;
    grid-template-columns: 22px 1fr;
    align-items: baseline;
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: var(--pm-text-muted);
}
.pm-activity-icon { color: var(--pm-text-muted); text-align: center; font-size: 12px; }
.pm-activity-line { line-height: 1.4; }
.pm-activity-who { color: var(--pm-text); font-weight: 500; }
.pm-activity-summary { color: var(--pm-text-muted); margin-left: 4px; }
.pm-activity-time { color: var(--pm-text-dim, var(--pm-text-muted)); margin-left: 6px; font-size: 11px; }

/* Sortable.js ghost during board drag */
.pm-board-card-ghost {
    opacity: 0.35;
    background: var(--pm-bg-active);
    border: 1px dashed var(--pm-border);
}
.pm-board-card.sortable-chosen { cursor: grabbing; }
.pm-label {
    font-size: 11px;
    font-weight: bold;
    padding: 1px 6px 2px;
    border-radius: 10px;
    color: white;
    white-space: nowrap;
}

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

.pm-assignee {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: grid; place-items: center;
    color: white;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}
.pm-assignee.is-empty {
    background: var(--pm-bg-elev-2);
    color: var(--pm-text-muted);
    border: 1px dashed var(--pm-border);
}

/* Section headers within list */
.pm-section-header {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 20px;
    background: var(--pm-bg-elev);
    border-bottom: 1px solid var(--pm-border);
    font-size: 12px;
    font-weight: 600;
    color: var(--pm-text-dim);
    position: sticky;
    top: 0;
    z-index: 1;
}
.pm-section-header .pm-section-count {
    color: var(--pm-text-muted);
    font-weight: 400;
}
/* Section header status glyph (the second <span> — first is the
   tri-state select-all checkbox). The header text is 12px but the
   unicode circle reads better at ~16px. */
.pm-section-header > span:nth-child(2) {
    font-size: 16px;
    line-height: 1;
    transform: translateY(-1px);
    display: inline-block;
}

/* Section select-all checkbox. Matches the row checkbox visually but
   sits in the header and toggles every row in the group. The 'partial'
   state shows an em-dash to signal "some, not all" — same Gmail / macOS
   Mail convention. */
.pm-section-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    border: 1px solid var(--pm-border);
    border-radius: 3px;
    background: var(--pm-bg);
    font-size: 11px;
    line-height: 1;
    color: transparent;
    cursor: pointer;
    transition: border-color 0.1s, background 0.1s, color 0.1s;
    margin-right: 2px;
}
.pm-section-check:hover { border-color: var(--pm-text-muted); }
.pm-section-check.is-checked,
.pm-section-check.is-partial {
    background: var(--pm-accent);
    border-color: var(--pm-accent);
    color: #fff;
}

/* ============================================================
   Detail pane
   ============================================================ */

.pm-detail {
    background: var(--pm-bg-elev);
    border-left: 1px solid var(--pm-border);
    overflow-y: auto;
    display: flex; flex-direction: column;
}

.pm-detail-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--pm-border-soft);
    display: flex; align-items: center; gap: 8px;
}
.pm-detail-ref {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--pm-text-muted);
}
.pm-parent-btn {
    background: transparent;
    border: 1px solid var(--pm-border-soft);
    color: var(--pm-text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    line-height: 1.4;
}
.pm-parent-btn:hover { background: var(--pm-bg-hover); color: var(--pm-text); }
.pm-detail-close { /* sits next to nav, no auto-margin needed */ }
.pm-detail-nav {
    margin-left: auto;
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px;
    color: var(--pm-text-muted);
}
.pm-detail-position {
    font-variant-numeric: tabular-nums;
    min-width: 56px; text-align: center;
}
.pm-nav-btn {
    background: transparent;
    border: 1px solid var(--pm-border-soft);
    border-radius: 4px;
    color: var(--pm-text);
    width: 24px; height: 22px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.1s, color 0.1s;
}
.pm-nav-btn:hover { border-color: var(--pm-text-muted); }
.pm-nav-btn.is-disabled {
    color: var(--pm-text-dim);
    opacity: 0.4;
    cursor: default;
}
.pm-nav-btn.is-disabled:hover { border-color: var(--pm-border-soft); }

.pm-detail-body { padding: 16px 20px; flex: 1; }
.pm-detail-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--pm-text);
    line-height: 1.3;
    margin-bottom: 12px;
}
.pm-detail-description {
    font-size: 13px;
    color: var(--pm-text);
    line-height: 1.6;
}
.pm-detail-description p { margin: 0 0 10px; }
.pm-detail-description code {
    background: var(--pm-bg-elev-2);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}
.pm-detail-description ul, .pm-detail-description ol { margin: 0 0 10px; padding-left: 20px; }
.pm-detail-description li { margin: 4px 0; }

.pm-detail-meta {
    margin-top: 16px;
    border-top: 1px solid var(--pm-border-soft);
    padding-top: 12px;
}
.pm-meta-row {
    display: grid;
    grid-template-columns: 90px 1fr;
    align-items: center;
    padding: 6px 0;
    font-size: 12px;
    gap: 8px;
}
.pm-meta-label { color: var(--pm-text-muted); }
.pm-meta-value { color: var(--pm-text); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.pm-comments {
    margin-top: 18px;
    border-top: 1px solid var(--pm-border-soft);
    padding-top: 14px;
}
.pm-comments-header {
    font-size: 12px;
    color: var(--pm-text-muted);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pm-comment {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--pm-border-soft);
}
.pm-comment:last-child { border-bottom: none; }
.pm-comment-meta { font-size: 11px; color: var(--pm-text-muted); margin-bottom: 4px; }
.pm-comment-author { color: var(--pm-text); font-weight: 500; }
.pm-comment-body { font-size: 13px; color: var(--pm-text); line-height: 1.5; }
.pm-comment-body p { margin: 0 0 8px 0; }
.pm-comment-body p:last-child { margin-bottom: 0; }
.pm-comment-body code {
    background: var(--pm-bg);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 12px;
}
.pm-comment-body pre {
    background: var(--pm-bg);
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
}

.pm-reactions {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-top: 6px;
}
.pm-reaction {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 6px;
    background: transparent;
    border: 1px solid var(--pm-border-soft);
    border-radius: 12px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    color: var(--pm-text);
    transition: opacity 0.1s, border-color 0.1s, background 0.1s;
}
.pm-reaction.is-empty { opacity: 0.35; }
.pm-reaction:hover { opacity: 1; border-color: var(--pm-text-muted); }
.pm-reaction.is-mine {
    background: rgba(58, 109, 217, 0.15);
    border-color: var(--pm-accent);
    opacity: 1;
}
.pm-reaction-count {
    font-variant-numeric: tabular-nums;
    color: var(--pm-text-muted);
}
.pm-reaction.is-mine .pm-reaction-count { color: var(--pm-accent); }

/* ============================================================
   Insights view
   ============================================================ */
.pm-insights {
    padding: 20px;
    overflow-y: auto;
}
.pm-insights-controls {
    display: flex; flex-wrap: wrap; gap: 12px;
    margin-bottom: 16px;
}
.pm-insights-control {
    display: flex; flex-direction: column; gap: 4px;
    flex: 0 0 auto;
}
.pm-insights-control-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--pm-text-muted);
}
.pm-insights-summary {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--pm-text-muted);
    margin-bottom: 8px;
}
.pm-insights-row {
    display: grid;
    grid-template-columns: 160px 1fr 64px;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--pm-text);
}
.pm-insights-row-label {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pm-insights-row-track {
    display: block;
    height: 16px;
    background: var(--pm-border-soft);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.pm-insights-row-bar {
    display: flex;
    height: 100%;
    transition: width 200ms ease;
}
.pm-insights-segment {
    display: block;
    height: 100%;
    transition: width 200ms ease;
}
.pm-insights-row-total {
    text-align: right;
    color: var(--pm-text-muted);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}
.pm-insights-legend {
    display: flex; flex-wrap: wrap; gap: 12px;
    margin-top: 16px;
    font-size: 12px;
    color: var(--pm-text-muted);
}
.pm-insights-legend-key {
    display: inline-flex; align-items: center; gap: 6px;
}
.pm-insights-legend-swatch {
    width: 12px; height: 12px;
    border-radius: 3px;
    display: inline-block;
}

/* ============================================================
   Cycle tab
   ============================================================ */
.pm-cycle {
    padding: 20px;
    overflow-y: auto;
}
.pm-cycle-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
    padding: 14px 16px;
    background: var(--pm-bg-elev);
    border: 1px solid var(--pm-border-soft);
    border-radius: 8px;
}
.pm-cycle-range {
    font-size: 14px;
    font-weight: 600;
    color: var(--pm-text);
}
.pm-cycle-progress {
    margin-top: 4px;
    font-size: 12px;
    color: var(--pm-text-muted);
}
.pm-cycle-remaining {
    font-size: 13px;
    color: var(--pm-accent);
    font-weight: 500;
}
.pm-cycle-chart-card {
    /* Allow the SVG to determine its own height responsively. */
}
.pm-cycle-svg {
    width: 100%;
    height: auto;
    max-height: 220px;
    display: block;
}
.pm-cycle-grid {
    stroke: var(--pm-border-soft);
    stroke-width: 1;
    stroke-dasharray: 2 4;
}
.pm-cycle-axis {
    stroke: var(--pm-border);
    stroke-width: 1;
}
.pm-cycle-today {
    stroke: var(--pm-text-muted);
    stroke-width: 1;
    stroke-dasharray: 4 4;
    opacity: 0.5;
}
.pm-cycle-ideal {
    stroke: var(--pm-text-muted);
    stroke-width: 1.5;
    stroke-dasharray: 5 5;
}
.pm-cycle-actual {
    stroke: var(--pm-accent);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.pm-cycle-tick { fill: var(--pm-text-muted); font-size: 10px; }
.pm-cycle-xlabel { fill: var(--pm-text-muted); font-size: 10px; }
.pm-cycle-legend {
    display: flex; gap: 14px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--pm-text-muted);
}
.pm-cycle-legend-key { display: inline-flex; align-items: center; gap: 6px; }
.pm-cycle-swatch {
    width: 16px; height: 2px;
    display: inline-block;
}
.pm-cycle-actual-swatch { background: var(--pm-accent); }
.pm-cycle-ideal-swatch  { background: var(--pm-text-muted); }

.pm-cycle-breakdown-tabs {
    display: flex; gap: 4px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--pm-border-soft);
}
.pm-tab-sub {
    padding: 6px 10px;
    font-size: 12px;
}
.pm-cycle-breakdown-row {
    display: grid;
    grid-template-columns: 140px 1fr 32px;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    font-size: 12px;
    color: var(--pm-text);
}
.pm-cycle-breakdown-label {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pm-cycle-breakdown-track {
    display: block;
    height: 8px;
    background: var(--pm-border-soft);
    border-radius: 4px;
    overflow: hidden;
}
.pm-cycle-breakdown-bar {
    display: block;
    height: 100%;
    transition: width 200ms ease;
}
.pm-cycle-breakdown-count {
    text-align: right;
    color: var(--pm-text-muted);
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   Project tab strip + Overview tab
   ============================================================ */
.pm-tabs {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    border-bottom: 1px solid var(--pm-border-soft);
    background: var(--pm-bg);
}
.pm-tab {
    background: transparent;
    border: none;
    color: var(--pm-text-muted);
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.1s, border-color 0.1s;
}
.pm-tab:hover { color: var(--pm-text); }
.pm-tab.is-active {
    color: var(--pm-text);
    border-bottom-color: var(--pm-accent);
    font-weight: 500;
}

.pm-overview {
    padding: 20px;
    overflow-y: auto;
}
.pm-overview-actions {
    display: flex; justify-content: flex-end;
    margin-bottom: 12px;
}

.pm-sidebar-section-row {
    display: flex; align-items: center; justify-content: space-between;
}
.pm-sidebar-add {
    background: transparent;
    border: none;
    color: var(--pm-text-muted);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 6px;
    border-radius: 4px;
}
.pm-sidebar-add:hover { color: var(--pm-text); background: var(--pm-bg-hover); }

.pm-sidebar-section-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}
.pm-sidebar-section-link:hover { color: var(--pm-text); }

/* ============================================================
   Projects index page
   ============================================================ */
.pm-projects-index {
    padding: 20px;
    overflow-y: auto;
}
.pm-projects-table {
    background: var(--pm-bg-elev);
    border: 1px solid var(--pm-border-soft);
    border-radius: 8px;
    overflow: hidden;
}
.pm-projects-thead, .pm-projects-row {
    display: grid;
    grid-template-columns: minmax(180px, 2fr) minmax(140px, 1fr) 110px 110px minmax(160px, 1fr) minmax(120px, 1fr);
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
}
.pm-projects-thead {
    background: var(--pm-bg);
    border-bottom: 1px solid var(--pm-border-soft);
    font-size: 11px;
    font-weight: 600;
    color: var(--pm-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pm-projects-row {
    cursor: pointer;
    border-bottom: 1px solid var(--pm-border-soft);
    transition: background 0.08s;
    font-size: 13px;
    color: var(--pm-text);
}
.pm-projects-row:last-child { border-bottom: none; }
.pm-projects-row:hover { background: var(--pm-bg-hover); }

.pm-projects-cell { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.pm-projects-name { font-weight: 500; }
.pm-projects-lead-name {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: var(--pm-text-muted);
}

.pm-projects-ring {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: grid; place-items: center;
    flex-shrink: 0;
}
.pm-projects-ring-inner {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--pm-bg-elev);
    display: grid; place-items: center;
    font-size: 10px; font-weight: 600;
    color: var(--pm-text);
    font-variant-numeric: tabular-nums;
}

.pm-health-pill {
    display: inline-block;
    font-size: 11px; font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pm-health-pill.is-on-track  { background: rgba(76, 201, 163, 0.18); color: #4cc9a3; }
.pm-health-pill.is-at-risk   { background: rgba(240, 160, 75, 0.20); color: #f0a04b; }
.pm-health-pill.is-off-track { background: rgba(232, 93, 117, 0.20); color: #e85d75; }
.pm-health-pill.is-unknown   { background: var(--pm-border-soft);     color: var(--pm-text-muted); }

.pm-projects-target {
    display: inline-flex; align-items: center; gap: 6px;
}
.pm-projects-target.is-overdue { color: var(--pm-danger); }
.pm-projects-target.is-overdue .pm-overview-target-rel { color: var(--pm-danger); }
.pm-projects-count {
    color: var(--pm-text-muted);
    font-variant-numeric: tabular-nums;
}

.pm-color-chip {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 4px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.1s;
}
.pm-color-chip:hover { border-color: var(--pm-text-muted); }
.pm-color-chip.is-selected { border-color: var(--pm-accent); }
.pm-color-swatch {
    width: 22px; height: 22px;
    border-radius: 50%;
    display: inline-block;
}
.pm-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
.pm-overview-card {
    background: var(--pm-bg-elev);
    border: 1px solid var(--pm-border-soft);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.pm-overview-card:last-child { margin-bottom: 0; }
.pm-overview-card-title {
    font-size: 11px; font-weight: 600;
    color: var(--pm-text-muted);
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.pm-overview-progress {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 0;
}
.pm-overview-ring {
    width: 64px; height: 64px;
    border-radius: 50%;
    display: grid; place-items: center;
    flex-shrink: 0;
}
.pm-overview-ring-inner {
    width: 50px; height: 50px;
    border-radius: 50%;
    background: var(--pm-bg-elev);
    display: grid; place-items: center;
    font-size: 13px; font-weight: 600;
    color: var(--pm-text);
    font-variant-numeric: tabular-nums;
}
.pm-overview-progress-label {
    font-size: 11px; font-weight: 600;
    color: var(--pm-text-muted);
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.pm-overview-progress-summary {
    font-size: 14px;
    color: var(--pm-text);
}

.pm-overview-properties { margin-bottom: 0; }
.pm-overview-prop {
    display: flex; align-items: center; gap: 12px;
    padding: 6px 0;
    font-size: 13px;
}
.pm-overview-prop-label {
    width: 80px; flex-shrink: 0;
    font-size: 11px; color: var(--pm-text-muted);
    text-transform: uppercase; letter-spacing: 0.04em;
}
.pm-overview-prop-value {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--pm-text);
}
.pm-overview-prop-value.is-overdue { color: var(--pm-danger); }
.pm-overview-target-rel {
    margin-left: 6px;
    font-size: 12px;
    color: var(--pm-text-muted);
}
.pm-overview-prop-value.is-overdue .pm-overview-target-rel { color: var(--pm-danger); }

.pm-overview-description {
    margin: 0;
    font-size: 13px;
    color: var(--pm-text);
    line-height: 1.5;
}

.pm-overview-bar {
    display: flex;
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--pm-border-soft);
    margin-bottom: 10px;
}
.pm-overview-bar-segment {
    height: 100%;
    transition: width 200ms ease;
}
.pm-overview-bar-segment.s-ideas       { background: #9b6dff; }
.pm-overview-bar-segment.s-backlog     { background: #6e7280; }
.pm-overview-bar-segment.s-todo        { background: #8a8eb0; }
.pm-overview-bar-segment.s-in_progress { background: #f0a04b; }
.pm-overview-bar-segment.s-in_review   { background: #5b8def; }
.pm-overview-bar-segment.s-done        { background: #4cc9a3; }
.pm-overview-bar-segment.s-cancelled   { background: #4a4a55; }
.pm-overview-bar-swatch.s-ideas        { background: #9b6dff; }
.pm-overview-bar-swatch.s-backlog      { background: #6e7280; }
.pm-overview-bar-swatch.s-todo         { background: #8a8eb0; }
.pm-overview-bar-swatch.s-in_progress  { background: #f0a04b; }
.pm-overview-bar-swatch.s-in_review    { background: #5b8def; }
.pm-overview-bar-swatch.s-done         { background: #4cc9a3; }
.pm-overview-bar-swatch.s-cancelled    { background: #4a4a55; }

.pm-overview-bar-legend {
    display: flex; flex-wrap: wrap; gap: 12px;
    font-size: 12px;
    color: var(--pm-text-muted);
}
.pm-overview-bar-key { display: inline-flex; align-items: center; gap: 6px; }
.pm-overview-bar-swatch {
    width: 10px; height: 10px;
    border-radius: 2px;
    display: inline-block;
}
.pm-overview-bar-count { color: var(--pm-text); font-variant-numeric: tabular-nums; }

.pm-milestone-row {
    display: grid;
    grid-template-columns: 24px 1fr auto auto;
    align-items: center; gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--pm-text);
}
.pm-milestone-icon {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--pm-bg);
    border: 1px solid var(--pm-border);
    display: grid; place-items: center;
    font-size: 11px; font-weight: 600;
    color: var(--pm-text-muted);
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
    padding: 0;
    font-family: inherit;
}
.pm-milestone-icon:hover { border-color: var(--pm-text-muted); }
.pm-milestone-remove {
    background: transparent;
    border: none;
    color: var(--pm-text-muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0;
    transition: opacity 0.1s, color 0.1s;
}
.pm-milestone-row:hover .pm-milestone-remove { opacity: 1; }
.pm-milestone-remove:hover { color: var(--pm-danger); }

.pm-resource-row-wrap {
    display: flex; align-items: center;
    padding: 0;
}
.pm-resource-row-wrap .pm-resource-row { flex: 1; }
.pm-resource-remove {
    background: transparent;
    border: none;
    color: var(--pm-text-muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0;
    transition: opacity 0.1s, color 0.1s;
}
.pm-resource-row-wrap:hover .pm-resource-remove { opacity: 1; }
.pm-resource-remove:hover { color: var(--pm-danger); }

.pm-inline-form {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-top: 8px;
    padding: 8px;
    background: var(--pm-bg);
    border: 1px solid var(--pm-border-soft);
    border-radius: var(--pm-radius);
}
.pm-inline-form .pm-input { flex: 1 1 140px; min-width: 0; }
.pm-milestone-row.is-done .pm-milestone-icon {
    background: var(--pm-accent);
    border-color: var(--pm-accent);
    color: #fff;
}
.pm-milestone-row.is-done .pm-milestone-name {
    color: var(--pm-text-dim);
    text-decoration: line-through;
}
.pm-milestone-row.is-overdue .pm-milestone-icon {
    background: var(--pm-danger);
    border-color: var(--pm-danger);
    color: #fff;
}
.pm-milestone-row.is-overdue .pm-milestone-due { color: var(--pm-danger); }
.pm-milestone-due { color: var(--pm-text-muted); font-size: 12px; }

.pm-resource-row {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--pm-text);
    text-decoration: none;
}
.pm-resource-row:hover { color: var(--pm-accent); }
.pm-resource-icon { color: var(--pm-text-muted); }

/* ============================================================
   Issue relations panel
   ============================================================ */
.pm-relations {
    margin-top: 14px;
    border-top: 1px solid var(--pm-border-soft);
    padding-top: 12px;
}
.pm-relation-group { margin-bottom: 10px; }
.pm-relation-group:last-child { margin-bottom: 0; }
.pm-relation-label {
    font-size: 11px; font-weight: 600;
    color: var(--pm-text-muted);
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.pm-relation-row {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 6px;
    border-radius: var(--pm-radius);
    cursor: pointer;
    font-size: 12px;
    color: var(--pm-text);
    transition: background 0.08s;
}
.pm-relation-row:hover { background: var(--pm-bg-hover); }
.pm-relation-title {
    flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pm-relation-remove {
    background: transparent;
    border: none;
    color: var(--pm-text-muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0;
    transition: opacity 0.1s, color 0.1s;
}
.pm-relation-row:hover .pm-relation-remove { opacity: 1; }
.pm-relation-remove:hover { color: var(--pm-danger); }

.pm-relation-form { margin-top: 8px; }
.pm-relation-form-body {
    padding: 8px;
    background: var(--pm-bg);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius);
}
.pm-relation-form-row {
    display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
    margin-bottom: 6px;
}
.pm-relation-form-row .pm-select { flex: 0 0 130px; }
.pm-relation-form-row .pm-input { flex: 1 1 160px; min-width: 0; }
.pm-relation-form-row .pm-text-btn { flex: 0 0 auto; }
.pm-relation-results {
    max-height: 320px;
    overflow-y: auto;
}
.pm-relation-result {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 6px;
    border-radius: var(--pm-radius);
    font-size: 12px;
    cursor: pointer;
    color: var(--pm-text);
}
.pm-relation-result:hover { background: var(--pm-bg-hover); }

.pm-subtasks {
    margin-top: 14px;
    border-top: 1px solid var(--pm-border-soft);
    padding-top: 12px;
}
.pm-subtask {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0;
    font-size: 12px;
    color: var(--pm-text);
    cursor: pointer;
}
.pm-subtask:hover .pm-subtask-title { color: var(--pm-accent); }

.pm-subtasks-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 6px;
}
.pm-subtasks-header .pm-comments-header { margin: 0; }
.pm-rollup-summary {
    font-size: 12px;
    color: var(--pm-text-muted);
    font-variant-numeric: tabular-nums;
}
.pm-add-subtask {
    margin-left: auto;
    background: transparent;
    color: var(--pm-text-muted);
    border: 1px solid var(--pm-border-soft);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    cursor: pointer;
}
.pm-add-subtask:hover { color: var(--pm-text); border-color: var(--pm-border); }
.pm-rollup-bar {
    height: 4px;
    background: var(--pm-border-soft);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}
.pm-rollup-bar-fill {
    height: 100%;
    background: var(--pm-accent);
    transition: width 200ms ease;
}

/* List-row badge: small "n/m" pill that lights up when rollup is complete. */
.pm-rollup-badge {
    display: inline-block;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: var(--pm-text-muted);
    background: var(--pm-border-soft);
    padding: 1px 6px;
    border-radius: 8px;
    margin: 0 6px;
}
.pm-rollup-badge.is-empty { display: none; }
.pm-rollup-badge.is-complete {
    color: #fff;
    background: var(--pm-accent);
}

/* ============================================================
   Board view
   ============================================================ */

.pm-board-grid {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    align-items: flex-start;
    min-height: 100%;
}
.pm-board-column {
    background: var(--pm-bg-elev);
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    width: 280px;
    flex-shrink: 0;
    display: flex; flex-direction: column;
    max-height: 100%;
}
.pm-board-column-header {
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--pm-text-dim);
    border-bottom: 1px solid var(--pm-border-soft);
    display: flex; align-items: center; gap: 8px;
}
.pm-board-cards {
    padding: 8px;
    display: flex; flex-direction: column; gap: 6px;
    overflow-y: auto;
}
.pm-board-card {
    background: var(--pm-bg-elev-2);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius);
    padding: 8px 10px;
    cursor: pointer;
    transition: border-color 0.1s, background 0.1s;
}
.pm-board-card:hover { border-color: var(--pm-accent); background: var(--pm-bg-hover); }
.pm-board-card-ref {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--pm-text-muted);
}
.pm-board-card-title {
    font-size: 12px;
    color: var(--pm-text);
    margin: 4px 0 6px;
    line-height: 1.3;
}
.pm-board-card-meta {
    display: flex; justify-content: space-between; align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--pm-text-muted);
}

/* ============================================================
   Modal / palette / shortcuts
   ============================================================ */

.pm-modal-host, .pm-palette-host, .pm-shortcut-host {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 20px;
    animation: pm-overlay-in 120ms ease-out;
}
.pm-palette-host { align-items: flex-start; padding-top: 80px; }

@keyframes pm-overlay-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes pm-modal-in    { from { opacity: 0; transform: translateY(6px) scale(0.98); }
                            to   { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes pm-detail-in   { from { opacity: 0; transform: translateX(8px); }
                            to   { opacity: 1; transform: translateX(0); } }
.pm-modal,
.pm-palette,
.pm-shortcuts-overlay { animation: pm-modal-in 140ms ease-out; }
.pm-detail            { animation: pm-detail-in 160ms ease-out; }

@media (prefers-reduced-motion: reduce) {
    .pm-modal-host, .pm-palette-host, .pm-shortcut-host,
    .pm-modal, .pm-palette, .pm-shortcuts-overlay, .pm-detail { animation: none; }
}

.pm-modal {
    background: var(--pm-bg-elev);
    border: 1px solid var(--pm-border);
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    /* Host is `display: grid; place-items: center`, which sizes the cell to
       its content. Use min() with the viewport so the modal actually stretches
       to ~1080px on wide screens but stays inside the viewport on narrow ones. */
    width: min(540px, calc(100vw - 40px));
    /* dvh = dynamic viewport height; accounts for mobile URL-bar show/hide.
       Fallback to vh for browsers that don't support dvh (Safari < 15.4). */
    max-height: 85vh;
    max-height: 85dvh;
    overflow: hidden;
    display: flex; flex-direction: column;
}
.pm-modal-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--pm-border-soft);
    font-weight: 600;
    display: flex; align-items: center;
    flex: 0 0 auto;
}
.pm-modal-body {
    padding: 16px 18px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    /* flex: 1 lets the body fill the remaining space between header and footer.
       min-height: 0 is mandatory in a flex column — without it, the body's
       min-height defaults to its content height, so overflow: auto would
       never engage and the content would push past the modal's max-height
       clip (chopping content + footer off the bottom on mobile). */
    flex: 1 1 auto;
    min-height: 0;
}
.pm-modal-footer {
    padding: 12px 18px;
    border-top: 1px solid var(--pm-border-soft);
    display: flex; gap: 8px; justify-content: flex-end;
    flex: 0 0 auto;
    /* Concrete minimum so the action row never collapses below the button
       height under content pressure. Without this an extremely tall body
       inside a viewport-constrained modal could squeeze the footer to
       zero in older browsers that don't honor flex-shrink: 0 here. */
    min-height: 52px;
}

/* Forms wrapping the modal's header/body/footer must themselves participate
   in the modal's flex layout. Without this the form is the modal's only
   flex child, takes its content height, and the body's overflow:auto never
   engages — so a tall body pushes the footer past the modal's max-height
   clip and the buttons disappear off the bottom on mobile. */
.pm-modal > form {
    display: flex; flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    /* Internal clip — the body's overflow:auto handles vertical scroll, but
       we don't want any sibling (header / footer) to bleed past the modal's
       rounded corners if it ever grows unexpectedly. */
    overflow: hidden;
}

/* Form picker (assignee / labels in issue form) — reuses the filter-bar
   trigger + popover pattern but stretched to fill the form row and sized
   to match the adjacent .pm-input / .pm-select controls. */
.pm-form-picker { display: block; width: 100%; }
.pm-form-picker-trigger {
    display: inline-flex; align-items: center; gap: 8px;
    width: 100%;
    max-width: none;
    padding: 6px 22px 6px 10px;
    font-size: 13px;
    text-align: left;
    min-height: 32px;
}
.pm-form-picker-avatar {
    flex: 0 0 auto;
    width: 18px; height: 18px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 10px; font-weight: 600;
}
.pm-form-picker-avatar:empty { display: none; }
/* Check column on multi-select label rows. Fixed width keeps the swatch /
   name columns aligned whether the row is checked or not. */
.pm-form-picker-check {
    flex: 0 0 14px;
    text-align: center;
    color: var(--pm-accent);
    font-weight: 700;
    font-size: 12px;
}
/* Inside the form, the popover should stretch to the trigger's full width
   so the dropdown reads as the natural expansion of the field. */
.pm-form-picker .pm-filter-popover {
    width: 100%;
    min-width: 0;
}

.pm-palette {
    background: var(--pm-bg-elev);
    border: 1px solid var(--pm-border);
    border-radius: 10px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    width: 100%;
    max-width: 600px;
    max-height: 60vh;
    overflow: hidden;
    display: flex; flex-direction: column;
}
.pm-palette-input {
    background: transparent;
    border: none;
    padding: 14px 18px;
    font-size: 14px;
    color: var(--pm-text);
    border-bottom: 1px solid var(--pm-border-soft);
    outline: none;
}
.pm-palette-results { overflow-y: auto; }
.pm-palette-row {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 18px;
    cursor: pointer;
    font-size: 13px;
}
.pm-palette-row.is-active, .pm-palette-row:hover { background: var(--pm-bg-active); }
.pm-palette-row[data-kind="header"] {
    padding: 8px 18px 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pm-text-muted);
    background: transparent;
    cursor: default;
    pointer-events: none;
}
.pm-palette-row[data-kind="header"]:hover { background: transparent; }
.pm-palette-row[data-kind="header"] .pm-palette-row-icon,
.pm-palette-row[data-kind="header"] .pm-palette-row-hint { display: none; }
.pm-palette-row-icon { color: var(--pm-text-muted); width: 18px; text-align: center; }
.pm-palette-row-label { flex: 1; color: var(--pm-text); }
.pm-palette-row-hint { font-size: 11px; color: var(--pm-text-muted); }

.pm-shortcuts {
    background: var(--pm-bg-elev);
    border: 1px solid var(--pm-border);
    border-radius: 10px;
    width: 100%;
    max-width: 480px;
    overflow: hidden;
}
.pm-shortcut-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 18px;
    border-bottom: 1px solid var(--pm-border-soft);
    font-size: 13px;
}
.pm-shortcut-row:last-child { border-bottom: none; }
.pm-shortcut-keys { display: flex; gap: 4px; }
.pm-kbd {
    display: inline-block;
    padding: 2px 6px;
    background: var(--pm-bg-elev-2);
    border: 1px solid var(--pm-border);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--pm-text);
    min-width: 18px; text-align: center;
}

/* ============================================================
   Forms
   ============================================================ */

.pm-form-row { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.pm-form-label { font-size: 11px; font-weight: 600; color: var(--pm-text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.pm-input, .pm-textarea, .pm-select {
    background: var(--pm-bg);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius);
    padding: 8px 10px;
    color: var(--pm-text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.1s;
}
.pm-input:focus, .pm-textarea:focus, .pm-select:focus { border-color: var(--pm-accent); }
.pm-input.is-invalid { border-color: var(--pm-danger); }
.pm-textarea { min-height: 80px; resize: vertical; }
.pm-form-error { font-size: 11px; color: var(--pm-danger); }
.pm-form-help { font-size: 11px; color: var(--pm-text-muted); }

.pm-form-assignees, .pm-form-labels {
    display: flex; flex-wrap: wrap; gap: 6px;
    padding: 4px 0;
}

/* Icon picker (project + team forms) — structurally identical to the
   .pm-color-chip / .pm-color-swatch pair so the same data-list binding
   path works. Only difference: inner element shows a text glyph instead
   of a colored swatch. */
.pm-form-icons {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding: 4px 0;
}
.pm-icon-chip {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 2px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.1s, background 0.1s;
}
.pm-icon-chip:hover { border-color: var(--pm-text-muted); }
.pm-icon-chip.is-selected { border-color: var(--pm-accent); }
.pm-icon-glyph {
    width: 32px; height: 32px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: var(--pm-text);
    background: var(--pm-bg);
    border-radius: 50%;
}
.pm-assignee-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 8px 3px 3px;
    border-radius: 14px;
    background: var(--pm-bg);
    border: 1px solid var(--pm-border);
    cursor: pointer;
    font-size: 12px;
    color: var(--pm-text);
    transition: border-color 0.1s, background 0.1s;
}
.pm-assignee-chip:hover { border-color: var(--pm-text-muted); }
.pm-assignee-chip.is-selected {
    border-color: var(--pm-accent);
    background: var(--pm-bg-active);
}
.pm-assignee-chip-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;
}
.pm-assignee-chip-name { font-size: 12px; }

.pm-form-labels .pm-label {
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.1s, transform 0.1s;
}
.pm-form-labels .pm-label.is-selected { opacity: 1; }
.pm-form-labels .pm-label:hover { opacity: 0.85; }
.pm-form-labels .pm-label.is-selected:hover { opacity: 1; transform: scale(1.04); }

/* ============================================================
   Bulk action bar
   ============================================================ */
.pm-bulk-bar {
    background: var(--pm-bg-elev);
    border-bottom: 1px solid var(--pm-border-soft);
    padding: 8px 20px;
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    font-size: 12px;
    color: var(--pm-text);
}
.pm-bulk-count {
    font-weight: 600;
    color: var(--pm-accent);
    margin-right: 4px;
}
.pm-bulk-spacer { flex: 1; }
.pm-bulk-delete { color: var(--pm-danger); }
.pm-bulk-delete:hover { color: var(--pm-danger); text-decoration: underline; }

/* ============================================================
   Activity feed (inbox view)
   ============================================================ */
.pm-activity-feed-row {
    display: grid;
    grid-template-columns: 28px 18px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--pm-border-soft);
    cursor: pointer;
    transition: background 0.08s;
    font-size: 13px;
    color: var(--pm-text);
}
.pm-activity-feed-row:hover { background: var(--pm-bg-hover); }
.pm-activity-feed-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 600; color: #fff;
}
.pm-activity-feed-icon { color: var(--pm-text-muted); text-align: center; }
.pm-activity-feed-line {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pm-activity-feed-who { font-weight: 600; }
.pm-activity-feed-summary { color: var(--pm-text-muted); margin: 0 4px; }
.pm-activity-feed-target { color: var(--pm-text); }
.pm-activity-feed-time {
    color: var(--pm-text-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   Toast stack
   ============================================================ */

.pm-toast-stack {
    position: fixed;
    bottom: 20px; right: 20px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 200;
}
.pm-toast {
    background: var(--pm-bg-elev);
    border: 1px solid var(--pm-border);
    border-radius: var(--pm-radius);
    padding: 10px 14px;
    min-width: 240px;
    max-width: 360px;
    display: flex; align-items: center; gap: 10px;
    font-size: 13px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.pm-toast-text { flex: 1; }
.pm-toast-action {
    color: var(--pm-accent);
    font-weight: 500;
    font-size: 12px;
}
.pm-toast.is-error { border-color: var(--pm-danger); }
.pm-toast.is-success { border-color: var(--pm-success); }
.pm-toast.is-warning { border-color: #f0a04b; }

/* ============================================================
   Activity feed
   ============================================================ */

.pm-activity {
    padding: 16px 20px;
    border-top: 1px solid var(--pm-border-soft);
    margin-top: 18px;
}
.pm-activity-row {
    font-size: 12px;
    color: var(--pm-text-dim);
    padding: 4px 0;
    display: flex; gap: 8px; align-items: center;
}
.pm-activity-row .pm-text { color: var(--pm-text); }
.pm-activity-row .pm-time { margin-left: auto; color: var(--pm-text-muted); font-size: 11px; }

/* ============================================================
   Utilities / responsive
   ============================================================ */

.pm-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--pm-text-muted);
}
.pm-empty-title { font-size: 16px; color: var(--pm-text-dim); margin-bottom: 6px; }
.pm-empty-hint { font-size: 12px; }

@media (max-width: 900px) {
    /* Sidebar and detail are lifted out of grid flow via position:fixed at
       narrow widths, so the only remaining grid child is the visible
       section. Collapse to a single column so the section gets full width
       (the prior `0 1fr` config left the section landing in column 1
       which was 0px wide, blanking the whole interface). */
    .pm-app, .pm-app.has-detail { grid-template-columns: 1fr; }
    .pm-sidebar { position: fixed; inset: 0 auto 0 0; width: var(--pm-sidebar-w); transform: translateX(-100%); transition: transform 0.2s; z-index: 50; box-shadow: 4px 0 12px rgba(0,0,0,0.2); }
    .pm-app.sidebar-open .pm-sidebar { transform: translateX(0); }
    /* Dim backdrop behind the open drawer at narrow widths. The sidebar
       carries data-event-outside on closeSidebar so any tap on the
       backdrop closes the drawer. */
    .pm-app.sidebar-open::before {
        content: '';
        position: fixed; inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 49;
        pointer-events: none;
    }
    .pm-detail { position: fixed; inset: 0 0 0 auto; width: min(100vw, 420px); border-left: 1px solid var(--pm-border); z-index: 60; }
    .pm-issue-row { grid-template-columns: 20px 24px 70px 20px 1fr auto; gap: 8px; padding: 8px 14px; }
    .pm-labels, .pm-issue-labels, .pm-due-date { display: none; }
    /* Show the hamburger toggle in the page header. */
    .pm-hamburger { display: inline-block; }

    /* Smart-view rows (Inbox / My Issues / Active / Triage). The template
       includes two empty placeholder spans for layout alignment with the
       project issue list (checkbox column + spacer before assignee). At
       narrow widths the 6-column grid plus those placeholders pushes the
       assignee badge onto a second row, and the empty leading column
       creates a visible gap between the device edge and the status icon.
       Hide the placeholders here and retemplate the grid to fit exactly
       the columns the smart-view actually renders. */
    [data-component="pm-smart-view"] .pm-issue-row {
        grid-template-columns: 24px 64px 20px 1fr auto auto;
        padding: 8px 12px;
    }
    [data-component="pm-smart-view"] .pm-issue-row > span:empty { display: none; }
}

@media (max-width: 575px) {
    /* Header reflow at narrow widths. The header carries title +
       subtitle on the left and action buttons on the right; below
       575px those two clusters start to collide. Drop the lower-
       priority "Trigger activity" + "?" buttons here, keep "Edit
       project" + "+ New issue" reachable. Subtitle goes too — the
       title alone is enough context, and the project overview tab
       carries the subtitle when present. */
    .pm-header { gap: 8px; padding: 10px 12px; }
    .pm-header-title { font-size: 18px; }
    .pm-header-subtitle { display: none; }
    .pm-header-right { flex-wrap: wrap; justify-content: flex-end; }
    .pm-header-right > button[title="Simulate another user"],
    .pm-header-right > button[title^="Keyboard shortcuts"] { display: none; }
    .pm-header-right .pm-btn-primary,
    .pm-header-right .pm-btn-secondary { padding: 6px 10px; font-size: 13px; }
}

@media (max-width: 400px) {
    /* Below 400px even Edit project must go. The project overview tab
       has its own Edit project button, so the action stays reachable
       one tap away. "+ New issue" is the one always-visible primary. */
    .pm-header-right > button[title="Edit project"],
    .pm-header-right > button[title="Edit team"] { display: none; }
}

/* ============================================================
   Members list + Profile + Teams index
   ============================================================ */
.pm-members,
.pm-teams-index { padding: 12px 24px 24px; }
.pm-members-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.pm-members-summary { font-size: 12px; color: var(--pm-text-muted); }
.pm-members-table {
    border: 1px solid var(--pm-border);
    border-radius: 6px;
    overflow: hidden;
    background: var(--pm-surface);
}
.pm-members-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr 1fr 70px;
    gap: 12px;
    padding: 10px 14px;
    align-items: center;
    border-bottom: 1px solid var(--pm-border);
    cursor: pointer;
    font-size: 13px;
}
.pm-members-row:last-child { border-bottom: none; }
.pm-members-row:hover { background: var(--pm-bg); }
.pm-members-head {
    background: var(--pm-bg);
    cursor: default;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--pm-text-muted);
}
.pm-members-head:hover { background: var(--pm-bg); }
.pm-members-cell-name { display: flex; gap: 8px; align-items: center; min-width: 0; }
.pm-members-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-members-cell-actions { display: flex; gap: 4px; justify-content: flex-end; }
.pm-members-edit, .pm-members-delete {
    color: var(--pm-text-muted);
    padding: 2px 8px;
    font-size: 16px;
    line-height: 1;
}
.pm-members-edit  { font-size: 15px; }
.pm-members-delete { font-size: 18px; }
.pm-members-edit:hover { color: var(--pm-text); }
.pm-members-delete:hover { color: var(--pm-danger, #ef4444); }
.pm-role-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    text-transform: capitalize;
    border: 1px solid var(--pm-border);
}
.pm-role-admin  { color: #f0a04b; border-color: #f0a04b; }
.pm-role-member { color: var(--pm-text); }
.pm-role-guest  { color: var(--pm-text-muted); }

.pm-member-profile { padding: 16px 24px 24px; }
.pm-profile-header {
    display: flex; gap: 14px; align-items: flex-start;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--pm-border);
    margin-bottom: 14px;
}
.pm-profile-avatar { width: 48px !important; height: 48px !important; font-size: 16px; }
.pm-profile-meta { flex: 1; min-width: 0; }
.pm-profile-name { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.pm-profile-sub  { font-size: 12px; color: var(--pm-text-muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.pm-profile-sep  { color: var(--pm-border); }
.pm-profile-teams { font-size: 12px; color: var(--pm-text-muted); margin-top: 6px; }
.pm-profile-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.pm-issue-row-flat {
    display: grid;
    grid-template-columns: 24px 70px 1fr auto;
    gap: 12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--pm-border);
    cursor: pointer;
    align-items: center;
}
.pm-issue-row-flat:hover { background: var(--pm-surface); }

/* ---- Team view ---- */
.pm-team-view { padding: 16px 24px 24px; }
.pm-team-icon {
    width: 48px !important; height: 48px !important;
    font-size: 22px !important;
    border-radius: 6px;
    display: inline-flex; align-items: center; justify-content: center;
}
.pm-team-key {
    font-size: 12px;
    color: var(--pm-text-muted);
    border: 1px solid var(--pm-border);
    border-radius: 3px;
    padding: 1px 6px;
    margin-left: 8px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pm-team-section { margin-top: 18px; }
.pm-team-section .pm-section-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--pm-text-muted);
    margin-bottom: 8px;
}
.pm-team-members { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-team-member {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--pm-border);
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    color: var(--pm-text);
    background: var(--pm-surface);
}
.pm-team-member:hover { background: var(--pm-bg); }
.pm-team-member-role { font-size: 11px; color: var(--pm-text-muted); }
.pm-team-projects { display: flex; flex-direction: column; gap: 4px; }
.pm-team-project {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--pm-border);
    border-radius: 6px;
    background: var(--pm-surface);
    text-decoration: none;
    color: var(--pm-text);
    font-size: 13px;
}
.pm-team-project:hover { background: var(--pm-bg); }
.pm-team-project-name { flex: 1; }
.pm-team-project-count { font-size: 11px; color: var(--pm-text-muted); }
.pm-empty-inline { font-size: 12px; color: var(--pm-text-muted); font-style: italic; padding: 6px 0; }

/* ---- Cycle status pills + cycle view ---- */
.pm-cycle-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    text-transform: capitalize;
    border: 1px solid var(--pm-border);
}
.pm-cycle-status-current  { color: #4cc9a3; border-color: #4cc9a3; }
.pm-cycle-status-upcoming { color: #5b8def; border-color: #5b8def; }
.pm-cycle-status-past     { color: var(--pm-text-muted); }

.pm-cycle-summary {
    display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    padding: 0 24px 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--pm-border);
    font-size: 13px;
    color: var(--pm-text-muted);
}
.pm-cycle-edit { margin-left: auto; }

.pm-cycle-burndown { padding: 0 24px; margin-bottom: 18px; }
.pm-burndown-chart {
    width: 100%; height: 180px;
    border: 1px solid var(--pm-border);
    border-radius: 6px;
    background: var(--pm-surface);
    padding: 12px;
    box-sizing: border-box;
}
.pm-burndown-legend {
    display: flex; gap: 16px;
    margin-top: 6px;
    font-size: 11px;
    color: var(--pm-text-muted);
}
.pm-burndown-key {
    display: inline-block; width: 12px; height: 2px;
    margin-right: 4px; vertical-align: middle;
}
.pm-burndown-key-ideal  { background: var(--pm-border-soft, var(--pm-border)); }
.pm-burndown-key-actual { background: var(--pm-accent); height: 8px; border-radius: 50%; width: 8px; }

.pm-cycle-group { margin-bottom: 12px; padding: 0 24px; }
.pm-cycle-group-header {
    display: flex; gap: 8px; align-items: center;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--pm-text-muted);
    margin-bottom: 6px;
}
.pm-cycle-group-count { color: var(--pm-border); }

.pm-section-header-row { display: flex; justify-content: space-between; align-items: center; }
.pm-team-cycle-link { /* inherits from .pm-team-project */ }

@media (max-width: 720px) {
    .pm-members-row {
        grid-template-columns: 1fr 1fr 60px;
        grid-template-areas:
            "name role actions"
            "teams teams teams";
    }
    .pm-members-cell-name    { grid-area: name; }
    .pm-members-cell-role    { grid-area: role; }
    .pm-members-cell-actions { grid-area: actions; }
    .pm-members-cell-teams   { grid-area: teams; font-size: 11px; color: var(--pm-text-muted); }
    .pm-members-cell-joined, .pm-members-cell-seen { display: none; }
    .pm-members-head .pm-members-cell-joined,
    .pm-members-head .pm-members-cell-seen { display: none; }
}

/* ============================================================
   pm-welcome — first-visit popup
   ============================================================
   Auto-opens on first visit, reopens via the "?" button in the sidebar
   header. Mirrors the .pm-modal-host pattern but with calmer visuals
   suited to a marketing card rather than a form modal. */

.pm-welcome-root {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    animation: pm-overlay-in 140ms ease-out;
}
.pm-welcome-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    cursor: pointer;
}
.pm-welcome-card {
    position: relative;
    background: var(--pm-bg-elev);
    border: 1px solid var(--pm-border);
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    width: min(540px, calc(100vw - 40px));
    padding: 32px 36px 28px;
    animation: pm-modal-in 180ms ease-out;
}
.pm-welcome-title {
    font-size: 22px;
    line-height: 1.3;
    font-weight: 600;
    margin: 0 0 16px;
    color: var(--pm-text);
}
.pm-welcome-body {
    font-size: 14px;
    line-height: 1.55;
    color: var(--pm-text-dim);
    margin: 0 0 12px;
}
.pm-welcome-body strong { color: var(--pm-text); font-weight: 600; }
.pm-welcome-body a      { color: var(--pm-accent); }
.pm-welcome-meta {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--pm-text-mute);
    margin: 16px 0 24px;
}
.pm-welcome-meta a { color: var(--pm-accent); }
.pm-welcome-cta {
    background: var(--pm-accent);
    color: #fff;
    border: 1px solid var(--pm-accent);
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: filter 120ms;
}
.pm-welcome-cta:hover  { filter: brightness(1.08); }
.pm-welcome-cta:focus  { outline: 2px solid var(--pm-accent); outline-offset: 2px; }

/* ---- Labels manage modal ----------------------------------------- */
.pm-labels-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.pm-labels-row {
    display: flex; align-items: center; gap: 10px;
    padding: 6px 10px;
    border: 1px solid var(--pm-border);
    border-radius: 6px;
    background: var(--pm-surface);
}
.pm-labels-name { flex: 1; font-size: 13px; }
.pm-labels-badge {
    font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--pm-text-muted);
    border: 1px solid var(--pm-border);
    border-radius: 3px;
    padding: 1px 6px;
}
.pm-labels-delete {
    color: var(--pm-text-muted);
    font-size: 18px;
    line-height: 1;
    padding: 0 6px;
}
.pm-labels-delete:hover { color: var(--pm-status-cancelled, #ef4444); }
.pm-labels-empty {
    font-size: 12px; color: var(--pm-text-muted);
    margin-bottom: 14px; font-style: italic;
}
.pm-labels-create-row { display: flex; gap: 8px; align-items: center; }
.pm-labels-create-row .pm-input { flex: 1; }
.pm-color-input {
    width: 36px; height: 32px; padding: 2px;
    border: 1px solid var(--pm-border);
    border-radius: 4px;
    background: var(--pm-surface);
    cursor: pointer;
}
/* Label filter wrapper mirrors the assignee one so the popover positions
   against the trigger button, not against the viewport. */
.pm-filter-label { position: relative; display: inline-flex; }
.pm-filter-label-trigger {
    display: inline-flex; align-items: center; gap: 6px;
    max-width: 200px;
}
/* Label-filter popover row uses a swatch (color square) in place of the
   assignee popover's avatar. */
.pm-filter-popover-row-label .pm-color-swatch {
    width: 14px; height: 14px;
}
.pm-filter-popover-name { flex: 1; }

/* Bulk-label popover: each row carries a state mark showing how the
   label is distributed across the current selection — ✓ when every
   selected issue has the label, – when some do, blank when none do.
   The user sees the converge-target before clicking: ✓ → remove from
   all, –/blank → add to all.

   Hard-sized box (no inline-flex) so the empty-content state still
   occupies the same column and the colour swatches line up across
   rows regardless of which mark glyph is showing. */
.pm-label-mark {
    box-sizing: border-box;
    flex: 0 0 14px;
    width: 14px;
    min-width: 14px;
    max-width: 14px;
    height: 14px;
    line-height: 14px;
    font-size: 11px;
    text-align: center;
    color: var(--pm-text-muted);
    overflow: hidden;
}
.pm-label-mark.is-all { color: var(--pm-accent); }
.pm-label-mark.is-some { color: var(--pm-text); }

/* "?" About button in the sidebar header. */
.pm-workspace-about {
    margin-left: 6px;
    width: 18px;
    height: 18px;
    line-height: 16px;
    text-align: center;
    border: 1px solid var(--pm-border-soft);
    border-radius: 50%;
    background: transparent;
    color: var(--pm-text-mute);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.pm-workspace-about:hover {
    color: var(--pm-text);
    border-color: var(--pm-border);
}

/* ==================== Sidebar hover tooltip ====================
   Single popover anchored next to a hovered sidebar row. Positioned
   in fixed coords (rootStyle: top/left), non-interactive so hover
   tracking stays on the row itself. Three kinds:
     .is-nav     — single-row label + optional keyboard-shortcut chip
     .is-project — title, description, progress bar, open-count line
     .is-issue   — ref + title, desc preview, status/priority/assignee
                   chips, label chips
   Positions itself with position: fixed at (row.right + 8, row.top). */
.pm-sidebar-tooltip {
    position: fixed;
    z-index: 200;
    background: var(--pm-bg-2, var(--pm-bg));
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    padding: 10px 12px;
    pointer-events: none;
    color: var(--pm-text);
    font-size: 12px;
    line-height: 1.4;
}
.pm-sidebar-tooltip.is-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
}
.pm-sidebar-tooltip.is-project,
.pm-sidebar-tooltip.is-issue {
    min-width: 240px;
    max-width: 320px;
}

.pm-tooltip-nav-label {
    font-weight: 500;
}
/* Keyboard-shortcut chip — small kbd-style box on the right. */
.pm-tooltip-shortcut {
    display: inline-block;
    min-width: 18px;
    padding: 1px 6px;
    border: 1px solid var(--pm-border);
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    color: var(--pm-text-muted);
    text-align: center;
    background: var(--pm-bg);
}

/* Project + issue tooltips share the header (icon/ref + title) and
   description preview. Per-section bits below. */
.pm-tooltip-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}
.pm-tooltip-title {
    font-weight: 600;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.pm-tooltip-ref {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: var(--pm-text-muted);
    font-size: 11px;
}
.pm-tooltip-desc {
    color: var(--pm-text-dim);
    margin-bottom: 8px;
    /* clamp to ~3 lines max */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Project progress bar. Plain track + accent fill driven inline by
   projectProgressStyle ({ width: 'NN%' }). */
.pm-tooltip-progress-bar {
    height: 4px;
    border-radius: 2px;
    background: var(--pm-bg-hover);
    overflow: hidden;
    margin: 4px 0 6px;
}
.pm-tooltip-progress-fill {
    height: 100%;
    background: var(--pm-accent, #5a7eff);
    border-radius: 2px;
}
.pm-tooltip-foot {
    display: flex;
    gap: 6px;
    color: var(--pm-text-muted);
    font-size: 11px;
}
.pm-tooltip-sep { opacity: 0.5; }

/* Issue meta row — small chips for status / priority / assignee.
   Compact spacing, no borders; the icons already convey the field. */
.pm-tooltip-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--pm-text-dim);
}
.pm-tooltip-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pm-tooltip-chip .pm-assignee-chip-avatar {
    width: 14px; height: 14px;
    font-size: 9px;
}
.pm-tooltip-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* ==================== Inline-edit cells (issue list) ====================
   Status / priority / assignee cells in the issue-list row are clickable
   triggers that open a popover anchored below the cell. The wrapper
   carries data-event-outside so clicks outside the cell close the
   popover; the inner .pm-cell-trigger has its own data-action="open*Cell".
   The trigger swallows the click so the row's selectIssue handler
   doesn't also navigate to the detail pane. */
.pm-cell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.pm-cell-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    margin: -3px;          /* keeps visual size identical to bare icon */
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.08s, box-shadow 0.08s;
}
/* Theme-independent grey overlay so the cell hover is visible even
   while the surrounding row is also hovered (the row already uses
   var(--pm-bg-hover); using the same color here would be invisible).
   The inset ring reinforces the clickable affordance. */
.pm-cell-trigger:hover {
    background: rgba(127, 127, 127, 0.18);
    box-shadow: inset 0 0 0 1px var(--pm-border);
}
.pm-cell-popover {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 30;
    min-width: 180px;
    max-height: 280px;
    overflow-y: auto;
    background: var(--pm-bg-2, var(--pm-bg));
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
/* Assignee cell sits at the right edge of the row; anchor its popover
   to the right so it stays within the viewport on narrower screens. */
.pm-cell-assignee .pm-cell-popover {
    left: auto;
    right: 0;
}
/* The popover-row reuses the same look as filter-bar / bulk-bar; this
   just normalizes the icon glyph size inside cell-popover rows so they
   align with the swatch/avatar column. */
.pm-cell-popover .pm-status-icon,
.pm-cell-popover .pm-priority-icon {
    font-size: 16px;
    width: 16px;
    text-align: center;
    transform: none;
}

