    :root {
      --bg: #fbfbfd;
      --surface: #ffffff;
      --surface-2: #fbfbff;
      --line: #e5e2ef;
      --text: #26233a;
      --muted: #7b7890;
      --green: #3bbf84;
      --yellow: #d7a317;
      --red: #d64545;
      --blue: #3973e6;
      --accent: #7762d9;
      --orange: #ff5a1f;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      color: var(--text);
      background: var(--bg);
    }
    * { box-sizing: border-box; }
    body { margin: 0; height: 100vh; overflow: hidden; background: #f7f7fb; }
    button, input, textarea { font: inherit; }
    button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; padding: 7px 10px; cursor: pointer; }
    button:hover { border-color: #aab8b0; background: #f9fbfa; }
    .app { height: 100vh; display: grid; grid-template-rows: 78px minmax(0, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); box-shadow: 0 16px 50px rgba(31, 27, 62, 0.12); }
    .topbar { display: grid; grid-template-columns: 300px minmax(280px, 1fr) 300px; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,0.9); padding: 0 28px; }
    .topbar.hide-session-actions .top-actions { display: none; }
    .logo { display: flex; align-items: center; gap: 14px; font-weight: 800; font-size: 24px; color: #29263d; }
    .book-icon { width: 34px; height: 34px; position: relative; display: inline-block; color: var(--accent); flex: 0 0 auto; }
    .book-icon::before, .book-icon::after { content: ""; position: absolute; top: 3px; bottom: 3px; width: 15px; border: 2px solid currentColor; background: #fff; }
    .book-icon::before { left: 1px; border-radius: 4px 1px 1px 4px; transform: skewY(2deg); }
    .book-icon::after { right: 1px; border-radius: 1px 4px 4px 1px; transform: skewY(-2deg); }
    .book-icon.small { width: 28px; height: 28px; color: #4c7ee8; }
    .book-icon.small::before, .book-icon.small::after { border-width: 2px; top: 4px; bottom: 4px; width: 12px; }
    .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); display: inline-block; }
    .search { display: none; }
    .top-actions { display: flex; align-items: center; justify-content: center; gap: 20px; grid-column: 2; }
    .session-badge { font: 16px ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid var(--line); border-radius: 8px; padding: 12px 20px; color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: linear-gradient(180deg, #fff, #fbfbff); display: inline-flex; align-items: center; gap: 12px; }
    #newSessionBtn { border-color: #ffb191; color: var(--orange); font-weight: 650; padding: 12px 20px; }
    .avatar { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 10px 10px; color: #4e4b63; margin-top: auto; background: #fff; }
    .avatar-dot { width: 34px; height: 34px; border-radius: 50%; background: #ede8ff; color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; border: 1px solid #ddd3ff; }
    .auth-screen { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; background: #f7f7fb; padding: 24px; }
    .auth-screen.active { display: flex; }
    .auth-card { width: min(420px, 100%); border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 18px 50px rgba(31, 27, 62, 0.12); padding: 26px; display: grid; gap: 16px; }
    .auth-title { font-size: 26px; font-weight: 800; }
    .auth-card input { width: 100%; border: 1px solid #d8d2ea; border-radius: 9px; padding: 12px 14px; }
    .auth-error { color: var(--red); font-size: 13px; min-height: 18px; }
    .logout-btn { margin-top: 8px; width: 100%; color: var(--muted); }
    .shell { min-height: 0; display: grid; grid-template-columns: 220px 300px minmax(0, 1fr) 360px; transition: grid-template-columns 160ms ease; }
    .shell.nav-collapsed { grid-template-columns: 76px 300px minmax(0, 1fr) 360px; }
    .shell:not(.show-notebook-panel) { grid-template-columns: 220px 0 minmax(0, 1fr) 0; }
    .shell.nav-collapsed:not(.show-notebook-panel) { grid-template-columns: 76px 0 minmax(0, 1fr) 0; }
    .sidebar { grid-column: 1; }
    .notebook-panel { grid-column: 2; }
    .main { grid-column: 3; }
    .right { grid-column: 4; }
    .sidebar { border-right: 1px solid var(--line); background: linear-gradient(180deg, #fff, #fdfcff); padding: 42px 18px 22px; overflow: visible; display: flex; flex-direction: column; min-width: 0; position: relative; }
    .collapse-btn { position: absolute; right: -15px; top: 50%; transform: translateY(-50%); z-index: 4; width: 30px; height: 58px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: #fff; border-color: var(--line); border-radius: 999px; box-shadow: 0 8px 22px rgba(31, 27, 62, 0.10); }
    .collapse-btn:hover { border-color: #cfc8e8; background: #fbfbff; color: var(--accent); }
    .nav-item, .notebook-item { width: 100%; display: flex; align-items: center; gap: 14px; border: 0; text-align: left; margin-bottom: 10px; color: #2f2d41; font-size: 16px; padding: 14px 12px; border-radius: 10px; }
    .nav-item.active { background: #fff1eb; color: #c9370a; font-weight: 700; }
    .nav-item span:first-child { width: 18px; text-align: center; color: currentColor; }
    .nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .shell.nav-collapsed .sidebar { padding: 42px 12px 22px; }
    .shell.nav-collapsed .nav-text, .shell.nav-collapsed .avatar span:not(.avatar-dot) { display: none; }
    .shell.nav-collapsed .nav-item { justify-content: center; padding: 14px 0; }
    .shell.nav-collapsed .nav-item span:first-child { width: auto; }
    .shell.nav-collapsed .avatar { justify-content: center; padding: 8px; }
    .notebook-panel { border-right: 1px solid var(--line); background: #fff; padding: 24px 16px; overflow: auto; min-width: 0; }
    .shell:not(.show-notebook-panel) .notebook-panel { display: none; }
    .shell:not(.show-notebook-panel) .right { display: none; }
    .section-label { margin: 0 6px 16px; color: var(--muted); font-size: 16px; font-weight: 700; text-transform: none; }
    .new-notebook-btn { width: calc(100% - 12px); margin: 4px 6px 16px; border-color: #ffb191; color: var(--orange); font-weight: 650; padding: 12px; }
    .notebook-item { padding: 14px 16px; border: 1px solid transparent; }
    .notebook-item.active { background: #f6f2ff; font-weight: 700; border-color: #e5dcff; box-shadow: 0 8px 22px rgba(119, 98, 217, 0.08); }
    .notebook-count { display: block; color: var(--muted); font-size: 13px; font-weight: 400; margin-top: 3px; }
    .notebook-item .book-icon { color: var(--accent); }
    .notebook-item:nth-child(2n) .book-icon { color: var(--blue); }
    .notebook-item:nth-child(3n) .book-icon { color: #d63f8f; }
    .notebook-item:nth-child(4n) .book-icon { color: #239b60; }
    .notebook-item:nth-child(5n) .book-icon { color: #f18b00; }
    .session-panel { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 18px; }
    .session-item { width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 12px; margin-bottom: 10px; text-align: left; color: var(--text); display: grid; gap: 8px; }
    .session-item.active { border-color: #d8ccff; background: #f7f3ff; box-shadow: 0 8px 20px rgba(119, 98, 217, 0.08); }
    .session-row { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
    .session-title { font-weight: 750; font-size: 14px; overflow-wrap: anywhere; }
    .session-actions { display: inline-flex; gap: 4px; flex: 0 0 auto; }
    .session-actions button { width: 26px; height: 26px; padding: 0; border: 0; background: transparent; color: var(--muted); }
    .session-actions button:hover { color: var(--accent); background: #f4f1ff; }
    .session-meta { color: var(--muted); font-size: 12px; }
    .session-empty { color: var(--muted); font-size: 13px; padding: 10px 6px; line-height: 1.4; }
    .status-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
    .ok { background: var(--green); }
    .warn { background: var(--yellow); }
    .conflict { background: var(--red); }
    .conflict-label { margin-left: auto; color: var(--red); font-size: 11px; }
    .main { min-width: 0; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); background: #fcfcff; }
    .app-view { grid-area: 1 / 1; min-height: 0; min-width: 0; overflow: auto; }
    .app-view:not(.active) { display: none !important; }
    .app-view.active { display: block; }
    .app-view.active.chat-scroll { display: grid; }
    .notebook-header { border: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; gap: 22px; padding: 30px; border-radius: 16px 16px 0 0; }
    .notebook-mark { width: 56px; height: 56px; }
    .notebook-mark::before, .notebook-mark::after { width: 25px; top: 8px; bottom: 8px; border-width: 3px; }
    .header-title { font-weight: 800; font-size: 30px; }
    .notebook-actions { margin-left: auto; display: flex; gap: 8px; }
    .icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; font-weight: 800; }
    .badge { border-radius: 999px; font-size: 12px; padding: 4px 8px; background: #eef2ef; color: var(--muted); }
    .badge.warn { background: #fff5d6; color: #7c5f00; }
    .source-count { color: var(--muted); font-size: 15px; }
    .chat-scroll { min-height: 0; overflow: auto; padding: 22px; display: grid; align-content: start; gap: 18px; }
    .main-inner { max-width: 820px; width: 100%; margin: 0 auto; display: grid; gap: 18px; }
    .suggested { border: 1px solid var(--line); background: var(--surface); border-radius: 0 0 16px 16px; padding: 28px; margin-bottom: 0; }
    .suggested-label { font-size: 20px; color: #27243b; font-weight: 800; margin-bottom: 12px; }
    .suggested-desc { color: var(--muted); margin-bottom: 18px; }
    .chips { display: grid; gap: 10px; overflow: visible; }
    .chip { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-radius: 9px; background: #fff; color: #2a273f; border-color: var(--line); padding: 14px 16px; font-size: 15px; }
    .chip.empty { color: var(--muted); cursor: default; justify-content: start; }
    .chip-source { color: var(--muted); font-size: 11px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; }
    .banner { border: 1px solid #f0d382; background: #fff8df; color: #6b5200; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; }
    .message { max-width: 72%; margin: 12px 0; }
    .message.user { margin-left: auto; }
    .bubble { border-radius: 12px; padding: 10px 12px; white-space: pre-wrap; line-height: 1.45; }
    .user .bubble { background: var(--accent); color: white; border-bottom-right-radius: 4px; }
    .ai .bubble { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
    .cite-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; }
    .cite { border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; color: var(--muted); }
    .cite.ghost { border-color: #f1aaa4; background: #fff0ef; color: var(--red); font-weight: 700; }
    .raw-badge { display: inline-block; margin-bottom: 5px; background: #fff3c4; color: #705500; border-radius: 999px; font-size: 11px; padding: 2px 6px; }
    .input-row { border: 1px solid var(--line); background: var(--surface); display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 24px; border-radius: 16px; }
    .input-title { color: var(--accent); font-size: 20px; font-weight: 800; }
    .input-row input[type="text"] { border: 1px solid #d8d2ea; border-radius: 9px; padding: 18px 18px; min-height: 74px; font-size: 16px; }
    .input-footer { display: flex; align-items: center; gap: 12px; }
    .input-footer select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--muted); max-width: 150px; }
    .raw-toggle { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
    .send { background: linear-gradient(135deg, #8168dd, #9b7ff0); color: white; border-color: #8168dd; padding: 13px 28px; margin-left: auto; }
    .right { min-height: 0; border-left: 0; background: #fcfcff; padding: 22px 22px 28px 0; display: grid; grid-template-rows: minmax(0, 1fr); }
    .right-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; }
    .right-body { min-width: 0; min-height: 0; overflow: auto; padding: 0 16px 16px; }
    .panel { min-width: 0; }
    .right-title { display: flex; gap: 14px; align-items: start; padding: 28px 18px 20px; min-width: 0; }
    .right-title-icon { color: #208763; font-size: 32px; border: 2px solid currentColor; border-radius: 4px; width: 30px; height: 34px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; }
    .right-title strong { font-size: 22px; }
    .right-title span { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 245px; }
    .source-actions-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; min-width: 0; }
    .source-action { min-height: 98px; min-width: 0; display: grid; justify-items: center; align-content: center; gap: 8px; color: #208763; border-radius: 9px; padding: 10px 6px; }
    .source-action:nth-child(2) { color: #416ce3; }
    .source-action:nth-child(3) { color: #7a63d7; }
    .source-action span:first-child { font-size: 28px; }
    .source-action span:last-child { font-size: 14px; white-space: normal; text-align: center; overflow-wrap: anywhere; }
    .source-card { border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; background: var(--surface); min-height: 110px; min-width: 0; cursor: pointer; }
    .source-card:hover { border-color: #cfc8e8; background: #fdfcff; }
    .source-card.pending-add { border-color: #bfe7d1; background: #f7fffa; cursor: default; }
    .source-card.pending-remove { border-color: #f0b9b9; background: #fff8f8; }
    .source-card.missing-source { border-color: #f0b9b9; background: #fffafa; }
    .source-top { display: flex; align-items: start; gap: 8px; }
    .source-title { font-weight: 700; flex: 1; min-width: 0; overflow-wrap: anywhere; }
    .source-state-badge { border: 1px solid var(--line); border-radius: 999px; padding: 3px 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
    .source-state-badge.add { border-color: #9ed8b9; color: #20734b; background: #ecfff3; }
    .source-state-badge.remove { border-color: #efb4b4; color: var(--red); background: #fff0f0; }
    .source-meta { color: var(--muted); font-size: 12px; margin: 7px 0; }
    .chunk-warn { color: var(--red); font-weight: 700; }
    .source-card-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
    .edit-source { color: var(--accent); border-color: #d6cef5; }
    .delete-source { color: var(--red); border-color: #f0b9b9; }
    .trash-btn { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--red); border-color: #f0b9b9; font-size: 14px; line-height: 1; }
    .source-type-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; color: var(--muted); font-size: 13px; }
    .source-type-tabs label { display: grid; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; cursor: pointer; background: var(--surface-2); }
    .source-type-tabs input { width: auto; }
    .add-source { width: 100%; margin: 8px 0; }
    .modal-backdrop { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(18, 30, 24, 0.46); z-index: 20; padding: 20px; }
    .modal-backdrop.active { display: flex; }
    .modal { width: min(720px, 100%); max-height: min(720px, 92vh); overflow: auto; background: var(--surface); border-radius: 12px; box-shadow: 0 24px 80px rgba(0,0,0,0.24); border: 1px solid var(--line); }
    .payload-preview-modal { width: min(760px, 100%); }
    .payload-preview-content { white-space: pre-wrap; max-height: 58vh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: #fbfbff; color: #2f2d41; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
    .source-detail-modal { width: min(980px, 100%); max-height: min(860px, 94vh); }
    .modal-head { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
    .modal-title { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
    .modal-desc { color: var(--muted); font-size: 13px; }
    .modal-body { padding: 18px 20px; display: grid; gap: 18px; }
    .wizard-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .wizard-step { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--surface-2); }
    .wizard-step strong { display: block; font-size: 13px; }
    .wizard-step span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
    .form-section { display: grid; gap: 10px; }
    .form-section h3 { margin: 0; font-size: 14px; }
    .form-section p { color: var(--muted); font-size: 13px; }
    .modal input, .modal textarea, .modal select { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 9px; background: #fff; }
    .modal-actions { display: flex; justify-content: end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
    .create-notebook-modal { width: min(520px, calc(100vw - 32px)); border-radius: 12px; overflow: hidden; }
    .create-notebook-modal .modal-head { padding: 24px 24px 10px; border-bottom: 0; }
    .create-notebook-modal .modal-title { font-size: 20px; line-height: 1.2; }
    .create-notebook-modal .modal-desc { font-size: 14px; margin-top: 6px; }
    .create-notebook-modal .modal-body { padding: 12px 24px 22px; gap: 16px; }
    .create-notebook-modal .modal-actions { padding: 16px 24px 24px; border-top: 0; background: #fff; }
    .create-notebook-modal .access-close { border: 0; background: transparent; box-shadow: none; color: #5f5a6c; font-size: 22px; width: 32px; height: 32px; }
    .create-notebook-modal .access-field { font-size: 14px; color: #151421; gap: 8px; }
    .create-notebook-modal .access-field input { border-radius: 9px; padding: 12px 14px; font-size: 15px; }
    .coached-option { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; background: #fbfbff; color: var(--text); }
    .coached-option input { width: auto; margin-top: 3px; }
    .coached-option strong { display: block; font-size: 14px; }
    .coached-option small { display: block; color: var(--muted); margin-top: 3px; line-height: 1.35; }
    .detail-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); padding: 0 20px; }
    .detail-tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); padding: 12px 10px; }
    .detail-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 750; }
    .detail-pane { display: none; }
    .detail-pane.active { display: grid; gap: 14px; }
    .source-content-box { white-space: pre-wrap; max-height: 320px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fbfbff; font-size: 13px; line-height: 1.45; }
    .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .detail-item { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: #fff; min-width: 0; }
    .detail-item strong { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
    .detail-item span, .detail-item code { overflow-wrap: anywhere; }
    .insight-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--surface-2); }
    .insight-toolbar select { min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 9px; background: #fff; }
    .insight-list { display: grid; gap: 10px; }
    .insight-card { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; }
    .insight-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
    .insight-type { border: 1px solid var(--line); border-radius: 999px; padding: 3px 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
    .insight-content { color: #3b384f; white-space: pre-wrap; font-size: 13px; line-height: 1.45; }
    .access-modal { width: min(780px, calc(100vw - 32px)); max-height: min(880px, 92vh); border-radius: 16px; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
    .access-modal .modal-head { padding: 36px 42px 34px; align-items: start; }
    .access-modal .modal-title { font-size: 30px; line-height: 1.12; margin-bottom: 10px; }
    .access-modal .modal-desc { font-size: 18px; color: #85807a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
    .access-modal .modal-body { padding: 0; gap: 0; overflow: auto; }
    .access-modal .modal-actions { padding: 24px 42px; }
    .access-close { width: 44px; height: 44px; padding: 0; border-radius: 12px; font-size: 18px; font-weight: 800; line-height: 1; }
    .access-section { display: grid; gap: 18px; padding: 34px 42px; border-bottom: 1px solid var(--line); }
    .access-section h3 { color: #55515c; font-size: 18px; margin: 0; }
    .access-field { display: grid; gap: 8px; color: #55515c; font-size: 16px; font-weight: 650; }
    .access-field input, .access-field select, .share-form input, .share-form select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 14px 16px; min-width: 0; background: #fff; font-size: 16px; color: var(--text); }
    .access-buttons { display: flex; gap: 14px; flex-wrap: wrap; }
    .access-buttons .send { margin-left: 0; }
    .share-form { display: grid; grid-template-columns: minmax(0, 1fr) 170px 110px; gap: 12px; align-items: center; }
    .share-form .send { margin-left: 0; justify-content: center; }
    .share-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 34px; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; }
    .share-user { font-weight: 750; overflow-wrap: anywhere; }
    .share-role { color: var(--muted); font-size: 13px; text-transform: capitalize; }
    .share-empty { min-height: 160px; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; color: #85807a; background: #fff; font-size: 18px; }
    .user-picker { position: relative; min-width: 0; }
    .user-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; display: none; max-height: 220px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; box-shadow: 0 18px 50px rgba(31, 27, 62, 0.14); padding: 6px; }
    .user-menu.active { display: grid; gap: 4px; }
    .user-option { width: 100%; text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 9px 10px; display: grid; gap: 2px; color: var(--text); }
    .user-option:hover { background: #f6f2ff; color: var(--accent); }
    .user-option strong { font-size: 14px; overflow-wrap: anywhere; }
    .user-option span { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
    .debug { margin-top: 12px; }
    .debug pre { max-height: 260px; overflow: auto; background: #111827; color: #e5edf7; border-radius: 6px; padding: 10px; font-size: 12px; }
    .tool-view { padding: 22px; }
    .tool-inner { max-width: 980px; margin: 0 auto; display: grid; gap: 18px; }
    .tool-head { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 26px 28px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
    .tool-title { font-size: 28px; font-weight: 800; }
    .tool-desc { color: var(--muted); margin-top: 4px; }
    .tool-card { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); padding: 22px; display: grid; gap: 16px; }
    .governance-panel { display: grid; gap: 12px; }
    .governance-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 16px; display: grid; gap: 12px; }
    .governance-card.compact { margin-bottom: 14px; padding: 12px; }
    .governance-card.compact .tool-desc { font-size: 12px; }
    .draft-changes-panel { display: grid; gap: 10px; }
    .governance-actions, .review-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
    .pr-op-list { display: grid; gap: 8px; }
    .pr-op { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; background: #fff; }
    .pr-op.add { border-color: #cfe9da; }
    .pr-op.remove { border-color: #f0c3c3; }
    .pr-op > span:first-child { font-weight: 900; color: var(--muted); text-align: center; }
    .pr-op.add > span:first-child { color: #208763; }
    .pr-op.remove > span:first-child { color: var(--red); }
    .review-pr { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; background: #fff; }
    .inline-link, .pr-source-link { border: 0; background: transparent; padding: 0; border-radius: 0; color: var(--accent); text-align: left; }
    .inline-link:hover, .pr-source-link:hover { background: transparent; color: #4e3dba; text-decoration: underline; }
    .pr-source-link { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
    .pr-source-link strong { overflow-wrap: anywhere; color: var(--text); }
    .tool-form { display: grid; gap: 12px; }
    .tool-form textarea, .tool-form input, .tool-form select { width: 100%; border: 1px solid #d8d2ea; border-radius: 9px; padding: 12px 14px; background: #fff; }
    .tool-form textarea { min-height: 120px; resize: vertical; }
    .tool-form .coach-prompt-input { min-height: 300px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.45; }
    .settings-actions { display: flex; align-items: center; gap: 12px; }
    .settings-status { color: var(--muted); font-size: 13px; min-height: 18px; }
    .option-row { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
    .result-list { display: grid; gap: 10px; }
    .result-card { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 14px; }
    .result-card strong { display: block; margin-bottom: 6px; }
    .result-meta { color: var(--muted); font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
    .source-table-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: auto; background: #fff; }
    .source-table { width: 100%; min-width: 820px; border-collapse: collapse; table-layout: fixed; }
    .source-table th, .source-table td { border-bottom: 1px solid var(--line); padding: 12px 14px; text-align: left; vertical-align: middle; }
    .source-table th { position: sticky; top: 0; background: #fbfbff; color: var(--muted); font-size: 12px; text-transform: uppercase; z-index: 1; }
    .source-table tbody tr:hover { background: #faf9ff; }
    .source-table .source-name { font-weight: 700; overflow-wrap: anywhere; }
    .source-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; font-size: 12px; color: var(--muted); }
    .audit-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
    .audit-entry { border-left: 4px solid var(--blue); background: var(--surface-2); border-radius: 6px; padding: 8px; margin-bottom: 8px; font-size: 13px; }
    .audit-entry.ok { border-left-color: var(--green); }
    .audit-entry.error { border-left-color: var(--red); }
    .audit-entry.info { border-left-color: var(--blue); }
    .audit-time { color: var(--muted); font-size: 11px; }
    .sidebar-footer { margin-top: auto; }
    @media (max-width: 980px) {
      .topbar { grid-template-columns: 160px 1fr; }
      .top-actions { grid-column: 1 / -1; justify-content: start; padding-bottom: 8px; }
      .app { grid-template-rows: auto minmax(0, 1fr); }
      .shell, .shell.nav-collapsed, .shell:not(.show-notebook-panel), .shell.nav-collapsed:not(.show-notebook-panel) { grid-template-columns: 76px minmax(0, 1fr); }
      .main { grid-column: 2; }
      .notebook-panel { display: none !important; }
      .right { display: none; }
      .access-modal .modal-head, .access-section, .access-modal .modal-actions { padding-left: 22px; padding-right: 22px; }
      .access-modal .modal-title { font-size: 24px; }
      .share-form { grid-template-columns: minmax(0, 1fr); }
    }
