/* Lavinya Design Studio - editor stilleri */
* { box-sizing: border-box; }
:root {
    --panel: #1f2430; --panel2: #2a3040; --line: #3b4256;
    --text: #e8ebf2; --muted: #9aa3b5; --accent: #19b5ad;
    --sidebar-w: 280px;
    --left-w: 70px;
}
html, body { height: 100%; margin: 0; }
body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: #e9edf3; color: var(--text);
    display: flex;
    height: 100vh; height: 100dvh; overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Sol Panel (Ana Araclar ve Global Islemler) */
#left-panel {
    flex: 0 0 var(--left-w);
    background: var(--panel);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    gap: 12px;
    z-index: 10;
}
.side-tool {
    width: 50px;
    height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    color: var(--text);
    background: var(--panel2);
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.side-tool .ico { font-size: 20px; }
.side-tool:hover { background: #39415a; }
.side-tool.primary { background: var(--accent); border-color: var(--accent); }
.side-tool:disabled { opacity: .3; cursor: default; }
.side-divider { width: 30px; height: 1px; background: var(--line); margin: 4px 0; }

/* Sag Panel (Ozellikler ve Katmanlar) */
#right-panel {
    flex: 0 0 var(--sidebar-w);
    background: var(--panel);
    border-left: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10;
}

#props-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
#props-container h3 { 
    margin: 0 0 10px 0; 
    font-size: 12px; 
    color: var(--muted); 
    text-transform: uppercase; 
    letter-spacing: .05em;
    border-bottom: 1px solid var(--line);
    padding-bottom: 5px;
}

#layers-section {
    flex: 1;
    border-top: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    min-height: 200px;
}
#layers-section h3 { margin: 0; padding: 10px 15px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
#layerList { flex: 1; overflow-y: auto; padding: 10px; }

/* Ana Sahne */
#stage {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #e9edf3;
    background-image: radial-gradient(#cdd5e2 1px, transparent 1px);
    background-size: 18px 18px;
}
#stage-header {
    padding: 10px 20px;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid #d1d9e6;
    display: flex;
    align-items: center;
    gap: 15px;
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 5;
}
#stage-header .product-info { color: #333; font-weight: 600; }
#stage-header .product-meta { color: #3f3f46; font-size: 12px; }
/* Kurumsal urun renkleri: her urunun ana rengi; baslik bicimi butun urunlerde ayni (yeni urun: buraya bir satir) */
body { --ds-accent: #0f766e; }
body[data-ds-type="defter"] { --ds-accent: #0f766e; }   /* spiralli defter: turkuaz */
body[data-ds-type="plaka"] { --ds-accent: #1e3a5f; }    /* plakalik: lacivert */
body[data-ds-type="davetiye"] { --ds-accent: #7f1d1d; } /* davetiye: bordo */
body[data-ds-type="davetiye"].inv-zarf { --ds-accent: #a8843f; } /* zarf: altin-bej */
#stage-header { border-bottom: 3px solid var(--ds-accent); }
#stage-header .product-badge b { color: var(--ds-accent); }
#props-container h3, #layers h3 { background: var(--ds-accent); color: #fff !important; padding: 7px 10px; border-radius: 8px; border-bottom: 0; }
/* Sabit yakinlastirma araclari (butun urunler) */
#stage-header .zoom-tool { width: auto; padding: 0 10px; white-space: nowrap; font-weight: 700; }
/* Tasarlanan urunun adi (her zaman gorunur) */
#stage-header .product-badge { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 0 1 auto; font: 700 14px/1.2 Montserrat, system-ui, sans-serif; color: #1f2430; }
#stage-header .product-badge:empty { display: none; }
#stage-header .product-badge img { width: 34px; height: 34px; flex: 0 0 auto; object-fit: cover; border-radius: 6px; border: 1px solid #d1d9e6; background: #fff; }
#stage-header .product-badge .pb-t { display: flex; flex-direction: column; min-width: 0; }
#stage-header .product-badge b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#stage-header .product-badge small { font: 500 11.5px/1.3 system-ui, sans-serif; color: #52525b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 899px) {
    #stage-header .product-badge { font-size: 12px; gap: 6px; flex: 1 1 auto; }
    #stage-header .product-badge img { width: 24px; height: 24px; }
    #stage-header .product-badge b { -webkit-line-clamp: 1; }
    #stage-header .product-badge small { display: none; }
}

#canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px 40px 40px; /* Üstten ve yanlardan daha fazla boşluk */
    overflow: auto; /* Taşan durumlarda kaydırma çubuğu çıksın */
    background: #d0d7e1; /* Tuvali daha belirgin yapmak için arka plan rengi */
}

.canvas-container { 
    background: #fff; 
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1), 0 20px 50px rgba(0,0,0,0.2); 
    border-radius: 2px;
    margin: auto; /* Ortalamayı garanti et */
}

/* Floating Status */
#status {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    padding: 8px 20px;
    border-radius: 30px;
    background: var(--panel);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    pointer-events: none; /* bilgi mesaji; altindaki dugmelere (yakinlastirma, ID) tiklamayi engellemesin */
    display: none;
}
#status:not(:empty) { display: block; }

/* Form elemanlari guncelleme */
.pg { display: flex; flex-direction: column; gap: 8px; }
.pg-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pg-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.props-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
    font-style: italic;
    font-size: 14px;
}

.align-btn, .toggle-btn { 
    min-width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); 
    background: var(--panel2); color: var(--text); cursor: pointer; 
    display: flex; align-items: center; justify-content: center;
}
.toggle-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }

select.pfield, input.pfield[type=number] { 
    width: 100%; height: 38px; border-radius: 8px; border: 1px solid var(--line); 
    background: #161a23; color: var(--text); padding: 0 10px; font-size: 13px; 
}
input[type=range] { width: 100%; }

.mobile-only { display: none; }

/* Mobil */
@media (max-width: 899px) {
    .mobile-only { display: flex; }
    body { flex-direction: column-reverse; }
    #left-panel { 
        flex: 0 0 70px; 
        width: 100%; 
        flex-direction: row; 
        padding: 0 10px; 
        overflow-x: auto; 
        justify-content: center;
        border-right: 0;
        border-top: 1px solid var(--line);
    }
    #right-panel { display: none; } 
    #stage-header { padding: 5px 10px; font-size: 12px; }
    #canvas-wrapper { padding-top: 50px; padding-bottom: 10px; }

    #layers.mobile-sheet {
        position: fixed; left: 0; right: 0; z-index: 20; width: auto;
        bottom: 70px;
        max-height: 50vh;
        border-radius: 14px 14px 0 0;
        transform: translateY(130%); visibility: hidden; transition: transform .2s;
    }
    #layers.mobile-sheet.open { transform: none; visibility: visible; }
}
#layerList { flex: 1; overflow-y: auto; padding: 8px; }

.layer-item { display: flex; align-items: center; gap: 4px; padding: 5px 6px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); font-size: 14px; cursor: pointer; }
.layer-item.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.layer-item.dim .layer-name { opacity: .45; }
.layer-item.drag-over { border-top: 3px solid #f5a623; }
.layer-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.layer-btn { width: 32px; height: 32px; flex: 0 0 auto; border: 1px solid rgba(255,255,255,.18); border-radius: 7px; background: rgba(0,0,0,.25); color: #fff; font-size: 13px; cursor: pointer; }
.grip { opacity: .5; cursor: grab; }
.empty { color: var(--muted); font-size: 13px; padding: 6px 0; }
@media (pointer: coarse) { .grip { display: none; } .layer-btn { width: 38px; height: 38px; } }

/* Sekil menusu */
#shapeMenu { flex-wrap: wrap; width: 392px; max-width: calc(100vw - 16px); display: none; position: fixed; z-index: 30; gap: 8px; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
#shapeMenu.open { display: flex; }

/* Ikon paneli */
#iconPanel { display: none; position: fixed; z-index: 30; flex-direction: column; gap: 8px; width: min(408px, calc(100vw - 16px)); max-height: min(560px, 80vh); padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
#iconPanel.open { display: flex; }
#iconSearch { height: 44px; padding: 0 14px 0 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa4b5' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center / 20px; color: var(--text); font-size: 15px; flex: 0 0 auto; }
#iconSearch:focus { outline: 2px solid var(--accent, #4a90d9); outline-offset: 0; }
#iconCats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; flex: 0 0 auto; }
#iconStyle { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; flex: 0 0 auto; }
#iconCats button, #iconStyle button { min-width: 0; height: 32px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--text); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: transform .12s, background .12s; }
#iconCats button:hover, #iconStyle button:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--c) 32%, transparent); }
#iconCats button.on, #iconStyle button.on { background: var(--c); border-color: var(--c); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
#iconGrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; overflow-y: auto; min-height: 120px; flex: 1 1 auto; }
#iconGrid .empty { grid-column: 1 / -1; }
.icon-item { aspect-ratio: 1; padding: 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; }
.icon-item svg { width: 100%; height: 100%; display: block; }
.icon-item:hover { border-color: var(--accent, #4a90d9); }

/* Renk secici (acilir/kapanir) */
.color-trigger { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); cursor: pointer; font-size: 13px; white-space: nowrap; }
.color-trigger:disabled { opacity: .35; cursor: default; }
.csw { width: 16px; height: 16px; border-radius: 4px; border: 1px solid rgba(255,255,255,.35); background: var(--sw, #888); flex: 0 0 auto; }
#colorPopover { display: none; position: fixed; z-index: 40; flex-wrap: wrap; gap: 6px; padding: 10px; max-width: 220px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.4); align-items: center; }
#colorPopover.open { display: flex; }

@media (max-width: 599px) {
    .hide-sm, .brand { display: none; }
    #designId { width: 52px; }
}

@media (min-width: 900px) {
    #layers { position: static !important; transform: none !important; visibility: visible !important; box-shadow: none !important; }
}


/* ---- Ozellikler paneli: kompakt, iki sutunlu, tek ekran ---- */
:root { --sidebar-w: 300px; --ctl-h: 32px; }
#propsBar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 10px; align-content: start; }
#propsBar .divider { display: none; }
#propsBar .pg { gap: 5px; min-width: 0; }
#propsBar .pg.wide { grid-column: 1 / -1; }
#propsBar .pg-label { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; }
#propsBar .pg-row { gap: 5px; flex-wrap: wrap; }
#propsBar .align-btn, #propsBar .toggle-btn { min-width: var(--ctl-h); height: var(--ctl-h); padding: 0 8px; font-size: 12.5px; border-radius: 7px; }
#propsBar .align-btn { padding: 0; width: 36px; }
#propsBar .pg.wide > .pg-row > .toggle-btn[onclick*="changeLayer"] { flex: 1 1 0; }
#propsBar select.pfield, #propsBar input.pfield[type=number] { height: var(--ctl-h); border-radius: 7px; width: 100%; flex: 1 1 0; min-width: 0; }
#propsBar input.pfield.size { flex: 0 0 62px; width: 62px; }
#propsBar input[type=range] { height: 20px; margin: 0; }
#propsBar .props-empty { grid-column: 1 / -1; padding: 24px 12px; }
#layers-section, #layers { min-height: 0; }

/* Renk dugmesi: dolgu / cizgi / yazi rengi icin ortak gorunum */
.color-trigger { width: 100%; height: var(--ctl-h); padding: 0 8px; gap: 7px; border-radius: 7px; font-size: 12px; justify-content: flex-start; }
.color-trigger .cval { flex: 1; text-align: left; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.color-trigger .caret { opacity: .6; font-size: 10px; }
.color-trigger:hover:not(:disabled) { border-color: var(--accent); }
.csw { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.55); box-shadow: 0 0 0 1px rgba(0,0,0,.35); }

/* Renk numuneleri: yuvarlak */
#colorPopover { gap: 8px; padding: 12px; max-width: 232px; border-radius: 12px; }
.swatch { width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); box-shadow: 0 0 0 1px rgba(0,0,0,.3); cursor: pointer; flex: 0 0 auto; transition: transform .12s; }
.swatch:hover { transform: scale(1.12); }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
#colorPopover input[type=color] { width: 26px; height: 26px; padding: 0; border: 2px solid rgba(255,255,255,.5); border-radius: 50%; background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red); cursor: pointer; overflow: hidden; flex: 0 0 auto; }
#colorPopover input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
#colorPopover input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
#colorPopover input[type=color]::-moz-color-swatch { border: 0; border-radius: 50%; }

/* Panel bolumleri: ozellikler icerik kadar, katmanlar kalan alan */
#props-container { flex: 0 1 auto; }
#layers { flex: 1 1 120px; min-height: 100px; display: flex; flex-direction: column; border-top: 1px solid var(--line); }
#layers h3 { margin: 0; padding: 8px 12px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; border-bottom: 1px solid var(--line); }
@media (min-width: 900px) and (max-height: 820px) {
    :root { --ctl-h: 28px; }
    #propsBar { gap: 6px 8px; }
    #propsBar .pg { gap: 3px; }
    #propsBar .align-btn { width: 32px; }
    #props-container { padding: 8px 12px; }
    #props-container h3 { margin-bottom: 6px; }
}


.pop-sep { flex: 0 0 100%; font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
/* Saydam numune (damali) */
.swatch.clear, .csw.clear { background: conic-gradient(#fff 25%, #c9ced8 0 50%, #fff 0 75%, #c9ced8 0) 0 0 / 10px 10px; position: relative; }
.swatch.clear::after, .csw.clear::after { content: ''; position: absolute; left: 12%; right: 12%; top: 50%; height: 2px; background: #e5484d; transform: rotate(-45deg); border-radius: 2px; }
.swatch.clear { overflow: hidden; }

/* Gorsel efekt paneli */
#fxPopover { display: none; position: fixed; z-index: 45; width: 270px; max-height: calc(100vh - 16px); overflow-y: auto; padding: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
#fxPopover.open { display: block; }
@media (max-width: 899px) { #fxPopover { width: auto; max-height: 55vh; } }
.fx-title { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.fx-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fx-presets .toggle-btn { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.fx-sec { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.fx-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.fx-head .toggle-btn { height: 26px; min-width: 56px; padding: 0 8px; font-size: 11px; border-radius: 6px; }
.fx-row { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.fx-row label { flex: 0 0 66px; font-size: 11.5px; color: var(--muted); }
.fx-row input[type=range] { flex: 1; min-width: 0; height: 18px; margin: 0; }
.fx-dirs { display: flex; gap: 5px; }
.fx-dirs .toggle-btn { width: 34px; min-width: 34px; height: 28px; padding: 0; border-radius: 7px; }
input.rcolor { width: 26px; height: 26px; padding: 0; border: 2px solid rgba(255,255,255,.5); border-radius: 50%; background: none; cursor: pointer; overflow: hidden; }
input.rcolor::-webkit-color-swatch-wrapper { padding: 0; }
input.rcolor::-webkit-color-swatch { border: 0; border-radius: 50%; }
input.rcolor::-moz-color-swatch { border: 0; border-radius: 50%; }

.fx-hint { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.4; }

.icon-item.d3 { padding: 3px; background: #fff; }
.icon-item.d3 img { width: 100%; height: 100%; object-fit: contain; display: block; }
#iconGrid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.icon-item { min-width: 0; }
/* Susler (ayirici cizgiler): genis, iki hucre */
.icon-item.wide { grid-column: span 2; aspect-ratio: auto; padding: 4px 8px; }

/* Sekil menusu: renkli dolu simge dugmeleri */
.shp { width: 38px; height: 38px; padding: 6px; border-radius: 10px; border: 0; background: var(--c); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .12s, box-shadow .12s; }
.shp svg { width: 100%; height: 100%; display: block; fill: #fff; }
.shp:hover { transform: translateY(-2px) scale(1.08); box-shadow: 0 6px 12px rgba(0,0,0,.4); }

/* Secenekli bolumler: sade, tek vurgu rengi (turkuaz) */
:root { --teal: #19b5ad; }
.fx-chip { font-weight: 600; }
.fx-presets { display: grid; grid-template-columns: repeat(2, 1fr); }
.fx-presets .toggle-btn { padding: 0 4px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-sec { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.fx-sec .fx-head span { color: var(--teal); }
.fx-sec input[type=range] { accent-color: var(--teal); }
.fx-sec .fx-head .toggle-btn.on, .fx-dirs .toggle-btn.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.fx-title { color: var(--teal); }
.fx-colors { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; }
.fx-colors input[type=color] { width: 26px; height: 26px; padding: 0; border: 2px solid rgba(255,255,255,.5); border-radius: 50%; background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red); cursor: pointer; overflow: hidden; flex: 0 0 auto; }
.fx-colors input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.fx-colors input[type=color]::-webkit-color-swatch { border: 0; border-radius: 50%; }
#propsBar .pg-label, #props-container h3, #layers h3 { color: var(--teal); }
#propsBar input[type=range] { accent-color: var(--teal); }
#propsBar .toggle-btn.on { background: var(--teal); border-color: var(--teal); color: #fff; }
#propsBar .toggle-btn:hover:not(:disabled), #propsBar .align-btn:hover:not(:disabled) { border-color: var(--teal); }
/* Baslik solda (2 satir), dugmeler ayni satirda */
#propsBar .pg.inline { flex-direction: row; align-items: center; gap: 8px; }
#propsBar .pg.inline > .pg-label { flex: 0 0 58px; line-height: 1.2; }
#propsBar .pg.inline > .pg-row { flex: 1; flex-wrap: nowrap; gap: 4px; }
#propsBar .pg.inline .align-btn, #propsBar .pg.inline .toggle-btn { flex: 1 1 0; min-width: 0; width: auto; padding: 0; }
/* Genis ekran: Ozellikler genis sutun (tuvale yakin), Katmanlar dar sutun (en sagda) */
@media (min-width: 1200px) {
    #right-panel { flex: 0 0 calc(var(--sidebar-w) + 290px); flex-direction: row; }
    #props-container { flex: 1 1 auto; min-width: 0; overflow-x: hidden; }
    #layers { flex: 0 0 200px !important; border-top: 0 !important; border-left: 1px solid var(--line); min-height: 0; }
    #layerList { overflow-y: auto; min-height: 0; }
    #layers .layer-item { flex-wrap: wrap; }
}
}

.csw.big { width: 22px; height: 22px; border-radius: 6px; border: 2px solid rgba(255,255,255,.55); box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.color-trigger { width: 100%; }
.color-trigger .cval { flex: 1; text-align: left; font-weight: 600; }
#propsBar .color-pg { gap: 0; }
#propsBar .pg.inline input[type=range] { flex: 1 1 0; min-width: 0; width: 100%; margin: 0; }
#propsBar .pg.inline .pfield.size { flex: 0 0 64px; width: 64px; }
#propsBar .pg.inline .toggle-btn.on, #propsBar .pg.inline .toggle-btn { flex: 1 1 0; }

#props-container { overflow-x: hidden; }
#propsBar .pg.inline .align-btn, #propsBar .pg.inline .toggle-btn { min-width: 0; }
.font-trigger { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; cursor: pointer; }
.font-trigger .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-trigger:disabled { opacity: .35; cursor: default; }
#propsBar .pg.wide > .pg-row > .font-trigger { flex: 1 1 0; min-width: 0; }
#fontPopover { display: none; position: fixed; z-index: 46; width: 260px; max-height: 340px; overflow-y: auto; padding: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
#fontPopover.open { display: block; }
.fp-item { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 17px; line-height: 1.25; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fp-item:hover, .fp-item.on { background: color-mix(in srgb, var(--teal) 30%, transparent); }
.fp-item.on { outline: 1px solid var(--teal); }
@media (min-width: 1200px) {
    #layers .layer-name { flex: 1 1 calc(100% - 58px); }
    #layers .layer-btn { width: 34px; height: 30px; }
    #layers .layer-item { justify-content: flex-start; }
}
.font-trigger { height: var(--ctl-h, 32px); padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); font-size: 15px; }
.font-trigger:hover:not(:disabled) { border-color: var(--teal); }

/* Golge/3D paneli: kompakt akordiyon */
.fx-presets { grid-template-columns: repeat(4, 1fr) !important; gap: 5px; margin-bottom: 6px; }
.fx-presets .toggle-btn { height: 28px; font-size: 11.5px; }
.fx-sec { padding-top: 4px; margin-top: 4px; }
.fx-head { margin-bottom: 4px; }
.fx-acc { flex: 1; text-align: left; background: transparent; border: 0; color: var(--teal); font-weight: 700; font-size: 12.5px; cursor: pointer; padding: 4px 0; }
.fx-acc .caret { display: inline-block; width: 14px; }
.fx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-top: 4px; }
.fx-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fx-cell label { font-size: 11px; color: var(--muted); }
.fx-cell input[type=range] { width: 100%; margin: 0; height: 18px; accent-color: var(--teal); }
.fx-cell .fx-dirs { display: flex; gap: 4px; }
.fx-cell .fx-dirs .toggle-btn { flex: 1; width: auto; min-width: 0; height: 24px; }
#fxPopover { width: 280px; }
#shapeMenu, #iconPanel, #colorPopover { overflow-y: auto; }
/* Islemler: tek satir ikon dugmeleri */
#propsBar .pg-row.ops { flex-wrap: nowrap; gap: 6px; }
#propsBar .pg-row.ops .toggle-btn { flex: 1 1 0; min-width: 0; padding: 0; font-size: 15px; }
#propsBar .pg-row.ops .toggle-btn.danger { flex: 0 0 44px; margin-left: 8px; border-color: #e5484d; background: color-mix(in srgb, #e5484d 16%, transparent); }
#propsBar .pg-row.ops .toggle-btn.danger:hover:not(:disabled) { background: color-mix(in srgb, #e5484d 36%, transparent); border-color: #e5484d; }
.fx-sec .fx-row > label { flex: 0 0 36px; }
.fx-colors { gap: 5px; }
.fx-colors .swatch, .fx-colors input[type=color] { width: 22px; height: 22px; }

/* ---- Mobil: plakalık + defter üst çubuğu (ürün menüsü, fiyat) ve plakalık paneli ---- */
@media (max-width: 899px) {
    html body.plate-simple #right-panel { display: flex !important; flex: 0 0 auto !important; width: 100% !important; max-height: 36vh; overflow: auto; order: 0; border: 0; }
    html body.plate-simple #stage { order: 1; }
    #stage-header { flex-wrap: nowrap; gap: 6px; min-height: 0; }
    #stage-header #productMeta, #stage-header #customSizeInputs { display: none !important; }
    #stage-header #productSelect { flex: 1 1 auto; min-width: 0; max-width: 62vw; height: 32px; font-size: 12px; }
    #stage-header #designId { width: 46px; }
    #plateTabs { padding: 6px 8px !important; gap: 6px !important; }
    #plateTabs .pmenu { height: 32px !important; padding: 0 12px !important; font-size: 12px !important; letter-spacing: 0 !important; }
    #platePriceBar { padding: 6px 8px !important; gap: 6px !important; flex-wrap: nowrap !important; overflow-x: auto; }
    #platePriceBar .plab2 { display: none !important; }
    #platePriceBar .pbadge { height: 30px !important; padding: 0 9px !important; font-size: 12px !important; flex: 0 0 auto; }
    #platePriceBar #platePrice { font-size: 20px !important; padding: 5px 10px !important; flex: 0 0 auto; }
    body.plate-simple #plateBar { flex: 0 0 auto !important; overflow: visible; }
    body.plate-simple #plateBar .pcols { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
    body.plate-simple #plateBar .pcol { flex: 0 0 74%; scroll-snap-align: start; }
    body.plate-simple #plateBar .pchip { height: 36px; font-size: 12px; }
    html body.plate-simple #canvas-wrapper { padding: 8px 6px !important; align-items: center !important; }
    html body.plate-simple #canvas-wrapper .canvas-container { align-self: center !important; }
    #left-panel { padding: 0 4px !important; gap: 2px; justify-content: space-between !important; overflow-x: hidden !important; }
    #left-panel .side-tool { flex: 1 1 0; min-width: 0; width: auto; padding: 0 1px; font-size: 10px; }
    #left-panel .side-tool .ico { font-size: 18px; }
    #left-panel .side-divider { display: none; }
    #platePriceBar #platePrice { order: -1; margin-left: 0 !important; }
}

/* Site şeridi: editör açıkken site logosu hep görünür (Bridge::siteBar boş dönerse şerit yok). */
:root { --sitebar-h: 46px; }
#ds-sitebar { position: fixed; top: 0; left: 0; right: 0; height: var(--sitebar-h); z-index: 60; display: flex; align-items: center; padding: 0 14px; background: #fff; border-bottom: 1px solid #d1d9e6; }
#ds-sitebar .ds-sitebar__logo { display: inline-flex; align-items: center; text-decoration: none; color: #111; font-weight: 700; }
#ds-sitebar img { height: 30px; width: auto; max-width: 200px; display: block; object-fit: contain; }
html.has-sitebar body { padding-top: var(--sitebar-h); }
html.has-sitebar #status { top: calc(var(--sitebar-h) + 8px); }
@media (max-width: 899px) { :root { --sitebar-h: 40px; } #ds-sitebar img { height: 26px; } }

/* ---- Telefon/tablet (<900px): Instagram hikaye benzeri düzen ---- */
#mtop, #mTrash, #mName { display: none; }
@media (max-width: 899px) {
    html body.has-mname #mName { display: block; flex: 0 0 auto; height: 24px; padding: 0 12px; background: rgba(255, 255, 255, 0.92); border-bottom: 1px solid #d1d9e6; color: #1f2430; font: 700 12px/24px Montserrat, system-ui, sans-serif; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    /* Plakalikta secili sekme (Araba / Motor Plakasi) urunu zaten gosterir */
    html body.has-mname.plate-simple #mName { display: none; }
}
@media (max-width: 899px) {
    :root { --tools-h: 72px; --mtop-h: 54px; }
    #mtop { display: flex; position: fixed; top: var(--sitebar-h); left: 0; right: 0; height: var(--mtop-h); z-index: 55; align-items: center; gap: 8px; padding: 0 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
    #mtop .mbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 19px; line-height: 1; }
    #mtop .mbtn:disabled { opacity: .35; }
    #mtop .mprice { margin: 0 auto; padding: 7px 14px; border-radius: 999px; background: #0f766e; color: #fff; font-weight: 800; font-size: 15px; white-space: nowrap; }
    #mtop .msave { margin-left: auto; height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; }
    #mtop .mprice + .msave { margin-left: 0; }
    html body, html.has-sitebar body { padding-top: calc(var(--sitebar-h) + var(--mtop-h)); }
    html body #stage-header, html body #platePriceBar { display: none !important; }
    #left-panel #exitBtn, #left-panel #undoBtn, #left-panel #redoBtn, #left-panel .side-tool.primary { display: none !important; }
    #left-panel { flex: 0 0 var(--tools-h) !important; }
    /* alttan açılan panel: plakada renk/yazı sütunları, diğer ürünlerde özellikler */
    html body #right-panel {
        display: block !important; position: fixed !important; left: 0; right: 0; bottom: var(--tools-h); top: auto; width: auto !important;
        max-height: 30vh; overflow-y: auto; z-index: 40; background: #fff; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.35);
        opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .18s ease, visibility .18s;
    }
    html body.sheet-open #right-panel { opacity: 1; visibility: visible; pointer-events: auto; }
    html body.m-dragging #right-panel { opacity: 0 !important; pointer-events: none !important; }
    html body:not(.plate-simple) #right-panel #props-container { display: block; }
    html body #right-panel { flex-direction: column; }
    /* çöp kutusu */
    #mTrash { position: fixed; left: 50%; bottom: calc(var(--tools-h) + 18px); transform: translateX(-50%) scale(.8); width: 56px; height: 56px; border-radius: 50%; background: #ef4444; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 70; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
    body.m-dragging #mTrash { opacity: 1; }
    #mTrash.hot { transform: translateX(-50%) scale(1.3); background: #dc2626; }
    #canvas-wrapper { padding-top: 12px !important; }
}

/* Tuval portre telefonda üstte durur; alt panel açılınca nesneyi örtmez */
@media (max-width: 899px) and (orientation: portrait) {
    html body #canvas-wrapper, html body.plate-simple #canvas-wrapper { align-items: flex-start !important; padding-top: 10px !important; }
    html body #canvas-wrapper .canvas-container, html body.plate-simple #canvas-wrapper .canvas-container { align-self: flex-start !important; margin-top: 0 !important; }
}
/* Telefon yatay: araçlar solda dikey, üst şeritler ince, tuval geniş */
@media (max-width: 899px) and (orientation: landscape) and (max-height: 520px) {
    :root { --sitebar-h: 30px; --mtop-h: 44px; --tools-w: 66px; }
    #ds-sitebar img { height: 20px; }
    #mtop .mbtn { width: 34px; height: 34px; font-size: 16px; }
    #mtop .msave { height: 34px; padding: 0 14px; font-size: 13px; }
    #mtop .mprice { padding: 5px 12px; font-size: 14px; }
    html body, html.has-sitebar body { padding-left: var(--tools-w); }
    html body #left-panel { position: fixed !important; left: 0; top: calc(var(--sitebar-h) + var(--mtop-h)); bottom: 0; width: var(--tools-w) !important; flex: none !important; flex-direction: column !important; overflow-y: auto !important; justify-content: flex-start !important; padding: 4px !important; border-top: 0; border-right: 1px solid var(--line); z-index: 45; }
    #left-panel .side-tool { flex: 0 0 auto !important; height: 52px; }
    html body #right-panel, html body.plate-simple #right-panel { position: fixed !important; display: block !important; max-height: none !important; left: auto; right: 0; top: calc(var(--sitebar-h) + var(--mtop-h)); bottom: 0; width: 46vw !important; max-height: none; border-radius: 14px 0 0 14px; }
    html body.sheet-open #stage { margin-right: 46vw; }
    html body.plate-simple #plateBar .pcol { flex-basis: 88%; }
    #mTrash { bottom: 18px; }
    html body #canvas-wrapper, html body.plate-simple #canvas-wrapper { align-items: center !important; padding: 6px !important; }
    html body #canvas-wrapper .canvas-container, html body.plate-simple #canvas-wrapper .canvas-container { align-self: center !important; }
    #plateTabs { padding: 3px 8px !important; }
    #plateTabs .pmenu { height: 28px !important; }
}

/* Hikaye mantığı: sürüklerken / iki parmakla çalışırken arayüz çekilir */
#mtop, #left-panel { transition: opacity .15s; }
body.m-dragging #mtop, body.m-pinch #mtop, body.m-dragging #left-panel, body.m-pinch #left-panel { opacity: 0 !important; pointer-events: none !important; }
body.m-pinch #right-panel { opacity: 0 !important; pointer-events: none !important; }
body.in-touch .canvas-container { touch-action: none; }

/* Metin düzenleme çubuğu (klavyenin üstü) */
#mText { display: none; }
body.m-typing #mText { display: block; }
body.m-typing #left-panel, body.m-typing #right-panel { display: none !important; }
#mText .mt-done { position: fixed; right: 10px; top: calc(var(--sitebar-h) + 8px); z-index: 90; height: 38px; padding: 0 18px; border: 0; border-radius: 999px; background: #fff; color: #111; font-weight: 800; font-size: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
#mText .mt-sizebox { position: fixed; left: 6px; top: 28%; bottom: calc(var(--kb, 0px) + 130px); width: 36px; z-index: 90; display: flex; align-items: center; justify-content: center; }
#mText .mt-sizebox input { width: calc(100vh - var(--kb, 0px) - 310px); max-width: 260px; min-width: 100px; transform: rotate(-90deg); transform-origin: center; accent-color: #fff; }
#mText .mt-strip { position: fixed; left: 0; right: 0; z-index: 90; display: flex; gap: 8px; align-items: center; overflow-x: auto; padding: 8px 10px; background: rgba(17,20,28,.88); -webkit-overflow-scrolling: touch; }
#mText #mtFonts { bottom: var(--kb, 0px); }
#mText #mtColors { bottom: calc(var(--kb, 0px) + 54px); }
#mText .mt-sw { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); }
#mText .mt-sw.on { border-color: #fff; box-shadow: 0 0 0 3px #19B5AD; }
#mText .mt-font { flex: 0 0 auto; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; font-size: 15px; white-space: nowrap; }
#mText .mt-font.on { background: #fff; color: #111; }

/* ---- Küçük ekran / dokunmatik: şekil ve ikon pencereleri küçük, ikon iki adımlı ---- */
@media (max-width: 899px) {
    #shapeMenu { width: 252px; gap: 6px; padding: 8px; max-height: 60vh; }
    .shp { width: 30px; height: 30px; padding: 5px; border-radius: 8px; }
    #iconPanel { width: min(300px, calc(100vw - 16px)); max-height: 56vh; padding: 8px; gap: 6px; }
    #iconSearch { height: 36px; font-size: 13px; }
    #iconGrid { grid-template-columns: repeat(5, 1fr); min-height: 90px; }
    #iconCats { grid-template-columns: repeat(2, 1fr); }
    #iconCats button, #iconStyle button { height: 36px; font-size: 13px; }
}
#iconBack { display: none; }
/* Davetiye: sade ikon paneli (arama yok; iki sekme yan yana) */
#iconPanel.inv-simple #iconSearch, #iconPanel.inv-simple #iconBack { display: none !important; }
#iconPanel.inv-simple #iconCats { grid-template-columns: 1fr 1fr !important; }
#iconPanel.compact.step-grid #iconBack { display: block; height: 32px; border: 0; border-radius: 10px; background: var(--panel2); color: var(--text); font-weight: 700; text-align: left; padding: 0 10px; cursor: pointer; }
#iconPanel.compact.step-cats #iconGrid, #iconPanel.compact.step-grid #iconCats, #iconPanel.compact.step-grid #iconStyle { display: none; }
#iconPanel.compact.step-cats #iconCats { grid-template-columns: repeat(2, 1fr); }

/* ---- Plakalık renk paneli: Zemin / Renk ---- */
#mColor { display: none; }
@media (max-width: 899px) {
    html body.plate-simple #right-panel { display: none !important; }
    #mColor { position: fixed; left: 0; right: 0; bottom: var(--tools-h); z-index: 42; background: #fff; border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.35); padding: 8px 10px 12px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .18s, visibility .18s; display: block; max-height: 36vh; overflow-y: auto; }
    body.m-color-open #mColor { opacity: 1; visibility: visible; pointer-events: auto; }
    body.m-dragging #mColor, body.m-pinch #mColor, body.m-typing #mColor { opacity: 0 !important; pointer-events: none !important; }
}
#mColor .mc-tabs { display: flex; gap: 6px; align-items: center; }
#mColor .mc-tabs [data-t] { flex: 1; height: 36px; border: 0; border-radius: 10px; background: #eef1f6; color: #223; font-weight: 800; font-size: 14px; }
#mColor .mc-tabs [data-t].on { background: #19B5AD; color: #fff; }
#mColor .mc-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #eef1f6; font-size: 15px; }
#mColor .mc-name { margin: 6px 2px; font-size: 12px; font-weight: 700; color: #445; min-height: 16px; }
#mColor .mc-grid { display: flex; flex-wrap: wrap; gap: 8px; }
#mColor .mc-sw { position: relative; width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(0,0,0,.18); padding: 0; }
#mColor .mc-sw.on { border-color: #fff; box-shadow: 0 0 0 3px #19B5AD; }
#mColor .mc-sw i { position: absolute; right: -6px; top: -7px; font-style: normal; font-size: 9px; font-weight: 800; line-height: 1; padding: 2px 4px; border-radius: 8px; background: #f59e0b; color: #fff; }
@media (max-width: 899px) and (orientation: landscape) and (max-height: 520px) {
    #mColor { left: auto; right: 0; top: calc(var(--sitebar-h) + var(--mtop-h)); bottom: 0; width: 46vw; max-height: none; border-radius: 14px 0 0 14px; }
    html body.m-color-open #stage, html body.m-typing #stage { margin-right: 46vw; }
    #mText .mt-strip { left: auto; right: 0; width: 46vw; flex-wrap: wrap; overflow-y: auto; align-content: flex-start; }
    #mText #mtColors { top: calc(var(--sitebar-h) + var(--mtop-h)); bottom: auto; max-height: 38%; }
    #mText #mtFonts { top: calc(var(--sitebar-h) + var(--mtop-h) + 38%); bottom: var(--kb, 0px); }
    #mText .mt-done { right: 100px; top: calc(var(--sitebar-h) + 5px); }
    #mText .mt-sizebox { top: 30%; bottom: 20px; }
    #mText .mt-sizebox input { width: 40vh; }
}

/* Odakla düğmesi */
#mFocus { display: none; position: fixed; right: 10px; top: calc(var(--sitebar-h) + var(--mtop-h) + 52px); z-index: 50; height: 38px; padding: 0 14px; align-items: center; border: 0; border-radius: 999px; background: rgba(17,20,28,.88); color: #fff; font-weight: 800; font-size: 13px; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
body.m-dragging #mFocus, body.m-pinch #mFocus, body.m-typing #mFocus { display: none !important; }
@media (max-width: 899px) {
    html body #canvas-wrapper { justify-content: safe center; }
}

/* ---- YATAY telefon/tablet (kısa ekran): tek ince üst satır + solda araç sütunu + sağdan tek dar panel ---- */
@media (max-width: 899px) and (orientation: landscape) and (max-height: 520px) {
    :root { --sitebar-h: 0px; --mtop-h: 44px; }
    #ds-sitebar { width: 104px; height: var(--mtop-h); padding: 0 8px; border: 0; border-radius: 0 0 12px 0; z-index: 62; }
    #ds-sitebar img { height: 22px; max-width: 88px; }
    #mtop { padding-left: 112px; gap: 6px; }
    html.has-sitebar #status { top: calc(var(--mtop-h) + 6px); }
    #mFocus { top: calc(var(--mtop-h) + 40px); }
    /* tek panel sütunu: şekil ve ikon pencereleri de sağ sütuna oturur */
    html body #shapeMenu, html body #iconPanel { position: fixed !important; left: auto !important; right: 0 !important; top: var(--mtop-h) !important; bottom: 0 !important; width: 46vw !important; max-width: 46vw !important; max-height: none !important; transform: none !important; border-radius: 14px 0 0 14px; z-index: 44; }
    html body.m-panel-open #stage { margin-right: 46vw; }
    #mText .mt-done { top: 5px; right: 96px; }
}

@media (max-width: 899px) { html body #stage, html body #canvas-wrapper { min-height: 0; min-width: 0; } }

@media (max-width: 899px) { html.has-sitebar #status { top: calc(var(--sitebar-h) + var(--mtop-h) + 8px); } }
@media (max-width: 899px) and (orientation: landscape) and (max-height: 520px) { html.has-sitebar #status { top: calc(var(--mtop-h) + 8px); } }
@media (max-width: 899px) and (orientation: landscape) and (max-height: 520px) { #mFocus { right: auto; left: calc(var(--tools-w) + 10px); top: calc(var(--mtop-h) + 44px); } }

/* ---- YATAY: daha geniş tuval, yarı boyutta sıkı paneller ---- */
@media (max-width: 899px) and (orientation: landscape) and (max-height: 520px) {
    :root { --tools-w: 56px; --mtop-h: 40px; --pw: max(28vw, 210px); }
    #mtop .mbtn { width: 30px; height: 30px; font-size: 14px; }
    #mtop .msave { height: 30px; padding: 0 12px; font-size: 12px; }
    #mtop .mprice { padding: 4px 10px; font-size: 13px; }
    #ds-sitebar { width: 92px; }
    #ds-sitebar img { height: 20px; max-width: 78px; }
    #mtop { padding-left: 100px; }
    html body #left-panel { width: var(--tools-w) !important; padding: 2px !important; }
    #left-panel .side-tool { height: 46px; font-size: 9px; }
    #left-panel .side-tool .ico { font-size: 16px; }
    #plateTabs { padding: 2px 6px !important; }
    #plateTabs .pmenu { height: 24px !important; padding: 0 9px !important; font-size: 11px !important; }
    html body.m-color-open #stage, html body.m-typing #stage, html body.m-panel-open #stage { margin-right: var(--pw); }
    /* panel: içeriği kadar yüksek, dar kart */
    #mColor { width: var(--pw); top: var(--mtop-h); bottom: auto; max-height: calc(100vh - var(--mtop-h) - 6px); padding: 6px 8px 8px; border-radius: 0 0 0 12px; }
    #mColor .mc-tabs { gap: 4px; }
    #mColor .mc-tabs [data-t] { height: 30px; font-size: 10.5px; line-height: 1.1; padding: 0 3px; border-radius: 8px; }
    #mColor .mc-x { width: 26px; height: 26px; font-size: 12px; flex: 0 0 26px; }
    #mColor .mc-name { margin: 4px 1px; font-size: 10.5px; min-height: 0; }
    #mColor .mc-grid { gap: 6px; }
    #mColor .mc-sw { width: 26px; height: 26px; border-width: 1.5px; }
    #mColor .mc-sw i { font-size: 8px; right: -5px; top: -6px; padding: 1px 3px; }
    html body #shapeMenu, html body #iconPanel { width: var(--pw) !important; max-width: var(--pw) !important; bottom: auto !important; height: auto !important; top: var(--mtop-h) !important; max-height: calc(100vh - var(--mtop-h) - 6px) !important; overflow-y: auto; padding: 6px !important; gap: 5px !important; border-radius: 0 0 0 12px; }
    html body #shapeMenu { gap: 5px !important; }
    .shp { width: 26px; height: 26px; padding: 4px; border-radius: 7px; }
    #iconSearch { height: 30px; font-size: 12px; padding-left: 34px; background-position: 10px center; }
    #iconCats, #iconPanel.compact.step-cats #iconCats { grid-template-columns: 1fr; gap: 4px; }
    #iconCats button, #iconStyle button { height: 28px; font-size: 12px; }
    #iconPanel.compact.step-grid #iconBack { height: 28px; font-size: 12px; }
    #iconGrid { grid-template-columns: repeat(4, 1fr); gap: 4px; min-height: 0; }
    #mText .mt-strip, #mText #mtColors, #mText #mtFonts { width: var(--pw); padding: 5px 6px; gap: 6px; }
    #mText .mt-sw { width: 26px; height: 26px; }
    #mText .mt-font { height: 30px; padding: 0 10px; font-size: 12px; }
    #mText #mtColors { top: var(--mtop-h); max-height: none; }
    #mText #mtFonts { top: calc(var(--mtop-h) + 76px); }
    #mText .mt-done { top: 4px; right: 96px; height: 32px; font-size: 12px; padding: 0 14px; }
    #mFocus { height: 28px; font-size: 11px; padding: 0 11px; top: calc(var(--mtop-h) + 34px); left: calc(var(--tools-w) + 8px); }
}

/* =====================================================================
   Hikaye-7: ortak mobil yapı (tek alt panel + akordiyon), ortak renk paneli,
   açık zeminde koyu yazı, katman düğmeleri
   ===================================================================== */

/* --- Okunurluk: açık yüzeyde koyu yazı. Turkuaz dolgulu düğmelerde koyu yazı (beyaz yazı yetersiz kontrast). --- */
:root { --ink: #1b2230; --ink-muted: #475467; --teal-ink: #0f766e; --on-teal: #04201e; }
.toggle-btn.on, #propsBar .toggle-btn.on, .fx-sec .fx-head .toggle-btn.on, .fx-dirs .toggle-btn.on { color: var(--on-teal); font-weight: 700; }
.side-tool.primary { color: var(--on-teal); font-weight: 700; }
.layer-item { color: var(--text); }
.layer-item.active { color: var(--on-teal); font-weight: 700; }
.layer-item.active .layer-btn { color: var(--on-teal); background: rgba(255,255,255,.35); border-color: rgba(4,32,30,.35); }
.layer-btn.txt { width: auto; min-width: 0; padding: 0 8px; font-size: 12px; font-weight: 700; white-space: nowrap; }
@media (pointer: coarse) { .layer-btn.txt { width: auto; } }
#layers .lnote { padding: 0 2px 6px; font-size: 11px; font-style: italic; }
#propsBar .pg-row.ord { flex-wrap: nowrap; gap: 4px; }
#propsBar .pg-row.ord .toggle-btn { flex: 1 1 0; min-width: 0; padding: 0 2px; font-size: 11px; white-space: nowrap; }

/* --- Açık yüzeyler (mobil alt paneller): koyu yazı, koyu turkuaz başlık --- */
@media (max-width: 899px) {
    html body #right-panel, #mColor { color: var(--ink); --muted: var(--ink-muted); --teal: var(--teal-ink); }
    html body #right-panel .props-empty, html body #right-panel .empty { color: var(--ink-muted); }
    #mColor .mc-tabs [data-t].on { background: #19B5AD; color: var(--on-teal); }
    #mtop .msave { background: #19b5ad; color: var(--on-teal); }
    #mText .mt-sw.on { box-shadow: 0 0 0 3px #19B5AD; }
}

/* --- Sayfa sekmeleri (Ön / Arka kapak): ürün sekmelerinin hemen altı --- */
#mPages { display: none; }
@media (max-width: 899px) {
    #mPages { display: flex; gap: 6px; padding: 5px 8px; background: #1f2430; border-top: 1px solid #2f3648; flex: 0 0 auto; z-index: 6; }
    #mPages.off { display: none; }
    #mPages .mp { flex: 1; height: 30px; border: 0; border-radius: 9px; background: #2a3040; color: #e8ebf2; font-weight: 800; font-size: 12.5px; }
    #mPages .mp.on[data-s="front"] { background: #19b5ad; color: var(--on-teal); }
    #mPages .mp.on[data-s="back"] { background: #f0a3a3; color: #3b0a0a; }
    /* Özellikler içindeki eski Ön/Arka düğmeleri mobilde gizli (üstte sekme var) */
    #propsBar .pg-pages { display: none !important; }
    /* tuval: kalan alana ortalı, yanlarda 20px */
    html body #canvas-wrapper { padding-left: 20px !important; padding-right: 20px !important; padding-bottom: calc(10px + var(--inset-b, 0px)) !important; }
    html body.plate-simple #canvas-wrapper { padding: 8px 20px calc(8px + var(--inset-b, 0px)) !important; }
}
@media (max-width: 899px) and (orientation: portrait) {
    html body #canvas-wrapper, html body.plate-simple #canvas-wrapper { align-items: center !important; align-items: safe center !important; padding-top: 10px !important; }
    html body #canvas-wrapper .canvas-container, html body.plate-simple #canvas-wrapper .canvas-container { align-self: center !important; margin: auto !important; }
}

/* --- Tek alt panel: Özellikler / Katmanlar akordiyon --- */
#sheetMore, #layerCount { display: none; }
.acc { display: contents; }
.acc-h { display: none; }
.acc-b { display: contents; }
@media (max-width: 899px) {
    :root { --ctl-h: 29px; }
    html body #right-panel { max-height: 38vh; padding-bottom: 6px; }
    html body #props-container { padding: 8px 12px; gap: 8px; overflow: visible; }
    html body #props-container h3, html body #layers h3 {
        display: flex; align-items: center; gap: 6px; margin: 0; padding: 8px 2px; font-size: 12.5px; color: var(--teal-ink);
        border-bottom: 1px solid #d5dbe6; cursor: pointer; user-select: none; -webkit-user-select: none; min-height: 36px;
    }
    html body #props-container h3::before, html body #layers h3::before { content: '\25BE'; display: inline-block; width: 14px; font-size: 12px; transition: transform .15s; }
    html body #props-container.collapsed h3::before, html body #layers.collapsed h3::before { content: '\25B8'; }
    #layerCount { display: inline; font-weight: 600; color: var(--ink-muted); text-transform: none; }
    html body #props-container.collapsed #propsBar, html body #layers.collapsed #layerList { display: none; }
    html body #props-container.collapsed { padding-bottom: 0; }
    /* Katmanlar artık ayrı çekmece değil, aynı panelin bölümü */
    html body #layers.mobile-sheet { position: static; transform: none; visibility: visible; width: auto; max-height: none; border-radius: 0; box-shadow: none; flex: none; min-height: 0; background: transparent; padding: 0 12px; border-top: 0; }
    html body #layers #layerList { overflow: visible; padding: 6px 0 4px; flex: none; }
    /* akordiyon alt gruplar */
    #propsBar .acc { display: block; grid-column: 1 / -1; order: 3; border: 1px solid #d5dbe6; border-radius: 10px; overflow: hidden; background: #f6f8fb; }
    #propsBar .acc-h { display: flex; align-items: center; gap: 6px; width: 100%; height: 34px; padding: 0 10px; border: 0; background: transparent; color: var(--ink); font-weight: 700; font-size: 12.5px; text-align: left; cursor: pointer; }
    #propsBar .acc-h .acc-t { flex: 1; }
    #propsBar .acc-h .acc-c::before { content: '\25B8'; font-size: 12px; color: var(--teal-ink); }
    #propsBar .acc.open .acc-h .acc-c::before { content: '\25BE'; }
    #propsBar .acc-b { display: none; padding: 4px 10px 10px; }
    #propsBar .acc.open .acc-b { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    #propsBar .acc[data-acc="effect"] { order: 4; } #propsBar .acc[data-acc="adv"] { order: 5; }
    #propsBar .acc-main { display: contents; }
    #propsBar .acc-main > .pg { order: 1; }
    #propsBar .pg:not(.pg-pages) { order: 1; }
    #propsBar .pg-row.ops { order: 2; }
    #propsBar > .pg.wide:last-child { order: 2; }
    /* mobilde renk burada değil: ortak Renk paneli kullanılır (alt araç çubuğu: Renk) */
    #propsBar .color-pg { display: none !important; }
    /* "daha fazla" göstergesi + alt solma */
    html body #right-panel.has-more #sheetMore { display: block; }
    #sheetMore { position: sticky; bottom: 0; height: 0; text-align: center; pointer-events: none; z-index: 3; }
    #sheetMore span { position: absolute; left: 0; right: 0; bottom: 0; height: 42px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px; font-size: 12px; font-weight: 700; color: var(--teal-ink); background: linear-gradient(to bottom, rgba(255,255,255,0), #fff 70%); pointer-events: auto; cursor: pointer; }
    /* renk paneli: açık zemin, 10% sıkı */
    #mColor .mc-tabs [data-t] { height: 33px; font-size: 13px; }
    #mColor .mc-sw { width: 33px; height: 33px; }
    #mColor .mc-sw.clear { background: conic-gradient(#fff 25%, #c9ced8 0 50%, #fff 0 75%, #c9ced8 0) 0 0 / 10px 10px; position: relative; overflow: hidden; }
    #mColor .mc-sw.clear::after { content: ''; position: absolute; left: 12%; right: 12%; top: 50%; height: 2px; background: #e5484d; transform: rotate(-45deg); }
    #mColor .mc-custom { background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red); display: inline-block; overflow: hidden; padding: 0; }
    #mColor .mc-custom input { opacity: 0; width: 100%; height: 100%; cursor: pointer; }
    #mColor .mc-name { color: var(--ink); }
}
@media (max-width: 899px) and (orientation: landscape) and (max-height: 520px) {
    html body #right-panel { max-height: none; }
    #mColor .mc-sw { width: 26px; height: 26px; }
    #mColor .mc-tabs [data-t] { height: 30px; font-size: 10.5px; }
    #mPages .mp { height: 24px; font-size: 11px; }
    #mPages { padding: 2px 6px; }
}

/* Turkuaz dolgu: her yerde aynı açık turkuaz (#19b5ad) + koyu yazı */
@media (max-width: 899px) {
    html body #right-panel #propsBar .toggle-btn.on, html body #right-panel .fx-dirs .toggle-btn.on { background: #19b5ad; border-color: #19b5ad; color: var(--on-teal); }
}
#layers .layer-btn.txt { width: auto !important; min-width: 0; padding: 0 8px; }

/* ---- Masaüstü plakalık: işlem paneli plakanın altında, tam genişlikte; ekleme düğmeleri yalnız burada ---- */
@media (min-width: 900px) {
    html body.plate-simple { display: grid; grid-template-columns: var(--left-w) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
    html body.plate-simple #left-panel { grid-column: 1; grid-row: 1 / 3; }
    html body.plate-simple #stage { grid-column: 2; grid-row: 1; min-height: 0; }
    html body.plate-simple #right-panel { grid-column: 2; grid-row: 2; width: auto !important; flex: none !important; max-height: 44vh; border-left: 0; border-top: 3px solid #0f766e; overflow: auto; }
    html body.plate-simple #plateBar { border-top: 0; overflow: visible; }
    html body.plate-simple #plateBar .pcol { display: grid; grid-template-columns: 1fr 1fr; align-content: start; }
    html body.plate-simple #plateBar .pcol > .pch, html body.plate-simple #plateBar .pcol > .pmore, html body.plate-simple #plateBar .pcol > .psub, html body.plate-simple #plateBar .pcol > div { grid-column: 1 / -1; }
    /* sol çubukta ekleme düğmeleri yok (sağdaki sütunlarla aynıydı) */
    body.plate-simple #left-panel .side-tool[onclick^="addText"], body.plate-simple #left-panel .side-tool[onclick^="toggleShapeMenu"],
    body.plate-simple #left-panel .side-tool[onclick^="toggleIconPanel"], body.plate-simple #left-panel .side-tool[onclick*="imageInput"] { display: none; }
}

/* ---- Masaüstü plakalık paneli: koyu editör teması, tüm renkler açık, sütunlar hizalı ---- */
@media (min-width: 900px) {
    html body.plate-simple #right-panel { background: var(--panel); border-top-color: #19b5ad; }
    html body.plate-simple #plateBar { background: var(--panel); color: var(--text); }
    html body.plate-simple #plateBar .pcols { grid-template-columns: 1.35fr 1.1fr .85fr 1.35fr; align-items: stretch; }
    html body.plate-simple #plateBar .pcol { border-right: 1px solid var(--line); padding: 0 0 10px; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 0; }
    html body.plate-simple #plateBar .pcol:last-child { border-right: 0; }
    html body.plate-simple #plateBar .pch { padding: 9px 8px; margin: 0 0 8px; font-size: 11.5px; }
    html body.plate-simple #plateBar .pcol .pchip { width: calc(100% - 8px); margin: 0 4px 5px; height: 32px; background: var(--panel2); border-color: var(--line); color: var(--text); }
    html body.plate-simple #plateBar .pchip:hover { border-color: #19b5ad; }
    html body.plate-simple #plateBar .pchip.on { background: #19b5ad; border-color: #19b5ad; color: var(--on-teal); font-weight: 800; box-shadow: none; }
    html body.plate-simple #plateBar .pchip i { border-color: rgba(255,255,255,.6); }
    html body.plate-simple #plateBar .pchip b { color: #fbbf24; }
    html body.plate-simple #plateBar .pchip.on b { color: var(--on-teal); }
    html body.plate-simple #plateBar .pprim { background: #19b5ad; border-color: #19b5ad; color: var(--on-teal); font-weight: 800; }
    html body.plate-simple #plateBar .pprim:hover { background: #3ed1c9; border-color: #3ed1c9; }
    html body.plate-simple #plateBar .pdel { background: transparent; border-color: #ef4444; color: #ff9b9b; }
    html body.plate-simple #plateBar .psub { color: var(--muted); border-top-color: var(--line); }
    /* yalnız yazı tipi sütunu kendi içinde kayar */
    html body.plate-simple #plateBar .pcol.pfonts { max-height: calc(44vh - 14px); overflow-y: auto; }
}
@media (min-width: 900px) {
    html body.plate-simple #plateBar .pcol .pchip.pprim { background: #19b5ad; border-color: #19b5ad; color: var(--on-teal); font-weight: 800; }
    html body.plate-simple #plateBar .pcol .pchip.pprim:hover { background: #3ed1c9; border-color: #3ed1c9; }
    html body.plate-simple #plateBar .pcol .pchip.pdel { background: transparent; border-color: #ef4444; color: #ff9b9b; font-weight: 700; }
    html body.plate-simple #plateBar .pcol .pchip.pfont.on { background: #19b5ad; color: var(--on-teal); }
    html body.plate-simple #plateBar .pcol .pchip.on { box-shadow: inset 0 0 0 2px #fff; }
}
@media (min-width: 900px) {
    html body.plate-simple #plateBar .pch { font-size: 13px; font-weight: 600; text-align: center; letter-spacing: .3px; }
}
@media (min-width: 900px) { html body.plate-simple #plateBar .pcol.pfonts { margin-top: -2px; } }

/* ---- Masaüstü sol menü: üstte araçlar, ortada boşluk, en altta Kaydet (plakalıkta da aynı) ---- */
@media (min-width: 900px) {
    html body #left-panel .side-tool.primary { margin-top: auto; }
    html body #left-panel { padding-bottom: 14px; }
}
@media (min-width: 900px) { html body.plate-simple #left-panel .side-divider:first-of-type { display: none; } }

/* ---- Hikaye-12: sol menü %25 büyük (masaüstü), alt başlıklar yarı kalın, yazı tipi listesi sakin ---- */
@media (min-width: 900px) {
    :root { --left-w: 88px; }
    html body #left-panel .side-tool { width: 62px; height: 62px; font-size: 12.5px; gap: 3px; border-radius: 12px; }
    html body #left-panel .side-tool .ico { font-size: 25px; }
    html body #left-panel .side-divider { width: 38px; }
}
@media (min-width: 900px) and (max-height: 760px) {
    html body #left-panel .side-tool { height: 54px; }
    html body #left-panel { gap: 8px; padding-top: 8px; }
}
#propsBar .pg-label, #propsBar .acc-h, #plateBar .psub, .fx-acc, .fx-head span, .pop-sep { font-weight: 600; }
/* yazı tipi listesi: isim ince ve düz, yanında kendi yazı tipiyle "Aa" örneği */
#plateBar .pfont { font-weight: 400; }
#plateBar .pfont .fn { font-weight: 400; font-size: 12px; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; }
#plateBar .pfont .fa { flex: 0 0 34px; font-size: 16px; line-height: 1; text-align: center; padding-right: 6px; margin-right: 2px; border-right: 1px solid rgba(128,128,128,.45); font-weight: 400; }


/* ---- Telefon/tablet: fiyat gösterilmez (editörde para rakamı baskı yaratır; fiyat sepette) ---- */
@media (pointer: coarse) {
    #mtop #mPrice, #platePriceBar, #platePrice { display: none !important; }
    #mtop .mprice + .msave, #mtop .msave { margin-left: auto; }
    .mc-sw i { display: none !important; }
}
/* ---- Telefon/tablet: yatay modda editör kapalı ---- */
#dsRotate { display: none; }
body.ds-land-block #dsRotate { position: fixed; inset: 0; z-index: 2147483000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; background: #0f1218; color: #fff; }
body.ds-land-block #dsRotate .dsr-ico { font-size: 56px; line-height: 1; color: #19b5ad; }
body.ds-land-block #dsRotate .dsr-t { font-size: 20px; font-weight: 700; }
body.ds-land-block #dsRotate .dsr-s { font-size: 14px; opacity: .75; max-width: 420px; }
body.ds-land-block { overflow: hidden; }


/* ---- Özellikler paneli daha az yer kaplar (telefon/tablet) ---- */
.flip-ic { display: none !important; }
@media (max-width: 899px) {
    .flip-ic { display: inline-flex !important; }
    #propsBar .flip-row { display: none !important; }
    /* Çözünürlük tek satır */
    #propsBar .pg-dpi { display: flex; flex-direction: row !important; flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
    #propsBar .pg-dpi .pg-label { flex: 0 0 auto; }
    #propsBar .pg-dpi .pg-row { display: inline-flex; flex: 0 0 auto; }
    #propsBar .pg-dpi .pg-dpi-note { margin: 0 !important; flex: 1 1 auto; min-width: 0; }
    /* Hizala / Efekt / Açı·Sıra: yan yana sekmeler, içerik altta açılır */
    #propsBar { grid-template-columns: repeat(6, 1fr); gap: 6px 6px; }
    #propsBar > .pg:not(.wide), #propsBar .acc-main > .pg:not(.wide) { grid-column: span 3; }
    #propsBar .acc { display: contents; border: 0; background: transparent; overflow: visible; }
    #propsBar .acc-h { grid-column: span 2; order: 3; height: 32px; padding: 0 4px; justify-content: center; border: 1px solid #d5dbe6; border-radius: 8px; background: #f6f8fb; }
    #propsBar .acc[data-acc="effect"] .acc-h { order: 4; } #propsBar .acc[data-acc="adv"] .acc-h { order: 5; }
    #propsBar .acc-h .acc-t { flex: 0 1 auto; text-align: center; white-space: nowrap; }
    #propsBar .acc-h .acc-c { display: none; }
    #propsBar .acc.open .acc-h { background: #19b5ad; border-color: #19b5ad; color: var(--on-teal); }
    #propsBar .acc-b { display: none; }
    #propsBar .acc.open .acc-b { display: grid; grid-column: 1 / -1; order: 6; grid-template-columns: 1fr 1fr; gap: 8px; padding: 2px 0 6px; }
    #propsBar .acc[data-acc="effect"].open .acc-b, #propsBar .acc[data-acc="adv"].open .acc-b { order: 6; }
}
/* Tablet dikey: Özellikler ve Katmanlar yan yana */
@media (min-width: 700px) and (max-width: 899px) {
    html body #right-panel { display: grid !important; grid-template-columns: 3fr 2fr; align-items: start; column-gap: 0; overflow: auto; }
    html body #right-panel #layers.mobile-sheet { border-left: 1px solid #d5dbe6; padding-left: 12px; }
    html body #right-panel #sheetMore { display: none !important; }
}

/* Her ürün kendi tuvalinde açılır: başlıktaki ürün seçme kutusu gizli (plakalıkta araba/motor üst sekmelerden seçilir) */
#stage-header #productSelect, #stage-header #customSizeInputs { display: none !important; }

/* "← Geri" menüsü (tüm ürünler): ürün sayfası / kategori / sepet / tüm ürünler / ana sayfa */
#dsExitMenu { position: fixed; z-index: 99998; display: flex; flex-direction: column; gap: 4px; min-width: 250px; max-width: calc(100vw - 24px); padding: 10px; border-radius: 12px; background: #fff; box-shadow: 0 10px 34px rgba(0, 0, 0, .3); font: 14px Montserrat, system-ui, sans-serif; color: #1f2933; }
#dsExitMenu b { padding: 2px 6px 6px; font-size: 13px; color: #475569; }
#dsExitMenu button { min-height: 42px; padding: 8px 12px; border: 1px solid #e2e8f0; border-radius: 9px; background: #f8fafc; color: #1f2933; font: 700 14px Montserrat, system-ui, sans-serif; text-align: left; cursor: pointer; }
#dsExitMenu button:hover, #dsExitMenu button:focus-visible { border-color: var(--ds-accent, #0f766e); background: #fff; outline: none; }
#dsExitMenu.sheet { left: 12px; right: 12px; bottom: 12px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
/* Telefonda üst çubuk: ✕ yerine yazılı "← Geri" */
#mtop .mbtn.mback { width: auto; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 800; white-space: nowrap; }
