/* Xoto yönetim paneli · tek dosya stil katmanı.
   CSP gereği tüm stiller buradadır; satır içi stil ve dış kaynak kullanılmaz.
   Görsel dil: shadcn zinc paleti, ince kenarlık, 8px köşe, sade tipografi. */

:root {
  --background: #ffffff;
  --foreground: #09090b;
  --card: #ffffff;
  --card-foreground: #09090b;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --accent: #f4f4f5;
  --accent-foreground: #18181b;
  --border: #e4e4e7;
  --input: #e4e4e7;
  --ring: #a1a1aa;
  --primary: #18181b;
  --primary-foreground: #fafafa;
  --secondary: #f4f4f5;
  --secondary-foreground: #18181b;
  --destructive: #dc2626;
  --destructive-foreground: #fafafa;
  --destructive-muted: #fef2f2;
  --destructive-border: #fecaca;
  --success: #16a34a;
  --success-muted: #f0fdf4;
  --success-border: #bbf7d0;
  --warning: #d97706;
  --warning-muted: #fffbeb;
  --warning-border: #fde68a;
  --info: #2563eb;
  --info-muted: #eff6ff;
  --info-border: #bfdbfe;
  --sidebar: #fafafa;
  --radius: 0.5rem;
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --sidebar-width: 256px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #09090b;
    --foreground: #fafafa;
    --card: #09090b;
    --card-foreground: #fafafa;
    --muted: #27272a;
    --muted-foreground: #a1a1aa;
    --accent: #27272a;
    --accent-foreground: #fafafa;
    --border: #27272a;
    --input: #27272a;
    --ring: #52525b;
    --primary: #fafafa;
    --primary-foreground: #18181b;
    --secondary: #27272a;
    --secondary-foreground: #fafafa;
    --destructive: #ef4444;
    --destructive-foreground: #fafafa;
    --destructive-muted: #2a1516;
    --destructive-border: #4c1d1d;
    --success: #22c55e;
    --success-muted: #0f2115;
    --success-border: #14532d;
    --warning: #f59e0b;
    --warning-muted: #271c0a;
    --warning-border: #78350f;
    --info: #3b82f6;
    --info-muted: #0f1b2e;
    --info-border: #1e3a5f;
    --sidebar: #0c0c0e;
  }
}

* { box-sizing: border-box; }

/* `hidden` özniteliği, aşağıdaki display kurallarına yenilmemeli; aksi hâlde
   gizlenmiş modal, banner ve yükleme satırları görünür kalır.
   Kenar çubuğu perdesi hariç tutulur: o, `hidden` özniteliğini korurken
   sınıfla açılıp kapanır. */
[hidden]:not(.sidebar-scrim) { display: none !important; }
.sidebar-scrim[hidden] { display: none; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.3rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1rem; }
p { margin: 0; }
button { font: inherit; color: inherit; }
a { color: var(--foreground); text-underline-offset: 2px; }
code { font-family: var(--font-mono); }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 120;
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-md) 0;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.muted { color: var(--muted-foreground); }

/* ---------- Ortak bileşenler ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  height: 36px;
  padding: 0 16px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--card);
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
  white-space: nowrap;
}
.button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }

.button--primary { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }
.button--primary:hover:not(:disabled) { background: var(--primary); opacity: 0.9; }

.button--quiet {
  background: var(--card);
  border-color: var(--border);
  color: var(--foreground);
}
.button--quiet:hover:not(:disabled) { background: var(--accent); }

.button--secondary { background: var(--secondary); color: var(--secondary-foreground); border-color: transparent; }
.button--secondary:hover:not(:disabled) { background: var(--secondary); opacity: 0.85; }

.button--ghost { background: transparent; border-color: transparent; color: var(--foreground); }
.button--ghost:hover:not(:disabled) { background: var(--accent); }

.button--danger { background: transparent; color: var(--destructive); border-color: var(--destructive-border); }
.button--danger:hover:not(:disabled) { background: var(--destructive-muted); }

/* Ghost + danger birlikte: kırmızı metin, kenarlık ve zemin yok; hover'da
   yalnız hafif kırmızı zemin. Salt .button--danger (ghost olmadan) aynen kalır. */
.button--ghost.button--danger { background: transparent; border-color: transparent; color: var(--destructive); }
.button--ghost.button--danger:hover:not(:disabled) { background: var(--destructive-muted); }

.button--destructive { background: var(--destructive); color: var(--destructive-foreground); border-color: var(--destructive); }
.button--destructive:hover:not(:disabled) { background: var(--destructive); opacity: 0.9; }

.button--small { height: 32px; padding: 0 12px; font-size: 0.8125rem; }
.button--full { width: 100%; }
.button--icon { width: 36px; height: 36px; padding: 0; }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}
.icon-button:hover { background: var(--accent); color: var(--foreground); }
.icon-button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Eski büyük harf eyebrow etiketleri artık normal, düşük vurgulu üst bilgi. */
.section-eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-bottom: 4px;
  text-transform: none;
  letter-spacing: normal;
}
.section-description { color: var(--muted-foreground); margin-top: 4px; font-size: 0.875rem; max-width: 60ch; }

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted-foreground);
  flex: none;
  display: inline-block;
}
.status-dot--success { background: var(--success); }
.status-dot--warn { background: var(--warning); }
.status-dot--danger { background: var(--destructive); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--foreground);
  font-weight: 600;
}
.brand-mark {
  width: 28px; height: 28px;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}
.brand-word { font-size: 1rem; letter-spacing: -0.01em; }
.brand--large .brand-mark { width: 36px; height: 36px; font-size: 1.1rem; }
.brand--large .brand-word { font-size: 1.2rem; }

/* ---------- Kırıntı (breadcrumb) ---------- */

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1rem;
  font-weight: 600;
}
.breadcrumb-root { color: var(--muted-foreground); font-weight: 500; }
.breadcrumb-sep { color: var(--muted-foreground); }

/* ---------- Uyarı kutuları (Alert) ---------- */

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 0.875rem;
  line-height: 1.5;
}
.alert-title { font-weight: 500; margin: 0 0 2px; }
.alert-description { color: var(--muted-foreground); margin: 0; }
.alert--warning { background: var(--warning-muted); border-color: var(--warning-border); color: #7c4a03; }
.alert--destructive { background: var(--destructive-muted); border-color: var(--destructive-border); color: var(--destructive); }
.alert--info { background: var(--info-muted); border-color: var(--info-border); color: var(--info); }
@media (prefers-color-scheme: dark) {
  .alert--warning { color: var(--warning); }
}

/* ---------- Giriş sayfası ---------- */

.login-page { min-height: 100vh; background: var(--background); }
.login-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
  max-width: 400px;
  width: 100%;
}
.login-card .brand { margin-bottom: 20px; }
.login-card h2 { font-size: 1.25rem; }
.login-card > .muted { margin-top: 6px; font-size: 0.875rem; }
.stack-form { display: flex; flex-direction: column; gap: 16px; margin-top: 22px; }
.password-wrap { position: relative; display: flex; align-items: center; }
.password-wrap input { padding-right: 46px; }
.password-toggle { position: absolute; right: 3px; width: 34px; height: 34px; }
.form-footnote {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}
.login-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted-foreground);
  margin-top: 16px;
}

.form-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  margin-bottom: 4px;
  padding: 11px 14px;
  border-radius: var(--radius-lg);
  background: var(--destructive-muted);
  color: var(--destructive);
  font-size: 0.875rem;
  border: 1px solid var(--destructive-border);
}
.alert-icon {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--destructive);
  color: var(--destructive-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex: none;
}

/* ---------- Form alanları ---------- */

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group label, .setting-row label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}
.required { color: var(--destructive); }
.optional { color: var(--muted-foreground); font-weight: 400; }
.field-help { font-size: 0.8rem; color: var(--muted-foreground); }
.field-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted-foreground);
}
.field-meta .is-over { color: var(--destructive); font-weight: 600; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

input[type="text"], input[type="url"], input[type="password"], input[type="search"],
input[type="number"], input[type="datetime-local"], input[type="time"], select, textarea {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  background: var(--background);
  color: var(--foreground);
  font: inherit;
  font-size: 0.875rem;
}
textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 68px; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--muted-foreground); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  border-color: var(--ring);
  outline: 2px solid var(--ring);
  outline-offset: 0;
}
input:focus:not(:focus-visible), select:focus:not(:focus-visible), textarea:focus:not(:focus-visible) { outline: none; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--destructive); }

select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.number-input { display: flex; align-items: center; gap: 9px; }
.number-input input { width: 92px; }
.number-input span { font-size: 0.83rem; color: var(--muted-foreground); }

.switch { display: inline-flex; align-items: center; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 36px; height: 20px;
  border-radius: 999px;
  background: var(--input);
  position: relative;
  transition: background 140ms ease;
  display: inline-block;
}
.switch-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--background);
  box-shadow: var(--shadow-sm);
  transition: transform 140ms ease;
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--ring); outline-offset: 2px; }

.form-feedback {
  padding: 10px 13px;
  border-radius: var(--radius-lg);
  background: var(--destructive-muted);
  border: 1px solid var(--destructive-border);
  color: var(--destructive);
  font-size: 0.85rem;
}
.form-feedback--info { background: var(--info-muted); border-color: var(--info-border); color: var(--info); }

/* ---------- Uygulama iskeleti ---------- */

.app-page { min-height: 100vh; }
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  flex: none;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sidebar-close { display: none; }
.sidebar-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin: 16px 0 6px 8px;
  text-transform: none;
  letter-spacing: normal;
}
.sidebar-label--spaced { margin-top: 16px; }

.nav-list { display: flex; flex-direction: column; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--foreground);
  text-align: left;
}
.nav-item span:not(.nav-count) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item svg { flex: none; }
.nav-item:hover { background: var(--accent); }
.nav-item.is-active { background: var(--accent); color: var(--accent-foreground); font-weight: 500; }
.nav-count {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  background: var(--muted);
  border-radius: 999px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}
.nav-item.is-active .nav-count { background: var(--background); color: var(--foreground); }

/* Nav üstte kalır, alt blok kenar çubuğunu iter (margin-top: auto). */
.sidebar-bottom { display: flex; flex-direction: column; gap: 10px; margin-top: auto; padding-top: 12px; }
.connection-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-radius: var(--radius-md);
  padding: 8px 10px;
  min-width: 0;
}
.connection-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  width: 100%;
  min-width: 0;
}
.connection-row span:last-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connection-card p { width: 100%; font-size: 0.72rem; color: var(--muted-foreground); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.account-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  text-align: left;
}
.account-button:hover { background: var(--accent); }
.account-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.78rem;
  flex: none;
}
.account-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.account-meta strong { font-size: 0.83rem; font-weight: 500; }
.account-meta small { font-size: 0.72rem; color: var(--muted-foreground); }
.account-button svg { flex: none; color: var(--muted-foreground); }

.sidebar-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  z-index: 40;
}

.main-area {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--background) 80%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
/* Eyebrow kaldırıldı; JS setText çağırsa da öğe gizli kalır. */
.topbar-kicker { display: none; }
.page-title { font-size: 1rem; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-date { font-size: 0.8rem; color: var(--muted-foreground); white-space: nowrap; }
.menu-toggle { display: none; }
/* avatar-button KALDIRILDI: ayarlara giden ikinci, anlamsız bir yol. Kanca
   testte geçmiyorsa da DOM'dan silinmez (dashboard.html wUI-A'ya ait);
   burada yalnız görünmez kılınır ki üst çubukta tekrar oluşmasın. */
.avatar-button { display: none; }

/* ---------- Otomatik mod durum hapı ---------- */
.auto-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.auto-pill:hover { background: var(--accent); }
.auto-pill::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted-foreground);
  flex: none;
}
.auto-pill--on { border-color: var(--success-border); background: var(--success-muted); color: var(--success); }
.auto-pill--on::before { background: var(--success); }
.auto-pill--halted { border-color: var(--destructive-border); background: var(--destructive-muted); color: var(--destructive); }
.auto-pill--halted::before { background: var(--destructive); }

.demo-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 16px 24px 0;
  padding: 11px 15px;
  border-radius: var(--radius-lg);
  background: var(--warning-muted);
  border: 1px solid var(--warning-border);
  color: #7c4a03;
  font-size: 0.875rem;
}
@media (prefers-color-scheme: dark) { .demo-banner { color: var(--warning); } }
.demo-banner-icon {
  width: 24px; height: 24px;
  border-radius: var(--radius-md);
  background: var(--warning);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  flex: none;
}
.demo-banner span:nth-child(2) { flex: 1; }
.banner-dismiss {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  color: inherit;
  padding: 0 4px;
}

.view-container { padding: 24px; flex: 1; max-width: 1200px; width: 100%; margin: 0 auto; }
.page-view { display: none; }
.page-view.is-visible { display: block; animation: fade-in 180ms ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-intro h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.015em; }
.intro-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Özet kartları ---------- */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.summary-card--alert { border-color: var(--destructive-border); }
/* Tüm özet kartları aynı (kart) zeminde; --quiet artık zemin farkı yapmaz. */
.summary-card--quiet { background: var(--card); }
.summary-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  font-weight: 500;
}
.summary-card-icon { color: var(--muted-foreground); flex: none; }
.summary-value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 6px 0 3px;
  font-variant-numeric: tabular-nums;
}
.summary-hint { font-size: 0.76rem; color: var(--muted-foreground); }

/* ---------- Araç çubuğu ---------- */

.content-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.segmented-control {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  background: var(--muted);
  border-radius: var(--radius-md);
  max-width: 100%;
  overflow-x: auto;
}
.segment {
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  height: 28px;
  padding: 0 12px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.segment span { font-size: 0.72rem; color: inherit; opacity: 0.75; font-variant-numeric: tabular-nums; }
.segment:hover { color: var(--foreground); }
.segment.is-active { background: var(--background); color: var(--foreground); box-shadow: var(--shadow-sm); font-weight: 500; }

.search-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 36px;
  background: var(--background);
  border: 1px solid var(--input);
  border-radius: var(--radius-md);
  color: var(--muted-foreground);
  min-width: 220px;
}
.search-field input {
  border: none;
  height: auto;
  background: transparent;
  padding: 0;
  font-size: 0.875rem;
}
.search-field input:focus-visible { outline: none; }
.search-field:focus-within { border-color: var(--ring); outline: 2px solid var(--ring); }

/* ---------- Taslak kartları ---------- */

.draft-list { display: flex; flex-direction: column; gap: 12px; }

.draft-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.draft-card.is-busy { opacity: 0.6; pointer-events: none; }
.draft-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 11px;
}
.draft-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted-foreground); }
.draft-char-count { font-size: 0.78rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; white-space: nowrap; }
.draft-char-count--warn { color: var(--warning); }
.draft-char-count--over { color: var(--destructive); font-weight: 600; }
.draft-text {
  font-size: 0.9375rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--foreground);
  margin-bottom: 12px;
}
.draft-source {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  color: var(--muted-foreground);
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.draft-source a { color: var(--foreground); text-decoration: underline; }
.draft-source-host {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 32ch;
}
.draft-actions, .draft-card-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.draft-actions-end { display: flex; gap: 8px; margin-left: auto; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--secondary);
  color: var(--secondary-foreground);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--draft { background: transparent; color: var(--muted-foreground); border-color: var(--border); }
.badge--scheduled { background: var(--info-muted); color: var(--info); }
.badge--publishing { background: var(--info-muted); color: var(--info); }
.badge--published { background: var(--success-muted); color: var(--success); }
.badge--uncertain { background: var(--destructive-muted); color: var(--destructive); }
.badge--failed { background: var(--destructive-muted); color: var(--destructive); }
.badge--rejected { background: var(--muted); color: var(--muted-foreground); }
.badge--auto { background: transparent; color: var(--foreground); border-color: var(--border); }

.draft-error {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-lg);
  background: var(--destructive-muted);
  border: 1px solid var(--destructive-border);
  color: var(--destructive);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}
.draft-schedule {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-lg);
  background: var(--info-muted);
  color: var(--info);
  font-size: 0.82rem;
}

/* Satır içi onay kutusu (native confirm yerine) */
.inline-confirm {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: var(--radius-lg);
  background: var(--warning-muted);
  border: 1px solid var(--warning-border);
  color: #7c4a03;
  font-size: 0.85rem;
}
@media (prefers-color-scheme: dark) { .inline-confirm { color: var(--warning); } }
.inline-confirm p { flex: 1; min-width: 180px; }
.inline-confirm .confirm-actions { display: flex; gap: 8px; }

/* ---------- Kuyruk / adaylar ---------- */

.queue-layout, .activity-layout {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel--flush { padding: 0; }
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-heading h3 { font-size: 1rem; font-weight: 600; }
.panel-count {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted-foreground);
  background: var(--muted);
  border-radius: 999px;
  padding: 2px 10px;
}
.panel-footnote { padding: 12px 18px; font-size: 0.76rem; color: var(--muted-foreground); border-top: 1px solid var(--border); }

.queue-list, .candidate-list, .event-list, .source-list, .usage-list {
  display: flex;
  flex-direction: column;
}
.queue-item, .candidate-item, .event-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.queue-item:last-child, .candidate-item:last-child, .event-item:last-child { border-bottom: none; }

.queue-auto-note {
  padding: 10px 18px;
  font-size: 0.8rem;
  color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}

.queue-item { display: flex; gap: 13px; align-items: flex-start; }
.queue-time {
  flex: none;
  width: 72px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}
.queue-time small { display: block; font-weight: 400; color: var(--muted-foreground); font-size: 0.72rem; }
.queue-body { flex: 1; min-width: 0; }
.queue-body p { font-size: 0.87rem; line-height: 1.55; overflow-wrap: anywhere; }
.queue-body .draft-meta { margin-top: 7px; }

/* Masaüstünde (>=768px) filtre yalnız Tabs ile yapılır; <select> DOM'da
   kalır (test/erişilebilirlik) ama gizlenir. <768px'de tersi: select
   görünür, .candidate-tabs gizlenir. */
.candidate-filter {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}
.candidate-filter label { font-size: 0.79rem; color: var(--foreground); font-weight: 500; }
.candidate-filter select { width: auto; flex: 1; font-size: 0.83rem; height: 32px; }
.candidate-list { max-height: 560px; overflow-y: auto; }
.candidate-item p { font-size: 0.86rem; line-height: 1.55; overflow-wrap: anywhere; margin-bottom: 8px; }
.candidate-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; font-size: 0.77rem; color: var(--muted-foreground); }
.candidate-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.candidate-tabs, .settings-tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--muted);
  border-radius: var(--radius-md);
  overflow-x: auto;
  max-width: 100%;
}
.candidate-tab, .settings-tab {
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  height: 32px;
  padding: 0 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer;
  white-space: nowrap;
  flex: none;
}
.candidate-tab:hover, .settings-tab:hover { color: var(--foreground); }
.candidate-tab[aria-selected="true"], .settings-tab[aria-selected="true"] {
  background: var(--background);
  color: var(--foreground);
  box-shadow: var(--shadow-sm);
}

.candidate-text { font-size: 0.86rem; line-height: 1.55; overflow-wrap: anywhere; margin-bottom: 8px; }
.candidate-text.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.candidate-text.is-expanded { display: block; -webkit-line-clamp: unset; overflow: visible; }
.candidate-expand {
  border: none;
  background: transparent;
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 8px;
  display: inline-block;
}
.candidate-signals {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--muted-foreground);
  margin-bottom: 8px;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Kaynaklar ---------- */

.source-note {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.82rem;
  margin-top: 18px;
}
.note-icon { flex: none; display: inline-flex; }

.source-list { gap: 12px; }
.source-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.source-item.is-disabled { opacity: 0.66; }
.source-body, .source-main { flex: 1; min-width: 200px; }
.source-body strong, .source-main strong { font-size: 0.92rem; font-weight: 500; display: block; overflow-wrap: anywhere; }
.source-url { font-size: 0.78rem; color: var(--muted-foreground); font-family: var(--font-mono); overflow-wrap: anywhere; display: block; margin-top: 3px; }
.source-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 0.76rem; color: var(--muted-foreground); }
.source-item .draft-meta { margin-top: 6px; }
.source-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.source-error { font-size: 0.78rem; color: var(--destructive); margin-top: 5px; overflow-wrap: anywhere; }

/* ---------- Aktivite ---------- */

.event-item { display: flex; gap: 11px; align-items: flex-start; }
.event-level {
  flex: none;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-top: 7px;
  background: var(--muted-foreground);
}
.event-level--info { background: var(--info); }
.event-level--warning { background: var(--warning); }
.event-level--error { background: var(--destructive); }
.event-body { flex: 1; min-width: 0; }
.event-body p { font-size: 0.86rem; line-height: 1.5; overflow-wrap: anywhere; }
.event-time { font-size: 0.74rem; color: var(--muted-foreground); margin-top: 3px; display: block; }

.usage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
}
.usage-row:last-child { border-bottom: none; }
.usage-row strong { font-variant-numeric: tabular-nums; font-weight: 600; }
.usage-row span { color: var(--muted-foreground); }

/* ---------- Ayarlar ---------- */

.settings-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.settings-panel-group { display: flex; flex-direction: column; gap: 18px; }
.settings-main { grid-row: auto; }
.settings-fields { display: flex; flex-direction: column; }
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.setting-row:first-child { border-top: none; }
.setting-row > div:first-child { flex: 1; min-width: 190px; }
.setting-row p { font-size: 0.8125rem; color: var(--muted-foreground); margin-top: 3px; max-width: 60ch; }
.setting-row select { width: auto; min-width: 160px; }
.setting-row > *:last-child:not(div:first-child) { margin-left: auto; }

.setting-row--note > div:first-child { flex: 1 1 100%; }
.setting-note-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--foreground);
}
.repo-share-readout { margin-top: 6px; }
.setting-row .repo-share-head {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}
.setting-row .repo-share-detail { color: var(--muted-foreground); }
.setting-row .repo-share-warn {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--warning-muted);
  color: #7c4a03;
  font-weight: 500;
}
@media (prefers-color-scheme: dark) { .setting-row .repo-share-warn { color: var(--warning); } }

.save-status { font-size: 0.83rem; color: var(--muted-foreground); }
.save-status.is-ok { color: var(--success); font-weight: 500; }
.save-status.is-error { color: var(--destructive); font-weight: 500; }
.settings-dirty { color: var(--foreground); font-weight: 500; }

/* Yapışkan kaydetme çubuğu: formun altında, mobilde alt navın üstünde. */
.settings-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 15;
}

.integration-list { display: flex; flex-direction: column; }
.integration-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}
.integration-row:first-child { border-top: none; }
.integration-row > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.integration-row strong { font-size: 0.88rem; font-weight: 500; }
.integration-row small { font-size: 0.76rem; color: var(--muted-foreground); overflow-wrap: anywhere; }
.integration-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex: none;
}
.integration-icon--model { background: var(--info-muted); color: var(--info); }
.integration-icon--x { background: var(--primary); color: var(--primary-foreground); }
.integration-state {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  white-space: nowrap;
}
.integration-state.is-ok { background: var(--success-muted); color: var(--success); }
.integration-state.is-off { background: var(--warning-muted); color: #7c4a03; }
@media (prefers-color-scheme: dark) { .integration-state.is-off { color: var(--warning); } }

/* ---------- Boş ve yükleme durumları ---------- */

.empty-state {
  padding: 42px 22px;
  text-align: center;
  color: var(--muted-foreground);
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.empty-state-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--muted);
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.empty-state strong { display: block; color: var(--foreground); font-size: 0.95rem; font-weight: 600; margin-bottom: 5px; }
.empty-state p { font-size: 0.85rem; max-width: 46ch; margin: 0 auto; }
.empty-state-action { margin-top: 10px; }
.panel--flush .empty-state { border: none; border-radius: 0; background: transparent; padding: 34px 20px; }

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 30px;
  color: var(--muted-foreground);
  font-size: 0.87rem;
}
.loading-spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--foreground);
  border-radius: 50%;
  animation: spin 720ms linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Modallar ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgb(0 0 0 / 0.5);
  z-index: 60;
}
/* Başlık üstte sabit, gövde (.modal-form) kayar, eylemler formun içinde
   sticky bottom olarak kalır — uzun içerikte (ör. zincirin ikinci
   gönderisini düzenlerken) başlık ve kapatma düğmesi kaybolmaz. */
.modal {
  position: fixed;
  z-index: 70;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(512px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
}
.modal--wide { width: min(720px, calc(100vw - 32px)); }
.modal-header {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 0 0 4px;
  margin: -4px -4px 0 0;
}
.modal-header h2 { font-size: 1.125rem; font-weight: 600; }
/* Modal başlığındaki eski eyebrow: kanca taşıyorsa 14px muted açıklamaya
   döner (başlığın üstünde küçük, büyük harf değil). */
.modal-header .section-eyebrow {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 2px;
}
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 0 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  bottom: -24px;
  margin: 6px -24px -24px;
  padding: 12px 24px 24px;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.generate-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; }
.generate-source, .generate-options { display: flex; flex-direction: column; gap: 14px; }
.generate-safety {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: var(--radius-lg);
  background: var(--muted);
  color: var(--foreground);
  font-size: 0.8rem;
  line-height: 1.5;
}
.generate-safety svg { flex: none; margin-top: 1px; }

.schedule-callout, .resolve-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--info-muted);
  border: 1px solid var(--info-border);
  color: var(--info);
  font-size: 0.83rem;
  line-height: 1.55;
}
.resolve-callout { background: var(--warning-muted); border-color: var(--warning-border); color: #7c4a03; }
@media (prefers-color-scheme: dark) { .resolve-callout { color: var(--warning); } }
.schedule-callout-icon, .resolve-callout-icon { flex: none; display: inline-flex; }
.resolve-callout-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--warning);
  color: #fff;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

/* Yayın öncesi risk uyarısı. Uyarı tonu kullanılır, hata tonu değil: bu
   pencere bir engel değil, devam edilebilir bir bilgilendirmedir. */
.risk-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--warning-muted);
  border: 1px solid var(--warning-border);
  color: #7c4a03;
  font-size: 0.83rem;
  line-height: 1.55;
}
@media (prefers-color-scheme: dark) { .risk-callout { color: var(--warning); } }
.risk-callout-icon { flex: none; display: inline-flex; margin-top: 1px; }

.risk-reasons {
  margin: 0;
  padding: 0 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.risk-reasons li::marker { color: var(--warning); }

.risk-footnote {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}

/* --- iki gönderilik zincir ------------------------------------------------
   Zincirin ikinci gönderisi, birinci gönderinin kartı içinde girintili bir
   kutuda gösterilir: iki metin aynı anda okunur, hangisinin nereye gittiği
   sol kenar çizgisinden anlaşılır. */
.chain-box {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-left: 2px solid var(--border);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--muted);
}
.chain-box-label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  color: var(--muted-foreground);
  text-transform: none;
  letter-spacing: normal;
}
.chain-box-text {
  margin: 0 0 8px;
  font-size: 0.875rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--foreground);
}
.chain-box-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--muted-foreground);
}
.chain-box-state {
  margin: 8px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--foreground);
}

/* --- zincir = tek kart: X'teki iplik gibi 1 → 2 ----------------------------
   Solda numaralı daireler ve onları birleştiren dikey çizgi; her gönderinin
   metni, sayacı ve kendi küçük eylemleri kendi sütununda. */
.chain-thread { display: flex; flex-direction: column; margin-bottom: 4px; }
.chain-post {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 12px;
}
.chain-post-gutter { display: flex; flex-direction: column; align-items: center; }
.chain-post-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--foreground);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.chain-thread-rail {
  flex: 1 1 auto;
  width: 2px;
  min-height: 12px;
  margin-top: 4px;
  border-radius: 1px;
  background: var(--border);
}
.chain-post-body { min-width: 0; padding-bottom: 8px; }
.chain-post-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 26px;
  margin-bottom: 6px;
}
.chain-post-head .chain-member-label { margin: 0; }
.chain-post-head .draft-char-count { margin-left: auto; }
.chain-post .draft-text { margin-bottom: 10px; }
.chain-post-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  /* Ghost düğmelerin iç boşluğu kadar sola: yazıları metinle hizalanır. */
  margin: -2px 0 10px -12px;
}
.chain-state-line {
  margin: 0 0 12px;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}
.queue-chain-follow {
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted-foreground);
}
.queue-body p.queue-chain-follow { font-size: 0.8rem; overflow-wrap: normal; }

.chain-callout {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--muted);
  color: var(--foreground);
  font-size: 0.83rem;
  line-height: 1.55;
}
.chain-callout-icon {
  flex: none;
  font-weight: 600;
  font-size: 0.78rem;
  padding-top: 1px;
  color: var(--muted-foreground);
}
.chain-callout p { margin: 0; }

/* Onay penceresindeki çift önizleme: kullanıcı onaylarken iki metni de
   görmek zorunda, bu yüzden liste her zaman iki maddeyi birden gösterir. */
.chain-approval {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--muted);
}
.chain-preview {
  margin: 8px 0 0;
  padding: 0 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chain-preview-item { color: var(--foreground); }
.chain-preview-label {
  margin: 0 0 4px;
  font-size: 0.72rem;
  color: var(--muted-foreground);
  text-transform: none;
  letter-spacing: normal;
}
.chain-preview-text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--foreground);
}
.chain-approval-note {
  margin: 10px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}
.chain-approval-image { color: var(--foreground); }

/* --- birinci gönderiye eklenecek depo kartı ------------------------------
   GitHub kartı 1200x600'dür. Kutu 2:1 oranını görsel gelmeden ayırır, böylece
   yükleme sırasında kart kaymaz; dar ekranda genişliğe göre küçülür. */
.draft-image {
  margin: 0 0 12px;
  max-width: 520px;
}
.draft-image-media,
.chain-preview-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--muted);
}
.draft-image-caption {
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--muted-foreground);
}
.draft-image.is-broken .draft-image-media { display: none; }
.draft-image.is-broken .draft-image-caption { color: var(--destructive); }
.chain-preview-image {
  margin-top: 8px;
  max-width: 320px;
}

.suggestion-list { display: flex; flex-direction: column; gap: 8px; }
.suggestion-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--background);
  cursor: pointer;
  text-align: left;
  font-size: 0.83rem;
}
.suggestion-chip:hover { border-color: var(--ring); background: var(--accent); }
.suggestion-chip strong { font-weight: 600; }
.suggestion-note { font-size: 0.76rem; color: var(--muted-foreground); line-height: 1.5; }

.resolve-choice { border: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.resolve-choice legend { font-size: 0.875rem; font-weight: 500; padding: 0; margin-bottom: 3px; }
.choice-card {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
}
.choice-card:hover { border-color: var(--ring); }
.choice-card input { margin-top: 3px; accent-color: var(--primary); }
.choice-card span { display: flex; flex-direction: column; }
.choice-card strong { font-size: 0.88rem; font-weight: 500; }
.choice-card small { font-size: 0.78rem; color: var(--muted-foreground); }
.choice-card:has(input:checked) { border-color: var(--ring); background: var(--accent); }

/* ---------- Mobil navigasyon ve bildirimler ---------- */

.mobile-nav { display: none; }

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  box-shadow: var(--shadow-lg);
  font-size: 0.86rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  animation: toast-in 180ms ease;
  border-left: 3px solid var(--foreground);
}
.toast--error { border-left-color: var(--destructive); }
.toast--success { border-left-color: var(--success); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Duyarlı yerleşim ---------- */

@media (max-width: 1080px) {
  .queue-layout, .activity-layout { grid-template-columns: 1fr; }
  .generate-layout { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow-lg);
  }
  .app-shell.sidebar-open .sidebar { transform: none; }
  .app-shell.sidebar-open .sidebar-scrim { display: block; }
  .sidebar-close { display: inline-flex; }
  .menu-toggle { display: inline-flex; }

  .topbar { padding: 0 16px; }
  .topbar-date { display: none; }
  .breadcrumb-root, .breadcrumb-sep { display: none; }
  .demo-banner { margin: 14px 16px 0; }
  .view-container { padding: 18px 16px 96px; }

  .mobile-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 45;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 7px 6px calc(7px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
  }
  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 5px 8px;
    min-height: 44px;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--muted-foreground);
    flex: 1;
    min-width: 0;
  }
  .mobile-nav-item.is-active { color: var(--foreground); background: var(--accent); }

  .page-intro { align-items: flex-start; }
  .page-intro h2 { font-size: 1.3rem; }
  .intro-actions { width: 100%; }
  .intro-actions .button:first-child { flex: 1 1 100%; }
  .intro-actions .button:not(:first-child) { flex: 1; }
  .search-field { width: 100%; min-width: 0; }
  .segmented-control { width: 100%; }
  .candidate-tabs, .settings-tabs { width: 100%; }
  .field-grid { grid-template-columns: 1fr; }
  .queue-item { flex-direction: column; gap: 8px; }
  .queue-time { width: auto; }
  .toast-region { right: 12px; left: 12px; bottom: 76px; max-width: none; }
  .setting-row select, .setting-row .number-input { width: 100%; }
  .setting-row select { min-width: 0; }
  .setting-row { flex-direction: column; align-items: flex-start; }
  .setting-row > *:last-child { margin-left: 0; width: 100%; }
  .settings-actions { bottom: 60px; flex-wrap: wrap; }
  .auto-slot-row { flex-wrap: wrap; }
  .weekday-toggle-group, .chip-toggle-group { width: 100%; }
  .auto-card-halt { flex-direction: column; align-items: stretch; }
  .auto-recent-item { flex-direction: column; gap: 3px; }
  .auto-recent-time { width: auto; }
  .draft-actions { flex-direction: column; align-items: stretch; }
  .draft-actions-end { margin-left: 0; width: 100%; }
  .draft-actions .button { width: 100%; }
  .draft-actions-end .button { width: 100%; }
}

/* Aday filtresi: >=768px Tabs, <768px <select>. */
@media (max-width: 767px) {
  .candidate-filter { display: flex; }
  .candidate-tabs { display: none; }
}

/* Diyalog: 640px altında alttan açılan sheet. */
@media (max-width: 640px) {
  .modal {
    top: auto;
    bottom: 0;
    left: 0;
    transform: none;
    width: 100%;
    max-width: none;
    max-height: 90vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- zincir üyesinin X'teki yeri (1/2, 2/2) -------------------------------- */
.chain-member-label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--foreground);
  text-transform: none;
  letter-spacing: normal;
}

/* --- düzenlemede değiştirilemeyen zincir alanları: düz metin, kutu değil --- */
/* Kompakt bilgi kutusu (Alert gibi): dolu zemin yok, ince kenarlık, her
   sabit alan kendi satırında "Etiket: değer", en altta açıklama cümlesi. */
.locked-fields {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--radius-lg);
}
.locked-fields-row {
  margin: 0 0 4px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--foreground);
}
.locked-fields-row:last-of-type { margin-bottom: 0; }
.locked-fields-reason {
  margin: 6px 0 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}

/* --- kaynaklı üretimde depo adayı: zincir açıklaması ------------------------ */
.generate-repo-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--foreground);
  background: var(--muted);
  border-radius: var(--radius-md);
}

/* --- görsel yükleme önizlemesi --------------------------------------------- */
.image-upload-preview {
  margin: 0 0 14px;
  max-width: 420px;
}
.image-upload-preview-media {
  display: block;
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--muted);
}

/* --- otomatik mod kartı (pano) ----------------------------------------------
   Kapalı moddayken şerit toplam yüksekliği ~64-80px'i geçmez: başlık satırı
   tek satıra sıkışır (başlık, rozet hemen yanında, Ayarlar düğmesi
   margin-left:auto ile sağa iter), gövde dolgusu daraltılır. */
.auto-card { margin-bottom: 18px; }
.auto-card .panel-heading {
  padding: 12px 16px;
  gap: 8px;
}
.auto-card .panel-heading h3 { font-size: 0.9375rem; }
.auto-card .panel-heading [data-auto-open-settings] { margin-left: auto; }
.auto-card-body { display: flex; flex-direction: column; gap: 8px; padding: 0 16px 12px; }
.auto-strip-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}
/* Details, dolu bir kutu olarak DEĞİL, ince satır içi bir bağlantı gibi
   görünür: yalnız açıldığında liste yer kaplar. Kapalıyken de summary aynı
   yükseklikte durur, kutu hissi yaratmaz. */
.auto-strip-details { margin: 0; }
.auto-strip-details summary {
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--muted-foreground);
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.auto-strip-details summary::-webkit-details-marker { display: none; }
.auto-strip-details summary::after {
  content: "";
  width: 7px; height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 140ms ease;
  margin-top: -2px;
}
.auto-strip-details[open] summary::after { transform: rotate(-135deg); margin-top: 2px; }
.auto-strip-details.auto-card-blockers { background: transparent; padding: 0; }
.auto-strip-details.auto-card-blockers ul { margin: 6px 0 0; padding: 0 0 0 18px; }
.auto-card-blockers {
  margin: 0;
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: var(--muted);
  color: var(--foreground);
  font-size: 0.83rem;
  line-height: 1.55;
}
.auto-card-blockers ul { margin: 0; padding: 0 0 0 18px; }
.auto-card-halt {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--destructive-muted);
  border: 1px solid var(--destructive-border);
  color: var(--destructive);
  font-size: 0.85rem;
}
.auto-card-halt p { flex: 1; min-width: 180px; margin: 0; }
.auto-card-empty-day {
  padding: 11px 13px;
  border-radius: var(--radius-md);
  background: var(--warning-muted);
  color: #7c4a03;
  font-size: 0.83rem;
}
@media (prefers-color-scheme: dark) { .auto-card-empty-day { color: var(--warning); } }
.auto-card-empty-day p { margin: 0; }
.auto-card-slots { display: flex; flex-direction: column; gap: 8px; }
.auto-slot-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--muted);
}
.auto-slot-time {
  flex: none;
  width: 56px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}
.auto-slot-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.auto-slot-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.auto-slot-preview {
  font-size: 0.82rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
  color: var(--foreground);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.auto-slot-reason { font-size: 0.76rem; color: var(--muted-foreground); margin: 0; }
.auto-slot-editor-note { font-size: 0.76rem; color: var(--foreground); margin: 0; }
.auto-recent-list { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; }
.auto-recent-item {
  display: flex;
  gap: 11px;
  align-items: baseline;
  font-size: 0.8rem;
  color: var(--foreground);
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.auto-recent-item:first-child { border-top: none; padding-top: 0; }
.auto-recent-time { flex: none; width: 118px; font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.auto-card-recent summary { cursor: pointer; font-size: 0.83rem; font-weight: 500; color: var(--foreground); }

/* --- taslak kartı: otomatik onay rozeti ------------------------------------- */
.auto-approved-note {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: var(--muted);
  color: var(--foreground);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* --- ayarlar: otomatik yayın bölümü ----------------------------------------- */
.auto-slot-editor { display: flex; flex-direction: column; gap: 8px; }
.auto-slot-row { display: flex; align-items: center; gap: 9px; }
.auto-slot-row input[type="time"] { width: auto; flex: 1; min-width: 0; max-width: 120px; }
.auto-slot-remove { flex: none; }
.chip-toggle-group, .weekday-toggle-group { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-toggle, .weekday-toggle {
  border: 1px solid var(--border);
  background: var(--background);
  border-radius: var(--radius-md);
  height: 36px;
  padding: 0 14px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--foreground);
  cursor: pointer;
}
.chip-toggle:hover, .weekday-toggle:hover { background: var(--accent); }
.chip-toggle.is-active,
.weekday-toggle.is-on {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
  font-weight: 500;
}
.chip-toggle:focus-visible, .weekday-toggle:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.auto-load-hint {
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--info-muted);
  color: var(--info);
}
.auto-load-hint.is-warn { background: var(--warning-muted); color: #7c4a03; }
@media (prefers-color-scheme: dark) { .auto-load-hint.is-warn { color: var(--warning); } }
.auto-default-note { font-size: 0.78rem; line-height: 1.5; color: var(--muted-foreground); margin: 0; }

/* ---------- Hesap sağlığı hapı ve banner ---------- */

.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.health-pill:hover { background: var(--accent); }
.health-pill::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--muted-foreground);
  flex: none;
}
.health-pill--ok { border-color: var(--success-border); background: var(--success-muted); color: var(--success); }
.health-pill--ok::before { background: var(--success); }
.health-pill--warning { border-color: var(--warning-border); background: var(--warning-muted); color: var(--warning); }
.health-pill--warning::before { background: var(--warning); }
.health-pill--critical { border-color: var(--destructive-border); background: var(--destructive-muted); color: var(--destructive); }
.health-pill--critical::before { background: var(--destructive); }
.health-pill--demo::before { background: var(--info); }

.health-banner {
  margin: 16px 24px 0;
  align-items: flex-start;
}
.health-banner-body { flex: 1; min-width: 0; }
.health-banner-body p { overflow-wrap: anywhere; }
.health-banner-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
@media (max-width: 860px) { .health-banner { margin: 14px 16px 0; flex-wrap: wrap; } }

/* ---------- İstatistikler sayfası ---------- */

.health-card { margin-bottom: 22px; }
.health-card-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.health-reason { font-size: 0.875rem; color: var(--muted-foreground); margin: 0 0 4px; }
.health-rows { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.health-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.86rem;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.health-row:first-child { border-top: none; padding-top: 0; }
.health-row dt { color: var(--muted-foreground); font-weight: 500; }
.health-row dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.health-reads, .health-next-check { font-size: 0.8rem; color: var(--muted-foreground); margin: 0; }
.health-card-body [data-health-check] { align-self: flex-start; }
@media (max-width: 640px) { .health-card-body [data-health-check] { align-self: stretch; width: 100%; } }
.health-incidents { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.health-incident {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--destructive-muted);
  border: 1px solid var(--destructive-border);
}
.health-incident-message { margin: 0; font-size: 0.85rem; color: var(--destructive); font-weight: 500; }
.health-incident-detail {
  margin: 4px 0 0;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--muted-foreground);
  overflow-wrap: anywhere;
}
.health-incident-time { margin: 4px 0 0; font-size: 0.75rem; color: var(--muted-foreground); }

.stats-section { margin-bottom: 18px; }
.stats-section-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 16px; }
.stats-summary-grid { margin-bottom: 0; }

.chart-wrap { width: 100%; overflow-x: auto; }
.chart-wrap svg { display: block; min-width: 320px; }
.chart-bar--published { fill: var(--success); }
.chart-bar--failed { fill: var(--destructive); }
.chart-bar--uncertain { fill: var(--warning); }
.chart-bar--cost { fill: var(--info); }
.chart-line--followers {
  fill: none;
  stroke: var(--foreground);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart-axis-label { fill: var(--muted-foreground); font-size: 9px; }

.stats-table-wrap { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.stats-table th, .stats-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.stats-table th { color: var(--muted-foreground); font-weight: 500; font-size: 0.76rem; text-transform: none; }
.stats-table tr.is-muted td { color: var(--muted-foreground); }
.stats-table td a { color: var(--foreground); text-decoration: underline; }

.stats-by-kind { display: flex; flex-direction: column; gap: 6px; }
.stats-by-kind-row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.83rem; flex-wrap: wrap; }
.stats-by-kind-detail { color: var(--muted-foreground); }

.auto-slot-result-list { display: flex; flex-direction: column; gap: 4px; }
.auto-slot-result-row { display: flex; justify-content: space-between; gap: 12px; font-size: 0.82rem; color: var(--muted-foreground); padding: 4px 0; }
.auto-slot-result-count { font-variant-numeric: tabular-nums; color: var(--foreground); }

.stats-cost-total { font-size: 0.85rem; color: var(--muted-foreground); margin: 0; }

.stats-post-compact-meta { color: var(--muted-foreground); font-size: 0.78rem; }

.stats-timing-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stats-timing-block { min-width: 0; }
.stats-timing-title { font-size: 0.82rem; font-weight: 500; color: var(--foreground); margin: 0 0 8px; }
.chart-bar--timing { fill: var(--info); }

@media (max-width: 860px) {
  .stats-timing-charts { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .health-card-body { padding: 14px 16px 16px; }
  .stats-section-body { padding: 14px 16px 16px; }
  .health-row { flex-direction: column; gap: 2px; }
  .health-row dd { text-align: left; }
}
