    :root {
      --bg: #F4F7F5;
      --bg-elev: #FFFFFF;
      --bg-sunken: #ECF2EF;
      --bg-hover: #E7F0EC;
      --bg-active: #DDE9E4;
      --border: #DCE6E1;
      --border-strong: #C7D6CF;
      --text: #18181B;
      --text-muted: #5F6C67;
      --text-faint: #8B9892;
      --accent: oklch(0.58 0.13 174);
      --accent-hover: oklch(0.52 0.14 174);
      --accent-soft: oklch(0.94 0.045 174);
      --accent-text: oklch(0.39 0.12 174);
      --accent-warm: oklch(0.74 0.15 72);
      --accent-warm-soft: oklch(0.96 0.05 72);
      --accent-blue: oklch(0.62 0.12 235);
      --accent-blue-soft: oklch(0.95 0.035 235);
      --pastel-mint: #F0FAF5;
      --pastel-sky: #EFF8FC;
      --pastel-amber: #FFF7E8;
      --pastel-lilac: #F7F2FF;
      --pastel-rose: #FFF1F3;
      --sidebar-bg: #14231F;
      --sidebar-bg-2: #1C312A;
      --sidebar-line: rgba(209, 235, 222, 0.14);
      --sidebar-text: #F2F8F5;
      --sidebar-muted: #A8BBB2;
      --s-backlog: #9A9A95;
      --s-todo: #6B6B6B;
      --s-progress: oklch(0.65 0.14 75);
      --s-review: oklch(0.62 0.13 195);
      --s-done: oklch(0.62 0.14 150);
      --s-cancel: #B8B6B0;
      --t-bug: oklch(0.58 0.16 25);
      --t-feature: oklch(0.55 0.13 295);
      --t-chore: #6B6B6B;
      --p-high: oklch(0.58 0.16 25);
      --p-med: oklch(0.62 0.13 75);
      --p-low: #9A9A95;
      --radius: 6px;
      --radius-sm: 4px;
      --radius-lg: 10px;
      --shadow-sm: 0 1px 2px rgba(24, 45, 38, 0.06);
      --shadow-md: 0 8px 24px rgba(24, 45, 38, 0.10), 0 1px 3px rgba(24, 45, 38, 0.05);
      --shadow-lg: 0 18px 48px rgba(20, 40, 33, 0.16), 0 2px 8px rgba(20, 40, 33, 0.06);
      --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
    }

    * { box-sizing: border-box; }
    body {
      font-family: var(--font-sans);
      font-size: 13px;
      line-height: 1.45;
      color: var(--text);
      background: var(--bg);
      -webkit-font-smoothing: antialiased;
      margin: 0;
      height: 100vh;
      overflow: hidden;
    }
    ::selection { background: var(--accent-soft); color: var(--accent-text); }
    .app { display: flex; height: 100vh; overflow: hidden; }

    /* ── Sidebar ── */
    .sidebar {
      width: 232px; flex-shrink: 0;
      background: var(--sidebar-bg);
      border-right: 1px solid rgba(255,255,255,0.08);
      box-shadow: inset -1px 0 0 rgba(0,0,0,0.16);
      display: flex; flex-direction: column;
      overflow-y: auto;
      transition: width 0.18s ease;
    }
    .sidebar.collapsed { width: 48px; }
    .sidebar.collapsed .sb-label,
    .sidebar.collapsed .sb-count,
    .sidebar.collapsed .sb-cycle,
    .sidebar.collapsed .sb-search,
    .sidebar.collapsed .sb-section-title,
    .sidebar.collapsed .sb-foot .btn,
    .sidebar.collapsed .sb-user span:not(.sb-avatar),
    .sidebar.collapsed .sb-title { display: none; }
    .sidebar.collapsed .sb-item { justify-content: center; padding: 6px; }
    .sidebar.collapsed .sb-header { justify-content: center; padding: 10px 4px; }
    .sidebar.collapsed .sb-section { padding: 6px 4px 2px; }
    .sidebar.collapsed .sb-foot { padding: 6px 4px; display: flex; flex-direction: column; align-items: center; }
    .sidebar.collapsed .sb-user { justify-content: center; }
    .sb-header { padding: 14px 14px 10px; display: flex; align-items: center; gap: 8px; }
    .sb-title { color: var(--sidebar-text); font-weight: 650; font-size: 13px; letter-spacing: -0.01em; padding: 2px 0; }
    .sb-search {
      margin: 4px 10px 14px; display: flex; align-items: center; gap: 6px;
      padding: 6px 8px; background: rgba(255,255,255,0.08);
      border: 1px solid var(--sidebar-line); border-radius: var(--radius);
      color: var(--sidebar-muted); cursor: pointer; transition: border-color 0.12s, background 0.12s;
    }
    .sb-search:hover { background: rgba(255,255,255,0.12); border-color: rgba(209,235,222,0.26); }
    .sb-search .kbd { margin-left: auto; }

    .kbd {
      display: inline-flex; align-items: center; justify-content: center;
      min-width: 16px; height: 16px; padding: 0 4px;
      border-radius: 3px; background: var(--bg-active);
      border: 1px solid var(--border); color: var(--text-muted);
      font-size: 10.5px; font-family: var(--font-mono); font-weight: 500;
      white-space: nowrap;
    }
    .sidebar .kbd { background: rgba(255,255,255,0.10); border-color: var(--sidebar-line); color: var(--sidebar-muted); }

    .sb-cycle {
      margin: 0 10px 10px; padding: 10px 12px;
      background: rgba(255,255,255,0.08); border: 1px solid var(--sidebar-line);
      border-radius: var(--radius); cursor: pointer; transition: border-color 0.12s, background 0.12s;
    }
    .sb-cycle:hover { background: rgba(255,255,255,0.12); border-color: rgba(209,235,222,0.26); }
    .sb-cycle-card-edit { width: 18px; height: 18px; padding: 0; display: grid; place-items: center; color: var(--text-faint); background: none; border: none; border-radius: 3px; cursor: pointer; opacity: 0; transition: opacity 0.1s; }
    .sb-cycle:hover .sb-cycle-card-edit { opacity: 1; }
    .sb-cycle-card-edit:hover { background: rgba(255,255,255,0.12); color: var(--sidebar-text); }
    .sb-cycle-label { display: flex; align-items: center; justify-content: space-between; font-size: 11px; color: var(--sidebar-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
    .sb-cycle-name { color: var(--sidebar-text); font-weight: 600; margin-top: 4px; font-size: 13px; }
    .sb-cycle-progress { margin-top: 8px; height: 3px; background: rgba(255,255,255,0.13); border-radius: 2px; overflow: hidden; }
    .sb-cycle-progress-fill { height: 100%; background: var(--accent-warm); transition: width 0.3s; }
    .sb-cycle-stats { display: flex; justify-content: space-between; font-size: 11px; color: var(--sidebar-muted); margin-top: 6px; font-variant-numeric: tabular-nums; }

    .sb-section { padding: 8px 10px 4px; }
    .sb-section-title {
      display: flex; align-items: center; justify-content: space-between;
      padding: 4px 8px; font-size: 11px; font-weight: 600; color: var(--sidebar-muted);
      text-transform: uppercase; letter-spacing: 0.04em;
    }
    .sb-section-title button { color: var(--sidebar-muted); width: 18px; height: 18px; display: grid; place-items: center; border-radius: 3px; background: none; border: none; cursor: pointer; }
    .sb-section-title button:hover { background: rgba(255,255,255,0.10); color: var(--sidebar-text); }

    .sb-item {
      display: flex; align-items: center; gap: 8px;
      padding: 5px 8px; border-radius: var(--radius-sm);
      color: var(--sidebar-text); width: 100%; text-align: left;
      font-size: 13px; background: none; border: none; cursor: pointer;
    }
    .sb-item:hover { background: rgba(255,255,255,0.10); }
    .sb-item.active { background: rgba(108, 203, 177, 0.18); box-shadow: inset 2px 0 0 var(--accent-warm); font-weight: 600; }
    .sb-item .sb-icon { width: 14px; flex: 0 0 14px; color: var(--sidebar-muted); display: grid; place-items: center; }
    .sb-item .sb-count { margin-left: auto; color: var(--sidebar-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
    .sb-item .sb-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }

    .sb-cycle-row { position: relative; }
    .sb-cycle-row .sb-cycle-edit { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; padding: 0; display: grid; place-items: center; color: var(--sidebar-muted); background: none; border: none; border-radius: 3px; cursor: pointer; opacity: 0; transition: opacity 0.1s; }
    .sb-cycle-row:hover .sb-cycle-edit { opacity: 1; }
    .sb-cycle-row .sb-cycle-edit:hover { background: rgba(255,255,255,0.10); color: var(--sidebar-text); }
    .sb-cycle-row-now { margin-left: auto; font-size: 10px; color: #14231F; background: var(--accent-warm); padding: 1px 5px; border-radius: 3px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

    .sb-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--sidebar-line); background: rgba(0,0,0,0.08); }
    .sb-user { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--radius-sm); cursor: pointer; }
    .sb-user { color: var(--sidebar-text); }
    .sb-user:hover { background: rgba(255,255,255,0.10); }
    .sb-avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--accent-warm); color: #14231F; display: grid; place-items: center; font-weight: 700; font-size: 11px; }
    .sidebar .btn-secondary { background: rgba(255,255,255,0.08); border-color: var(--sidebar-line); color: var(--sidebar-text); }
    .sidebar .btn-secondary:hover { background: rgba(255,255,255,0.13); border-color: rgba(209,235,222,0.28); }
    .sidebar .btn-ghost,
    .sidebar .btn-icon { color: var(--sidebar-muted); }
    .sidebar .btn-ghost:hover,
    .sidebar .btn-icon:hover { background: rgba(255,255,255,0.10); color: var(--sidebar-text); }

    /* ── Main ── */
    .main { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); min-width: 0; }
    #content-area { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

    .topbar {
      height: 48px; border-bottom: 1px solid var(--border);
      display: flex; align-items: center; padding: 0 18px; gap: 12px;
      background: rgba(255,255,255,0.82); flex-shrink: 0;
      backdrop-filter: blur(12px);
    }
    .crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; }
    .crumbs .crumb-sep { color: var(--text-faint); }
    .crumbs .crumb { color: var(--text-muted); cursor: pointer; }
    .crumbs .crumb:hover { color: var(--text); }
    .crumbs .crumb.active { color: var(--text); font-weight: 500; }

    .topbar-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
    .view-tabs { display: flex; align-items: center; gap: 2px; padding: 2px; background: var(--bg-sunken); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(255,255,255,0.7); }
    .view-tabs button { padding: 4px 10px; border-radius: 4px; font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; font-weight: 500; background: none; border: none; cursor: pointer; }
    .view-tabs button.active { background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-sm); }
    .view-tabs button:not(.active):hover { color: var(--text); }

    .btn { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius); font-weight: 500; font-size: 12.5px; border: 1px solid transparent; transition: background 0.1s, border-color 0.1s; white-space: nowrap; cursor: pointer; }
    .btn-primary { background: var(--accent); color: white; }
    .btn-primary:hover { background: var(--accent-hover); }
    .btn-secondary { background: var(--bg-elev); border-color: var(--border); color: var(--text); }
    .btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }
    .btn-ghost { color: var(--text-muted); padding: 5px 8px; border-color: transparent; background: none; }
    .btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
    .btn-icon { width: 28px; height: 28px; padding: 0; display: grid; place-items: center; color: var(--text-muted); border-radius: var(--radius); background: none; border: none; cursor: pointer; }
    .btn-icon:hover { background: var(--bg-hover); color: var(--text); }

    /* ── Filter bar ── */
    .filterbar { display: flex; align-items: center; gap: 6px; padding: 8px 18px; border-bottom: 1px solid var(--border); background: rgba(248,250,249,0.86); flex-shrink: 0; font-size: 12.5px; }
    .filterchip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 7px; border-radius: var(--radius); border: 1px dashed var(--border-strong); color: var(--text-muted); font-size: 12px; cursor: pointer; background: none; }
    .filterchip:hover { background: var(--bg-hover); color: var(--text); border-color: var(--text-faint); }
    .filterchip.applied { border-style: solid; border-color: var(--border-strong); background: var(--bg-elev); color: var(--text); }
    .filter-spacer { flex: 1; }
    .filter-summary { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; }

    /* ── Board ── */
    .board { flex: 1; min-height: 0; overflow: auto; padding: 14px 18px 18px; }
    .board-cols { display: flex; gap: 12px; height: 100%; align-items: stretch; }
    .col { flex: 1 1 280px; min-width: 280px; max-width: 380px; display: flex; flex-direction: column; min-height: 0; background: rgba(255,255,255,0.46); border: 1px solid rgba(220,230,225,0.82); border-radius: var(--radius-lg); padding: 8px 6px 0; box-shadow: inset 0 1px 0 rgba(255,255,255,0.8); }
    .col-head { display: flex; align-items: center; gap: 8px; padding: 4px 8px 10px; font-size: 12px; font-weight: 650; letter-spacing: -0.005em; }
    .col-head .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
    .col-head .count { color: var(--text-faint); font-weight: 500; font-variant-numeric: tabular-nums; }
    .col-actions { margin-left: auto; display: flex; gap: 0; opacity: 0; transition: opacity 0.1s; }
    .col:hover .col-actions { opacity: 1; }
    .col-add { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 4px; color: var(--text-muted); background: none; border: none; cursor: pointer; }
    .col-add:hover { background: var(--bg-active); color: var(--text); }
    .col-body { display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; padding: 0 4px 8px; }

    .card {
      background: var(--bg-elev); border: 1px solid var(--border);
      border-radius: var(--radius); padding: 10px 11px;
      cursor: pointer; transition: border-color 0.1s, box-shadow 0.1s, transform 0.1s;
      box-shadow: 0 1px 0 rgba(255,255,255,0.85);
    }
    .card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
    .card.done { opacity: 0.7; }
    .card.cancel { opacity: 0.55; }
    .card.cancel .card-title { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--text-muted); }
    .card-cancel-tag { display: inline-flex; align-items: center; padding: 1px 5px; border-radius: 3px; font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; background: var(--bg-sunken); color: var(--text-muted); border: 1px solid var(--border); margin-left: 4px; }
    .card-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
    .card-id { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); letter-spacing: -0.01em; }
    .card-type { display: inline-flex; width: 14px; height: 14px; border-radius: 3px; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: white; }
    .card-type.bug { background: var(--t-bug); }
    .card-type.feature { background: var(--t-feature); }
    .card-type.chore { background: var(--t-chore); }
    .card-prio { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; }
    .prio-bars { display: inline-flex; gap: 1.5px; align-items: flex-end; }
    .prio-bars span { width: 2.5px; border-radius: 1px; }
    .prio-bars .b1 { height: 4px; }
    .prio-bars .b2 { height: 7px; }
    .prio-bars .b3 { height: 10px; }
    .card-prio.high .prio-bars span { background: var(--p-high); }
    .card-prio.medium .prio-bars .b1, .card-prio.medium .prio-bars .b2 { background: var(--p-med); }
    .card-prio.medium .prio-bars .b3 { background: var(--bg-active); }
    .card-prio.low .prio-bars .b1 { background: var(--p-low); }
    .card-prio.low .prio-bars .b2, .card-prio.low .prio-bars .b3 { background: var(--bg-active); }
    .card-prio.none .prio-bars span { background: var(--bg-active); }
    .card-prio.urgent { color: var(--p-high); }

    .card-title { font-size: 13px; font-weight: 500; color: var(--text); margin: 2px 0 8px; letter-spacing: -0.005em; }
    .card-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); }
    .card-meta .meta-tag { display: inline-flex; align-items: center; gap: 4px; }
    .card-meta .meta-tag .tag-dot { width: 6px; height: 6px; border-radius: 50%; }
    .card-meta .meta-spacer { flex: 1; }
    .card-empty { padding: 16px 8px; text-align: center; color: var(--text-faint); font-size: 12px; border: 1px dashed var(--border); border-radius: var(--radius); }

    .card-quickadd { display: flex; flex-direction: column; gap: 6px; padding: 10px; background: var(--bg-elev); border: 1px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
    .card-quickadd input { border: none; outline: none; width: 100%; padding: 0; font-size: 13px; background: transparent; }
    .card-quickadd-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-muted); }

    .card-placeholder { background: var(--accent-soft); border: 1.5px dashed var(--accent); border-radius: var(--radius); height: 90px; }

    /* ── List view ── */
    .list-view { flex: 1; overflow: auto; padding: 0 18px 18px; }
    .list-group { margin-top: 16px; }
    .list-group-head { display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--border); }
    .list-group-head .count { color: var(--text-faint); font-weight: 500; font-variant-numeric: tabular-nums; }
    .list-row { display: grid; grid-template-columns: 18px 16px 76px 1fr auto auto auto auto; align-items: center; gap: 12px; padding: 8px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
    .list-row:hover { background: var(--bg-hover); }
    .list-row .row-id { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
    .list-row .row-title { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .list-row.done .row-title { text-decoration: line-through; opacity: 0.6; }
    .list-row .row-proj { color: var(--text-muted); font-size: 12px; }
    .list-row .row-comments { color: var(--text-muted); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 20px; }
    .list-row .row-date { color: var(--text-faint); font-size: 11px; font-variant-numeric: tabular-nums; min-width: 50px; text-align: right; }

    /* ── Panel (slide-over) ── */
    .panel-overlay { position: fixed; inset: 0; background: rgba(20,20,20,0.18); z-index: 1050; }
    .panel {
      position: fixed; top: 12px; right: 12px; bottom: 12px;
      width: min(720px, calc(100vw - 24px));
      background: var(--bg-elev); border: 1px solid var(--border);
      border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
      z-index: 1051; display: flex; flex-direction: column; overflow: hidden;
      animation: slideIn 0.18s ease-out;
    }
    @keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
    .panel-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
    .panel-head .pid { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
    .panel-head-actions { margin-left: auto; display: flex; gap: 4px; }
    .panel-body { flex: 1; overflow-y: auto; padding: 16px 22px 12px; }
    .panel-title { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; margin: 4px 0 14px; width: 100%; border: none; outline: none; background: transparent; resize: none; color: var(--text); line-height: 1.3; }
    .panel-props { display: grid; grid-template-columns: 90px 1fr; gap: 10px 14px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 12.5px; }
    .panel-prop-label { color: var(--text-muted); display: flex; align-items: center; gap: 6px; font-size: 12px; }
    .panel-prop-value { display: flex; align-items: center; gap: 6px; }
    .prop-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--radius-sm); background: var(--bg-sunken); border: 1px solid var(--border); font-size: 12px; cursor: pointer; }

    .panel-section { margin-top: 18px; }
    .panel-section-title { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
    .panel-desc { font-size: 13.5px; line-height: 1.55; color: var(--text); cursor: text; }
    .panel-desc.empty { color: var(--text-faint); font-style: italic; cursor: pointer; }
    #panel-desc-wrap { position: relative; }
    .panel-desc-edit { position: absolute; top: 0; right: 0; opacity: 0; transition: opacity 0.15s; }
    #panel-desc-wrap:hover .panel-desc-edit { opacity: 1; }
    /* Rendered markdown — keep tight to match the panel scale */
    .panel-desc p { margin: 0 0 0.6em; }
    .panel-desc p:last-child { margin-bottom: 0; }
    .panel-desc h1, .panel-desc h2, .panel-desc h3, .panel-desc h4 { font-weight: 600; margin: 0.8em 0 0.4em; line-height: 1.3; }
    .panel-desc h1 { font-size: 17px; }
    .panel-desc h2 { font-size: 15px; }
    .panel-desc h3, .panel-desc h4 { font-size: 13.5px; }
    .panel-desc ul, .panel-desc ol { margin: 0 0 0.6em; padding-left: 22px; }
    .panel-desc li { margin: 0.15em 0; }
    .panel-desc code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--bg-sunken); padding: 1px 5px; border-radius: 3px; }
    .panel-desc pre { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; overflow-x: auto; margin: 0 0 0.6em; }
    .panel-desc pre code { background: none; padding: 0; font-size: 12px; }
    .panel-desc blockquote { margin: 0 0 0.6em; padding: 0 0 0 12px; border-left: 3px solid var(--border); color: var(--text-muted); }
    .panel-desc a { color: var(--accent-text); text-decoration: underline; }
    .panel-desc table { border-collapse: collapse; margin: 0 0 0.6em; }
    .panel-desc th, .panel-desc td { border: 1px solid var(--border); padding: 4px 8px; font-size: 12.5px; }

    .comments { display: flex; flex-direction: column; gap: 16px; }
    .comment { display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
    .comment-avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 11px; color: white; background: var(--text-muted); flex-shrink: 0; }
    .comment-avatar.agent { background: linear-gradient(135deg, var(--accent), oklch(0.55 0.16 295)); }
    .comment-body { min-width: 0; }
    .comment-head { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
    .comment-author { font-weight: 600; color: var(--text); }
    .comment-author .agent-tag { display: inline-block; margin-left: 5px; padding: 1px 5px; font-size: 9.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent-text); border-radius: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
    .comment-time { color: var(--text-faint); font-size: 11px; }
    .comment-text { font-size: 13px; color: var(--text); margin-top: 3px; line-height: 1.5; }
    .comment-text p { margin: 0 0 0.5em; }
    .comment-text p:last-child { margin-bottom: 0; }
    .comment-text ul, .comment-text ol { margin: 0 0 0.5em; padding-left: 20px; }
    .comment-text code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; background: var(--bg-sunken); padding: 1px 4px; border-radius: 3px; }
    .comment-text pre { background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; overflow-x: auto; margin: 0 0 0.5em; }
    .comment-text pre code { background: none; padding: 0; }
    .comment-text a { color: var(--accent-text); text-decoration: underline; }
    .comment-pr { margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; color: var(--text); }
    .pr-status { margin-left: 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; padding: 1px 5px; border-radius: 3px; }
    .pr-status.merged { background: oklch(0.94 0.06 295); color: oklch(0.45 0.16 295); }
    .pr-status.open { background: oklch(0.95 0.06 150); color: oklch(0.4 0.14 150); }
    .pr-status.closed { background: var(--bg-sunken); color: var(--text-muted); }

    .attachment-drop { border: 1px dashed transparent; border-radius: var(--radius); padding: 4px; transition: background 0.1s, border-color 0.1s; }
    .attachment-drop.drag-over { border-color: var(--accent); background: var(--accent-soft); }
    .attachment-item { display: grid; grid-template-columns: 18px 1fr auto 24px; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius); }
    .attachment-item:hover { background: var(--bg-sunken); }
    .attachment-icon { color: var(--text-muted); }
    .attachment-name { font-size: 13px; color: var(--text); text-decoration: none; font-weight: 500; }
    .attachment-name:hover { text-decoration: underline; color: var(--accent-text); }
    .attachment-meta { font-size: 11px; color: var(--text-faint); white-space: nowrap; }

    .comments .comment, .comments .activity-event { margin-bottom: 14px; }
    .activity-event { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: center; }
    .activity-avatar { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 9px; color: white; background: var(--text-faint); flex-shrink: 0; }
    .activity-line { font-size: 12px; color: var(--text-muted); display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
    .activity-line .activity-author { font-weight: 600; color: var(--text); }
    .activity-line .activity-text { color: var(--text-muted); }
    .activity-line .activity-text code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; background: var(--bg-sunken); padding: 1px 5px; border-radius: 3px; color: var(--text); }
    .activity-line .activity-text em { color: var(--text-faint); font-style: italic; }
    .activity-line .activity-time { color: var(--text-faint); font-size: 11px; margin-left: auto; }

    .composer { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); transition: border-color 0.1s; }
    .composer:focus-within { border-color: var(--text-faint); background: var(--bg-elev); }
    .composer textarea { width: 100%; border: none; outline: none; resize: none; padding: 10px 12px; background: transparent; font-size: 13px; line-height: 1.5; min-height: 44px; font-family: inherit; }
    .composer-actions { display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; border-top: 1px solid var(--border); }
    .composer-actions .hint { color: var(--text-faint); font-size: 11px; margin-right: auto; }

    /* ── Projects page ── */
    .projects-page { flex: 1; overflow: auto; padding: 24px 24px 32px; }
    .projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-top: 18px; }
    .project-card {
      border: 1px solid var(--border); background: rgba(255,255,255,0.82);
      border-radius: var(--radius-lg); padding: 16px 18px 14px;
      display: flex; flex-direction: column; gap: 10px;
      position: relative; overflow: hidden;
      box-shadow: var(--shadow-sm);
      transition: border-color 0.1s, box-shadow 0.1s, transform 0.1s;
    }
    .project-card:nth-child(5n+1) { background: linear-gradient(180deg, var(--pastel-mint), rgba(255,255,255,0.92)); border-color: #CFE7DA; }
    .project-card:nth-child(5n+2) { background: linear-gradient(180deg, var(--pastel-sky), rgba(255,255,255,0.92)); border-color: #CBE2EA; }
    .project-card:nth-child(5n+3) { background: linear-gradient(180deg, var(--pastel-amber), rgba(255,255,255,0.92)); border-color: #ECDDBF; }
    .project-card:nth-child(5n+4) { background: linear-gradient(180deg, var(--pastel-lilac), rgba(255,255,255,0.92)); border-color: #DDD3EF; }
    .project-card:nth-child(5n) { background: linear-gradient(180deg, var(--pastel-rose), rgba(255,255,255,0.92)); border-color: #EBCDD3; }
    .project-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: rgba(0,0,0,0.05); }
    .project-card:nth-child(5n+1)::before { background: #8DD7B3; }
    .project-card:nth-child(5n+2)::before { background: #8CCFE7; }
    .project-card:nth-child(5n+3)::before { background: #F0C46A; }
    .project-card:nth-child(5n+4)::before { background: #C7ADEA; }
    .project-card:nth-child(5n)::before { background: #F1A9B6; }
    .project-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
    .project-card-head { display: flex; align-items: flex-start; gap: 10px; }
    .project-mark { width: 28px; height: 28px; border-radius: var(--radius); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 600; font-size: 13px; color: white; flex-shrink: 0; }
    .project-name { font-weight: 600; font-size: 14px; letter-spacing: -0.005em; }
    .project-path { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 1px; }
    .project-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
    .project-stats { display: flex; gap: 16px; padding-top: 8px; border-top: 1px solid rgba(95,108,103,0.16); font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
    .project-stats strong { color: var(--text); font-weight: 600; margin-right: 4px; }
    .project-instructions { background: rgba(255,255,255,0.62); border: 1px solid rgba(95,108,103,0.14); border-radius: var(--radius); padding: 8px 10px; font-family: var(--font-mono); font-size: 11.5px; line-height: 1.55; color: var(--text); white-space: pre-wrap; max-height: 100px; overflow: hidden; position: relative; box-shadow: inset 0 1px 0 rgba(255,255,255,0.72); }
    .project-instructions::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 24px; background: linear-gradient(transparent, rgba(255,255,255,0.86)); }
    .project-instructions-label { font-size: 11px; font-weight: 500; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
    #new-project-overlay .cmd,
    #edit-project-overlay .cmd { background: linear-gradient(180deg, var(--pastel-mint), #FFFFFF 42%); border-color: #CFE7DA; }
    #new-project-overlay .form-control,
    #edit-project-overlay .form-control { background-color: rgba(255,255,255,0.78); border-color: rgba(95,108,103,0.18) !important; }
    #new-project-overlay .form-control:focus,
    #edit-project-overlay .form-control:focus { background-color: #FFFFFF; border-color: var(--accent) !important; box-shadow: 0 0 0 2px var(--accent-soft); }

    .page-header { display: flex; align-items: flex-end; justify-content: space-between; padding: 8px 0 14px; border-bottom: 1px solid var(--border); }
    .page-header h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
    .page-header .sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

    /* ── Command palette ── */
    .cmd-overlay { position: fixed; inset: 0; background: rgba(20,35,31,0.36); z-index: 2000; display: grid; place-items: start center; padding-top: 14vh; backdrop-filter: blur(2px); }
    .cmd { width: min(560px, 92vw); background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
    .cmd-input { width: 100%; border: none; outline: none; padding: 14px 18px; font-size: 14px; background: transparent; border-bottom: 1px solid var(--border); font-family: inherit; }
    .cmd-list { max-height: 40vh; overflow-y: auto; padding: 6px; }
    .cmd-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius); font-size: 13px; cursor: pointer; }
    .cmd-row.sel { background: var(--bg-active); }
    .cmd-row .cmd-id { font-family: var(--font-mono); color: var(--text-faint); font-size: 11px; }
    .cmd-row .cmd-meta { margin-left: auto; color: var(--text-faint); font-size: 11px; }

    /* -- Personal capture -- */
    .capture-modal { padding: 18px; width: min(620px, 92vw); }
    .capture-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
    .capture-head h3 { font-size: 16px; font-weight: 600; margin: 0 0 4px; }
    .capture-sub { color: var(--text-muted); font-size: 12.5px; }
    .capture-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .capture-card {
      display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
      min-height: 74px; padding: 12px;
      background: rgba(255,255,255,0.9); border: 1px solid var(--border);
      border-radius: var(--radius); color: var(--text); text-align: left;
      cursor: pointer; box-shadow: 0 1px 0 rgba(255,255,255,0.8);
    }
    .capture-card:hover { background: var(--bg-hover); border-color: var(--border-strong); }
    .capture-card-title { font-size: 13px; font-weight: 600; }
    .capture-card-meta { color: var(--text-muted); font-size: 12px; line-height: 1.35; }
    @media (max-width: 640px) {
      .capture-grid { grid-template-columns: 1fr; }
    }

    /* -- Personal setup -- */
    .setup-page { flex: 1; overflow: auto; padding: 24px 24px 32px; }
    .setup-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.85fr); gap: 14px; margin-top: 18px; }
    .setup-panel {
      background: rgba(255,255,255,0.86); border: 1px solid var(--border);
      border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm);
    }
    .setup-panel-wide { grid-row: span 2; }
    .setup-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
    .setup-panel-head h3 { margin: 0; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
    .setup-panel-head span { color: var(--text-faint); font-size: 12px; font-variant-numeric: tabular-nums; }
    .setup-list { display: flex; flex-direction: column; gap: 8px; }
    .setup-row { padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(244,247,245,0.72); display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 0.55fr); gap: 12px; align-items: start; }
    .setup-row-title { font-weight: 600; font-size: 13px; margin-bottom: 3px; }
    .setup-row-path { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); overflow-wrap: anywhere; }
    .setup-row-note { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
    .setup-tools { display: flex; flex-direction: column; gap: 8px; }
    .setup-tool { padding-bottom: 8px; border-bottom: 1px solid var(--border); }
    .setup-tool:last-child { border-bottom: none; padding-bottom: 0; }
    .setup-tool-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
    .setup-tool-name { font-weight: 600; font-size: 13px; }
    .setup-badge { padding: 1px 6px; border-radius: 3px; font-size: 10.5px; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); white-space: nowrap; }
    .setup-tool-detail { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
    .setup-rules { margin: 0; padding-left: 18px; color: var(--text); }
    .setup-rules li { margin-bottom: 8px; line-height: 1.45; }
    .setup-edit-modal { padding: 18px; width: min(780px, 94vw); }
    .agent-edit-modal { width: min(900px, 94vw); }
    .setup-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .setup-edit-grid label { display: flex; flex-direction: column; gap: 5px; color: var(--text-muted); font-size: 12px; font-weight: 500; }
    .setup-edit-grid textarea { width: 100%; resize: vertical; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; font-family: var(--font-mono); font-size: 12px; line-height: 1.5; color: var(--text); background: var(--bg); outline: none; }
    .setup-edit-grid textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); background: var(--bg-elev); }
    .setup-edit-full { grid-column: 1 / -1; }
    @media (max-width: 820px) {
      .setup-layout, .setup-edit-grid, .setup-row { grid-template-columns: 1fr; }
      .setup-panel-wide { grid-row: auto; }
    }

    /* -- Today dashboard -- */
    .today-page { flex: 1; overflow: auto; padding: 24px 24px 32px; }
    .today-stats { display: grid; grid-template-columns: repeat(4, minmax(140px, 1fr)); gap: 10px; margin-top: 18px; }
    .today-stat { background: rgba(255,255,255,0.88); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
    .today-stat::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--accent); }
    .today-stat:nth-child(2)::before { background: var(--accent-blue); }
    .today-stat:nth-child(3)::before { background: var(--accent-warm); }
    .today-stat:nth-child(4)::before { background: var(--s-review); }
    .today-stat span { display: block; font-size: 24px; line-height: 1; font-weight: 650; letter-spacing: -0.02em; }
    .today-stat label { display: block; margin-top: 6px; color: var(--text-muted); font-size: 12px; }
    .today-layout { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr); gap: 14px; margin-top: 14px; }
    .today-panel { background: rgba(255,255,255,0.86); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); }
    .today-main { grid-column: 1; }
    .today-actions { margin: 0; padding-left: 20px; }
    .today-actions li { margin-bottom: 8px; font-weight: 500; }
    .today-ticket-list { display: flex; flex-direction: column; gap: 7px; }
    .today-ticket { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left; width: 100%; padding: 10px 11px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(244,247,245,0.72); color: var(--text); cursor: pointer; }
    .today-ticket:hover { border-color: var(--border-strong); background: var(--bg-hover); }
    .today-ticket-id { font-family: var(--font-mono); color: var(--text-faint); font-size: 11px; }
    .today-ticket-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .today-ticket-meta { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
    .today-empty { color: var(--text-faint); font-size: 12.5px; padding: 10px 0; }
    .run-log { display: flex; flex-direction: column; gap: 9px; }
    .run-log-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 9px; align-items: start; padding: 0 0 9px; border-bottom: 1px solid var(--border); }
    .run-log-row:last-child { border-bottom: none; padding-bottom: 0; }
    .run-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 5px; }
    .run-title { font-weight: 650; font-size: 12.5px; }
    .run-title span { color: var(--text-muted); font-weight: 500; }
    .run-detail { color: var(--text-muted); font-size: 12px; line-height: 1.4; margin-top: 2px; }
    .run-log-row time { color: var(--text-faint); font-size: 11px; white-space: nowrap; }
    @media (max-width: 900px) {
      .today-stats, .today-layout, .today-ticket { grid-template-columns: 1fr; }
      .today-main { grid-column: auto; }
    }

    /* -- Agent command center -- */
    .agents-page { flex: 1; overflow: auto; padding: 24px 24px 32px; }
    .agents-hero {
      margin-top: 18px; padding: 18px 20px; border: 1px solid rgba(20,35,31,0.12);
      border-radius: var(--radius-lg); background: var(--sidebar-bg);
      color: var(--sidebar-text); box-shadow: var(--shadow-md);
      display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
    }
    .agents-kicker { color: var(--accent-warm); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 5px; }
    .agents-hero h2 { font-size: 20px; line-height: 1.25; font-weight: 650; max-width: 560px; margin: 0; }
    .agents-hero-stats { display: flex; gap: 10px; color: var(--sidebar-muted); font-size: 12px; white-space: nowrap; }
    .agents-hero-stats span { padding: 6px 8px; border-radius: var(--radius); background: rgba(255,255,255,0.08); border: 1px solid var(--sidebar-line); }
    .agents-hero-stats strong { color: var(--sidebar-text); font-size: 14px; margin-right: 3px; }
    .agents-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr); gap: 14px; margin-top: 14px; }
    .agents-section { background: rgba(255,255,255,0.86); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; box-shadow: var(--shadow-sm); }
    .agents-main { grid-column: 1; }
    .agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
    .agent-card { display: flex; flex-direction: column; gap: 10px; padding: 13px; background: rgba(244,247,245,0.76); border: 1px solid var(--border); border-top: 3px solid var(--accent); border-radius: var(--radius); min-height: 180px; box-shadow: 0 1px 0 rgba(255,255,255,0.85); }
    .agent-card:nth-child(2n) { border-top-color: var(--accent-blue); }
    .agent-card:nth-child(3n) { border-top-color: var(--accent-warm); }
    .agent-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
    .agent-name { font-weight: 650; font-size: 13.5px; }
    .agent-lane { color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }
    .agent-status { padding: 1px 6px; border-radius: 3px; background: var(--accent-soft); color: var(--accent-text); font-size: 10.5px; font-weight: 650; white-space: nowrap; }
    .agent-mission { color: var(--text-muted); font-size: 12.5px; line-height: 1.45; flex: 1; }
    .agent-tools { display: flex; flex-wrap: wrap; gap: 5px; }
    .agent-tools span { padding: 2px 6px; border-radius: 3px; background: var(--bg-sunken); color: var(--text-muted); border: 1px solid var(--border); font-size: 10.5px; }
    .agent-action { justify-content: center; }
    .lane-grid { display: flex; flex-direction: column; gap: 8px; }
    .lane-card { padding: 10px 11px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(244,247,245,0.72); }
    .lane-name { font-size: 12.5px; font-weight: 650; margin-bottom: 3px; }
    .lane-use { color: var(--text-muted); font-size: 12px; line-height: 1.4; }
    .integration-list { display: flex; flex-direction: column; gap: 7px; }
    .integration-row { display: grid; grid-template-columns: minmax(0, 1fr) 88px 86px; gap: 10px; align-items: center; padding: 10px 11px; border: 1px solid var(--border); border-radius: var(--radius); background: rgba(244,247,245,0.72); }
    .integration-name { font-weight: 650; font-size: 12.5px; margin-bottom: 2px; }
    .integration-impact { color: var(--text-muted); font-size: 12px; line-height: 1.35; }
    .integration-group, .integration-status { justify-self: end; color: var(--text-muted); background: var(--bg-sunken); border: 1px solid var(--border); border-radius: 3px; padding: 2px 6px; font-size: 10.5px; white-space: nowrap; }
    .integration-status { color: var(--accent-text); background: var(--accent-soft); border-color: transparent; font-weight: 650; }
    @media (max-width: 900px) {
      .agents-hero, .agents-hero-stats { align-items: flex-start; flex-direction: column; }
      .agents-layout { grid-template-columns: 1fr; }
      .agents-main { grid-column: auto; }
      .integration-row { grid-template-columns: 1fr; }
      .integration-group, .integration-status { justify-self: start; }
    }

    /* ── SVG icons ── */
    .svg-icon { flex-shrink: 0; }

    /* ── Utilities ── */
    .dot-backlog { background: var(--s-backlog); }
    .dot-todo { border: 1.5px solid var(--s-todo); background: transparent; }
    .dot-progress { background: var(--s-progress); }
    .dot-review { background: var(--s-review); }
    .dot-done { background: var(--s-done); }
    .dot-cancel { background: var(--s-cancel); }

    .status-color-backlog { color: var(--s-backlog); }
    .status-color-todo { color: var(--s-todo); }
    .status-color-progress { color: var(--s-progress); }
    .status-color-review { color: var(--s-review); }
    .status-color-done { color: var(--s-done); }
    .status-color-cancel { color: var(--s-cancel); }

    .spinner { width: 12px; height: 12px; border: 1.5px solid var(--bg-active); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
    @keyframes spin { to { transform: rotate(360deg); } }

    ::-webkit-scrollbar { width: 10px; height: 10px; }
    ::-webkit-scrollbar-thumb { background: transparent; border-radius: 5px; }
    *:hover::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); }
    ::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.15) !important; }
    ::-webkit-scrollbar-track { background: transparent; }

    /* ── Login ── */
    .login-overlay { position: fixed; inset: 0; background: var(--sidebar-bg); z-index: 3000; display: grid; place-items: center; }
    .login-card { width: min(380px, 90vw); background: var(--bg-elev); border: 1px solid rgba(255,255,255,0.16); border-radius: var(--radius-lg); padding: 32px 28px 24px; box-shadow: var(--shadow-lg); }
    .login-card h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 6px; }
    .login-card .sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
    .login-card .field { margin-bottom: 14px; }
    .login-card label { font-size: 12px; font-weight: 500; color: var(--text-muted); display: block; margin-bottom: 4px; }
    .login-card input { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; font-family: inherit; outline: none; }
    .login-card input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
    .login-error { color: var(--p-high); font-size: 12px; margin-bottom: 10px; display: none; }

    /* ── Filter dropdown ── */
    .filterchip-wrap { position: relative; }
    .filter-drop {
      position: absolute; top: 100%; left: 0; margin-top: 4px;
      min-width: 140px; background: var(--bg-elev);
      border: 1px solid var(--border); border-radius: var(--radius);
      box-shadow: var(--shadow-md); z-index: 500; padding: 4px;
    }
    .filter-drop-item {
      display: block; width: 100%; text-align: left; padding: 5px 8px;
      border-radius: var(--radius-sm); font-size: 12.5px; color: var(--text);
      background: none; border: none; cursor: pointer;
    }
    .filter-drop-item:hover { background: var(--bg-hover); }
    .filter-drop-item.sel { background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }

    /* ── Profile ── */
    .profile-page { flex: 1; overflow: auto; padding: 24px 24px 32px; max-width: 600px; }
    .profile-section { background: rgba(255,255,255,0.86); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; margin-bottom: 16px; box-shadow: var(--shadow-sm); }
    .profile-section h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 12px; }
    .token-box { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg-sunken); border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font-mono); font-size: 12.5px; word-break: break-all; }
    .token-box button { flex-shrink: 0; }

    /* ── Relationships ── */
    .rel-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
    .rel-type-badge { display: inline-block; padding: 1px 6px; border-radius: 3px; font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: white; white-space: nowrap; }
    .rel-type-related { background: var(--text-muted); }
    .rel-type-blocks { background: var(--p-high); }
    .rel-type-blocked_by { background: oklch(0.62 0.13 195); }
    .rel-ticket-link { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
    .rel-ticket-name { flex: 1; font-weight: 500; color: var(--text); cursor: pointer; }
    .rel-ticket-name:hover { color: var(--accent-text); }
    .rel-status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
    .rel-remove { width: 20px; height: 20px; color: var(--text-faint); display: grid; place-items: center; border-radius: 4px; background: none; border: none; cursor: pointer; }
    .rel-remove:hover { background: var(--bg-hover); color: var(--p-high); }
    .add-rel-form { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
    .add-rel-form input { flex: 1; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 12.5px; font-family: inherit; outline: none; }
    .add-rel-form input:focus { border-color: var(--accent); }
    .add-rel-form select { padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 12.5px; font-family: inherit; }
    .rel-search-results { margin-top: 4px; max-height: 160px; overflow-y: auto; }
    .rel-search-item { display: flex; align-items: center; gap: 8px; padding: 4px 8px; cursor: pointer; border-radius: var(--radius-sm); font-size: 12.5px; }
    .rel-search-item:hover { background: var(--bg-hover); }
    .rel-section-head { display: flex; align-items: center; justify-content: space-between; }
    .rel-section-head button { font-size: 11px; padding: 2px 8px; }
    .rel-empty { color: var(--text-faint); font-size: 12.5px; padding: 8px 0; }
