:root {
  --bg: #111114;
  --bg2: #1b1b20;
  --bg3: #26262d;
  --line: #34343d;
  --text: #f2f2f5;
  --muted: #9a9aa6;
  --accent: #ff4f7b;
  --accent2: #ffb14f;
  --sel: #3d9bff;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.4 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.screen { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* ---------- butonlar ---------- */
.btn { border: 0; border-radius: 999px; padding: 9px 16px; font-weight: 600; background: var(--bg3); white-space: nowrap; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #1a0c10; }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.topbar .btn { display: inline-flex; align-items: center; gap: 6px; }
.topbar .btn svg { width: 18px; height: 18px; }
@media (max-width: 520px) {
  .topbar .btn span { display: none; }
  .topbar .btn { padding: 9px 11px; }
  .topbar .icon-btn { width: 36px; }
}
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.danger { background: #3a1820; color: #ff8a9f; }
.btn:active { transform: scale(.97); }
.icon-btn { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.icon-btn:active { background: var(--bg3); }
.icon-btn:disabled { opacity: .3; }
.icon-btn.small { width: 34px; height: 34px; }
.icon-btn.small svg { width: 18px; height: 18px; }

/* ---------- ana ekran ---------- */
#home { overflow-y: auto; padding: calc(var(--safe-t) + 18px) 16px calc(var(--safe-b) + 24px); display: block; }
.home-head { display: flex; align-items: center; justify-content: space-between; max-width: 980px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px; letter-spacing: -.5px; }
.logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--accent2)); position: relative; }
.logo::after { content: ""; position: absolute; inset: 8px 5px; border-left: 3px solid #1a0c10; border-right: 3px solid #1a0c10; opacity: .7; }
.home-sub { color: var(--muted); max-width: 980px; margin: 10px auto 22px; }
.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; max-width: 980px; margin: 0 auto; }
.pcard { background: var(--bg2); border-radius: 16px; overflow: hidden; border: 1px solid var(--line); cursor: pointer; }
.pcard .thumb { height: 150px; background: #000; display: flex; align-items: center; overflow-x: auto; scrollbar-width: none; }
.pcard .thumb img { height: 100%; display: block; }
.pcard .meta { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; gap: 8px; }
.pcard .meta b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .meta small { color: var(--muted); }
.empty-home { text-align: center; margin-top: 12vh; color: var(--muted); }
.empty-art { display: flex; justify-content: center; gap: 4px; margin-bottom: 18px; }
.empty-art i { width: 56px; height: 70px; border-radius: 6px; background: linear-gradient(90deg, #ff4f7b33, #ffb14f33); }
.empty-art i:nth-child(1) { background: linear-gradient(90deg, #ff4f7b, #ff6f6a); }
.empty-art i:nth-child(2) { background: linear-gradient(90deg, #ff6f6a, #ff905d); }
.empty-art i:nth-child(3) { background: linear-gradient(90deg, #ff905d, #ffb14f); }

/* ---------- editör ---------- */
.topbar { display: flex; align-items: center; gap: 4px; padding: calc(var(--safe-t) + 6px) 8px 6px; background: var(--bg); border-bottom: 1px solid var(--line); }
.proj-name { flex: 1; min-width: 40px; background: transparent; border: 0; font-weight: 700; padding: 6px; border-radius: 8px; text-overflow: ellipsis; }
.proj-name:focus { outline: none; background: var(--bg3); }
.work { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.work-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
@media (min-width: 900px) {
  .work { flex-direction: row; }
  .work .panel { width: 340px; max-height: none; border-top: 0; border-left: 1px solid var(--line); padding: 14px; }
  .work .panel .prow { flex-wrap: wrap; overflow: visible; }
  .work .panel .slider { min-width: 100%; }
}
.stage-wrap { position: relative; flex: 1; min-height: 0; background: #0b0b0d; overflow: hidden; }
#stage { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.zoom-ctl { position: absolute; right: 10px; top: 8px; display: flex; gap: 2px; background: #1b1b20e6; border-radius: 12px; padding: 2px; border: 1px solid var(--line); }
.crop-banner { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); background: #1b1b20f0; border: 1px solid var(--sel); padding: 6px 6px 6px 14px; border-radius: 999px; font-size: 13px; display: flex; gap: 10px; align-items: center; white-space: nowrap; max-width: calc(100% - 20px); overflow: hidden; }

.slide-strip { display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto; background: var(--bg); border-top: 1px solid var(--line); scrollbar-width: none; flex: none; }
.slide-strip::-webkit-scrollbar { display: none; }
.slide-strip button { flex: none; border: 1px solid var(--line); background: var(--bg2); border-radius: 6px; font-size: 12px; color: var(--muted); height: 30px; min-width: 30px; padding: 0 8px; }
.slide-strip button.on { border-color: var(--text); color: var(--text); }

.toolbar { display: flex; justify-content: space-around; background: var(--bg); border-top: 1px solid var(--line); padding: 4px 4px calc(var(--safe-b) + 4px); overflow-x: auto; scrollbar-width: none; flex: none; }
.toolbar button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); padding: 6px 4px; border-radius: 10px; flex: 1 0 auto; min-width: 48px; white-space: nowrap; }
.toolbar button:active { background: var(--bg3); color: var(--text); }

/* seçili öğe paneli */
.panel { background: var(--bg2); border-top: 1px solid var(--line); padding: 8px 10px; flex: none; max-height: 40vh; overflow-y: auto; }
.prow { display: flex; gap: 6px; align-items: center; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.prow::-webkit-scrollbar { display: none; }
.prow + .prow { margin-top: 8px; }
.chip { flex: none; border: 1px solid var(--line); background: var(--bg3); border-radius: 10px; padding: 7px 11px; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { border-color: var(--sel); background: #16304f; }
.chip svg { width: 17px; height: 17px; }
.chip.danger { color: #ff8a9f; }
.slider { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex: 1; min-width: 150px; }
.slider input { flex: 1; accent-color: var(--accent); }
.swatches { display: flex; gap: 6px; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); flex: none; padding: 0; }
.sw.on { border-color: #fff; box-shadow: 0 0 0 2px var(--sel); }
.sw.custom { position: relative; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.sw.custom input { position: absolute; inset: -8px; opacity: 0; width: 50px; height: 50px; cursor: pointer; }
select.chip { appearance: none; padding-right: 26px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.text-edit { width: 100%; min-height: 64px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; resize: vertical; }

/* ---------- sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: #0009; z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--bg2); border-radius: 20px 20px 0 0; max-height: 88vh; display: flex; flex-direction: column; padding-bottom: var(--safe-b); animation: up .22s ease-out; border-top: 1px solid var(--line); }
@media (min-width: 720px) { .sheet { left: 50%; right: auto; width: 640px; transform: translateX(-50%); bottom: 20px; border-radius: 20px; border: 1px solid var(--line); animation: none; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet-body { overflow-y: auto; padding: 10px 16px 18px; }
.sheet h3 { margin: 6px 0 12px; font-size: 18px; }
.sheet h4 { margin: 18px 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.opt-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ratio-opt { border: 1px solid var(--line); background: var(--bg3); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 76px; font-size: 13px; }
.ratio-opt i { display: block; background: var(--muted); border-radius: 3px; }
.ratio-opt.on { border-color: var(--accent); }
.ratio-opt.on i { background: var(--accent); }
.stepper { display: inline-flex; align-items: center; background: var(--bg3); border-radius: 12px; border: 1px solid var(--line); }
.stepper button { border: 0; background: transparent; width: 44px; height: 44px; font-size: 22px; }
.stepper b { min-width: 40px; text-align: center; font-size: 18px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.tpl { border: 1px solid var(--line); background: var(--bg3); border-radius: 12px; padding: 6px; text-align: left; }
.tpl canvas { width: 100%; display: block; border-radius: 6px; background: #000; }
.tpl span { display: block; font-size: 12px; margin: 6px 2px 2px; color: var(--muted); }
.tpl.on { border-color: var(--accent); }
.tpl.on span { color: var(--text); }
.sheet-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.export-thumbs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }

.export-thumbs img, .export-thumbs video { height: 150px; display: block; border-radius: 4px; }
.export-thumbs .slot { min-width: 60px; flex: none; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.slot-dl { font-size: 12px; }
.slot-wait { height: 150px; aspect-ratio: 4/5; display: grid; place-items: center; background: var(--bg3); border-radius: 4px; font-size: 12px; color: var(--muted); text-align: center; padding: 6px; }
.note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.big-actions { display: grid; gap: 8px; margin-top: 14px; }
.big-actions .btn { padding: 13px; font-size: 15px; }

/* ---------- önizleme ---------- */
.preview { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; }
.preview-head { display: flex; justify-content: space-between; align-items: center; padding: calc(var(--safe-t) + 8px) 10px 8px; }
.seg { display: inline-flex; background: var(--bg3); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--bg); color: var(--text); }
.preview-body { flex: 1; overflow-y: auto; display: flex; justify-content: center; align-items: flex-start; }
.ig-post { width: min(100%, 470px); background: #000; margin-top: 10px; }
.ig-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 14px; font-weight: 600; }
.ig-av { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); padding: 2px; }
.ig-av::after { content: ""; display: block; width: 100%; height: 100%; border-radius: 50%; background: #333; border: 2px solid #000; }
.ig-car { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; position: relative; }
.ig-car::-webkit-scrollbar { display: none; }
.ig-car img, .ig-car canvas { width: 100%; flex: none; scroll-snap-align: center; display: block; }
.ig-counter { position: relative; }
.ig-counter span { position: absolute; top: 12px; right: 12px; background: #000a; font-size: 12px; padding: 3px 9px; border-radius: 99px; pointer-events: none; }
.ig-dots { display: flex; justify-content: center; gap: 4px; padding: 10px; }
.ig-dots i { width: 6px; height: 6px; border-radius: 50%; background: #555; }
.ig-dots i.on { background: #3d9bff; }
.ig-actions { display: flex; gap: 14px; padding: 0 12px 14px; }
.ig-grid { width: min(100%, 470px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin-top: 10px; }
.ig-grid div { aspect-ratio: 3/4; background: #1c1c1f; overflow: hidden; position: relative; }
.ig-grid div img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-grid div.first::after { content: ""; position: absolute; top: 8px; right: 8px; width: 14px; height: 14px; border: 2px solid #fff; border-radius: 3px; box-shadow: 3px -3px 0 -1px #000, 3px -3px 0 1px #fff; }
.grid-note { width: min(100%, 470px); color: var(--muted); font-size: 12px; padding: 10px 12px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 90px); transform: translateX(-50%); background: #fff; color: #111; padding: 10px 16px; border-radius: 12px; font-weight: 600; z-index: 99; box-shadow: 0 10px 30px #0008; max-width: 90vw; text-align: center; }

.nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #1b1b20e6; display: grid; place-items: center; z-index: 2; }
.nav-arrow.left { left: 6px; }
.nav-arrow.right { right: 6px; }
.nav-arrow svg { width: 20px; height: 20px; }
.slide-count { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); font-size: 12px; font-weight: 600; color: var(--muted); background: #1b1b20e6; border: 1px solid var(--line); padding: 3px 10px; border-radius: 99px; pointer-events: none; }
#btnMode.on { background: var(--bg3); color: var(--accent); }

/* ---------- karşılama ---------- */
.home-actions { display: flex; gap: 8px; }
.welcome { max-width: 980px; margin: 0 auto 26px; background: linear-gradient(135deg, #ff4f7b14, #ffb14f14); border: 1px solid #ff4f7b40; border-radius: 16px; padding: 14px 16px 6px; }
.welcome-badge { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: #1a0c10; background: linear-gradient(135deg, var(--accent), var(--accent2)); padding: 3px 10px; border-radius: 99px; }
.welcome ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.welcome li { font-size: 13.5px; color: #c9c9d3; padding: 0 0 10px; }
.welcome li b { color: var(--text); display: block; margin-bottom: 2px; }
.home-section { max-width: 980px; margin: 8px auto 12px; font-size: 15px; color: var(--muted); font-weight: 700; }
.home-section + .project-list { margin-bottom: 26px; }
.home-foot { max-width: 980px; margin: 36px auto 0; border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: 13px; text-align: center; }
.home-foot p { margin: 0 0 8px; }
.social { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.social a { color: var(--text); text-decoration: none; font-weight: 600; border: 1px solid var(--line); background: var(--bg2); padding: 8px 14px; border-radius: 99px; }
.social a:hover { border-color: var(--accent); }
.home-foot .fine { font-size: 11.5px; line-height: 1.5; max-width: 620px; margin: 0 auto; opacity: .8; }
@media (max-width: 520px) {
  .brand { font-size: 17px; white-space: nowrap; gap: 8px; }
  .logo { width: 26px; height: 26px; }
  .home-actions { gap: 6px; }
  .home-actions .btn { padding: 8px 11px; font-size: 14px; }
  .home-sub { font-size: 14px; margin: 8px auto 14px; }
  .welcome { padding: 10px 12px 2px; margin-bottom: 18px; }
  .welcome ul { gap: 2px; margin-top: 8px; }
  .welcome li { font-size: 12.5px; line-height: 1.35; padding-bottom: 7px; }
}

/* ---------- pano ---------- */
#editor.is-board .carousel-only { display: none !important; }
#editor:not(.is-board) .board-only { display: none !important; }
.board-export img { max-width: 100%; max-height: 50vh; display: block; margin: 0 auto; border-radius: 8px; }
@media (max-width: 420px) {
  .home-head { flex-wrap: wrap; gap: 10px; }
  .home-actions { width: 100%; }
  .home-actions .btn { flex: 1; }
}

/* ---------- ana ekrana yükleme rehberi ---------- */
.install { max-width: 980px; margin: 30px auto 0; }
.install .home-section { color: var(--text); font-size: 17px; }
.install-lead { color: var(--muted); font-size: 14px; margin: -4px 0 12px; }
.install-now { width: 100%; padding: 13px; font-size: 15px; margin-bottom: 12px; }
.install-warn { background: #3a2a12; border: 1px solid #ffb14f55; color: #f3dfc2; border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.45; margin-bottom: 10px; }
.install-warn b { display: block; color: #ffd08a; margin-bottom: 2px; }
.install-os { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.install-os summary { cursor: pointer; padding: 12px 14px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.install-os summary::-webkit-details-marker { display: none; }
.install-os summary::after { content: "+"; color: var(--muted); font-size: 20px; font-weight: 400; }
.install-os[open] summary::after { content: "−"; }
.install-os[open] { border-color: #ff4f7b66; }
.install-os ol { margin: 0; padding: 0 16px 14px 34px; font-size: 14px; line-height: 1.5; color: #d4d4dc; }
.install-os li { margin-bottom: 6px; }
.install-os .mine-tag { font-size: 11px; font-weight: 700; background: var(--accent); color: #1a0c10; padding: 2px 8px; border-radius: 99px; margin-left: 8px; }
.k { display: inline-block; background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-weight: 700; }
.inapp-top { max-width: 980px; margin: 4px auto 16px; background: #3a2a12; border: 1px solid #ffb14f88; border-radius: 14px; padding: 12px 14px; color: #f3dfc2; font-size: 13.5px; line-height: 1.45; }
.inapp-top b { display: block; color: #ffd08a; font-size: 15px; margin-bottom: 4px; }
.inapp-top p { margin: 0 0 10px; }
.inapp-top .btn { display: block; text-align: center; text-decoration: none; padding: 12px; font-size: 15px; margin-bottom: 8px; }
.inapp-top .inapp-manual { margin: 0; font-size: 12.5px; opacity: .9; }
