/* ==========================================================================
   Borsa — "seans tabelası"
   --------------------------------------------------------------------------
   Referans, matbu borsa bülteni ve gerçek işlem terminalleri: cetvelli
   sütunlar, tabular monospace rakamlar, süs yok. Kural şu — RENK BİLGİDİR.
   Ekranda yalnızca iki yerde renk vardır: değişim sütunu (yeşil/kırmızı) ve
   pirinç sarısı aksan (aktif bölüm, odak). Geri kalan her şey gri tonlarda.

   Rakamların tamamı monospace ve tabular; 1000 kağıtlık ızgarada basamaklar
   alt alta hizalanır ve değişim sütunu dikey cetveller oluşturur.
   ========================================================================== */

:root {
    color-scheme: dark;

    --paper: #0f1216;
    --panel: #151920;
    --panel-2: #1b202a;

    --rule: #232935;
    --rule-strong: #313a49;

    --ink: #dfe3ea;
    --ink-dim: #8792a3;
    --ink-faint: #5c6675;

    --up: #34b578;
    --down: #e0484c;
    --up-bg: rgba(52, 181, 120, 0.10);
    --down-bg: rgba(224, 72, 76, 0.10);
    /* Satir flasi (app.js flashRow): --up-bg zemin icin dogru ama flas icin
       fazla soluk — flasin gorunur olmasi icin biraz daha dolu ton. */
    --up-soft: rgba(52, 181, 120, 0.16);
    --down-soft: rgba(224, 72, 76, 0.16);

    /* Tek aksan: pirinç. Portföyün ağırlığı altın/gümüş, tabelanın rengi de bu. */
    --brass: #c9962f;
    --brass-bg: rgba(201, 150, 47, 0.12);

    --sans: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
    --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

    --r: 3px;
    --gutter: clamp(14px, 2.4vw, 28px);
    --shadow: 0 18px 44px -18px rgba(0, 0, 0, 0.8);

    /* Kinetik Tabela: tek yavaşlama eğrisi. Hareket hızlı doğar, yavaş ölür;
       her geçiş aynı imzayı taşır ki ekran tek elden çıkmış gibi dursun. */
    --ease-exp: cubic-bezier(0.16, 1, 0.3, 1);
}

body.light-theme {
    color-scheme: light;

    --paper: #f4f6f8;
    --panel: #ffffff;
    --panel-2: #eef1f5;

    --rule: #dde2e9;
    --rule-strong: #c3ccd8;

    --ink: #171c24;
    --ink-dim: #5d6875;
    --ink-faint: #8a94a2;

    --up: #10814f;
    --down: #c2333a;
    --up-bg: rgba(16, 129, 79, 0.09);
    --down-bg: rgba(194, 51, 58, 0.09);
    --up-soft: rgba(16, 129, 79, 0.14);
    --down-soft: rgba(194, 51, 58, 0.14);

    --brass: #8a6414;
    --brass-bg: rgba(138, 100, 20, 0.10);

    --shadow: 0 18px 44px -20px rgba(23, 28, 36, 0.30);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100svh;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.hidden { display: none !important; }
.ta-r { text-align: right; }

/* Rakam gören her şey monospace ve tabular */
.price, .cur, .chg, .m-price, .m-chg, .stat .v, .fut-v, .hm-val, .hm-chg,
.pf-total, .pf-chip, .pf-row-value, .pf-row-chg, .pf-realized,
.dr-hero-val, .dr-row-value, .dr-row-chg, .dr-row-sub,
.txn-qty, .txn-cost, .txn-real, .updated, .code, .hm-sym, .pf-row-sym,
.txn-sym, .dr-row-sym, .imp-row, .foot-summary, .summary-row {
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum" 1, "zero" 1;
}

::selection { background: var(--brass); color: var(--paper); }

* { scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border: 4px solid transparent; background-clip: content-box; }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 1px; }

/* ==========================================================================
   Üst bar
   ========================================================================== */
.topbar {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; flex-wrap: wrap;
    gap: 10px 18px;
    padding: 0 var(--gutter);
    min-height: 52px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
}

.brand { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; }
/* Marka işareti: yükseliş/düşüş çubukları — tabelanın kendi dili */
.mark {
    width: 14px; height: 16px;
    background:
        linear-gradient(var(--up) 0 0) 0 100% / 3px 10px no-repeat,
        linear-gradient(var(--ink-faint) 0 0) 5.5px 100% / 3px 16px no-repeat,
        linear-gradient(var(--down) 0 0) 11px 100% / 3px 6px no-repeat;
}
.wordmark {
    font-family: var(--mono);
    font-size: 14px; font-weight: 600;
    letter-spacing: 0.16em; text-transform: uppercase;
}

.search-field { position: relative; flex: 1 1 180px; min-width: 0; max-width: 320px; }
.search-icon {
    position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
    width: 14px; height: 14px;
    fill: none; stroke: var(--ink-faint); stroke-width: 1.4; stroke-linecap: round;
    pointer-events: none;
}
#search {
    width: 100%; padding: 6px 10px 6px 28px;
    border: 1px solid var(--rule); border-radius: var(--r);
    background: var(--panel); color: var(--ink);
    font: inherit; font-size: 13px;
    transition: border-color .12s;
}
#search::placeholder { color: var(--ink-faint); }
#search:focus { outline: none; border-color: var(--brass); }
#search::-webkit-search-cancel-button { filter: grayscale(1); opacity: .5; }

.status { display: flex; align-items: center; gap: 14px; flex: 0 1 auto; flex-wrap: wrap; }
.controls { display: flex; align-items: center; gap: 6px; }

/* Piyasa durumu: etiket + sayı, rozet değil */
.market-state {
    display: inline-flex; align-items: baseline; gap: 7px;
    font-size: 12px; color: var(--ink-dim); white-space: nowrap;
}
.market-state b { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; border-left: 2px solid currentColor; padding-left: 7px; }
.market-state.bullish b { color: var(--up); }
.market-state.bearish b { color: var(--down); }
.market-state.neutral b { color: var(--ink); }
.market-state:empty { display: none; }

/* Veri akışı göstergesi */
.feed-state { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.dot.online { background: var(--up); }
.dot.offline { background: var(--down); }
.updated { font-size: 11px; color: var(--ink-faint); white-space: nowrap; }
.updated.stale { color: var(--brass); }

/* ==========================================================================
   Düğmeler — tek bir yüzey, varyantlar
   ========================================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 28px; padding: 0 11px;
    border: 1px solid var(--rule); border-radius: var(--r);
    background: var(--panel); color: var(--ink);
    font: inherit; font-size: 12.5px; font-weight: 500;
    white-space: nowrap; cursor: pointer;
    transition: border-color .12s, background .12s, color .12s, filter .12s, transform .12s ease-out;
}
.btn:hover { border-color: var(--rule-strong); background: var(--panel-2); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--rule); background: var(--panel); }

.btn-icon { width: 28px; padding: 0; }
.btn-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
#soundToggle.is-muted { color: var(--ink-faint); }
#soundToggle.is-muted svg path:last-child { opacity: .25; }
#themeToggle.is-light svg circle { fill: currentColor; }

.btn-key { padding: 0 7px; gap: 3px; color: var(--ink-faint); }
.btn-key kbd {
    font-family: var(--mono); font-size: 10px; font-weight: 500;
    padding: 1px 3px; border: 1px solid var(--rule); border-radius: 2px;
}
.btn-primary { background: var(--brass); border-color: var(--brass); color: #14171c; font-weight: 600; }
.btn-primary:hover { background: var(--brass); border-color: var(--brass); filter: brightness(1.08); }
.btn-primary.buy { background: var(--up); border-color: var(--up); }
.btn-primary.sell { background: var(--down); border-color: var(--down); color: #fff; }
.btn-up { color: var(--up); }
.btn-up:hover { border-color: var(--up); background: var(--up-bg); }
.btn-down { color: var(--down); }
.btn-down:hover { border-color: var(--down); background: var(--down-bg); }
.btn-dashed { border-style: dashed; color: var(--ink-dim); }
.btn-dashed:hover { color: var(--brass); border-color: var(--brass); }

/* ==========================================================================
   Kayan bant
   ========================================================================== */
.tape-wrap {
    overflow: hidden; white-space: nowrap;
    border-bottom: 1px solid var(--rule);
    background: var(--panel);
}
.tape { display: inline-flex; animation: tape 90s linear infinite; }
.tape-wrap:hover .tape { animation-play-state: paused; }
/* Baglanti yokken bant durur: hareketin durmasi bilginin kendisi —
   donuk bant "canli degilim" der, ayrica renge/yaziya gerek kalmaz. */
.tape-wrap.offline .tape { animation-play-state: paused; }
@keyframes tape { to { transform: translate3d(-50%, 0, 0); } }

.ticker-item {
    display: inline-flex; align-items: baseline; gap: 8px;
    padding: 6px 14px;
    border-right: 1px solid var(--rule);
    font-family: var(--mono); font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}
.ticker-item:hover { background: var(--panel-2); }
.ticker-item .sym { font-weight: 600; letter-spacing: .04em; }
.ticker-item .val { color: var(--ink-dim); }
/* Tahtadaki 2px yon cubugu imzasi banda da tasinir — ayni dil, ayni renk kurali. */
.ticker-item .chg { font-weight: 600; border-left: 2px solid currentColor; padding-left: 7px; }

/* ==========================================================================
   Bölüm sekmeleri — alt çizgi göstergesi
   ========================================================================== */
.tabs {
    display: flex; flex-wrap: wrap; gap: 2px;
    padding: 0 var(--gutter);
    border-bottom: 1px solid var(--rule);
    position: relative;               /* kayan gösterge buna göre konumlanır */
}

/* Kayan aktiflik çizgisi: sekmeler arasında ışınlanmak yerine kayar.
   Genişlik scaleX ile verilir (taban 100px) — yalnızca transform animasyonu,
   yerleşim özelliği oynatılmaz. Konumu JS (moveTabInd) ölçer. */
.tab-ind {
    position: absolute; left: 0; top: 0;
    width: 100px; height: 2px;
    background: var(--brass);
    transform-origin: left top;
    pointer-events: none;
}
.tab-ind.ready { transition: transform .32s var(--ease-exp); }
.tab {
    padding: 10px 13px;
    border: none; background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    color: var(--ink-dim);
    font: inherit; font-size: 13px; font-weight: 500;
    cursor: pointer;
    transition: color .12s, border-color .12s, transform .12s ease-out;
}
.tab:hover { color: var(--ink); }
/* Pirinç alt çizgiyi artık .tab-ind taşır; sekmede yalnızca renk/ağırlık değişir. */
.tab.active { color: var(--ink); font-weight: 600; }

/* ==========================================================================
   Tahta
   ========================================================================== */
.board, .heatmap { padding: 18px var(--gutter) 56px; max-width: 1800px; margin: 0 auto; }
/* Bos durum "bozuk ekran" gibi degil "ayrilmis ama bos goz" gibi okunmali:
   kesikli cerceve dili evde zaten var (.btn-dashed). */
.empty {
    color: var(--ink-faint); text-align: center; padding: 48px 16px; font-size: 13.5px;
    border: 1px dashed var(--rule-strong); border-radius: var(--r);
}

.group { margin-bottom: 30px; }
.group h2 {
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 10px;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--ink-dim);
}
.group h2::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.group-n {
    order: 3;
    font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em;
    color: var(--ink-faint); text-transform: none;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 208px), 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }

/*
   Tabela hücresi. Kart değil, ızgaranın bir gözü: aralar 1px cetvel.
   Fiyat ve değişim aynı satırda; değişim sabit genişlikte sağa yaslı bir
   alanda ve solunda 2px yön çubuğu var — 1000 gözde dikey cetveller çıkar.
*/
.card {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "sym sym" "price chg";
    align-items: end;
    gap: 8px 10px;
    padding: 10px 11px;
    background: var(--paper);
    cursor: pointer;
    content-visibility: auto;
    contain-intrinsic-size: auto 92px;
    transition: background .12s, transform .15s ease-out;
}
.card:hover { background: var(--panel); }

.card .sym { grid-area: sym; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card .code { font-size: 13px; font-weight: 600; letter-spacing: .05em; }
.card .name {
    color: var(--ink-faint); font-size: 11px; margin-top: 1px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 16ch;
}
.card .price {
    grid-area: price;
    font-size: 17px; font-weight: 500; letter-spacing: -0.01em;
    line-height: 1.15;
}
.card .cur { font-size: 10px; color: var(--ink-faint); margin-left: 5px; font-weight: 400; }

/* İmza: değişim sütunu */
.card .chg {
    grid-area: chg;
    padding-left: 8px;
    border-left: 2px solid currentColor;
    font-size: 12px; font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    /* Sabit taban + saga yasli rakam: 1000 gozde yon cubuklari GERCEK dikey
       cetvel olusturur — tabelanin ilan ettigi ama teslim etmedigi imza.
       9.5ch = "▼ -99.99%" (ok isareti mono'da 1ch'ten genis olabilir). */
    min-width: 9.5ch;
    text-align: right;
}
.chg.up, .up { color: var(--up); }
.chg.down, .down { color: var(--down); }
.chg.flat, .flat { color: var(--ink-faint); }

.fav-star {
    flex: 0 0 auto; padding: 1px; margin: -1px;
    border: none; background: none; cursor: pointer;
    color: var(--ink-faint);
    line-height: 0;
    transition: color .12s;
}
.fav-star svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; }
.fav-star:hover { color: var(--brass); }
.fav-star.active { color: var(--brass); }
.fav-star.active svg { fill: currentColor; }

/* Fiyat değişimi: kısa bir yön parlaması, hareket yok */
@keyframes flashUp { from { background: var(--up-bg); } to { background: var(--paper); } }
@keyframes flashDown { from { background: var(--down-bg); } to { background: var(--paper); } }
.card.flash-up { animation: flashUp .7s ease-out; }
.card.flash-down { animation: flashDown .7s ease-out; }
/* Tik aninda rakamin KENDISI yon rengini alip murekkebe geri soner — zemin
   flasindan daha okunur bir sinyal, RENK BILGIDIR kuralinin tam icinde.
   Parent'taki flash-* remove+reflow+add dongusu cocugu da yeniden tetikler. */
@keyframes tickUp { from { color: var(--up); } }
@keyframes tickDown { from { color: var(--down); } }
.card.flash-up .price { animation: tickUp .7s ease-out; }
.card.flash-down .price { animation: tickDown .7s ease-out; }
.m-price.tick-up { animation: tickUp .7s ease-out; }
.m-price.tick-down { animation: tickDown .7s ease-out; }
/* Kart kaskadı: panel ANINDA gelir (zemin + başlıklar), kartlar soldan sağa
   dalga hâlinde dizilir. Eski hâli 0,22 sn salt-opaklıktı — göz yakalamıyordu.
   "backwards" bilinçli: animasyon bitince kartı serbest bırakır ki üzerine
   gelince kalkma hareketi çalışsın (fill:both transform'u kilitliyordu). */
@keyframes cardIn { from { opacity: 0; transform: translateY(28px) scale(.94); } }
.card.in { animation: cardIn .5s var(--ease-exp) backwards; }

/* İmleç altındaki kart 1px kalkar: tahta elinin altında canlı hissettirir.
   Yalnızca gerçek imleçte — dokunmatikte tık sonrası yapışan sahte hover olmaz. */
@media (hover: hover) and (pointer: fine) {
    .card:hover { transform: translateY(-2px); }
}

/* Vadeli gözleri */
.fut-rows {
    grid-area: chg; grid-column: 1 / -1;
    display: grid; grid-template-columns: auto 1fr; gap: 3px 10px;
    margin-top: 8px; padding-top: 8px;
    border-top: 1px solid var(--rule);
    font-size: 11.5px;
}
.fut-k { color: var(--ink-faint); }
.fut-v { text-align: right; font-weight: 500; }
.fut-v.flat { color: var(--ink-faint); }
.card.fut { grid-template-areas: "sym sym" "price price" "chg chg"; }

/* ==========================================================================
   Isı haritası
   ========================================================================== */
.heatmap-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 128px), 1fr));
    gap: 1px; background: var(--rule); border: 1px solid var(--rule);
}
.hm-cell {
    --hm-i: .3;
    padding: 9px 10px;
    background: var(--paper);
    cursor: pointer;
    content-visibility: auto;
    contain-intrinsic-size: auto 74px;
}
.hm-cell.up { background: color-mix(in srgb, var(--up) calc(var(--hm-i) * 46%), var(--paper)); }
.hm-cell.down { background: color-mix(in srgb, var(--down) calc(var(--hm-i) * 46%), var(--paper)); }
.hm-cell:hover { outline: 1px solid var(--ink); outline-offset: -1px; }
.hm-sym { font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.hm-val { font-size: 12px; margin-top: 3px; }
.hm-val small { font-size: 9.5px; color: var(--ink-faint); margin-left: 3px; }
.hm-chg { font-size: 11px; font-weight: 600; margin-top: 2px; }

.foot {
    padding: 20px var(--gutter) 32px;
    border-top: 1px solid var(--rule);
    color: var(--ink-faint); font-size: 11.5px; text-align: center;
}

/* ==========================================================================
   Katmanlar (modal / sayfa panelleri)
   ========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Katman durum makinesi (Apple §3 — kesintiye dayanıklılık).
   Giriş/çıkış keyframe DEĞİL transition: sınıf düşünce hareket o anki değerden
   geriye oynar. Kapanış ortasında yeniden açılan kâğıt elinin altında geri
   döner; keyframe olsaydı baştan oynar, gözle görülür sıçrardı.
   Süre kuralı: hedef durumun transition'ı geçerlidir — giriş süreleri .open
   kuralında, çıkış süreleri taban kuralda yaşar. Çıkış girişten kısadır
   (plans/002): kullanıcı kapatmayı istedi, oyalanma olmaz. */
.modal, .sheet-modal, .cmd-modal, .ask, .drawer {
    position: fixed; inset: 0;
    background: color-mix(in srgb, var(--paper) 82%, transparent);
    opacity: 0;
    transition: opacity .18s var(--ease-exp);   /* çıkış */
}
.modal.open, .sheet-modal.open, .cmd-modal.open, .ask.open, .drawer.open {
    opacity: 1;
    transition-duration: .12s;                  /* giriş */
}
/* Kapanan katman tıklama yutmasın */
.modal.closing, .sheet-modal.closing, .cmd-modal.closing, .ask.closing, .drawer.closing {
    pointer-events: none;
}
/* Palet bilinçli geçişsiz: Ctrl+K günde 100+ kez kullanılan klavye yüzeyi.
   Bu sıklıkta her milisaniye gecikmedir (bkz. plans/001). */
.cmd-modal, .cmd-modal.open { transition: none; }
.modal { z-index: 60; display: grid; place-items: start center; padding: clamp(0px, 3vw, 32px); overflow-y: auto; }
.sheet-modal { z-index: 85; display: grid; place-items: center; padding: clamp(0px, 2vw, 24px); }
.cmd-modal { z-index: 80; display: grid; place-items: start center; padding: clamp(40px, 12vh, 130px) 14px 14px; }
.ask { z-index: 90; display: grid; place-items: center; padding: 14px; }
.drawer { z-index: 70; display: flex; justify-content: flex-end; }

.sheet {
    width: min(920px, 100%);
    background: var(--panel);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    position: relative;
    /* Kâğıt tıklanan noktadan büyür: transform-origin'i JS (growFrom) tıklamanın
       koordinatına kurar; klavyeyle açılışta merkezden. Saf ölçek — kayma yok.
       Giriş .9→1 ve çıkış 1→.9 aynı yoldan (Apple §7, mekânsal tutarlılık). */
    opacity: 0;
    transform: scale(.9);
    transition: transform .22s var(--ease-exp), opacity .22s var(--ease-exp);  /* çıkış */
}
.open .sheet {
    opacity: 1;
    transform: none;
    transition-duration: .46s;                  /* giriş: süzülerek oturur */
}
/* Kâğıt açılınca gövde blokları 45 ms kaskadıyla dizilir; başlık kâğıtla
   birlikte gelir, sahnede tek koreografi olur. Sıra index.html'deki çocuk
   sırasıdır — modala blok eklersen gecikmeleri kaydır. */
.modal.open .sheet > .action-bar,
.modal.open .sheet > .signal-row,
.modal.open .sheet > .stats,
.modal.open .sheet > .block { animation: rise .5s var(--ease-exp) backwards; }
.modal.open .sheet > .signal-row { animation-delay: 45ms; }
.modal.open .sheet > .stats { animation-delay: 90ms; }
.modal.open .sheet > .block:nth-of-type(1) { animation-delay: 135ms; }
.modal.open .sheet > .block:nth-of-type(2) { animation-delay: 180ms; }
.modal.open .sheet > .block:nth-of-type(3) { animation-delay: 225ms; }
.sheet-wide { width: min(1120px, 100%); max-height: 92svh; display: flex; flex-direction: column; }
.modal .sheet { padding: clamp(18px, 2.6vw, 28px); }

.sheet-close, .sheet-close-inline, .drawer-close {
    display: grid; place-items: center;
    width: 26px; height: 26px; flex: 0 0 auto;
    border: 1px solid var(--rule); border-radius: var(--r);
    background: none; color: var(--ink-dim);
    font-size: 15px; line-height: 1; cursor: pointer;
    transition: color .12s, border-color .12s, transform .12s ease-out;
}
/* Kucuk yardimci dugmeler de basildigi ani soyler; 26px'te .96 okunmadigi
   icin .94. Buyuk dugme ailesiyle ayni sure/egri — tek etkilesim dili. */
.sheet-close:active, .sheet-close-inline:active, .drawer-close:active,
.dr-x:active, .dr-reset:active, .pfe-buy:active, .pfe-corp:active, .pfe-del:active,
.pf-rate-btn:active { transform: scale(.94); transition-duration: .06s; }
.sheet-close:hover, .sheet-close-inline:hover, .drawer-close:hover { color: var(--ink); border-color: var(--rule-strong); }
.sheet-close { position: absolute; top: 14px; right: 14px; }

.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding-right: 34px; }
.m-code { font-family: var(--mono); font-size: clamp(20px, 3vw, 26px); font-weight: 600; letter-spacing: .06em; line-height: 1.1; }
.m-name { color: var(--ink-dim); font-size: 12.5px; margin-top: 2px; }
.m-price-wrap { text-align: right; margin-left: auto; }
/* Büyük rakam sıkı izlenir (Apple §15): boyut büyüdükçe harf arası daralır.
   Ölçek: 17px → -0.01em (kart), 24px+ → -0.015em (hero/modal/portföy). */
.m-price { font-size: clamp(20px, 3vw, 28px); font-weight: 500; line-height: 1.1; letter-spacing: -0.015em; }
.m-price .cur { font-size: 12px; color: var(--ink-faint); margin-left: 5px; }
.m-chg { font-size: 13px; font-weight: 600; margin-top: 3px; }
.m-chg.up { color: var(--up); }
.m-chg.down { color: var(--down); }
.m-chg.flat { color: var(--ink-faint); }

.sheet-head-simple {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
    padding: 16px 18px; border-bottom: 1px solid var(--rule);
}
.sheet-head-simple h3 { margin: 0; font-size: 15px; font-weight: 600; }
.sheet-sub { margin: 4px 0 0; color: var(--ink-dim); font-size: 12px; line-height: 1.55; max-width: 78ch; }
.sheet-body { flex: 1; overflow-y: auto; padding: 14px 18px; }
.sheet-foot {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 12px 18px; border-top: 1px solid var(--rule);
}
.foot-summary { flex: 1; min-width: 190px; color: var(--ink-dim); font-size: 12px; }
.foot-summary b { color: var(--ink); }
.foot-actions { display: flex; gap: 6px; }
.summary-row {
    display: flex; flex-wrap: wrap; gap: 6px 18px;
    padding: 10px 18px; border-bottom: 1px solid var(--rule);
    color: var(--ink-dim); font-size: 11.5px;
}
.summary-row b { color: var(--ink); }
.summary-row:empty { display: none; }

.action-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.paper-trading-actions { display: flex; gap: 6px; }

/* Teknik gösterge satırı */
.signal-row {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    margin-top: 14px; padding: 9px 12px;
    border: 1px solid var(--rule); border-radius: var(--r);
    font-size: 12px;
}
.signal-row:empty { display: none; }
.signal-label { color: var(--ink-dim); text-transform: uppercase; letter-spacing: .1em; font-size: 10.5px; font-weight: 600; }
.signal-meta { color: var(--ink-dim); font-family: var(--mono); }
.signal-meta b { color: var(--ink); font-weight: 600; }
.signal-badge { font-weight: 600; letter-spacing: .02em; }
.signal-badge.strong-buy, .signal-badge.buy { color: var(--up); }
.signal-badge.sell, .signal-badge.strong-sell { color: var(--down); }
.signal-badge.neutral { color: var(--ink-dim); }
.signal-badge.strong-buy::after, .signal-badge.strong-sell::after { content: " ▮▮"; font-size: 8px; vertical-align: 1px; }
.signal-badge.buy::after, .signal-badge.sell::after { content: " ▮"; font-size: 8px; vertical-align: 1px; }

/* İstatistik şeridi */
.stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr));
    gap: 1px; margin-top: 16px;
    background: var(--rule); border: 1px solid var(--rule);
}
.stat { padding: 8px 10px; background: var(--panel); }
.stat .k { color: var(--ink-faint); font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.stat .v { font-size: 14px; font-weight: 500; margin-top: 3px; }

.block { margin-top: 22px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.block-title { margin: 0 0 10px; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); }
.block-head .block-title { margin: 0; }
.block-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.select {
    height: 28px; padding: 0 8px; max-width: 190px;
    border: 1px solid var(--rule); border-radius: var(--r);
    background: var(--panel); color: var(--ink);
    font: inherit; font-size: 12px; cursor: pointer;
    transition: border-color .12s;
}
.select:focus { outline: none; border-color: var(--brass); }

.segmented { display: flex; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.range, .pf-range, .pf-cur, .drawer-tab {
    padding: 5px 11px; border: none; background: var(--panel);
    color: var(--ink-dim);
    font: inherit; font-size: 12px; font-weight: 500; cursor: pointer;
    transition: color .12s, background .12s;
}
.range + .range { border-left: 1px solid var(--rule); }
.range:hover, .pf-range:hover, .pf-cur:hover, .drawer-tab:hover { color: var(--ink); }
.range.active, .pf-range.active, .pf-cur.active { background: var(--panel-2); color: var(--ink); font-weight: 600; }

/* Alanlar */
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span:first-child { color: var(--ink-dim); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.field input {
    height: 32px; padding: 0 10px; width: 100%;
    border: 1px solid var(--rule); border-radius: var(--r);
    background: var(--panel); color: var(--ink);
    font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums;
    transition: border-color .12s;
}
.field input:focus { outline: none; border-color: var(--brass); }
.input-wrap { display: flex; align-items: center; gap: 8px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--panel); padding-right: 10px; transition: border-color .12s; }
.input-wrap:focus-within { border-color: var(--brass); }
.input-wrap input { border: none; background: none; }
.input-wrap input:focus { outline: none; }
.suffix { color: var(--ink-faint); font-size: 11.5px; white-space: nowrap; }

.sim-body { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.sim-body .field { width: 130px; }
.sim-result { flex: 1 1 240px; font-size: 12.5px; color: var(--ink-dim); line-height: 1.7; padding-bottom: 5px; }
.sim-result b { color: var(--ink); font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Grafik
   ========================================================================== */
.chart { border: 1px solid var(--rule); border-radius: var(--r); padding: 12px; min-height: 190px; color: var(--ink-faint); font-size: 12.5px; }
.chart-inner { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; cursor: crosshair; touch-action: none; }
.chart .axis { fill: var(--ink-faint); font-size: 10px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--rule); stroke-width: 1; }
.chart .lastline { stroke-dasharray: 3 3; stroke-width: 1; opacity: .5; }
.chart .badge { fill: var(--ink); font-size: 10px; font-weight: 600; font-family: var(--mono); }
.chart .wchg { font-size: 12px; font-weight: 600; font-family: var(--mono); }
.chart .wchg.cmp { fill: var(--ink-dim); font-size: 11px; }
.chart .cmp-line { stroke: var(--ink-dim); fill: none; opacity: .7; }
.chart .cross { stroke: var(--ink-faint); stroke-width: 1; stroke-dasharray: 3 3; opacity: .6; }
.chart #cxDot { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }
.chart-empty { padding: 64px 16px; text-align: center; }
.chart-note { color: var(--ink-faint); font-size: 11px; margin-top: 8px; }

.chart-tip {
    position: absolute; top: 0; opacity: 0; pointer-events: none;
    min-width: 190px; padding: 9px 11px;
    border: 1px solid var(--rule-strong); border-radius: var(--r);
    background: var(--panel); box-shadow: var(--shadow);
    font-size: 11.5px; z-index: 5;
    transition: opacity .1s;
}
.chart-tip .tt-time { color: var(--ink-faint); font-size: 10.5px; margin-bottom: 6px; font-family: var(--mono); }
.chart-tip .tt-row { display: flex; justify-content: space-between; gap: 18px; line-height: 1.65; }
.chart-tip .tt-row span { color: var(--ink-dim); }
.chart-tip .tt-row b { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.chart-tip .tt-ev { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--rule); font-weight: 600; }
.chart-tip .tt-ev.up { color: var(--up); }
.chart-tip .tt-ev.down { color: var(--down); }
.chart-tip .tt-ev small { display: block; color: var(--ink-faint); font-weight: 400; margin-top: 1px; }

/* Haberler */
.news { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: var(--r); }
.news a { display: block; padding: 10px 12px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule); }
.news a:last-child { border-bottom: none; }
.news a:hover { background: var(--panel-2); }
.news .n-title { font-size: 13px; line-height: 1.5; }
.news .n-meta { color: var(--ink-faint); font-size: 11px; margin-top: 4px; font-family: var(--mono); }
.news .none { color: var(--ink-faint); font-size: 12.5px; padding: 14px; text-align: center; }

/* ==========================================================================
   Komut paleti
   ========================================================================== */
.cmd-card {
    width: min(560px, 100%);
    background: var(--panel); border: 1px solid var(--rule-strong); border-radius: var(--r);
    box-shadow: var(--shadow); overflow: hidden;
    /* Bilinçli animasyonsuz: Ctrl+K günde 100+ kez kullanılan klavye yüzeyi.
       Bu sıklıkta her milisaniye gecikmedir (bkz. plans/001). */
}
.cmd-input-wrap { display: flex; align-items: center; gap: 9px; padding: 11px 13px; border-bottom: 1px solid var(--rule); }
.cmd-icon { width: 14px; height: 14px; fill: none; stroke: var(--ink-faint); stroke-width: 1.4; stroke-linecap: round; flex: 0 0 auto; }
#cmdInput { flex: 1; min-width: 0; border: none; background: none; color: var(--ink); font: inherit; font-size: 14px; }
#cmdInput:focus { outline: none; }
#cmdInput::placeholder { color: var(--ink-faint); }
.cmd-hint kbd { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); padding: 1px 4px; border: 1px solid var(--rule); border-radius: 2px; }
.cmd-list { max-height: min(400px, 55vh); overflow-y: auto; }
.cmd-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 8px 13px; cursor: pointer; font-size: 13px;
    border-bottom: 1px solid var(--rule);
}
.cmd-item:last-child { border-bottom: none; }
.cmd-item span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-item:hover, .cmd-item.selected { background: var(--panel-2); }
/* Klavye imleci fare hover'indan ayrisir: secili satirda 2px pirinc cubuk.
   Inset golge — yerlesim kaymaz, palet animasyonsuz kurali bozulmaz. */
.cmd-item.selected { box-shadow: inset 2px 0 0 0 var(--brass); }
.cmd-badge { flex: 0 0 auto; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-faint); }

/* ==========================================================================
   Portföy
   ========================================================================== */
.portfolio { padding: 20px var(--gutter) 56px; max-width: 1440px; margin: 0 auto; }
.pf-greet { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.pf-greet .hi { color: var(--ink-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.pf-name { font-size: 18px; font-weight: 600; margin: 2px 0 0; }
.pf-greet-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pf-ava {
    width: 28px; height: 28px; display: grid; place-items: center;
    border: 1px solid var(--rule); border-radius: 50%;
    font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--ink-dim);
}

/* Sütunlar bağımsız yükseklikte: hero kısa kalır, altında boş bir blok oluşmaz. */
.pf-grid { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 14px; align-items: start; }
.pf-hero, .pf-panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 18px; }
.pf-hero { position: sticky; top: 60px; }
/* Gunun K/Z yonu hero'nun sol kenarinda — dr-hero'daki desenle ayni imza.
   Inset cizgi: border degistirmez, sticky kartta yerlesim ziplamasi olmaz. */
.pf-hero.up { box-shadow: inset 2px 0 0 0 var(--up); }
.pf-hero.down { box-shadow: inset 2px 0 0 0 var(--down); }
.pf-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 22px; }
.pf-hero-label { color: var(--ink-faint); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }

/* Hero iki bölümdür: ŞU AN (bugünkü değer) ve SEYİR (pencere içindeki gidiş).
   Aralarındaki saç teli çizgi dekoratif değil ANLAM taşıyor: iki bölümün de
   birer yüzdesi var ve düz bir yığında kardeş gibi okunuyorlardı. */
.pf-sec + .pf-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--rule); }
/* Boş satırlar bölümde hayalet boşluk bırakmasın — 'gerçekleşen', 'uyarı' ve
   'dolar notu' çoğu zaman boştur. */
.pf-now > :empty { display: none; }
.pf-cur-switch { display: flex; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.pf-cur { padding: 3px 8px; font-family: var(--mono); }
.pf-cur + .pf-cur { border-left: 1px solid var(--rule); }

.pf-total { font-size: clamp(26px, 4.4vw, 34px); font-weight: 500; letter-spacing: -0.015em; margin: 8px 0 8px; line-height: 1.05; }
.pf-chip { display: inline-flex; align-items: baseline; gap: 7px; font-size: 12.5px; font-weight: 600; }
.pf-chip.up { color: var(--up); }
.pf-chip.down { color: var(--down); }
.pf-chip.flat { color: var(--ink-faint); }
.pf-chip span { color: var(--ink-faint); font-weight: 400; font-family: var(--sans); font-size: 11px; }
.pf-realized { margin-top: 6px; font-size: 12px; font-weight: 500; }
.pf-realized:empty { display: none; }
.pf-realized.up { color: var(--up); }
.pf-realized.down { color: var(--down); }
.pf-realized span { color: var(--ink-faint); font-family: var(--sans); font-size: 10.5px; }
.pf-usd-note { margin-top: 7px; color: var(--ink-faint); font-size: 10.5px; line-height: 1.5; }
.pf-usd-note:empty { display: none; }
.pf-rate-btn {
    display: inline-block; margin-top: 5px; padding: 4px 9px;
    border: 1px solid var(--brass); border-radius: var(--r);
    background: none; color: var(--brass);
    font: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
}
.pf-rate-btn:hover { background: var(--brass-bg); }

/* Canlı fiyatı bulunamayan kalemler: sunucu onları MALİYETİYLE dolduruyor ve
   K/Z'leri %0,00 çıkıyor. Uyarı pirinç renkte — kırmızı "zarar" demek olurdu,
   burada söylenen "bu rakama güvenme". */
.pf-stale {
    margin-top: 8px; padding: 6px 9px;
    border: 1px solid var(--brass); border-left-width: 3px; border-radius: var(--r);
    background: var(--brass-bg); color: var(--ink-dim);
    font-size: 10.5px; line-height: 1.5;
}
.pf-stale b { color: var(--brass); font-weight: 600; }
.pf-stale[hidden] { display: none; }

.pf-dead {
    margin-left: 6px; padding: 1px 5px; border-radius: 2px;
    border: 1px solid var(--brass); color: var(--brass); background: var(--brass-bg);
    font-family: var(--sans); font-size: 9px; font-weight: 600;
    letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px;
}
.pf-row.is-stale .pf-row-value { color: var(--ink-dim); }

/* Grafiğin başlığı: aralık değişimi solda, ölçeğin gerçek aralığı sağda.
   Otomatik ölçek min–max'e gerildiği için %0,1'lik oynama dağ gibi
   görünüyordu; sayıyı yazmak eğrinin ne kadar yakınlaştığını dürüstçe söyler. */
/* Dar hero sütununda ikisi yan yana sığmayabilir; sarma serbest ama her ibare
   KENDİ İÇİNDE bölünmez — "+₺173.796 +9,42%" ile "14 gün" ayrı satırlara
   düşerse cümle okunmaz hâle geliyordu. */
.pf-spark-head {
    display: flex; align-items: baseline; justify-content: space-between;
    flex-wrap: wrap; gap: 2px 10px; margin-top: 10px; min-height: 16px;
}
.pf-spark-range { font-size: 12px; font-weight: 600; color: var(--ink-faint); white-space: nowrap; }
.pf-spark-range.up { color: var(--up); }
.pf-spark-range.down { color: var(--down); }
.pf-spark-range b { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pf-spark-range span { color: var(--ink-faint); font-weight: 400; font-size: 10.5px; }
.pf-spark-scale {
    color: var(--ink-faint); font-size: 10px;
    font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* touch-action: pan-y — yatay gezinme grafiğe ait, DİKEY kaydırma sayfaya
   kalır. 'none' deseydik mobilde grafiğe denk gelen parmak sayfayı kaydıramaz,
   liste ekranda kilitlenirdi. */
/* Hero'nun asıl okunacak parçası: metin yığınından daha az dikey alan
   almasın diye 96 -> 140px. */
.pf-spark { margin-top: 6px; height: 140px; position: relative; touch-action: pan-y; }
.pf-spark svg { width: 100%; height: 100%; display: block; cursor: crosshair; }
.pf-spark svg:focus-visible { outline: 1px solid var(--brass); outline-offset: 2px; }

/* Nokta ve imleç: SVG'nin orantısız gerilmesinden etkilenmesinler diye HTML
   katmanında, yüzdeyle konumlanır (bkz. drawSpark iskeleti). */
.pf-spark > i { position: absolute; display: block; pointer-events: none; }
/* display:block, tarayıcının [hidden] kuralını ezer — gizlenmesi gereken imleç
   ve seçim noktası sürekli ekranda kalıyordu (biri sol kenarda kesik çizgi,
   diğeri akıştaki yerinde sol altta bir daire). */
.pf-spark > i[hidden] { display: none; }
.spark-dot {
    width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
    box-shadow: 0 0 0 2px var(--paper);
}
.spark-cross {
    top: 0; bottom: 0; width: 1px; margin-left: -0.5px;
    background: repeating-linear-gradient(var(--ink-faint) 0 2px, transparent 2px 5px);
}
.spark-pick {
    width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%;
    background: var(--paper); border: 1.6px solid var(--ink);
}

/* Gezinirken başlık okunan noktayı devralır — parmağın altında kalan ayrı bir
   balon yok. Değer mono/tabular: rakamlar nokta nokta gezerken zıplamasın. */
.pf-spark-range.is-scrub b {
    font-size: 13px; color: var(--ink);
    font-family: var(--mono); font-variant-numeric: tabular-nums;
}
/* Kaydın olmadığı zaman aralığı. Eğri o boşlukta komşularından doldurulur ama
   bandı görmeden bakan kişi orada ölçüm yapıldığını sanar. */
.spark-gap { fill: var(--ink-faint); opacity: .13; }
body.light-theme .spark-gap { opacity: .16; }
.spark-wait { color: var(--ink-faint); font-size: 11.5px; text-align: center; padding-top: 34px; line-height: 1.6; }
.pf-spark-note { color: var(--ink-faint); font-size: 10px; margin-top: 8px; line-height: 1.5; }
.pf-ranges { display: flex; margin-top: 8px; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.pf-range { flex: 1; padding: 4px 6px; font-size: 11px; }
.pf-range + .pf-range { border-left: 1px solid var(--rule); }

.pf-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pf-list-head h3 { margin: 0; font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-dim); }
.pf-list-head span { color: var(--ink-faint); font-size: 11px; font-family: var(--mono); }
/* --------------------------------------------------------------------------
   Dağılım
   Halka + efsane yerine sıralı paylar: etiket çubuğun yanında, sıralama
   büyüklüğü anlatıyor. Renk burada kimlik değil VARLIK SINIFI taşıyor —
   maden/hisse/kripto ayrımı tek bakışta okunsun diye.
   -------------------------------------------------------------------------- */
.cat-METAL    { --cat: #c9962f; }
.cat-BIST     { --cat: #5c82ab; }
.cat-CRYPTO   { --cat: #4e9b8f; }
.cat-CURRENCY { --cat: #9d7f9e; }
.cat-CASH     { --cat: #6d7681; }
/* Repo: mevcut beş renkten de ayrışan zeytin yeşili. Kripto turkuazına (#4e9b8f)
   ve maden pirincine (#c9962f) yeterince uzak — dağılım şeridinde bitişik
   düşseler bile birbirine karışmıyorlar. */
.cat-REPO     { --cat: #7f9a5c; }
body.light-theme .cat-METAL    { --cat: #96701f; }
body.light-theme .cat-BIST     { --cat: #3d6288; }
body.light-theme .cat-CRYPTO   { --cat: #2f7469; }
body.light-theme .cat-CURRENCY { --cat: #76597a; }
body.light-theme .cat-CASH     { --cat: #576069; }
body.light-theme .cat-REPO     { --cat: #5e7740; }

.alloc-stack { display: flex; height: 8px; border-radius: 2px; overflow: hidden; gap: 1px; }
.alloc-seg { background: var(--cat); min-width: 2px; }

.alloc-cats { display: flex; flex-wrap: wrap; gap: 5px 14px; margin-top: 9px; font-size: 11px; color: var(--ink-dim); }
.alloc-cat { display: inline-flex; align-items: center; gap: 5px; }
.alloc-cat i { width: 8px; height: 8px; border-radius: 1px; background: var(--cat); flex: 0 0 auto; }
.alloc-cat b { color: var(--ink); font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; }

.alloc-rows { margin-top: 14px; border-top: 1px solid var(--rule); }
.alloc-row {
    display: grid;
    grid-template-columns: 4.5rem minmax(60px, 1fr) 3.4rem 6.5rem;
    gap: 10px; align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--rule);
}
.alloc-row:last-child { border-bottom: none; }
.alloc-sym { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.alloc-track { height: 9px; background: var(--panel-2); border-radius: 1px; overflow: hidden; }
.alloc-bar { display: block; height: 100%; background: var(--cat); min-width: 2px; }
.alloc-pct, .alloc-val {
    font-family: var(--mono); font-variant-numeric: tabular-nums;
    font-size: 11.5px; text-align: right;
}
.alloc-pct { color: var(--ink); font-weight: 600; }
.alloc-val { color: var(--ink-dim); }

@media (max-width: 560px) {
    .alloc-row { grid-template-columns: 4rem 1fr 3.2rem; }
    .alloc-val { display: none; }
}

.pf-list { display: flex; flex-direction: column; border: 1px solid var(--rule); border-radius: var(--r); }
.pf-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-bottom: 1px solid var(--rule); }
.pf-row:last-child { border-bottom: none; }
.pf-row:hover { background: var(--panel-2); }
.pf-badge {
    width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center;
    border: 1px solid var(--rule); border-radius: var(--r);
    font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--ink-dim);
}
/* Rozet, varlik sinifinin rengini giyer: dagilim efsanesiyle liste arasindaki
   bag kapanir. --cat zaten bilgi rengi olarak mesru — yeni renk tanimlanmiyor.
   (METAL'de --cat = pirinc oldugu icin eski gorunum birebir korunur.) */
.pf-badge[class*="cat-"] { color: var(--cat); border-color: color-mix(in srgb, var(--cat) 40%, transparent); }
.pf-row-main { flex: 1 1 auto; min-width: 0; }
.pf-row-sym { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; }
.pf-row-name { color: var(--ink-faint); font-size: 11px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Repo satırının ikinci satırı: işleyen faiz ve vade sayacı.
   Rakam PİRİNÇ renginde, yeşil değil — yeşil "kazanıldı" der, oysa işleyen
   faiz vade dolmadan hak edilmiş sayılmaz. Uygulama pirinci zaten "henüz
   kesinleşmedi" anlamında kullanıyor (bkz. .updated.stale, .pf-stale).

   Ad satırından farklı olarak SARILIR, kırpılmaz: uzun bir kağıt adının sonunu
   kaybetmek zararsızdır ama burada kesilen şey vade sayacı olur — dar ekranda
   "vade sonunda +8.430 ₺ · 184 gü…" diye bitiyordu. En işe yarar bilgiyi
   kırpmaktansa satırın iki satır olmasına razıyız. */
.pf-row-repo {
    color: var(--ink-faint); font-size: 10.5px; margin-top: 2px;
    font-variant-numeric: tabular-nums; line-height: 1.35;
}
.pf-row-repo b { color: var(--brass); font-weight: 600; }
.pf-row-val { text-align: right; flex: 0 0 auto; }
.pf-row-value { font-size: 13px; font-weight: 500; }
.pf-row-chg { font-size: 11px; font-weight: 600; margin-top: 1px; }
.pf-row-chg.up { color: var(--up); }
.pf-row-chg.down { color: var(--down); }
.pf-row-chg.flat { color: var(--ink-faint); }

/* ==========================================================================
   Yan panel
   ========================================================================== */
.drawer-card {
    width: min(400px, 100%); height: 100%;
    display: flex; flex-direction: column;
    background: var(--panel); border-left: 1px solid var(--rule-strong);
    touch-action: pan-y;   /* jest: yatay sürükleme bizde, dikey kaydırma tarayıcıda */
    /* Girdiği yoldan çıkar: sağdan kayar, sağa döner (Apple §7). */
    transform: translateX(100%);
    transition: transform .28s var(--ease-exp);  /* çıkış */
}
.drawer.open .drawer-card {
    transform: none;
    transition-duration: .42s;                   /* giriş */
}
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--rule); }
.drawer-tabs { display: flex; flex: 1; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.drawer-tab { flex: 1; }
.drawer-tab + .drawer-tab { border-left: 1px solid var(--rule); }
.drawer-tab.active { background: var(--panel-2); color: var(--ink); font-weight: 600; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px; }

.dr-hero { padding: 13px 14px; border: 1px solid var(--rule); border-radius: var(--r); margin-bottom: 14px; }
.dr-hero.up { border-left: 2px solid var(--up); }
.dr-hero.down { border-left: 2px solid var(--down); }
.dr-hero-label { color: var(--ink-faint); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
.dr-hero-val { font-size: 24px; font-weight: 500; margin: 5px 0 5px; line-height: 1.1; letter-spacing: -0.015em; }
.dr-hero-sub { font-size: 11.5px; color: var(--ink-faint); }
.dr-hero-sub .up { color: var(--up); font-weight: 600; }
.dr-hero-sub .down { color: var(--down); font-weight: 600; }
.dr-dot { opacity: .4; margin: 0 3px; }

.dr-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.dr-sec-head h4 { margin: 0; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); }
.dr-reset { padding: 3px 8px; border: 1px solid var(--rule); border-radius: var(--r); background: none; color: var(--ink-faint); font: inherit; font-size: 11px; cursor: pointer; transition: color .12s, border-color .12s, transform .12s ease-out; }
.dr-reset:hover { color: var(--down); border-color: var(--down); }

.dr-row { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--rule); border-radius: var(--r); margin-bottom: 5px; }
.dr-row:hover { background: var(--panel-2); }
.dr-row-main { flex: 1 1 auto; min-width: 0; cursor: pointer; }
.dr-row-sym { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; }
.dr-row-sub { color: var(--ink-faint); font-size: 10.5px; margin-top: 1px; }
.dr-row-val { text-align: right; flex: 0 0 auto; }
.dr-row-value { font-size: 13px; font-weight: 500; }
.dr-row-chg { font-size: 10.5px; font-weight: 600; margin-top: 1px; }
.dr-row-chg.up { color: var(--up); }
.dr-row-chg.down { color: var(--down); }
.dr-row-chg.flat { color: var(--ink-faint); }
.dr-warn { color: var(--brass); }
.dr-x { flex: 0 0 auto; padding: 4px 8px; border: 1px solid var(--rule); border-radius: var(--r); background: none; color: var(--ink-faint); font: inherit; font-size: 11px; cursor: pointer; transition: color .12s, border-color .12s, transform .12s ease-out; }
.dr-x:hover { color: var(--down); border-color: var(--down); }
.dr-empty { color: var(--ink-faint); text-align: center; padding: 34px 14px; font-size: 12.5px; line-height: 1.8; }
.dr-empty small { color: var(--ink-faint); font-size: 11.5px; }
.dr-note { padding: 9px 11px; margin-bottom: 12px; border: 1px solid var(--brass); border-left-width: 2px; border-radius: var(--r); color: var(--brass); font-size: 11.5px; line-height: 1.55; }

/* ==========================================================================
   İşlem geçmişi ve Excel karşılaştırması
   ========================================================================== */
.txn-row { display: grid; grid-template-columns: 5rem 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-bottom: 1px solid var(--rule); }
.txn-row:last-child { border-bottom: none; }
.txn-type { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); }
.txn-type.up { color: var(--up); }
.txn-type.down { color: var(--down); }
.txn-main { min-width: 0; }
.txn-sym { font-size: 12.5px; font-weight: 600; letter-spacing: .04em; }
.txn-sym small { color: var(--ink-faint); font-size: 9.5px; margin-left: 5px; letter-spacing: .08em; }
.txn-when { color: var(--ink-faint); font-size: 11px; margin-top: 1px; }
.txn-nums { text-align: right; white-space: nowrap; }
.txn-qty { color: var(--ink-faint); font-size: 11px; }
.txn-cost { font-size: 12.5px; font-weight: 600; margin-top: 1px; }
.txn-cost.up { color: var(--up); }
.txn-cost.down { color: var(--down); }
.txn-real { font-size: 10.5px; font-weight: 600; margin-top: 1px; }

.imp-note { padding: 10px 12px; margin-bottom: 14px; border: 1px solid var(--brass); border-left-width: 2px; border-radius: var(--r); color: var(--brass); font-size: 11.5px; line-height: 1.6; }
.imp-head { margin: 16px 0 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-dim); }
.imp-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 10px; border-bottom: 1px solid var(--rule); font-size: 12px; }

/* Portföy düzenleme ızgarası */
.grid-head, .pfe-row {
    display: grid;
    grid-template-columns: 5.5rem minmax(6.5rem, 1.1fr) 5.5rem minmax(6rem, 1fr) 6.5rem 7.5rem 7.5rem 11rem;
    gap: 6px; align-items: center;
}
.grid-head { padding: 9px 18px; border-bottom: 1px solid var(--rule); color: var(--ink-faint); font-size: 9.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; }
.pfe-row { padding: 4px 0; }
.pfe-wait { color: var(--ink-faint); text-align: center; padding: 34px 0; font-size: 12.5px; }
.pfe-f {
    width: 100%; min-width: 0; height: 28px; padding: 0 8px;
    border: 1px solid var(--rule); border-radius: var(--r);
    background: var(--panel); color: var(--ink);
    font: inherit; font-size: 12px;
    transition: border-color .12s;
}
.pfe-f:focus { outline: none; border-color: var(--brass); }
.pfe-f.ta-r { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 500; }
select.pfe-f { cursor: pointer; }
.pfe-tot { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 600; padding-right: 3px; white-space: nowrap; }
.pfe-tot.bad { color: var(--down); }
.pfe-btns { display: flex; gap: 4px; justify-content: flex-end; }
.pfe-buy, .pfe-corp, .pfe-del {
    padding: 5px 8px; border: 1px solid var(--rule); border-radius: var(--r);
    background: none; color: var(--ink-faint);
    font: inherit; font-size: 11px; font-weight: 500; cursor: pointer;
    transition: color .12s, border-color .12s, transform .12s ease-out;
}
.pfe-buy:hover { color: var(--up); border-color: var(--up); }
.pfe-corp:hover { color: var(--brass); border-color: var(--brass); }
.pfe-del:hover { color: var(--down); border-color: var(--down); }
.pfe-bad { color: var(--down); }

/* Repo satırı: ana şeridin altına tam genişlikte ikinci bir şerit açar.
   grid-column: 1 / -1 sütun sayısından bağımsızdır; masaüstündeki sekiz
   sütunda da mobildeki iki sütunda da satırın tamamını kaplar. */
.pfe-row.is-repo .pfe-sub {
    grid-column: 1 / -1;
    display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px;
    padding: 1px 0 5px 2px;
    color: var(--ink-faint); font-size: 11px;
}
.pfe-sub label { display: inline-flex; align-items: center; gap: 5px; }
.pfe-f.pfe-mini { width: 5rem; height: 24px; padding: 0 6px; }
.pfe-sub select.pfe-f, .pfe-sub .pfe-f[type="date"] { width: auto; height: 24px; padding: 0 6px; }

/* Repoda "Fiyat kaynağı" ve "Miktar" sütunlarının karşılığı yok: anapara
   doğrudan altıncı sütuna, yani "Birim maliyet" başlığının altına oturtulur.
   Boş yer tutucu eleman koymak yerine sütun numarası veriliyor — ızgara
   kendiliğinden dördüncü ve beşinci hücreyi boş bırakır. */
.pfe-row.is-repo > [data-f="costUnit"] { grid-column: 6; }
.pfe-hint { font-variant-numeric: tabular-nums; }
.pfe-hint b { color: var(--ink); font-weight: 600; }
.pfe-hint i { font-style: normal; opacity: .6; }

/* Tarih seçicinin takvimi ve oku sayfanın temasını izlesin; aksi halde koyu
   temada beyaz bir kutu açılıyor. */
.pfe-f[type="date"] { color-scheme: dark; }
body.light-theme .pfe-f[type="date"] { color-scheme: light; }

/* ==========================================================================
   Girdi diyaloğu
   ========================================================================== */
.ask-card {
    width: min(400px, 100%); padding: 20px;
    background: var(--panel); border: 1px solid var(--rule-strong); border-radius: var(--r);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: scale(.9);
    transition: transform .22s var(--ease-exp), opacity .22s var(--ease-exp);  /* çıkış */
}
.ask.open .ask-card {
    opacity: 1;
    transform: none;
    transition-duration: .36s;                  /* giriş */
}
.ask-card h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.ask-hint { margin: 0 0 14px; color: var(--ink-dim); font-size: 12px; line-height: 1.65; }
.ask-hint b { color: var(--ink); font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ask-card .field + .field { margin-top: 10px; }
.ask-actions { display: flex; gap: 6px; margin-top: 16px; }
.ask-actions .btn { flex: 1; height: 32px; }

/* ==========================================================================
   Bildirimler
   ========================================================================== */
/* Toast durum makinesi: hizli tetiklenen oge oldugu icin keyframe DEGIL
   transition (katman makinesiyle ayni ilke). Aralik gap yerine margin-top ile
   verilir ki cikista yukseklikle birlikte COKEBILSIN — alttaki toast'lar
   ziplamadan suzulur. Asimetri: giris zarif (.26s yukselis), cikis hizli. */
.toasts { position: fixed; right: 14px; bottom: 14px; z-index: 100; display: flex; flex-direction: column; max-width: min(360px, calc(100vw - 28px)); pointer-events: none; }
.toast {
    margin-top: 6px;
    padding: 9px 12px;
    background: var(--panel); border: 1px solid var(--rule-strong); border-left-width: 2px;
    border-radius: var(--r); box-shadow: var(--shadow);
    font-size: 12.5px; line-height: 1.5;
    overflow: hidden;
    opacity: 0; transform: translateY(12px);
    transition: opacity .26s var(--ease-exp), transform .26s var(--ease-exp);
    /* Jest: kap pointer-events:none, toast'un kendisi kaydırılabilir.
       pan-y — dikey kaydırma tarayıcıda kalır, yatay atış bizde. */
    pointer-events: auto;
    touch-action: pan-y;
}
.toast b { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.toast.show { opacity: 1; transform: none; }
/* Cikis: soner + yuksekligi coker. height JS'te px'e sabitlenir (auto gecis
   yapmaz); buradaki !important o inline degeri ezerek 0'a tasir. */
.toast.out {
    opacity: 0;
    height: 0 !important;
    margin-top: 0; padding-top: 0; padding-bottom: 0;
    border-top-width: 0; border-bottom-width: 0;
    transition: opacity .16s var(--ease-exp), height .22s var(--ease-exp),
                margin .22s var(--ease-exp), padding .22s var(--ease-exp),
                border-width .22s var(--ease-exp);
}
.toast.up { border-left-color: var(--up); }
.toast.down { border-left-color: var(--down); }
.toast.warn, .toast.alarm { border-left-color: var(--brass); }
.toast.info { border-left-color: var(--ink-dim); }

/* ==========================================================================
   Kinetik Tabela — hareket katmanı
   --------------------------------------------------------------------------
   Kural: hareket süs değil, malzeme. Tek yavaşlama eğrisi (--ease-exp) her
   yerde; eğriler iz bırakarak akar, kâğıtlar süzülür. Parlama yok, nabız yok.
   Sekme geçişleri BİLEREK animasyonsuz: 1000+ kartlık paneli saydamlıktan
   doğdurmak "gri flaş + donma" hissi veriyordu — sahne kesmesi ANINDA olur,
   hareket yalnızca panelin İÇİNDEKİ öğelerde yaşar.
   ========================================================================== */

/* Değer seyri: aralık değişiminde eğrinin geride bıraktığı pozlar.
   JS her ~85 ms'de mevcut ara kareyi kopyalar; kopya burada sönüp silinir. */
.spark-ghost { animation: ghostOut .7s ease-out forwards; }
@keyframes ghostOut { to { opacity: 0; } }

/* --------------------------------------------------------------------------
   Mekanik tabela rakamları (odometer)
   Fiyat değişince yalnızca DEĞİŞEN basamak makara gibi döner: yükselişte
   çark yukarı, düşüşte aşağı akar. Ayraçlar ve sabit basamaklar kımıldamaz.
   Mono + tabular olduğu için hücreler 1ch genişliğinde hizada kalır; JS
   animasyon bitince düz metne döner, sonraki tik temiz zeminde başlar.
   -------------------------------------------------------------------------- */
/* Hücre yüksekliği 1lh: kabın satır yüksekliğine eşit — rulo öncesi/sonrası
   taban çizgisi aynı kalır, rakamlar zıplamaz. (1em fallback eski tarayıcıya.)
   white-space: pre — yalnız boşluk taşıyan hücre sıfıra çökmesin.
   Hareket keyframe'le: yeni basılan şerit kendi kendine oynar, JS'in zorunlu
   reflow (offsetWidth) okuması gerekmez — saniyede ~50 rulo ucuza çıkar. */
.od-roll .odc { display: inline-block; vertical-align: top; white-space: pre; height: 1em; height: 1lh; }
.od { overflow: hidden; }
.od-strip span { display: block; height: 1em; height: 1lh; }
@keyframes odUp { from { transform: none; } to { transform: translateY(-1em); } }
@keyframes odDn { from { transform: translateY(-1em); } to { transform: none; } }
@supports (height: 1lh) {
    @keyframes odUp { from { transform: none; } to { transform: translateY(-1lh); } }
    @keyframes odDn { from { transform: translateY(-1lh); } to { transform: none; } }
}
.od .od-strip { display: block; }
.od-up .od-strip { animation: odUp .34s var(--ease-exp) forwards; }
.od-dn .od-strip { animation: odDn .34s var(--ease-exp) forwards; }

/* --------------------------------------------------------------------------
   Açılış koreografisi: tabela güne başlar. Üst bar, bant ve sekmeler 90 ms
   arayla yukarıdan yerine oturur; kartlar zaten kendi dalgasıyla gelir
   (cardIn). Sayfa yüklenmesine bağlı saf CSS — oturumda bir kez, JS yok.
   -------------------------------------------------------------------------- */
@keyframes drop { from { opacity: 0; transform: translateY(-14px); } }
/* Topbar SOLUKLASMAZ (yalniz kayar): scroll edilmis sayfa yenilenince sticky
   bar icerigin ustunde yari saydam binerdi — opak kalirsa bindirme okunmaz. */
@keyframes dropBar { from { transform: translateY(-14px); } }
.topbar { animation: dropBar .5s var(--ease-exp) backwards; }
.tape-wrap { animation: drop .5s var(--ease-exp) .09s backwards; }
.tabs { animation: drop .5s var(--ease-exp) .18s backwards; }

/* Portföy kalemleri: satırlar üstel ritimle sahneye girer.
   (Gecikmeleri buildPortfolio satır başına inline verir.) */
.pf-list .pf-row { animation: rise .55s var(--ease-exp) both; }

/* Portföy sahnesi: üç blok (özet bandı, paneller, tablo) 70 ms arayla yükselir.
   Yalnızca buildPortfolio'da kurulur — 5 sn'lik güncellemeler yerinde yama
   yaptığı için sahne TEKRARLAMAZ. */
@keyframes panelIn { from { opacity: 0; transform: translateY(22px); } }
.pf-app > * { animation: panelIn .55s var(--ease-exp) backwards; }
.pf-app > *:nth-child(2) { animation-delay: 70ms; }
.pf-app > *:nth-child(3) { animation-delay: 140ms; }

/* Isı haritası hücreleri: küçükten yerine oturur — tabloyu tek seferde
   basmak yerine dalga hâlinde kurar. Sınır ve gecikme renderHeatmap'te. */
@keyframes cellPop { from { opacity: 0; transform: scale(.84); } }
.hm-cell.in { animation: cellPop .5s var(--ease-exp) backwards; }

/* Favori yıldızı: nadir, keyifli an — işaretlenince yerinde pop yapar.
   Tahta yeniden basılmaz (animasyonu silerdi); sınıf yerinde değişir. */
@keyframes starPop { 40% { transform: scale(1.65); } }
.fav-star.pop { animation: starPop .4s var(--ease-exp); }

/* Tema perdesi: varsayılan çapraz sönüm kapatılır; yeni tema, JS'in (WAAPI)
   verdiği dairesel clip-path ile DÜĞMEDEN büyüyerek ekranı süpürür.
   API'siz tarayıcıda ve azaltılmış harekette eski davranış (anında) kalır. */
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: none; }

/* Tepki (Apple §1): geribildirim parmağın DEĞDİĞİ anda. Basılıyken hafif
   çöker; süre kısa tutulur ki tepki gecikmesiz okunsun. */
.btn:active, .tab:active, .range:active, .pf-range:active, .pf-cur:active,
.drawer-tab:active { transform: scale(.96); transition-duration: .06s; }
.range, .pf-range, .pf-cur, .drawer-tab, .hm-cell { transition: transform .12s ease-out; }
.card:active { transform: translateY(0) scale(.985); transition-duration: .06s; }
.hm-cell:active { transform: scale(.97); }
/* Satır/bağlantı tıklamaları da değdiği anda cevap verir — hareket değil,
   yalnızca zemin: dokunmatikte hover yok, basma anı yine de okunmalı. */
.ticker-item:active, .news a:active, .cmd-item:active,
.pf-row:active, .dr-row:active { background: var(--panel-2); }

/* Katman giriş/çıkışları yukarıda, "Katman durum makinesi" bölümünde:
   .open sınıfı transition ile düşer/kalkar, keyframe kullanılmaz — kesintiye
   dayanıklılık için (Apple §3). Burada ayrı bir kapanış tanımı YOKTUR. */

/* ==========================================================================
   Giriş ekranı
   --------------------------------------------------------------------------
   Arka planda canlı bir seans tahtası (canvas) akar, önünde tek bir kâğıt
   durur. Tahta bilerek soluk: okunacak olan form, tahta yalnızca bağlam.
   ========================================================================== */
.login-body { display: grid; place-items: center; min-height: 100svh; overflow: hidden; }

.login-board {
    position: fixed; inset: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

.login-shell { position: relative; z-index: 1; width: 100%; padding: 24px 16px; display: grid; place-items: center; }

.login-card {
    width: min(380px, 100%);
    padding: 26px 26px 22px;
    background: var(--paper);
    border: 1px solid var(--rule-strong);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    /* Kâğıt sahneye süzülerek oturur — açılışta tek hareket bu. */
    animation: rise .5s var(--ease-exp) backwards;
}

.login-brand {
    display: flex; align-items: center; gap: 9px;
    padding-bottom: 16px; margin-bottom: 18px;
    border-bottom: 1px solid var(--rule);
}

.login-title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.login-sub { margin: 4px 0 18px; color: var(--ink-dim); font-size: 12.5px; line-height: 1.55; }

/* Chrome otomatik doldurmayı kendi sarı zeminiyle boyar ve tasarımı ezer.
   background-color doğrudan değiştirilemediği için iç gölge hilesi: alanın
   kendi zemini kadar kalın bir iç gölge sarıyı örter, metin rengi de
   -webkit-text-fill-color ile geri alınır. */
.login-form input:-webkit-autofill,
.login-form input:-webkit-autofill:hover,
.login-form input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink);
    -webkit-box-shadow: 0 0 0 40px var(--panel) inset;
    caret-color: var(--ink);
    transition: background-color 9999s ease 0s;   /* geçiş sarıyı geri getirmesin */
}

.login-form .field + .field { margin-top: 12px; }
.login-form .field input { height: 34px; font-family: var(--sans); font-size: 13.5px; }
/* Şifre alanı mono: karakter sayısı gözle takip edilebilsin. */
.login-form input[type="password"] { font-family: var(--mono); letter-spacing: .08em; }
.field-hint { color: var(--ink-faint); font-size: 10.5px; line-height: 1.5; }

/* Hata: yer kaplamayan bir satır. Görününce yükseklik zıplamasın diye
   min-height ayrılır — form açılırken/kapanırken kart boyu sabit kalır. */
.login-err {
    min-height: 1.4em;
    margin: 12px 0 0;
    color: var(--down); font-size: 12px; line-height: 1.4;
    opacity: 0; transform: translateY(-3px);
    transition: opacity .16s var(--ease-exp), transform .16s var(--ease-exp);
}
.login-err.show { opacity: 1; transform: none; }

.login-submit { width: 100%; height: 36px; margin-top: 12px; font-size: 13.5px; }
.login-submit:disabled { opacity: .55; }

.login-alt { margin: 14px 0 0; color: var(--ink-dim); font-size: 12px; text-align: center; }
.link-btn {
    border: none; background: none; padding: 0;
    color: var(--brass); font: inherit; font-weight: 600; cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: border-color .12s;
}
.link-btn:hover { border-bottom-color: var(--brass); }

/* ==========================================================================
   Duyarlılık
   ========================================================================== */
@media (max-width: 1040px) {
    .pf-grid { grid-template-columns: 1fr; }
    .pf-hero { position: static; }
}
@media (max-width: 860px) {
    .topbar { padding: 8px var(--gutter); }
    .search-field { order: 3; flex: 1 1 100%; max-width: none; }
    .status { flex: 1 1 auto; justify-content: flex-end; }
    .grid-head { display: none; }
    .pfe-row {
        grid-template-columns: 1fr 1fr; gap: 5px;
        padding: 10px; margin-bottom: 6px;
        border: 1px solid var(--rule); border-radius: var(--r);
    }
    .pfe-row > [data-f="symbol"], .pfe-row > [data-f="name"] { grid-column: span 2; }
    /* Mobilde ızgara iki sütuna düşer; masaüstündeki 6. sütun sabiti burada
       geçersiz — anapara akışta kalmalı, yoksa yanına iki boş hücre açılır. */
    .pfe-row.is-repo > [data-f="costUnit"] { grid-column: auto; }
    .pfe-tot { grid-column: span 2; text-align: left; padding: 2px 0 0; }
    .pfe-btns { grid-column: span 2; justify-content: flex-start; }
}
@media (max-width: 560px) {
    .market-state { display: none; }
    .btn-key { display: none; }
    .feed-state .updated { display: none; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
    /* Dar hücrede fiyat ve değişim yan yana sığmıyor; değişim alta iner,
       yön çubuğu (2px sol kenar) korunur. */
    .card { grid-template-columns: 1fr; grid-template-areas: "sym" "price" "chg"; gap: 5px; align-items: start; }
    .card .chg { justify-self: start; min-width: 0; text-align: left; }
    .card .price { font-size: 15px; }
    .card .name { max-width: 100%; }
    .heatmap-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 100px), 1fr)); }
    .modal { padding: 0; }
    .modal .sheet { border: none; border-radius: 0; min-height: 100%; }
    .sheet-modal { padding: 0; }
    .sheet-wide { max-height: 100svh; border: none; border-radius: 0; }
    .drawer-card { width: 100%; }
    .toasts { left: 12px; right: 12px; max-width: none; }
    .action-bar { flex-direction: column; align-items: stretch; }
    .paper-trading-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .txn-row { grid-template-columns: 4.5rem 1fr; }
    .txn-nums { grid-column: span 2; text-align: left; }
}

/* ==========================================================================
   Erişilebilirlik tercihleri
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .tape { animation: none; }
    /* Renk geribildirimi hareket değildir: fiyat yönü flaşı, rakam tiki ve
       portföy satır flaşı kalır — konum değişimi yok, yalnızca renk (plans/005). */
    .card.flash-up, .card.flash-down,
    .card.flash-up .price, .card.flash-down .price,
    .m-price.tick-up, .m-price.tick-down { animation-duration: .7s !important; }
    .pf-row { transition-duration: .8s !important; }
}
@media (prefers-contrast: more) {
    :root { --rule: #3d4655; --ink-dim: #b3bcc9; --ink-faint: #8d97a5; }
    body.light-theme { --rule: #a8b3c0; --ink-dim: #414b58; --ink-faint: #5f6a78; }
}
/* Saydamlık azaltma tercihi: yarı saydam perde tam örtücü olur (Apple §14). */
@media (prefers-reduced-transparency: reduce) {
    .modal, .sheet-modal, .cmd-modal, .ask, .drawer { background: var(--paper); }
}
