/* ==========================================================================
   Malpera arayüzü — tema, ortak bileşenler, pano, çalışma alanı
   ========================================================================== */

:root {
  --bg: #0a0a0d;
  --panel: #111116;
  --panel-2: #17171d;
  --panel-3: #1e1e26;
  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.14);
  --text: #f3f3f6;
  --muted: #9a9aa8;
  --faint: #62626f;
  --accent: #ff6a3d;
  --accent-2: #ff3d8f;
  --accent-grad: linear-gradient(135deg, #ff7a45 0%, #ff3d8f 100%);
  --danger: #ff5a5a;
  --ok: #3ddc97;
  --radius: 14px;
  --radius-sm: 9px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --chat-w: 400px;
  --tree-w: 240px;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
textarea, select, input { font: inherit; color: inherit; }
::selection { background: rgba(255,106,61,.35); }
.hidden { display: none !important; }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.view { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* ---------- Ortak bileşenler ---------- */
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: -.02em; font-size: 17px; white-space: nowrap; }
.logo-mark {
  width: 26px; height: 26px; border-radius: 8px; background: var(--accent-grad);
  display: grid; place-items: center; box-shadow: 0 4px 14px rgba(255,90,80,.35);
}
.logo-mark svg { width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 2.6; stroke-linecap: round; }

.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text); font-size: 13.5px; font-weight: 500;
  transition: background .15s, border-color .15s, transform .1s, opacity .15s; white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-primary { background: var(--accent-grad); border-color: transparent; color: #fff; }
.btn-primary:hover { filter: brightness(1.08); background: var(--accent-grad); }
.btn-icon { padding: 7px; border-radius: 9px; color: var(--muted); }
.btn-icon:hover { color: var(--text); }
.btn-icon.active { color: var(--text); background: var(--panel-3); border-color: var(--border-strong); }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-danger { color: var(--danger); }

.select {
  appearance: none; -webkit-appearance: none;
  background: var(--panel-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239a9aa8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 30px 8px 12px; font-size: 13px; color: var(--muted); cursor: pointer;
}
.select:hover { color: var(--text); border-color: var(--border-strong); }
.pill-muted { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12.5px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border); }
.pill-muted .icon { width: 14px; height: 14px; }
.spinner { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.topbar {
  display: flex; align-items: center; justify-content: space-between; padding: 0 14px 0 16px; height: 52px; flex: none;
  border-bottom: 1px solid var(--border); background: var(--panel); position: relative; z-index: 2;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* Composer (pano ve sohbet ortak) */
.composer {
  width: 100%; background: var(--panel); border: 1px solid var(--border-strong);
  border-radius: 18px; padding: 14px 14px 10px; text-align: left;
  box-shadow: 0 30px 80px rgba(0,0,0,.55); transition: border-color .15s, box-shadow .15s;
}
.composer:focus-within { border-color: rgba(255,106,61,.55); box-shadow: 0 30px 80px rgba(0,0,0,.55), 0 0 0 3px rgba(255,106,61,.15); }
.composer textarea {
  width: 100%; min-height: 84px; max-height: 260px; resize: none; background: transparent; border: 0; outline: 0;
  font-size: 16px; line-height: 1.5; color: var(--text); padding: 4px 4px 8px; display: block;
}
.composer textarea::placeholder { color: var(--faint); }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.composer-hint { color: var(--faint); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.send {
  width: 36px; height: 36px; border-radius: 10px; background: var(--accent-grad); color: #fff; display: grid; place-items: center; flex: none;
  box-shadow: 0 6px 18px rgba(255,90,80,.35); transition: transform .1s, filter .15s, opacity .15s;
}
.send:hover { filter: brightness(1.08); }
.send:active { transform: scale(.96); }
.send:disabled { opacity: .35; box-shadow: none; cursor: not-allowed; }
.send.stop { background: var(--panel-3); box-shadow: none; }

/* ==========================================================================
   Pano
   ========================================================================== */
#view-dashboard { overflow-y: auto; }
#view-dashboard::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(55% 40% at 50% 30%, rgba(255,106,61,.18), transparent 70%),
    radial-gradient(35% 30% at 25% 40%, rgba(255,61,143,.12), transparent 70%),
    radial-gradient(35% 28% at 75% 42%, rgba(120,80,255,.14), transparent 70%);
}
.dash { position: relative; z-index: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px 80px; }
.dash-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 64px 0 48px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255,255,255,.03); color: var(--muted); font-size: 12.5px; margin-bottom: 26px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
h1 { font-size: clamp(34px, 5.2vw, 56px); line-height: 1.04; letter-spacing: -.035em; margin: 0 0 14px; font-weight: 800; }
.sub { color: var(--muted); font-size: clamp(15px, 1.6vw, 17.5px); margin: 0 0 32px; max-width: 600px; line-height: 1.55; }
.dash-hero .composer { max-width: 760px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 20px; max-width: 800px; }
.chip {
  padding: 8px 13px; border-radius: 999px; border: 1px solid var(--border); background: rgba(255,255,255,.025);
  color: var(--muted); font-size: 13px; transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); background: rgba(255,255,255,.06); }
.chip .icon { width: 14px; height: 14px; }
.warn {
  margin-top: 18px; padding: 10px 14px; border-radius: 10px; font-size: 13px; color: #ffb4a0;
  background: rgba(255,90,60,.1); border: 1px solid rgba(255,90,60,.3); max-width: 760px;
}
.warn code { font-family: var(--mono); font-size: 12px; }

.projects { padding-top: 12px; }
.projects-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; }
.projects-head h2 { font-size: 18px; margin: 0; letter-spacing: -.01em; display: flex; align-items: baseline; gap: 10px; }
.projects-head .count { color: var(--faint); font-weight: 500; font-size: 14px; }
.project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card {
  display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; position: relative;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.thumb { position: relative; aspect-ratio: 16 / 10; background: #0c0c10; overflow: hidden; border-bottom: 1px solid var(--border); }
.thumb iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 800px; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.thumb-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--faint); font-size: 13px; }
.thumb-empty .icon { width: 22px; height: 22px; }
.thumb-building { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 13px; background: rgba(12,12,16,.85); }
.card-body { padding: 12px 14px 13px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { font-weight: 600; font-size: 14.5px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.card-meta { color: var(--faint); font-size: 12px; margin-top: 5px; display: flex; gap: 6px; flex-wrap: wrap; }
.card-meta .sep { color: var(--faint); }
.card-meta .status-ok { color: var(--ok); }
.card-meta .status-err { color: var(--danger); }
.card-menu { position: relative; flex: none; }
.menu {
  position: absolute; right: 0; top: 34px; z-index: 5; min-width: 170px; background: var(--panel-2); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 5px; box-shadow: 0 16px 40px rgba(0,0,0,.5);
}
.menu button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 8px 10px; border-radius: 7px; font-size: 13px; text-align: left; }
.menu button:hover { background: var(--panel-3); }
.menu .icon { width: 15px; height: 15px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 20px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); font-size: 14px; text-align: center; }
.empty .icon { width: 28px; height: 28px; color: var(--faint); }
.empty p { margin: 0; max-width: 420px; line-height: 1.5; }

/* ==========================================================================
   Çalışma alanı
   ========================================================================== */
#view-workspace { display: grid; grid-template-rows: 52px 1fr; }
.crumb-sep { color: var(--faint); }
.project-name {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); padding: 6px 9px; border-radius: 8px;
  max-width: 360px; min-width: 0;
}
.project-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.project-name .icon { width: 13px; height: 13px; opacity: 0; transition: opacity .15s; }
.project-name:hover { background: var(--panel-2); color: var(--text); }
.project-name:hover .icon { opacity: 1; }
.build-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border); }

.body { display: grid; grid-template-columns: var(--chat-w) 1fr; min-height: 0; }

/* Sohbet */
.chat { display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--panel); min-height: 0; }
.messages { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; }
.msg { display: flex; flex-direction: column; gap: 8px; max-width: 100%; }
.msg.user { align-items: flex-end; }
.bubble { padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.msg.user .bubble { background: var(--panel-3); border: 1px solid var(--border); border-bottom-right-radius: 5px; max-width: 88%; }
.msg.assistant .bubble { padding: 0 2px; }
.msg.assistant .bubble code { font-family: var(--mono); font-size: 12px; background: var(--panel-3); padding: 1px 5px; border-radius: 4px; }
.msg.assistant .who { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.msg.assistant .who .logo-mark { width: 18px; height: 18px; border-radius: 6px; box-shadow: none; }
.msg.assistant .who .logo-mark svg { width: 10px; height: 10px; }
.msg .time { color: var(--faint); font-size: 11px; font-weight: 400; margin-left: auto; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 6px 10px;
  border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); width: fit-content;
}
.status-pill.done { color: var(--ok); }
.status-pill.error { color: var(--danger); }
.error-text { color: var(--danger); font-size: 13.5px; }

/* Plan kartı ve dosya listesi (Lovable'ın "Editing files" listesi gibi) */

.chat-composer { padding: 10px 12px 12px; border-top: 1px solid var(--border); }
.chat-composer .composer { padding: 10px 10px 8px; border-radius: 14px; box-shadow: none; }
.chat-composer .composer textarea { min-height: 44px; font-size: 14px; }

/* Önizleme */
.preview { display: flex; flex-direction: column; min-height: 0; background: #08080a; position: relative; }
.preview-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px;
  border-bottom: 1px solid var(--border); background: var(--panel); flex: none;
}
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; flex: none; }
.seg button { padding: 5px 11px; border-radius: 7px; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.seg button.active { background: var(--panel-3); color: var(--text); }
.seg button .icon { width: 15px; height: 15px; }
.urlbar {
  flex: 1; max-width: 460px; display: flex; align-items: center; gap: 6px; padding: 4px 6px 4px 12px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--faint); font-size: 12.5px; font-family: var(--mono); min-width: 0;
}
.urlbar .icon { width: 13px; height: 13px; }
.urlbar .url-host { white-space: nowrap; }
.page-select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; color: var(--text); font-family: var(--mono); font-size: 12.5px; padding: 3px 6px; border-radius: 6px; cursor: pointer; min-width: 0; flex: 1; }
.page-select:hover { background: var(--panel-3); }
.page-select option { background: var(--panel-2); color: var(--text); }
.preview-tools { display: flex; align-items: center; gap: 4px; flex: none; }

.stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: stretch; justify-content: center; overflow: hidden; }
.stage.mobile { padding: 18px; background: radial-gradient(60% 60% at 50% 40%, rgba(255,255,255,.03), transparent); }
.frame-wrap { position: relative; flex: 1; display: flex; }
.stage.mobile .frame-wrap { flex: none; width: 390px; max-width: 100%; border-radius: 30px; border: 8px solid #1c1c22; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.6); background: #fff; }
iframe#frame { flex: 1; width: 100%; height: 100%; border: 0; background: #fff; }
.stage.mobile iframe#frame { border-radius: 22px; }

.placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: var(--muted); font-size: 14px; background: #0c0c10; z-index: 1;
}
.placeholder .big-spinner { width: 34px; height: 34px; border-width: 3px; }
.placeholder .ghost { width: min(560px, 80%); display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.placeholder .ghost i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.1), rgba(255,255,255,.05)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.placeholder .ghost i:nth-child(1) { height: 28px; width: 60%; }
.placeholder .ghost i:nth-child(2) { width: 85%; }
.placeholder .ghost i:nth-child(3) { width: 70%; }
.placeholder .ghost i:nth-child(4) { height: 120px; margin-top: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Kod görünümü: dosya ağacı + kod */
.code-area { flex: 1; min-height: 0; display: grid; grid-template-columns: var(--tree-w) 1fr; background: #0c0c10; }
.file-tree { border-right: 1px solid var(--border); overflow-y: auto; padding: 10px 8px; font-size: 13px; }
.tree-folder { color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 7px; cursor: pointer; user-select: none; }
.tree-folder:hover { background: var(--panel-2); }
.tree-folder .icon { width: 14px; height: 14px; }
.tree-folder .chev { width: 11px; height: 11px; transition: transform .15s; }
.tree-folder.open .chev { transform: rotate(90deg); }
.tree-children { padding-left: 14px; }
.tree-file { display: flex; align-items: center; gap: 7px; padding: 5px 8px; border-radius: 7px; cursor: pointer; color: var(--muted); font-family: var(--mono); font-size: 12.5px; }
.tree-file:hover { background: var(--panel-2); color: var(--text); }
.tree-file.active { background: var(--panel-3); color: var(--text); }
.tree-file .icon { width: 14px; height: 14px; }
.tree-file .spinner { margin-left: auto; }
.tree-file .dot-new { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-left: auto; }
.code-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px 8px 16px; border-bottom: 1px solid var(--border); font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.code { flex: 1; margin: 0; overflow: auto; padding: 14px 0 60px; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: #d6d6de; tab-size: 2; counter-reset: line; }
.code .line { display: block; padding: 0 20px 0 0; white-space: pre; }
.code .line::before { counter-increment: line; content: counter(line); display: inline-block; width: 52px; padding-right: 16px; text-align: right; color: var(--faint); user-select: none; }
.code-empty { color: var(--faint); padding: 40px; text-align: center; font-family: var(--font); }

/* Yayınlama */
.btn-publish-live { background: rgba(61,220,151,.12); border-color: rgba(61,220,151,.35); color: var(--ok); }
.btn-publish-live:hover { background: rgba(61,220,151,.18); border-color: rgba(61,220,151,.5); }
.btn-publish-live .icon { color: var(--ok); }
.pub-intro { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 16px; }
.slug-field { display: flex; align-items: center; background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: 10px; padding: 0 12px; font-family: var(--mono); font-size: 13px; color: var(--faint); }
.slug-field:focus-within { border-color: rgba(255,106,61,.55); }
.slug-field input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; padding: 10px 4px; font-family: var(--mono); font-size: 13px; color: var(--text); }
.slug-check { font-size: 12.5px; margin: 8px 2px 0; min-height: 18px; color: var(--faint); }
.slug-check.ok { color: var(--ok); }
.slug-check.bad { color: var(--danger); }
.pub-field-label { display: block; font-size: 12px; color: var(--muted); margin: 14px 0 6px; font-weight: 500; }
.pub-option { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px; margin-top: 10px; cursor: pointer; }
.pub-option:hover { border-color: var(--border-strong); }
.pub-option input { margin: 3px 0 0; accent-color: var(--accent); }
.pub-option .pub-option-title { font-size: 13.5px; font-weight: 500; }
.pub-option .pub-option-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.pub-option.disabled { opacity: .55; cursor: not-allowed; }
.pub-option .pub-option-sub code { font-family: var(--mono); font-size: 11.5px; background: var(--panel-3); padding: 1px 5px; border-radius: 4px; }
.pub-status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ok); margin-bottom: 14px; }
.pub-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.pub-status .since { color: var(--faint); font-weight: 400; }
.pub-links { display: flex; flex-direction: column; gap: 8px; }
.pub-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.pub-link-icon { display: grid; place-items: center; }
.pub-link .icon { width: 16px; height: 16px; color: var(--muted); }
.pub-link .pub-link-body { flex: 1; min-width: 0; }
.pub-link .pub-link-label { font-size: 11.5px; color: var(--faint); }
.pub-link a { display: block; font-family: var(--mono); font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-link a:hover { color: var(--accent); }
.pub-stale { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: rgba(255,106,61,.1); border: 1px solid rgba(255,106,61,.3); font-size: 13px; color: #ffb4a0; }
.pub-fresh { margin-top: 14px; font-size: 12.5px; color: var(--faint); }
.pub-error { margin-top: 12px; font-size: 13px; color: var(--danger); line-height: 1.45; }
.modal-actions .spacer { flex: 1; }
.card-meta .live { color: var(--ok); display: inline-flex; align-items: center; gap: 4px; }
.card-meta .live:hover { text-decoration: underline; }
.card-meta .live .icon { width: 12px; height: 12px; }

/* Ayarlar ve gelen kutusu */
.btn-icon { position: relative; }
.badge { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--panel); }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field .input { width: 100%; background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: 0; color: var(--text); }
.field .input:focus { border-color: rgba(255,106,61,.55); }
.field .hint { font-size: 12px; color: var(--faint); line-height: 1.45; }
.phone-row { display: flex; gap: 8px; }
.phone-row .cc-select { flex: none; width: 150px; background-color: var(--panel-2); color: var(--text); padding: 10px 28px 10px 10px; }
.phone-row .input { flex: 1; min-width: 0; }
.wa-preview b { color: var(--ok); font-family: var(--mono); }
.delivery { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.delivery-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.delivery-row .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--faint); }
.delivery-row.on { color: var(--text); }
.delivery-row.on .icon { color: var(--ok); }
.inbox-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; margin-top: 4px; }
.inbox-item { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.inbox-item.unread { border-color: rgba(255,106,61,.4); }
.inbox-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12.5px; color: var(--muted); }
.inbox-head b { color: var(--text); font-weight: 600; }
.inbox-head .when { margin-left: auto; color: var(--faint); }
.inbox-fields { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.inbox-fields dt { color: var(--muted); }
.inbox-fields dd { margin: 0; white-space: pre-wrap; word-break: break-word; }
.inbox-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.inbox-empty { text-align: center; color: var(--faint); font-size: 13.5px; padding: 28px 12px; line-height: 1.5; }
.pub-forms { margin-top: 14px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.pub-forms a { color: var(--accent); cursor: pointer; }

/* Hazırlanıyor ekranı */
.seg-sm button { padding: 4px 10px; font-size: 12.5px; }
.building { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; background: #0b0b0f; overflow-y: auto; padding: 24px; }
.building::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(60% 40% at 50% 0%, rgba(255,106,61,.14), transparent 70%); }
.building-card { position: relative; width: min(560px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 18px; padding: 26px 26px 20px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.building-head { text-align: center; margin-bottom: 20px; }
.building-head .eyebrow { margin-bottom: 14px; }
.building-title { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-bottom: 6px; }
.building-sub { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.step { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; font-size: 13.5px; color: var(--faint); transition: background .2s, color .2s; }
.step .mark { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; flex: none; font-size: 11px; color: var(--faint); }
.step .mark .icon { width: 12px; height: 12px; stroke-width: 3; }
.step .mark .spinner { width: 12px; height: 12px; }
.step.active { color: var(--text); background: var(--panel-2); }
.step.active .mark { border-color: var(--accent); }
.step.done { color: var(--muted); }
.step.done .mark { background: rgba(61,220,151,.15); border-color: rgba(61,220,151,.4); color: var(--ok); }
.step .detail { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.building-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; min-height: 26px; }
.building-files .chip-file { font-family: var(--mono); font-size: 11px; padding: 4px 9px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--border); color: var(--faint); display: inline-flex; align-items: center; gap: 5px; }
.building-files .chip-file.done { color: var(--muted); border-color: rgba(61,220,151,.3); }
.building-files .chip-file .icon { width: 10px; height: 10px; color: var(--ok); stroke-width: 3; }
.building-files .chip-file .spinner { width: 9px; height: 9px; }
.building-foot { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; font-size: 12px; color: var(--faint); }
.building-foot .sep { color: var(--border-strong); }
.reveal-in { animation: reveal .45s ease; }
@keyframes reveal { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }

/* Düzenleme sırasında ince üst çubuk: eski site ekranda kalır */
.updating { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 8px; padding: 7px 14px; font-size: 12.5px; color: var(--text); background: rgba(17,17,22,.92); border-bottom: 1px solid var(--border-strong); backdrop-filter: blur(6px); }
.updating::after { content: ''; position: absolute; left: 0; bottom: -1px; height: 2px; width: 40%; background: var(--accent-grad); animation: sweep 1.4s ease-in-out infinite; }
@keyframes sweep { 0% { left: 0; width: 20%; } 50% { width: 45%; } 100% { left: 80%; width: 20%; } }

/* Tıkla-düzenle paneli */
.inspector { position: absolute; right: 16px; bottom: 16px; z-index: 6; width: min(360px, calc(100% - 32px)); background: var(--panel); border: 1px solid var(--border-strong); border-radius: 14px; padding: 12px 14px 14px; box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.inspector-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.inspector-tag { font-family: var(--mono); font-size: 11.5px; padding: 2px 7px; border-radius: 6px; background: rgba(255,106,61,.14); color: var(--accent); }
.inspector-page { font-family: var(--mono); font-size: 11px; color: var(--faint); flex: 1; }
.inspector .field { margin-top: 10px; }
.inspector-text { resize: vertical; min-height: 60px; font-size: 13.5px; line-height: 1.45; }
.inspector-actions { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.inspector-actions .hint { font-size: 11.5px; color: var(--faint); }
.preview-tools .btn-icon.editing { color: var(--accent); border-color: rgba(255,106,61,.5); background: rgba(255,106,61,.12); }
.chat-composer .seg-sm button.active[data-mode="ask"] { color: var(--ok); }

/* Ziyaret istatistiği */
.stats { margin-top: 14px; }
.stats-loading { font-size: 12.5px; color: var(--faint); }
.stats-nums { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.stats-nums b { font-size: 18px; color: var(--text); margin-right: -8px; }
.stats-bars { display: flex; align-items: flex-end; gap: 4px; height: 30px; margin-top: 8px; }
.stats-bars i { flex: 1; background: rgba(255,106,61,.45); border-radius: 2px 2px 0 0; display: block; }

/* Hata pili ve son kontrol satırı */
.error-pill { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: rgba(255,90,90,.1); border-bottom: 1px solid rgba(255,90,90,.35); color: #ffb4b4; font-size: 12.5px; }
.error-pill > .icon { color: var(--danger); flex: none; }
.error-pill span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); font-size: 11.5px; }
.error-pill .btn-icon { color: var(--muted); }
.check-line { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.check-line span { display: grid; place-items: center; }
.check-line .icon { width: 12px; height: 12px; stroke-width: 3; }
.check-line.ok .icon { color: var(--ok); }
.check-line.warn .icon { color: #ffb347; }
.hist-meta { font-size: 12.5px; color: var(--muted); }

/* Üç tasarım */
.variants { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #0b0b0f; }
.variants-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.variants-head h2 { font-size: 17px; margin: 0 0 4px; letter-spacing: -.01em; }
.variants-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 620px; }
.variants-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 14px 16px 18px; overflow-y: auto; }
.variant { display: flex; flex-direction: column; min-height: 0; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.variant.ready { border-color: rgba(255,255,255,.18); }
.variant.chosen { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(255,106,61,.25); }
.variant.failed { opacity: .6; }
.variant-head { padding: 11px 13px 10px; border-bottom: 1px solid var(--border); }
.variant-name { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.variant-name .dot-key { width: 20px; height: 20px; border-radius: 6px; background: var(--panel-3); color: var(--muted); font-size: 11px; font-weight: 700; display: grid; place-items: center; text-transform: uppercase; flex: none; }
.variant.ready .dot-key { background: rgba(255,106,61,.16); color: var(--accent); }
.variant-hint { font-size: 11.5px; color: var(--faint); margin-top: 3px; }
.variant-frame { position: relative; flex: 1; min-height: 220px; background: #fff; overflow: hidden; }
.variant-frame iframe { position: absolute; top: 0; left: 0; width: 1280px; height: 1800px; border: 0; transform-origin: 0 0; }
.variant-frame .veil { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: #0f0f14; color: var(--muted); font-size: 12.5px; text-align: center; padding: 16px; }
.variant-frame .veil .file { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.variant-frame .veil .vsteps { display: flex; gap: 6px; margin-top: 4px; }
.variant-frame .veil .vsteps i { width: 26px; height: 4px; border-radius: 2px; background: var(--panel-3); display: block; }
.variant-frame .veil .vsteps i.done { background: var(--ok); }
.variant-frame .veil .vsteps i.active { background: var(--accent); }
.variant-foot { padding: 10px 12px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.variant-foot .btn { flex: 1; justify-content: center; }
.variant-foot .open { flex: none; }
.variant-err { font-size: 12px; color: var(--danger); padding: 0 12px 10px; }
@media (max-width: 1100px) { .variants-grid { grid-template-columns: 1fr; } .variant-frame { min-height: 320px; } }

/* Görseller */
.badge.muted { background: var(--panel-3); color: var(--muted); border-color: var(--panel); }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 4px 10px; }
.attach { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border-strong); background: var(--panel-3); }
.attach img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach .rm { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; display: grid; place-items: center; }
.attach .rm .icon { width: 12px; height: 12px; }
.attach .tag { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; text-align: center; background: rgba(0,0,0,.6); color: #fff; padding: 2px 0; }
.attach .tag.mode { cursor: pointer; }
.attach.ref { border-color: rgba(120,160,255,.6); }
.attach.ref .tag.mode { background: rgba(70,100,220,.85); }
.attach { width: 72px; height: 72px; }
.composer.drop-over { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,106,61,.2); }
.msg-thumbs { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 2px; }
.msg-thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-strong); }
.attach.busy::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.modal-card.wide { width: min(720px, calc(100% - 32px)); }

.lang-seg button { padding: 4px 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; }
.lang-seg button.active { color: var(--text); }

.auth-hint { color: var(--faint); font-size: 12px; text-align: left; margin: 12px 0 0; }
.dash-hero { position: relative; }
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: 18px; padding: 20px 20px 16px; text-align: left; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 3px rgba(255,106,61,.12); }
/* Giriş penceresi (ortada, Lovable tarzı) */
.auth-modal { text-align: center; padding: 6px 4px 0; }
.auth-modal .auth-brand .logo-mark { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; margin-bottom: 14px; }
.auth-modal .auth-brand .logo-mark .icon { width: 20px; height: 20px; }
.auth-kicker { color: var(--faint); font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.auth-modal h3 { font-size: 20px; margin: 2px 0 6px; }
.auth-modal .auth-sub { margin: 0 0 16px; }
.auth-modal .field { margin: 0 0 10px; }
.auth-modal .input { width: 100%; text-align: center; padding: 11px 12px; font-size: 14.5px; }
.auth-wide { width: 100%; justify-content: center; padding: 11px; font-size: 14.5px; }
.auth-code { font-size: 26px !important; letter-spacing: .35em; font-variant-numeric: tabular-nums; padding: 8px 0 8px .35em !important; }
.auth-row-links { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.auth-dev { color: var(--accent); font-size: 14px; font-weight: 600; margin: -6px 0 10px; }
.auth-modal .auth-hint { text-align: center; margin-top: 16px; }
.auth-modal .auth-hint a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.auth-modal .auth-hint a:hover { color: var(--text); }
.auth-modal .pub-error { margin-bottom: 10px; }
.auth-title { margin: 0 0 4px; font-size: 18px; padding-right: 28px; }
.auth-sub { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 0 14px; }
.auth-google { width: 100%; justify-content: center; padding: 10px; font-size: 14px; background: #fff; color: #1f1f1f; border-color: #fff; }
.auth-google:hover { background: #f2f2f2; color: #000; }
.auth-google .gicon { width: 18px; height: 18px; flex: none; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 12px; margin: 12px 0; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-sent p { font-size: 13.5px; line-height: 1.5; color: var(--text); margin: 0 0 12px; }
.auth-sent .btn { margin-right: 8px; }
.admin-list { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; margin-top: 12px; }
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 10px; font-size: 13px; }
.admin-who small { display: block; color: var(--faint); font-size: 11.5px; margin-top: 2px; }
.admin-credits { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.user-chip { display: inline-flex; align-items: center; gap: 10px; padding: 4px 4px 4px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; }
.user-name { color: var(--text); font-weight: 500; }
.user-credits { color: var(--ok); font-size: 12px; font-weight: 600; }

/* Bildirimler ve pencere */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; pointer-events: none; }
.toast { background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 14px; font-size: 13.5px; box-shadow: 0 16px 40px rgba(0,0,0,.5); animation: toast-in .2s ease; }
.toast.error { border-color: rgba(255,90,90,.4); color: #ffb4b4; }
.toast.ok { border-color: rgba(61,220,151,.35); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.55); backdrop-filter: blur(4px); }
.modal-card { width: min(460px, calc(100% - 32px)); max-height: calc(100% - 32px); overflow-y: auto; background: var(--panel); border: 1px solid var(--border-strong); border-radius: 16px; padding: 22px; box-shadow: 0 40px 100px rgba(0,0,0,.6); }
.modal-card h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.01em; }
.modal-card p { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.modal-input { width: 100%; background: var(--panel-2); border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 12px; font-size: 14px; outline: 0; margin-bottom: 16px; }
.modal-input:focus { border-color: rgba(255,106,61,.55); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal .btn-primary.danger { background: var(--danger); }

/* Dar ekranlar: sohbet ve önizleme sekmeli, alt çubuk */
.mobile-tabs { display: none; }
@media (max-width: 960px) {
  /* Sekme çubuğu DOM'da body'den önce; grid sırasını order ile en alta al.
     Sütun minmax(0,1fr): üst çubuk taşarsa tüm ızgarayı genişletmesin (595 px olmuştu). */
  #view-workspace { grid-template-rows: 52px 1fr 52px; grid-template-columns: minmax(0, 1fr); }
  #view-workspace .topbar { min-width: 0; overflow-x: auto; scrollbar-width: none; }
  #view-workspace .topbar::-webkit-scrollbar { display: none; }
  #view-workspace .topbar-right .select, #view-workspace .lang-seg { display: none; }
  .mobile-tabs { order: 3; }
  .body { grid-template-columns: 1fr; grid-template-rows: 1fr; min-height: 0; order: 2; }
  .body > .chat, .body > .preview { display: none; }
  .body[data-pane="chat"] > .chat, .body[data-pane="preview"] > .preview { display: flex; }
  .chat { border-right: 0; }
  .mobile-tabs { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border); background: var(--panel); }
  .mobile-tabs button { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: var(--muted); padding: 12px; }
  .mobile-tabs button.active { color: var(--text); box-shadow: inset 0 2px 0 var(--accent); }
  .mobile-tabs .icon { width: 17px; height: 17px; }
  .preview-bar { flex-wrap: wrap; gap: 8px; }
  .inspector { right: 8px; left: 8px; bottom: 8px; width: auto; }
  .variants-grid { grid-template-columns: 1fr; }
  .dash { padding: 0 16px 60px; }
  .composer-row { flex-wrap: wrap; }
  .composer-left { flex-wrap: wrap; }
  .crumb-sep, .project-name, .build-badge, .btn-label, .urlbar { display: none; }
  #view-workspace .topbar { padding: 0 10px; gap: 8px; }
  #view-workspace .topbar-right .select { max-width: 120px; padding-right: 26px; }
  #view-workspace .topbar-right { gap: 6px; }
  #view-workspace .btn { padding: 8px; }
  #view-workspace .logo span:not(.logo-mark) { display: none; }
  .code-area { grid-template-columns: 1fr; }
  .file-tree { display: none; }
  .dash-hero { padding: 40px 0 32px; }
}
