/* AI Copilot: sağdan açılan panel. Sayfanın düzenini değiştirmez, üstünde çalışır. */
.cp-fab {
  position: fixed;
  inset-inline-end: 1.25rem;
  bottom: 1.25rem;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  height: 2.5rem;
  padding-block: 0; padding-inline: 0.75rem 0.875rem;
  border: 1px solid var(--nav-line);
  border-radius: var(--radius-pill);
  background: var(--nav-bg);
  color: var(--nav-text-strong);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background 0.12s ease;
}
.cp-fab:hover { background: var(--nav-bg-active); }
.cp-fab svg { width: 16px; height: 16px; color: var(--nav-accent); }
[data-theme="dark"] .cp-fab { background: var(--panel2); border-color: var(--line-strong); }
.cp-minibar {
  position: fixed;
  inset-inline-end: 1.25rem;
  bottom: 0;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  height: 2.25rem;
  min-width: 11rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}
.cp-minibar svg { width: 15px; height: 15px; color: var(--ai); }
.cp-minibar i { width: 7px; height: 7px; margin-inline-start: auto; border-radius: 50%; background: var(--ai); }

.cp-panel {
  position: fixed;
  top: 0;
  inset-inline-end: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: min(27rem, 100vw);
  background: var(--panel);
  color: var(--text);
  border-inline-start: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cp-panel[hidden] { display: none; }
.cp-panel.is-open { transform: none; }
.cp-panel.no-anim { transition: none; }

.cp-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); height: var(--topbar-h); flex: 0 0 var(--topbar-h); padding-block: 0; padding-inline: 0.875rem 0.5rem; border-bottom: 1px solid var(--line); }
.cp-title { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.cp-title strong { display: block; font-size: var(--fs-sm); font-weight: 600; line-height: 1.2; }
.cp-mark { display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; flex: 0 0 auto; border-radius: var(--radius); background: var(--ai-soft); color: var(--ai); }
.cp-mark svg { width: 15px; height: 15px; }
.cp-context { display: block; max-width: 12rem; font-size: var(--fs-2xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-actions { display: flex; align-items: center; flex: 0 0 auto; }
.cp-ico { display: inline-flex; align-items: center; justify-content: center; width: 1.875rem; height: 1.875rem; padding: 0; border: 0; border-radius: var(--radius); background: transparent; color: var(--muted); cursor: pointer; }
.cp-ico:hover { background: var(--neutral-soft); color: var(--text); }
.cp-ico[aria-expanded="true"] { background: var(--neutral-soft); color: var(--text); }
.cp-ico svg { width: 15px; height: 15px; }

.cp-history { position: absolute; inset-inline-start: 0; inset-inline-end: 0; top: var(--topbar-h); bottom: 0; z-index: 2; overflow-y: auto; background: var(--panel); padding: 0.75rem; }
.cp-history-title { margin-bottom: 0.5rem; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); }
.cp-history ul { list-style: none; margin: 0; padding: 0; }
.cp-history li { display: flex; align-items: center; gap: 0.25rem; border-radius: var(--radius); }
.cp-history li:hover { background: var(--panel2); }
.cp-history-open { flex: 1 1 auto; min-width: 0; padding: 0.4375rem 0.5rem; border: 0; background: transparent; color: var(--text); font: inherit; font-size: var(--fs-sm); text-align: start; cursor: pointer; }
.cp-history-open span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-history-open small { display: block; font-size: var(--fs-2xs); color: var(--muted); }
.cp-history li.is-current .cp-history-open span { font-weight: 600; }
.cp-history-none { padding: 1.5rem 0.5rem; text-align: center; font-size: var(--fs-sm); color: var(--muted); }

.cp-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--sp-4); }
.cp-empty h2 { margin: 0.75rem 0 0.25rem; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.01em; }
.cp-empty p { font-size: var(--fs-xs); line-height: 1.5; color: var(--muted); }
.cp-suggest { display: flex; flex-direction: column; align-items: stretch; gap: 0.3125rem; margin-top: var(--sp-4); }
.cp-chip { padding: 0.5rem 0.625rem; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--text); font: inherit; font-size: var(--fs-sm); text-align: start; cursor: pointer; }
.cp-chip:hover { background: var(--panel2); border-color: var(--line-strong); }

.cp-msg { margin-bottom: var(--sp-4); font-size: var(--fs-sm); line-height: 1.5; }
.cp-msg.is-user { display: flex; justify-content: flex-end; }
.cp-bubble { max-width: 85%; padding: 0.4375rem 0.6875rem; border-radius: var(--radius-lg) var(--radius-lg) 2px var(--radius-lg); background: var(--neutral-soft); overflow-wrap: anywhere; white-space: pre-wrap; }
.cp-tools { display: flex; flex-direction: column; gap: 0.1875rem; margin-bottom: 0.4375rem; }
.cp-tool { display: flex; align-items: baseline; gap: 0.375rem; font-size: var(--fs-xs); color: var(--muted); }
.cp-tool i { flex: 0 0 auto; align-self: center; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.cp-tool.is-running i { background: var(--ai); animation: sg-pulse 0.9s ease-in-out infinite; }
.cp-tool.is-error i { background: var(--bad); }
.cp-tool.is-error { color: var(--bad); }
.cp-tool b { font-weight: 500; color: var(--text); }
.cp-text { overflow-wrap: anywhere; }
.cp-text p { margin: 0 0 0.4375rem; }
.cp-text p:last-child { margin-bottom: 0; }
.cp-text ul, .cp-text ol { margin: 0 0 0.4375rem; padding-inline-start: 1.125rem; }
.cp-text code { font-size: 0.88em; }
.cp-thinking { display: inline-flex; align-items: center; gap: 0.375rem; font-size: var(--fs-xs); color: var(--muted); }
.cp-thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--ai); animation: sg-pulse 0.9s ease-in-out infinite; }
.cp-error { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; padding: 0.4375rem 0.625rem; border-inline-start: 3px solid var(--bad); border-radius: 0; border-start-end-radius: var(--radius); border-end-end-radius: var(--radius); background: var(--bad-soft); font-size: var(--fs-xs); }
.cp-error button { padding: 0; border: 0; background: transparent; color: var(--accent); font: inherit; font-weight: 500; cursor: pointer; }
.cp-sources { margin-top: 0.5rem; }
.cp-sources > span { display: block; margin-bottom: 0.1875rem; font-size: var(--fs-2xs); color: var(--muted); }
.cp-source { display: flex; align-items: center; gap: 0.375rem; padding: 0.1875rem 0.4375rem; border-radius: 4px; color: var(--text); font-size: var(--fs-xs); }
.cp-source:hover { background: var(--panel2); text-decoration: none; color: var(--accent); }
.cp-source i { flex: 0 0 auto; width: 7px; height: 7px; border-radius: 2px; background: var(--faint); }
.cp-source.v-clean i { background: var(--ok); }
.cp-source.v-hold i { background: var(--series-hold); }
.cp-source.v-block i { background: var(--series-block); }
.cp-source.v-fail i { background: var(--series-fail); }
.cp-source span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cp-composer { position: relative; flex: 0 0 auto; padding: 0.5rem 0.75rem 0.25rem; border-top: 1px solid var(--line); }
.cp-composer textarea { display: block; min-height: 2.5rem !important; max-height: 8rem; padding-block: 0.5625rem !important; padding-inline: 0.6875rem 2.75rem !important; resize: none; overflow-y: auto; line-height: 1.4; }
.cp-send, .cp-stop { position: absolute; inset-inline-end: 1.1875rem; bottom: 0.6875rem; display: inline-flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; padding: 0; border: 0; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.cp-send:hover, .cp-stop:hover { background: var(--accent-strong); }
.cp-send[disabled] { background: var(--neutral-soft); color: var(--faint); cursor: default; }
.cp-send svg, .cp-stop svg { width: 15px; height: 15px; }
.cp-foot { flex: 0 0 auto; padding: 0 0.75rem 0.5rem; font-size: var(--fs-2xs); color: var(--faint); }

@media (max-width: 640px) {
  .cp-panel { width: 100vw; height: 100dvh; bottom: auto; border-inline-start: 0; }
  .cp-fab { inset-inline-end: 0.75rem; bottom: 0.75rem; }
  .cp-minibar { inset-inline-end: 0.75rem; }
  .cp-composer textarea { font-size: 1rem; }
}
@media print { .cp-fab, .cp-panel, .cp-minibar { display: none !important; } }

/* Grafik kartı: veri araç sonucundan; seri renkleri tasarım sistemindeki karar renkleri */
.cp-charts { display: grid; gap: 0.5rem; margin-top: 0.5rem; }
.cp-chart { position: relative; margin: 0; padding: 0.625rem 0.75rem 0.5rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.cp-chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.5rem; }
.cp-chart-head strong { display: block; font-size: var(--fs-sm); font-weight: 600; }
.cp-chart-head span { display: block; font-size: var(--fs-2xs); color: var(--muted); }
.cp-chart-actions { display: flex; gap: 0.25rem; flex: 0 0 auto; }
.cp-chart-actions button { height: 1.5rem; padding: 0 0.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--muted); font: inherit; font-size: var(--fs-2xs); font-weight: 500; cursor: pointer; }
.cp-chart-actions button:hover { color: var(--text); border-color: var(--line-strong); }
.cp-chart-actions button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.cp-chart-note { margin: 0.4375rem 0 0; font-size: var(--fs-2xs); color: var(--muted); }

.cp-bars { display: grid; gap: 0.3125rem; }
.cp-bar { display: grid; grid-template-columns: minmax(5rem, 38%) 1fr auto; align-items: center; gap: 0.5rem; font-size: var(--fs-xs); }
.cp-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.cp-bar-track { position: relative; height: 0.625rem; }
.cp-bar-track i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: 0; border-start-end-radius: 4px; border-end-end-radius: 4px; background: var(--series-clean); }
.cp-bar.is-other .cp-bar-track i { background: var(--series-fail); }
.cp-bar.is-other .cp-bar-label { color: var(--muted); }
.cp-bar-val { min-width: 2.5rem; text-align: end; font-variant-numeric: tabular-nums; font-weight: 500; }
.cp-bar:hover .cp-bar-track i { filter: brightness(1.08); }

.cp-line-wrap { position: relative; }
.cp-line { display: block; width: 100%; height: auto; overflow: visible; }
.cp-grid { stroke: var(--grid); stroke-width: 1; }
.cp-axis { fill: var(--muted); font-size: 9.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.cp-area { fill: var(--neutral-soft); }
.cp-path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.cp-path.is-total { stroke: var(--line-strong); stroke-width: 1.5; }
.cp-path.s-clean { stroke: var(--series-clean); }
.cp-path.s-hold { stroke: var(--series-hold); }
.cp-path.s-block { stroke: var(--series-block); }
.cp-cross { stroke: var(--faint); stroke-width: 1; stroke-dasharray: 2 2; pointer-events: none; }
.cp-tip { position: absolute; top: 0; z-index: 2; display: grid; gap: 0.0625rem; min-width: 8.5rem; padding: 0.3125rem 0.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-md); font-size: var(--fs-2xs); pointer-events: none; }
.cp-tip b { font-weight: 600; margin-bottom: 0.0625rem; }
.cp-tip span { display: flex; align-items: center; gap: 0.3125rem; color: var(--muted); }
.cp-tip strong { margin-inline-start: auto; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.cp-legend { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; margin-top: 0.3125rem; font-size: var(--fs-2xs); color: var(--muted); }
.cp-legend span { display: inline-flex; align-items: center; gap: 0.3125rem; }
.cp-legend i, .cp-tip i { flex: 0 0 auto; width: 10px; height: 3px; border-radius: 2px; background: var(--line-strong); }
.cp-legend .s-total i, .cp-tip .s-total i { height: 8px; background: var(--neutral-soft); box-shadow: inset 0 0 0 1px var(--line-strong); }
.s-clean > i { background: var(--series-clean); }
.s-hold > i { background: var(--series-hold); }
.s-block > i { background: var(--series-block); }

.cp-chart-table { width: 100%; border-collapse: collapse; font-size: var(--fs-2xs); }
.cp-chart-table th, .cp-chart-table td { padding: 0.1875rem 0.375rem; border-bottom: 1px solid var(--line); text-align: start; }
.cp-chart-table th { color: var(--muted); font-weight: 500; }
.cp-chart-table .num { text-align: end; font-variant-numeric: tabular-nums; }
.cp-chart [hidden] { display: none !important; }

/* Posta akışına geçiş kartı */
.cp-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.375rem 0.75rem; margin-top: 0.5rem; padding: 0.5rem 0.625rem; border: 1px solid var(--accent-soft); border-inline-start: 3px solid var(--accent); border-radius: 0; border-start-end-radius: var(--radius); border-end-end-radius: var(--radius); background: var(--accent-soft); font-size: var(--fs-xs); }
.cp-nav-info { min-width: 0; }
.cp-nav-info strong { display: block; font-weight: 600; }
.cp-nav-info span { display: block; color: var(--muted); }
.cp-nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.cp-nav-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.cp-nav-go { font-weight: 600; }
.cp-nav button { padding: 0; border: 0; background: transparent; color: var(--muted); font: inherit; cursor: pointer; text-decoration: underline; }
