    /* ── Export panel ── */
    /* Base left/right/top/bottom are overridden inline by positionExportPanel() in dashboard.js,
       which uses fixed positioning computed from the trigger button's viewport rect. */
    .export-panel { left: auto; right: 0; }

    /* ── Sidebar ── */
    /* ── Sidebar ── */
    #sidebar {
      width: 240px;
      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 items ── */
    #sidebar-nav {
      padding: 4px 8px 0;
      flex-shrink: 0;
      border-bottom: 1px solid var(--border);
    }

    #nav-actions {
      padding: 4px 0 0;
    }

    #sidebar.collapsed #nav-actions { opacity: 0; pointer-events: none; }

    .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; }
    .nav-pro-badge { margin-left: auto; font-size: 10px; font-weight: 600; letter-spacing: .02em; background: rgba(110,92,230,0.12); color: #6E5CE6; border-radius: 4px; padding: 2px 6px; line-height: 1.4; flex-shrink: 0; }
    #sidebar.collapsed .nav-label { opacity: 0; pointer-events: none; }

    /* ── Sidebar content panels ── */
    #sidebar-content {
      flex: 1;
      overflow-y: auto;
      overflow-x: hidden;
      padding-top: 12px;
    }

    .scontent { display: none; padding: 6px 12px 8px; }
    .scontent.active { display: block; }

    .cl-label {
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.09em;
      color: #B8B6AE;
      padding: 8px 4px 4px;
      white-space: nowrap;
    }

    .cl-item {
      padding: 5px 8px;
      border-radius: 4px;
      font-size: 12.5px;
      color: #4A4A47;
      letter-spacing: -0.005em;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 3px;
      min-width: 0;
      transition: background .1s, color .1s;
      margin-bottom: 1px;
    }
    .cl-item:hover { background: rgba(0,0,0,0.04); color: var(--text); }
    .cl-item.active { background: rgba(0,0,0,0.04); color: #1A1A1A; font-weight: 500; }
    .cl-item-text {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    .cl-rename-btn {
      flex-shrink: 0;
      opacity: 0;
      background: none;
      border: none;
      cursor: pointer;
      font-size: 11px;
      color: var(--text-muted);
      padding: 2px 3px;
      border-radius: 3px;
      line-height: 1;
      transition: opacity .1s;
      font-family: inherit;
    }
    .cl-item:hover .cl-rename-btn,
    .cl-item.active .cl-rename-btn { opacity: 0.6; }
    .cl-rename-btn:hover { opacity: 1 !important; color: var(--text); }
    .cl-delete-btn {
      flex-shrink: 0;
      opacity: 0;
      background: none;
      border: none;
      cursor: pointer;
      font-size: 11px;
      color: var(--text-muted);
      padding: 2px 3px;
      border-radius: 3px;
      line-height: 1;
      transition: opacity .1s;
      font-family: inherit;
    }
    .cl-item:hover .cl-delete-btn,
    .cl-item.active .cl-delete-btn { opacity: 0.6; }
    .cl-delete-btn:hover { opacity: 1 !important; color: #e53e3e; }
    .cl-rename-input {
      flex: 1;
      min-width: 0;
      background: var(--bg);
      border: 1px solid var(--accent);
      border-radius: 3px;
      padding: 1px 5px;
      font-size: 12.5px;
      color: var(--text);
      font-family: inherit;
      outline: none;
    }

    /* Calendar placeholder */
    .cal-empty {
      padding: 32px 12px;
      text-align: center;
      color: var(--text-light);
      font-size: 12px;
      line-height: 1.6;
    }
    .cal-empty-icon { font-size: 24px; opacity: .25; margin-bottom: 8px; }

    /* New chat button in sidebar content */
    .new-chat-btn {
      display: flex;
      align-items: center;
      gap: 9px;
      width: 100%;
      padding: 5px 9px;
      background: none;
      border: none;
      border-radius: 5px;
      font-size: 13px;
      font-weight: 500;
      color: #6E5CE6;
      cursor: pointer;
      font-family: inherit;
      margin-bottom: 2px;
      transition: background .1s;
    }
    .new-chat-btn:hover { background: rgba(110,92,230,0.07); }

    /* ws- styles inherited from common.css */

    /* ── Delete chat confirmation modal ── */
    #delete-chat-modal {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.35);
      z-index: 900;
      align-items: center;
      justify-content: center;
    }
    #delete-chat-modal.open { display: flex; }

    /* ── Delete project confirmation modal ── */
    #delete-project-modal {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.35);
      z-index: 900;
      align-items: center;
      justify-content: center;
    }
    #delete-project-modal.open { display: flex; }
    .delete-modal-box {
      background: #fff;
      border-radius: 12px;
      padding: 24px;
      width: 380px;
      max-width: calc(100vw - 32px);
      box-shadow: 0 8px 40px rgba(0,0,0,.18);
    }
    .delete-modal-box h3 {
      font-size: 15px;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 8px;
    }
    .delete-modal-box p {
      font-size: 13px;
      color: var(--text-muted);
      line-height: 1.55;
      margin-bottom: 20px;
    }
    .delete-modal-box p strong { color: var(--text); }
    .delete-modal-actions {
      display: flex;
      gap: 8px;
      justify-content: flex-end;
    }
    .delete-modal-actions button {
      padding: 7px 16px;
      border-radius: 6px;
      font-size: 13px;
      font-family: inherit;
      cursor: pointer;
      border: none;
    }
    .delete-cancel-btn { background: var(--surface); color: var(--text-muted); }
    .delete-cancel-btn:hover { background: var(--border); }
    .delete-confirm-btn { background: var(--red); color: #fff; }
    .delete-confirm-btn:hover { background: #c92a2a; }
    .delete-confirm-btn:disabled { opacity: .5; cursor: default; }

    #sidebar.collapsed #sidebar-content { opacity: 0; pointer-events: none; }

    /* ── Calendar view ── */
    #cal-view {
      display: none;
      flex-direction: column;
      flex: 1;
      overflow: hidden;
    }
    #cal-view.active { display: flex; }

    #cal-topbar {
      padding: 13px 24px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
    }

    .cal-topbar-left {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .cal-topbar-title {
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
    }

    .cal-nav-btn {
      background: none;
      border: 1px solid var(--border);
      border-radius: 6px;
      cursor: pointer;
      padding: 4px 8px;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background .1s, color .1s, border-color .1s;
    }
    .cal-nav-btn:hover { background: var(--surface); color: var(--text); border-color: var(--text-muted); }

    .cal-today-btn {
      background: none;
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 4px 12px;
      font-size: 12px;
      font-weight: 600;
      color: var(--text-muted);
      cursor: pointer;
      font-family: inherit;
      transition: background .1s, color .1s;
    }
    .cal-today-btn:hover { background: var(--surface); color: var(--text); }

    .cal-add-btn {
      display: flex;
      align-items: center;
      gap: 6px;
      background: var(--accent);
      color: #fff;
      border: none;
      border-radius: 8px;
      padding: 7px 14px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: background .15s;
    }
    .cal-add-btn:hover { background: var(--accent-hover); }

    #cal-body {
      flex: 1;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
    }

    .cal-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      flex: 1;
    }

    .cal-weekday {
      padding: 10px 4px;
      text-align: center;
      font-size: 10.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .6px;
      color: var(--text-light);
      border-bottom: 1px solid var(--border);
      background: var(--bg);
    }

    .cal-day {
      min-height: 90px;
      padding: 6px 8px;
      border-right: 1px solid var(--border);
      border-bottom: 1px solid var(--border);
      cursor: pointer;
      transition: background .1s;
      position: relative;
      overflow: hidden;
    }
    .cal-day:nth-child(7n) { border-right: none; }
    .cal-day:hover { background: var(--bg); }
    .cal-day.outside { opacity: .3; }
    .cal-day.today { background: rgba(0,0,0,.02); }

    .cal-day-num {
      font-size: 12px;
      font-weight: 500;
      color: var(--text-muted);
      margin-bottom: 4px;
    }
    .cal-day.today .cal-day-num {
      background: var(--accent);
      color: #fff;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 11px;
    }

    .cal-event {
      font-size: 11px;
      padding: 2px 6px;
      border-radius: 4px;
      margin-bottom: 2px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      cursor: pointer;
      font-weight: 500;
      line-height: 1.5;
    }
    .cal-event.campaign  { background: rgba(99,102,241,.1); color: #4338ca; }
    .cal-event.publish   { background: rgba(22,163,74,.1);  color: var(--green); }
    .cal-event.audit     { background: rgba(234,179,8,.1);  color: #a16207; }
    .cal-event.social    { background: rgba(220,38,38,.1);  color: var(--red); }
    .cal-event.default   { background: var(--surface);      color: var(--text-muted); }

    .cal-more {
      font-size: 10px;
      color: var(--text-light);
      padding: 1px 6px;
      font-weight: 600;
    }

    /* Add event modal */
    .cal-modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.3);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 200;
    }

    .cal-modal {
      background: #fff;
      border-radius: 14px;
      box-shadow: 0 16px 48px rgba(0,0,0,.15);
      width: 380px;
      max-width: 90vw;
      overflow: hidden;
    }

    .cal-modal-header {
      padding: 16px 20px 12px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .cal-modal-title {
      font-size: 14px;
      font-weight: 700;
      color: var(--text);
    }

    .cal-modal-close {
      background: none;
      border: none;
      cursor: pointer;
      padding: 4px;
      border-radius: 5px;
      color: var(--text-muted);
      display: flex;
      transition: background .1s;
    }
    .cal-modal-close:hover { background: var(--surface); }

    .cal-modal-body {
      padding: 16px 20px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .cal-field label {
      display: block;
      font-size: 11.5px;
      font-weight: 600;
      color: var(--text-muted);
      margin-bottom: 4px;
      text-transform: uppercase;
      letter-spacing: .4px;
    }

    .cal-field input,
    .cal-field select {
      width: 100%;
      padding: 8px 10px;
      border: 1.5px solid var(--border);
      border-radius: 7px;
      font-size: 13px;
      color: var(--text);
      font-family: inherit;
      outline: none;
      background: #fff;
      transition: border-color .15s;
    }
    .cal-field input:focus,
    .cal-field select:focus { border-color: var(--accent); }

    .cal-modal-footer {
      padding: 12px 20px 16px;
      display: flex;
      gap: 8px;
      justify-content: flex-end;
    }

    .cal-modal-cancel {
      background: none;
      border: 1px solid var(--border);
      border-radius: 7px;
      padding: 7px 16px;
      font-size: 13px;
      color: var(--text-muted);
      cursor: pointer;
      font-family: inherit;
      transition: border-color .12s, color .12s;
    }
    .cal-modal-cancel:hover { border-color: var(--text-muted); color: var(--text); }

    .cal-modal-save {
      background: var(--accent);
      color: #fff;
      border: none;
      border-radius: 7px;
      padding: 7px 16px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: background .15s;
    }
    .cal-modal-save:hover { background: var(--accent-hover); }

    /* Sidebar upcoming list */
    .cal-upcoming { padding: 4px 0; }
    .cal-upcoming-item {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      padding: 6px 8px;
      border-radius: 6px;
      cursor: pointer;
      transition: background .1s;
      margin-bottom: 1px;
    }
    .cal-upcoming-item:hover { background: var(--surface); }

    .cal-upcoming-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      flex-shrink: 0;
      margin-top: 5px;
    }
    .cal-upcoming-dot.campaign { background: #4338ca; }
    .cal-upcoming-dot.publish  { background: var(--green); }
    .cal-upcoming-dot.audit    { background: #a16207; }
    .cal-upcoming-dot.social   { background: var(--red); }
    .cal-upcoming-dot.default  { background: var(--text-light); }

    .cal-upcoming-info { flex: 1; min-width: 0; }
    .cal-upcoming-name {
      font-size: 12px;
      font-weight: 500;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .cal-upcoming-date {
      font-size: 10.5px;
      color: var(--text-light);
    }

    /* ── Workflow suggestion card (in agent chat) - disabled ── */
    /* .wf-suggest-card {
      margin-top: 10px; padding: 11px 13px;
      background: var(--surface); border: 1.5px solid var(--border); border-radius: 10px;
    }
    .wf-suggest-text { font-size: 12.5px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.5; }
    .wf-suggest-actions { display: flex; align-items: center; gap: 8px; }
    .wf-suggest-yes {
      background: var(--accent); color: #fff; border: none; border-radius: 6px;
      padding: 5px 13px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
      transition: background .1s;
    }
    .wf-suggest-yes:hover { background: var(--accent-hover); }
    .wf-suggest-dismiss {
      border: none; background: none; color: var(--text-light); font-size: 12px;
      cursor: pointer; font-family: inherit; padding: 5px 2px;
    }
    .wf-suggest-dismiss:hover { color: var(--text-muted); } */

    /* ── Welcome screen ── */
    #welcome-screen {
      position: fixed;
      inset: 0;
      background: var(--bg);
      z-index: 200;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: opacity .35s, visibility .35s;
    }
    #welcome-screen.hidden {
      opacity: 0;
      visibility: hidden;
      pointer-events: none;
    }

    .welcome-card {
      max-width: 520px;
      width: 100%;
      padding: 0 24px;
    }
    .welcome-logo {
      font-family: 'Instrument Serif', serif;
      font-size: 28px;
      color: var(--text);
      margin-bottom: 32px;
    }
    .welcome-heading {
      font-family: 'Instrument Serif', serif;
      font-size: 32px;
      line-height: 1.25;
      color: var(--text);
      margin-bottom: 12px;
    }
    .welcome-sub {
      font-size: 15px;
      color: var(--text-muted);
      line-height: 1.65;
      margin-bottom: 28px;
    }
    .welcome-input-wrap {
      display: flex;
      gap: 8px;
      margin-bottom: 16px;
    }
    .welcome-input-wrap input {
      flex: 1;
      padding: 12px 16px;
      border: 1.5px solid var(--border);
      border-radius: 10px;
      font-size: 15px;
      font-family: inherit;
      color: var(--text);
      outline: none;
      transition: border-color .15s;
    }
    .welcome-input-wrap input:focus { border-color: var(--accent); }
    .welcome-input-wrap input::placeholder { color: var(--text-light); }
    .welcome-input-wrap button {
      background: var(--accent);
      color: #fff;
      border: none;
      border-radius: 10px;
      padding: 12px 24px;
      font-size: 15px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      white-space: nowrap;
      transition: background .15s;
    }
    .welcome-input-wrap button:hover { background: var(--accent-hover); }
    .welcome-input-wrap button:disabled { opacity: .5; cursor: default; }

    .welcome-steps {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-bottom: 28px;
    }
    .welcome-step {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      font-size: 13.5px;
      color: var(--text-muted);
      line-height: 1.5;
    }
    .welcome-step-icon {
      flex-shrink: 0;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: var(--surface);
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
      color: var(--text-light);
      margin-top: 1px;
    }

    .welcome-footer {
      font-size: 12.5px;
      color: var(--text-light);
      line-height: 1.6;
      padding-top: 16px;
      border-top: 1px solid var(--border);
    }

    /* ── Plan card ── */
    .plan-block {
      margin-top: 10px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .plan-week {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
    }

    .plan-week-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 10px 14px;
      background: var(--bg);
      border-bottom: 1px solid var(--border);
    }

    .plan-week-title {
      font-size: 12.5px;
      font-weight: 700;
      color: var(--text);
    }

    .plan-week-theme {
      font-size: 11px;
      color: var(--text-muted);
      font-weight: 500;
    }

    .plan-item {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 14px;
      border-bottom: 1px solid var(--border);
      transition: background .1s;
    }
    .plan-item:last-child { border-bottom: none; }
    .plan-item:hover { background: var(--bg); }

    .plan-item-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      flex-shrink: 0;
    }
    .plan-item-dot.campaign { background: #4338ca; }
    .plan-item-dot.publish  { background: var(--green); }
    .plan-item-dot.audit    { background: #a16207; }
    .plan-item-dot.social   { background: var(--red); }

    .plan-item-info { flex: 1; min-width: 0; }

    .plan-item-name {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
    }

    .plan-item-desc {
      font-size: 11.5px;
      color: var(--text-muted);
      margin-top: 1px;
    }

    .plan-item-date {
      font-size: 11.5px;
      color: var(--text-light);
      white-space: nowrap;
      flex-shrink: 0;
    }

    .plan-item-type {
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: .3px;
      padding: 2px 7px;
      border-radius: 5px;
      flex-shrink: 0;
    }
    .plan-item-type.campaign { background: rgba(99,102,241,.1); color: #4338ca; }
    .plan-item-type.publish  { background: rgba(22,163,74,.1);  color: var(--green); }
    .plan-item-type.audit    { background: rgba(234,179,8,.1);  color: #a16207; }
    .plan-item-type.social   { background: rgba(220,38,38,.1);  color: var(--red); }

    .plan-edit-area {
      width: 100%;
      min-height: 200px;
      background: var(--bg);
      border: 1.5px solid var(--border);
      border-radius: 8px;
      padding: 12px 14px;
      font-size: 12.5px;
      font-family: inherit;
      color: var(--text);
      line-height: 1.6;
      resize: vertical;
      outline: none;
    }
    .plan-edit-area:focus { border-color: var(--accent); }

    /* ── Audit results ── */
    .audit-block {
      margin-top: 10px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }

    .audit-scores {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .audit-score-card {
      flex: 1;
      min-width: 100px;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 14px 12px;
      text-align: center;
    }

    .audit-score-ring {
      width: 52px;
      height: 52px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 8px;
      font-size: 17px;
      font-weight: 700;
      position: relative;
    }
    .audit-score-ring.good   { background: rgba(22,163,74,.1); color: var(--green); border: 3px solid var(--green); }
    .audit-score-ring.ok     { background: rgba(234,179,8,.08); color: #a16207; border: 3px solid #e5a100; }
    .audit-score-ring.bad    { background: rgba(220,38,38,.08); color: var(--red); border: 3px solid var(--red); }

    .audit-score-label {
      font-size: 11.5px;
      font-weight: 600;
      color: var(--text-muted);
      text-transform: capitalize;
    }

    .audit-page-card {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
    }

    .audit-page-header {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 14px;
      background: var(--bg);
      border-bottom: 1px solid var(--border);
      cursor: pointer;
      user-select: none;
    }
    .audit-page-header:hover { background: var(--surface); }

    .audit-page-url {
      flex: 1;
      font-size: 12.5px;
      font-weight: 600;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .audit-page-scores {
      display: flex;
      gap: 6px;
      flex-shrink: 0;
    }

    .audit-mini-score {
      font-size: 11px;
      font-weight: 700;
      padding: 2px 7px;
      border-radius: 5px;
    }
    .audit-mini-score.good { background: rgba(22,163,74,.1); color: var(--green); }
    .audit-mini-score.ok   { background: rgba(234,179,8,.08); color: #a16207; }
    .audit-mini-score.bad  { background: rgba(220,38,38,.08); color: var(--red); }

    .audit-page-chevron {
      font-size: 9px;
      color: var(--text-light);
      transition: transform .15s;
      flex-shrink: 0;
    }
    .audit-page-card.open .audit-page-chevron { transform: rotate(90deg); }

    .audit-page-body {
      display: none;
      padding: 10px 14px;
    }
    .audit-page-card.open .audit-page-body { display: block; }

    .audit-issue {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      padding: 7px 0;
      border-bottom: 1px solid var(--bg);
      font-size: 12.5px;
    }
    .audit-issue:last-child { border-bottom: none; }

    .audit-issue-icon {
      font-size: 10px;
      margin-top: 3px;
      flex-shrink: 0;
    }
    .audit-issue-icon.fail { color: var(--red); }
    .audit-issue-icon.warn { color: #a16207; }

    .audit-issue-text { flex: 1; color: var(--text-muted); line-height: 1.45; }
    .audit-issue-text strong { color: var(--text); font-weight: 600; }

    .audit-issue-val {
      font-size: 11px;
      color: var(--text-light);
      flex-shrink: 0;
      white-space: nowrap;
    }

    #topbar {
      padding: 5px 24px;
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-shrink: 0;
    }

    #topbar-user {
      display: flex;
      align-items: center;
      gap: 8px;
      flex-shrink: 0;
    }

    #topbar-title { font-size: 14px; font-weight: 600; }
    #topbar-title-container {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    #topbar-rename-btn {
      background: none;
      border: none;
      cursor: pointer;
      font-size: 12px;
      color: var(--text-muted);
      opacity: 0;
      padding: 2px 4px;
      border-radius: 4px;
      line-height: 1;
      transition: opacity .12s;
      font-family: inherit;
    }
    #topbar-title-container:hover #topbar-rename-btn { opacity: 0.6; }
    #topbar-rename-btn:hover { opacity: 1 !important; }
    #topbar-rename-input {
      background: none;
      border: none;
      border-bottom: 1.5px solid var(--accent);
      font-size: 14px;
      font-weight: 600;
      color: var(--text);
      font-family: inherit;
      outline: none;
      padding: 0 2px;
      min-width: 80px;
      max-width: 280px;
    }

    .badge {
      font-size: 11px;
      background: var(--accent-bg);
      color: var(--accent);
      border: 1px solid rgba(99,102,241,.2);
      border-radius: 20px;
      padding: 3px 9px;
      font-weight: 500;
    }

    /* ── Messages ── */
    #messages {
      flex: 1;
      min-width: 0;
      overflow-x: hidden;
      overflow-y: auto;
      padding: 32px 0 40px;
      display: flex;
      flex-direction: column;
      gap: 32px;
    }

    #messages::-webkit-scrollbar { width: 4px; }
    #messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

    /* Empty / welcome state */
    #welcome {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 32px 24px 16px;
      text-align: center;
      gap: 10px;
    }

    #welcome h2 {
      font-size: 21px;
      font-weight: 700;
      letter-spacing: -.4px;
    }

    #welcome p {
      font-size: 14px;
      color: var(--text-muted);
      max-width: 340px;
      line-height: 1.6;
    }

    .action-cards {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      justify-content: center;
      margin-top: 12px;
      max-width: 580px;
    }

    .ac {
      background: #fff;
      border: 1.5px solid var(--border);
      border-radius: 12px;
      padding: 18px 16px;
      width: 174px;
      text-align: left;
      cursor: pointer;
      transition: border-color .15s, box-shadow .15s, transform .1s;
      position: relative;
    }
    .ac:hover {
      border-color: var(--accent);
      box-shadow: 0 3px 16px rgba(99,102,241,.1);
      transform: translateY(-1px);
    }

    .ac-icon { font-size: 20px; margin-bottom: 10px; display: block; }
    .ac-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
    .ac-desc { font-size: 12px; color: var(--text-muted); line-height: 1.45; }

    .ac-tag {
      position: absolute;
      top: -9px;
      left: 12px;
      background: var(--accent);
      color: #fff;
      font-size: 10px;
      font-weight: 600;
      padding: 2px 7px;
      border-radius: 10px;
    }

    /* Message rows */
    .msg-row {
      display: flex;
      flex-direction: column;
      padding: 0 24px;
      gap: 0;
      max-width: 900px;
      width: 100%;
      min-width: 0;
      align-self: center;
      box-sizing: border-box;
    }

    .msg-row.msg-user {
      flex-direction: row;
      justify-content: flex-end;
    }

    /* Avatars hidden - replaced by assistant-tag */
    .avatar { display: none; }

    /* Assistant tag: brand mark + label above message body */
    .assistant-tag {
      display: flex;
      align-items: center;
      gap: 8px;
      margin-bottom: 10px;
    }
    .brand-mark {
      width: 20px;
      height: 20px;
      background: #8c6cff;
      border-radius: 5px;
      overflow: hidden;
      padding: 3px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .assistant-label {
      font-size: 11px;
      font-weight: 600;
      letter-spacing: 0.06em;
      text-transform: uppercase;
      color: #9A9A95;
    }

    .msg-body {
      flex: 1;
      min-width: 0;
      overflow-x: hidden;
      font-size: 14px;
      line-height: 1.65;
      color: var(--text);
      padding-top: 0;
    }

    /* Inline form (bot asks for URL + keyword) */
    .inline-form {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 18px 18px 14px;
      margin-top: 8px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    .inline-form .if-label {
      font-size: 12.5px;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 2px;
    }

    .inline-form input {
      width: 100%;
      background: var(--bg);
      border: 1.5px solid var(--border);
      border-radius: 8px;
      padding: 9px 12px;
      font-size: 13.5px;
      color: var(--text);
      outline: none;
      font-family: inherit;
      transition: border-color .15s;
    }
    .inline-form input:focus { border-color: var(--accent); }
    .inline-form input::placeholder { color: var(--text-light); }

    .if-go {
      align-self: flex-end;
      background: var(--accent);
      color: #fff;
      border: none;
      border-radius: 8px;
      padding: 8px 20px;
      font-size: 13.5px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: background .15s;
      margin-top: 2px;
    }
    .if-go:hover { background: var(--accent-hover); }

    .if-cancel {
      align-self: flex-end;
      background: transparent;
      color: var(--text-muted);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 8px 16px;
      font-size: 13.5px;
      font-weight: 500;
      cursor: pointer;
      font-family: inherit;
      transition: color .15s, border-color .15s;
      margin-top: 2px;
    }
    .if-cancel:hover { color: var(--text); border-color: var(--text-muted); }

    /* ── Progress block ── */
    .progress-block {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 14px 16px;
      margin-top: 8px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .pb-headline {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 2px;
    }

    .pb-step {
      display: flex;
      align-items: center;
      gap: 9px;
      font-size: 13px;
      color: var(--text-light);
      transition: color .25s;
    }
    .pb-step.done  { color: var(--text-muted); }
    .pb-step.live  { color: var(--text); }

    .pb-icon {
      width: 16px;
      height: 16px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 11px;
    }

    .pb-step.done .pb-icon::before  { content: '✓'; color: var(--green); font-weight: 700; }
    .pb-step.live .pb-icon::before  { content: ''; display: block; width: 10px; height: 10px; border: 2px solid var(--accent); border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
    .pb-step.idle .pb-icon::before  { content: '·'; color: var(--text-light); font-size: 18px; line-height: 0; }

    /* ── Results (inline in chat) ── */
    .results-block {
      margin-top: 10px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .rb-intro {
      font-size: 14px;
      line-height: 1.6;
      color: var(--text);
    }

    /* Stats */
    .rb-stats {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .rb-stat {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px 16px;
      flex: 1;
      min-width: 100px;
    }
    .rb-stat-val { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
    .rb-stat-val.red    { color: var(--red); }
    .rb-stat-val.yellow { color: var(--yellow); }
    .rb-stat-val.green  { color: var(--green); }
    .rb-stat-lbl { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

    /* Time saved */
    .rb-saved {
      background: rgba(22,163,74,.07);
      border: 1px solid rgba(22,163,74,.18);
      border-radius: 9px;
      padding: 10px 14px;
      font-size: 13px;
      color: var(--green);
      font-weight: 500;
    }

    /* Section header */
    .rb-section {
      font-size: 12.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .5px;
      color: var(--text-light);
      margin-bottom: -4px;
    }

    /* Gap table */
    .gap-table {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
    }

    .gap-row {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 14px;
      border-bottom: 1px solid var(--border);
      font-size: 13px;
      transition: background .1s;
    }
    .gap-row:last-child { border-bottom: none; }
    .gap-row:hover { background: var(--bg); }

    .gs {
      width: 18px; height: 18px;
      border-radius: 50%;
      flex-shrink: 0;
      display: flex; align-items: center; justify-content: center;
      font-size: 10px; font-weight: 700;
    }
    .gs.ok   { background: rgba(22,163,74,.1);   color: var(--green); }
    .gs.miss { background: rgba(220,38,38,.1);   color: var(--red); }
    .gs.weak { background: rgba(202,138,4,.1);   color: var(--yellow); }

    .gt  { flex: 1; color: var(--text); }
    .gc  { font-size: 11.5px; color: var(--text-light); text-align: right; }
    .gc strong { color: var(--text-muted); font-weight: 500; }

    /* Headings */
    .heading-list {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px 14px;
      display: flex;
      flex-direction: column;
      gap: 0;
    }

    .h-row {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 0;
      border-bottom: 1px solid var(--bg);
      font-size: 13px;
    }
    .h-row:last-child { border-bottom: none; }

    .h-tag {
      font-size: 10px;
      font-weight: 700;
      font-family: monospace;
      background: var(--surface);
      color: var(--text-muted);
      border-radius: 3px;
      padding: 2px 4px;
      flex-shrink: 0;
    }
    .h-tag.add { background: var(--accent-bg); color: var(--accent); }

    .h-text { flex: 1; }

    .h-badge {
      font-size: 10.5px;
      background: var(--accent-bg);
      color: var(--accent);
      border-radius: 8px;
      padding: 1px 7px;
      font-weight: 500;
    }

    /* CTA buttons inline */
    .rb-ctas {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      padding-top: 2px;
    }

    .cta-primary {
      background: var(--accent);
      color: #fff;
      border: none;
      border-radius: 8px;
      padding: 10px 18px;
      font-size: 13.5px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: background .15s;
    }
    .cta-primary:hover { background: var(--accent-hover); }

    .cta-ghost {
      background: #fff;
      color: var(--text);
      border: 1.5px solid var(--border);
      border-radius: 8px;
      padding: 10px 16px;
      font-size: 13.5px;
      font-weight: 500;
      cursor: pointer;
      font-family: inherit;
      transition: border-color .15s;
    }
    .cta-ghost:hover { border-color: var(--text-muted); }

    /* Onboarding suggestion pills */
    .suggestion-pills {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-top: 14px;
    }
    .suggestion-pill {
      display: inline-flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      background: var(--surface);
      color: var(--text);
      border: 1.5px solid var(--border);
      border-radius: 10px;
      padding: 9px 14px;
      font-size: 13px;
      font-weight: 500;
      cursor: pointer;
      font-family: inherit;
      transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
      text-align: left;
      max-width: 480px;
    }
    .suggestion-pill::after {
      content: '→';
      font-size: 13px;
      opacity: 0.45;
      flex-shrink: 0;
      transition: opacity .15s, transform .15s;
    }
    .suggestion-pill:hover {
      background: var(--text);
      border-color: var(--text);
      color: #fff;
      box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    }
    .suggestion-pill:hover::after {
      opacity: 1;
      transform: translateX(2px);
    }
    .suggestion-pill:active {
      transform: scale(0.98);
    }

    /* ── New-chat welcome screen ── */
    @keyframes welcomeItemIn {
      from { opacity: 0; transform: translateY(8px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    .chat-welcome-screen {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 20px 24px 60px;
    }

    .welcome-greeting {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      margin-bottom: 8px;
      animation: welcomeItemIn 0.3s cubic-bezier(0.2,0,0,1) both;
      animation-delay: 0ms;
    }

    .welcome-greeting-pre {
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      letter-spacing: 0.1em;
      text-transform: uppercase;
      text-align: center;
    }

    .welcome-greeting-name {
      font-size: 44px;
      font-weight: 800;
      letter-spacing: -2px;
      line-height: 1.05;
      color: var(--text);
      text-align: center;
    }

    .welcome-sub {
      font-size: 13px;
      color: var(--text-muted);
      text-align: center;
      margin-bottom: 28px;
      animation: welcomeItemIn 0.3s cubic-bezier(0.2,0,0,1) both;
      animation-delay: 40ms;
    }

    .welcome-cards-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 7px;
      width: 100%;
      max-width: 560px;
      margin-bottom: 20px;
    }

    .welcome-card {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 11px;
      background: var(--bg);
      border: 1.5px solid var(--border);
      border-radius: 11px;
      padding: 12px 13px;
      cursor: pointer;
      font-family: inherit;
      text-align: left;
      transition: border-color .15s, box-shadow .14s, transform .12s;
      animation: welcomeItemIn 0.35s cubic-bezier(0.2,0,0,1) both;
    }

    .welcome-card:hover {
      border-color: var(--text);
      box-shadow: 0 3px 14px rgba(0,0,0,0.08);
      transform: translateY(-1px);
    }

    .welcome-card:active {
      transform: translateY(0) scale(0.98);
    }

    .welcome-card-chip {
      width: 32px;
      height: 32px;
      border-radius: 8px;
      background: var(--surface);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--text-muted);
      flex-shrink: 0;
      transition: background .15s, color .15s;
    }

    .welcome-card:hover .welcome-card-chip {
      background: var(--text);
      color: #fff;
    }

    .welcome-card-content {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .welcome-card-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
      line-height: 1.25;
    }

    .welcome-card-desc {
      font-size: 11.5px;
      color: var(--text-muted);
      line-height: 1.35;
    }

    .welcome-card-arr {
      font-size: 13px;
      color: var(--text-muted);
      flex-shrink: 0;
      opacity: 0;
      transform: translateX(-4px);
      transition: opacity .15s, transform .15s;
    }

    .welcome-card:hover .welcome-card-arr {
      opacity: 1;
      transform: translateX(0);
    }

    .welcome-hint {
      font-size: 12px;
      color: var(--text-muted);
      letter-spacing: 0.01em;
      animation: welcomeItemIn 0.3s ease both;
      animation-delay: 380ms;
    }

    @media (max-width: 520px) {
      .welcome-cards-grid { grid-template-columns: 1fr; }
      .welcome-greeting-name { font-size: 36px; letter-spacing: -1.5px; }
    }

    /* Typing dots */
    .typing {
      display: flex;
      gap: 4px;
      align-items: center;
      padding-top: 2px;
    }
    .t-dot {
      width: 6px; height: 6px;
      background: var(--text-light);
      border-radius: 50%;
      animation: bob 1.1s ease-in-out infinite;
    }
    .t-dot:nth-child(2) { animation-delay: .18s; }
    .t-dot:nth-child(3) { animation-delay: .36s; }
    @keyframes bob {
      0%,60%,100% { transform: translateY(0); }
      30% { transform: translateY(-5px); }
    }

    /* ── Input bar ── */
    #input-area {
      padding: 12px 24px 16px;
      border-top: 0.5px solid rgba(0,0,0,0.08);
      flex-shrink: 0;
    }

    #input-wrap {
      max-width: 900px;
      margin: 0 auto;
      background: #fff;
      border: 0.5px solid rgba(0,0,0,0.15);
      border-radius: 12px;
      display: flex;
      flex-direction: column;
      gap: 0;
      padding: 12px 12px 8px 14px;
      box-shadow: 0 1px 2px rgba(0,0,0,0.03);
      transition: border-color .15s;
    }
    #input-row {
      display: flex;
      align-items: flex-start;
    }
    #input-bottom {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-top: 8px;
    }
    #input-bottom-left {
      display: flex;
      align-items: center;
      gap: 4px;
    }
    #input-bottom-right {
      display: flex;
      align-items: center;
      gap: 8px;
    }
    #input-wrap:focus-within { border-color: rgba(0,0,0,0.3); }

    #user-input {
      flex: 1;
      background: none;
      border: none;
      outline: none;
      color: var(--text);
      font-size: 14px;
      line-height: 1.5;
      letter-spacing: -0.005em;
      resize: none;
      max-height: 180px;
      font-family: inherit;
      padding: 2px 0;
    }
    #user-input::placeholder { color: var(--text-light); letter-spacing: -0.005em; }

    #send-btn {
      background: #1A1A1A;
      border: none;
      border-radius: 6px;
      width: 28px; height: 28px;
      display: flex; align-items: center; justify-content: center;
      cursor: pointer;
      flex-shrink: 0;
      transition: background .15s, opacity .15s;
    }
    #send-btn:hover { background: #000; }
    #send-btn:disabled { opacity: .3; cursor: default; }
    #send-btn.stop { background: #1A1A1A; border: none; }
    #send-btn.stop:hover { background: #000; }

    #attach-btn {
      background: none;
      border: none;
      cursor: pointer;
      padding: 5px;
      border-radius: 6px;
      color: var(--text-muted);
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background .12s, color .12s;
    }
    #attach-btn:hover { background: rgba(0,0,0,0.04); color: var(--text); }

    #file-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      padding: 8px 4px 4px;
    }

    /* ── Attachment card (ChatGPT/Claude style) ── */
    .attach-card {
      position: relative;
      display: flex;
      align-items: center;
      gap: 9px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 8px 30px 8px 10px;
      width: 190px;
      flex-shrink: 0;
      overflow: hidden;
      transition: border-color .12s;
    }
    .attach-card.error { border-color: #f87171; }

    .attach-card-icon {
      width: 34px;
      height: 34px;
      border-radius: 7px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 9px;
      font-weight: 700;
      letter-spacing: .03em;
      color: #fff;
      flex-shrink: 0;
      text-transform: uppercase;
    }

    .attach-card-info {
      flex: 1;
      min-width: 0;
    }
    .attach-card-name {
      font-size: 12.5px;
      font-weight: 500;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .attach-card-meta {
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 2px;
      white-space: nowrap;
    }
    .attach-card.error .attach-card-meta { color: #f87171; }

    .attach-card-remove {
      position: absolute;
      top: 5px;
      right: 5px;
      background: none;
      border: none;
      cursor: pointer;
      color: var(--text-muted);
      font-size: 16px;
      line-height: 1;
      padding: 0;
      width: 18px;
      height: 18px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      transition: color .1s, background .1s;
    }
    .attach-card-remove:hover { color: var(--text); background: var(--border); }

    .attach-card-progress {
      position: absolute;
      bottom: 0;
      left: 0;
      height: 3px;
      background: var(--accent);
      border-radius: 0 0 0 10px;
      transition: width .12s linear;
      pointer-events: none;
    }

    .file-hint-banner {
      font-size: 12px;
      color: var(--text-muted);
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 6px 10px;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .model-fallback-notice {
      font-size: 0.75rem;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      gap: 5px;
      margin-bottom: 10px;
      opacity: 0.8;
    }

    #model-selector {
      display: flex;
      align-items: center;
      gap: 4px;
      flex-shrink: 0;
      position: relative;
    }
    #model-btn {
      appearance: none;
      background: none;
      border: 0.5px solid rgba(0,0,0,0.1);
      border-radius: 5px;
      padding: 4px 20px 4px 9px;
      font-size: 11.5px;
      font-weight: 500;
      font-family: inherit;
      color: #4A4A47;
      cursor: pointer;
      outline: none;
      transition: background .12s;
      background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23B8B6AE' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 6px center;
      white-space: nowrap;
      letter-spacing: -0.005em;
    }
    #model-btn:hover { background-color: rgba(0,0,0,0.02); }
    #model-dropdown {
      position: absolute;
      bottom: calc(100% + 6px);
      left: 0;
      min-width: 180px;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 8px;
      box-shadow: 0 4px 16px rgba(0,0,0,.1);
      padding: 4px;
      z-index: 200;
      display: none;
      max-height: 450px;
      overflow: auto;
    }
    #model-dropdown.open { display: block; }
    .model-opt {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 10px;
      border-radius: 5px;
      font-size: 12px;
      cursor: pointer;
      color: var(--text);
      transition: background .1s;
    }
    .model-opt:hover { background: var(--surface); }
    .model-opt.active { font-weight: 600; }
    .model-opt.no-key { color: var(--text-light); cursor: pointer; }
    .model-opt.no-key:hover { background: var(--surface); color: var(--text-muted); }
    .model-opt .key-badge {
      margin-left: auto;
      font-size: 10px;
      color: var(--text-light);
    }
    .model-opt.active .key-badge { display: none; }
    .model-dropdown-divider {
      height: 1px;
      background: var(--border);
      margin: 4px 2px;
    }
    .model-opt.manage-keys { color: var(--text-muted); font-size: 11.5px; }
    .model-opt.manage-keys:hover { color: var(--text); }

    /* ── Attach menu (attach button popup) ── */
    #attach-selector { position: relative; flex-shrink: 0; }
    #attach-menu {
      position: absolute;
      bottom: calc(100% + 6px);
      left: 0;
      min-width: 170px;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 8px;
      box-shadow: 0 4px 16px rgba(0,0,0,.1);
      padding: 4px;
      z-index: 200;
      display: none;
    }
    #attach-menu.open { display: block; }
    .attach-opt {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 7px 10px;
      border-radius: 5px;
      font-size: 12.5px;
      cursor: pointer;
      color: var(--text);
      transition: background .1s;
    }
    .attach-opt:hover { background: var(--surface); }
    .attach-opt svg { flex-shrink: 0; }

    /* ── Fathom Calls modal ── */
    #fathom-calls-modal {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.35);
      z-index: 900;
      align-items: center;
      justify-content: center;
    }
    #fathom-calls-modal.open { display: flex; }
    .fathom-calls-box {
      background: #fff;
      border-radius: 12px;
      padding: 18px 20px 20px;
      width: 640px;
      max-width: calc(100vw - 32px);
      max-height: 80vh;
      box-shadow: 0 8px 40px rgba(0,0,0,.18);
      /* Header/footer stay put; only #fathom-calls-body's content scrolls
         (previously overflow:auto here scrolled the whole box, header and all). */
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }
    .fathom-calls-box-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      font-size: 15px;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 14px;
      flex-shrink: 0;
    }
    #fathom-calls-body {
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0;
    }
    .fathom-calls-close-btn {
      background: none;
      border: none;
      cursor: pointer;
      color: var(--text-muted);
      padding: 4px;
      display: flex;
    }
    .fathom-calls-close-btn:hover { color: var(--text); }
    .fmp-loading, .fmp-empty {
      padding: 24px 4px;
      text-align: center;
      font-size: 13px;
      color: var(--text-muted);
    }
    .fmp-connect-empty {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      padding: 40px 24px 32px;
      gap: 4px;
    }
    .fmp-connect-icon {
      width: 48px;
      height: 48px;
      border-radius: 50%;
      background: var(--sidebar-bg);
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 10px;
    }
    .fmp-connect-title {
      font-size: 15px;
      font-weight: 600;
      color: var(--text);
    }
    .fmp-connect-sub {
      font-size: 13px;
      color: var(--text-muted);
      line-height: 1.5;
      max-width: 300px;
      margin-bottom: 14px;
    }
    .fmp-connect-btn {
      padding: 8px 22px;
      background: var(--accent);
      color: #fff;
      border: none;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: background .12s;
    }
    .fmp-connect-btn:hover:not(:disabled) { background: var(--accent-hover); }
    .fmp-connect-btn:disabled { opacity: .5; cursor: default; }

    /* ── API Key Modal ── */
    #api-key-modal {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.35);
      z-index: 900;
      align-items: center;
      justify-content: center;
    }
    #api-key-modal.open { display: flex; }
    .api-key-box {
      background: #fff;
      border-radius: 12px;
      padding: 24px;
      width: 440px;
      max-width: calc(100vw - 32px);
      box-shadow: 0 8px 40px rgba(0,0,0,.18);
    }
    .api-key-box h3 {
      font-size: 15px;
      font-weight: 600;
      margin-bottom: 4px;
      color: var(--text);
    }
    .api-key-box p {
      font-size: 12.5px;
      color: var(--text-muted);
      margin-bottom: 18px;
      line-height: 1.5;
    }
    .api-key-field { margin-bottom: 12px; }
    .api-key-field label {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      font-weight: 500;
      color: var(--text-muted);
      margin-bottom: 5px;
    }
    .api-key-field label .key-status {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--border);
      flex-shrink: 0;
    }
    .api-key-field label .key-status.has-key { background: var(--green); }
    .api-key-field input {
      width: 100%;
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 7px 10px;
      font-size: 12.5px;
      font-family: monospace;
      color: var(--text);
      outline: none;
      transition: border-color .15s;
      -webkit-text-security: disc;
    }
    .api-key-field input:focus { border-color: var(--accent); }
    .api-key-field input::placeholder { font-family: ui-sans-serif, -apple-system, sans-serif; color: var(--text-light); }
    .key-validate-status {
      display: block;
      font-size: 11px;
      margin-top: 4px;
      min-height: 16px;
      font-family: ui-sans-serif, -apple-system, sans-serif;
    }
    .key-validate-status.checking { color: var(--text-muted); }
    .key-validate-status.valid { color: var(--green, #22c55e); }
    .key-validate-status.invalid { color: #ef4444; }
    .api-key-actions {
      display: flex;
      gap: 8px;
      justify-content: flex-end;
      margin-top: 18px;
    }
    .api-key-actions button {
      padding: 7px 16px;
      border-radius: 6px;
      font-size: 13px;
      cursor: pointer;
      border: none;
      font-family: inherit;
    }
    .api-key-cancel { background: var(--surface); color: var(--text-muted); }
    .api-key-cancel:hover { background: var(--border); }
    .api-key-save { background: var(--accent); color: #fff; }
    .api-key-save:hover { background: var(--accent-hover); }

    .api-key-copy-section {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 12px 14px;
      margin-bottom: 16px;
    }
    .api-key-copy-label {
      font-size: 11.5px;
      font-weight: 500;
      color: var(--text-muted);
      margin-bottom: 8px;
    }
    .api-key-copy-row {
      display: flex;
      gap: 8px;
      align-items: center;
    }
    .api-key-copy-row select {
      flex: 1;
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 6px 10px;
      font-size: 12.5px;
      font-family: inherit;
      color: var(--text);
      background: var(--bg);
      outline: none;
      cursor: pointer;
    }
    .api-key-copy-row select:focus { border-color: var(--accent); }
    .api-key-copy-btn {
      padding: 6px 14px;
      border-radius: 6px;
      font-size: 12.5px;
      font-weight: 500;
      font-family: inherit;
      border: none;
      background: var(--accent);
      color: #fff;
      cursor: pointer;
      white-space: nowrap;
      flex-shrink: 0;
    }
    .api-key-copy-btn:hover { background: var(--accent-hover); }
    .api-key-copy-btn:disabled { opacity: .55; cursor: default; }
    .api-key-or-divider {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 14px;
      font-size: 11.5px;
      color: var(--text-light);
    }
    .api-key-or-divider::before,
    .api-key-or-divider::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border);
    }

    /* Help mode pill */
    .help-mode-pill {
      display: none;
      align-items: center;
      gap: 5px;
      padding: 3px 6px 3px 10px;
      background: rgba(99,102,241,0.1);
      color: #6366f1;
      border-radius: 6px;
      font-size: 12px;
      font-weight: 500;
      white-space: nowrap;
      flex-shrink: 0;
      align-self: center;
      margin-right: 6px;
      border: 1px solid rgba(99,102,241,0.25);
    }
    .help-pill-close {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 16px;
      height: 16px;
      padding: 0;
      border: none;
      background: transparent;
      color: #6366f1;
      cursor: pointer;
      border-radius: 50%;
      opacity: 0.7;
      transition: opacity 0.12s, background 0.12s;
    }
    .help-pill-close:hover {
      opacity: 1;
      background: rgba(99,102,241,0.15);
    }
    #input-wrap.help-active {
      border-color: rgba(99,102,241,0.4);
      box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
    }

    /* No-key confirmation banner */
    #no-key-notice {
      display: none;
      position: absolute;
      bottom: calc(100% + 4px);
      left: 0; right: 0;
      max-width: 780px;
      margin: 0 auto;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 12px 16px;
      font-size: 12.5px;
      color: var(--text);
      box-shadow: 0 4px 16px rgba(0,0,0,.1);
      z-index: 100;
      line-height: 1.5;
    }
    #no-key-notice.open { display: block; }
    #no-key-notice strong { display: block; margin-bottom: 4px; }
    #no-key-notice .notice-actions { display: flex; gap: 8px; margin-top: 10px; }
    #no-key-notice .notice-actions button {
      padding: 5px 12px;
      border-radius: 6px;
      font-size: 12px;
      cursor: pointer;
      border: none;
      font-family: inherit;
    }
    .notice-add-key { background: var(--accent); color: #fff; }
    .notice-add-key:hover { background: var(--accent-hover); }
    .notice-dismiss { background: var(--surface); color: var(--text-muted); }

    .input-hint {
      font-size: 10.5px;
      color: var(--text-light);
      text-align: center;
      margin-top: 8px;
      max-width: 680px;
      margin-left: auto;
      margin-right: auto;
      letter-spacing: -0.005em;
    }
    .input-hint kbd {
      font-family: inherit;
      padding: 1px 5px;
      background: rgba(0,0,0,0.05);
      border-radius: 3px;
      font-size: 10px;
      color: #4A4A47;
      border: 0.5px solid rgba(0,0,0,0.06);
    }

    #credits-badge {
      font-size: 11px;
      color: var(--text-light);
      font-variant-numeric: tabular-nums;
      letter-spacing: -0.005em;
    }

    #byo-nudge {
      font-size: 10.5px;
      font-weight: 500;
      letter-spacing: -0.005em;
      text-decoration: none;
      padding: 3px 8px;
      border-radius: 4px;
      white-space: nowrap;
      transition: background .12s;
    }
    #byo-nudge.byo-nudge {
      color: #6E5CE6;
      background: rgba(110,92,230,0.08);
    }
    #byo-nudge.byo-nudge:hover { background: rgba(110,92,230,0.14); }
    #byo-nudge.byo-nudge-warn {
      color: #C77A2E;
      background: rgba(199,122,46,0.09);
    }
    #byo-nudge.byo-nudge-warn:hover { background: rgba(199,122,46,0.15); }
    #byo-nudge.byo-nudge-urgent {
      color: #A53232;
      background: rgba(199,62,62,0.08);
    }
    #byo-nudge.byo-nudge-urgent:hover { background: rgba(199,62,62,0.14); }

    #trial-expired-banner-chat,
    #out-of-credits-banner-chat {
      padding: 10px 16px;
      background: rgba(199,62,62,0.06);
      border-top: 1px solid rgba(199,62,62,0.18);
      font-size: 12.5px;
      color: #A53232;
      text-align: center;
    }

    /* ── Command menu ── */
    #cmd-menu {
      display: none;
      position: absolute;
      bottom: calc(100% + 6px);
      left: 0; right: 0;
      max-width: 680px;
      margin: 0 auto;
      background: #fff;
      border: 1.5px solid var(--border);
      border-radius: 12px;
      box-shadow: 0 8px 32px rgba(0,0,0,0.1);
      overflow: hidden;
      z-index: 100;
    }

    #cmd-menu.open { display: block; }

    .cmd-header {
      padding: 8px 14px 6px;
      font-size: 10.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .6px;
      color: var(--text-light);
      border-bottom: 1px solid var(--border);
    }

    .cmd-item {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 10px 14px;
      cursor: pointer;
      transition: background .1s;
      border-bottom: 1px solid var(--bg);
    }
    .cmd-item:last-child { border-bottom: none; }
    .cmd-item:hover, .cmd-item.selected { background: var(--accent-bg); }

    .cmd-icon {
      width: 30px; height: 30px;
      background: var(--surface);
      border-radius: 7px;
      display: flex; align-items: center; justify-content: center;
      font-size: 14px;
      flex-shrink: 0;
    }
    .cmd-item.selected .cmd-icon { background: var(--accent-bg); }

    .cmd-info { flex: 1; min-width: 0; }
    .cmd-name {
      font-size: 13.5px;
      font-weight: 600;
      color: var(--text);
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .cmd-slug {
      font-size: 12px;
      font-family: 'SF Mono', monospace;
      color: var(--accent);
      font-weight: 500;
    }
    .cmd-desc { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

    .cmd-hint {
      font-size: 11px;
      color: var(--text-light);
      flex-shrink: 0;
    }

    /* ── Command result cards ── */
    .serp-table, .kw-table {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
    }

    .serp-row {
      display: flex;
      gap: 10px;
      padding: 10px 14px;
      border-bottom: 1px solid var(--border);
      align-items: flex-start;
      transition: background .1s;
    }
    .serp-row:last-child { border-bottom: none; }
    .serp-row:hover { background: var(--bg); }

    .serp-rank {
      font-size: 11px;
      font-weight: 700;
      color: var(--text-light);
      width: 18px;
      flex-shrink: 0;
      padding-top: 2px;
    }
    .serp-body { flex: 1; min-width: 0; }
    .serp-title {
      font-size: 13.5px;
      font-weight: 600;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .serp-url {
      font-size: 11.5px;
      color: var(--green);
      margin: 2px 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .serp-snippet {
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.5;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
    }

    .kw-row {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 9px 14px;
      border-bottom: 1px solid var(--border);
      font-size: 13px;
    }
    .kw-row:last-child { border-bottom: none; }
    .kw-term { flex: 1; color: var(--text); }
    .kw-vol  { font-size: 12px; font-weight: 600; color: var(--text); min-width: 60px; text-align: right; }
    .kw-cpc  { font-size: 12px; color: var(--text-muted); min-width: 50px; text-align: right; }
    .kw-comp-bar {
      width: 50px; height: 6px;
      background: var(--surface);
      border-radius: 3px;
      overflow: hidden;
    }
    .kw-comp-fill { height: 100%; background: var(--accent); border-radius: 3px; }

    .onpage-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    .onpage-card {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px 14px;
    }
    .onpage-card.full { grid-column: 1 / -1; }
    .onpage-card-label {
      font-size: 10.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .5px;
      color: var(--text-light);
      margin-bottom: 6px;
    }
    .onpage-card-val {
      font-size: 13.5px;
      color: var(--text);
      line-height: 1.5;
    }
    .onpage-stat { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }

    .heading-chip {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 4px 8px;
      font-size: 12px;
      color: var(--text);
      margin: 2px;
    }
    .heading-chip .hc-tag {
      font-size: 9px;
      font-weight: 700;
      font-family: monospace;
      background: var(--surface);
      color: var(--text-muted);
      padding: 1px 4px;
      border-radius: 3px;
    }

    /* ── Interlinking results ── */
    .il-keywords {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    .il-kw {
      background: var(--accent-bg);
      border: 1px solid rgba(99,102,241,.2);
      color: var(--accent);
      border-radius: 20px;
      padding: 4px 12px;
      font-size: 12.5px;
      font-weight: 500;
    }

    .il-section-head {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 13px;
      font-weight: 700;
      color: var(--text);
    }

    .il-count {
      background: var(--surface);
      border-radius: 10px;
      padding: 2px 8px;
      font-size: 11.5px;
      font-weight: 600;
      color: var(--text-muted);
    }

    .il-table {
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 10px;
      overflow: hidden;
    }

    .il-row {
      display: grid;
      grid-template-columns: 1fr 160px;
      gap: 0;
      padding: 12px 16px;
      border-bottom: 1px solid var(--border);
      transition: background .1s;
    }
    .il-row:last-child { border-bottom: none; }
    .il-row:hover { background: var(--bg); }

    .il-row-main { min-width: 0; }

    .il-url {
      font-size: 12px;
      color: var(--green);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-bottom: 3px;
    }

    .il-anchor {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
      margin-bottom: 3px;
    }

    .il-reason {
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.4;
    }

    .il-context {
      font-size: 11.5px;
      color: var(--text-muted);
      font-style: italic;
      line-height: 1.4;
      padding-left: 8px;
      border-left: 2px solid var(--border);
      margin-top: 3px;
    }

    .il-row-meta {
      text-align: right;
      padding-left: 12px;
      display: flex;
      flex-direction: column;
      align-items: flex-end;
      justify-content: center;
      gap: 4px;
    }

    .il-tag {
      font-size: 10.5px;
      font-weight: 600;
      padding: 2px 7px;
      border-radius: 8px;
    }

    .il-tag.in  { background: rgba(22,163,74,.1);  color: var(--green); }
    .il-tag.out { background: var(--accent-bg); color: var(--accent); }

    /* pb step with real data label */
    .pb-step-detail {
      font-size: 11.5px;
      color: var(--text-light);
      margin-top: 2px;
    }
    .pb-step.done .pb-step-detail { color: var(--green); }

    /* ── Brand card (post-setup) ── */
    .brand-card {
      display: flex;
      align-items: center;
      gap: 12px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 12px 14px;
      margin-top: 8px;
    }

    .brand-favicon {
      width: 32px; height: 32px;
      border-radius: 6px;
      object-fit: contain;
      background: #fff;
      border: 1px solid var(--border);
      flex-shrink: 0;
    }

    .brand-favicon-fallback {
      width: 32px; height: 32px;
      border-radius: 6px;
      background: var(--text);
      color: #fff;
      display: flex; align-items: center; justify-content: center;
      font-size: 13px;
      font-weight: 700;
      flex-shrink: 0;
    }

    .brand-info { flex: 1; min-width: 0; }
    .brand-name { font-size: 14px; font-weight: 700; color: var(--text); }
    .brand-summary { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }

    .brand-stats {
      display: flex;
      gap: 12px;
      font-size: 11.5px;
      color: var(--text-light);
      flex-shrink: 0;
    }

    .brand-stat strong { color: var(--text-muted); font-weight: 600; display: block; font-size: 13px; }

    .country-card {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 14px 16px;
      margin-top: 10px;
    }

    .country-card-title {
      font-size: 13px;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 4px;
    }

    .country-card-copy {
      font-size: 12.5px;
      color: var(--text-muted);
      line-height: 1.5;
      margin-bottom: 10px;
    }
    .country-card-copy span { display: block; margin-top: 3px; color: var(--text-light); }

    .country-control-row {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .country-control-row select {
      flex: 1;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 7px;
      padding: 8px 10px;
      font-size: 13px;
      color: var(--text);
      font-family: inherit;
      outline: none;
    }
    .country-control-row select:focus { border-color: var(--text); }
    .country-control-row input:focus { border-color: var(--text); }
    .country-control-row input::placeholder { color: var(--text-light); }

    .country-control-row button {
      background: var(--text);
      color: #fff;
      border: none;
      border-radius: 7px;
      padding: 8px 14px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      white-space: nowrap;
    }
    .country-control-row button:disabled { opacity: .55; cursor: default; }

    /* ── Action cards (shown after setup) ── */
    .action-cards-row {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      margin-top: 6px;
    }

    .ac2 {
      flex: 1;
      min-width: 130px;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 14px 14px;
      cursor: pointer;
      transition: border-color .15s, box-shadow .12s;
      position: relative;
    }
    .ac2:hover { border-color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
    .ac2-icon { font-size: 16px; margin-bottom: 8px; display: block; }
    .ac2-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 3px; }
    .ac2-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
    .ac2-tag {
      position: absolute; top: -8px; left: 10px;
      background: var(--text); color: #fff;
      font-size: 9.5px; font-weight: 700;
      padding: 2px 7px; border-radius: 8px;
      letter-spacing: .3px;
    }

    /* Setup URL input form */
    .setup-form {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 16px;
      margin-top: 8px;
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .setup-form input {
      flex: 1;
      background: #fff;
      border: 1px solid var(--border);
      border-radius: 7px;
      padding: 9px 12px;
      font-size: 14px;
      color: var(--text);
      outline: none;
      font-family: inherit;
      transition: border-color .15s;
    }
    .setup-form input:focus { border-color: var(--text); }
    .setup-form input::placeholder { color: var(--text-light); }

    .setup-form button {
      background: var(--text);
      color: #fff;
      border: none;
      border-radius: 7px;
      padding: 9px 16px;
      font-size: 13.5px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      white-space: nowrap;
      transition: opacity .15s;
    }
    .setup-form button:hover { opacity: .8; }

    /* page markdown preview */
    .md-preview {
      background: var(--bg);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 12px 14px;
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.6;
      white-space: pre-wrap;
      word-break: break-word;
      max-height: 160px;
      overflow-y: auto;
      font-family: 'SF Mono', monospace;
    }

    .token-badge {
      display: inline-flex; align-items: center; gap: 4px;
      margin-top: 6px;
      font-size: 10px; color: var(--text-muted); font-family: monospace;
      opacity: 0.4;
    }
    .token-badge svg { flex-shrink: 0; }

    /* ── Meta row: token info (left) + action buttons (right) ── */
    .meta-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-top: 16px;
      padding-top: 12px;
      border-top: 0.5px solid rgba(0,0,0,0.06);
    }

    .meta-info {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 11px;
      color: #B8B6AE;
      font-variant-numeric: tabular-nums;
      min-height: 28px;
    }
    .meta-info svg { flex-shrink: 0; }
    .meta-model-label { border-left: 1px solid #DDD; padding-left: 8px; margin-left: 2px; }

    .meta-actions-right {
      display: flex;
      align-items: center;
      gap: 2px;
      color: #9A9A95;
    }

    /* Legacy msg-actions kept for any remaining usages */
    .msg-actions {
      display: flex;
      align-items: center;
      gap: 1px;
      margin-top: 8px;
    }
    .msg-action-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 28px;
      height: 28px;
      border: none;
      border-radius: 6px;
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
      transition: background .12s, color .12s;
      padding: 0;
    }
    .msg-action-btn:hover { background: var(--surface); color: var(--text); }
    .msg-action-btn.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
    .msg-action-btn.copied { color: #16a34a; }
    .msg-action-divider {
      width: 1px;
      height: 14px;
      background: var(--border);
      margin: 0 4px;
      flex-shrink: 0;
    }

    /* ── Feedback prompt ── */
    .msg-feedback {
      margin-top: 8px;
      background: var(--surface);
      border: 1.5px solid var(--border);
      border-radius: 10px;
      padding: 12px 14px;
    }
    .msg-feedback-prompt {
      font-size: 13px;
      font-weight: 500;
      color: var(--text);
      margin-bottom: 8px;
    }
    .msg-feedback-input {
      width: 100%;
      background: var(--bg);
      border: 1.5px solid var(--border);
      border-radius: 8px;
      padding: 8px 10px;
      font-size: 13px;
      color: var(--text);
      font-family: inherit;
      resize: none;
      outline: none;
      box-sizing: border-box;
      min-height: 62px;
      line-height: 1.5;
      transition: border-color .15s;
    }
    .msg-feedback-input:focus { border-color: var(--accent); }
    .msg-feedback-input::placeholder { color: var(--text-light); }
    .msg-feedback-footer {
      display: flex;
      gap: 8px;
      margin-top: 8px;
      justify-content: flex-end;
    }
    .msg-feedback-skip {
      background: transparent;
      border: 1.5px solid var(--border);
      border-radius: 7px;
      padding: 5px 13px;
      font-size: 12.5px;
      color: var(--text-muted);
      cursor: pointer;
      font-family: inherit;
      transition: border-color .12s, color .12s;
    }
    .msg-feedback-skip:hover { border-color: var(--text-muted); color: var(--text); }
    .msg-feedback-submit {
      background: var(--accent);
      color: #fff;
      border: none;
      border-radius: 7px;
      padding: 5px 14px;
      font-size: 12.5px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: opacity .12s;
    }
    .msg-feedback-submit:hover { opacity: .88; }
    .msg-feedback-thanks {
      font-size: 13px;
      color: var(--text-muted);
      padding: 2px 0;
    }

    /* GSC inline connect card */
    .gsc-connect-card {
      margin-top: 10px;
      border: 1.5px solid var(--border);
      border-radius: 10px;
      padding: 14px 16px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      background: var(--sidebar-bg);
      max-width: 340px;
    }
    .gsc-connect-header {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .gsc-connect-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
    }
    .gsc-connect-sub {
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.5;
    }
    .gsc-connect-actions {
      display: flex;
      gap: 8px;
    }
    .gsc-btn-connect {
      padding: 6px 14px;
      background: var(--accent);
      color: #fff;
      border: none;
      border-radius: 7px;
      font-size: 12.5px;
      font-weight: 600;
      cursor: pointer;
      font-family: inherit;
      transition: background .12s;
    }
    .gsc-btn-connect:hover:not(:disabled) { background: var(--accent-hover); }
    .gsc-btn-connect:disabled { opacity: .5; cursor: default; }
    .gsc-btn-skip {
      padding: 6px 14px;
      background: none;
      color: var(--text-muted);
      border: 1px solid var(--border);
      border-radius: 7px;
      font-size: 12.5px;
      font-weight: 500;
      cursor: pointer;
      font-family: inherit;
      transition: background .12s, color .12s;
    }
    .gsc-btn-skip:hover:not(:disabled) { background: var(--surface); color: var(--text); }
    .gsc-btn-skip:disabled { opacity: .5; cursor: default; }

    .wp-connect-card {
      margin-top: 10px;
      border: 1.5px solid var(--border);
      border-radius: 10px;
      padding: 14px 16px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      background: var(--sidebar-bg);
      max-width: 360px;
    }
    .wp-connect-header {
      display: flex;
      align-items: center;
      gap: 10px;
    }
    .wp-connect-title {
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
    }
    .wp-connect-sub {
      font-size: 12px;
      color: var(--text-muted);
      line-height: 1.5;
    }
    .wp-type-toggle {
      display: flex;
      gap: 4px;
      padding: 3px;
      background: var(--surface);
      border-radius: 7px;
      width: fit-content;
    }
    .wp-type-btn {
      padding: 4px 12px;
      border-radius: 5px;
      font-size: 12px;
      font-weight: 500;
      cursor: pointer;
      border: none;
      background: transparent;
      color: var(--text-muted);
      font-family: inherit;
      transition: background .12s, color .12s;
    }
    .wp-type-btn.active {
      background: #fff;
      color: var(--text);
      font-weight: 600;
      box-shadow: 0 1px 3px rgba(0,0,0,.08);
    }
    .wp-field-label {
      font-size: 11px;
      font-weight: 600;
      color: var(--text-muted);
      margin-bottom: 3px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .wp-field-label a { color: var(--text-muted); font-weight: 400; text-decoration: underline; }
    .wp-field-input {
      width: 100%;
      padding: 6px 9px;
      border: 1.5px solid var(--border);
      border-radius: 6px;
      font-size: 12.5px;
      font-family: inherit;
      color: var(--text);
      background: #fff;
      outline: none;
      box-sizing: border-box;
      transition: border-color .15s;
    }
    .wp-field-input:focus { border-color: #aaa; }
    .wp-field-input::placeholder { color: var(--text-light); }
    .wp-fields { display: flex; flex-direction: column; gap: 7px; }
    .wp-error { font-size: 11.5px; color: var(--red); display: none; }
    .wp-error.show { display: block; }

    .gsc-not-found-card {
      margin-top: 10px;
      border: 1.5px solid #f59e0b33;
      border-radius: 10px;
      padding: 12px 14px;
      display: flex;
      align-items: flex-start;
      gap: 10px;
      background: #fffbeb;
      max-width: 340px;
    }
    .gsc-not-found-icon {
      font-size: 15px;
      line-height: 1;
      margin-top: 1px;
      flex-shrink: 0;
    }
    .gsc-not-found-title {
      font-size: 12.5px;
      font-weight: 600;
      color: #92400e;
      margin-bottom: 3px;
    }
    .gsc-not-found-sub {
      font-size: 11.5px;
      color: #a16207;
      line-height: 1.5;
    }

    /* Streaming cursor */
    @keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0; } }
    .stream-cursor {
      display: inline-block; width: 2px; height: 13px;
      background: var(--text); margin-left: 2px;
      vertical-align: text-bottom;
      animation: blink .8s ease infinite;
    }

    /* Credits badge */
    #credits-badge {
      font-size: 11px;
      color: var(--text-muted);
      padding: 2px 8px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 6px;
      white-space: nowrap;
    }

    /* Sidebar section label */
    .cl-section-label {
      font-size: 10px;
      font-weight: 600;
      letter-spacing: .4px;
      text-transform: uppercase;
      color: var(--text-light);
      padding: 8px 12px 3px;
    }

    /* User dropdown menu */
    #topbar-user { position: relative; }

    /* ── User message bubble ── */
    .msg-row.msg-user .msg-body {
      flex: none;
      max-width: 75%;
      display: flex;
      flex-direction: column;
    }
    /* Expand to fill the row while editing */
    .msg-row.msg-user:has(.user-msg-edit-area) .msg-body {
      flex: 1;
      max-width: 100%;
    }

    .msg-file-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 6px;
    }
    .msg-file-chip {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 9px;
      padding: 5px 9px 5px 7px;
      max-width: 200px;
      overflow: hidden;
    }
    .msg-file-chip-icon {
      width: 26px;
      height: 26px;
      border-radius: 5px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 8px;
      font-weight: 700;
      letter-spacing: .03em;
      color: #fff;
      flex-shrink: 0;
      text-transform: uppercase;
    }
    .msg-file-chip-info { min-width: 0; }
    .msg-file-chip-name {
      font-size: 11.5px;
      font-weight: 500;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: block;
    }
    .msg-file-chip-meta {
      font-size: 10.5px;
      color: var(--text-muted);
      white-space: nowrap;
    }

    .user-bubble {
      background: #EDEBE4;
      border: none;
      border-radius: 14px 14px 4px 14px;
      padding: 10px 14px;
      font-size: 14px;
      line-height: 1.5;
      letter-spacing: -0.005em;
      white-space: pre-wrap;
      word-break: break-word;
      max-width: 100%;
    }

    /* ── User message edit button ── */
    .user-msg-actions {
      /* Always in flow (no display toggle) - prevents layout jump on hover */
      display: flex;
      align-items: center;
      height: 22px;
      margin-top: 2px;
      opacity: 0;
      pointer-events: none;
      transition: opacity .18s ease;
      justify-content: flex-end;
    }
    .user-msg-meta {
      font-size: 11px;
      color: var(--text-muted);
      text-align: right;
      margin-top: 3px;
      opacity: 0.7;
    }
    .msg-row.msg-user:hover .user-msg-actions {
      opacity: 1;
      pointer-events: auto;
    }
    .user-edit-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 22px;
      height: 22px;
      border: none;
      border-radius: 5px;
      background: transparent;
      color: var(--text-muted);
      cursor: pointer;
      transition: background .12s, color .12s;
      padding: 0;
    }
    .user-edit-btn:hover { background: var(--border); color: var(--text); }

    /* ── User message edit mode ── */
    .user-msg-edit-area {
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .user-msg-textarea {
      width: 100%;
      background: var(--bg);
      border: 1.5px solid var(--accent);
      border-radius: 10px;
      padding: 10px 14px;
      font-size: 14px;
      line-height: 1.65;
      color: var(--text);
      font-family: inherit;
      resize: none;
      outline: none;
      box-sizing: border-box;
      min-height: 130px;
      overflow-y: hidden;
      box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent);
    }
    .user-msg-edit-btns {
      display: flex;
      align-items: center;
      gap: 6px;
      justify-content: flex-end;
    }
    .user-edit-cancel-btn {
      background: transparent;
      border: 1.5px solid var(--border);
      border-radius: 7px;
      padding: 5px 14px;
      font-size: 13px;
      font-weight: 500;
      color: var(--text-muted);
      cursor: pointer;
      font-family: inherit;
      transition: border-color .12s, color .12s;
    }
    .user-edit-cancel-btn:hover { border-color: var(--text-muted); color: var(--text); }
    .user-edit-save-btn {
      display: flex;
      align-items: center;
      gap: 5px;
      background: var(--accent);
      border: none;
      border-radius: 7px;
      padding: 5px 16px;
      font-size: 13px;
      font-weight: 600;
      color: #fff;
      cursor: pointer;
      font-family: inherit;
      transition: opacity .12s;
    }
    .user-edit-save-btn:hover { opacity: .85; }
    .user-edit-kbd {
      font-size: 10.5px;
      font-family: inherit;
      background: rgba(255,255,255,0.22);
      border-radius: 4px;
      padding: 1px 5px;
      font-weight: 500;
    }

    /* ── Agent markdown prose ── */
    .agent-text {
      max-width: 100%;
      font-size: 14.5px;
      line-height: 1.55;
      color: var(--text);
      letter-spacing: -0.005em;
    }
    .agent-text > *:first-child { margin-top: 0 !important; }
    .agent-text p { margin: 0 0 14px; }
    .agent-text p:last-child { margin-bottom: 0; }

    .agent-text h1, .agent-text h2, .agent-text h3, .agent-text h4 {
      font-weight: 650; line-height: 1.3; margin: 22px 0 8px;
      color: var(--text); letter-spacing: -0.2px;
    }
    .agent-text h1 { font-size: 20px; }
    .agent-text h2 { font-size: 16px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
    .agent-text h3 { font-size: 14.5px; }
    .agent-text h4 { font-size: 14px; color: var(--text-muted); }

    .agent-text ul { list-style: disc; padding-left: 22px; margin: 6px 0 12px; }
    .agent-text ol { padding-left: 22px; margin: 6px 0 12px; }
    .agent-text li { margin-bottom: 5px; line-height: 1.7; }
    .agent-text li > ul, .agent-text li > ol { margin: 5px 0 3px; }
    .agent-text ul li::marker { color: var(--text-muted); }

    .agent-text blockquote {
      border-left: 3px solid var(--border);
      margin: 14px 0; padding: 8px 14px;
      background: var(--sidebar-bg);
      border-radius: 0 8px 8px 0;
      color: var(--text-muted);
    }
    .agent-text blockquote p:last-child { margin-bottom: 0; }

    .agent-text table {
      display: block;
      width: 100%; border-collapse: collapse; margin: 14px 0;
      font-size: 13.5px; border: 1px solid var(--border);
      border-radius: 8px; overflow-x: auto; overflow-y: hidden;
      max-width: 100%;
    }
    .agent-text th, .agent-text td {
      border: none; border-bottom: 1px solid var(--border);
      padding: 8px 12px; text-align: left;
    }
    .agent-text tr:last-child td { border-bottom: none; }
    .agent-text th {
      background: var(--surface); font-weight: 600; font-size: 12px;
      text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
    }
    .agent-text tbody tr:hover { background: var(--sidebar-bg); }

    .agent-text a {
      color: var(--text); text-decoration: underline;
      text-decoration-color: var(--border); text-underline-offset: 2px;
    }
    .agent-text a:hover { text-decoration-color: var(--text); }
    .agent-text hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
    .agent-text strong { font-weight: 650; }
    .agent-text em { font-style: italic; }

    .agent-text code:not(pre code) {
      background: var(--surface); border: 1px solid var(--border);
      padding: 2px 6px; border-radius: 5px;
      font-size: 12.5px; font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    }

    /* ── Code blocks ── */
    .code-block-wrap {
      margin: 14px 0; border-radius: 10px; overflow: hidden;
      border: 1px solid rgba(255,255,255,0.06);
      background: #15161a;
      box-shadow: 0 2px 12px rgba(0,0,0,0.12);
      max-width: 100%;
    }
    .code-block-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 7px 14px; background: rgba(255,255,255,0.04);
      border-bottom: 1px solid rgba(255,255,255,0.07);
    }
    .code-lang-label {
      font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.3);
      text-transform: uppercase; font-family: 'SF Mono', monospace; letter-spacing: 0.07em;
    }
    .copy-code-btn {
      background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1);
      border-radius: 5px; color: rgba(255,255,255,0.4); padding: 2px 10px;
      font-size: 11px; cursor: pointer; font-family: inherit;
      transition: background .15s, color .15s;
    }
    .copy-code-btn:hover { background: rgba(255,255,255,0.14); color: rgba(255,255,255,0.9); }
    .code-block-wrap pre {
      background: #15161a; padding: 14px 16px; font-size: 12.5px;
      overflow-x: auto; overflow-y: hidden; margin: 0; line-height: 1.7;
      font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
      white-space: pre;
    }
    .code-block-wrap pre code { background: transparent !important; padding: 0 !important; border: none !important; font-size: inherit; color: #e6edf3; }

    /* ── Toast notifications ── */
    #toast-container {
      position: fixed;
      bottom: 24px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      flex-direction: column-reverse;
      gap: 8px;
      z-index: 9999;
      pointer-events: none;
    }
    .toast {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 10px 14px;
      border-radius: 10px;
      font-size: 13px;
      line-height: 1.4;
      min-width: 260px;
      max-width: 420px;
      box-shadow: 0 4px 16px rgba(0,0,0,.14);
      pointer-events: all;
      animation: toast-in .18s ease;
    }
    .toast.removing { animation: toast-out .18s ease forwards; }
    .toast.error    { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
    .toast.warning  { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
    .toast.info     { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
    .toast-msg { flex: 1; }
    .toast-close {
      background: none;
      border: none;
      cursor: pointer;
      font-size: 16px;
      line-height: 1;
      color: inherit;
      opacity: .5;
      padding: 0;
      flex-shrink: 0;
      transition: opacity .1s;
    }
    .toast-close:hover { opacity: 1; }
    @keyframes toast-in  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
    @keyframes toast-out { from { opacity: 1; transform: translateY(0); }   to { opacity: 0; transform: translateY(8px); } }

    /* ── Search chats trigger button ── */
    .search-chat-btn {
      display: flex;
      align-items: center;
      gap: 12px;
      width: 100%;
      padding: 5px 9px;
      background: rgba(0,0,0,0.04);
      border: none;
      border-radius: 5px;
      font-size: 13px;
      color: #9A9A95;
      cursor: pointer;
      font-family: inherit;
      margin-bottom: 4px;
      transition: background .1s;
    }
    .search-chat-btn:hover { background: rgba(0,0,0,0.07); color: var(--text-muted); }
    .search-shortcut { margin-left: auto; font-size: 10px; color: #9A9A95; }

    /* ── Search chats modal ── */
    #search-chat-modal {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,.45);
      z-index: 950;
      align-items: flex-start;
      justify-content: center;
      padding-top: 80px;
    }
    #search-chat-modal.open { display: flex; }

    #search-chat-box {
      background: #fff;
      border-radius: 14px;
      width: 620px;
      max-width: calc(100vw - 40px);
      max-height: 70vh;
      display: flex;
      flex-direction: column;
      box-shadow: 0 16px 56px rgba(0,0,0,.22);
      overflow: hidden;
      animation: sch-in .15s ease;
    }
    @keyframes sch-in { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

    #search-chat-header {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 14px 16px;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }

    #search-chat-input {
      flex: 1;
      border: none;
      outline: none;
      font-size: 16px;
      color: var(--text);
      background: transparent;
      font-family: inherit;
      line-height: 1.4;
    }
    #search-chat-input::placeholder { color: var(--text-light); }

    #search-chat-close {
      background: none;
      border: none;
      cursor: pointer;
      font-size: 14px;
      color: var(--text-muted);
      padding: 4px 6px;
      border-radius: 5px;
      line-height: 1;
      flex-shrink: 0;
      transition: background .1s, color .1s;
    }
    #search-chat-close:hover { background: var(--surface); color: var(--text); }

    #search-chat-results {
      overflow-y: auto;
      padding: 8px;
      flex: 1;
    }

    .sch-group-label {
      font-size: 10px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: .8px;
      color: var(--text-light);
      padding: 8px 8px 4px;
    }

    .sch-result {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 9px 10px;
      border-radius: 8px;
      cursor: pointer;
      transition: background .1s;
    }
    .sch-result:hover { background: var(--surface); }

    .sch-result-icon {
      flex-shrink: 0;
      color: var(--text-light);
      margin-top: 1px;
    }

    .sch-result-body {
      flex: 1;
      min-width: 0;
      display: flex;
      flex-direction: column;
    }

    .sch-result-title {
      font-size: 13.5px;
      font-weight: 500;
      color: var(--text);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: block;
    }

    .sch-result-snippet {
      font-size: 12px;
      color: var(--text-muted);
      margin-top: 3px;
      line-height: 1.45;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      word-break: break-word;
    }

    .sch-result mark {
      background: #fff3b0;
      color: inherit;
      border-radius: 2px;
      padding: 0 1px;
    }

    .sch-result-date {
      font-size: 11px;
      color: var(--text-light);
      white-space: nowrap;
      flex-shrink: 0;
      padding-top: 2px;
    }

    .sch-empty {
      text-align: center;
      padding: 32px 16px;
      font-size: 13px;
      color: var(--text-muted);
    }

    /* ── Load-more sentinel ── */
    #agent-load-more {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 6px 0;
      visibility: hidden;
    }
    #agent-load-more.loading { visibility: visible; }
    .msg-load-more-spinner {
      width: 16px;
      height: 16px;
      border: 2px solid var(--border);
      border-top-color: var(--text-muted);
      border-radius: 50%;
      animation: chat-spin 0.7s linear infinite;
      flex-shrink: 0;
    }

    /* ── Chat loading spinner ── */
    #chat-loading {
      display: flex;
      align-items: center;
      justify-content: center;
      flex: 1;
      padding: 40px 0;
    }
    .chat-loading-spinner {
      width: 28px;
      height: 28px;
      border: 2.5px solid var(--border);
      border-top-color: var(--text-muted);
      border-radius: 50%;
      animation: chat-spin 0.7s linear infinite;
    }
    @keyframes chat-spin { to { transform: rotate(360deg); } }


    /* User-created skill chips above chat input */
    #user-skill-chips {
      display: none;
      flex-wrap: wrap;
      gap: 6px;
      padding: 6px 16px 2px;
      max-width: 680px;
      margin: 0 auto;
    }

    #user-skill-chips.has-chips { display: flex; }

    .user-skill-chip {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 4px 10px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 500;
      border: 1px solid var(--border);
      background: var(--bg);
      color: var(--text-muted);
      cursor: pointer;
      transition: background .12s, color .12s, border-color .12s;
      white-space: nowrap;
    }

    .user-skill-chip:hover {
      background: var(--surface);
      color: var(--text);
      border-color: var(--text-light);
    }
