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

    :root {
      --bg: #ffffff;
      --sidebar-bg: #f7f7f5;
      --surface: #efefed;
      --border: #e3e2df;
      --text: #191919;
      --text-muted: #787774;
      --text-light: #c0bfbc;
      --accent: #191919;
      --accent-hover: #373737;
      --accent-bg: rgba(0,0,0,0.05);
      --bg-accent: #eeedfe;
      --text-accent: #534ab7;
      --green: #2f9e44;
      --red: #e03131;
      --yellow: #e67700;
      --sidebar-w: 240px;
    }

    body {
      font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
      background: var(--bg);
      color: var(--text);
      display: flex;
      height: 100vh;
      overflow: hidden;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

    /* ── Sidebar ── */
    #sidebar {
      width: var(--sidebar-w);
      background: var(--sidebar-bg);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
      transition: width .2s ease;
      overflow: hidden;
    }
    #sidebar.collapsed { width: 52px; }

    #sidebar-header {
      padding: 14px 12px 12px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
      min-height: 49px;
    }
    .logo { display: flex; align-items: center; white-space: nowrap; overflow: hidden; transition: opacity .15s, width .2s; flex-shrink: 0; }
    #sidebar.collapsed .logo { opacity: 0; width: 0; }
    #sidebar-logo svg { height: 24px; width: auto; }

    #collapse-btn {
      background: none; border: none; cursor: pointer; padding: 4px; border-radius: 5px;
      color: var(--text-muted); display: flex; align-items: center; justify-content: center;
      flex-shrink: 0; transition: background .12s, color .12s;
    }
    #collapse-btn:hover { background: var(--surface); color: var(--text); }
    #collapse-btn svg { transition: transform .2s; }
    #sidebar.collapsed #collapse-btn svg { transform: rotate(180deg); }

    /* Nav */
    #sidebar-nav { padding: 4px 8px 0; flex-shrink: 0; border-bottom: 1px solid var(--border); }
    .nav-item {
      display: flex; align-items: center; gap: 9px; padding: 6px 8px;
      border-radius: 5px; cursor: pointer; transition: background .1s;
      white-space: nowrap; margin-bottom: 1px;
      text-decoration: none; color: inherit;
    }
    .nav-item:hover { background: var(--surface); }
    .nav-item.active { background: #1A1A1A; }
    .nav-item.active:hover { background: #1A1A1A; }
    .nav-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text-muted); }
    .nav-item.active .nav-icon { color: #FAFAF9; }
    .nav-item:not(.active):hover .nav-icon { color: var(--text); }
    .nav-label { font-size: 13px; font-weight: 400; color: #4A4A47; letter-spacing: -0.005em; transition: opacity .15s; }
    .nav-item.active .nav-label { color: #FAFAF9; font-weight: 500; }
    .nav-item:not(.active):hover .nav-label { color: var(--text); }
    .nav-item--soon { cursor: default; }
    .nav-item--soon:hover { background: none; }
    .nav-item--soon .nav-icon,
    .nav-item--soon .nav-label { color: #B8B6AE; }
    .nav-item--soon:hover .nav-icon, .nav-item--soon:hover .nav-label { color: #B8B6AE; }
    .nav-soon-badge { margin-left: auto; font-size: 9px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: #9A9A95; background: none; border-radius: 4px; padding: 1px 5px; }
    .nav-count-badge { margin-left: auto; font-size: 10px; font-weight: 600; color: #fff; background: var(--red); border-radius: 999px; padding: 1px 6px; line-height: 1.5; }
    .nav-item.active .nav-count-badge { background: rgba(255,255,255,.25); }
    .nav-group-label { font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-light); padding: 12px 8px 3px; white-space: nowrap; overflow: hidden; }
    .nav-sub-item { padding-left: 14px; }
    #sidebar.collapsed .nav-group-label { opacity: 0; }
    #sidebar.collapsed .nav-label { opacity: 0; pointer-events: none; }

    /* Sidebar content */
    #sidebar-content { flex: 1; overflow-y: auto; overflow-x: hidden; padding-top: 12px; }
    #sidebar.collapsed #sidebar-content { opacity: 0; pointer-events: none; }

    /* SEO / GBP surface switcher (top of sidebar, before project switcher) */
    #mode-switch { padding: 8px 8px 0; flex-shrink: 0; }
    #sidebar.collapsed #mode-switch { opacity: 0; pointer-events: none; }
    #mode-switch-group {
      display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
    }
    .mode-switch-btn {
      flex: 1; padding: 6px 8px; font-size: 12px; font-weight: 600; font-family: inherit;
      border: none; background: var(--bg); color: var(--text-muted); cursor: pointer; text-align: center;
    }
    .mode-switch-btn + .mode-switch-btn { border-left: 1px solid var(--border); }
    .mode-switch-btn.active { background: #1A1A1A; color: #FAFAF9; cursor: default; }
    .mode-switch-btn:not(.active):hover { background: var(--surface); color: var(--text); }

    /* Project switcher (top of sidebar, before nav) */
    #sidebar-footer { display: none; }
    #ws-wrap { padding: 8px 8px 6px; flex-shrink: 0; position: relative; border-bottom: 1px solid var(--border); }
    #sidebar.collapsed #ws-wrap { opacity: 0; pointer-events: none; }

    #ws-switcher {
      display: flex; align-items: center; gap: 9px;
      padding: 8px 10px; border-radius: 8px;
      border: 1px solid var(--border); background: var(--bg);
      cursor: pointer; width: 100%; text-align: left; font-family: inherit;
      transition: border-color .12s;
    }
    #ws-switcher:hover { border-color: var(--text-muted); }
    #ws-switcher.open { border-color: var(--text-muted); }
    .ws-switcher-info { flex: 1; min-width: 0; }
    .ws-switcher-name { font-size: 13px; line-height: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
    .ws-switcher-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; display: block; margin-top: 1px; }
    .ws-switcher-chevron { flex-shrink: 0; color: var(--text-light); transition: transform .15s; transform: rotate(180deg); }
    #ws-switcher.open .ws-switcher-chevron { transform: rotate(0deg); }

    #ws-overlay { display: none; position: fixed; inset: 0; z-index: 49; }
    #ws-dropdown {
      position: absolute; top: 100%; left: 0; right: 0;
      background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
      box-shadow: 0 8px 24px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
      display: none; flex-direction: column;
      max-height: 340px; z-index: 50; margin-top: 6px; overflow: hidden;
    }
    #ws-dropdown.open { display: flex; }
    #ws-search-wrap { padding: 8px 8px 6px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
    #ws-search {
      width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px;
      background: var(--surface); font-size: 12.5px; color: var(--text);
      font-family: inherit; outline: none; box-sizing: border-box;
    }
    #ws-search:focus { border-color: var(--text-muted); }
    #ws-list, #projects-list { overflow-y: auto; flex: 1; padding: 5px; }
    .ws-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 8px; border-radius: 7px; cursor: pointer; transition: background .1s; }
    .ws-item:hover { background: var(--surface); }
    .ws-item.active { background: var(--bg-accent); }
    .ws-item-body { flex: 1; min-width: 0; }
    .ws-item-domain { font-size: 13px; line-height: 15px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
    .ws-item.active .ws-item-domain { color: var(--text-accent); font-weight: 500; }
    .ws-item-loc { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; margin-top: 1px; }
    .ws-item-delete { display: none; align-items: center; justify-content: center; width: 22px; height: 22px; border: none; background: transparent; border-radius: 5px; cursor: pointer; color: var(--text-muted); flex-shrink: 0; padding: 0; margin-top: 1px; }
    .ws-item:hover .ws-item-delete { display: flex; }
    .ws-item-delete:hover { background: rgba(224,49,49,.1); color: #e03131; }
    #ws-dropdown-footer { padding: 5px 8px 6px; border-top: 1px solid var(--border); flex-shrink: 0; }
    #ws-add-btn {
      display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 8px;
      border-radius: 7px; border: none; background: none; cursor: pointer;
      font-size: 12px; font-family: inherit; color: var(--text-muted); transition: background .1s, color .1s;
    }
    #ws-add-btn:hover { background: var(--surface); color: var(--text); }

    /* ── Main ── */
    #main {
      flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0;
    }

    .user-row {
      display: flex; align-items: center; gap: 8px; padding: 6px 8px;
      border-radius: 8px; cursor: pointer; transition: background .12s; user-select: none;
    }
    .user-row:hover { background: var(--surface); }
    .user-avatar {
      width: 28px; height: 28px; border-radius: 50%; background: var(--text); color: #fff;
      display: flex; align-items: center; justify-content: center;
      font-size: 11px; font-weight: 700; flex-shrink: 0;
    }
    .user-info { flex: 1; min-width: 0; }
    .user-name { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .user-email { font-size: 10.5px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

    #user-menu {
      display: none; position: absolute; top: calc(100% + 6px); right: 0;
      background: #fff; border: 1px solid var(--border); border-radius: 10px;
      box-shadow: 0 4px 20px rgba(0,0,0,.08); min-width: 168px;
      z-index: 200; padding: 4px; overflow: hidden;
    }
    #user-menu.open { display: block; }
    .user-menu-item {
      display: flex; align-items: center; gap: 9px; padding: 8px 10px;
      border-radius: 7px; font-size: 13px; color: var(--text-muted);
      cursor: pointer; transition: background .1s, color .1s; white-space: nowrap;
    }
    .user-menu-item:hover { background: var(--surface); color: var(--text); }
    .user-menu-item.danger { color: var(--red); }
    .user-menu-item.danger:hover { background: rgba(224,49,49,.07); color: var(--red); }
    .user-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }

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

    /* ── Tool chips ── */
    .tool-chip {
      display: inline-flex; align-items: center; gap: 5px; border-radius: 5px;
      padding: 3px 9px 3px 7px; font-size: 12px; font-weight: 500; letter-spacing: 0.01em;
      margin: 2px 4px 2px 0; border: none; transition: opacity 0.15s;
    }
    .tool-chip.running { background: rgba(99,102,241,0.09); color: #5b5bd6; }
    .tool-chip.done    { background: rgba(22,163,74,0.09); color: #16a34a; }
    .tool-chip.error   { background: rgba(220,38,38,0.09); color: #dc2626; }
    .tool-chip.paused  { background: rgba(234,179,8,0.1); color: #a16207; }
    .tool-chip-spinner {
      width: 10px; height: 10px; border: 1.5px solid currentColor; border-top-color: transparent;
      border-radius: 50%; animation: spin 0.65s linear infinite; display: inline-block; flex-shrink: 0;
    }
    .tool-chip-icon { display: inline-flex; align-items: center; flex-shrink: 0; }
    .agent-tools { margin-top: 6px; margin-bottom: 4px; }
    .tool-chip[data-chip-id] { cursor: pointer; outline: none; }
    .tool-chip.panel-active { box-shadow: 0 0 0 1.5px currentColor; margin-left: 2px; }
    .tool-chip-arrow {
      display: inline-flex; align-items: center; margin-left: 2px;
      opacity: 0.45; transition: transform 0.15s, opacity 0.15s; flex-shrink: 0;
    }
    .tool-chip.panel-active .tool-chip-arrow { transform: rotate(90deg); opacity: 0.8; }

    /* ── Approval card ── */
    .approval-card {
      background: var(--surface); border: 1px solid var(--border);
      border-radius: 10px; padding: 12px 14px; margin-top: 8px;
      max-width: 420px;
    }
    .approval-description {
      font-size: 13px; color: var(--text); line-height: 1.5; margin-bottom: 10px;
    }
    .approval-actions {
      display: flex; gap: 8px;
    }
    .approval-btn {
      display: inline-flex; align-items: center; justify-content: center;
      gap: 5px; border-radius: 6px; padding: 6px 14px;
      font-size: 13px; font-weight: 500; cursor: pointer; border: none;
      transition: background 0.12s, opacity 0.12s; white-space: nowrap;
    }
    .approval-btn-confirm {
      background: var(--accent); color: #fff;
    }
    .approval-btn-confirm:hover { background: var(--accent-hover); }
    .approval-btn-cancel {
      background: transparent; color: var(--text-muted);
      border: 1px solid var(--border);
    }
    .approval-btn-cancel:hover { background: var(--border); color: var(--text); }
    .approval-btn:disabled { opacity: 0.45; cursor: not-allowed; }

    /* ── Tool Detail Panel ── */
    #tool-detail-panel {
      position: fixed; top: 0; right: 0; height: 100vh; width: 400px;
      background: var(--bg); border-left: 1px solid var(--border);
      box-shadow: -6px 0 20px rgba(0,0,0,0.06); display: flex; flex-direction: column;
      transform: translateX(100%); transition: transform 0.2s cubic-bezier(0.4,0,0.2,1); z-index: 200;
    }
    #tool-detail-panel.open { transform: translateX(0); }
    .tdp-header {
      display: flex; align-items: center; gap: 8px; padding: 13px 14px;
      border-bottom: 1px solid var(--border); flex-shrink: 0;
    }
    .tdp-header-icon { display: inline-flex; align-items: center; flex-shrink: 0; }
    .tdp-header-title { flex: 1; font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tdp-close {
      background: none; border: none; cursor: pointer; color: var(--text-muted);
      padding: 3px 5px; border-radius: 4px; line-height: 1; flex-shrink: 0;
      transition: background 0.12s; display: inline-flex; align-items: center;
    }
    .tdp-close:hover { background: var(--surface); }
    .tdp-body { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 18px; }
    .tdp-section-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
    .tdp-input-grid { display: flex; flex-direction: column; gap: 5px; }
    .tdp-input-row { display: flex; gap: 10px; font-size: 12px; line-height: 1.5; }
    .tdp-input-key { color: var(--text-muted); flex-shrink: 0; min-width: 70px; font-size: 11px; }
    .tdp-input-val { color: var(--text); word-break: break-all; font-family: ui-monospace, monospace; font-size: 11px; }
    .tdp-result-text { font-size: 12px; color: var(--text); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
    .tdp-error-text { font-size: 12px; color: var(--red); line-height: 1.5; }
    .tdp-result-list { display: flex; flex-direction: column; }
    .tdp-result-item { display: grid; grid-template-columns: 24px 1fr; gap: 6px; padding: 7px 0; border-bottom: 1px solid var(--border); }
    .tdp-result-item:last-child { border-bottom: none; }
    .tdp-result-rank { font-size: 11px; color: var(--text-muted); padding-top: 1px; font-variant-numeric: tabular-nums; }
    .tdp-result-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
    .tdp-result-title { font-size: 12px; color: var(--text); font-weight: 500; line-height: 1.35; word-break: break-word; }
    .tdp-result-link { font-size: 12px; color: var(--accent); font-weight: 500; line-height: 1.35; word-break: break-word; text-decoration: none; }
    .tdp-result-link:hover { text-decoration: underline; }
    .tdp-result-meta { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .tdp-result-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; word-break: break-word; }
    .tdp-shimmer { display: flex; flex-direction: column; gap: 7px; }
    .tdp-shimmer-line {
      height: 10px; border-radius: 4px;
      background: linear-gradient(90deg, var(--surface) 25%, var(--border) 50%, var(--surface) 75%);
      background-size: 200% 100%; animation: tdp-shimmer 1.3s infinite;
    }
    @keyframes tdp-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
    .tdp-serp { display: flex; flex-direction: column; gap: 14px; }
    .tdp-serp-section-header { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
    .tdp-serp-ai-text { font-size: 12px; color: var(--text); line-height: 1.6; }
    .tdp-serp-paa-list { display: flex; flex-direction: column; gap: 3px; }
    .tdp-serp-paa-item { font-size: 12px; color: var(--text); padding: 5px 8px; background: var(--bg-alt, rgba(0,0,0,.04)); border-radius: 5px; line-height: 1.4; }
    .tdp-local-list { display: flex; flex-direction: column; }
    .tdp-local-item { display: flex; flex-direction: column; gap: 2px; padding: 7px 0; border-bottom: 1px solid var(--border); }
    .tdp-local-item:last-child { border-bottom: none; }
    .tdp-local-name { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.3; }
    .tdp-local-rating { display: flex; align-items: center; gap: 4px; }
    .tdp-local-stars { color: #f59e0b; font-size: 11px; letter-spacing: 0px; line-height: 1; }
    .tdp-local-rating-text { font-size: 11px; color: var(--text-muted); }
    .tdp-local-meta { font-size: 11px; color: var(--text-muted); }
    .tdp-local-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
    /* ── Heading tree ── */
    .tdp-headings { display: flex; flex-direction: column; gap: 1px; }
    .tdp-heading-url { font-size: 10px; color: var(--text-muted); margin-bottom: 6px; word-break: break-all; }
    .tdp-heading-node { display: flex; align-items: baseline; gap: 6px; padding: 2px 0; min-width: 0; }
    .tdp-heading-tag { font-size: 10px; font-weight: 700; color: var(--text-muted); font-family: ui-monospace,monospace; flex-shrink: 0; min-width: 20px; }
    .tdp-heading-text { font-size: 12px; color: var(--text); line-height: 1.4; word-break: break-word; }
    /* ── Meta list ── */
    .tdp-meta-list { display: flex; flex-direction: column; gap: 10px; }
    .tdp-meta-item { display: flex; flex-direction: column; gap: 2px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
    .tdp-meta-item:last-child { border-bottom: none; padding-bottom: 0; }
    .tdp-meta-url { font-size: 10px; color: var(--text-muted); font-family: ui-monospace,monospace; word-break: break-all; }
    .tdp-meta-title { font-size: 12px; font-weight: 500; color: var(--text); line-height: 1.4; word-break: break-word; }
    .tdp-meta-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; word-break: break-word; }
    /* ── Schema list ── */
    .tdp-schema-list { display: flex; flex-direction: column; gap: 8px; }
    .tdp-schema-item { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px; background: var(--surface); border-radius: 5px; }
    .tdp-schema-type { font-size: 11px; font-weight: 600; color: var(--text); font-family: ui-monospace,monospace; }
    .tdp-schema-name { font-size: 11px; color: var(--text-muted); line-height: 1.4; word-break: break-word; }
    .tdp-schema-code { margin: 0; padding: 10px 12px; background: var(--surface); border-radius: 6px; font-family: ui-monospace,monospace; font-size: 10.5px; color: var(--text); line-height: 1.55; white-space: pre; overflow-x: auto; word-break: normal; }
    /* ── Lighthouse audit ── */
    .tdp-lh { display: flex; flex-direction: column; gap: 14px; }
    .tdp-lh-scores { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .tdp-lh-score { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 10px 6px; border-radius: 8px; background: var(--surface); }
    .tdp-lh-score-num { font-size: 22px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
    .tdp-lh-score-label { font-size: 10px; font-weight: 500; color: var(--text-muted); text-align: center; text-transform: uppercase; letter-spacing: 0.05em; }
    .tdp-lh-score.good .tdp-lh-score-num { color: #1a9e5c; }
    .tdp-lh-score.ok .tdp-lh-score-num   { color: #e07b00; }
    .tdp-lh-score.bad .tdp-lh-score-num  { color: #d03030; }
    .tdp-lh-summary { font-size: 12px; color: var(--text); line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
    .tdp-lh-section-header { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding-bottom: 4px; border-bottom: 1px solid var(--border); }
    .tdp-lh-recs { display: flex; flex-direction: column; gap: 8px; }
    .tdp-lh-rec { padding: 8px 10px; background: var(--surface); border-radius: 6px; display: flex; flex-direction: column; gap: 4px; }
    .tdp-lh-rec-header { display: flex; align-items: center; gap: 6px; }
    .tdp-lh-priority { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 2px 5px; border-radius: 3px; flex-shrink: 0; }
    .tdp-lh-priority.high   { background: rgba(208,48,48,0.12);  color: #d03030; }
    .tdp-lh-priority.medium { background: rgba(224,123,0,0.12);  color: #e07b00; }
    .tdp-lh-priority.low    { background: rgba(26,158,92,0.12);  color: #1a9e5c; }
    .tdp-lh-rec-title { font-size: 11px; font-weight: 600; color: var(--text); line-height: 1.4; }
    .tdp-lh-rec-desc { font-size: 11px; color: var(--text-muted); line-height: 1.5; }
    .tdp-lh-rec-fix { margin: 2px 0 0; padding: 6px 8px; background: var(--bg); border-radius: 4px; font-family: ui-monospace,monospace; font-size: 10.5px; color: var(--text); line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
    /* ── Keyword table ── */
    .tdp-kw-table { width: 100%; border-collapse: collapse; font-size: 11px; }
    .tdp-kw-table thead tr { border-bottom: 1px solid var(--border); }
    .tdp-kw-table th { text-align: left; padding: 3px 4px; font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
    .tdp-kw-table td { padding: 5px 4px; color: var(--text); border-bottom: 1px solid var(--border); line-height: 1.4; word-break: break-word; vertical-align: top; }
    .tdp-kw-table tbody tr:last-child td { border-bottom: none; }
    .tdp-kw-num { font-family: ui-monospace,monospace; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-muted); }
    /* ── Page content links ── */
    .tdp-links-section { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; }
    .tdp-links-header { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
    .tdp-link-row { display: flex; gap: 6px; font-size: 11px; padding: 3px 0; border-bottom: 1px solid var(--border); }
    .tdp-link-row:last-child { border-bottom: none; }
    .tdp-link-badge { flex-shrink: 0; font-size: 9px; font-weight: 600; padding: 1px 4px; border-radius: 3px; text-transform: uppercase; letter-spacing: 0.04em; }
    .tdp-link-badge.int { background: rgba(91,91,214,0.12); color: #5b5bd6; }
    .tdp-link-badge.ext { background: var(--surface); color: var(--text-muted); }
    .tdp-link-anchor { color: var(--text); flex: 1; min-width: 0; word-break: break-word; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .tdp-link-href { color: var(--text-muted); font-size: 10px; word-break: break-all; }
    .tdp-link-href-muted { color: var(--text-muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; flex-shrink: 0; }
    /* ── Page content ── */
    .tdp-pc { display: flex; flex-direction: column; gap: 10px; }
    .tdp-pc-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; word-break: break-word; }
    .tdp-pc-desc { font-size: 11px; color: var(--text-muted); line-height: 1.5; word-break: break-word; }
    .tdp-pc-stats { display: flex; gap: 6px; flex-wrap: wrap; }
    .tdp-pc-stat { display: flex; flex-direction: column; align-items: center; padding: 6px 10px; background: var(--surface); border-radius: 6px; min-width: 60px; }
    .tdp-pc-stat-num { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
    .tdp-pc-stat-label { font-size: 9.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 1px; white-space: nowrap; }
    /* ── Page markdown ── */
    .tdp-md { display: flex; flex-direction: column; gap: 8px; }
    .tdp-md-meta { display: flex; flex-wrap: wrap; gap: 8px; }
    .tdp-md-meta-item { font-size: 10.5px; color: var(--text-muted); }
    .tdp-md-meta-item + .tdp-md-meta-item::before { content: '·'; margin-right: 8px; }
    .tdp-md-content { margin: 0; padding: 10px 12px; background: var(--surface); border-radius: 6px; font-family: ui-monospace,monospace; font-size: 10.5px; color: var(--text); line-height: 1.6; white-space: pre-wrap; word-break: break-word; max-height: 420px; overflow-y: auto; }
    /* ── Export panel ── */
    .export-panel-wrap { position: relative; }
    .export-panel {
      position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 120;
      background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
      box-shadow: 0 4px 24px rgba(0,0,0,.13); min-width: 200px; overflow: visible;
    }
    .export-panel-header, .export-option:first-child { border-top-left-radius: 10px; border-top-right-radius: 10px; }
    .export-option:last-child { border-bottom-left-radius: 10px; border-bottom-right-radius: 10px; }
    .export-panel-header {
      font-size: 10.5px; font-weight: 700; color: var(--text-muted);
      text-transform: uppercase; letter-spacing: .06em; padding: 10px 14px 6px;
    }
    .export-option {
      display: flex; align-items: center; gap: 9px; padding: 8px 14px;
      cursor: pointer; font-size: 13px; color: var(--text);
    }
    .export-option:not(.disabled):hover { background: var(--surface); }
    .export-option.disabled { opacity: .45; cursor: default; }
    .export-option-icon { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-muted); }
    .export-soon-badge {
      margin-left: auto; font-size: 10px; font-weight: 500; color: var(--text-light);
      background: var(--surface); border: 1px solid var(--border);
      border-radius: 4px; padding: 1px 5px;
    }
    .export-email-view { padding: 12px 14px 14px; }
    .export-email-back {
      display: flex; align-items: center; gap: 4px; font-size: 11.5px;
      font-weight: 600; color: var(--text-muted); cursor: pointer; margin-bottom: 11px;
    }
    .export-email-back:hover { color: var(--text); }
    .export-email-label { font-size: 11.5px; color: var(--text-muted); margin-bottom: 5px; }
    .export-email-input {
      width: 100%; padding: 7px 10px; font-size: 13px; border: 1px solid var(--border);
      border-radius: 7px; background: var(--surface); color: var(--text);
      box-sizing: border-box; margin-bottom: 8px;
    }
    .export-email-input:focus { outline: none; border-color: var(--accent); }
    .export-email-send {
      width: 100%; padding: 8px; font-size: 13px; font-weight: 600;
      background: var(--accent); color: #fff; border: none; border-radius: 7px; cursor: pointer;
    }
    .export-email-send:hover { background: var(--accent-hover); }
    .export-email-send:disabled { opacity: .55; cursor: default; }

    .slack-sender-row { display: flex; gap: 8px; margin-bottom: 8px; }
    .slack-sender-card {
      flex: 1; min-width: 0; text-align: left; font-family: inherit;
      border: 1.5px solid var(--border); border-radius: 8px; padding: 7px 10px;
      background: var(--bg); cursor: pointer;
    }
    .slack-sender-card:hover { background: var(--surface); }
    .slack-sender-card.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
    .slack-sender-card.locked { opacity: .5; cursor: default; }
    .slack-sender-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
    .slack-sender-name { font-size: 12px; font-weight: 600; color: var(--text); }
    .slack-sender-desc { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }

    .slack-recipient-picker { position: relative; }
    .slack-recipient-input { background: var(--bg); }
    .slack-recipient-dropdown {
      display: none; position: absolute; bottom: calc(100% + 4px); left: 0; right: 0; z-index: 130;
      max-height: 220px; overflow-y: auto; background: var(--bg); border: 1px solid var(--border);
      border-radius: 7px; box-shadow: 0 4px 16px rgba(0,0,0,.12); padding: 4px;
    }
    .slack-recipient-group-label {
      font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase;
      letter-spacing: .05em; padding: 6px 8px 3px;
    }
    .slack-recipient-item { padding: 6px 8px; font-size: 13px; color: var(--text); border-radius: 5px; cursor: pointer; }
    .slack-recipient-item:hover { background: var(--surface); }
    .slack-recipient-empty { padding: 8px; font-size: 12.5px; color: var(--text-muted); }
    .slack-error-flash .slack-recipient-input { border-color: var(--red) !important; }

    /* ── User switcher ── */
    #user-switcher { display:none; }
    .user-switcher-wrap { position:relative; display:flex; align-items:center; }
    .user-switcher-btn {
      width:28px; height:28px; border-radius:50%; border:none;
      background:var(--surface-2,#e5e7eb); cursor:pointer;
      font-weight:700; font-size:14px; color:var(--text-light,#6b7280);
      display:flex; align-items:center; justify-content:center;
      flex-shrink:0;
    }
    .user-switcher-btn:hover { background:var(--border,#d1d5db); }
    .user-switcher-menu {
      display:none; position:absolute; right:0; top:34px;
      background:#fff; border:1px solid var(--border,#e5e7eb);
      border-radius:8px; padding:4px; min-width:220px; max-height:320px; overflow-y:auto;
      box-shadow:0 4px 12px rgba(0,0,0,.1); list-style:none; margin:0; z-index:200;
    }
    .user-switcher-wrap.open .user-switcher-menu { display:block; }
    .user-switcher-item {
      padding:7px 12px; border-radius:5px; cursor:pointer;
      font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
    }
    .user-switcher-item:hover { background:var(--surface-2,#f3f4f6); }

    /* ── Calendar plan proposal table (shared: dashboard + calendar) ── */
    .cp-wrap { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-top: 8px; }
    .cp-head {
      display: flex; align-items: center; justify-content: space-between;
      padding: 9px 12px; background: var(--surface); border-bottom: 1px solid var(--border);
    }
    .cp-head-left { display: flex; align-items: center; gap: 8px; }
    .cp-head-title { font-size: 12px; font-weight: 600; color: var(--text); }
    .cp-head-count { font-size: 11px; color: var(--text-muted); }
    .cp-table { width: 100%; border-collapse: collapse; }
    .cp-table th {
      font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
      color: var(--text-muted); padding: 6px 12px; background: var(--surface);
      border-bottom: 1px solid var(--border); text-align: left;
    }
    .cp-table td {
      padding: 8px 12px; border-bottom: 1px solid var(--border);
      vertical-align: middle; font-size: 12px; color: var(--text);
    }
    .cp-table tbody tr:last-child td { border-bottom: none; }
    .cp-table tbody tr:hover td { background: var(--surface); }
    .cp-row-added td { opacity: .5; }
    .cp-date-cell { white-space: nowrap; color: var(--text-muted); font-size: 11px; width: 72px; font-variant-numeric: tabular-nums; }
    .cp-title-cell { }
    .cp-title-text { font-size: 12px; font-weight: 500; display: inline; word-break: break-word; }
    .cp-type-badge {
      font-size: 8px; font-weight: 600; padding: 1px 4px; border-radius: 3px;
      background: var(--surface); border: 1px solid var(--border); color: var(--text-muted);
      text-transform: uppercase; letter-spacing: .04em; margin-right: 5px;
      vertical-align: middle; flex-shrink: 0; display: inline-block;
    }
    .cp-skill-cell { color: var(--text-muted); font-size: 11px; white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
    .cp-action-cell { width: 52px; text-align: right; white-space: nowrap; }
    .cp-add-btn {
      font-size: 11px; padding: 3px 10px; border-radius: 5px;
      border: 1px solid var(--border); background: var(--surface); color: var(--text);
      cursor: pointer; transition: border-color .1s;
    }
    .cp-add-btn:hover { border-color: var(--text-muted); }
    .cp-add-btn:disabled { opacity: .5; cursor: default; }
    .cp-added-check { font-size: 11px; color: var(--green, #2A9D5C); font-weight: 500; display: none; }
    .cp-row-added .cp-added-check { display: inline; }
    .cp-row-added .cp-add-btn { display: none; }
    .cp-footer {
      display: flex; align-items: center; justify-content: flex-end;
      padding: 8px 12px; background: var(--surface); border-top: 1px solid var(--border);
    }
    .cp-add-all-btn {
      font-size: 12px; padding: 5px 14px; border-radius: 6px;
      border: none; background: var(--accent); color: #fff;
      cursor: pointer; font-weight: 500; transition: opacity .12s;
    }
    .cp-add-all-btn:hover { opacity: .88; }
    .cp-add-all-btn:disabled { opacity: .5; cursor: default; }

    .cp-participants-cell {
      color: var(--text-muted); font-size: 11px; line-height: 1.6;
    }
    #fathom-calls-modal .cp-action-cell { padding-top: 12px; }
    /* Fathom Calls modal: cp-head/search and cp-footer stay fixed, only the
       table body scrolls (cp-wrap is shared with an inline-chat picker
       elsewhere that scrolls with the page instead, so this is scoped here). */
    #fathom-calls-modal .cp-wrap {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
      overflow: hidden;
    }
    #fathom-calls-modal .cp-head,
    #fathom-calls-modal .fmp-search-wrap,
    #fathom-calls-modal .cp-footer {
      flex-shrink: 0;
    }
    #fathom-calls-modal .cp-table-scroll {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
    }
    #fathom-calls-modal .cp-table thead th {
      position: sticky;
      top: 0;
      z-index: 1;
    }
    .fmp-search-wrap {
      display: flex; align-items: center; gap: 6px;
      padding: 7px 12px; border-bottom: 1px solid var(--border);
    }
    .fmp-search-icon { color: var(--text-muted); flex-shrink: 0; }
    .fmp-search-input {
      flex: 1; border: none; outline: none; background: none;
      font-size: 12px; font-family: inherit; color: var(--text);
    }
    .fmp-search-input::placeholder { color: var(--text-muted); }
    .fmp-no-results { padding: 16px 12px; text-align: center; font-size: 12px; color: var(--text-muted); }

