  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --bg: #0a0a0f;
    --surface: #111118;
    --surface2: #1a1a24;
    --border: #2a2a3a;
    --text: #e8e8f0;
    --muted: #666680;
    --accent-code: #7ee8a2;
    --accent-design: #e87ee8;
    --accent-review: #e8c47e;
    --accent-full: #7ebbe8;
    --accent-req: #ff9f7e;
    --accent-lead: #c4b5fd;
    --accent-arch: #86efac;
    --accent-orch: #67e8f9;
    --active: #ffffff;
  }

  body {
    font-family: 'Syne', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
  }

  /* Noise texture overlay */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
  }

  header {
    position: relative;
    z-index: 10;
    padding: 24px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
  }

  .logo {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .logo span { color: var(--text); }

  .status-bar {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    display: flex;
    gap: 20px;
  }
  .status-dot {
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent-code);
    margin-right: 6px;
    animation: pulse 2s infinite;
  }
  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
  }

  .main {
    position: relative;
    z-index: 1;
    display: flex;
    flex: 1;
    gap: 0;
  }

  /* Agent sidebar */
  .agent-nav {
    width: 280px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    padding: 32px 0;
  }

  .nav-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.2em;
    color: var(--muted);
    text-transform: uppercase;
    padding: 0 28px;
    margin-bottom: 16px;
  }

  .agent-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 28px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    position: relative;
    transition: color 0.2s;
  }

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

  .agent-btn.active {
    color: var(--active);
    background: linear-gradient(90deg, rgba(255,255,255,0.04), transparent);
  }

  .agent-btn.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 2px;
  }

  .agent-btn[data-agent="coding"].active::before { background: var(--accent-code); }
  .agent-btn[data-agent="design"].active::before { background: var(--accent-design); }
  .agent-btn[data-agent="review"].active::before { background: var(--accent-review); }
  .agent-btn[data-agent="fullstack"].active::before { background: var(--accent-full); }

  .agent-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    border: 1px solid var(--border);
    transition: border-color 0.2s;
  }

  .agent-btn[data-agent="coding"] .agent-icon { border-color: rgba(126,232,162,0.3); background: rgba(126,232,162,0.05); }
  .agent-btn[data-agent="design"] .agent-icon { border-color: rgba(232,126,232,0.3); background: rgba(232,126,232,0.05); }
  .agent-btn[data-agent="review"] .agent-icon { border-color: rgba(232,196,126,0.3); background: rgba(232,196,126,0.05); }
  .agent-btn[data-agent="fullstack"] .agent-icon { border-color: rgba(126,187,232,0.3); background: rgba(126,187,232,0.05); }

  .agent-meta { line-height: 1; }
  .agent-name { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
  .agent-tag {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    font-weight: 400;
  }

  .nav-divider {
    height: 1px;
    background: var(--border);
    margin: 24px 28px;
  }

  /* Chat area */
  .chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

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

  .agent-title {
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .agent-title h1 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  .agent-badge {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid;
    letter-spacing: 0.1em;
  }

  .badge-coding { color: var(--accent-code); border-color: rgba(126,232,162,0.4); background: rgba(126,232,162,0.06); }
  .badge-design { color: var(--accent-design); border-color: rgba(232,126,232,0.4); background: rgba(232,126,232,0.06); }
  .badge-review { color: var(--accent-review); border-color: rgba(232,196,126,0.4); background: rgba(232,196,126,0.06); }
  .badge-fullstack { color: var(--accent-full); border-color: rgba(126,187,232,0.4); background: rgba(126,187,232,0.06); }
  .badge-requirements { color: var(--accent-req); border-color: rgba(255,159,126,0.4); background: rgba(255,159,126,0.06); }
  .badge-lead { color: var(--accent-lead); border-color: rgba(196,181,253,0.4); background: rgba(196,181,253,0.06); }
  .badge-architecture { color: var(--accent-arch); border-color: rgba(134,239,172,0.4); background: rgba(134,239,172,0.06); }
  .send-btn.active-architecture { background: rgba(134,239,172,0.15); color: var(--accent-arch); }
  .agent-btn[data-agent="architecture"] .agent-icon { border-color: rgba(134,239,172,0.3); background: rgba(134,239,172,0.05); }
  .agent-btn[data-agent="architecture"].active::before { background: var(--accent-arch); }

  .clear-btn {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    background: none;
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.05em;
  }
  .clear-btn:hover { color: var(--text); border-color: var(--muted); }

  .messages {
    flex: 1;
    overflow-y: auto;
    padding: 32px 36px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scroll-behavior: smooth;
  }

  .messages::-webkit-scrollbar { width: 4px; }
  .messages::-webkit-scrollbar-track { background: transparent; }
  .messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

  .empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    padding: 60px;
  }

  .empty-icon {
    font-size: 40px;
    opacity: 0.3;
    margin-bottom: 8px;
  }

  .empty-state h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--muted);
  }

  .empty-state p {
    font-size: 13px;
    color: var(--muted);
    max-width: 320px;
    line-height: 1.6;
    opacity: 0.7;
  }

  .suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
  }

  .suggestion-chip {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
  }
  .suggestion-chip:hover { color: var(--text); border-color: var(--muted); }

  /* Messages */
  .message {
    display: flex;
    gap: 14px;
    animation: fadeIn 0.3s ease;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .message.user { flex-direction: row-reverse; }

  .msg-avatar {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    border: 1px solid var(--border);
  }

  .msg-avatar.user-av {
    background: var(--surface2);
    color: var(--muted);
  }

  .msg-bubble {
    max-width: 72%;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.7;
    border: 1px solid var(--border);
  }

  .message.user .msg-bubble {
    background: var(--surface2);
    border-color: var(--border);
    color: var(--text);
    border-radius: 12px 4px 12px 12px;
  }

  .message.assistant .msg-bubble {
    background: var(--surface);
    border-radius: 4px 12px 12px 12px;
    color: var(--text);
  }

  .msg-bubble pre {
    background: #0d0d16;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    overflow-x: auto;
    margin: 10px 0;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    line-height: 1.6;
  }

  .msg-bubble code {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    background: #0d0d16;
    padding: 2px 6px;
    border-radius: 4px;
  }

  .msg-bubble pre code {
    background: none;
    padding: 0;
  }

  .msg-bubble p { margin-bottom: 8px; }
  .msg-bubble p:last-child { margin-bottom: 0; }

  .msg-bubble strong { font-weight: 700; }

  .typing-indicator {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 16px 18px;
  }
  .typing-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--muted);
    animation: typingBounce 1.2s infinite;
  }
  .typing-dot:nth-child(2) { animation-delay: 0.2s; }
  .typing-dot:nth-child(3) { animation-delay: 0.4s; }
  @keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
  }

  /* Input area */
  .input-area {
    padding: 20px 36px 28px;
    border-top: 1px solid var(--border);
  }

  .input-wrap {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    transition: border-color 0.2s;
  }

  .input-wrap:focus-within {
    border-color: var(--muted);
  }

  textarea {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text);
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    max-height: 160px;
    min-height: 24px;
  }

  textarea::placeholder { color: var(--muted); }

  .send-btn {
    width: 36px; height: 36px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.2s;
    background: var(--surface2);
    color: var(--muted);
  }

  .send-btn:not(:disabled):hover {
    color: var(--text);
    background: var(--border);
  }

  .send-btn:disabled { opacity: 0.3; cursor: not-allowed; }

  .send-btn.active-coding { background: rgba(126,232,162,0.15); color: var(--accent-code); }
  .send-btn.active-design { background: rgba(232,126,232,0.15); color: var(--accent-design); }
  .send-btn.active-review { background: rgba(232,196,126,0.15); color: var(--accent-review); }
  .send-btn.active-fullstack { background: rgba(126,187,232,0.15); color: var(--accent-full); }
  .send-btn.active-requirements { background: rgba(255,159,126,0.15); color: var(--accent-req); }
  .send-btn.active-lead { background: rgba(196,181,253,0.15); color: var(--accent-lead); }

  .agent-btn[data-agent="requirements"] .agent-icon { border-color: rgba(255,159,126,0.3); background: rgba(255,159,126,0.05); }
  .agent-btn[data-agent="requirements"].active::before { background: var(--accent-req); }
  .agent-btn[data-agent="lead"] .agent-icon { border-color: rgba(196,181,253,0.3); background: rgba(196,181,253,0.05); }
  .agent-btn[data-agent="lead"].active::before { background: var(--accent-lead); }

  /* Task breakdown cards */
  .task-breakdown {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
  }

  .task-card {
    border-radius: 10px;
    border: 1px solid var(--border);
    overflow: hidden;
    animation: fadeIn 0.3s ease both;
  }

  .task-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface2);
    cursor: pointer;
    user-select: none;
  }

  .task-agent-pill {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid;
    letter-spacing: 0.08em;
    flex-shrink: 0;
  }

  .pill-coding { color: var(--accent-code); border-color: rgba(126,232,162,0.4); background: rgba(126,232,162,0.08); }
  .pill-design { color: var(--accent-design); border-color: rgba(232,126,232,0.4); background: rgba(232,126,232,0.08); }
  .pill-review { color: var(--accent-review); border-color: rgba(232,196,126,0.4); background: rgba(232,196,126,0.08); }
  .pill-fullstack { color: var(--accent-full); border-color: rgba(126,187,232,0.4); background: rgba(126,187,232,0.08); }

  .task-title {
    font-size: 13px;
    font-weight: 700;
    flex: 1;
    color: var(--text);
  }

  .task-priority {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--muted);
  }

  .task-body {
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--text);
    border-top: 1px solid var(--border);
    background: var(--surface);
  }

  .task-body p { margin-bottom: 6px; }
  .task-body p:last-child { margin-bottom: 0; }

  .task-send-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.05em;
  }
  .task-send-btn:hover { color: var(--text); border-color: var(--muted); }

  /* Stack selector */
  .stack-section { padding: 12px 20px 16px; }
  .stack-grid { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
  .stack-btn {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 10px; border-radius: 7px;
    background: none; border: 1px solid transparent;
    cursor: pointer; text-align: left; transition: all 0.15s;
    font-family: 'Syne', sans-serif; width: 100%;
  }
  .stack-btn:hover { background: var(--surface2); border-color: var(--border); }
  .stack-btn.active {
    background: rgba(103,232,249,0.1);
    border-color: rgba(103,232,249,0.4);
    box-shadow: inset 3px 0 0 var(--accent-orch);
  }
  .stack-btn.active .stack-name { color: var(--accent-orch); }
  .stack-icon { font-size: 16px; width: 22px; flex-shrink: 0; text-align: center; }
  .stack-name { font-size: 12px; font-weight: 700; color: var(--text); line-height: 1.3; }
  .stack-subtitle { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--muted); line-height: 1.4; }

  /* Orchestrator */
  .badge-orchestrator { color: var(--accent-orch); border-color: rgba(103,232,249,0.4); background: rgba(103,232,249,0.06); }
  .send-btn.active-orchestrator { background: rgba(103,232,249,0.15); color: var(--accent-orch); }
  .agent-btn[data-agent="orchestrator"] .agent-icon { border-color: rgba(103,232,249,0.3); background: rgba(103,232,249,0.05); }
  .agent-btn[data-agent="orchestrator"].active::before { background: var(--accent-orch); }

  /* Loop timeline */
  .loop-panel { display: flex; flex-direction: column; gap: 0; padding: 24px 36px; overflow-y: auto; flex: 1; scroll-behavior: smooth; }
  .loop-panel::-webkit-scrollbar { width: 4px; }
  .loop-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

  .loop-step {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    animation: fadeIn 0.3s ease;
    position: relative;
  }
  .loop-step:last-child { border-bottom: none; }

  .step-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    border: 1px solid var(--border);
  }

  .step-content { flex: 1; min-width: 0; }

  .step-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
  }

  .step-label {
    font-weight: 700;
    font-size: 13px;
  }

  .step-status {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid var(--border);
  }
  .step-status.running { color: var(--accent-orch); border-color: rgba(103,232,249,0.3); animation: pulse 1.5s infinite; }
  .step-status.done    { color: var(--accent-code); border-color: rgba(126,232,162,0.3); }
  .step-status.failed  { color: #ff7e7e; border-color: rgba(255,126,126,0.3); }
  .step-status.waiting { color: var(--muted); }
  .step-status.paused  { color: var(--accent-review); border-color: rgba(232,196,126,0.3); }

  .step-detail {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    line-height: 1.6;
  }

  .step-detail a { color: var(--accent-full); text-decoration: none; }
  .step-detail a:hover { text-decoration: underline; }

  .loop-controls {
    padding: 16px 36px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
  }

  .loop-btn {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    padding: 7px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface2);
    color: var(--muted);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.04em;
  }
  .loop-btn:hover:not(:disabled) { color: var(--text); border-color: var(--muted); }
  .loop-btn:disabled { opacity: 0.35; cursor: not-allowed; }
  .loop-btn.primary { background: rgba(103,232,249,0.1); color: var(--accent-orch); border-color: rgba(103,232,249,0.3); }
  .loop-btn.primary:hover:not(:disabled) { background: rgba(103,232,249,0.18); }
  .loop-btn.danger { color: #ff7e7e; border-color: rgba(255,126,126,0.3); }
  .loop-btn.retry { color: var(--accent-review); border-color: rgba(232,196,126,0.4); background: rgba(232,196,126,0.06); }
  .loop-btn.skip  { color: var(--muted); }

  .loop-meta {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    margin-left: auto;
  }

  .issue-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
  }
  .issue-input-row input {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 12px;
    color: var(--text);
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    outline: none;
    width: 120px;
    transition: border-color 0.2s;
  }
  .issue-input-row input:focus { border-color: var(--accent-orch); }
  .issue-input-row input::placeholder { color: var(--muted); opacity: 0.6; }

  /* PR card */
  .pr-card {
    margin-top: 12px;
    border: 1px solid rgba(126,232,162,0.3);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(126,232,162,0.04);
  }
  .pr-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(126,232,162,0.07);
  }
  .pr-card-title {
    font-size: 13px;
    font-weight: 700;
    flex: 1;
    color: var(--text);
  }
  .pr-card-body {
    padding: 10px 14px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
  .pr-file-row {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .pr-file-op {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    flex-shrink: 0;
  }
  .pr-file-op.create { background: rgba(126,232,162,0.2); color: var(--accent-code); }
  .pr-file-op.modify { background: rgba(126,187,232,0.2); color: var(--accent-full); }
  .pr-file-op.delete { background: rgba(255,126,126,0.2); color: #ff7e7e; }
  .pr-status-working {
    color: var(--accent-review);
    animation: pulse 1.5s infinite;
  }

  /* Zip download card */
  .zip-card {
    margin-top: 12px;
    border: 1px solid rgba(103,232,249,0.3);
    border-radius: 10px;
    overflow: hidden;
    background: rgba(103,232,249,0.04);
  }
  .zip-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(103,232,249,0.07);
  }
  .zip-card-body {
    padding: 10px 14px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .issue-preview {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    font-size: 13px;
  }
  .issue-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .issue-number {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--accent-full);
  }
  .issue-title-text {
    font-weight: 700;
    flex: 1;
  }
  .issue-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--muted);
  }
  .issue-body-preview {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .issue-meta {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    display: flex;
    gap: 12px;
  }

  .input-hint {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    margin-top: 10px;
    opacity: 0.6;
  }

  /* API Key modal */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,10,15,0.85);
    backdrop-filter: blur(6px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 40px;
    width: 440px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .modal-logo {
    font-size: 28px;
    margin-bottom: 4px;
  }

  .modal h2 {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  .modal p {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.6;
  }

  .modal p a {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  .modal-input-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .modal-label {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.15em;
    color: var(--muted);
    text-transform: uppercase;
  }

  .modal-input {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 14px;
    color: var(--text);
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
  }

  .modal-input:focus { border-color: var(--muted); }
  .modal-input::placeholder { color: var(--muted); opacity: 0.5; }

  .modal-submit {
    background: var(--text);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-family: 'Syne', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
    letter-spacing: 0.02em;
  }
  .modal-submit:hover { opacity: 0.85; }

  .modal-note {
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    color: var(--muted);
    opacity: 0.6;
    text-align: center;
  }

  /* Key indicator in header */
  .key-indicator {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s;
  }
  .key-indicator:hover { border-color: var(--border); color: var(--text); }
  .key-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent-review);
  }
  .key-dot.connected { background: var(--accent-code); }


  /* Polling indicator */
  .key-dot.polling { background: var(--accent-design); animation: pulse 1.5s infinite; }
  .key-dot.poll-error { background: var(--accent-review); animation: none; }

  /* PR notification toast */
  #pr-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 200;
    display: none;
    flex-direction: column;
    gap: 8px;
    max-width: 340px;
  }

  .toast-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 16px;
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    color: var(--text);
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: toastIn 0.25s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .toast-card:hover { border-color: var(--muted); }

  .toast-title {
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .toast-sub { color: var(--muted); font-size: 11px; }

  .toast-badge {
    font-size: 10px;
    padding: 1px 7px;
    border-radius: 10px;
    border: 1px solid rgba(232,126,232,0.4);
    color: var(--accent-design);
    background: rgba(232,126,232,0.08);
    margin-left: auto;
  }

  .toast-badge.agent-studio {
    border-color: rgba(126,232,162,0.4);
    color: var(--accent-code);
    background: rgba(126,232,162,0.08);
  }

  @keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* Changelog modal */
  .changelog-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; animation: fadeIn 0.15s ease;
  }
  .changelog-overlay.hidden { display: none; }
  .changelog-modal {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; width: 480px; max-width: 92vw;
    max-height: 80vh; display: flex; flex-direction: column; overflow: hidden;
  }
  .changelog-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 22px 14px; border-bottom: 1px solid var(--border);
  }
  .changelog-title { font-size: 15px; font-weight: 700; letter-spacing: 0.02em; }
  .changelog-close {
    background: none; border: 1px solid var(--border); border-radius: 6px;
    color: var(--muted); cursor: pointer; font-size: 14px;
    padding: 3px 9px; transition: all 0.15s;
  }
  .changelog-close:hover { color: var(--text); border-color: var(--muted); }
  .changelog-body { overflow-y: auto; padding: 16px 22px 20px; flex: 1; }
  .changelog-body::-webkit-scrollbar { width: 4px; }
  .changelog-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
  .cl-version { margin-bottom: 18px; }
  .cl-version:last-child { margin-bottom: 0; }
  .cl-version-header { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
  .cl-version-num {
    font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 700;
    color: var(--accent-orch); background: rgba(103,232,249,0.08);
    border: 1px solid rgba(103,232,249,0.25); border-radius: 5px; padding: 2px 9px;
  }
  .cl-version-label { font-size: 12px; font-weight: 700; color: var(--text); }
  .cl-version-date { font-family: 'DM Mono', monospace; font-size: 10px; color: var(--muted); margin-left: auto; }
  .cl-items { list-style: none; display: flex; flex-direction: column; gap: 4px; }
  .cl-items li {
    font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted);
    padding-left: 14px; position: relative; line-height: 1.5;
  }
  .cl-items li::before { content: '·'; position: absolute; left: 3px; color: var(--accent-orch); }

  /* Passphrase save toggle */
  .save-creds-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 0 2px;
  }
  .save-creds-row input[type=checkbox] { width: 14px; height: 14px; cursor: pointer; }
  .save-creds-row label {
    font-family: 'DM Mono', monospace; font-size: 11px;
    color: var(--muted); cursor: pointer; user-select: none;
  }
  .passphrase-row { margin-top: 2px; }
  /* Dev log panel */
  .devlog-overlay {
    position: fixed; inset: 0; z-index: 200;
    pointer-events: none;
  }
  .devlog-panel {
    position: fixed; right: 0; top: 0; bottom: 0;
    width: 520px; max-width: 95vw;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex; flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    pointer-events: all;
    z-index: 201;
  }
  .devlog-panel.open { transform: translateX(0); }
  .devlog-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .devlog-title { font-family: 'DM Mono', monospace; font-size: 12px; font-weight: 700; color: var(--text); flex: 1; }
  .devlog-controls { display: flex; align-items: center; gap: 8px; }
  .devlog-btn {
    font-family: 'DM Mono', monospace; font-size: 10px;
    padding: 3px 9px; border-radius: 5px;
    border: 1px solid var(--border); background: none;
    color: var(--muted); cursor: pointer; transition: all 0.15s;
  }
  .devlog-btn:hover { color: var(--text); border-color: var(--muted); }
  .devlog-btn.active { color: var(--accent-code); border-color: rgba(126,232,162,0.4); background: rgba(126,232,162,0.08); }
  .devlog-filters {
    display: flex; flex-wrap: wrap; gap: 5px;
    padding: 8px 16px; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .devlog-filter {
    font-family: 'DM Mono', monospace; font-size: 10px;
    padding: 2px 8px; border-radius: 10px;
    border: 1px solid var(--border); background: none;
    color: var(--muted); cursor: pointer; transition: all 0.15s;
  }
  .devlog-filter.on { color: var(--text); border-color: var(--muted); background: var(--surface2); }
  .devlog-body { flex: 1; overflow-y: auto; padding: 8px 0; }
  .devlog-body::-webkit-scrollbar { width: 4px; }
  .devlog-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
  .devlog-entry {
    border-bottom: 1px solid var(--border);
    font-family: 'DM Mono', monospace; font-size: 11px;
  }
  .devlog-entry-header {
    display: flex; align-items: center; gap: 8px;
    padding: 7px 16px; cursor: pointer; user-select: none;
    transition: background 0.1s;
  }
  .devlog-entry-header:hover { background: var(--surface2); }
  .devlog-agent { font-weight: 700; }
  .devlog-type { color: var(--muted); font-size: 10px; }
  .devlog-ts { color: var(--muted); font-size: 10px; margin-left: auto; }
  .devlog-chevron { color: var(--muted); font-size: 10px; transition: transform 0.15s; }
  .devlog-entry.expanded .devlog-chevron { transform: rotate(90deg); }
  .devlog-content {
    display: none; padding: 0 16px 12px;
    white-space: pre-wrap; word-break: break-all;
    color: var(--muted); font-size: 10px; line-height: 1.6;
    max-height: 400px; overflow-y: auto;
  }
  .devlog-entry.expanded .devlog-content { display: block; }
  .devlog-empty { padding: 24px 16px; color: var(--muted); font-family: 'DM Mono', monospace; font-size: 11px; text-align: center; }
  #devlog-toggle {
    font-family: 'DM Mono', monospace; font-size: 10px;
    padding: 2px 9px; border-radius: 5px;
    border: 1px solid var(--border); background: none;
    color: var(--muted); cursor: pointer; transition: all 0.15s;
  }
  #devlog-toggle:hover { color: var(--text); border-color: var(--muted); }
  #devlog-toggle.has-logs { color: var(--accent-review); border-color: rgba(232,196,126,0.4); }

