/* Açık tema (varsayılan, web sitesi gibi). Koyu tema: html[data-tema="koyu"] */
:root {
  --bg: #f3f4f7;
  --bg2: #ffffff;
  --bg3: #eef0f4;
  --line: #e1e4ea;
  --text: #1c2230;
  --muted: #6b7384;
  --accent: #f0620c;
  --accent2: #ff8a3d;
  --acc-yumusak: #fff1e8;
  --mor: #7c4dff;
  --ok: #12a66a;
  --err: #e5484d;
  --canvas: #e8eaef;
  --golge: 0 1px 2px rgba(16,24,40,.06), 0 4px 14px rgba(16,24,40,.08);
  --golge2: 0 12px 40px rgba(16,24,40,.18);
  --ust-bg: linear-gradient(90deg, #1f1147 0%, #3b1c8c 45%, #f0620c 130%);
  --ust-yazi: #ffffff;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  color-scheme: light;
}
html[data-tema="koyu"] {
  --bg: #1f2329;
  --bg2: #262b32;
  --bg3: #2e343c;
  --line: #3a414b;
  --text: #e6e9ee;
  --muted: #9aa3ae;
  --accent: #ff7a1a;
  --accent2: #ff9a4d;
  --acc-yumusak: rgba(255,122,26,.14);
  --ok: #3ecf8e;
  --err: #ff5d5d;
  --canvas: #15181c;
  --golge: 0 4px 16px rgba(0,0,0,.35);
  --golge2: 0 20px 50px rgba(0,0,0,.5);
  --ust-bg: linear-gradient(90deg, #17121f 0%, #241a3d 60%, #3a2414 120%);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; user-select: none; }
.hidden { display: none !important; }
.spacer { flex: 1; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 35%, transparent); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--muted) 60%, transparent); }
::-webkit-scrollbar-track { background: transparent; }

#app {
  --ck: 0px; --pw: 296px;
  display: grid; height: 100vh;
  grid-template-columns: 76px var(--ck) minmax(0, 1fr) var(--pw);
  grid-template-rows: 54px 46px minmax(0, 1fr) 32px;
  grid-template-areas: "top top top top" "rail ck prop prop" "rail ck stage panel" "rail ck status status";
}
#app.ck-acik { --ck: 344px; }
#app.panelsiz { --pw: 0px; }
#app.panelsiz #panel { display: none; }

/* ---------------- sol menü (Canva tarzı) */
#rail { grid-area: rail; background: var(--bg2); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; padding: 8px 0; gap: 2px; overflow-y: auto; scrollbar-width: none; }
.rl { width: 66px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 7px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 600 11px "Segoe UI"; cursor: pointer; }
.rl svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rl:hover { color: var(--text); background: var(--bg3); }
.rl.on { color: var(--accent); background: var(--acc-yumusak); }
.rl.ai svg { stroke: url(#rlGrad); }
.rl.ur:not(.on) svg { stroke: var(--accent); }
/* Üretim çekmecesi: dizme formu ve önizleme */
.ur-makine { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); }
.ur-makine > svg { width: 26px; height: 26px; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--accent); flex: none; }
.ur-makine div { flex: 1; min-width: 0; display: flex; flex-direction: column; } .ur-makine b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .ur-makine small { color: var(--muted); font-size: 11.5px; }
.ur-alan { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.ur-alan select { width: 100%; }
.ur-ikili { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ur-ikili label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin: 0; }
.ur-ikili input, .ur-ikili select { width: 100%; box-sizing: border-box; }
.ur-chk { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-direction: row !important; } .ur-chk small { color: var(--muted); display: block; font-size: 11.5px; }
#ckIcerik > * { flex-shrink: 0; }
.ur-onizleme { width: 100%; height: 190px; border-radius: 12px; background: var(--bg3); display: block; }
.ur-sonuc { font-size: 13px; line-height: 1.5; text-align: center; min-height: 20px; }
.rl-alt { margin-top: auto; }
#cekmece { grid-area: ck; background: var(--bg2); border-right: 1px solid var(--line); display: none; flex-direction: column; min-width: 0; overflow: hidden; }
#app.ck-acik #cekmece { display: flex; }
.ck-ust { display: flex; align-items: center; padding: 14px 14px 6px 18px; }
.ck-ust h2 { margin: 0; font-size: 17px; font-weight: 700; flex: 1; }
#ckKapat { width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--bg3); color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
#ckKapat:hover { color: var(--text); }
#ckIcerik { flex: 1; overflow-y: auto; padding: 6px 14px 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.ck-ara { position: relative; }
.ck-ara input { width: 100%; padding: 10px 12px 10px 36px !important; border-radius: 10px !important; background: var(--bg3) !important; border: 1px solid transparent !important; font-size: 14px !important; }
.ck-ara input:focus { border-color: var(--accent) !important; background: var(--bg2) !important; }
.ck-ara svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2; }
.ck-baslik { display: flex; align-items: baseline; justify-content: space-between; font-weight: 700; font-size: 14px; margin-top: 4px; }
.ck-baslik a { font-weight: 600; font-size: 12px; color: var(--accent); cursor: pointer; }
.ck-cipler { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.ck-cip { flex: none; border: 1px solid var(--line); background: var(--bg2); color: var(--text); border-radius: 999px; padding: 5px 12px; font: 600 12px "Segoe UI"; cursor: pointer; }
.ck-cip:hover { border-color: var(--muted); }
.ck-cip.on { background: var(--text); color: var(--bg2); border-color: var(--text); }
.ck-izgara { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ck-izgara.uc { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.og-bolumler { display: flex; flex-direction: column; gap: 10px; }
.me-izgara { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.me-izgara .ck-res img { box-shadow: none; }
.ck-renkler { display: flex; flex-wrap: wrap; gap: 8px; }
.ck-renk { width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); transition: transform .12s; }
.ck-renk:hover { transform: scale(1.1); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15), 0 0 0 2px var(--accent); }
.ck-sec { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg2); color: var(--text); font: inherit; }
.ck-kart { position: relative; display: flex; flex-direction: column; gap: 6px; border: 0; background: none; padding: 0; color: var(--text); text-align: left; font: inherit; cursor: pointer; min-width: 0; }
.ck-res { aspect-ratio: 4 / 3; border-radius: 10px; background: var(--bg3); display: grid; place-items: center; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); transition: transform .12s, box-shadow .12s; }
.ck-res img { max-width: 92%; max-height: 92%; object-fit: contain; display: block; border-radius: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.ck-res svg { width: 46%; height: 46%; }
.ck-kart:hover .ck-res { transform: translateY(-2px); box-shadow: inset 0 0 0 2px var(--accent), var(--golge); }
.ck-kart .ad { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ck-kart .rozet { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 6px; }
.ck-bos { color: var(--muted); font-size: 13px; line-height: 1.5; padding: 10px 2px; }
.ck-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 11px 14px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font: 600 14px "Segoe UI"; cursor: pointer; }
.ck-btn:hover { filter: brightness(1.06); }
.ck-btn.ikinci { background: var(--bg3); color: var(--text); }
.ck-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ck-metin { display: flex; flex-direction: column; gap: 8px; }
.ck-metin button { text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); color: var(--text); padding: 12px 14px; cursor: pointer; font-family: "Segoe UI"; }
.ck-metin button:hover { border-color: var(--accent); box-shadow: var(--golge); }
.ck-metin .m1 { font-size: 26px; font-weight: 800; }
.ck-metin .m2 { font-size: 18px; font-weight: 600; }
.ck-metin .m3 { font-size: 13px; }
.ck-ikili { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ck-ikili button { border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); color: var(--text); padding: 14px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 76px; justify-content: center; overflow: hidden; }
.ck-ikili button:hover { border-color: var(--accent); }
.ck-ikili button small { color: var(--muted); font-size: 11px; }
.ck-uyg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ck-uyg button { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); color: var(--text); padding: 10px; cursor: pointer; font: inherit; font-size: 12.5px; line-height: 1.3; min-width: 0; }
.ck-uyg button:hover:not(:disabled) { border-color: var(--accent); box-shadow: var(--golge); }
.ck-uyg button:disabled { opacity: .45; cursor: default; }
.ck-uyg .ui { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; }
.ck-uyg .ut { min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.ck-tek { grid-column: 1 / -1; }
#ckIcerik #hvPanel { position: static; width: auto; box-shadow: none; border: 0; padding: 0; background: none; flex: 1; min-height: 0; }
#ckIcerik #hvPanel .hv-ust { display: none; }
#ckIcerik #hvPanel .hv-alt2 { flex-wrap: wrap; }
#ckIcerik:has(#hvPanel:not(.gizli)) { overflow: hidden; }
.yk-liste { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.yk-oge { position: relative; aspect-ratio: 1; border-radius: 10px; background: var(--bg3) center / contain no-repeat; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.yk-oge:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.yk-oge span { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 6px; font-size: 11px; background: linear-gradient(transparent, rgba(0,0,0,.6)); color: #fff; border-radius: 0 0 10px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yk-birak { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); line-height: 1.5; }
.yz-kutu textarea { width: 100%; min-height: 110px; border-radius: 12px !important; padding: 12px !important; font-size: 14px !important; background: var(--bg3) !important; }
.yz-oneri { display: flex; flex-wrap: wrap; gap: 6px; }
.ck-ipucu { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }

/* ---------------- indir menüsü */
.ust-btn { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.12); color: var(--ust-yazi); font: 600 13px "Segoe UI"; cursor: pointer; }
.ust-btn:hover { background: rgba(255,255,255,.22); }
.ust-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#indirMenu { position: fixed; z-index: 300; width: 340px; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--golge2); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
#indirMenu h4 { margin: 0 0 4px; font-size: 15px; }
#indirMenu .im { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; border: 0; background: none; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
#indirMenu .im:hover { background: var(--bg3); }
#indirMenu .im b { display: block; font-size: 13px; }
#indirMenu .im small { color: var(--muted); font-size: 11.5px; }
#indirMenu .im i { flex: none; width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 11px; color: #fff; }
#indirMenu .im.onerilen { background: var(--acc-yumusak); }

/* ---------------- belge adı */
#belge { display: flex; align-items: center; gap: 8px; min-width: 0; }
#belgeAd { width: 230px; max-width: 30vw; background: transparent !important; border: 1px solid transparent !important; color: var(--ust-yazi) !important; font: 600 14px "Segoe UI" !important; padding: 5px 9px !important; border-radius: 7px !important; text-overflow: ellipsis; }
#belgeAd:hover { border-color: rgba(255,255,255,.35) !important; }
#belgeAd:focus { background: rgba(255,255,255,.14) !important; border-color: rgba(255,255,255,.6) !important; }
#kayitDurum { color: rgba(255,255,255,.7); font-size: 12px; white-space: nowrap; display: flex; align-items: center; gap: 5px; }
#kayitDurum svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------- özellik çubuğu (seçime göre değişir) */
#propbar { grid-area: prop; display: flex; align-items: center; gap: 2px; padding: 0 10px; background: var(--bg2); border-bottom: 1px solid var(--line); overflow: hidden; white-space: nowrap; box-shadow: 0 1px 3px rgba(16,24,40,.04); z-index: 4; }
#propbar svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pbmid { display: flex; align-items: center; gap: 2px; min-width: 0; overflow: hidden; }
.pb { width: 30px; height: 28px; display: grid; place-items: center; background: none; border: 0; border-radius: 6px; color: var(--text); cursor: pointer; flex: none; }
.pb:hover { background: var(--bg3); }
.pb.tog { color: var(--muted); }
.pb.tog.on { color: var(--accent); background: rgba(255,122,26,.12); }
.pbgrp { display: flex; gap: 2px; }
.pbgrp.kapali { opacity: .35; pointer-events: none; }
.pbsep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; flex: none; }
.pbmak { display: flex; align-items: center; gap: 7px; background: var(--bg3); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 4px 10px; font: inherit; cursor: pointer; max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.pbmak:hover { border-color: var(--accent); }
.pbmak b { color: var(--accent2); font-weight: 600; }
.pbl { flex-direction: row; align-items: center; gap: 5px; color: var(--muted); }
.pbl input[type=number] { width: 72px; padding: 3px 6px; }
#pbGrid { width: 58px; }
.pbipucu { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- cetveller */
.ruler { position: absolute; display: block; z-index: 2; cursor: default; }
.ruler.rtop { left: 22px; top: 0; cursor: ns-resize; }
.ruler.rleft { left: 0; top: 22px; cursor: ew-resize; }
.rcorner { position: absolute; left: 0; top: 0; width: 22px; height: 22px; background: var(--bg2); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); z-index: 3; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.rcorner svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.rcorner:hover { color: var(--accent); }
#app.cetvelsiz .ruler, #app.cetvelsiz .rcorner { display: none; }

/* ---------------- makine seçimi ve başlangıç ekranı */
.mk-turler, .bs-turler { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mk-tur, .bs-tur { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; text-align: left; background: var(--bg3); color: var(--text); border: 1px solid var(--line); border-radius: 9px; padding: 12px; font: inherit; cursor: pointer; }
.mk-tur:hover, .bs-tur:hover { border-color: var(--accent); }
.mk-tur.active { border-color: var(--accent); background: rgba(255,122,26,.12); }
.mk-tur svg, .bs-tur svg { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.mk-tur b, .bs-tur b { font-size: 14px; }
.mk-tur span, .bs-tur span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.mk-liste { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.mbox.mk-kutu { max-width: min(820px, 95vw); width: min(820px, 95vw); }
.mbox.bs-kutu { max-width: min(860px, 95vw); width: min(860px, 95vw); }
.bs-tur { padding: 16px; min-height: 130px; }
.bs-tur svg { width: 38px; height: 38px; }
.bs-alt { margin-top: 0; }
.bs-alt-satir { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.bs-chk { margin-top: 0 !important; }

/* ---------------- üst çubuk */
#topbar { grid-area: top; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: var(--ust-bg); color: var(--ust-yazi); position: relative; z-index: 30; }
.brand { display: flex; align-items: center; gap: 9px; font: 800 15px "Segoe UI"; letter-spacing: .2px; margin-right: 8px; padding: 6px 10px 6px 6px; border: 0; border-radius: 9px; background: none; color: inherit; cursor: pointer; }
.brand:hover { background: rgba(255,255,255,.12); }
.brand-mark { width: 24px; height: 24px; border-radius: 7px; background: conic-gradient(from 210deg, #ff7a1a, #ffd166, #ff3d7f, #7c4dff, #ff7a1a); box-shadow: 0 0 0 2px rgba(255,255,255,.25); }
#menubar { display: flex; }
.menu { position: relative; }
.menu > button { background: none; border: 0; color: rgba(255,255,255,.9); padding: 7px 9px; border-radius: 7px; font: 500 13px "Segoe UI"; cursor: pointer; }
.menu > button:hover, .menu.open > button { background: rgba(255,255,255,.14); color: #fff; }
.dropdown { position: absolute; top: calc(100% + 4px); left: 0; min-width: 270px; white-space: nowrap; background: var(--bg2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: var(--golge2); z-index: 50; display: none; max-height: calc(100vh - 70px); overflow-y: auto; }
.menu.open .dropdown { display: block; }
.mi { display: flex; align-items: center; width: 100%; background: none; border: 0; color: var(--text); padding: 7px 10px; border-radius: 7px; font: inherit; text-align: left; cursor: pointer; }
.mi:hover:not(:disabled) { background: var(--acc-yumusak); color: var(--text); }
.mi:disabled { color: color-mix(in srgb, var(--muted) 60%, transparent); cursor: default; }
.mi .key { margin-left: auto; padding-left: 20px; color: var(--muted); font-size: 12px; }
.msep { height: 1px; background: var(--line); margin: 4px 6px; }
#quick { display: flex; gap: 2px; margin-right: 4px; }
.qbtn { width: 34px; height: 34px; display: grid; place-items: center; background: none; border: 0; border-radius: 8px; color: var(--ust-yazi); cursor: pointer; }
.qbtn:hover { background: rgba(255,255,255,.14); }
.qbtn svg, #sendBtn svg, .tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#sendBtn { display: flex; align-items: center; gap: 8px; height: 36px; background: #fff; color: #1f1147; border: 0; border-radius: 9px; padding: 0 16px; font: 700 13px "Segoe UI"; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,.18); margin-left: 4px; }
#sendBtn:hover { background: #fff4ec; }
#sendBtn:disabled { opacity: .6; cursor: wait; }

/* ---------------- çizim araçları: sahnenin solunda yüzen dikey çubuk */
#tools { position: absolute; left: 32px; top: 50%; transform: translateY(-50%); z-index: 6; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--golge); display: flex; flex-direction: column; align-items: center; padding: 6px; gap: 2px; max-height: calc(100% - 44px); overflow-y: auto; scrollbar-width: none; }
#app.cetvelsiz #tools { left: 10px; }
.tool { width: 36px; height: 34px; flex: none; display: grid; place-items: center; border: 0; border-radius: 9px; background: none; color: var(--text); cursor: pointer; position: relative; }
.tool:hover { background: var(--bg3); }
.tool.active { background: var(--accent); color: #fff; }
.tsep { width: 24px; height: 1px; flex: none; background: var(--line); margin: 3px 0; }

/* ---------------- çizim alanı */
#stage { grid-area: stage; position: relative; background: var(--canvas); overflow: hidden; }
#canvas { position: absolute; left: 22px; top: 22px; display: block; outline: none; }
#app.cetvelsiz #canvas { left: 0; top: 0; }
#toast { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--bg2); color: var(--text); border: 1px solid var(--line); box-shadow: var(--golge2); padding: 10px 18px; border-radius: 12px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 70%; text-align: center; z-index: 8; }
#toast.show { opacity: 1; }
#toast.ok { border-color: var(--ok); }
#toast.err { border-color: var(--err); }

/* ---------------- panel */
#panel { grid-area: panel; background: var(--bg2); border-left: 1px solid var(--line); overflow-y: auto; padding: 4px 14px 16px; user-select: text; }
.psec { border-bottom: 1px solid var(--line); padding: 10px 0 12px; }
.psec h3 { margin: 0 0 9px; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); font-weight: 600; }
.psec h3 .sub { text-transform: none; letter-spacing: 0; font-weight: 400; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
label { display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-size: 12px; }
label.chk { flex-direction: row; align-items: center; gap: 6px; margin-top: 16px; color: var(--text); }
input:not([type]), input[type=number], input[type=text], input[type=search], input[type=email], input[type=password], select, textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 5px; padding: 5px 7px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; margin-bottom: 6px; font-size: 14px; }
#tFontSearch { margin-bottom: 4px; }
#tFont { margin-bottom: 8px; }
.hint { color: var(--muted); font-size: 12px; margin: 8px 0 0; line-height: 1.4; }
#palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.sw { aspect-ratio: 1; border-radius: 5px; border: 2px solid transparent; cursor: pointer; }
.sw.active { border-color: #fff; box-shadow: 0 0 0 1px #000 inset; }
.layer { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; }
.layer:hover { background: var(--bg3); }
.layer .dot { width: 14px; height: 14px; border-radius: 3px; }
.layer .name { flex: 1; }
.layer .cnt { color: var(--muted); font-size: 12px; }
.layer button { background: none; border: 0; color: var(--text); cursor: pointer; padding: 2px 4px; border-radius: 4px; }
.layer button:hover { background: var(--bg); }
.layer.off .name, .layer.off .cnt { opacity: .4; text-decoration: line-through; }
.empty { color: var(--muted); font-size: 12px; }

/* ---------------- durum */
#status { grid-area: status; display: flex; align-items: center; gap: 16px; padding: 0 12px; background: var(--bg2); border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; white-space: nowrap; min-width: 0; overflow: hidden; }
#zoomKutu { display: flex; align-items: center; gap: 6px; }
#zoomKutu input[type=range] { width: 110px; }
#zoomKutu button, #panelBtn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 2px 6px; border-radius: 6px; font: inherit; }
#zoomKutu button:hover, #panelBtn:hover { background: var(--bg3); color: var(--text); }
#panelBtn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; vertical-align: -3px; }
#sTool { color: var(--text); }
#sHint { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#sayfaBar { display: flex; align-items: center; gap: 2px; margin-left: -8px; max-width: 40%; overflow-x: auto; scrollbar-width: none; }
#sayfaBar button { background: transparent; border: 1px solid transparent; color: var(--muted); font: inherit; padding: 1px 9px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
#sayfaBar button:hover { color: var(--text); background: var(--bg3); }
#sayfaBar button.aktif { color: var(--text); background: var(--bg3); border-color: var(--line); }
#sayfaBar button.ekle { font-weight: 700; padding: 1px 7px; }
/* dar pencerede üst çubuk satır kaydırmasın: belge adı daralır, düğmeler sabit kalır */
.brand, #sendBtn, .ust-btn, #quick, #menubar button { white-space: nowrap; flex-shrink: 0; }
#belge { flex: 0 1 auto; }
#belgeAd { flex: 0 1 230px; min-width: 70px; }
#sayfaBar, #zoomKutu, #panelBtn, #sZoom, #sPos { flex-shrink: 0; }
@media (max-width: 1250px) { #kayitDurum { font-size: 0; gap: 0; } .brand { font-size: 0; gap: 0; margin-right: 2px; } }
@media (max-width: 1100px) { #zoomKutu input[type=range] { width: 70px; } #sendBtn { padding: 0 10px; } }
#simgeBar { display: flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--text); white-space: nowrap; }
#simgeBar[hidden] { display: none; }
#simgeBar button { font: inherit; padding: 1px 8px; border-radius: 4px; border: 1px solid var(--line); background: var(--bg3); color: var(--text); cursor: pointer; }
#simgeBar button.bitir { border-color: var(--accent); }
#sPos { font-variant-numeric: tabular-nums; min-width: 150px; text-align: right; }

/* ---------------- pencere */
#modal { position: fixed; inset: 0; background: rgba(16,18,27,.45); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 100; }
.mbox { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; min-width: 360px; max-width: 520px; box-shadow: var(--golge2); }
.mbox h3 { margin: 0 0 12px; font-size: 17px; }
.mbox p { color: var(--muted); line-height: 1.5; }
.mbtns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn { background: var(--bg3); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 8px 15px; font: inherit; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
#mBody { max-height: 65vh; overflow-y: auto; }
.ktable { width: 100%; border-collapse: collapse; font-size: 12px; }
.ktable td { padding: 4px 8px; border-bottom: 1px solid var(--line); }
.ktable td:first-child { color: var(--accent2); white-space: nowrap; width: 1%; }
.layer .eye svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; display: block; }
.layer { cursor: pointer; }

/* ---------- renkli (baskı) modu: renk paneli ve nesne listesi */
#app:not([data-mod="renkli"]) .renkli-only, #app[data-mod="renkli"] .cizgi-only { display: none; }
.rk-ust { display: flex; gap: 8px; margin-bottom: 8px; }
.rk-kutu { flex: 1; display: flex; align-items: center; gap: 6px; background: var(--bg3); border-radius: 6px; padding: 4px 6px; }
.rk-kutu span { flex: 1; font-size: 12px; color: var(--muted); }
.rk-kutu input[type=color] { width: 34px; height: 24px; padding: 0; border: 1px solid var(--line, #444); border-radius: 4px; background: none; cursor: pointer; }
.rk-kutu input[type=color].bos { opacity: .25; }
.rk-yok { width: 24px; height: 24px; border-radius: 4px; border: 1px solid transparent; background: var(--bg); color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
.rk-yok.on { border-color: #e5484d; color: #e5484d; }
.rk-palet { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.rk-palet .sw { box-shadow: 0 0 0 1px #0004 inset; }
.rk-palet .sw.yok { background: linear-gradient(135deg, #fff 45%, #e5484d 45%, #e5484d 55%, #fff 55%); }
#secRenk:not(.grad-acik) .rk-g { opacity: .4; }
.nsn.secili { background: var(--bg3); box-shadow: inset 3px 0 0 var(--acc, #1e88ff); }
.nsn .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#nesneler { max-height: 260px; overflow: auto; }
.nsAra { display: flex; gap: 6px; margin: 0 0 6px; }
.nsAra input { flex: 1; min-width: 0; }
.nsAra select { flex: 0 0 auto; max-width: 46%; }
#nesneler .nsSonuc { margin: 0 0 4px; }
#nesneler .nsSonuc a, #nesneler .empty a { color: var(--accent); }
.nsn.soluk .name, .nsn.soluk .kr, .nsn.soluk .dot { opacity: .45; }
/* nesne listesi: resim, katman maskesi ve düzeltme katmanı küçük resimleri */
.nsn .kr, .nsn .km { flex: none; width: 28px; height: 28px; border-radius: 3px; background-size: contain; background-repeat: no-repeat; background-position: center; box-shadow: inset 0 0 0 1px var(--line); }
.nsn .kr { --dama: conic-gradient(#d6d9de 25%, #fff 0 50%, #d6d9de 0 75%, #fff 0); background-color: #fff; background-size: contain, 8px 8px; background-repeat: no-repeat, repeat; }
.nsn .km { background-color: #000; cursor: pointer; margin-left: -4px; }
.nsn .km:hover, .nsn .kd:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.nsn .km.kapali { opacity: .45; position: relative; }
.nsn .km.kapali::after { content: ''; position: absolute; inset: 0; background: linear-gradient(45deg, transparent 46%, #e53935 46%, #e53935 54%, transparent 54%), linear-gradient(-45deg, transparent 46%, #e53935 46%, #e53935 54%, transparent 54%); }
.nsn .kd { flex: none; width: 22px; height: 22px; margin-left: -4px; padding: 3px !important; color: var(--accent); }
.nsn .kd svg { width: 16px; height: 16px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; }
/* açılır gruplar */
.nsn .ac { flex: none; width: 16px; height: 16px; padding: 0 !important; margin-right: -4px; color: var(--muted); }
.nsn .ac svg { width: 14px; height: 14px; display: block; margin: auto; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nsn .ac:hover { color: var(--text); }
.nsn .acbos { flex: none; width: 16px; margin-right: -4px; }
.nsn.icsatir { font-size: 12.5px; padding-top: 3px; padding-bottom: 3px; }
.nsn.icsatir .dot { width: 11px; height: 11px; }
.nsn.icsatir .kr { width: 22px; height: 22px; }
.nsn.ustSecili { background: color-mix(in srgb, var(--bg3) 55%, transparent); }
.nsn .adKutu { flex: 1; min-width: 0; font: inherit; padding: 2px 5px; border: 1px solid var(--accent); border-radius: 4px; background: var(--bg); color: var(--text); }
/* kilit: açıkken yalnız satırın üstüne gelince soluk görünür, kilitliyken hep */
.layer .kilit svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; display: block; }
.nsn .kilit { opacity: 0; }
.nsn:hover .kilit { opacity: .45; }
.nsn .kilit:hover { opacity: 1; }
.nsn.kilitli .kilit { opacity: 1; color: var(--accent); }
.nsn.kilitli .name { opacity: .65; font-style: italic; }
/* nesne listesinde sürükleyerek sıralama: bırakılacak yer çizgisi */
.nsn.ust { box-shadow: inset 0 2px 0 var(--accent); }
.nsn.alt { box-shadow: inset 0 -2px 0 var(--accent); }
.nsn.surukleniyor { opacity: .5; }
.nsn.ic { box-shadow: inset 0 0 0 2px var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.dropdown.acilir { position: fixed; display: block; top: 0; left: 0; z-index: 400; }
.bs-form select { width: 100%; }
input:disabled { opacity: .5; }

/* ---------------- abonelik */
#sLic { cursor: pointer; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--line); color: var(--text); }
#sLic:empty { display: none; }
#sLic.ok { border-color: var(--ok); color: var(--ok); }
#sLic.uyari { border-color: #ffb020; color: #ffb020; }
#sLic.kapali { border-color: var(--err); color: var(--err); }
.lic { width: 100%; border-collapse: collapse; margin: 4px 0 10px; }
.lic td { padding: 5px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.lic td:first-child { color: var(--muted); width: 38%; }
.lic .buyuk { font-size: 16px; font-weight: 600; }
.lic-mesaj { padding: 8px 10px; border-radius: 6px; background: var(--bg3); border-left: 3px solid var(--accent); margin: 0 0 10px; }
.lic-mesaj.kapali { border-left-color: var(--err); }
.lic-cihaz { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; }
.lic-cihaz .btn { padding: 3px 10px; font-size: 12px; }
.lic-h4 { margin: 14px 0 4px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.lic-hareket { font-size: 12px; display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.lic-hareket .t { color: var(--muted); white-space: nowrap; }

/* ---------------- geniş pencere ve vektörleştirme */
.mbox.wide { max-width: min(1060px, 95vw); width: min(1060px, 95vw); }
.mbox.wide #mBody { max-height: 78vh; }
.trace { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; }
.mbox.wide #mBody { overflow-x: hidden; }
.tprev { position: relative; height: min(560px, 66vh); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #f3f4f6; }
.tprev canvas { display: block; width: 100%; height: 100%; }
.tbusy { position: absolute; right: 10px; top: 10px; background: rgba(30,34,40,.9); color: var(--text); padding: 4px 10px; border-radius: 6px; font-size: 12px; }
.tctl { display: flex; flex-direction: column; gap: 9px; }
.tctl label.chk { margin-top: 0; }
.tctl label span { color: var(--text); margin-left: 4px; }
.trow { display: flex; gap: 14px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.tleg { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 12px; color: var(--muted); }
.tleg .tl { display: inline-flex; align-items: center; gap: 4px; }
.tleg i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid var(--line); }
/* ---------------- kutu harf raporu */
.kh-tablo { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.kh-tablo th, .kh-tablo td { padding: 5px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.kh-tablo th:first-child, .kh-tablo td:first-child { text-align: left; }
.kh-tablo th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--bg2); }
.kh-ozet { margin: 12px 0 6px; padding-left: 18px; line-height: 1.6; }
/* ---------------- teklif ve onay görseli */
.tk details { margin-bottom: 10px; background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.tk summary { cursor: pointer; color: var(--text); font-weight: 600; }
.tk .tk3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 8px 0; }
.tk .genis { grid-column: span 2; }
.tk input:not([type=checkbox]), .tk select { width: 100%; box-sizing: border-box; }
.tkKalem { width: 100%; margin: 6px 0; }
.tkKalem td { vertical-align: top; }
.tkKalem textarea { width: 100%; min-width: 260px; resize: vertical; }
.tkKalem .tkM { width: 64px; } .tkKalem .tkF { width: 110px; }
.tkKalem .tkT { text-align: right; white-space: nowrap; padding-top: 8px; font-variant-numeric: tabular-nums; }
.tkKos { display: block; } .tkKos textarea { width: 100%; }
.tkOzet { margin-top: 8px; padding: 8px 10px; background: var(--bg3); border-radius: 6px; line-height: 1.6; }
.mk-mock { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; }
.mk-sahne { display: flex; align-items: center; justify-content: center; background: #111; border-radius: 8px; min-height: 300px; overflow: hidden; }
.mk-sahne canvas { max-width: 100%; touch-action: none; cursor: crosshair; }
.mk-yan { display: flex; flex-direction: column; gap: 7px; }
.mk-yan input:not([type=checkbox]), .mk-yan select { width: 100%; box-sizing: border-box; }
/* ---------------- yapay zekâ tasarımı */
#mBody textarea { background: var(--bg3); color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px; font: inherit; margin-top: 4px; box-sizing: border-box; }
.yzOrnek { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.mbox .not { font-size: 12px; color: var(--muted); }
.yzListe { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.yzKart { display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--bg3); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px; font: inherit; cursor: pointer; }
.yzKart:hover { border-color: var(--accent); }
.yzKart span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.yzResim { background: #f3f4f6; border-radius: 6px; aspect-ratio: 16 / 10; display: grid; place-items: center; padding: 8px; }
.yzResim svg { width: 100%; height: 100%; }
