/* ============================================================
   Components — buttons, chips, search, table rows,
   status/priority, modal, tabs, chat, skill cards, timeline
   ============================================================ */

/* ───────── Buttons ───────── */
.btn {
  height: 32px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--hover); border-color: #dadde3; }
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover { background: #4d51e0; border-color: #4d51e0; }
.btn .ico { width: 14px; height: 14px; opacity: .85; }
.btn .ico svg { width: 100%; height: 100%; display: block; }

.icon-btn {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: background .12s, border-color .12s, color .12s;
}
.icon-btn:hover { background: var(--hover); color: var(--fg); }

.avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #c8b6e4;
  color: #2d1a55;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
}

/* ───────── Chips & Search ───────── */
.chip {
  height: 30px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .12s, border-color .12s, color .12s;
}
.chip:hover { background: var(--hover); color: var(--fg); border-color: #cdd1d8; }
.chip-applied {
  border-style: solid;
  border-color: var(--border);
  color: var(--fg);
  background: var(--surface);
}
.chip-applied .x { color: var(--muted-2); margin-left: 2px; }

.search {
  height: 30px;
  width: 220px;
  padding: 0 10px 0 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  color: var(--fg);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236a7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>");
  background-repeat: no-repeat;
  background-position: 9px 50%;
  outline: none;
}
.search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }

/* ───────── Issue list ───────── */
.list-wrap {
  flex: 1;
  overflow-y: auto;
}
.group { border-bottom: 1px solid var(--border); }

.group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 40px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
.group-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
}
.group-dot.todo    { color: var(--status-todo); }
.group-dot.prog    {
  color: var(--status-prog);
  background: conic-gradient(currentColor 0 70%, transparent 70% 100%);
  border-color: currentColor;
}
.group-dot.review  {
  color: var(--status-review);
  background: var(--status-review);
  border-color: var(--status-review);
  position: relative;
}
.group-dot.review::after {
  content: ''; position: absolute; inset: 2px;
  border-radius: 50%; background: var(--surface-2);
}
.group-dot.done    {
  color: var(--status-done);
  background: var(--status-done);
  border-color: var(--status-done);
}
.group-dot.blocked {
  color: var(--status-blocked);
  background: var(--status-blocked);
  border-color: var(--status-blocked);
}
.group-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--fg);
}
.group-count {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.group-actions { margin-left: auto; display: flex; gap: 4px; }

/* Issue row */
.issue-row {
  display: grid;
  grid-template-columns: 70px 36px 1fr 110px 110px 130px 80px 100px 32px;
  gap: 14px;
  align-items: center;
  padding: 0 40px;
  height: 56px;
  border-bottom: 1px solid var(--border-2);
  cursor: pointer;
  transition: background .1s;
}
.issue-row:last-child { border-bottom: none; }
.issue-row:hover { background: var(--surface-2); }

.issue-row__id {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.issue-row__prio { display: grid; place-items: center; }
.issue-row__title {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.issue-row__title .labels {
  margin-left: 8px;
  display: inline-flex;
  gap: 6px;
  vertical-align: middle;
}

.issue-row__status {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--fg-2);
}
.issue-row__sprint,
.issue-row__points {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.issue-row__points { text-align: right; padding-right: 4px; }

.issue-row__ai {
  display: flex;
  align-items: center;
  gap: 8px;
}
.issue-row__people {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
}
.issue-row__jira {
  display: grid; place-items: center;
  color: var(--muted-2);
  transition: color .12s;
}
.issue-row__jira:hover { color: var(--accent); }
.issue-row__jira svg { width: 14px; height: 14px; }

/* Label pill */
.label-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
}
.label-pill .swatch { width: 6px; height: 6px; border-radius: 50%; }

/* Priority icons */
.prio-icon {
  width: 16px; height: 16px;
  display: grid; place-items: center;
}
.prio-icon svg { width: 100%; height: 100%; }

/* Person chip */
.person {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 600;
  color: #fff;
  border: 2px solid var(--surface);
}
.person.reporter { margin-left: -10px; opacity: .65; }

/* AI confidence bar */
.ai-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border-2);
  overflow: hidden;
  position: relative;
}
.ai-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}
.ai-bar.warn > span { background: #f4a738; }
.ai-bar.low  > span { background: #d2473d; }
.ai-num {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 26px;
  text-align: right;
}

/* ───────── Modal ───────── */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(13,17,23,.36);
  backdrop-filter: blur(2px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.modal {
  position: fixed;
  z-index: 51;
  inset: 32px;
  max-width: 1280px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-modal);
  display: grid;
  grid-template-columns: 1fr 420px;
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "head head"
    "body chat";
  overflow: hidden;
  transform: translateY(8px) scale(.99);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.modal.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.modal-head {
  grid-area: head;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 0 24px;
  border-bottom: 1px solid var(--border);
}
.modal-id {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.modal-id .crumb-sep { margin: 0 6px; }
.modal-head .spacer { flex: 1; }
.modal-head .btn { height: 30px; padding: 0 10px; font-size: 12.5px; }

.modal-body {
  grid-area: body;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.modal-title-block {
  padding: 28px 36px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}
.modal-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 6px 0 14px;
  line-height: 1.25;
}
.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  font-size: 12.5px;
  color: var(--muted);
}
.modal-meta .meta-row { display: inline-flex; align-items: center; gap: 6px; }
.modal-meta .meta-row strong { color: var(--fg-2); font-weight: 500; }

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  padding: 0 36px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0;
  z-index: 1;
}
.tab {
  height: 44px;
  padding: 0 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color .12s, border-color .12s;
  margin-bottom: -1px;
}
.tab:hover { color: var(--fg); }
.tab.active {
  color: var(--fg);
  border-bottom-color: var(--fg);
}
.tab .badge {
  margin-left: 6px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--border-2);
  color: var(--muted);
  font-weight: 500;
}

.tab-panel { display: none; padding: 28px 36px 40px; }
.tab-panel.active { display: block; }

/* Overview cards */
.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.ov-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  background: var(--surface);
}
.ov-card h4 {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.ov-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  padding: 7px 0;
  font-size: 13px;
  border-top: 1px solid var(--border-2);
}
.ov-row:first-of-type { border-top: none; }
.ov-row .k { color: var(--muted); }
.ov-row .v { color: var(--fg); }

.progress-row { display: flex; align-items: center; gap: 10px; }
.progress-row .ai-bar { flex: 1; height: 6px; }

/* Acceptance criteria */
.acceptance { list-style: none; margin: 0; padding: 0; }
.acceptance li {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-top: 1px solid var(--border-2);
  font-size: 13px;
  color: var(--fg-2);
}
.acceptance li:first-child { border-top: none; }
.acceptance .check {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  flex-shrink: 0;
  margin-top: 2px;
  display: grid; place-items: center;
  color: #fff;
}
.acceptance .check.done {
  background: var(--status-done);
  border-color: var(--status-done);
}
.acceptance .check.done::after {
  content: '';
  width: 8px; height: 4px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* Description prose */
.desc-prose {
  font-size: 14px;
  line-height: 1.7;
  color: var(--fg-2);
  max-width: 720px;
}
.desc-prose h3 {
  margin: 24px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
}
.desc-prose p { margin: 0 0 12px; }
.desc-prose ul, .desc-prose ol { margin: 0 0 14px; padding-left: 22px; }
.desc-prose li { margin: 4px 0; }
.desc-prose code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 1px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 4px;
}
.desc-prose blockquote {
  margin: 14px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--accent);
  background: var(--accent-2);
  color: var(--fg-2);
  border-radius: 0 6px 6px 0;
}

/* Loglar — timeline */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 4px; bottom: 4px;
  width: 1px;
  background: var(--border);
}
.log-item {
  position: relative;
  padding: 10px 0 14px;
  font-size: 13px;
}
.log-dot {
  position: absolute;
  left: -22px; top: 14px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
}
.log-dot.ai { border-color: var(--accent); }
.log-dot.human { border-color: var(--status-done); }
.log-head {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.log-actor { font-weight: 600; color: var(--fg); }
.log-actor.ai { color: var(--accent); }
.log-time {
  color: var(--muted-2);
  font-size: 12px;
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.log-body { color: var(--muted); margin-top: 2px; }
.log-body code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--fg-2);
}
.log-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-2);
  color: var(--accent);
  font-size: 11px;
  font-weight: 500;
}

/* Skill cards */
.skill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.skill-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface);
}
.skill-card .name { font-size: 13px; font-weight: 600; color: var(--fg); }
.skill-card .cat  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.skill-card .meter {
  margin-top: 10px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-2);
  overflow: hidden;
}
.skill-card .meter > span {
  display: block;
  height: 100%;
  background: var(--fg-2);
  border-radius: 2px;
}
.skill-card .meter.match > span { background: var(--status-done); }
.skill-card .lvl {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

/* ───────── AI Chat panel ───────── */
.chat {
  grid-area: chat;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
}
.chat-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-head .ai-orb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: conic-gradient(from 200deg, #5b5ff0, #b07be0, #5b5ff0);
  box-shadow: 0 0 0 3px rgba(91, 95, 240, 0.10);
}
.chat-head .title { font-size: 13.5px; font-weight: 600; }
.chat-head .sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ai-drawer .chat-head .sub { margin-left: auto; }
.chat-head .live {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--status-done);
  box-shadow: 0 0 0 3px rgba(46, 166, 106, 0.18);
}

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.msg { display: flex; gap: 10px; }
.msg .av {
  width: 24px; height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 2px;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 600;
  color: #fff;
}
.msg .av.ai {
  background: conic-gradient(from 200deg, #5b5ff0, #b07be0, #5b5ff0);
}
.msg .av.user { background: #c8b6e4; color: #2d1a55; }
.msg .bubble {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fg-2);
  max-width: 320px;
}
.msg.user { flex-direction: row-reverse; }
.msg.user .bubble {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.msg .bubble strong { color: var(--fg); font-weight: 600; }
.msg.user .bubble strong { color: #fff; }
.msg .bubble code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 4px;
  padding: 1px 5px;
}
.msg.user .bubble code {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.2);
  color: #fff;
}
.msg .bubble ul { margin: 6px 0 0; padding-left: 18px; }
.msg .bubble li { margin: 2px 0; }

.ai-action-card {
  margin-top: 10px;
  background: var(--accent-2);
  border: 1px solid var(--accent-3);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--fg);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.ai-action-card .icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.ai-action-card .text { flex: 1; }
.ai-action-card .text strong { display: block; font-weight: 600; margin-bottom: 1px; }
.ai-action-card .text span { color: var(--muted); font-size: 11.5px; }
.ai-action-card .btn { height: 26px; padding: 0 10px; font-size: 12px; }

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 12px;
}
.quick-actions .qa {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  color: var(--fg-2);
  transition: background .12s, border-color .12s;
}
.quick-actions .qa:hover {
  background: var(--accent-2);
  border-color: var(--accent-3);
  color: var(--accent);
}

.chat-input {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.input-shell {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  background: var(--surface);
  transition: border-color .12s, box-shadow .12s;
}
.input-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-2);
}
.input-shell textarea {
  width: 100%;
  border: none;
  outline: none;
  resize: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--fg);
  background: transparent;
  min-height: 36px;
  max-height: 140px;
  line-height: 1.5;
}
.input-shell .actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.input-shell .actions .spacer { flex: 1; }
.input-shell .send {
  height: 26px;
  padding: 0 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.input-shell .send:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: default;
}
.input-shell .ico-btn {
  width: 26px; height: 26px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--muted);
  display: grid; place-items: center;
  transition: background .12s, color .12s;
}
.input-shell .ico-btn:hover { background: var(--hover); color: var(--fg); }

/* ───────── Floating AI Prompt ───────── */
.ai-prompt {
  position: fixed;
  bottom: 24px;
  left: 188px;
  right: 0;
  display: flex;
  justify-content: center;
  padding: 0 40px;
  z-index: 150;
  pointer-events: none;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.ai-prompt.visible {
  opacity: 1;
  transform: translateY(0);
}
.ai-prompt-box {
  pointer-events: auto;
  width: min(680px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(13,17,23,.06), 0 16px 48px rgba(13,17,23,.12), 0 32px 80px rgba(13,17,23,.08);
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-prompt-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--fg);
  line-height: 1.5;
  caret-color: var(--accent);
}
.ai-prompt-input::placeholder { color: var(--muted-2); }
.ai-prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ai-prompt-tools {
  display: flex;
  align-items: center;
  gap: 2px;
}
.ai-prompt-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ap-tool {
  width: 30px; height: 30px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.ap-tool:hover { background: var(--hover); color: var(--fg-2); }
.ap-divider {
  width: 1px; height: 16px;
  background: var(--border);
  margin: 0 4px;
}
.ap-model {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 8px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-2);
  cursor: pointer;
  transition: background .12s;
}
.ap-model:hover { background: var(--hover); }
.ap-model-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--status-done);
  flex-shrink: 0;
}
.ap-action {
  width: 30px; height: 30px;
  border: none;
  background: transparent;
  border-radius: 8px;
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.ap-action:hover { background: var(--hover); color: var(--fg-2); }
.ap-send {
  width: 30px; height: 30px;
  border: none;
  background: var(--fg);
  border-radius: 50%;
  color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .12s;
  flex-shrink: 0;
}
.ap-send:hover { background: var(--accent); }

/* ───────── AI Conversation Drawer (grid item) ───────── */
.ai-drawer {
  grid-area: drawer;
  background: var(--surface-2);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.ai-drawer-close {
  width: 26px; height: 26px;
  border: none;
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .12s, color .12s;
  margin-left: 8px;
  flex-shrink: 0;
}
.ai-drawer-close:hover { background: var(--hover); color: var(--fg); }

/* Typing indicator */
.ai-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ai-typing-dots span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--muted-2);
  animation: ai-dot .9s ease-in-out infinite;
}
.ai-typing-dots span:nth-child(2) { animation-delay: .15s; }
.ai-typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes ai-dot {
  0%, 80%, 100% { transform: scale(.7); opacity: .5; }
  40%           { transform: scale(1);  opacity: 1; }
}

/* ───────── Chat Trigger Button (bottom-center) ───────── */
.chat-trigger-btn {
  position: fixed;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 140;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px 7px 9px;
  background: rgba(13,17,23,0.52);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 11px;
  color: rgba(255,255,255,0.82);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: opacity .2s ease, transform .2s ease, background .14s;
}
.chat-trigger-btn:hover {
  background: rgba(13,17,23,0.70);
}
.chat-trigger-shortcut {
  display: flex;
  align-items: center;
  gap: 3px;
}
.chat-shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 4px;
  background: rgba(255,255,255,0.11);
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0;
}
.chat-trigger-label {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .01em;
}
.chat-trigger-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(6px);
}
