/* ================================================================
   Goal Builder v7 — Tabbed Create / Edit Popup
   Top tabs: Overview | Members | Tasks
   ================================================================ */

/* ────────────────── 1. SEARCHABLE SELECT ────────────────── */

.gp-ss { position: relative; }
.gp-ss-input {
  width: 100%; padding: 8px 12px; font-size: 13px;
  border: 1.5px solid var(--border, #e5e7eb); border-radius: 10px;
  background: var(--surf, #fff); color: var(--ink, #111);
  outline: none; transition: border-color .15s;
}
.gp-ss-input:focus { border-color: var(--c-blue, #3b82f6); box-shadow: 0 0 0 3px rgba(59,130,246,.08); }
.gp-ss-dropdown {
  position: fixed; z-index: 13000;
  background: var(--surf, #fff); border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 12px; overflow-y: auto; overflow-x: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); display: none;
  padding: 4px 0;
}
.gp-ss-dropdown:empty { padding: 0; }
.gp-ss-dropdown.is-open {
  display: block;
  animation: gpSsSlideIn .18s ease;
}
@keyframes gpSsSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.gp-ss-option {
  padding: 8px 12px; font-size: 13px; color: var(--ink, #111);
  cursor: pointer; transition: background .1s;
  display: flex; align-items: center; gap: 8px;
}
.gp-ss-color-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.gp-ss-option:hover, .gp-ss-option.is-highlighted { background: var(--c-blue-bg, #eff6ff); }
.gp-ss-option.is-selected { font-weight: 700; color: var(--c-blue, #3b82f6); }
.gp-ss-empty { padding: 8px 12px; font-size: 12px; color: var(--ink3, #9ca3af); text-align: center; }
.gp-ss-add {
  padding: 8px 12px; font-size: 12px; color: var(--c-blue, #3b82f6);
  cursor: pointer; font-weight: 600; border-top: 1px solid var(--border-s, #f3f4f6);
}
.gp-ss-add:hover { background: var(--c-blue-bg, #eff6ff); }

/* Multi-select chips */
.gp-ss-multi {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  padding: 5px 8px; border: 1.5px solid var(--border, #e5e7eb); border-radius: 10px;
  background: var(--surf, #fff); transition: border-color .15s; min-height: 38px;
}
.gp-ss-multi:focus-within { border-color: var(--c-blue, #3b82f6); }
.gp-ss-multi .gp-ss-input { border: none; padding: 3px 4px; flex: 1; min-width: 80px; }
.gp-ss-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.gp-ss-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; font-size: 11px; font-weight: 600;
  background: var(--c-blue-bg, #eff6ff); color: var(--c-blue, #3b82f6); border-radius: 6px;
}
.gp-ss-chip-x {
  cursor: pointer; font-size: 13px; line-height: 1; opacity: .6; transition: opacity .1s;
}
.gp-ss-chip-x:hover { opacity: 1; }

/* ────────────────── 2. CALENDAR PICKER ────────────────── */

.gp-cal-wrap { position: relative; }
.gp-cal-trigger {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; font-size: 13px; text-align: left;
  border: 1.5px solid var(--border, #e5e7eb); border-radius: 10px;
  background: var(--surf, #fff); color: var(--ink, #111); cursor: pointer;
  transition: border-color .15s;
}
.gp-cal-trigger:hover { border-color: var(--c-blue, #3b82f6); }
.gp-cal-trigger svg { width: 14px; height: 14px; color: var(--ink3, #9ca3af); flex-shrink: 0; }
.gp-cal-popup {
  position: fixed; z-index: 13000;
  width: 280px; padding: 12px;
  background: var(--surf, #fff); border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.15); display: none;
}
.gp-cal-popup.is-open { display: block; }
.gp-cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.gp-cal-nav-btn {
  width: 28px; height: 28px; border-radius: 8px; border: none;
  background: transparent; cursor: pointer; color: var(--ink2, #374151);
  display: flex; align-items: center; justify-content: center;
}
.gp-cal-nav-btn:hover { background: var(--border-s, #f3f4f6); }
.gp-cal-nav-btn svg { width: 14px; height: 14px; }
.gp-cal-month { font-size: 13px; font-weight: 700; color: var(--ink, #111); }
.gp-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.gp-cal-dow {
  font-size: 10px; font-weight: 700; color: var(--ink3, #9ca3af);
  text-align: center; padding: 4px 0; text-transform: uppercase;
}
.gp-cal-date {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 12px; border-radius: 8px; cursor: pointer;
  color: var(--ink, #111); transition: background .1s, color .1s;
}
.gp-cal-date:hover { background: var(--c-blue-bg, #eff6ff); }
.gp-cal-date.is-today { border: 2px solid var(--c-blue, #3b82f6); font-weight: 700; }
.gp-cal-date.is-selected { background: var(--c-blue, #3b82f6); color: #fff; font-weight: 700; }
.gp-cal-date.is-other { color: var(--ink4, #d1d5db); }

/* ────────────────── 3. POPUP SHELL ────────────────── */

.gp-overlay {
  position: fixed; inset: 0; z-index: 12000;
  background: transparent;
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity .25s ease, visibility 0s .25s;
}
.gp-overlay.is-open { opacity: 1; pointer-events: auto; visibility: visible; transition: opacity .25s ease, visibility 0s 0s; }
.gp-overlay.is-closing,
.gp-overlay.is-closing .gp-popup { transition: none !important; }

/* ── SIZE IS THE SLIVER, NOT A MARGIN ─────────────────────────────
   Tyler, 2026-08-25: *"make the pop-up as big as possible to make up almost
   the entire screen."* Same instruction, same answer, same numbers as the
   allocate overlay (#wkAllocOverlay, 2026-08-24): fill the viewport and leave
   a few pixels of scrim on every edge so it still reads as a layer over the
   app rather than a navigation.

   🚨 THE OLD `max-height: 1040px` WAS THE REAL CEILING, not the width. On a
   tall monitor the popup stopped at 1040px and centred, so the tallest screen
   in the app — Plan ▸ Capacity, which is a month rail plus scorecards plus a
   card per teammate — did its scrolling inside a box with empty desk either
   side of it. Both caps are gone; there is nothing left to grow into.

   ⚠️ `max-width`/`max-height` are explicitly `none`. They are not dead
   declarations: the 900px breakpoint below still narrows `width`, and leaving
   a stale `max-width: 96vw` here would silently re-cap the width the moment
   anybody edited the shorthand above it. */
.gp-popup {
  position: absolute; top: 50%; left: 50%;
  width: calc(100vw - 24px); max-width: none;
  height: calc(100vh - 22px); max-height: none;
  transform: translate(-50%, -50%) scale(.95);
  background: var(--surf, #fff); border-radius: 20px;
  box-shadow: 0 32px 80px rgba(0,0,0,.22), 0 0 0 1px rgba(0,0,0,.05);
  display: flex; flex-direction: column; overflow: visible;
  transition: transform .35s cubic-bezier(.34,1.56,.64,1), opacity .3s ease;
  opacity: 0;
  pointer-events: auto;
}
.gp-overlay.is-open .gp-popup { transform: translate(-50%, -50%) scale(1); opacity: 1; }

/* Top bar */
.gp-topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 24px; border-bottom: 1px solid var(--border-s, #f3f4f6); flex-shrink: 0;
  cursor: grab; user-select: none;
  position: relative; z-index: 20;
}
.gp-topbar:active { cursor: grabbing; }
.gp-topbar-icon {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--c-blue, #3b82f6), #6366f1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.gp-topbar-icon svg { width: 20px; height: 20px; color: #fff; stroke: #fff; fill: none; }
.gp-topbar-label {
  display: flex; flex-direction: column; gap: 1px;
}
.gp-topbar-title {
  font-size: 16px; font-weight: 800; color: var(--ink, #111); line-height: 1.2;
}
.gp-topbar-subtitle {
  font-size: 11px; font-weight: 500; color: var(--ink3, #9ca3af); line-height: 1.2;
}
.gp-topbar-btn {
  width: 34px; height: 34px; border-radius: 10px; border: none;
  background: transparent; color: var(--ink3, #9ca3af); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.gp-topbar-btn:hover { background: var(--c-red-bg, #fee2e2); color: var(--c-red, #ef4444); }
.gp-topbar-btn svg { width: 17px; height: 17px; }

/* ────────────────── 4. TAB BAR ────────────────── */

.gp-tabs {
  display: flex; gap: 4px; padding: 10px 24px;
  background: var(--bg, #f9fafb); border-bottom: 1px solid var(--border-s, #f3f4f6);
  flex-shrink: 0; position: relative; z-index: 15;
}
.gp-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 14px; border-radius: 10px; border: none;
  background: transparent; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--ink3, #9ca3af);
  transition: all .2s ease; position: relative;
}
.gp-tab:hover { color: var(--ink2, #374151); background: rgba(255,255,255,.6); }
.gp-tab.is-active {
  color: var(--c-blue, #3b82f6); background: var(--surf, #fff); font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.06), 0 0 0 1px rgba(59,130,246,.12);
}
.gp-tab svg {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.gp-tab-badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; font-size: 10px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--border-s, #f3f4f6); color: var(--ink3, #9ca3af);
  transition: all .2s;
}
.gp-tab.is-active .gp-tab-badge {
  background: var(--c-blue-bg, #eff6ff); color: var(--c-blue, #3b82f6);
}
.gp-tab-badge:empty { display: none; }
.gp-tab-badge.has-count { display: inline-flex; }

/* ────────────────── 5. PANELS ────────────────── */

.gp-body { flex: 1; overflow-y: auto; overflow-x: visible; position: relative; overscroll-behavior: contain; }
.gp-panel {
  display: none; padding: 24px 28px;
}
.gp-panel.is-active {
  display: block;
  animation: gpPanelIn .2s ease-out;
}
@keyframes gpPanelIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Footer */
.gp-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 14px 24px; border-top: 1px solid var(--border-s, #f3f4f6); flex-shrink: 0;
  background: var(--bg, #f9fafb); border-radius: 0 0 20px 20px;
}
.gp-footer-btn {
  padding: 9px 22px; border-radius: 10px; font-size: 13px; font-weight: 700;
  border: none; cursor: pointer; transition: all .15s;
}
.gp-footer-btn--primary { background: var(--c-blue, #3b82f6); color: #fff; }
.gp-footer-btn--primary:hover { background: #2563eb; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,.3); }
.gp-footer-btn--save { background: var(--border-s, #f3f4f6); color: var(--ink, #111); }
.gp-footer-btn--save:hover { background: var(--border, #e5e7eb); }
.gp-footer-btn:disabled { opacity: .4; cursor: default; transform: none !important; box-shadow: none !important; }

/* ────────────────── 6. OVERVIEW PANEL ────────────────── */

.gp-hero-input {
  width: 100%; padding: 12px 0; font-size: 20px; font-weight: 800;
  border: none; border-bottom: 2px solid transparent; outline: none;
  background: transparent; color: var(--ink, #111);
  transition: border-color .2s; font-family: inherit; box-sizing: border-box;
}
.gp-hero-input:focus { border-color: var(--c-blue, #3b82f6); box-shadow: 0 2px 0 0 rgba(59,130,246,.18); }
.gp-hero-input::placeholder { color: var(--ink4, #d1d5db); font-weight: 700; }

.gp-section-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--ink3, #9ca3af); margin: 24px 0 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border-s, #f3f4f6);
}
.gp-section-label:first-child { margin-top: 16px; }
.gp-section-label svg { width: 14px; height: 14px; flex-shrink: 0; }
.gp-section-label--green svg { color: #10b981; }
.gp-section-label--amber svg { color: #d97706; }
.gp-section-label--teal svg { color: #0d9488; }
.gp-section-label--purple svg { color: #8b5cf6; }

.gp-field { margin-bottom: 14px; }
.gp-label {
  display: block; font-size: 12px; font-weight: 600;
  color: var(--ink2, #374151); margin-bottom: 5px;
}
.gp-req { color: var(--c-red, #ef4444); }
.gp-textarea {
  width: 100%; padding: 10px 12px; font-size: 13px; line-height: 1.55;
  border: 1.5px solid var(--border, #e5e7eb); border-radius: 10px;
  background: var(--surf, #fff); color: var(--ink, #111);
  outline: none; resize: vertical; font-family: inherit;
  transition: border-color .15s, box-shadow .15s; box-sizing: border-box;
}
.gp-textarea:focus { border-color: var(--c-blue, #3b82f6); box-shadow: 0 0 0 3px rgba(59,130,246,.08); }
.gp-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gp-field-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* AI helper label row */
.gp-label-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 5px;
}
.gp-label-row .gp-label { margin-bottom: 0; }
.gp-ai-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 7px; border: none;
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(139,92,246,.08));
  color: #7c3aed; font-size: 10px; font-weight: 700;
  cursor: pointer; transition: all .25s cubic-bezier(.22,1,.36,1); white-space: nowrap;
  letter-spacing: .2px;
}
.gp-ai-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.gp-ai-btn:hover {
  background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(139,92,246,.15));
  transform: translateY(-1px); box-shadow: 0 2px 8px rgba(139,92,246,.15);
}
.gp-ai-btn:active { transform: translateY(0); }
.gp-ai-btn:disabled { opacity: .5; cursor: default; transform: none !important; box-shadow: none !important; }
.gp-ai-btn.is-loading { pointer-events: none; }
.gp-ai-btn.is-loading svg { animation: gpAiSpin 1s linear infinite; }
@keyframes gpAiSpin { to { transform: rotate(360deg); } }

/* AI task generator */
.gp-ai-task-bar {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 10px;
}
.gp-ai-task-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); color: #fff;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all .25s cubic-bezier(.22,1,.36,1); white-space: nowrap;
  box-shadow: 0 2px 8px rgba(139,92,246,.2);
}
.gp-ai-task-btn svg { width: 14px; height: 14px; flex-shrink: 0; stroke: #fff; fill: none; }
.gp-ai-task-btn:hover {
  transform: translateY(-1px); box-shadow: 0 4px 14px rgba(139,92,246,.3);
  background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
}
.gp-ai-task-btn:active { transform: translateY(0); }
.gp-ai-task-btn:disabled { opacity: .5; cursor: default; transform: none !important; box-shadow: none !important; }

/* ────────────────── 7. MEMBERS PANEL ────────────────── */

.gp-member-list { display: flex; flex-direction: column; gap: 4px; min-height: 40px; }
.gp-member-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 12px;
  background: var(--bg, #f9fafb); border: 1px solid var(--border-s, #f3f4f6);
  transition: border-color .15s;
}
.gp-member-card:hover { border-color: var(--border, #e5e7eb); }
.gp-member-avatar {
  width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.gp-member-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--ink, #111); min-width: 0; }
.gp-member-role {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  color: #7c3aed; letter-spacing: .3px;
  padding: 2px 8px; border-radius: 6px;
  background: rgba(139,92,246,.08);
}
.gp-member-remove {
  width: 26px; height: 26px; border-radius: 8px; border: none;
  background: transparent; color: var(--ink4, #d1d5db); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.gp-member-remove:hover { background: var(--c-red-bg, #fee2e2); color: var(--c-red, #ef4444); }
.gp-member-remove svg { width: 14px; height: 14px; }
.gp-member-empty {
  padding: 32px; text-align: center; font-size: 13px; color: var(--ink4, #d1d5db);
  border: 1.5px dashed var(--border, #e5e7eb); border-radius: 14px;
  background: rgba(59,130,246,.02);
}

/* Scope toggle button & collapsible wrap */
.gp-section-label--flex {
  display: flex; align-items: center; justify-content: space-between;
}
.gp-scope-toggle {
  height: 30px; border-radius: 8px; border: 1.5px solid var(--c-blue, #3b82f6);
  background: var(--c-blue-bg, #eff6ff); color: var(--c-blue, #3b82f6); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 0 10px; font-size: 11.5px; font-weight: 600;
  transition: background .15s, color .15s, border-color .15s, transform .25s;
}
.gp-scope-toggle svg { width: 14px; height: 14px; flex-shrink: 0; transition: transform .25s; }
.gp-scope-toggle:hover { background: var(--c-blue, #3b82f6); color: #fff; border-color: var(--c-blue, #3b82f6); }
.gp-scope-toggle.is-active { background: var(--c-blue, #3b82f6); color: #fff; border-color: var(--c-blue, #3b82f6); }
.gp-scope-toggle.is-active svg { transform: rotate(45deg); }
.gp-scope-wrap {
  overflow: hidden; opacity: 0; max-height: 0;
  transition: opacity .25s ease, max-height .25s ease;
}
.gp-scope-wrap.is-open { opacity: 1; max-height: 200px; }

/* ────────────────── 8. TASKS PANEL ────────────────── */

/* AI toggle pill (sparkle + AI label) */
.gp-qa-ai-toggle {
  height: 26px; padding: 0 8px; gap: 4px;
  border: 1.5px solid rgba(139,92,246,.25); background: rgba(139,92,246,.06);
  border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: #7c3aed; font-family: inherit;
  transition: background .2s, color .2s, border-color .2s, transform .15s, box-shadow .2s;
}
.gp-qa-ai-toggle svg { width: 12px; height: 12px; flex-shrink: 0; }
.gp-qa-ai-label { font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.gp-qa-ai-toggle:hover { background: rgba(139,92,246,.14); border-color: rgba(139,92,246,.4); box-shadow: 0 2px 8px rgba(139,92,246,.1); }
.gp-qa-ai-toggle:active { transform: scale(.93); }
/* AI mode active on goal task bar */
.gp-task-add.is-ai-mode .gp-qa-ai-toggle { background: #7c3aed; color: #fff; border-color: #7c3aed; box-shadow: 0 2px 10px rgba(124,58,237,.25); }
.gp-task-add.is-ai-mode .gp-qa-ai-toggle svg { stroke: #fff; }
.gp-task-add.is-ai-mode .gp-qa-ai-toggle:hover { background: #6d28d9; border-color: #6d28d9; }
.gp-task-add.is-ai-mode { border-color: rgba(139,92,246,.35); border-style: solid; }
.gp-task-add.is-ai-mode .gp-task-add-input::placeholder { color: #a78bfa; }
.gp-task-add.is-ai-mode .gp-task-add-btn { background: #7c3aed; }
.gp-task-add.is-ai-mode .gp-task-add-btn:hover { opacity: .85; }

.gp-task-add {
  display: flex; align-items: center; gap: 4px; margin-bottom: 10px;
  background: var(--surf, #fff); border-radius: 10px; padding: 4px 6px 4px 4px;
  border: 1.5px solid var(--border-s, #f3f4f6); transition: border-color .2s, box-shadow .2s;
}
.gp-task-add:focus-within { border-color: var(--c-blue, #3b82f6); box-shadow: 0 0 0 3px rgba(59,130,246,.06); }
.gp-task-add--full .gp-task-add-plus {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--ink4, #d1d5db);
}
.gp-task-add--full .gp-task-add-plus svg { width: 14px; height: 14px; }
.gp-task-add-input {
  flex: 1; min-width: 0; padding: 6px 6px; font-size: 13px;
  border: none; background: transparent; color: var(--ink, #111); outline: none;
}
.gp-task-add-btn {
  padding: 5px 14px; border-radius: 7px; font-size: 12px; font-weight: 700;
  color: #fff; background: var(--c-blue, #3b82f6); border: none; cursor: pointer;
  transition: opacity .15s; flex-shrink: 0; white-space: nowrap;
}
.gp-task-add-btn:hover { opacity: .85; }

/* Divider & expand */
.gp-qa-divider {
  width: 1px; height: 14px; background: var(--border, #e5e7eb);
  margin: 0 2px; flex-shrink: 0;
}
.gp-qa-opt-expand svg { stroke-width: 1.8; }

/* Inline task option icons */
.gp-qa-options {
  display: flex; align-items: center; gap: 1px; flex-shrink: 0;
}

.gp-qa-opt-btn {
  width: 28px; height: 28px; border-radius: 6px; display: flex;
  align-items: center; justify-content: center; cursor: pointer;
  background: transparent; border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease;
  flex-shrink: 0;
}
.gp-qa-opt-btn svg {
  width: 14px; height: 14px; stroke: var(--ink4, #9ca3af); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.gp-qa-opt-btn:hover { background: var(--bg, #f1f5f9); border-color: var(--border-s, #e5e7eb); }
.gp-qa-opt-btn:hover svg { stroke: var(--ink2, #374151); }
.gp-qa-opt-btn.is-set { background: var(--c-blue-bg, rgba(0,75,124,.08)); border-color: var(--c-blue-bg, rgba(0,75,124,.15)); }
.gp-qa-opt-btn.is-set svg { stroke: var(--c-blue, #3b82f6); }

/* Popovers — positioned via JS, hidden by default */
.gp-qa-popover {
  position: fixed; z-index: 10060; min-width: 180px;
  background: var(--surf, #fff); border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px; padding: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
}
.gp-qa-pop-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; color: var(--ink4, #9ca3af); margin-bottom: 6px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border-s, #f3f4f6);
}
.gp-qa-pop-priorities { display: flex; flex-direction: column; gap: 2px; }
.gp-qa-pop-pri {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 6px; cursor: pointer;
  font-size: 12px; font-weight: 600;
  transition: background .12s ease;
}
.gp-qa-pop-pri[data-val="Critical"] { color: #dc2626; }
.gp-qa-pop-pri[data-val="High"] { color: #ef4444; }
.gp-qa-pop-pri[data-val="Medium"] { color: #d97706; }
.gp-qa-pop-pri[data-val="Low"] { color: #16a34a; }
.gp-qa-pop-pri:hover { background: var(--bg, #f1f5f9); }
.gp-qa-pop-pri.is-selected { background: var(--c-blue-bg, #eff6ff); }
.gp-qa-pop-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.gp-qa-pop-list { max-height: 180px; overflow-y: auto; }
.gp-qa-pop-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--ink, #111);
  transition: background .12s ease;
}
.gp-qa-pop-item:hover { background: var(--bg, #f1f5f9); }
.gp-qa-pop-item.is-selected { background: var(--c-blue-bg, #eff6ff); }
.gp-qa-pop-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c-blue-bg, #eff6ff); color: var(--c-blue, #3b82f6);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; flex-shrink: 0;
}
.gp-qa-pop-date {
  width: 100%; border: 1px solid var(--border-s, #e5e7eb); border-radius: 6px;
  font-family: var(--f); font-size: 12px; color: var(--ink, #111);
  padding: 7px 10px; outline: none; background: var(--bg, #f8fafc);
  transition: border-color .15s ease; box-sizing: border-box;
}
.gp-qa-pop-date:focus { border-color: var(--c-blue, #3b82f6); }

/* Description popover */
.gp-qa-popover--desc { min-width: 260px; }
.gp-qa-popover--cal { min-width: 280px; }
.gp-qa-pop-desc-input {
  width: 100%; border: 1px solid var(--border-s, #e5e7eb); border-radius: 8px;
  font-family: inherit; font-size: 12px; color: var(--ink, #111);
  padding: 8px 10px; outline: none; background: var(--bg, #f8fafc);
  resize: vertical; transition: border-color .15s; box-sizing: border-box;
}
.gp-qa-pop-desc-input:focus { border-color: var(--c-blue, #3b82f6); }

/* Submission toggle row */
.gp-sub-toggle-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 4px; cursor: pointer; font-size: 12px; font-weight: 600;
  color: var(--ink, #111);
}
.gp-sub-toggle-row input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--c-blue, #3b82f6);
  cursor: pointer; flex-shrink: 0;
}
.gp-sub-toggle-label { user-select: none; }

/* Task due calendar popover */
.gp-qa-task-cal-wrap { width: 240px; }

/* Tag pills */
.gp-qa-tag-row {
  display: none; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 0 6px 10px;
}
.gp-task-add.has-tags ~ .gp-qa-tag-row { display: flex; }
.gp-qa-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 10px; font-size: 10px;
  font-weight: 600; background: var(--bg, #f1f5f9);
  color: var(--ink2, #374151); border: 1px solid var(--border-s, #e5e7eb);
}
.gp-qa-tag-x {
  cursor: pointer; font-size: 12px; line-height: 1; opacity: .6;
  transition: opacity .1s; margin-left: 2px;
}
.gp-qa-tag-x:hover { opacity: 1; color: var(--c-red, #ef4444); }

/* Task list */
.gp-task-list { display: flex; flex-direction: column; gap: 8px; }
.gp-task-card {
  border: 1px solid rgba(0,0,0,.08); border-radius: 12px;
  padding: 12px 14px; cursor: pointer;
  background: var(--surf, #fff);
  transition: background .2s, border-color .2s, transform .2s, box-shadow .2s;
}
.gp-task-card:hover {
  border-color: rgba(0,0,0,.12); transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0,0,0,.04);
}
.gp-task-card.is-dragging { opacity: .4; transform: scale(.97); }
.gp-task-card.is-done { opacity: .55; }
.gp-task-card.is-done .gp-task-title { text-decoration: line-through; color: var(--ink4, #9ca3af); }
.gp-task-card-row {
  display: flex; align-items: center; gap: 6px;
}
.gp-task-check {
  width: 20px; height: 20px; border-radius: 50%; border: none;
  background: transparent; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--ink4, #cbd5e1); transition: color .15s;
  padding: 0;
}
.gp-task-check svg { width: 18px; height: 18px; }
.gp-task-check:hover { color: var(--c-blue, #3b82f6); }
.gp-task-card.is-done .gp-task-check { color: var(--c-green, #16a34a); }
.gp-task-drag {
  color: var(--ink4, #cbd5e1); cursor: grab; user-select: none;
  flex-shrink: 0;
}
.gp-task-drag svg { width: 12px; height: 12px; }
.gp-task-pri-dot {
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
}
.gp-task-title {
  flex: 1; font-size: 13px; font-weight: 600;
  color: var(--ink, #111); line-height: 1.35;
  min-width: 0; word-break: break-word;
  cursor: text; border-radius: 4px; padding: 1px 4px;
  transition: background .15s;
}
.gp-task-title:hover { background: rgba(59,130,246,.04); }
.gp-task-edit-input {
  flex: 1; min-width: 0; padding: 3px 6px; font-size: 13px; font-weight: 600;
  color: var(--ink, #111); line-height: 1.35; font-family: inherit;
  border: 1.5px solid var(--c-blue, #3b82f6); border-radius: 6px;
  background: var(--surf, #fff); outline: none;
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}
.gp-task-act--edit:hover { color: var(--c-blue, #3b82f6); }
.gp-task-actions {
  display: flex; gap: 2px; flex-shrink: 0; opacity: .5;
  transition: opacity .15s;
}
.gp-task-card:hover .gp-task-actions { opacity: 1; }
.gp-task-act {
  width: 24px; height: 24px; border-radius: 7px; border: none;
  background: transparent; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  color: var(--ink4, #9ca3af); transition: background .15s, color .15s;
}
.gp-task-act:hover { background: rgba(0,0,0,.06); }
.gp-task-act--del:hover { color: var(--c-red, #ef4444); }
.gp-task-act svg { width: 13px; height: 13px; }
.gp-task-meta {
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  margin-top: 4px; padding-left: 18px;
}
.gp-task-chip {
  font-size: 10px; padding: 2px 7px; border-radius: 5px;
  background: rgba(0,0,0,.04); color: var(--ink2, #475569);
  font-weight: 600; display: inline-flex; align-items: center; gap: 3px;
}
.gp-task-chip svg { width: 10px; height: 10px; }
.gp-task-chip--pri-critical { background: rgba(220,38,38,.08); color: #dc2626; }
.gp-task-chip--pri-high { background: rgba(239,68,68,.08); color: #ef4444; }
.gp-task-chip--pri-medium { background: rgba(217,119,6,.08); color: #d97706; }
.gp-task-chip--pri-low { background: rgba(22,163,74,.08); color: #16a34a; }
.gp-task-chip--submit { background: rgba(99,102,241,.08); color: #6366f1; }
.gp-task-chip--due { background: rgba(217,119,6,.06); color: #b45309; }
.gp-task-chip--assignee { background: rgba(139,92,246,.08); color: #7c3aed; }
.gp-task-chip--desc { background: rgba(13,148,136,.06); color: #0d9488; cursor: help; }

/* ── Full task edit popup ── */
.gp-task-edit-backdrop {
  position: fixed; inset: 0; z-index: 10020;
  background: rgba(0,0,0,.4); display: flex;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.gp-task-edit-card {
  background: #fff; border-radius: 16px; padding: 24px 28px;
  max-width: 440px; width: 92%; box-shadow: 0 20px 60px rgba(0,0,0,.22);
}
.gp-task-edit-header {
  font-size: 16px; font-weight: 800; color: #0f172a;
  margin-bottom: 16px;
}
.gp-task-edit-label {
  font-size: 11px; font-weight: 700; color: #64748b;
  text-transform: uppercase; letter-spacing: .3px;
  display: block; margin-bottom: 4px; margin-top: 12px;
}
.gp-task-edit-label:first-of-type { margin-top: 0; }
.gp-task-edit-field {
  width: 100%; padding: 9px 12px; border: 1.5px solid #e2e8f0;
  border-radius: 8px; font-size: 13px; font-family: inherit;
  color: #0f172a; outline: none; box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.gp-task-edit-field:focus {
  border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,.12);
}
.gp-task-edit-ta { resize: vertical; min-height: 60px; }
.gp-task-edit-row { display: flex; gap: 12px; }
.gp-task-edit-col { flex: 1; }
.gp-task-edit-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid #f1f5f9;
}
.gp-task-edit-btn {
  padding: 9px 20px; border-radius: 8px; font-size: 13px;
  font-weight: 600; cursor: pointer; font-family: inherit;
}
.gp-task-edit-btn--cancel {
  border: 1px solid #e2e8f0; background: #fff; color: #64748b;
}
.gp-task-edit-btn--cancel:hover { background: #f8fafc; }
.gp-task-edit-btn--save {
  border: none; background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff; box-shadow: 0 2px 8px rgba(139,92,246,.25);
}
.gp-task-edit-btn--save:hover { box-shadow: 0 4px 12px rgba(139,92,246,.35); }

.gp-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 32px; color: var(--ink4, #d1d5db); font-size: 13px; text-align: center;
  border: 1.5px dashed var(--border, #e5e7eb); border-radius: 14px;
  background: rgba(59,130,246,.02);
}
.gp-empty svg { width: 28px; height: 28px; }

/* ────────────────── 9. INNER TASK CREATOR ────────────────── */

.gp-inner-task {
  position: absolute; inset: 0; z-index: 10;
  background: var(--surf, #fff); border-radius: 20px;
  display: flex; flex-direction: column;
  animation: gpInnerIn .2s ease-out;
}
@keyframes gpInnerIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.gp-inner-task-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; border-bottom: 1px solid var(--border-s, #f3f4f6); flex-shrink: 0;
}
.gp-inner-task-title {
  font-size: 15px; font-weight: 800; color: var(--ink, #111);
}
.gp-inner-task-body {
  flex: 1; overflow-y: auto; padding: 20px 28px;
}
.gp-inner-task-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 14px 24px; border-top: 1px solid var(--border-s, #f3f4f6); flex-shrink: 0;
  background: var(--bg, #f9fafb); border-radius: 0 0 20px 20px;
}
.gp-inner-sub-row { display: flex; align-items: center; gap: 6px; }

/* ────────────────── 9b. RECURRING + TIME ESTIMATE ────────────────── */

.gp-select {
  width: 100%; padding: 7px 10px; border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px; font-size: 13px; font-family: var(--f);
  color: var(--ink, #111); background: var(--surf, #fff);
  outline: none; cursor: pointer; transition: border-color .15s;
}
.gp-select:focus { border-color: var(--c-blue, #0284c7); }

.gp-recur-custom {
  display: flex; align-items: center; gap: 6px;
  margin-top: 8px; padding: 8px 10px;
  background: var(--bg, #f9fafb); border-radius: 8px;
  border: 1px solid var(--border, #e2e8f0);
}
.gp-recur-every {
  font-size: 12px; color: var(--ink3, #6b7280); font-weight: 600; white-space: nowrap;
}
.gp-recur-num {
  width: 52px; padding: 5px 8px; border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px; font-size: 13px; font-family: var(--f);
  color: var(--ink, #111); background: var(--surf, #fff);
  outline: none; -moz-appearance: textfield;
}
.gp-recur-num::-webkit-inner-spin-button,
.gp-recur-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.gp-recur-num:focus { border-color: var(--c-blue, #0284c7); }
.gp-recur-unit {
  padding: 5px 8px; border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px; font-size: 12px; font-family: var(--f);
  color: var(--ink, #111); background: var(--surf, #fff);
  outline: none; cursor: pointer;
}
.gp-recur-unit:focus { border-color: var(--c-blue, #0284c7); }

.gp-time-est {
  display: flex; align-items: center; gap: 0;
  border: 1px solid var(--border, #e2e8f0); border-radius: 8px;
  overflow: hidden; background: var(--surf, #fff); transition: border-color .15s;
}
.gp-time-est:focus-within { border-color: var(--c-blue, #0284c7); }
.gp-time-est-num {
  border: none; outline: none; font-size: 13px; font-family: var(--f);
  padding: 7px 10px; width: 56px; color: var(--ink, #111);
  background: transparent; -moz-appearance: textfield;
}
.gp-time-est-num::-webkit-inner-spin-button,
.gp-time-est-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.gp-time-est-unit {
  border: none; border-left: 1px solid var(--border, #e2e8f0);
  padding: 7px 10px; font-size: 11px; font-weight: 600;
  color: var(--c-blue, #0284c7); background: rgba(2,132,199,.05);
  cursor: pointer; font-family: var(--f); white-space: nowrap;
  transition: background .15s; letter-spacing: .02em;
}
.gp-time-est-unit:hover { background: rgba(2,132,199,.1); }

/* ────────────────── 10. AI TASK SUGGESTION POPUP ────────────────── */

.gp-ais-overlay {
  position: fixed; z-index: 13500;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 900px; max-width: 94vw; height: 600px; max-height: 85vh;
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,.25), 0 0 0 1px rgba(0,0,0,.06);
  animation: gpAisFadeIn .25s ease;
}
@keyframes gpAisFadeIn { from { opacity: 0; transform: translate(-50%, -50%) scale(.96); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

.gp-ais-shell {
  width: 100%; height: 100%;
  background: #f9fafb; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px;
}

.gp-ais-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px; background: #fff; border-bottom: 1px solid #e5e7eb; flex-shrink: 0;
  cursor: grab; user-select: none;
}
.gp-ais-topbar:active { cursor: grabbing; }
.gp-ais-topbar-title { font-size: 14px; font-weight: 800; color: #0f172a; }
.gp-ais-topbar-spacer { flex: 1; }
.gp-ais-topbar-close {
  width: 30px; height: 30px; border: none; background: #f1f5f9; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #64748b; transition: all .15s; flex-shrink: 0;
}
.gp-ais-topbar-close:hover { background: #fee2e2; color: #ef4444; }
.gp-ais-topbar-close svg { width: 14px; height: 14px; }

.gp-ais-body { display: flex; flex: 1; overflow: hidden; }

/* ── Left panel: task cards ── */
.gp-ais-left {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  border-right: 1px solid #e5e7eb; background: #fff;
}
.gp-ais-left-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px; border-bottom: 1px solid #f1f5f9; flex-shrink: 0;
}
.gp-ais-select-all {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: #475569; cursor: pointer;
}
.gp-ais-select-all input { width: 15px; height: 15px; accent-color: #7c3aed; cursor: pointer; }
.gp-ais-count { font-size: 11px; font-weight: 600; color: #94a3b8; }

.gp-ais-cards {
  flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 8px;
}
.gp-ais-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 48px 20px; color: #94a3b8; font-size: 13px; text-align: center;
}

.gp-ais-card {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid #e5e7eb; background: #fff;
  transition: all .2s ease; cursor: pointer;
  animation: gpAisCardIn .25s ease both;
}
@keyframes gpAisCardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.gp-ais-card:nth-child(1) { animation-delay: 0s; }
.gp-ais-card:nth-child(2) { animation-delay: .05s; }
.gp-ais-card:nth-child(3) { animation-delay: .1s; }
.gp-ais-card:nth-child(4) { animation-delay: .15s; }
.gp-ais-card:nth-child(5) { animation-delay: .2s; }
.gp-ais-card:nth-child(6) { animation-delay: .25s; }
.gp-ais-card:hover { border-color: #c4b5fd; box-shadow: 0 2px 8px rgba(139,92,246,.06); }
.gp-ais-card.is-selected { border-color: #8b5cf6; background: #faf5ff; box-shadow: 0 0 0 2px rgba(139,92,246,.15); }
.gp-ais-card-check {
  width: 18px; height: 18px; border-radius: 5px; border: 2px solid #d1d5db;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  margin-top: 1px; transition: all .15s;
}
.gp-ais-card.is-selected .gp-ais-card-check { background: #7c3aed; border-color: #7c3aed; }
.gp-ais-card-check svg { width: 12px; height: 12px; stroke: #fff; fill: none; stroke-width: 3; display: none; }
.gp-ais-card.is-selected .gp-ais-card-check svg { display: block; }
.gp-ais-card-body { flex: 1; min-width: 0; }
.gp-ais-card-title { font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.gp-ais-card-desc { font-size: 12px; color: #64748b; line-height: 1.5; }
.gp-ais-card-kept {
  display: inline-block; font-size: 10px; font-weight: 700; color: #7c3aed;
  background: #f5f3ff; padding: 2px 8px; border-radius: 6px; margin-top: 4px;
}
.gp-ais-card.is-kept {
  border-color: #c4b5fd; background: #faf5ff;
}
.gp-ais-card-type {
  display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .4px; padding: 1px 6px; border-radius: 4px; margin-top: 3px;
  background: rgba(139,92,246,.08); color: #7c3aed;
}

.gp-ais-left-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid #f1f5f9; flex-shrink: 0;
}

.gp-ais-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: 10px; font-size: 12px; font-weight: 700;
  cursor: pointer; border: none; transition: all .15s; white-space: nowrap;
}
.gp-ais-btn--outline {
  background: #fff; color: #475569; border: 1.5px solid #e5e7eb;
}
.gp-ais-btn--outline:hover { background: #f8fafc; border-color: #c4b5fd; color: #7c3aed; }
.gp-ais-btn--primary {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff;
  box-shadow: 0 2px 8px rgba(139,92,246,.2);
}
.gp-ais-btn--primary:hover { box-shadow: 0 4px 14px rgba(139,92,246,.3); transform: translateY(-1px); }
.gp-ais-btn--primary:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }

/* ── Right panel: AI chat ── */
.gp-ais-right {
  width: 340px; display: flex; flex-direction: column; flex-shrink: 0;
  overflow: hidden; background: #fff;
}
.gp-ais-chat-head {
  padding: 14px 16px; border-bottom: 1px solid #f1f5f9;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
}
.gp-ais-chat-title { font-size: 13px; font-weight: 700; color: #0f172a; }
.gp-ais-chat-sub { font-size: 10px; color: #8b5cf6; font-weight: 600; }

.gp-ais-chat-msgs {
  flex: 1; overflow-y: auto; padding: 20px 16px; display: flex; flex-direction: column; gap: 14px; min-height: 0;
}

.gp-ais-msg { display: flex; max-width: 100%; animation: gpAisMsgIn .25s ease; }
@keyframes gpAisMsgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.gp-ais-msg-ai { align-self: flex-start; max-width: 100%; }
.gp-ais-msg-user { align-self: flex-end; max-width: 85%; }
.gp-ais-msg-bubble { font-size: 13px; line-height: 1.7; color: #0f172a; word-wrap: break-word; }
.gp-ais-msg-ai .gp-ais-msg-bubble { background: transparent; padding: 0; color: #1e293b; font-size: 13px; line-height: 1.7; }
.gp-ais-msg-user .gp-ais-msg-bubble {
  background: #8b5cf6; color: #fff; padding: 10px 16px;
  border-radius: 18px 18px 4px 18px; font-size: 13px;
}

.gp-ais-msg-typing { display: flex; gap: 4px; padding: 6px 0; }
.gp-ais-msg-typing span { width: 6px; height: 6px; border-radius: 50%; background: #c4b5fd; animation: gpAisTyping .8s infinite; }
.gp-ais-msg-typing span:nth-child(2) { animation-delay: .2s; }
.gp-ais-msg-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes gpAisTyping { 0%,80%,100% { opacity: .3; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

.gp-ais-chat-input-wrap {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid #f1f5f9; background: #fff;
}
.gp-ais-chat-input {
  flex: 1; border: 1.5px solid #e5e7eb; border-radius: 20px;
  padding: 10px 18px; font-size: 13px; font-family: inherit; color: #0f172a;
  outline: none; resize: none; min-height: 42px; max-height: 120px;
  transition: border-color .15s; box-sizing: border-box; background: #f9fafb;
}
.gp-ais-chat-input:focus { border-color: #8b5cf6; background: #fff; }
.gp-ais-chat-input::placeholder { color: #94a3b8; }
.gp-ais-chat-send {
  width: 38px; height: 38px; border: none; background: #8b5cf6; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .12s; flex-shrink: 0;
}
.gp-ais-chat-send:hover { background: #7c3aed; }
.gp-ais-chat-send:disabled { background: #e2e8f0; cursor: not-allowed; }
.gp-ais-chat-send svg { width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 2; }

/* Spin animation for loading */
@keyframes gpAiSpin { to { transform: rotate(360deg); } }

/* ── Responsive adjustments ── */
@media (max-width: 800px) {
  .gp-ais-body { flex-direction: column; }
  .gp-ais-right { width: 100%; height: 260px; border-top: 1px solid #e5e7eb; }
  .gp-ais-left { border-right: none; }
}

/* ────────────────── 11. PLACEHOLDER FLASH ANIMATION ────────────────── */

@keyframes gpPhFlash {
  0%   { opacity: 0; transform: translateY(4px); }
  30%  { opacity: 1; transform: translateY(0); }
  100% { opacity: 1; transform: translateY(0); }
}
.gp-ph-flash::placeholder {
  animation: gpPhFlash .45s ease-out;
}

/* ────────────────── 12. AI MARKDOWN FORMATTING ────────────────── */

.gp-ais-msg-bubble strong { font-weight: 600; }
.gp-ais-msg-bubble em { font-style: italic; }
.gp-ais-li-num {
  display: inline-block; min-width: 22px;
  font-weight: 600; color: #7c3aed;
}
.gp-ais-li-bullet {
  display: inline-block; min-width: 16px;
  color: #7c3aed; font-weight: 700;
}
.gp-ais-msg-ai .gp-ais-msg-bubble {
  line-height: 1.65; font-size: 13px;
}

/* ────────────────── 13. PLAN TAB ────────────────── */

/* Sub-tab pill navigation */
.gp-plan-nav {
  display: flex; gap: 4px; margin-bottom: 16px; padding: 3px;
  background: var(--bg, #f3f4f6); border-radius: 10px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.gp-plan-pill {
  padding: 6px 14px; border-radius: 8px; border: none;
  background: transparent; color: var(--ink3, #6b7280);
  font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: all .2s; font-family: inherit;
}
.gp-plan-pill:hover { color: var(--ink, #111); background: rgba(255,255,255,.5); }
.gp-plan-pill.is-active {
  background: #fff; color: var(--ink, #111);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* Plan sub-tab panels */
.gp-plan-sub { animation: gpFadeIn .2s ease; }
@keyframes gpFadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Shared plan item components */
.gp-plan-count {
  font-size: 10px; font-weight: 700; color: var(--ink4, #9ca3af);
  margin-left: 2px;
}
.gp-plan-add {
  display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
  background: var(--surf, #fff); border-radius: 10px; padding: 4px 6px;
  border: 1.5px solid var(--border-s, #f3f4f6); transition: border-color .2s, box-shadow .2s;
}
.gp-plan-add:focus-within { border-color: var(--c-blue, #3b82f6); box-shadow: 0 0 0 3px rgba(59,130,246,.06); }
.gp-plan-add-input {
  flex: 1; min-width: 0; padding: 7px 8px; font-size: 13px;
  border: none; background: transparent; color: var(--ink, #111); outline: none;
  font-family: inherit;
}
.gp-plan-add-date {
  width: 130px; padding: 5px 8px; font-size: 12px; font-family: inherit;
  border: 1px solid var(--border, #e5e7eb); border-radius: 7px;
  background: var(--bg, #f9fafb); color: var(--ink2, #374151);
  outline: none; cursor: pointer; flex-shrink: 0;
  transition: border-color .15s;
}
.gp-plan-add-date:focus { border-color: var(--c-blue, #3b82f6); }
.gp-plan-add-btn {
  padding: 5px 14px; border-radius: 7px; font-size: 12px; font-weight: 700;
  color: #fff; background: var(--c-blue, #3b82f6); border: none; cursor: pointer;
  transition: opacity .15s; flex-shrink: 0; white-space: nowrap;
}
.gp-plan-add-btn:hover { opacity: .85; }
.gp-plan-list { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.gp-plan-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--bg, #f9fafb); border: 1px solid var(--border-s, #f3f4f6);
  transition: border-color .15s, background .15s;
}
.gp-plan-item:hover { border-color: var(--border, #e5e7eb); }
.gp-plan-item.is-done { opacity: .55; }
.gp-plan-item.is-done .gp-plan-item-title { text-decoration: line-through; color: var(--ink4, #9ca3af); }
.gp-plan-item-check {
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: transparent; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--ink4, #cbd5e1); transition: color .15s; padding: 0;
}
.gp-plan-item-check svg { width: 18px; height: 18px; }
.gp-plan-item-check:hover { color: var(--c-blue, #3b82f6); }
.gp-plan-item.is-done .gp-plan-item-check { color: var(--c-green, #16a34a); }
.gp-plan-item-title {
  flex: 1; font-size: 13px; font-weight: 600; color: var(--ink, #111);
  min-width: 0; word-break: break-word;
}
.gp-plan-item-date {
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 6px;
  background: rgba(217,119,6,.08); color: #b45309; flex-shrink: 0;
  white-space: nowrap;
}
.gp-plan-item-del {
  width: 24px; height: 24px; border-radius: 7px; border: none;
  background: transparent; cursor: pointer; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--ink4, #d1d5db); transition: background .15s, color .15s;
  opacity: 0; padding: 0;
}
.gp-plan-item:hover .gp-plan-item-del { opacity: 1; }
.gp-plan-item-del:hover { background: var(--c-red-bg, #fee2e2); color: var(--c-red, #ef4444); }
.gp-plan-item-del svg { width: 13px; height: 13px; }

/* Section label color: red */
.gp-section-label--red svg { color: #ef4444; }

/* Start / Stop / Continue 3-column */
.gp-ssc-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
}
.gp-ssc-col {
  background: var(--bg, #f9fafb); border-radius: 12px; padding: 10px;
  border: 1px solid var(--border-s, #f3f4f6);
}
.gp-ssc-col .gp-plan-add { border: none; background: transparent; padding: 2px 0; margin-bottom: 6px; }
.gp-ssc-col .gp-plan-add-input { padding: 5px 6px; font-size: 12px; }
.gp-ssc-col .gp-plan-add-btn { padding: 4px 10px; font-size: 11px; }
.gp-ssc-header {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  margin-bottom: 6px;
}
.gp-ssc-header svg { width: 13px; height: 13px; flex-shrink: 0; }
.gp-ssc-col--start .gp-ssc-header { color: #16a34a; }
.gp-ssc-col--start .gp-ssc-header svg { color: #16a34a; }
.gp-ssc-col--stop .gp-ssc-header { color: #ef4444; }
.gp-ssc-col--stop .gp-ssc-header svg { color: #ef4444; }
.gp-ssc-col--continue .gp-ssc-header { color: #3b82f6; }
.gp-ssc-col--continue .gp-ssc-header svg { color: #3b82f6; }
.gp-ssc-col .gp-plan-item { padding: 6px 8px; border-radius: 8px; }
.gp-ssc-col .gp-plan-item-title { font-size: 12px; }

/* Skill pills */
.gp-skill-pills {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0;
}
.gp-skill-pill {
  padding: 5px 12px; border-radius: 20px; border: 1.5px solid var(--border, #e5e7eb);
  background: var(--surf, #fff); color: var(--ink2, #374151);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .2s; white-space: nowrap; font-family: inherit;
}
.gp-skill-pill:hover { border-color: var(--c-blue, #3b82f6); color: var(--c-blue, #3b82f6); }
.gp-skill-pill.is-selected {
  background: var(--c-blue, #3b82f6); color: #fff;
  border-color: var(--c-blue, #3b82f6);
}
.gp-skill-pill-x {
  font-size: 14px; line-height: 1; margin-left: 4px; opacity: .7;
  cursor: pointer;
}
.gp-skill-pill-x:hover { opacity: 1; }

/* Plan add-bar date trigger (calendar icon button) */
.gp-plan-date-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; border-radius: 7px; border: 1px solid var(--border, #e5e7eb);
  background: var(--bg, #f9fafb); color: var(--ink3, #6b7280);
  font-size: 11px; font-weight: 600; cursor: pointer; flex-shrink: 0;
  transition: border-color .15s, background .15s, color .15s; font-family: inherit;
  white-space: nowrap;
}
.gp-plan-date-trigger svg { width: 13px; height: 13px; flex-shrink: 0; }
.gp-plan-date-trigger:hover { border-color: var(--c-blue, #3b82f6); color: var(--c-blue, #3b82f6); }
.gp-plan-date-trigger.is-set { background: rgba(217,119,6,.08); border-color: rgba(217,119,6,.25); color: #b45309; }
.gp-plan-date-label { pointer-events: none; }

/* Plan add-bar AI mode */
.gp-plan-add.is-ai-mode { border-color: rgba(139,92,246,.35); border-style: solid; }
.gp-plan-add.is-ai-mode .gp-plan-ai-toggle { background: #7c3aed; color: #fff; border-color: #7c3aed; box-shadow: 0 2px 10px rgba(124,58,237,.25); }
.gp-plan-add.is-ai-mode .gp-plan-ai-toggle svg { stroke: #fff; }
.gp-plan-add.is-ai-mode .gp-plan-ai-toggle:hover { background: #6d28d9; border-color: #6d28d9; }
.gp-plan-add.is-ai-mode .gp-plan-add-input::placeholder { color: #a78bfa; }
.gp-plan-add.is-ai-mode .gp-plan-add-btn { background: #7c3aed; }
.gp-plan-add.is-ai-mode .gp-plan-add-btn:hover { opacity: .85; }

/* SSC columns: hide AI label text, icon only */
.gp-ssc-col .gp-plan-ai-toggle { padding: 0 4px; height: 22px; }
.gp-ssc-col .gp-plan-ai-toggle .gp-qa-ai-label { display: none; }

/* ────────────────── 14. AI INLINE SUGGEST BUTTON ────────────────── */

/* Button group: Improve + Suggest side by side */
.gp-ai-btn-group {
  display: inline-flex; align-items: center; gap: 4px; margin-left: auto;
}

/* Suggest variant — teal/green tint to differentiate from Improve (purple) */
.gp-ai-btn--suggest {
  background: linear-gradient(135deg, rgba(13,148,136,.08), rgba(16,185,129,.08));
  color: #0d9488;
}
.gp-ai-btn--suggest:hover {
  background: linear-gradient(135deg, rgba(13,148,136,.16), rgba(16,185,129,.16));
  box-shadow: 0 2px 8px rgba(13,148,136,.15);
}

/* ────────────────── MODE SELECTOR OVERLAY ────────────────── */

.gp-mode-overlay {
  display: none; position: fixed; inset: 0; z-index: 12500;
  background: rgba(15,23,42,.55); backdrop-filter: blur(6px);
  align-items: center; justify-content: center;
}
.gp-mode-overlay.is-open { display: flex; }
.gp-mode-popup {
  position: relative;
  background: var(--surface1, #fff); border-radius: 20px;
  padding: 40px 36px 36px; max-width: 600px; width: 92%;
  box-shadow: 0 24px 60px rgba(0,0,0,.18);
  animation: gpModeIn .35s cubic-bezier(.22,1,.36,1);
  text-align: center;
}
/* Big mode (COS-style) */
.gp-mode-popup.gp-mode-popup--big {
  max-width: none; width: 94vw; height: 92vh;
  padding: 0; text-align: left;
  display: flex; flex-direction: column; overflow: hidden;
}
@keyframes gpModeIn { from { opacity: 0; transform: scale(.92) translateY(12px); } }
/* Close button — default mode */
.gp-mode-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 10px; border: none;
  background: var(--surface2, #f1f5f9); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.gp-mode-close svg { width: 16px; height: 16px; stroke: var(--ink2, #64748b); }
.gp-mode-close:hover { background: var(--surface3, #e2e8f0); }
/* Close inside big mode topbar */
.gp-mode-popup--big .gp-mode-close {
  position: static; background: rgba(255,255,255,.12);
}
.gp-mode-popup--big .gp-mode-close svg { stroke: #fff; }
.gp-mode-popup--big .gp-mode-close:hover { background: rgba(255,255,255,.22); }

/* Top bar for big mode */
.gp-mode-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  flex-shrink: 0; border-radius: 20px 20px 0 0;
}
.gp-mode-topbar-left { display: flex; align-items: center; gap: 12px; }
.gp-mode-topbar-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.gp-mode-topbar-title { font-size: 16px; font-weight: 700; color: #fff; letter-spacing: -.02em; }

/* Body of big mode */
.gp-mode-body {
  flex: 1; overflow-y: auto; padding: 32px 40px;
  scrollbar-width: thin;
}

/* Mode section */
.gp-mode-section { margin-bottom: 32px; }
.gp-mode-popup--big .gp-mode-sub {
  font-size: 13px; color: var(--ink3, #64748b); margin-bottom: 20px;
}

.gp-mode-icon {
  margin: 0 auto 12px; width: 52px; height: 52px;
  border-radius: 14px; background: linear-gradient(135deg, #8b5cf6, #6366f1);
  display: flex; align-items: center; justify-content: center;
}
.gp-mode-icon svg { width: 26px; height: 26px; stroke: #fff; fill: none; }
.gp-mode-title { font-size: 22px; font-weight: 800; color: var(--ink1, #0f172a); margin-bottom: 6px; }
.gp-mode-sub { font-size: 13px; color: var(--ink3, #64748b); margin-bottom: 28px; }
.gp-mode-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gp-mode-card {
  background: var(--surface2, #f8fafc); border: 2px solid var(--border1, #e2e8f0);
  border-radius: 16px; padding: 28px 20px 24px; cursor: pointer;
  transition: all .3s cubic-bezier(.22,1,.36,1); text-align: center;
}
.gp-mode-card:hover {
  border-color: #8b5cf6; transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(139,92,246,.15);
}
.gp-mode-card-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.gp-mode-card-icon svg { width: 24px; height: 24px; }
.gp-mode-card-title { font-size: 15px; font-weight: 700; color: var(--ink1, #0f172a); margin-bottom: 8px; }
.gp-mode-card-desc { font-size: 12px; color: var(--ink3, #64748b); line-height: 1.5; }

/* Upload label on mode cards */
.gp-mode-card-upload { margin-top: 12px; }
.gp-mode-upload-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--ink3, #64748b);
  padding: 4px 10px; border-radius: 6px;
  border: 1px dashed var(--border1, #cbd5e1);
  cursor: pointer; transition: all .2s;
}
.gp-mode-upload-label:hover { border-color: #8b5cf6; color: #8b5cf6; }

/* ── Drafts section inside big mode ── */
.gp-mode-drafts {
  border-top: 1px solid var(--border1, #e2e8f0);
  padding-top: 24px;
}
.gp-mode-drafts-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.gp-mode-drafts-title {
  font-size: 15px; font-weight: 700; color: var(--ink1, #0f172a);
}
.gp-mode-drafts-count {
  font-size: 11px; font-weight: 700; color: #fff;
  background: #8b5cf6; border-radius: 10px;
  padding: 1px 8px; min-width: 20px; text-align: center;
}
.gp-mode-drafts-count:empty { display: none; }
.gp-mode-drafts-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px;
}
.gp-mode-drafts-empty {
  grid-column: 1 / -1;
  text-align: center; padding: 32px 16px; color: var(--ink4, #94a3b8);
  font-size: 13px; font-style: italic;
}
/* Individual draft card */
.gp-mode-draft-card {
  background: var(--surface2, #f8fafc);
  border: 1px solid var(--border1, #e2e8f0);
  border-radius: 12px; padding: 16px; cursor: pointer;
  transition: all .2s ease; position: relative;
}
.gp-mode-draft-card:hover {
  border-color: #8b5cf6; background: #faf5ff;
  box-shadow: 0 4px 12px rgba(139,92,246,.1);
}
.gp-mode-draft-card-title {
  font-size: 14px; font-weight: 600; color: var(--ink1, #0f172a);
  margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding-right: 28px;
}
.gp-mode-draft-card-meta {
  font-size: 11px; color: var(--ink4, #94a3b8);
  display: flex; align-items: center; gap: 8px;
}
.gp-mode-draft-card-meta svg { width: 12px; height: 12px; flex-shrink: 0; }
.gp-mode-draft-card-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; color: #f59e0b;
  background: #fffbeb; border-radius: 4px; padding: 2px 6px; margin-top: 6px;
}
.gp-mode-draft-card-delete {
  position: absolute; top: 10px; right: 10px;
  width: 24px; height: 24px; border: none; background: none;
  border-radius: 6px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; opacity: 0;
  transition: all .15s;
}
.gp-mode-draft-card:hover .gp-mode-draft-card-delete { opacity: 1; }
.gp-mode-draft-card-delete:hover { background: #fee2e2; }
.gp-mode-draft-card-delete svg { width: 14px; height: 14px; stroke: #ef4444; }

/* ────────────────── AI CHAT-FIRST MODE — shared by task + project ────────────────── */

/* Shell inside mode overlay — reuses gp-aib-shell styling */
.gp-mode-overlay .gp-aib-shell.tk-aib-shell {
  width: 100%; height: 100%;
  max-width: calc(100vw - 48px); max-height: calc(100vh - 48px);
}
/* Hide scrollbars inside mode chat */
.gp-mode-overlay .gp-aib-shell * { scrollbar-width: none; -ms-overflow-style: none; }
.gp-mode-overlay .gp-aib-shell *::-webkit-scrollbar { display: none; }

/* Topbar pill buttons (Drafts, Manual Builder) */
.tk-topbar-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 8px; border: none;
  background: rgba(255,255,255,.08); color: var(--ink3, #94a3b8);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all .2s; white-space: nowrap; margin-right: 4px;
}
.tk-topbar-pill:hover { background: rgba(255,255,255,.15); color: #fff; }
.tk-topbar-pill svg { flex-shrink: 0; }
.tk-topbar-pill-count {
  font-size: 10px; font-weight: 700; color: #fff;
  background: #8b5cf6; border-radius: 8px;
  padding: 0 6px; min-width: 16px; text-align: center; line-height: 1.6;
}
.tk-topbar-pill-count:empty { display: none; }
.tk-topbar-pill--manual { background: rgba(59,130,246,.15); color: #93c5fd; }
.tk-topbar-pill--manual:hover { background: rgba(59,130,246,.25); color: #fff; }

/* Drafts slide-in panel */
.tk-drafts-panel {
  width: 0; min-width: 0; overflow: hidden;
  background: var(--surface2, #f8fafc);
  border-left: 1px solid var(--border1, #e2e8f0);
  display: flex; flex-direction: column;
  transition: width .35s cubic-bezier(.22,1,.36,1), min-width .35s cubic-bezier(.22,1,.36,1);
}
.tk-drafts-panel.is-open {
  width: 340px; min-width: 340px;
}
.tk-drafts-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border1, #e2e8f0);
  font-size: 15px; font-weight: 700; color: var(--ink1, #0f172a);
  flex-shrink: 0;
}
.tk-drafts-panel-close {
  width: 28px; height: 28px; border-radius: 8px; border: none;
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink3, #94a3b8); transition: background .2s;
}
.tk-drafts-panel-close:hover { background: var(--surface3, #e2e8f0); }
.tk-drafts-panel-body {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
/* Draft cards inside the panel (reuse existing styles) */
.tk-drafts-panel-body .gp-mode-draft-card { margin: 0; }
.tk-drafts-panel-body .gp-mode-drafts-empty {
  text-align: center; padding: 40px 16px; color: var(--ink4, #94a3b8);
  font-size: 13px; font-style: italic;
}

/* Chat action buttons (Create Task, Continue Coach, etc.) */
.tk-create-action {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 8px 0 4px;
  animation: gpAibMsgIn .3s ease;
}
.tk-create-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .2s; white-space: nowrap;
}
.tk-create-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(139,92,246,.3); }
.tk-create-btn--alt {
  background: var(--surface2, #f1f5f9); color: var(--ink1, #0f172a);
  border: 1px solid var(--border1, #e2e8f0);
}
.tk-create-btn--alt:hover { background: var(--surface3, #e2e8f0); box-shadow: 0 2px 8px rgba(0,0,0,.08); }

/* Thinking dots animation — reused from AI builder */
.gp-aib-dots { display: flex; gap: 6px; padding: 8px 0; }
.gp-aib-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink4, #94a3b8); opacity: .4;
  animation: gpAibDotPulse 1.4s infinite ease-in-out both;
}
.gp-aib-dots span:nth-child(2) { animation-delay: .16s; }
.gp-aib-dots span:nth-child(3) { animation-delay: .32s; }
@keyframes gpAibDotPulse {
  0%, 80%, 100% { opacity: .4; transform: scale(.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* User message bubble style */
.gp-aib-msg--user {
  align-self: flex-end; max-width: 80%;
}
.gp-aib-msg--user .gp-aib-bubble {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff; border-radius: 16px 16px 4px 16px;
  padding: 10px 16px; font-size: 13.5px; line-height: 1.6;
}

/* ────────────────── AI GUIDED BUILDER — COS ChatGPT POPUP ────────────────── */

/* Hide all scrollbars inside overlay */
.gp-aib-overlay * { scrollbar-width: none; -ms-overflow-style: none; }
.gp-aib-overlay *::-webkit-scrollbar { display: none; }

.gp-aib-overlay {
  display: none; position: fixed; inset: 0; z-index: 12501;
  background: rgba(15,23,42,.55); backdrop-filter: blur(12px);
  align-items: center; justify-content: center; padding: 24px;
}
.gp-aib-overlay.is-open { display: flex; }

/* Prevent scroll bleed-through */
.gp-aib-shell { overscroll-behavior: contain; }
.gp-aib-chat-msgs { overscroll-behavior: contain; }
.gp-aib-plan-body { overscroll-behavior: contain; }

/* Shell — COS popup style */
.gp-aib-shell {
  width: 100%; height: 100%;
  max-width: calc(100vw - 48px); max-height: calc(100vh - 48px);
  background: var(--surface1, #fff); border-radius: 18px;
  box-shadow: 0 32px 80px rgba(0,0,0,.22), 0 0 0 1px rgba(0,0,0,.06);
  display: flex; flex-direction: column; overflow: hidden;
  animation: gpAibShellIn .35s cubic-bezier(.22,1,.36,1);
}
@keyframes gpAibShellIn { from { opacity: 0; transform: scale(.94) translateY(10px); } }

/* ── Top bar ── */
.gp-aib-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border1, #e2e8f0);
  background: var(--surface2, #f8fafc); flex-shrink: 0;
}
.gp-aib-topbar-icon {
  width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  display: flex; align-items: center; justify-content: center;
}
.gp-aib-topbar-info { min-width: 0; }
.gp-aib-topbar-title { font-size: 14px; font-weight: 700; color: var(--ink1, #0f172a); }
.gp-aib-topbar-sub { font-size: 11px; color: var(--ink3, #94a3b8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-aib-topbar-progress { display: flex; gap: 6px; align-items: center; margin-left: 8px; }
.gp-aib-prog-bar {
  width: 80px; height: 6px; border-radius: 3px; background: var(--border1, #e2e8f0); overflow: hidden;
}
.gp-aib-prog-fill {
  height: 100%; border-radius: 3px; background: linear-gradient(90deg, #10b981, #8b5cf6);
  transition: width .4s ease;
}
.gp-aib-prog-label { font-size: 11px; font-weight: 600; color: var(--ink3, #94a3b8); white-space: nowrap; }
.gp-aib-topbar-close {
  width: 30px; height: 30px; border-radius: 8px; border: none;
  background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink3, #94a3b8); transition: background .2s, color .2s;
}
.gp-aib-topbar-close:hover { background: var(--surface3, #e2e8f0); color: var(--ink1, #0f172a); }

/* ── Body: horizontal flex of chat + resize + plan ── */
.gp-aib-body { display: flex; flex: 1; min-height: 0; overflow: hidden; }

/* ── Chat panel ── */
.gp-aib-chat {
  display: flex; flex-direction: column; flex: 1; min-width: 0;
  background: var(--surface1, #fff);
  transition: flex .4s cubic-bezier(.22,1,.36,1);
}
/* In split mode, chat takes majority of space */
.gp-aib-overlay.is-split .gp-aib-chat { flex: 0 0 60%; min-width: 320px; }
.gp-mode-overlay.is-split .gp-aib-chat { flex: 0 0 50%; min-width: 280px; }

/* Centered inner container — limits chat width like ChatGPT / COS */
.gp-aib-chat-center {
  display: flex; flex-direction: column; flex: 1; min-height: 0;
  max-width: 760px; width: 100%; margin: 0 auto;
}
/* In split mode, chat takes full width of its panel */
.gp-aib-overlay.is-split .gp-aib-chat-center { max-width: 100%; }
.gp-mode-overlay.is-split .gp-aib-chat-center { max-width: 100%; }

.gp-aib-chat-msgs {
  flex: 1; overflow-y: auto; padding: 24px 20px;
  display: flex; flex-direction: column; gap: 16px;
}

/* ── Messages — ChatGPT / COS style ── */
.gp-aib-msg {
  font-size: 13.5px; line-height: 1.75;
  animation: gpAibMsgIn .3s ease;
}
@keyframes gpAibMsgIn { from { opacity: 0; transform: translateY(6px); } }

/* AI message: rich formatted, left-aligned, full width */
.gp-aib-msg--ai {
  align-self: flex-start; max-width: 100%;
}
.gp-aib-msg--ai .gp-aib-bubble {
  background: transparent; border: none; padding: 0;
  color: var(--ink1, #1e293b); font-size: 14px; line-height: 1.75;
  max-width: 100%;
}
.gp-aib-msg--ai .gp-aib-bubble p { margin: 0 0 10px 0; }
.gp-aib-msg--ai .gp-aib-bubble p:last-child { margin-bottom: 0; }
.gp-aib-msg--ai .gp-aib-bubble strong { font-weight: 700; color: var(--ink, #0f172a); }
.gp-aib-msg--ai .gp-aib-bubble em { font-style: italic; color: var(--ink2, #475569); }

/* Markdown headers inside AI messages */
.gp-aib-md-h2 {
  font-size: 16px; font-weight: 800; color: var(--ink, #0f172a);
  margin: 16px 0 8px 0; letter-spacing: -.01em;
}
.gp-aib-md-h3 {
  font-size: 15px; font-weight: 700; color: var(--ink, #0f172a);
  margin: 14px 0 6px 0; letter-spacing: -.01em;
}
.gp-aib-msg--ai .gp-aib-bubble .gp-aib-md-h2:first-child,
.gp-aib-msg--ai .gp-aib-bubble .gp-aib-md-h3:first-child { margin-top: 0; }

/* Styled ordered lists — visual step cards */
.gp-aib-md-ol {
  list-style: none; counter-reset: aibStep; margin: 8px 0 12px 0; padding: 0;
}
.gp-aib-md-ol li {
  counter-increment: aibStep;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px; margin-bottom: 6px;
  background: var(--surface2, #f8fafc); border-radius: 10px;
  border: 1px solid var(--border1, #e2e8f0);
  font-size: 13.5px; line-height: 1.6; color: var(--ink1, #1e293b);
  transition: border-color .2s;
}
.gp-aib-md-ol li:hover { border-color: rgba(139,92,246,.25); }
.gp-aib-md-ol li::before {
  content: counter(aibStep);
  display: flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; flex-shrink: 0;
  border-radius: 50%; background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: #fff; font-size: 12px; font-weight: 700;
  margin-top: 1px;
}

/* Styled unordered lists — bullet cards */
.gp-aib-md-ul {
  list-style: none; margin: 8px 0 12px 0; padding: 0;
}
.gp-aib-md-ul li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 14px; margin-bottom: 4px;
  font-size: 13.5px; line-height: 1.6; color: var(--ink1, #1e293b);
  border-radius: 8px;
  transition: background .15s;
}
.gp-aib-md-ul li:hover { background: rgba(139,92,246,.03); }
.gp-aib-md-ul li::before {
  content: '';
  width: 7px; height: 7px; flex-shrink: 0;
  border-radius: 50%; background: #8b5cf6;
  margin-top: 8px;
}

/* ── Option Chips (clickable choices) ── */
.gp-aib-option-row {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 12px; padding: 0;
}
.gp-aib-option-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; width: 100%;
  font-size: 13.5px; font-weight: 500; font-family: inherit;
  text-align: left; line-height: 1.45;
  border: 1.5px solid var(--border1, #e2e8f0); border-radius: 12px;
  background: var(--surface1, #fff); color: var(--ink1, #1e293b);
  cursor: pointer; transition: all .2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.gp-aib-option-chip:hover {
  border-color: #8b5cf6; color: #6d28d9;
  background: rgba(139,92,246,.04);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,92,246,.12);
}
.gp-aib-option-chip:active {
  transform: translateY(0); box-shadow: none;
  background: rgba(139,92,246,.08);
}

/* User message: purple bubble, right-aligned */
.gp-aib-msg--user {
  align-self: flex-end; max-width: 85%;
}
.gp-aib-msg--user .gp-aib-bubble {
  background: #8b5cf6; color: #fff;
  padding: 10px 16px; border-radius: 18px 18px 4px 18px;
  font-size: 14px; line-height: 1.65;
}

/* ── Typing indicator (3 dots, COS style) ── */
.gp-aib-typing {
  display: flex; align-items: center; gap: 5px; padding: 8px 0;
}
.gp-aib-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: #94a3b8;
  animation: gpAibDot 1.4s ease-in-out infinite;
}
.gp-aib-typing span:nth-child(2) { animation-delay: .2s; }
.gp-aib-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes gpAibDot { 0%,80%,100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* ── Chat input — pill-shaped (COS style) ── */
.gp-aib-chat-input-wrap {
  padding: 14px 20px; border-top: 1px solid var(--border1, #e2e8f0);
  display: flex; gap: 10px; align-items: flex-end; flex-shrink: 0;
}
.gp-aib-chat-input {
  flex: 1; resize: none; border: 1.5px solid var(--border1, #e2e8f0);
  border-radius: 20px; padding: 10px 18px; font-size: 13.5px;
  font-family: inherit; background: #f9fafb;
  color: var(--ink1, #0f172a); outline: none;
  min-height: 42px; max-height: 120px;
  transition: border-color .2s;
}
.gp-aib-chat-input:focus { border-color: #8b5cf6; background: #fff; }
.gp-aib-chat-send {
  width: 38px; height: 38px; border-radius: 50%; border: none;
  background: #8b5cf6; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .2s, background .2s; flex-shrink: 0;
}
.gp-aib-chat-send svg { width: 16px; height: 16px; stroke: #fff; fill: none; }
.gp-aib-chat-send:hover { transform: scale(1.08); background: #7c3aed; }

/* ── Resize handle ── */
.gp-aib-resize {
  width: 6px; cursor: col-resize; flex-shrink: 0;
  background: transparent; position: relative;
  display: none; transition: background .15s;
}
.gp-aib-resize::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 3px; height: 28px; border-radius: 2px;
  background: var(--border1, #cbd5e1); transition: background .15s;
}
.gp-aib-resize:hover::after, .gp-aib-resize.is-dragging::after { background: #8b5cf6; }
.gp-aib-overlay.is-split .gp-aib-resize { display: block; }
.gp-mode-overlay.is-split .gp-aib-resize { display: block; }

/* ── Plan panel (hidden until split mode) ── */
.gp-aib-plan {
  display: none; flex-direction: column; flex: 1; min-width: 0;
  background: var(--surface1, #fff);
  border-left: 1px solid var(--border1, #e2e8f0);
}
.gp-aib-overlay.is-split .gp-aib-plan { display: flex; }
.gp-mode-overlay.is-split .gp-aib-plan { display: flex; }
.gp-aib-plan-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-bottom: 1px solid var(--border1, #e2e8f0);
  flex-shrink: 0;
}
.gp-aib-plan-title { font-size: 14px; font-weight: 700; color: var(--ink1, #0f172a); }
.gp-aib-plan-pips { display: flex; gap: 3px; align-items: center; }
.gp-aib-plan-pips .gp-aib-pip {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--border1, #cbd5e1); transition: background .3s;
}
.gp-aib-plan-pips .gp-aib-pip.filled { background: #8b5cf6; }
.gp-aib-plan-body { flex: 1; overflow-y: auto; padding: 20px; }
.gp-aib-plan-foot {
  padding: 12px 18px; border-top: 1px solid var(--border1, #e2e8f0);
  display: flex; justify-content: flex-end; gap: 10px; flex-shrink: 0;
}

/* ── Plan section group labels ── */
.gp-aib-group-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px;
  color: #8b5cf6; padding: 18px 4px 8px; margin-top: 6px;
  display: flex; align-items: center; gap: 8px;
}
.gp-aib-group-label::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, rgba(139,92,246,.2), transparent);
}
.gp-aib-group-label:first-child { padding-top: 2px; margin-top: 0; }

/* ── Plan section cards ── */
.gp-aib-section {
  margin-bottom: 12px; border: 1px solid var(--border1, #e2e8f0);
  border-radius: 12px; overflow: hidden; background: #fff;
  animation: gpAibSecIn .4s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.gp-aib-section.gp-aib-sec-update {
  animation: gpAibSecPulse .6s ease;
}
@keyframes gpAibSecIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes gpAibSecPulse { 0% { box-shadow: 0 0 0 0 rgba(139,92,246,.3); } 50% { box-shadow: 0 0 0 4px rgba(139,92,246,.15); } 100% { box-shadow: none; } }
.gp-aib-section-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border-bottom: 1px solid var(--border1, #e2e8f0);
  font-size: 11px; font-weight: 700; color: var(--ink2, #475569);
  text-transform: uppercase; letter-spacing: .3px;
}
.gp-aib-section-head svg { width: 15px; height: 15px; flex-shrink: 0; }
.gp-aib-section-body { padding: 12px 14px; font-size: 13px; line-height: 1.6; color: var(--ink1, #0f172a); }

/* ── Editable section body ── */
.gp-aib-section-edit {
  width: 100%; min-height: 60px; max-height: 200px; resize: vertical;
  padding: 12px 14px; font-size: 13px; line-height: 1.55; font-family: inherit;
  color: var(--ink1, #0f172a); background: #fff;
  border: 1.5px solid #8b5cf6; border-radius: 0 0 10px 10px;
  outline: none; box-sizing: border-box;
}
.gp-aib-section-body.is-editable {
  cursor: pointer; transition: background .15s;
  border-radius: 0 0 10px 10px;
}
.gp-aib-section-body.is-editable:hover { background: rgba(139,92,246,.03); }
.gp-aib-section-edit-hint {
  font-size: 10px; color: var(--ink3, #94a3b8); padding: 2px 14px 6px;
  font-style: italic; display: none;
}
.gp-aib-section:hover .gp-aib-section-edit-hint { display: block; }

/* ── Task cards in plan (with selection checkbox) ── */
.gp-aib-task {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border1, #e2e8f0);
  margin-bottom: 10px; background: var(--surface1, #fff);
  cursor: pointer; transition: border-color .2s, background .2s, box-shadow .2s;
  animation: gpAibSecIn .3s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.03);
}
.gp-aib-task:last-child { margin-bottom: 0; }
.gp-aib-task:hover { border-color: #c4b5fd; background: rgba(139,92,246,.02); box-shadow: 0 2px 8px rgba(139,92,246,.08); }
.gp-aib-task.is-selected { border-color: #8b5cf6; background: rgba(139,92,246,.06); }
.gp-aib-task-check {
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  border: 2px solid var(--border1, #cbd5e1); background: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; margin-top: 1px;
}
.gp-aib-task.is-selected .gp-aib-task-check {
  background: #8b5cf6; border-color: #8b5cf6;
}
.gp-aib-task.is-selected .gp-aib-task-check::after {
  content: ''; width: 10px; height: 6px;
  border-left: 2px solid #fff; border-bottom: 2px solid #fff;
  transform: rotate(-45deg); margin-top: -2px;
}
.gp-aib-task-info { flex: 1; min-width: 0; }
.gp-aib-task-title { font-size: 13px; font-weight: 600; color: var(--ink1, #0f172a); }
.gp-aib-task-desc { font-size: 11px; color: var(--ink3, #94a3b8); margin-top: 2px; }
.gp-aib-task-select-all {
  padding: 6px 12px; border-radius: 8px; border: none;
  background: var(--surface2, #f1f5f9); font-size: 11px; font-weight: 600;
  color: var(--ink2, #475569); cursor: pointer; transition: all .2s;
  margin-bottom: 10px;
}
.gp-aib-task-select-all:hover { background: var(--surface3, #e2e8f0); color: #7c3aed; }

/* ── Task toolbar (add, regenerate, delete) ── */
.gp-aib-task-toolbar {
  display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px;
}
.gp-aib-task-tbtn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border1, #e2e8f0);
  background: #fff; font-size: 11px; font-weight: 600; font-family: inherit;
  color: var(--ink2, #475569); cursor: pointer; transition: all .15s;
}
.gp-aib-task-tbtn:hover { border-color: #8b5cf6; color: #7c3aed; background: rgba(139,92,246,.04); }
.gp-aib-task-tbtn svg { width: 12px; height: 12px; flex-shrink: 0; }
.gp-aib-task-tbtn--danger:hover { border-color: #ef4444; color: #dc2626; background: rgba(239,68,68,.04); }

/* ── Task delete button ── */
.gp-aib-task-del {
  width: 20px; height: 20px; border-radius: 4px; border: none;
  background: transparent; color: var(--ink3, #94a3b8); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-left: auto; transition: all .15s; opacity: 0;
}
.gp-aib-task:hover .gp-aib-task-del { opacity: 1; }
.gp-aib-task-del:hover { background: rgba(239,68,68,.1); color: #ef4444; }

/* ── Task priority number ── */
.gp-aib-task-num {
  font-size: 10px; font-weight: 800; color: var(--ink4, #94a3b8);
  min-width: 18px; text-align: center; flex-shrink: 0; line-height: 20px;
}

/* ── Task priority colors ── */
.gp-aib-task.prio-high { border-left: 3px solid #ef4444; }
.gp-aib-task.prio-med { border-left: 3px solid #f59e0b; }
.gp-aib-task.prio-low { border-left: 3px solid #22c55e; }

/* ── Task meta row (priority, assignee, due) ── */
.gp-aib-task-meta {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px;
}
.gp-aib-task-prio-btn,
.gp-aib-task-assign-btn,
.gp-aib-task-due-btn {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border1, #e2e8f0);
  background: var(--surface2, #f8fafc); font-size: 11px; font-weight: 600;
  color: var(--ink3, #64748b); cursor: pointer; transition: all .15s; font-family: inherit;
}
.gp-aib-task-prio-btn:hover,
.gp-aib-task-assign-btn:hover,
.gp-aib-task-due-btn:hover { border-color: #8b5cf6; color: #7c3aed; background: rgba(139,92,246,.06); box-shadow: 0 1px 4px rgba(139,92,246,.1); }

/* ── Task drag grip ── */
.gp-aib-task-grip {
  width: 16px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: var(--ink4, #cbd5e1); cursor: grab; opacity: 0;
  transition: opacity .15s;
}
.gp-aib-task:hover .gp-aib-task-grip { opacity: 1; }
.gp-aib-task-grip:active { cursor: grabbing; }
.gp-aib-task.is-dragging { opacity: .4; border-style: dashed; }
.gp-aib-task.gp-aib-drag-over-top { box-shadow: 0 -2px 0 0 #8b5cf6; }
.gp-aib-task.gp-aib-drag-over-bot { box-shadow: 0 2px 0 0 #8b5cf6; }

/* ── Inline task editing ── */
.gp-aib-task-title[data-edit-task],
.gp-aib-task-desc[data-edit-task] { cursor: text; }
.gp-aib-task-title[data-edit-task]:hover { text-decoration-style: dotted; text-decoration-line: underline; text-underline-offset: 2px; }
.gp-aib-task-desc[data-edit-task]:hover { text-decoration-style: dotted; text-decoration-line: underline; text-underline-offset: 2px; }
.gp-aib-task-inline-edit {
  width: 100%; border: none; border-bottom: 1.5px solid #8b5cf6;
  background: transparent; font: inherit; color: inherit; outline: none;
  padding: 0 0 1px; margin: 0;
}

/* ── Buttons ── */
.gp-aib-btn-primary {
  padding: 9px 22px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed); color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 2px 8px rgba(139,92,246,.2); transition: all .2s;
}
.gp-aib-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(139,92,246,.3); }
.gp-aib-btn-primary:disabled { opacity: .5; cursor: default; transform: none !important; }

/* ── Draft button ── */
.gp-aib-btn-draft {
  padding: 9px 22px; border-radius: 10px; border: 1.5px solid var(--border1, #e2e8f0);
  background: var(--surface1, #fff); color: var(--ink2, #475569);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .2s;
}
.gp-aib-btn-draft:hover { border-color: #8b5cf6; color: #7c3aed; background: rgba(139,92,246,.04); }

/* ── Option pills (quick reply chips) ── */
.gp-aib-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.gp-aib-option {
  padding: 8px 14px; border-radius: 20px; border: 1.5px solid var(--border1, #e2e8f0);
  background: var(--surface1, #fff); font-size: 12px; font-weight: 600;
  color: var(--ink2, #475569); cursor: pointer;
  transition: all .25s cubic-bezier(.22,1,.36,1);
  display: flex; align-items: center; gap: 6px;
}
.gp-aib-option:hover {
  border-color: #8b5cf6; color: #7c3aed;
  background: rgba(139,92,246,.06); transform: translateY(-1px);
}
.gp-aib-option svg { width: 16px; height: 16px; flex-shrink: 0; stroke: var(--ink3, #64748b); fill: none; transition: stroke .2s; }
.gp-aib-option:hover svg { stroke: #7c3aed; }

/* ── Suggested Option Chips ── */
.gp-aib-suggested-row { padding-left: 38px; }
.gp-aib-suggested-label {
  font-size: 11px; font-weight: 600; color: var(--ink3, #94a3b8);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px;
}
.gp-aib-suggested-options {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.gp-aib-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 14px; font-size: 13px; font-family: inherit;
  border: 1.5px solid var(--border, #e2e8f0); border-radius: 20px;
  background: var(--surf, #fff); color: var(--ink2, #475569);
  cursor: pointer; transition: all .2s ease; white-space: nowrap;
}
.gp-aib-chip:hover {
  border-color: #8b5cf6; color: #7c3aed;
  background: rgba(139,92,246,.05); transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(139,92,246,.12);
}
.gp-aib-chip.is-selected {
  border-color: #7c3aed; color: #fff;
  background: #7c3aed; box-shadow: 0 2px 8px rgba(139,92,246,.25);
}
.gp-aib-chip-confirm {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 16px; font-size: 13px; font-weight: 600; font-family: inherit;
  border: none; border-radius: 20px;
  background: #10b981; color: #fff; cursor: pointer;
  transition: background .15s, transform .15s;
  animation: gpChipConfirmIn .25s ease;
}
.gp-aib-chip-confirm:hover { background: #059669; transform: translateY(-1px); }
@keyframes gpChipConfirmIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }

/* ── Speed-Up Bar ── */
.gp-aib-speedup-bar {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 16px; margin: 0;
  background: linear-gradient(135deg, rgba(139,92,246,.04), rgba(99,102,241,.04));
  border-top: 1px solid var(--border, #e2e8f0);
}
.gp-aib-speedup-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; font-size: 14px; font-weight: 600; font-family: inherit;
  border: 2px solid #7c3aed; border-radius: 24px;
  background: linear-gradient(135deg, #7c3aed, #6366f1);
  color: #fff; cursor: pointer;
  transition: all .2s ease; box-shadow: 0 3px 12px rgba(124,58,237,.2);
  animation: gpSpeedUpPulse 3s ease-in-out infinite;
}
.gp-aib-speedup-btn:hover {
  transform: translateY(-2px); box-shadow: 0 6px 20px rgba(124,58,237,.35);
  background: linear-gradient(135deg, #6d28d9, #4f46e5);
}
.gp-aib-speedup-btn svg { flex-shrink: 0; }
@keyframes gpSpeedUpPulse {
  0%, 100% { box-shadow: 0 3px 12px rgba(124,58,237,.2); }
  50% { box-shadow: 0 3px 20px rgba(124,58,237,.35); }
}
.gp-aib-speedup-hint {
  font-size: 11px; color: var(--ink3, #94a3b8); text-align: center; max-width: 360px;
}
.gp-aib-speedup-done {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; font-size: 14px;
}
.gp-aib-speedup-done svg { flex-shrink: 0; }

/* ── File upload button ── */
.gp-aib-upload-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--surface2, #f1f5f9); color: var(--ink3, #94a3b8);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: all .2s;
}
.gp-aib-upload-btn:hover { background: rgba(139,92,246,.1); color: #7c3aed; }
.gp-aib-upload-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; }

/* ── File card in chat ── */
.gp-aib-file-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(139,92,246,.06); border: 1px solid rgba(139,92,246,.15);
}
.gp-aib-file-card svg { flex-shrink: 0; }
.gp-aib-file-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gp-aib-file-info strong { font-size: 13px; color: var(--ink1, #0f172a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gp-aib-file-info span { font-size: 11px; color: var(--ink3, #94a3b8); }

/* ── Drag-over state on chat messages ── */
.gp-aib-chat-msgs.gp-aib-dragover {
  background: rgba(139,92,246,.04);
  outline: 2px dashed #8b5cf6;
  outline-offset: -4px;
  border-radius: 8px;
}

/* ── Tasks section in plan preview ── */
.gp-aib-tasks-section {
  margin-top: 20px; border: 1px solid rgba(139,92,246,.2);
  border-radius: 12px; overflow: hidden;
  animation: gpAibSecIn .4s ease;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .gp-mode-cards { grid-template-columns: 1fr; }
  .gp-mode-popup.gp-mode-popup--big { width: 100vw; height: 100vh; border-radius: 0; }
  .gp-mode-topbar { border-radius: 0; }
  .gp-mode-body { padding: 20px 16px; }
  .gp-mode-drafts-list { grid-template-columns: 1fr; }
  .gp-aib-overlay { padding: 8px; }
  .gp-aib-shell { max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 14px; }
  .gp-aib-overlay.is-split .gp-aib-chat { flex: 1; }
  .gp-mode-overlay.is-split .gp-aib-chat { flex: 1; }
  .gp-aib-plan { display: none !important; }
  .gp-aib-resize { display: none !important; }
}

/* Section-label inline suggest — pushes to the right */
.gp-section-ai { margin-left: auto; }

/* ────────────────── 15. TIMELINE DATE RANGE ────────────────── */

.gp-timeline-row {
  display: flex; align-items: flex-end; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.gp-timeline-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 120px; }
.gp-timeline-field--dur { flex: 0 0 auto; min-width: 80px; align-items: center; }
.gp-timeline-label {
  font-size: 11px; font-weight: 600; color: var(--ink3, #6b7280);
  text-transform: uppercase; letter-spacing: .3px;
}
.gp-timeline-trigger {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; font-size: 13px; text-align: left;
  border: 1.5px solid var(--border, #e5e7eb); border-radius: 10px;
  background: var(--surf, #fff); color: var(--ink3, #9ca3af); cursor: pointer;
  transition: border-color .15s, color .15s; width: 100%;
  font-family: inherit;
}
.gp-timeline-trigger svg { width: 14px; height: 14px; flex-shrink: 0; }
.gp-timeline-trigger:hover { border-color: var(--c-blue, #3b82f6); }
.gp-timeline-trigger.is-set { color: var(--ink, #111); }
.gp-timeline-arrow {
  display: flex; align-items: center; color: var(--ink4, #d1d5db);
  padding-bottom: 6px;
}
.gp-timeline-arrow svg { width: 18px; height: 18px; }
.gp-timeline-duration {
  font-size: 14px; font-weight: 700; color: var(--ink2, #374151);
  padding: 8px 0;
}

/* ────────────────── 16. KEY SKILLS ADD INPUT ────────────────── */

.gp-skill-suggestions {
  display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 0 8px;
}
.gp-skill-suggestion {
  padding: 4px 10px; border-radius: 14px; border: 1px dashed var(--border, #e5e7eb);
  background: var(--bg, #f9fafb); color: var(--ink3, #6b7280);
  font-size: 11px; font-weight: 600; cursor: pointer;
  transition: all .15s; font-family: inherit;
}
.gp-skill-suggestion:hover {
  border-color: var(--c-blue, #3b82f6); color: var(--c-blue, #3b82f6);
  background: var(--c-blue-bg, #eff6ff); border-style: solid;
}

/* ────────────────── 17. SMOOTH TEXT TRANSITIONS ────────────────── */

.gp-text-out {
  transition: opacity .2s ease-out;
  opacity: 0;
}
.gp-text-in {
  animation: gpTextIn .4s ease-out;
}
@keyframes gpTextIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* AI suggestion cards in field mode — wider text display */
.gp-ais-card-title {
  transition: opacity .15s ease;
}

/* ────────────────── RESPONSIVE ────────────────── */

@media (max-width: 900px) {
  /* The base rule is already the sliver; this override only survives to keep
     the two breakpoints reading as one story (sliver → full-bleed at 700). */
  .gp-popup { width: calc(100vw - 24px); }
  .gp-field-row, .gp-field-row-3 { grid-template-columns: 1fr; }
  .gp-ssc-row { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .gp-popup { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
  .gp-panel { padding: 20px 16px; }
  .gp-topbar, .gp-footer, .gp-tabs { padding-left: 16px; padding-right: 16px; }
  .gp-tab span { display: none; }
  .gp-tab { gap: 4px; }
}
