/* app.css — VEDUTA v2 görsel kimlik: glassmorphism, sıcak-mimari, yüzen paneller (worker 005) */
:root {
  --bg: #12141a; --bg2: #0d0f14;
  --glass: rgba(28, 31, 40, 0.72); --glass2: rgba(40, 44, 56, 0.55);
  --ink: #eef1ec; --muted: #9aa0a6; --line: rgba(255, 255, 255, 0.09); --line2: rgba(255, 255, 255, 0.16);
  --accent: #D57A66; --accent2: #C5A059; --sand: #EFECE6; --ok: #62d0a8; --soon: #C5A059; --danger: #d2503f;
  --r: 14px; --r-sm: 10px;
  --blur: blur(18px) saturate(1.2);
  --sh: 0 10px 40px rgba(0, 0, 0, 0.45); --sh-sm: 0 4px 18px rgba(0, 0, 0, 0.3);
  --ring: 0 0 0 3px rgba(213, 122, 102, 0.3);
  --ease: cubic-bezier(.175, .885, .32, 1.1);
  --canvasBg: #171a20;
}
[data-theme="light"] {
  --bg: #eceae3; --bg2: #e3e0d7;
  --glass: rgba(252, 251, 247, 0.78); --glass2: rgba(255, 255, 255, 0.6);
  --ink: #1a201d; --muted: #6b736c; --line: rgba(20, 25, 22, 0.1); --line2: rgba(20, 25, 22, 0.18);
  --accent: #b85c43; --accent2: #a87a35; --canvasBg: #f6f4ee;
  --sh: 0 10px 40px rgba(60, 55, 45, 0.16); --sh-sm: 0 4px 18px rgba(60, 55, 45, 0.1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(120% 100% at 70% 0%, var(--bg) 0%, var(--bg2) 100%);
  color: var(--ink); overflow: hidden;
  font-family: "Space Grotesk", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; transition: background .18s, border-color .18s, transform .12s var(--ease), box-shadow .18s, color .18s; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .38; cursor: default; }
:focus-visible { outline: none; box-shadow: var(--ring); }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; }
b, strong { font-weight: 700; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.glass { background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line); box-shadow: var(--sh); }

/* ---- TUVAL ZEMİNİ ---- */
.stage { position: fixed; top: 68px; left: 78px; right: 354px; bottom: 46px; display: flex; gap: 12px; z-index: 1; }
.canvas-card { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--canvasBg); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-sm); position: relative; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--glass2); backdrop-filter: blur(6px); }
.card-title b { font-size: 13.5px; } .card-title span { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.card-tools { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; align-items: center; min-width: 0; max-height: 74px; overflow-y: auto; }   /* P0: 45 buton tek satırda kırpılıyordu → sar + yükseklik sınırı (hiçbir buton erişilemez kalmasın); P1 çoğunu panele taşır */
.card-tools::-webkit-scrollbar { width: 6px; }
.protog { height: 28px; padding: 0 11px; border-radius: 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .6px; color: var(--muted); border: 1px solid var(--line); background: var(--glass2); }
.protog:hover { border-color: var(--line2); color: var(--ink); }
.protog.pro { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; border-color: transparent; box-shadow: var(--sh-sm); }

/* P1: 3D başlık ipucu + sağ panel "Çatı & Cephe Detayları" bölümü (eski 45-buton başlığının yeni evi) */
.ct-hint { font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: .3px; padding: 0 4px; white-space: nowrap; opacity: .8; }
.det-label { font-size: 10px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); margin: 11px 0 6px; }
.det-label:first-of-type { margin-top: 1px; }
.detail-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.detail-grid .protog { height: 26px; padding: 0 9px; font-size: 10.5px; letter-spacing: .3px; flex: 0 0 auto; }
.detcat { margin-top: 9px; border-top: 1px solid var(--line); padding-top: 8px; }
.detcat > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--ink); padding: 3px 0; user-select: none; }
.detcat > summary::-webkit-details-marker { display: none; }
.detcat > summary::before { content: "\25B8"; color: var(--muted); font-size: 11px; transition: transform .16s var(--ease); }
.detcat[open] > summary::before { transform: rotate(90deg); }
.detcat > summary:hover { color: var(--accent2); }
.detcat .detail-grid { margin-top: 8px; }
.dc-n { margin-left: auto; min-width: 16px; text-align: center; font-size: 9.5px; font-weight: 800; color: #fff; background: var(--accent); border-radius: 999px; padding: 1px 6px; opacity: 0; transition: opacity .15s; }
.dc-n.has { opacity: 1; }
#detailCount.has { background: var(--accent); color: #fff; border-color: transparent; }
.canvas-wrap { flex: 1; min-height: 0; position: relative; }
#planCanvas, #previewCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#planCanvas { cursor: crosshair; } body.tool-select #planCanvas { cursor: default; }
#previewCanvas { cursor: grab; } #previewCanvas:active { cursor: grabbing; }
.view-plan .three-card, .view-three .plan-card, .view-walk .plan-card { display: none; }
.view-elevation .three-card { display: none; }   /* KK1: CEPHE → plan-card tam genişlik (elevasyon planCanvas'a çizilir) */
.elev-bar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 3px; background: var(--glass2); padding: 3px; border-radius: 11px; border: 1px solid var(--line); box-shadow: var(--sh-sm); z-index: 4; }
.elev-dir { height: 30px; padding: 0 14px; border-radius: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.elev-dir.on { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; box-shadow: var(--sh-sm); }
.elev-dir:not(.on):hover { color: var(--ink); }
.walk-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(18,20,26,.92); color: #fff; padding: 7px 14px; border-radius: 999px; font-size: 12px; white-space: nowrap; box-shadow: var(--sh-sm); }
.walk-hint b { background: var(--accent); padding: 1px 6px; border-radius: 5px; margin: 0 1px; }

/* canlı ölçü etiketi (HTML overlay — net) */
.dim-tip { position: absolute; transform: translate(-50%, -50%); background: var(--accent); color: #fff; font: 600 12px/1 "Space Grotesk", Inter, monospace; padding: 5px 9px; border-radius: 7px; pointer-events: none; white-space: nowrap; box-shadow: var(--sh-sm); z-index: 5; font-variant-numeric: tabular-nums; }
.dim-tip span { opacity: .8; font-weight: 500; }
.dim-tip.typing { background: var(--accent2); }

/* ---- ÜST BAR ---- */
.topbar { position: fixed; top: 10px; left: 12px; right: 12px; height: 50px; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 0 12px; border-radius: var(--r); }
.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-weight: 800; font-size: 18px; }
.brand-t b { font-size: 15px; letter-spacing: .3px; } .brand-t span { display: block; font-size: 10.5px; color: var(--muted); }
.seg { display: flex; gap: 3px; margin: 0 auto; background: var(--glass2); padding: 3px; border-radius: 11px; border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 15px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg button.on { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; box-shadow: var(--sh-sm); }
.seg button:not(.on):hover { color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 5px; }
.sep { width: 1px; height: 24px; background: var(--line2); margin: 0 3px; }
.ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: var(--ink); border: 1px solid transparent; }
.ic:hover { background: var(--glass2); border-color: var(--line); }
.ic.on { background: var(--accent2); color: #fff; }
.btn-accent { height: 36px; padding: 0 16px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 7px; box-shadow: var(--sh-sm); }
.btn-accent:hover { filter: brightness(1.06); }
.soon { width: 7px; height: 7px; border-radius: 50%; background: var(--sand); box-shadow: 0 0 0 2px rgba(255,255,255,.3); }

/* ---- SOL DOCK ---- */
.dock { position: fixed; left: 12px; top: 72px; z-index: 20; display: flex; flex-direction: column; gap: 5px; padding: 7px; border-radius: 16px; }
.tool { width: 48px; height: 48px; border-radius: 11px; display: grid; place-items: center; color: var(--ink); border: 1px solid transparent; }
.tool:hover { background: var(--glass2); border-color: var(--line); }
.tool.on { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; box-shadow: var(--sh-sm); }
.tool.danger.on { background: var(--danger); }
.dock-sep { height: 1px; background: var(--line2); margin: 3px 6px; }

/* ---- SAĞ PANEL ---- */
.panel { position: fixed; right: 12px; top: 72px; bottom: 52px; width: 330px; z-index: 20; display: flex; flex-direction: column; border-radius: var(--r); overflow: hidden; }
.panel-scroll { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.blk { background: var(--glass2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px; }
.blk-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.blk-h b { font-size: 13.5px; } .blk-h span, #selBadge, #floorBadge { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 11px; }
.stat { text-align: center; background: var(--glass); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 2px; }
.stat b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; } .stat span { font-size: 10px; color: var(--muted); }
.proj { width: 100%; height: 38px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--glass); padding: 0 11px; font-weight: 700; font-size: 15px; margin-bottom: 9px; }
.row-btns { display: flex; gap: 7px; }
.floor-row { display: flex; gap: 7px; align-items: center; }
.floor-row .fb { flex: 0 0 38px; font-size: 14px; }
.floor-name { flex: 1; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--glass); padding: 0 11px; font-weight: 700; font-size: 13.5px; color: var(--ink); text-align: center; }
.mini { flex: 1; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: var(--glass); font-size: 12.5px; font-weight: 600; color: var(--ink); }
.mini:hover { border-color: var(--line2); background: var(--glass2); }
.prop-empty { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.prop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.prop-grid.full { grid-template-columns: 1fr; }
.prop-grid label, .field { color: var(--muted); font-size: 11px; font-weight: 700; display: block; }
.prop-grid input, .prop-grid select, .field input { width: 100%; height: 34px; margin-top: 5px; padding: 0 9px; border-radius: 9px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); }
.prop-act { display: flex; gap: 7px; margin-top: 10px; }
.prop-act button { flex: 1; height: 33px; border-radius: 9px; border: 1px solid var(--line); background: var(--glass); font-size: 12px; font-weight: 600; }
.prop-act .del { background: var(--danger); color: #fff; border-color: var(--danger); }
.prop-row.wmat { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 11px; font-weight: 700; color: var(--muted); }
#pWmat { display: flex; gap: 5px; margin-left: auto; }
#pWmat button { padding: 5px 11px; border-radius: 8px; border: 1px solid var(--line); background: var(--glass); color: var(--ink); font-size: 11px; font-weight: 600; cursor: pointer; }
#pWmat button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--glass); outline: 1px solid var(--line); background: var(--c); }
.sw.on { outline: 2px solid var(--accent); transform: scale(1.1); }
.hint { color: var(--muted); font-size: 10.5px; margin: 9px 0 0; line-height: 1.4; }
/* BOM / metraj-maliyet kartı */
.bom-metraj { border-bottom: 1px solid var(--line); padding-bottom: 7px; margin-bottom: 7px; }
.bom-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bom-row b { color: var(--ink); font-weight: 700; }
.bom-line { display: flex; align-items: baseline; gap: 8px; padding: 2px 0; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bom-line > span:first-child { flex: 1; min-width: 0; }
.bom-line .bq { font-size: 10.5px; opacity: .75; white-space: nowrap; }
.bom-line b { color: var(--ink); min-width: 64px; text-align: right; font-weight: 700; }
.bom-total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line2); font-size: 13px; font-variant-numeric: tabular-nums; }
.bom-total span { font-weight: 700; } .bom-total b { color: var(--accent2); font-weight: 800; }
.mode { width: 100%; height: 40px; display: flex; align-items: center; gap: 9px; padding: 0 11px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--glass); font-size: 13px; font-weight: 600; margin-bottom: 7px; color: var(--ink); position: relative; }
.mode:last-child { margin-bottom: 0; } .mode:hover { border-color: var(--line2); }
.soon-tag { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--soon); border: 1px solid color-mix(in srgb, var(--soon) 50%, transparent); border-radius: 999px; padding: 2px 7px; }
.dev { background: var(--glass2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px; }
.dev summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted); }
.dev .row-btns { margin: 10px 0; } #schemaText { width: 100%; height: 150px; border-radius: 9px; border: 1px solid var(--line); background: var(--glass); padding: 9px; font: 11px/1.45 ui-monospace, Menlo, monospace; color: var(--ink); resize: vertical; }

/* katalog (panelin altında) */
.catalog { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.cat-head { display: flex; align-items: center; gap: 8px; }
#catSearch { flex: 1; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: var(--glass); padding: 0 10px; color: var(--ink); }
#catCount { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cat-tabs { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 2px; }
.cat-tab { height: 27px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); font-size: 11.5px; font-weight: 600; white-space: nowrap; color: var(--muted); }
.cat-tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; max-height: 184px; overflow-y: auto; }
.cat-card { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--glass); overflow: hidden; cursor: grab; display: flex; flex-direction: column; text-align: left; transition: transform .12s var(--ease), border-color .18s, box-shadow .18s; }
.cat-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--sh-sm); }
.cat-card:active { cursor: grabbing; }
.cat-card .thumb-svg { width: 100%; height: 50px; transition: transform .16s var(--ease), filter .16s; }
.cat-card:hover .thumb-svg { transform: scale(1.18); filter: drop-shadow(0 2px 5px color-mix(in srgb, var(--accent) 38%, transparent)); }
.cat-card .glb-thumb { width: 100%; height: 50px; object-fit: contain; display: block; transition: transform .16s var(--ease), filter .16s; }
.cat-card:hover .glb-thumb { transform: scale(1.12); filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }
.cat-thumb { position: relative; background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 8%, var(--glass)), var(--glass)); border-bottom: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.glb-badge { position: absolute; top: 3px; right: 3px; z-index: 1; font: 700 8px/1 Inter, sans-serif; letter-spacing: .04em; padding: 2px 4px; border-radius: 4px; color: #0d0f14; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff)); box-shadow: 0 1px 3px rgba(0,0,0,.35); pointer-events: none; }
.cat-info { padding: 5px 7px; } .cat-info b { display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .cat-info span { font-size: 9.5px; color: var(--muted); }
.cat-card.tool .cat-thumb { background: color-mix(in srgb, var(--accent) 12%, var(--glass)); }

/* M1: yüzen kart önizleme (body'e iliştirilir → overflow kırpmaz) */
.cat-preview { position: fixed; z-index: 70; width: 188px; border-radius: var(--r-sm); background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line2); box-shadow: var(--sh); pointer-events: none; overflow: hidden; animation: cpIn .14s var(--ease); }
.cat-preview .cp-visual { position: relative; height: 150px; display: grid; place-items: center; background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--accent) 10%, var(--glass)), var(--glass)); border-bottom: 1px solid var(--line); }
.cat-preview .cp-visual svg, .cat-preview .cp-visual img { width: 84%; height: 84%; object-fit: contain; }
.cat-preview .cp-visual .glb-badge { font-size: 9px; padding: 3px 5px; }
.cat-preview .cp-info { padding: 9px 11px; }
.cat-preview .cp-info b { display: block; font-size: 13px; }
.cat-preview .cp-info span { font-size: 10.5px; color: var(--muted); }
@keyframes cpIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---- DURUM ---- */
.status { position: fixed; left: 12px; right: 354px; bottom: 8px; height: 32px; z-index: 20; display: flex; align-items: center; gap: 0; padding: 0 12px; border-radius: 11px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.status > * { padding: 0 11px; border-right: 1px solid var(--line); height: 32px; display: inline-flex; align-items: center; white-space: nowrap; }
.status > *:first-child { padding-left: 0; }
.st-tog { background: none; color: var(--muted); border-radius: 0; } .st-tog.on { color: var(--accent2); font-weight: 600; }
.sp { flex: 1; border: none; } .st-brand { border: none; opacity: .8; }

/* ---- toast / modal ---- */
.toast { position: fixed; left: 50%; bottom: 50px; transform: translateX(-50%) translateY(14px); opacity: 0; pointer-events: none; z-index: 60; background: rgba(18,20,26,.95); color: #fff; padding: 10px 16px; border-radius: 11px; box-shadow: var(--sh); font-size: 13px; transition: opacity .22s, transform .22s var(--ease); border: 1px solid var(--line2); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: color-mix(in srgb, var(--ok) 88%, #000); } .toast.warn { background: color-mix(in srgb, var(--accent) 90%, #000); }
.modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(8,10,14,.55); display: grid; place-items: center; padding: 20px; }
.modal { width: min(520px, 100%); max-height: 84vh; overflow: auto; border-radius: 18px; }
.modal-h { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); } .modal-h b { font-size: 17px; }
.modal-b { padding: 18px; font-size: 13.5px; line-height: 1.6; } .modal-b p { margin: 0 0 10px; color: var(--muted); }
.modal-act { display: flex; gap: 9px; justify-content: flex-end; margin-top: 8px; }
.modal-act .btn-accent { color: #fff; }
.kbd { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; }
.kbd kbd { justify-self: start; background: var(--glass); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 6px; padding: 3px 7px; font: 600 11.5px ui-monospace, Menlo, monospace; }
.gal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.gal-card { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--glass); overflow: hidden; cursor: pointer; transition: transform .12s var(--ease), border-color .18s; }
.gal-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.gal-thumb { display: grid; place-items: center; padding: 12px; background: var(--glass2); border-bottom: 1px solid var(--line); }
.gal-thumb svg { width: 100%; height: 56px; } .gal-card b { display: block; padding: 8px 10px 2px; font-size: 12.5px; } .gal-card span { display: block; padding: 0 10px 9px; font-size: 10.5px; color: var(--muted); }

/* ---- P2: komut paleti (⌘/Ctrl-K) ---- */
.cmdk-bg { position: fixed; inset: 0; z-index: 90; background: rgba(8, 10, 14, .5); display: grid; align-items: start; justify-items: center; padding: 12vh 16px 16px; animation: cpIn .12s var(--ease); }
.cmdk { width: min(580px, 100%); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; max-height: 64vh; }
.cmdk input { height: 52px; border: none; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); padding: 0 18px; font-size: 16px; font-weight: 600; outline: none; }
.cmdk input::placeholder { color: var(--muted); font-weight: 500; }
.cmdk-list { overflow-y: auto; padding: 7px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.cmdk-item .cmdk-lbl { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item .cmdk-grp { margin-left: auto; font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; white-space: nowrap; flex: 0 0 auto; }
.cmdk-item.sel { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.cmdk-item.sel .cmdk-grp { color: #fff; border-color: rgba(255, 255, 255, .4); }
.cmdk-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---- P4: mirror-DOM erişilebilirlik katmanı (görsel-gizli; odaklanınca açılır panel) ---- */
.sr-only { position: fixed; left: -10000px; top: 0; width: 1px; height: 1px; overflow: hidden; }
.sr-only:focus-within { left: 12px; top: 128px; width: 300px; height: auto; max-height: 58vh; overflow-y: auto; z-index: 88; padding: 12px 14px; border-radius: var(--r); background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); border: 1px solid var(--line2); box-shadow: var(--sh); }
#a11yMirror p { font-size: 11.5px; color: var(--muted); line-height: 1.5; margin: 0 0 8px; }
#a11yMirror ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
#a11yMirror li { font-size: 12px; color: var(--muted); }
#a11yMirror button { width: 100%; text-align: left; padding: 6px 9px; border-radius: 8px; border: 1px solid var(--line); background: var(--glass2); color: var(--ink); font-size: 12px; font-weight: 600; }
#a11yMirror button:hover, #a11yMirror button:focus-visible { border-color: var(--accent); }

/* ---- P3: onboarding tanıtım turu (spotlight + kart) ---- */
.coach { position: fixed; inset: 0; z-index: 95; pointer-events: none; }
.coach[hidden] { display: none; }
.coach-spot { position: fixed; border-radius: 11px; box-shadow: 0 0 0 9999px rgba(8, 10, 14, .66); transition: left .26s var(--ease), top .26s var(--ease), width .26s var(--ease), height .26s var(--ease); }
.coach-card { position: fixed; left: 50%; transform: translateX(-50%); bottom: 74px; width: min(420px, 92vw); border-radius: 14px; padding: 16px 18px; z-index: 96; pointer-events: auto; animation: cpIn .18s var(--ease); }
.coach-card.top { bottom: auto; top: 84px; }
.coach-card b { font-size: 15px; display: block; }
.coach-card p { margin: 7px 0 13px; font-size: 13px; color: var(--muted); line-height: 1.55; }
.coach-foot { display: flex; align-items: center; gap: 9px; }
.coach-foot #coachStep { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.coach-foot .mini { flex: 0 0 auto; width: auto; padding: 0 15px; margin-left: auto; }
.coach-foot .btn-accent { flex: 0 0 auto; }

/* ---- duyarlı ---- */
.sheet-handle { display: none; }   /* masaüstünde gizli; P4c mobil bottom-sheet tutamağı */

/* tablet (901–1100): panel daralır, durum çubuğu gizlenir */
@media (max-width: 1100px) and (min-width: 901px) {
  .stage { right: 300px; } .panel { width: 286px; } .status { right: 300px; }
}

/* P4c: telefon/küçük tablet (≤900px) — sağ panel = aşağıdan açılan BOTTOM-SHEET (tutamağa dokun) */
@media (max-width: 900px) {
  body { overflow: hidden; }
  .topbar { flex-wrap: wrap; height: auto; gap: 8px; padding-bottom: 7px; } .seg { order: 3; width: 100%; margin: 0; justify-content: center; }
  .stage { position: fixed; left: 8px; right: 8px; top: 104px; bottom: 8px; margin: 0; gap: 8px; height: auto; flex-direction: column; }
  .dock { position: fixed; left: 8px; right: auto; top: auto; bottom: 70px; flex-direction: row; justify-content: flex-start; gap: 4px; padding: 6px; z-index: 45; }
  .dock-sep { width: 1px; height: 28px; margin: 0 3px; }
  .status { display: none; }
  .panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 84vh; margin: 0; border-radius: 18px 18px 0 0; transform: translateY(calc(100% - 56px)); transition: transform .32s var(--ease); z-index: 50; }
  .panel.sheet-open { transform: translateY(0); }
  .sheet-handle { display: flex; align-items: center; justify-content: center; height: 32px; flex: 0 0 auto; background: none; border: none; }
  .sheet-grip { width: 40px; height: 5px; border-radius: 999px; background: var(--line2); }
}

/* ---- boş-durum ipucu + dokunmatik/erişilebilirlik cilası ---- */
#planCanvas, #previewCanvas { touch-action: none; }   /* dokunmatik sürükleme sayfayı kaydırmasın */
.empty-hint {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px;
  text-align: center; padding: 22px; pointer-events: none; color: var(--ink);
}
.empty-hint[hidden] { display: none; }
.empty-hint b { font: 700 17px Inter, sans-serif; }
.empty-hint p { max-width: 340px; font-size: 13px; color: var(--muted, #9aa0a6); line-height: 1.6; margin: 0; }
.empty-hint kbd { font: 600 12px ui-monospace, Menlo, monospace; background: var(--glass2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
@media (pointer: coarse) {            /* dokunmatik: 44px hedef (WCAG 2.5.5) */
  .ic { width: 44px; height: 44px; }
  .mini { height: 44px; }
  .seg button { min-height: 44px; }
}

/* ============================================================
   P5: GÖRSEL SİSTEM CİLASI — tasarım-token ölçeği + dark elevation (açık yüzey, Material) + crafted highlight + tipografi ritmi
   ============================================================ */
:root {
  /* tipografi ölçeği (modüler ~1.18) */
  --fs-2xs: 10px; --fs-xs: 11.5px; --fs-sm: 13px; --fs-md: 15px; --fs-lg: 18px; --fs-xl: 23px;
  /* boşluk ölçeği (4px tabanlı) */
  --sp-1: 4px; --sp-2: 7px; --sp-3: 10px; --sp-4: 14px; --sp-5: 20px;
  /* dark elevation: üst-katman daha AÇIK yüzey (gölge değil ışık ile derinlik) + ışık-çizgisi highlight */
  --elev3: rgba(50, 54, 67, 0.9); --hl: rgba(255, 255, 255, 0.06); --hl-strong: rgba(255, 255, 255, 0.16);
  --sh-pop: 0 20px 64px rgba(0, 0, 0, 0.52), 0 2px 10px rgba(0, 0, 0, 0.34);
}
[data-theme="light"] { --elev3: rgba(255, 255, 255, 0.94); --hl: rgba(255, 255, 255, 0); --hl-strong: rgba(255, 255, 255, 0.5); --sh-pop: 0 20px 64px rgba(60, 55, 45, 0.22), 0 2px 10px rgba(60, 55, 45, 0.12); }

/* yüzen / üst-katman = belirgin daha açık yüzey + derin gölge → net z-hiyerarşi */
.modal, .cmdk, .cat-preview, .coach-card { background: var(--elev3); box-shadow: var(--sh-pop); }
/* crafted: yükseltilmiş kartlarda üst kenar ışık çizgisi (dokunsal/zanaat hissi) */
.blk, .stat, .cat-card, .gal-card, .mode, .dev { box-shadow: var(--sh-sm), inset 0 1px 0 var(--hl); }
/* düz çipler: yalnız ince üst ışık (gölge yok → düz kalır) */
.protog, .mini, .cat-tab, .floor-name, .proj { box-shadow: inset 0 1px 0 var(--hl); }
/* aktif/vurgulu öğeler: gradyan üstünde güçlü iç ışık → cam/parlak his */
.protog.pro, .seg button.on, .tool.on, .btn-accent, .cmdk-item.sel { box-shadow: var(--sh-sm), inset 0 1px 0 var(--hl-strong); }
/* tipografi ritmi: başlıklarda hafif sıkı tracking, etiketlerde geniş, sayılarda tabular + sıkı */
.brand-t b, .card-title b, .blk-h b, .modal-h b, .coach-card b, .empty-hint b { letter-spacing: -0.01em; }
.det-label, .cat-info span, .hint { letter-spacing: 0.02em; }
.stat b { letter-spacing: -0.02em; font-feature-settings: "tnum" 1; }
/* odak halkası: tutarlı + üst ışık korunur */
:focus-visible { box-shadow: var(--ring); }
.blk:focus-within { border-color: var(--line2); }
