/* Atölye — arayüz stilleri */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --text: #16181d;
  --text-2: #5b6170;
  --text-3: #8a90a0;
  --accent: #0f766e;
  --accent-2: #0d9488;
  --accent-soft: #e6f4f2;
  --accent-text: #ffffff;
  --info: #2563eb;
  --info-soft: #e8efff;
  --warn: #b45309;
  --warn-soft: #fff4e5;
  --danger: #c2410c;
  --danger-soft: #fdecea;
  --ok: #15803d;
  --sidebar: #111418;
  --sidebar-text: #c9ced8;
  --sidebar-muted: #7d8494;
  --sidebar-hover: #1d2128;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --radius: 10px;
  --radius-sm: 7px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --surface: #16191e;
    --surface-2: #1d2127;
    --border: #262b33;
    --border-strong: #353b45;
    --text: #e8eaee;
    --text-2: #a3a9b6;
    --text-3: #6f7685;
    --accent: #14b8a6;
    --accent-2: #2dd4bf;
    --accent-soft: #10302d;
    --accent-text: #04201d;
    --info: #60a5fa;
    --info-soft: #172338;
    --warn: #fbbf24;
    --warn-soft: #2e2512;
    --danger: #f87171;
    --danger-soft: #331b1b;
    --ok: #4ade80;
    --sidebar: #0a0c0f;
    --sidebar-hover: #171a20;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
h4 { font-size: 13px; font-weight: 650; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono, pre { font-family: var(--mono); font-size: 12.5px; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ico { flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Düzen ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-text);
  display: flex; flex-direction: column; padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: inherit; padding: 4px 8px 14px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.brand-mark.lg { width: 44px; height: 44px; font-size: 22px; border-radius: 12px; }
.side-section { flex: 1; }
.side-title {
  display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 6px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--sidebar-muted);
}
.side-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: var(--radius-sm);
  color: var(--sidebar-text); font: inherit; background: none; border: 0; width: 100%; text-align: left; cursor: pointer;
}
.side-link:hover { background: var(--sidebar-hover); text-decoration: none; color: #fff; }
.side-link.active { background: var(--sidebar-hover); color: #fff; box-shadow: inset 2px 0 0 var(--accent-2); }
.side-link .ico { opacity: .8; }
.side-empty { color: var(--sidebar-muted); padding: 4px 9px; font-size: 13px; }
.side-bottom { border-top: 1px solid #22262e; padding-top: 10px; display: grid; gap: 2px; }
.sidebar .icon-btn { color: var(--sidebar-muted); }
.sidebar .icon-btn:hover { background: var(--sidebar-hover); color: #fff; }

.agent-box { background: #181b21; border: 1px solid #23272f; border-radius: var(--radius); padding: 10px; margin-bottom: 8px; display: grid; gap: 6px; }
.agent-box:empty { display: none; }
.agent-head { display: flex; align-items: center; gap: 8px; }
.agent-head .muted { color: var(--sidebar-muted); flex: 1; font-size: 12.5px; }
.agent-task { font-size: 12.5px; color: var(--sidebar-text); line-height: 1.4; }
.agent-task.muted { color: var(--sidebar-muted); }
.agent-phase { color: var(--accent-2); font-size: 12px; margin-top: 2px; }
.agent-meta { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--sidebar-muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-run { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.dot-idle { background: #64748b; }
.dot-pause { background: #f59e0b; }
.dot-off { background: var(--danger); }
.meter { height: 5px; background: rgba(127, 127, 127, .2); border-radius: 99px; overflow: hidden; }
.meter.lg { height: 8px; margin: 12px 0 16px; }
.meter-fill { height: 100%; background: var(--accent-2); border-radius: inherit; transition: width .4s; }
.meter-fill.warn { background: #f59e0b; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.main { flex: 1; min-width: 0; }
.scrim { display: none; }

.page { max-width: 1180px; margin: 0 auto; padding: 28px 28px 48px; }
.page-project { max-width: none; padding-bottom: 24px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin-top: 4px; }
.repo-line { display: flex; align-items: center; gap: 6px; }

/* ---------- Butonlar & form ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 500 13.5px/1 var(--font); cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger); opacity: .9; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn.is-busy { position: relative; color: transparent !important; }
.btn.is-busy::after {
  content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--text-2) transparent var(--text-2) transparent; animation: spin .8s linear infinite;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 0; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn:disabled { opacity: .35; cursor: default; }

.form { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; }
.field-label { font-weight: 550; font-size: 13px; }
.field-hint { color: var(--text-3); font-size: 12px; }
.input {
  width: 100%; min-height: 36px; padding: 7px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); font: 14px/1.45 var(--font); transition: border-color .15s, box-shadow .15s;
}
.input.mono { font-family: var(--mono); font-size: 13px; }
textarea.input { resize: vertical; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
select.input[size] { padding: 4px; }
.select-sm { width: auto; min-height: 30px; padding: 3px 8px; font-size: 13px; }
.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-suffix {
  display: grid; place-items: center; padding: 0 10px; border: 1px solid var(--border-strong); border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); color: var(--text-2); font-family: var(--mono); font-size: 13px; white-space: nowrap;
}
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: start; }
.form-error { color: var(--danger); min-height: 18px; font-size: 13px; }
.status-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); margin-top: -6px; }

/* ---------- Rozet, çip, banner ---------- */
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--surface-2); color: var(--text-2); }
.badge-warn { background: #f59e0b; color: #1f1300; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 500; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.chip-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.banner {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 14px;
  background: var(--warn-soft); color: var(--warn); font-weight: 500; flex-wrap: wrap;
}
a.banner:hover { text-decoration: none; filter: brightness(.98); }
.banner-warn { background: var(--warn-soft); color: var(--warn); }
.banner-run { background: var(--accent-soft); color: var(--accent); margin: 0 0 12px; }
.page .banner:not(.banner-warn):not(a) { background: var(--info-soft); color: var(--info); }

/* ---------- Bildirim ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toast-in .2s ease-out; transition: opacity .3s, transform .3s; }
.toast-success { background: var(--ok); color: #fff; }
.toast-error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Modal & çekmece ---------- */
.overlay, .drawer-overlay { position: fixed; inset: 0; background: rgba(10, 12, 16, .45); z-index: 50; animation: fade .15s; }
.overlay { display: grid; place-items: center; padding: 16px; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 14px; width: min(480px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal-wide { width: min(680px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.modal-body { padding: 10px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px 16px; }
.drawer-overlay { display: flex; justify-content: flex-end; }
.drawer { width: min(640px, 100%); height: 100%; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 0; display: flex; flex-direction: column; }
.drawer-loading { display: grid; place-items: center; flex: 1; }
.drawer-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.drawer-head h2 { margin-top: 2px; font-size: 19px; }
.drawer-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.card-detail { display: grid; gap: 14px; padding: 16px 0; }
.card-detail section { display: grid; gap: 6px; }
.timeline-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 10px; border-top: 1px solid var(--border); padding-top: 14px; }
.timeline { display: grid; gap: 10px; padding-bottom: 12px; }
.ev { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); }
.ev-head { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.ev-user { background: var(--surface-2); }
.ev-agent { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.ev-question { border-color: #f59e0b; background: var(--warn-soft); }
.ev-error { border-color: var(--danger); background: var(--danger-soft); }
.ev-log { padding: 7px 12px; background: transparent; border-style: dashed; }
.ev-log-body { margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--text-2); font-size: 12px; max-height: 240px; overflow: auto; }
.comment-box { position: sticky; bottom: 0; background: var(--surface); padding: 12px 0 16px; border-top: 1px solid var(--border); display: grid; gap: 8px; margin-top: auto; }

/* ---------- Boş durum & projeler ---------- */
.empty { text-align: center; padding: 48px 16px; display: grid; justify-items: center; gap: 8px; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-bottom: 6px; }
.empty .btn { margin-top: 8px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.project-card {
  display: grid; gap: 10px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  color: inherit; box-shadow: var(--shadow); transition: border-color .15s, transform .15s;
}
.project-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.project-card-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.project-card-head .badge { height: auto; padding: 2px 8px; }
.project-card-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); }
.project-card-meta span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Sekmeler ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 12px; color: var(--text-2); font-weight: 500;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar > p { flex: 1; min-width: 240px; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }

/* ---------- Bilgi (spec) ---------- */
.spec-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; }
.spec-side { display: grid; gap: 10px; position: sticky; top: 12px; }
.spec-tabs { display: grid; gap: 2px; }
.spec-tab {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); border: 0;
  background: transparent; color: var(--text-2); font: 500 14px var(--font); cursor: pointer; text-align: left;
}
.spec-tab:hover { background: var(--surface-2); color: var(--text); }
.spec-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.spec-tab .count { font-size: 12px; color: var(--text-3); }
.spec-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); min-height: 300px; }
.spec-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.items { list-style: none; margin: 0 0 12px; padding: 0; display: grid; }
.item { display: flex; gap: 10px; align-items: flex-start; padding: 9px 6px; border-bottom: 1px solid var(--border); border-radius: 6px; }
.item:hover { background: var(--surface-2); }
.item-num { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 12.5px; min-width: 20px; padding-top: 1px; text-align: right; }
.item-text { flex: 1; white-space: pre-wrap; word-break: break-word; }
.item .input { flex: 1; }
.item-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .15s; }
.item:hover .item-actions, .item:focus-within .item-actions { opacity: 1; }
.empty-line { padding: 16px 4px; }
.add-row { display: flex; gap: 8px; align-items: flex-end; }

/* ---------- Sohbet ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 190px); min-height: 420px; }
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 4px 16px; }
.chat-empty { margin: auto; }
.msg { display: flex; gap: 10px; max-width: 860px; width: 100%; }
.msg-user { justify-content: flex-end; margin-left: auto; }
.msg-user .bubble { background: var(--accent); color: var(--accent-text); border-radius: 14px 14px 4px 14px; white-space: pre-wrap; max-width: 80%; }
.msg-assistant .bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; }
.msg-error .bubble { background: var(--danger-soft); color: var(--danger); border-radius: 10px; }
.msg-main { display: grid; gap: 8px; min-width: 0; flex: 1; }
.bubble { padding: 10px 14px; word-break: break-word; }
.avatar { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; }
.msg-meta { font-size: 11.5px; color: var(--text-3); }
.typing { display: inline-flex; gap: 4px; padding: 14px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.chat-compose { border: 1px solid var(--border-strong); border-radius: 14px; background: var(--surface); padding: 8px; box-shadow: var(--shadow); }
.chat-compose .chat-input { border: 0; box-shadow: none; resize: none; min-height: 44px; }
.chat-compose-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 6px; }
.proposals { display: grid; gap: 8px; }
.proposal { border: 1px dashed var(--border-strong); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 8px; background: var(--surface); }
.proposal.done { opacity: .65; }
.proposal-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.proposal-body { white-space: pre-wrap; }
.proposal-status { display: flex; align-items: center; gap: 6px; color: var(--ok); font-size: 13px; }

/* ---------- Markdown ---------- */
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md pre, .md blockquote, .md table { margin: 0 0 .6em; }
.md ul, .md ol { padding-left: 1.3em; }
.md pre { background: var(--surface-2); padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.md pre code { background: none; padding: 0; }
.md h1, .md h2, .md h3 { margin: .8em 0 .4em; font-size: 15px; }
.md blockquote { border-left: 3px solid var(--border-strong); padding-left: 10px; color: var(--text-2); }
.md table { border-collapse: collapse; }
.md td, .md th { border: 1px solid var(--border); padding: 4px 8px; }

/* ---------- Pano ---------- */
.board { display: grid; grid-template-columns: repeat(6, minmax(180px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { min-width: 0; background: var(--surface-2); border-radius: 12px; padding: 10px; min-height: 220px; display: flex; flex-direction: column; border: 1px solid transparent; transition: border-color .15s, background .15s; }
.col.locked { background: color-mix(in srgb, var(--surface-2) 70%, var(--bg)); }
.col.drop { border-color: var(--accent); background: var(--accent-soft); }
.col-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; }
.col-head .count { font-size: 12px; color: var(--text-3); font-weight: 600; }
.col-hint { font-size: 11.5px; color: var(--text-3); padding: 0 4px 8px; }
.col-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; flex: 1; min-height: 60px; }
.kcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 11px; box-shadow: var(--shadow);
  cursor: pointer; display: grid; gap: 7px; transition: border-color .15s, box-shadow .15s;
}
.kcard:hover { border-color: var(--border-strong); }
.kcard[draggable="true"] { cursor: grab; }
.kcard.dragging { opacity: .4; }
.kcard.running { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.kcard-title { font-weight: 550; line-height: 1.35; word-break: break-word; }
.kcard-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.kcard-phase { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--accent); }
.kcard-meta { display: flex; flex-wrap: wrap; row-gap: 2px; gap: 9px; font-size: 11.5px; color: var(--text-3); align-items: center; }
.kcard-meta span { white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.drop-marker { height: 3px; border-radius: 3px; background: var(--accent); }
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; display: inline-block; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cevap bekleyenler ---------- */
.waiting-list { display: grid; gap: 14px; max-width: 860px; }
.waiting-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid #f59e0b; border-radius: 12px; padding: 14px 16px; display: grid; gap: 12px; box-shadow: var(--shadow); }
.waiting-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.question { background: var(--warn-soft); border-radius: var(--radius); padding: 10px 12px; }
.question-label { display: flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; color: var(--warn); margin-bottom: 4px; }

/* ---------- Ayarlar ---------- */
.settings-stack { display: grid; gap: 16px; max-width: 920px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.panel > h3 { display: flex; align-items: center; gap: 6px; }
.panel-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.panel-danger .btn { justify-self: start; }
details.panel summary { cursor: pointer; font-weight: 600; }
pre.code { background: var(--surface-2); padding: 12px; border-radius: 8px; overflow-x: auto; margin: 0; }
.repo-connected { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); flex-wrap: wrap; }
.option-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; align-content: start; }
.option-card .btn { justify-self: start; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; }
.stat-value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--text-2); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.table td { padding: 8px; border-bottom: 1px solid var(--border); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

.panel h4 { margin-top: 6px; }
ul.plain { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; }

/* ---------- Giriş ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent), var(--bg); }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; display: grid; gap: 14px; box-shadow: var(--shadow-lg); }
.login-brand { display: flex; align-items: center; gap: 12px; }

/* ---------- Duyarlı ---------- */
@media (max-width: 980px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 30; }
  .topbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
  .topbar .brand { padding: 0; color: var(--text); }
  .page { padding: 18px 16px 40px; }
  .spec-layout { grid-template-columns: 1fr; }
  .spec-side { position: static; }
  .spec-tabs { display: flex; overflow-x: auto; }
  .spec-tab { white-space: nowrap; }
  .item-actions { opacity: 1; }
  .grid-2, .grid-3, .stat-row { grid-template-columns: 1fr; }
  .board { grid-template-columns: repeat(6, 82vw); scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .chat { height: calc(100vh - 210px); }
  .msg-user .bubble { max-width: 90%; }
}

/* ---------- Görseller & Telegram ---------- */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs:empty { display: none; }
.thumbs.end { justify-content: flex-end; }
.thumb { position: relative; width: 88px; height: 88px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); display: block; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-x {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; opacity: 0; transition: opacity .15s;
}
.thumb:hover .thumb-x, .thumb:focus-within .thumb-x { opacity: 1; }
@media (hover: none) { .thumb-x { opacity: 1; } }
.compose-thumbs { padding: 4px 4px 8px; }
.msg-user-main { display: grid; gap: 6px; justify-items: end; max-width: 80%; }
.msg-user-main .bubble { max-width: 100%; }
.attach-section { display: grid; gap: 8px; padding-bottom: 14px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); }
.steps b, .steps a { color: var(--text); }
code.big { font-size: 14px; padding: 3px 8px; background: var(--accent-soft); color: var(--accent); font-weight: 600; user-select: all; }
.row.nowrap { flex-wrap: nowrap; }
details summary { cursor: pointer; }
