/* Uygulama: projeler + editör */
body.app { display: flex; flex-direction: column; min-height: 100vh; }
#view { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---------- projeler ---------- */
.ptool { background: var(--surface); border-bottom: 1px solid var(--line); }
.ptool .container { display: flex; align-items: center; gap: 6px; height: 54px; }
.ptool .btn { border: 0; background: none; color: var(--fg); font-weight: 600; }
.ptool .btn:hover { background: var(--surface-2); }
.ptool input[type=search] { max-width: 300px; margin-left: auto; }
.pwrap { padding: 28px 0 80px; }
.pwrap h1 { text-align: center; font-size: 30px; letter-spacing: -.02em; margin-bottom: 26px; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.pcard-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pcard-head .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--nav); color: #fff; display: grid; place-items: center; font-weight: 800; overflow: hidden; }
.pcard-head .ic img { width: 100%; height: 100%; object-fit: cover; }
.pcard-head b { flex: 1; font-size: 14px; }
.pcard-head .more { border: 0; background: none; font-size: 18px; cursor: pointer; color: var(--muted); padding: 4px 6px; }
.pcover { margin: 12px; height: 260px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); display: flex; gap: 4px; padding: 6px; cursor: pointer; }
.pcover canvas { height: 100%; width: auto; border-radius: 6px; flex: 0 0 auto; }
.pcover.empty { display: grid; place-items: center; color: var(--faint); }
.pmeta { padding: 4px 14px 12px; }
.pmeta div { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.pmeta div:last-child { border-bottom: 0; }
.pmeta b { color: var(--fg); font-weight: 600; }
.pmeta .id { font-family: ui-monospace, Menlo, monospace; color: var(--faint); font-style: italic; }
.pempty { text-align: center; color: var(--muted); padding: 60px 20px; }
.pempty .btn { margin: 6px; }
.menu { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; min-width: 190px; }
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.menu button:hover { background: var(--surface-2); }
.menu button.danger { color: var(--danger); }
.newgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 820px; margin: 0 auto; }
.newcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 26px; cursor: pointer; box-shadow: var(--shadow); transition: .12s; }
.newcard:hover { border-color: var(--brand); transform: translateY(-2px); }
.newcard .ic { font-size: 30px; margin-bottom: 10px; }
.newcard h3 { font-size: 18px; margin-bottom: 6px; }
.newcard p { color: var(--muted); font-size: 13px; }

/* ---------- editör ---------- */
.ed { flex: 1; min-height: 0; display: flex; flex-direction: column; background: #e9e9f1; }
.ed-tools { display: flex; align-items: center; gap: 6px; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.ed-tools .tb { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 7px 11px; font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--fg); white-space: nowrap; }
.ed-tools .tb:hover { background: #e6e6f0; }
.ed-tools .tb.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.ed-tools .tb.ai { background: #e8f7ee; color: #1f7a3f; border-color: #cdeeda; }
.ed-tools .tb.on { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
.ed-tools .tb:disabled { opacity: .4; cursor: default; }
.ed-tools .sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.ed-tools .grow { flex: 1; }
.ed-tools select { width: auto; padding: 6px 28px 6px 10px; font-weight: 600; font-size: 12.5px; }
.ed-tools .saved { font-size: 11.5px; color: var(--faint); }
.ed-canvas { flex: 1; min-height: 0; overflow: auto; padding: 18px 18px 60px; }
.ed-strip { display: flex; gap: 12px; align-items: flex-start; width: max-content; min-width: 100%; }
.ed-strip.pan { gap: 2px; }
.scr { position: relative; flex: 0 0 auto; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 24px rgba(20,20,40,.14); background: #fff; }
.scr canvas { display: block; }
.scr.sel { outline: 3px solid var(--brand); outline-offset: 2px; }
.scr .pencil { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; font-size: 15px; opacity: 0; transition: .12s; }
.scr:hover .pencil, .scr.sel .pencil { opacity: 1; }
.scr .num { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 12px; }
.scr .sel-box { position: absolute; border: 2px solid var(--brand); pointer-events: none; box-shadow: 0 0 0 1px rgba(255,255,255,.7); }
.scr .sel-box .h { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid var(--brand); border-radius: 3px; right: -8px; bottom: -8px; pointer-events: auto; cursor: nwse-resize; }
.scr-add { flex: 0 0 auto; width: 120px; border: 2px dashed var(--line-2); border-radius: 10px; display: grid; place-items: center; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 13px; }
.scr-add:hover { border-color: var(--brand); color: var(--brand-ink); }

/* inline panel */
.panel { flex: 0 0 auto; width: 380px; background: var(--surface); border-radius: 12px; box-shadow: 0 6px 24px rgba(20,20,40,.14); display: flex; flex-direction: column; max-height: calc(100vh - 150px); position: sticky; top: 0; }
.panel-tools { display: flex; gap: 6px; padding: 10px; border-bottom: 1px solid var(--line); }
.panel-tools .tb { flex: 1; border: 0; border-radius: 8px; padding: 8px 0; background: var(--brand-soft); color: var(--brand-ink); cursor: pointer; font-size: 14px; }
.panel-tools .tb.ok { background: #e8f7ee; color: #1f7a3f; }
.panel-tools .tb.del { background: #fdecef; color: var(--danger); }
.panel-body { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.acc { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.acc > .acc-h { display: flex; align-items: center; gap: 8px; padding: 9px 10px; cursor: pointer; font-weight: 700; font-size: 13px; user-select: none; }
.acc > .acc-h .ic { width: 22px; text-align: center; color: var(--muted); }
.acc > .acc-h .grow { flex: 1; }
.acc > .acc-h .mini { border: 0; background: var(--brand-soft); color: var(--brand-ink); width: 26px; height: 24px; border-radius: 7px; cursor: pointer; font-size: 12px; }
.acc > .acc-h .mini.off { background: var(--surface-2); color: var(--faint); }
.acc > .acc-h .chev { color: var(--faint); font-size: 11px; transition: .15s; }
.acc.open > .acc-h .chev { transform: rotate(180deg); }
.acc > .acc-b { display: none; padding: 6px 10px 12px; border-top: 1px solid var(--line); }
.acc.open > .acc-b { display: block; }
.acc .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.acc .row.one { grid-template-columns: 1fr; }
.acc .row.three { grid-template-columns: 1fr 1fr 1fr; }
.acc .f { display: flex; flex-direction: column; gap: 3px; }
.acc .f > span { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.acc .f input, .acc .f select, .acc .f textarea { padding: 6px 8px; font-size: 12.5px; border-radius: 7px; }
.acc .f textarea { min-height: 54px; font-weight: 600; }
.acc .f input[type=color] { width: 100%; height: 30px; }
.acc .f .rng { display: flex; align-items: center; gap: 6px; }
.acc .f .rng input[type=range] { flex: 1; }
.acc .f .rng b { font-size: 11px; width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.layer-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.layer { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; font-size: 12.5px; }
.layer:hover { background: var(--surface-2); }
.layer.sel { border-color: var(--brand); background: var(--brand-soft); }
.layer .ic { width: 20px; text-align: center; color: var(--muted); }
.layer .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.layer .dim { font-size: 10px; color: var(--faint); font-family: ui-monospace, Menlo, monospace; white-space: nowrap; }
.layer .acts { display: flex; gap: 2px; }
.layer .acts button { border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 12px; padding: 2px 4px; border-radius: 5px; }
.layer .acts button:hover { background: var(--surface); color: var(--fg); }
.addrow { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.addrow .btn { justify-content: flex-start; }
.addmenu { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.addmenu button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 4px; cursor: pointer; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.addmenu button:hover { border-color: var(--brand); background: var(--brand-soft); }
.addmenu button span { font-size: 18px; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; margin: 6px 0; }
.swatch { height: 26px; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; }
.swatch.on { outline: 2px solid var(--brand); }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.preset-grid button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 4px; font-size: 11px; cursor: pointer; }
.preset-grid button:hover { border-color: var(--brand); }
.ed-zoom { position: fixed; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px; box-shadow: var(--shadow); z-index: 30; }
.ed-zoom button { border: 0; background: none; cursor: pointer; padding: 5px 8px; border-radius: 7px; font-size: 14px; }
.ed-zoom button:hover { background: var(--surface-2); }
.ed-zoom b { font-size: 11.5px; min-width: 40px; text-align: center; }
.popover { position: absolute; z-index: 70; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 12px; width: 360px; }
.popover h4 { font-size: 12px; margin-bottom: 8px; }

/* ekran görüntüleri modalı */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: 14px; }
.tabs button { border: 0; background: none; padding: 9px 12px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--brand-ink); border-bottom-color: var(--brand); }
.shots-grid { display: grid; grid-template-columns: 170px 1fr; gap: 18px; }
.shots-grid .thumb { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.shots-grid .thumb canvas { width: 100%; display: block; }
.slot-group { margin-bottom: 14px; }
.slot-group h4 { font-size: 12px; color: var(--muted); margin-bottom: 8px; display: flex; gap: 6px; align-items: center; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.slot { border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; cursor: pointer; }
.slot:hover { border-color: var(--brand); background: var(--brand-soft); }
.slot.filled { border-style: solid; background: var(--surface); }
.slot img { width: 34px; height: 60px; object-fit: cover; border-radius: 5px; background: #ddd; }
.slot .info { flex: 1; min-width: 0; }
.slot b { display: block; font-size: 12.5px; }
.slot small { color: var(--faint); font-size: 11px; display: block; }
.slot .x { border: 0; background: none; color: var(--faint); cursor: pointer; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 12px; padding: 22px; text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.dropzone.on { border-color: var(--brand); background: var(--brand-soft); }

/* dışa aktarma */
.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.exp-grid h4 { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.exp-list { display: flex; flex-direction: column; gap: 6px; }
.exp-preview { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; }
.exp-preview canvas { height: 300px; width: auto; border-radius: 8px; flex: 0 0 auto; background: #ddd; }
.storemock { background: #f2f2f7; border-radius: 14px; padding: 14px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.progress i { display: block; height: 100%; background: var(--brand); width: 0; transition: .2s; }
.langrow { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.langrow .grow { flex: 1; }
.kbd { display: inline-block; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 6px; font-size: 11px; font-family: inherit; background: var(--surface-2); }
@media (max-width: 900px) { .panel { width: 320px; } .exp-grid, .shots-grid, .newgrid { grid-template-columns: 1fr; } }
