/* Kuyumcu ekran tasarımı (studyo.js). TV ve stüdyo önizlemesi ortak kullanır. Ölçüler tuvalin hücre boyuna bağlıdır. */
.ek-tuval {
    --ek-zemin: #07090d; --ek-panel: #0e131b; --ek-baslik: #131a24; --ek-yazi: #f5f7fa; --ek-soluk: #8590a0;
    --ek-vurgu: #f5a623; --ek-satis: #fbd38d; --ek-cizgi: #1c2430; --ek-kose: 14px; --ek-bosluk: 6px;
    position: relative; overflow: hidden; background: var(--ek-zemin); color: var(--ek-yazi);
    font-family: 'Inter', sans-serif; user-select: none; -webkit-user-select: none;
}
.ek-tuval * { box-sizing: border-box; margin: 0; padding: 0; }
.ek-tuval.ek-katman { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }   /* sayfa geçişinde yeni sayfanın katmanı */
.ek-blok { position: absolute; padding: calc(var(--ek-bosluk) / 2); }
.ek-ic { width: 100%; height: 100%; overflow: hidden; border-radius: var(--ek-kose); line-height: 1.1; color: var(--blok-renk, var(--ek-yazi)); }
.zemin-panel > .ek-ic { background: var(--ek-panel); border: 1px solid var(--ek-cizgi); }
.zemin-vurgu > .ek-ic { background: var(--ek-panel); border: 1px solid var(--ek-vurgu); }
.zemin-vurgu > .ek-ic { background: radial-gradient(120% 160% at 0% 0%, color-mix(in srgb, var(--ek-vurgu) 22%, transparent), transparent 62%), var(--ek-panel); border: 1px solid color-mix(in srgb, var(--ek-vurgu) 40%, transparent); }
.zemin-yok > .ek-ic { background: none; border: 0; }
.ek-fiyat { font-weight: 800; font-feature-settings: 'tnum' 1, 'lnum' 1; white-space: nowrap; letter-spacing: -.01em; transition: background-color 1.2s ease; border-radius: .2em; }
.ek-fiyat.alis { color: var(--ek-soluk); font-weight: 600; }
.ek-fiyat.satis { color: var(--blok-renk, var(--ek-satis)); }
.ek-fiyat.yukari { animation: ek-yukari 1.6s ease; }
.ek-fiyat.asagi { animation: ek-asagi 1.6s ease; }
@keyframes ek-yukari { from { background-color: rgba(34,197,94,.35); } to { background-color: transparent; } }
@keyframes ek-asagi { from { background-color: rgba(239,68,68,.35); } to { background-color: transparent; } }
.ek-birim { color: var(--ek-soluk); font-weight: 700; font-size: .45em; margin-left: .2em; }
.ek-bos { display: grid; place-items: center; height: 100%; color: var(--ek-soluk); font-size: 14px; opacity: .7; }
.ek-tuval.eski .ek-fiyat { visibility: hidden; }

/* Tablo */
.ek-tablo { display: grid; }
.ek-tbas, .ek-satir { display: grid; align-items: center; column-gap: .6em; padding: 0 .8em; }
.ek-tablo.k3 .ek-tbas, .ek-tablo.k3 .ek-satir { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); }
.ek-tablo.k2 .ek-tbas, .ek-tablo.k2 .ek-satir { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.ek-tbas { background: var(--ek-baslik); padding-top: calc(.5em * var(--bas-yuk, 1) / var(--bas-boyut, 1)); padding-bottom: calc(.5em * var(--bas-yuk, 1) / var(--bas-boyut, 1)); font-size: calc(.46em * var(--bas-boyut, 1)); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ek-soluk); }
.ek-tbas span:not(:first-child) { text-align: right; }
.ek-tbaslik { color: var(--ek-vurgu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ek-satir:nth-child(odd) { background: color-mix(in srgb, var(--ek-yazi) 3%, transparent); }
.ek-satir .ek-ad { font-weight: 700; font-size: .9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ek-satir .ek-fiyat { text-align: right; overflow: hidden; }
/* Fiyat sütunları en uzun fiyata göre genişler, satırlar hizalı kalır (subgrid); desteklemeyen eski TV'de yukarıdaki oranlar */
@supports (grid-template-columns: subgrid) {
    .ek-tablo.k3 { grid-template-columns: minmax(0, 1fr) max-content max-content; column-gap: .6em; }
    .ek-tablo.k2 { grid-template-columns: minmax(0, 1fr) max-content; column-gap: .6em; }
    .ek-tablo.k3 > .ek-tbas, .ek-tablo.k3 > .ek-satir, .ek-tablo.k2 > .ek-tbas, .ek-tablo.k2 > .ek-satir { grid-column: 1 / -1; grid-template-columns: subgrid; }
    .ek-satir .ek-fiyat { overflow: visible; }
    .ek-tablo > .ek-bos { grid-column: 1 / -1; }
}

/* Tek ürün (büyük kart) */
.ek-tek { display: flex; align-items: center; justify-content: space-between; gap: 1em; padding: 0 1.2em; }
.ek-tek-sol { min-width: 0; }
.ek-tek-sol small { display: block; font-size: .36em; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--ek-soluk); margin-bottom: .35em; }
.ek-tek-sol .ek-ad { display: block; font-size: .95em; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Kart darsa fiyat küçülür, ürün adı kesilmez (gerekirse iki satır) */
@supports (container-type: inline-size) {
    .ek-tek { container-type: inline-size; }
    .ek-tek-sol { flex: 0 0 auto; max-width: 38%; }
    .ek-tek-sol .ek-ad { white-space: normal; overflow: visible; overflow-wrap: anywhere; line-height: 1.1; }
    .ek-tek .ek-fiyat.buyuk { font-size: min(2.3em, 12cqw); }
}
.ek-tek-sag { text-align: right; }
.ek-tek-fiyat { display: flex; align-items: baseline; justify-content: flex-end; gap: .3em; }
.ek-tek-fiyat small { font-size: .3em; font-weight: 700; color: var(--ek-soluk); letter-spacing: .12em; text-transform: uppercase; margin-right: .4em; }
.ek-fiyat.buyuk { font-size: 2.3em; font-weight: 900; letter-spacing: -.03em; line-height: 1; color: var(--blok-renk, var(--ek-vurgu)); }
.ek-tek-fiyat.alis .ek-fiyat.buyuk { color: var(--ek-soluk); font-weight: 700; }
.ek-tek-fiyat + .ek-tek-fiyat { margin-top: .15em; }
.ek-tek-fiyat .ek-birim { font-size: .9em; }

/* Kartlar (döviz şeridi vb.) */
.zemin-panel > .ek-kartlar, .zemin-vurgu > .ek-kartlar { background: none; border: 0; }
.ek-kartlar { display: grid; gap: var(--ek-bosluk); }
.ek-kart { display: flex; align-items: center; justify-content: space-between; gap: .6em; padding: 0 .9em; min-width: 0; border-radius: var(--ek-kose); background: var(--ek-panel); border: 1px solid var(--ek-cizgi); }
.zemin-yok .ek-kart { background: none; border: 0; }
.ek-kart .ek-ad { font-size: .6em; font-weight: 700; color: var(--ek-soluk); letter-spacing: .05em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ek-kart-fiyat { display: flex; align-items: baseline; gap: .5em; }
.ek-kart .ek-fiyat.satis { color: var(--blok-renk, var(--ek-yazi)); }
.ek-kart .ek-fiyat.alis { font-size: .8em; }

/* Yazı, kayan yazı, saat, görsel */
.tur-yazi > .ek-ic { display: flex; align-items: center; padding: 0 .3em; color: var(--blok-renk, var(--ek-vurgu)); }
.ek-yazi-ic { width: 100%; white-space: pre; overflow: hidden; line-height: 1.15; }
.ek-yazi-ic.sabit { white-space: pre-wrap; overflow-wrap: anywhere; }
.hiza-orta .ek-yazi-ic, .hiza-orta.tur-saat .ek-ic { text-align: center; }
.hiza-sag .ek-yazi-ic, .hiza-sag.tur-saat .ek-ic { text-align: right; }
.tur-kayan > .ek-ic { display: flex; align-items: center; white-space: nowrap; background: var(--ek-vurgu); color: var(--blok-renk, #111); border: 0; }
.zemin-yok.tur-kayan > .ek-ic { background: none; color: var(--blok-renk, var(--ek-yazi)); }
.ek-kayan-ic { display: inline-block; padding-left: 100%; animation: ek-kay linear infinite; animation-duration: 20s; }
@keyframes ek-kay { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.tur-saat > .ek-ic { display: flex; flex-direction: column; justify-content: center; padding: 0 .4em; }
.ek-saat-s { font-size: 1em; font-feature-settings: 'tnum' 1; }
.ek-saat-t { font-size: .34em; font-weight: 600; color: var(--ek-soluk); margin-top: .25em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tur-gorsel img { width: 100%; height: 100%; display: block; border-radius: var(--ek-kose); }

/* Stüdyo düzenleme görünümü */
.ek-blok.duzenle { cursor: grab; touch-action: none; }
.ek-blok.duzenle::after { content: ''; position: absolute; inset: calc(var(--ek-bosluk) / 2); border-radius: var(--ek-kose); outline: 1px dashed rgba(255,255,255,.28); outline-offset: -1px; pointer-events: none; }
.ek-blok.secili { z-index: 5; }
.ek-blok.secili::after { outline: 2px solid #3b82f6; outline-offset: -2px; }
.ek-blok.suruklen { cursor: grabbing; opacity: .85; }
.ek-tuval.izgarali { background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: var(--ek-hucre-x) var(--ek-hucre-y); }

@media (prefers-reduced-motion: reduce) { .ek-kayan-ic { animation-duration: 60s !important; } .ek-fiyat.yukari, .ek-fiyat.asagi { animation: none; } }
/* Dar kartlarda ad üstte, fiyat altta */
.ek-kartlar.ust-alt .ek-kart { flex-direction: column; justify-content: center; align-items: flex-start; gap: .15em; }
.ek-kartlar.ust-alt .ek-kart .ek-ad { font-size: .5em; }

/* Sürüm 2: özel zemin, dikey hizalama, şekil, sabit punto */
.zemin-renk > .ek-ic { background: var(--blok-zemin); border: 0; }
.tur-yazi.dhiza-ust > .ek-ic, .tur-saat.dhiza-ust > .ek-ic { align-items: flex-start; justify-content: flex-start; }
.tur-yazi.dhiza-alt > .ek-ic { align-items: flex-end; }
.tur-saat.dhiza-alt > .ek-ic { justify-content: flex-end; }
.ek-saat-t.yalniz { font-size: .8em; margin: 0; }
.tur-sekil > .ek-ic { background: var(--blok-renk, var(--ek-vurgu)); border: 0; }
.tur-sekil > .ek-ic.sekil-daire { border-radius: 50%; }
.tur-sekil > .ek-ic.sekil-cizgi { background: none; display: flex; align-items: center; justify-content: center; }
.ek-cizgi { display: block; background: var(--blok-renk, var(--ek-vurgu)); border-radius: 99px; }
.ek-cizgi.yatay { width: 100%; height: max(2px, calc(var(--ek-hucre) * .22)); }
.ek-cizgi.dikey { height: 100%; width: max(2px, calc(var(--ek-hucre) * .22)); }

/* Stüdyo: 8 tutamak */
.ek-tutamak { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; border: 2px solid #3b82f6; touch-action: none; z-index: 6; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.t-nw { left: 0; top: 0; cursor: nwse-resize; } .t-n { left: 50%; top: 0; cursor: ns-resize; } .t-ne { left: 100%; top: 0; cursor: nesw-resize; }
.t-e { left: 100%; top: 50%; cursor: ew-resize; } .t-se { left: 100%; top: 100%; cursor: nwse-resize; } .t-s { left: 50%; top: 100%; cursor: ns-resize; }
.t-sw { left: 0; top: 100%; cursor: nesw-resize; } .t-w { left: 0; top: 50%; cursor: ew-resize; }
@media (pointer: coarse) { .ek-tutamak { width: 22px; height: 22px; margin: -11px 0 0 -11px; } .t-n, .t-s, .t-e, .t-w { display: none; } }
.ek-yazi-ic[contenteditable=true] { outline: none; cursor: text; user-select: text; -webkit-user-select: text; white-space: pre-wrap; }

/* Klasik (analog) saat — renkler temadan */
.ek-analog { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.ek-analog svg { height: 100%; max-width: 100%; aspect-ratio: 1; }
.ek-analog .kadran { fill: var(--ek-panel, transparent); stroke: var(--ek-vurgu); stroke-width: 1.6; }
.ek-analog .kalin { stroke: var(--ek-yazi); stroke-width: 2.2; stroke-linecap: round; }
.ek-analog .ince { stroke: var(--ek-soluk); stroke-width: 1.2; stroke-linecap: round; }
.ek-analog .akrep { stroke: var(--ek-yazi); stroke-width: 4; stroke-linecap: round; }
.ek-analog .yelkovan { stroke: var(--ek-yazi); stroke-width: 2.6; stroke-linecap: round; }
.ek-analog .saniye { stroke: var(--ek-vurgu); stroke-width: 1.1; stroke-linecap: round; }
.ek-analog .merkez { fill: var(--ek-vurgu); }
