/* ============================================================
   manosdepot — tasarım sistemi
   Koyu "premium hesap aracı" · BDO altın/parşömen ruhu (oyun UI taklidi değil)
   ============================================================ */

:root {
  --bg:        #0E1013;
  --surface:   #171A1F;
  --surface-2: #1E232B;
  --surface-3: #252B34;
  --border:    #2A303A;
  --border-2:  #363E4A;
  --accent:    #C9A227;   /* altın */
  --accent-2:  #E0C868;
  --accent-soft:#D9BE7B;
  --text:      #E8E6E1;
  --muted:     #98A0AB;
  /* #6B7280 idi → koyu zeminde 3.3:1 (WCAG gövde <4.5, okunmuyordu). #8A929E ile tüm yüzeylerde
     ≥4.5, --muted'dan hâlâ ayrık (hiyerarşi korunur). */
  --muted-2:   #8A929E;
  --profit:    #4CAF7D;
  --profit-bg: rgba(76,175,125,.12);
  --loss:      #E05A4E;
  --loss-bg:   rgba(224,90,78,.12);
  --warn:      #E0A83C;
  --warn-bg:   rgba(224,168,60,.12);
  --info:      #5B9BD5;

  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.28);
  --sidebar-w: 244px;
  --topbar-h:  60px;
  /* Sidebar/topbar kendi yüzey token'ları (temaya göre değişir) */
  --sidebar-bg: linear-gradient(180deg, #141821 0%, #101318 100%);
  --topbar-glass: rgba(14,16,19,.82);
  --auth-card-bg: linear-gradient(180deg, #191C22 0%, #131418 100%);

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  color-scheme: dark;
}

/* ============================================================
   LIGHT (beyaz) tema — BDO altın/parşömen ruhu, açık parşömen zemin + koyu metin.
   Tüm renkler açık zeminde WCAG ≥4.5:1 doğrulandı (koyulaştırılmış altın/yeşil/kırmızı).
   html[data-theme="light"] ile etkin; JS localStorage + PlayerSettings ile kalıcı (theme.js).
   ============================================================ */
:root[data-theme="light"] {
  --bg:        #F5F3EE;
  --surface:   #FCFBF7;
  --surface-2: #EFEBE2;
  --surface-3: #E5E0D5;
  --border:    #DED9CE;
  --border-2:  #CFC9BB;
  --accent:    #B8901A;   /* altın (buton zemini + ikon/border); açık zeminde koyulaştırıldı */
  --accent-2:  #7A5E0E;   /* metin vurgusu — koyu altın (açık zeminde ≥4.5) */
  --accent-soft:#8A6D10;
  --text:      #20242A;
  --muted:     #5C6470;
  --muted-2:   #616974;
  --profit:    #157545;
  --profit-bg: rgba(21,117,69,.10);
  --loss:      #BE2E20;
  --loss-bg:   rgba(190,46,32,.10);
  --warn:      #8A5E00;
  --warn-bg:   rgba(138,94,0,.10);
  --info:      #2C6099;

  /* Açık zeminde koyu-siyah gölge sert olur → çok hafif gölge. */
  --shadow:    0 1px 2px rgba(60,50,20,.06), 0 8px 24px rgba(60,50,20,.10);
  --sidebar-bg: linear-gradient(180deg, #FCFBF7 0%, #EFEBE2 100%);
  --topbar-glass: rgba(250,248,243,.85);
  --auth-card-bg: linear-gradient(180deg, #FFFFFF 0%, #F7F4EE 100%);

  color-scheme: light;
}

/* Tema geçişi yumuşak olsun (renk değişimi ani sıçramasın). Reduced-motion'da anında. */
html { transition: background-color .2s ease, color .2s ease; }
@media (prefers-reduced-motion: reduce) { html { transition: none; } }

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

a { color: var(--accent-soft); text-decoration: none; }
a:hover { color: var(--accent-2); }

h1,h2,h3,h4 { font-weight: 650; letter-spacing: -.01em; margin: 0 0 .4em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }

::selection { background: rgba(201,162,39,.32); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #454e5c; }

/* ============================================================ Uygulama kabuğu */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.brand {
  display: flex; align-items: center; gap: .65rem;
  padding: 1.15rem 1.25rem 1.1rem;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: radial-gradient(120% 120% at 30% 20%, var(--accent-2), var(--accent) 55%, #8a6f16);
  display: grid; place-items: center;
  color: #1a1500; font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 2px 10px rgba(201,162,39,.35), inset 0 1px 0 rgba(255,255,255,.4);
}
.brand-name { font-weight: 700; font-size: 1.08rem; letter-spacing: -.02em; line-height: 1.1; }
.brand-name b { color: var(--accent-2); font-weight: 800; }
.brand-sub { font-size: .64rem; color: var(--muted-2); letter-spacing: .14em; text-transform: uppercase; }

.nav-list { padding: .75rem .6rem; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: .7rem;
  padding: .62rem .7rem; border-radius: var(--radius-sm);
  color: var(--muted); font-weight: 500; font-size: .95rem;
  transition: background .12s, color .12s; cursor: pointer; text-decoration: none;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--surface-3); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
.nav-item.active .nav-ico { color: var(--accent); }
.nav-ico { width: 18px; height: 18px; flex-shrink: 0; color: var(--muted-2); }

.sidebar-foot { padding: .8rem 1rem; border-top: 1px solid var(--border); font-size: .78rem; color: var(--muted-2); }

/* ---- Ana alan ---- */
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.5rem;
}
/* Buzlu cam efekti pseudo-öğede: backdrop-filter'ı topbar'a koymak onu position:fixed alt
   öğeler için "containing block" yapıp modal'ı topbar'a hapsediyordu. Pseudo'da efekt korunur,
   modal (position:fixed) viewport'a göre ortalanır. */
.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--topbar-glass); backdrop-filter: blur(8px);
}
.topbar-title { font-weight: 650; font-size: 1.02rem; margin: 0; letter-spacing: -.01em; color: var(--text); }
.topbar-spacer { flex: 1; }

.content { padding: 1.6rem 1.75rem 3rem; max-width: 1180px; width: 100%; margin: 0 auto; }

/* ============================================================ Çipler / rozetler */
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .6rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted-2); }
.chip.region { color: var(--accent-soft); border-color: rgba(201,162,39,.35); }
.chip.region .dot { background: var(--accent); }
.chip.net .dot { background: var(--profit); }
.chip.fresh .dot { background: var(--info); }
.chip.demo { color: var(--warn); border-color: rgba(224,168,60,.4); background: var(--warn-bg); }

/* ---- Topbar global eşya arama ---- */
.gsearch { position: relative; display: inline-flex; align-items: center; }
.gsearch-ico { position: absolute; left: .55rem; color: var(--muted-2); pointer-events: none; }
.gsearch-input {
  width: 190px; padding: .38rem .6rem .38rem 1.7rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  font: inherit; font-size: .82rem; transition: width .15s, border-color .15s;
}
.gsearch-input:focus { width: 230px; outline: none; border-color: var(--accent); }
.gsearch-hint { position: absolute; right: .6rem; font-size: .72rem; color: var(--muted-2); pointer-events: none; }
.gsearch-drop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 90;
  width: 300px; max-height: 340px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0,0,0,.5); padding: .25rem;
}
.gsearch-hit { display: flex; align-items: center; gap: .5rem; padding: .4rem .5rem; border-radius: 6px; cursor: pointer; }
.gsearch-hit:hover, .gsearch-hit.on { background: var(--surface-3); }
.gsearch-hit .gs-name { flex: 1; font-size: .85rem; color: var(--text); }
.gsearch-hit .gs-stock { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.gsearch-hit .gs-stock.zero { color: var(--warn); }

/* ---- Arama sonucu modalı ---- */
/* overflow-y:auto tek başına overflow-x'i de 'auto'ya çevirir → hover ItemCard tooltip'leri (absolute,
   visibility:hidden'ken bile yer kaplar) modal sağ kenarını aşıp YATAY SCROLL üretir. x'i açıkça kısıtla. */
.modal-box.gs-modal { max-width: 880px; width: min(94vw, 880px); overflow-y: auto; overflow-x: hidden; }
/* Üreten reçete seçici sekmeleri */
.gs-recipe-tabs { display: flex; flex-direction: column; gap: 4px; }
.gs-recipe-tab {
  display: flex; align-items: center; gap: .5rem; padding: .4rem .55rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; transition: border-color .1s, background .1s;
}
.gs-recipe-tab:hover { background: var(--surface-3); }
.gs-recipe-tab.on { border-color: var(--accent); background: var(--surface-3); box-shadow: inset 2px 0 0 var(--accent); }
.gs-recipe-tab img { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.gs-recipe-tab .grt-name { flex: 1; font-size: .84rem; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Bununla neler üretilebilir */
.gs-section { border-top: 1px solid var(--border); padding-top: .6rem; margin-top: .7rem; }
.gs-uses { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 5px; }
.gs-use {
  display: flex; align-items: center; gap: .45rem; padding: .35rem .5rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; transition: border-color .1s, background .1s;
}
.gs-use:hover { border-color: var(--accent); background: var(--surface-3); }
.gs-use img { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; }
.gs-use .gu-name { flex: 1; font-size: .82rem; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-use .gu-qty { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.gs-stats { display: flex; flex-direction: column; gap: .22rem; border-top: 1px solid var(--border); padding-top: .6rem; margin-top: .7rem; }
.gs-stat { display: flex; justify-content: space-between; gap: 1rem; font-size: .84rem; color: var(--muted); }
.gs-stat b { color: var(--text); font-weight: 600; white-space: nowrap; }
.gs-stat.muted, .gs-stat.muted b { color: var(--muted-2); }
.gs-stat.warn b { color: var(--warn); }
.gs-plan { margin-top: .6rem; padding-top: .7rem; border-top: 1px solid var(--border); }
.gs-plan.illiquid { opacity: .82; }
.gs-modb { padding: .5rem .6rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }

.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .18rem .5rem; border-radius: 6px;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
}
.badge.tax-free { background: rgba(201,162,39,.16); color: var(--accent-2); border: 1px solid rgba(201,162,39,.3); }
.badge.market  { background: var(--surface-3); color: var(--muted); border: 1px solid var(--border-2); }
.badge.craft   { background: var(--profit-bg); color: var(--profit); }
.badge.sell    { background: var(--loss-bg); color: var(--loss); }
.badge.dead    { background: var(--loss-bg); color: var(--loss); border: 1px solid rgba(224,90,78,.3); }
.badge.ok      { background: var(--profit-bg); color: var(--profit); }

/* ============================================================ Kartlar */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
}
.card-pad { padding: 1.15rem 1.25rem; }

.grid { display: grid; gap: 1rem; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.stat {
  padding: 1.15rem 1.25rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border);
  position: relative; overflow: hidden;
}
.stat::before { content:""; position:absolute; inset:0 auto 0 0; width:3px; background:var(--accent); opacity:0; transition:opacity .15s; }
.stat:hover::before { opacity:.7; }
.stat-label { font-size: .8rem; color: var(--muted); font-weight: 600; margin-bottom: .5rem; display:flex; align-items:center; gap:.5rem; }
.stat-key { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.stat-key.gold { background: var(--accent); box-shadow: 0 0 8px rgba(201,162,39,.5); }
.stat-key.green { background: var(--profit); box-shadow: 0 0 8px rgba(76,175,125,.4); }

/* MOD A kullanıcı filtreleri */
.moda-filters { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
.moda-filters .mf-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.moda-filters .mf-label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); margin-right: .1rem; }
.mf-chip { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer;
  padding: .32rem .6rem; border-radius: 999px; font-size: .8rem; color: var(--muted);
  background: var(--surface); border: 1px solid var(--border); transition: border-color .12s, background .12s, color .12s; }
.mf-chip:hover { border-color: var(--border-2); }
.mf-chip.on { border-color: var(--accent); color: var(--text); background: rgba(201,162,39,.08); }
.mf-chip input { accent-color: var(--accent); cursor: pointer; margin: 0; }
.stat-key.red { background: var(--loss); box-shadow: 0 0 8px rgba(224,90,78,.4); }
.stat-value { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; }
.stat-sub { font-size: .82rem; color: var(--muted); margin-top: .35rem; }

/* ============================================================ Gümüş değerler */
.num { color: var(--text); }
.silver { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--text); }
.silver .unit { font-size: .78em; color: var(--muted); font-weight: 500; margin-left: .18em; }
.pos { color: var(--profit); }
.neg { color: var(--loss); }

/* ============================================================ Plan kartları (MOD A) */
.plan-card { padding: 0; overflow: hidden; }
.plan-head {
  display: flex; align-items: flex-start; gap: .8rem;
  padding: 1rem 1.2rem .85rem; border-bottom: 1px solid var(--border);
}
.plan-title { font-weight: 650; font-size: 1.02rem; }
.plan-out { font-size: .84rem; color: var(--muted); margin-top: .12rem; }
.plan-body { padding: .9rem 1.2rem 1.1rem; display: flex; flex-direction: column; gap: .85rem; }

/* Katlanabilir plan kartı: özet (başlık + kâr) tıklanır; detaylar açılır/kapanır */
.plan-summary { cursor: pointer; user-select: none; }
.plan-summary .plan-head { border-bottom: none; padding-bottom: .55rem; }
.plan-summary .profit-row { padding: 0 1.2rem 1rem; }
.plan-card.open > .plan-summary { border-bottom: 1px solid var(--border); }
.plan-summary:hover .plan-title { color: var(--accent-2); }
.chevron { flex-shrink: 0; color: var(--muted); transition: transform .18s; margin-top: .25rem; }
.plan-card.open .chevron { transform: rotate(180deg); }
/* MOD B kartında da özet dikey yerleşim */
.plan-summary > .row { padding: 1rem 1.2rem .2rem; }
.plan-summary > .row.between:not(:first-child) { padding: .2rem 1.2rem; }

.profit-row { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.profit-row.three { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 720px) { .profit-row.three { grid-template-columns: 1fr; } }

/* ---- MOD A kompakt kart özeti: sol başlık+meta (2 satır), sağda mini istatistik sütunları ---- */
.ps { display: flex; align-items: center; gap: 1.1rem; padding: .8rem 1.2rem; }
.ps-left { flex: 1; min-width: 0; }
.ps-title {
  display: inline-flex; align-items: center; gap: .45rem;
  font-weight: 650; font-size: 1rem; color: var(--text); cursor: help;
}
.plan-summary:hover .ps-title { color: var(--accent-2); }
.ps-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: .55rem;
  font-size: .82rem; color: var(--muted); margin-top: .16rem;
}
.ps-stats { display: flex; align-items: center; gap: 1.5rem; flex-shrink: 0; }
.ps-stat { display: flex; flex-direction: column; align-items: flex-end; gap: .06rem; }
.ps-stat .k { font-size: .64rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.ps-stat .v { font-size: .98rem; font-weight: 750; letter-spacing: -.01em; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.ps-stat .v.pos { color: var(--profit); }
.ps-stat .v.neg { color: var(--loss); }
.ps-stat .s { font-size: .68rem; color: var(--muted-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 900px) {
  .ps { flex-wrap: wrap; }
  .ps-left { flex-basis: 100%; }
  .ps-stats { width: 100%; justify-content: space-between; gap: .8rem .9rem; flex-wrap: wrap; }
  .ps-stat { align-items: flex-start; }
  .ps .chevron { display: none; }
  /* Fiyat girişli hücre (imparatorluk/ticaret) taşmasın: kendi satırına geçip tam genişlik alır. */
  .ps-price { flex-basis: 100%; align-items: stretch; }
  .ps-price input { width: 100%; text-align: left; }
}

/* Üretim yap: adet gir → plandaki depo tüketimi gerçek depodan düşülür */
.craft-do {
  display: flex; align-items: center; flex-wrap: wrap; gap: .6rem;
  padding: .55rem .7rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px dashed var(--border-2);
}
.craft-do input[type="number"] {
  width: 90px; padding: .3rem .5rem; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-variant-numeric: tabular-nums;
}
.craft-do .cd-max { font-size: .74rem; color: var(--muted-2); white-space: nowrap; }
.craft-do .cd-btn { padding: .32rem .8rem; font-size: .82rem; }
.craft-do .cd-msg { font-size: .78rem; font-weight: 600; }
.craft-do .cd-msg.ok { color: var(--profit); }
.craft-do .cd-msg.err { color: var(--loss); }

/* Malzeme-bazlı depo kullanımı (işaretli = depodan düş; ± birim maliyet etkisi) */
.du-list { display: flex; flex-direction: column; gap: .25rem; }
.du-row { display: flex; align-items: center; gap: .5rem; padding: .3rem .55rem; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); font-size: .8rem; color: var(--muted); cursor: pointer; }
.du-row.on { border-color: var(--accent); background: rgba(201,162,39,.06); color: var(--text); }
.du-row input { accent-color: var(--accent); cursor: pointer; margin: 0; flex-shrink: 0; }
.du-row img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.du-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.du-have { font-size: .72rem; color: var(--muted-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.du-delta { font-size: .74rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.du-delta.pos { color: var(--profit); }
.du-delta.neg { color: var(--loss); }
.profit-box {
  padding: .7rem .85rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.profit-box .k { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.profit-box .v { font-size: 1.25rem; font-weight: 750; margin-top: .2rem; letter-spacing: -.01em; }
.profit-box.econ { background: var(--surface); }

.kv { font-size: .86rem; color: var(--muted); }
.kv b { color: var(--text); font-weight: 600; }

.revenue-line { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: .92rem; }

.shop-list, .used-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .28rem .55rem; border-radius: 7px; font-size: .8rem;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.pill b { color: var(--text); font-weight: 600; }

/* ---- Üretim akışı (craft flow) ---- */
.craft-flow { display: flex; flex-direction: column; gap: .45rem; }
.flow-step {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .5rem .6rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.flow-step.final { background: rgba(201,162,39,.08); border-color: rgba(201,162,39,.3); }
.flow-num {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-3); color: var(--muted); font-size: .72rem; font-weight: 700;
  display: grid; place-items: center;
}
.flow-step.final .flow-num { background: var(--accent); color: #1a1500; }
.flow-inputs { display: flex; flex-wrap: wrap; gap: .3rem; flex: 1; min-width: 140px; }
.flow-pill {
  display: inline-flex; align-items: center; gap: .28rem;
  padding: .18rem .45rem; border-radius: 6px; font-size: .78rem;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}
.flow-pill img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.flow-pill b { color: var(--accent-2); font-variant-numeric: tabular-nums; }
/* İkame edilebilir (değiştirilebilir) malzeme: yeşilimsi kenar + ⇄ rozeti */
.flow-pill.sub { border-color: var(--profit); background: var(--profit-bg); }
.pill-sub { display: inline-flex; align-items: center; color: var(--profit); flex-shrink: 0; margin-left: .05rem; }
.pill-sub svg { display: block; }
.pill-flag { display: inline-flex; align-items: center; color: currentColor; flex-shrink: 0; margin-left: .05rem; }
.pill-flag svg { display: block; }
.flow-legend { font-size: .66rem; font-weight: 600; letter-spacing: .02em; text-transform: none;
  color: var(--profit); margin-left: .5rem; }
.flow-arrow { color: var(--muted-2); flex-shrink: 0; }
/* Ok + işlem türü etiketi (Isıtma, Simya, Aşçılık…): okun üstünde küçük etiket */
.flow-proc { display: inline-flex; flex-direction: column; align-items: center; gap: .06rem; flex-shrink: 0; }
.fp-label {
  font-size: .6rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--accent-2); white-space: nowrap; line-height: 1;
}
.flow-out {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .84rem; color: var(--text);
  padding: .2rem .5rem; border-radius: 6px; background: var(--surface); border: 1px solid var(--border);
}
.flow-out img { width: 22px; height: 22px; object-fit: contain; flex-shrink: 0; }
.flow-out b { color: var(--accent-2); font-variant-numeric: tabular-nums; }
.flow-out.final { background: rgba(201,162,39,.14); border-color: rgba(201,162,39,.35); font-weight: 600; }

/* Likidite sorunlu eşya: sorun ayrı bir uyarı kutusunda değil, kaynağında işaretlenir.
   .blocked = plan bu eşya yüzünden gerçekleştirilemez · .warn = riskli ama yürür.
   KONUM ŞART: .flow-pill.sub (ikame yeşili) ve .flow-out.final (altın) kurallarından SONRA gelmeli,
   yoksa eşit specificity'de sonraki kural kazanır ve sorun rengi görünmez. */
.flow-pill.warn, .flow-out.warn {
  border-color: rgba(224,168,60,.5); background: var(--warn-bg); color: var(--warn);
}
.flow-pill.blocked, .flow-out.blocked {
  border-color: rgba(224,90,78,.55); background: var(--loss-bg); color: var(--loss);
}
.flow-pill.warn b, .flow-out.warn b { color: var(--warn); }
.flow-pill.blocked b, .flow-out.blocked b { color: var(--loss); }
/* Ara ürün: marketten al vs üret maliyet karşılaştırması */
.flow-cost { flex-basis: 100%; display: flex; align-items: center; gap: .5rem; margin: .35rem 0 0 28px; font-size: .78rem; }
.cost-opt { color: var(--muted); }
.cost-opt b { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: .2rem; }
.cost-opt.best { color: var(--profit); font-weight: 600; }
.cost-opt.best b { color: var(--profit); }
.cost-vs { color: var(--muted-2); }

.warn-band {
  display: flex; align-items: center; gap: .55rem;
  padding: .6rem .8rem; border-radius: var(--radius-sm);
  background: var(--warn-bg); border: 1px solid rgba(224,168,60,.35);
  color: var(--accent-2); font-size: .86rem; font-weight: 500;
}

/* Örnek (demo) plan şeridi: depo boşken planlama sayfasının üstünde durumu izah eder. */
.demo-banner {
  display: flex; align-items: center; gap: .8rem;
  padding: .85rem 1rem; margin-bottom: 1rem; border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(201,162,39,.10), rgba(201,162,39,.04));
  border: 1px solid rgba(201,162,39,.35);
  color: var(--text); font-size: .9rem; line-height: 1.5;
}
.demo-banner .demo-ico { color: var(--accent-2); flex-shrink: 0; display: flex; }
.demo-banner b { color: var(--accent-2); font-weight: 700; }
.demo-cta { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 720px) {
  .demo-banner { flex-direction: column; align-items: flex-start; }
  .demo-cta { align-self: stretch; text-align: center; }
}

.section-label { font-size: .74rem; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .08em; }

/* ============================================================ Likidite (market gerçekliği) */
.liq-badge {
  display: inline-flex; align-items: center; gap: .4rem; margin-top: .35rem;
  padding: .12rem .5rem; border-radius: 999px; font-size: .74rem; font-weight: 600;
  border: 1px solid var(--border-2);
}
.liq-badge .liq-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.liq-badge.ok       { color: var(--profit); background: var(--profit-bg); border-color: rgba(76,175,125,.3); }
.liq-badge.thin     { color: var(--warn);   background: var(--warn-bg);   border-color: rgba(224,168,60,.35); }
.liq-badge.illiquid { color: var(--loss);   background: var(--loss-bg);   border-color: rgba(224,90,78,.35); }
.liq-badge.unknown  { color: var(--muted);  background: var(--surface-3); border-color: var(--border); }

/* Gerçekleştirilemez (ilikit) reçete kartı: soluk, dipte */
.plan-card.illiquid { opacity: .58; filter: saturate(.7); }
.plan-card.illiquid:hover { opacity: .82; }
.plan-card.illiquid.open { opacity: 1; filter: none; }

/* ============================================================ Eşya bilgi kartı (hover) */
/* Kart açıkken overflow serbest — yoksa hover popover kart kenarında kesilir. */
.plan-card.open { overflow: visible; position: relative; z-index: 1; }
.plan-card.open:hover { z-index: 2; }
/* Kapalı kartta da başlık hover kartı kesilmesin (özet başlığındaki bilgi kartı). */
.plan-card:hover { overflow: visible; position: relative; z-index: 2; }

.pill-wrap { position: relative; display: inline-flex; }
.pill-wrap > .flow-pill, .pill-wrap > .flow-out { cursor: help; }
/* Pill'ler tabindex taşır: dokunmatik/klavyede de bilgi kartı açılabilsin (:focus-within). */
.pill-wrap > .flow-pill:focus-visible, .pill-wrap > .flow-out:focus-visible {
  outline: 2px solid var(--accent-2); outline-offset: 1px;
}
.item-card {
  position: absolute; z-index: 60; bottom: calc(100% + 6px); left: 0;
  min-width: 230px; max-width: 300px;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); padding: .7rem .8rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  opacity: 0; visibility: hidden; transform: translateY(5px);
  transition: opacity .12s ease, transform .12s ease, visibility .12s;
  pointer-events: none;
  display: flex; flex-direction: column; gap: .55rem;
  white-space: normal; text-align: left;
}
.pill-wrap:hover > .item-card,
.pill-wrap:focus-within > .item-card { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
/* Görünmez köprü: kartın altı ile pill arası 6px boşlukta imleç geçerken hover kopmasın (alternatif
   seçimi için karta çıkarken kart kaybolmasın). Kart kapalıyken pointer-events:none → köprü de pasif. */
.pill-wrap > .item-card::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 10px; }
.ic-head { display: flex; align-items: center; gap: .55rem; }
/* Likidite gerekçesi — kartın başında, pill rengiyle aynı dilde */
.ic-flag {
  display: flex; align-items: flex-start; gap: .4rem;
  padding: .4rem .5rem; border-radius: var(--radius-sm);
  font-size: .78rem; line-height: 1.4;
}
.ic-flag svg { flex-shrink: 0; margin-top: .1rem; }
.ic-flag.blocked { color: var(--loss); background: var(--loss-bg); border: 1px solid rgba(224,90,78,.35); }
.ic-flag.warn   { color: var(--warn); background: var(--warn-bg); border: 1px solid rgba(224,168,60,.35); }
.ic-head img { width: 34px; height: 34px; border-radius: 6px; background: var(--surface-3); flex-shrink: 0; }
.ic-title { display: flex; flex-direction: column; min-width: 0; }
.ic-name { font-weight: 700; color: var(--text); font-size: .9rem; line-height: 1.2; }
.ic-en { font-size: .72rem; color: var(--muted-2); }
.ic-rows { display: flex; flex-direction: column; gap: .22rem; }
.ic-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .8rem; color: var(--muted); }
.ic-row b { color: var(--text); font-weight: 600; white-space: nowrap; }
.ic-row.muted, .ic-row.muted b { color: var(--muted-2); }
.ic-row.warn b { color: var(--warn); }
.ic-tag { font-size: .64rem; padding: .05rem .3rem; border-radius: 4px; margin-left: .2rem;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.ic-tag.ok { background: var(--profit-bg); color: var(--profit); border-color: transparent; }
.ic-hint { margin-top: .1rem; font-size: .76rem; color: var(--accent-soft); border-top: 1px solid var(--border); padding-top: .4rem; }
/* 5 günlük hacim sparkline'ı: gün başına bir yuva, barlar tabandan büyür; son gün (bugün) yeşil. */
/* 5 günlük hacim — kompakt rakam dizisi (grafik yerine). */
.vol-nums { display: inline-flex; align-items: baseline; gap: .25rem; font-variant-numeric: tabular-nums; font-size: .8rem; white-space: nowrap; }
.vol-nums .vn { color: var(--muted); }
.vol-nums .vn.today { color: var(--accent-2); font-weight: 600; }
.vol-nums .vn-sep { color: var(--muted-2); font-size: .7rem; }
/* Hacim satırı fiyat bloğunun dışında tek başına → alt çizgi/kenar boşluğu topla. */
.mkt-row.mkt-vol { border-bottom: none; }
/* İkame alternatifleri (birim maliyetle, en ucuz üstte/vurgulu) */
.ic-alts { display: flex; flex-direction: column; gap: .18rem; border-top: 1px solid var(--border); padding-top: .4rem; }
.ic-alts-head { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); margin-bottom: .1rem; }
.ic-alt { display: flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--muted); }
.ic-alt img { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }
.ic-alt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic-alt-cost { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ic-alt.chosen { color: var(--text); }
.ic-alt.chosen .ic-alt-cost { color: var(--profit); }
/* Seçilebilir alternatif (reçetede değiştir) — tıklanabilir buton */
.ic-alt-btn { appearance: none; background: none; border: 1px solid transparent; border-radius: 6px;
  width: 100%; text-align: left; cursor: pointer; padding: .18rem .3rem; font: inherit; }
.ic-alt-btn:hover { border-color: var(--border-2); background: var(--surface-3); }
.ic-alt-btn.chosen { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.ic-alt-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ic-pos { color: var(--profit) !important; }

/* Reçete başlığında ürün ikonu */
.plan-title { display: flex; align-items: center; gap: .45rem; }
.title-ico { width: 22px; height: 22px; border-radius: 5px; background: var(--surface-3); object-fit: contain; flex-shrink: 0; }

/* Depo hücresinde eşya kartı — hücre üstünde ortalanmış */
.wh-cell.filled > .item-card { left: 50%; right: auto; transform: translateX(-50%) translateY(5px); }
.wh-cell.filled:hover > .item-card { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ============================================================ İmparatorluk sayfası */
.tabs { display: inline-flex; gap: .3rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .25rem; }
.tab { border: none; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: .88rem; padding: .4rem .9rem; border-radius: 7px; cursor: pointer; }
.tab.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.3); }

.imp-list { display: flex; flex-direction: column; gap: .6rem; }
.imp-card { padding: 0; border-left: 3px solid var(--border-2); overflow: visible; position: relative; z-index: 1; }
.imp-card.open { z-index: 2; }
.imp-foot { cursor: pointer; }
.imp-toggle { color: var(--accent-soft); font-weight: 600; }
.imp-detail { margin-top: .7rem; padding-top: .7rem; border-top: 1px solid var(--border); }
.imp-drow { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.imp-drow:last-child { border-bottom: none; }
.imp-drow-top { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.imp-cmp { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; margin-left: auto; }
.imp-cmp .imp-line { color: var(--text); margin-left: .3rem; }
.imp-recipe { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-top: .4rem; padding-left: 1rem; }

/* Özyinelemeli reçete ağacı */
.rtree-node { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .25rem 0; }
.rtree-info { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; margin-left: auto; }
.rtree-stok { color: var(--muted-2); }
.rtree-exp { border: none; background: var(--surface-3); color: var(--accent-soft); font: inherit; font-size: .72rem; padding: .1rem .45rem; border-radius: 5px; cursor: pointer; margin-left: .2rem; }
.rtree-exp:hover { background: var(--surface); }
.rtree-children { margin-left: 16px; padding-left: 12px; border-left: 1px dashed var(--border-2); }
.imp-card.pos { border-left-color: var(--profit); }
.imp-card.neg { border-left-color: var(--loss); opacity: .82; }
.imp-head { display: flex; align-items: flex-start; gap: .8rem; }
.imp-box-ico { width: 26px; height: 26px; border-radius: 6px; background: var(--surface-3); flex-shrink: 0; object-fit: contain; }

/* İmp: sandık NPC fiyat girişi — ps-stats içinde bir sütun (Mod A ps düzeni) */
.ps-price { align-items: flex-end; }
.ps-price input {
  width: 128px; padding: .32rem .5rem; border-radius: 7px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-variant-numeric: tabular-nums; text-align: right;
}
.ps-price input:focus { outline: none; border-color: var(--accent-soft); }
.ps-stat .v.s-hint { color: var(--muted); font-weight: 600; font-size: .82rem; }
@media (max-width: 900px) { .ps-price { align-items: flex-start; } }
.imp-name { font-weight: 700; font-size: .98rem; margin-bottom: .35rem; }
.imp-dishes { display: flex; flex-wrap: wrap; gap: .3rem; }
.imp-dish { display: inline-flex; align-items: center; gap: .3rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: .1rem .5rem; font-size: .78rem; color: var(--muted); }
.imp-dish img { width: 18px; height: 18px; }
.imp-dish b { color: var(--text); }
.imp-price { display: flex; flex-direction: column; gap: .2rem; align-items: flex-end; flex-shrink: 0; }
.imp-price .input { width: 130px; }
.imp-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .6rem; padding-top: .55rem; border-top: 1px solid var(--border); flex-wrap: wrap; gap: .5rem; }
.imp-profit { font-size: .9rem; }
.imp-profit.pos b { color: var(--profit); }
.imp-profit.neg b { color: var(--loss); }

/* Arama açılır listesinde fiyat + stok */
.cd-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; margin-left: auto; }
.cd-stock { font-size: .68rem; color: var(--muted-2); white-space: nowrap; }
.cd-stock.zero { color: var(--warn); }

/* ============================================================ Formlar & butonlar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .58rem 1rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .92rem; cursor: pointer;
  border: 1px solid transparent; transition: background .12s, border-color .12s, transform .05s;
  font-family: var(--font); text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #1a1500; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-2); color: #1a1500; }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-danger { background: transparent; color: var(--loss); border-color: rgba(224,90,78,.4); }
.btn-danger:hover { background: var(--loss-bg); }
.btn-sm { padding: .38rem .7rem; font-size: .84rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

.icon-btn {
  width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center;
  background: transparent; border: 1px solid transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--loss-bg); color: var(--loss); border-color: rgba(224,90,78,.3); }

/* Tema değiştirici — ikon data-theme'e göre: dark'ta güneş (aydınlığa geç), light'ta ay (karanlığa geç). */
.theme-toggle {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--border); color: var(--muted); cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.theme-toggle:hover { color: var(--accent-2); border-color: var(--border-2); background: var(--surface-2); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.theme-toggle .theme-ico-moon { display: none; }
.theme-toggle .theme-ico-sun { display: block; }
:root[data-theme="light"] .theme-toggle .theme-ico-sun { display: none; }
:root[data-theme="light"] .theme-toggle .theme-ico-moon { display: block; }

label.field { display: block; margin-bottom: 1rem; }
label.field > .lbl { display: block; font-size: .84rem; font-weight: 600; color: var(--text); margin-bottom: .35rem; }
label.field > .hint { font-size: .78rem; color: var(--muted-2); margin-top: .25rem; }

.input, .textarea, select.input {
  width: 100%; padding: .6rem .75rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text);
  font-family: var(--font); font-size: .92rem; transition: border-color .12s, box-shadow .12s;
}
.input:focus, .textarea:focus, select.input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,162,39,.15);
}
.textarea { min-height: 150px; resize: vertical; font-variant-numeric: tabular-nums; line-height: 1.6; }

.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 40px; height: 23px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-2); position: relative; transition: background .15s; }
.switch .track::after { content:""; position:absolute; top:2px; left:2px; width:17px; height:17px; border-radius:50%; background:var(--muted); transition: transform .15s, background .15s; }
.switch input:checked + .track { background: rgba(201,162,39,.3); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(17px); background: var(--accent); }

.segment { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); gap: 2px; }
.segment button {
  padding: .5rem .95rem; border-radius: 7px; border: none; cursor: pointer;
  background: transparent; color: var(--muted); font-weight: 600; font-size: .9rem; font-family: var(--font);
  transition: background .12s, color .12s;
}
.segment button.active { background: var(--surface-3); color: var(--text); }
.segment button .cnt { color: var(--muted-2); font-weight: 500; margin-left: .3rem; font-size: .82em; }

/* Sekme/segment şeritleri mobilde sığmayınca yatay kaydırılır (satır kaymaz, kesilmez).
   Base .segment/.tabs tanımlarından SONRA gelmeli — yoksa display:inline-flex bunu ezer.
   min-width:0 şart: flex öğesinin varsayılan min-width:auto (=içerik) küçülmeyi engeller,
   şeridi viewport'a sığdırmak yerine sayfayı yatay taşırırdı. */
@media (max-width: 640px) {
  .tabs, .segment { display: flex; max-width: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar, .segment::-webkit-scrollbar { display: none; }
  .tab, .segment button { flex-shrink: 0; white-space: nowrap; }
  /* Şerit bir flex satırının öğesiyse (ör. .mf-row içindeki segment) o öğe de küçülebilmeli.
     .moda-filters column-flex + align-items:flex-start → satırlar parent'a stretch olmaz, kendi
     max-content genişliğini alır. max-width:100% ile viewport'a sabitle, segment içeride kaysın. */
  .moda-filters .mf-row { min-width: 0; max-width: 100%; }
  .moda-filters .mf-row > .segment { flex: 1 1 0; }
}

/* ============================================================ Yardımcılar */
.row { display: flex; align-items: center; gap: .6rem; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; }
.gap-sm { gap: .5rem; } .gap-md { gap: 1rem; } .gap-lg { gap: 1.5rem; }
.mt-1{margin-top:.5rem} .mt-2{margin-top:1rem} .mt-3{margin-top:1.5rem} .mb-2{margin-bottom:1rem}
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.center { text-align: center; }
.flex1 { flex: 1; }

.empty {
  padding: 3rem 1.5rem; text-align: center; color: var(--muted);
  border: 1px dashed var(--border-2); border-radius: var(--radius); background: var(--surface);
}
.empty .big { font-size: 2.2rem; margin-bottom: .6rem; opacity: .6; }

.page-head { margin-bottom: 1rem; }
.page-head p { color: var(--muted); margin: 0; font-size: .88rem; }

.alert { padding: .7rem .9rem; border-radius: var(--radius-sm); font-size: .88rem; margin-bottom: 1rem; }
.alert-ok { background: var(--profit-bg); color: var(--profit); border: 1px solid rgba(76,175,125,.3); }
.alert-err { background: var(--loss-bg); color: var(--loss); border: 1px solid rgba(224,90,78,.3); }
.alert-info { background: rgba(91,155,213,.12); color: var(--info); border: 1px solid rgba(91,155,213,.3); }

/* ============================================================ Duyarlı */

/* Hamburger düğmesi — masaüstünde gizli, mobilde topbar'ın en solunda. */
.menu-toggle {
  display: none;
  width: 38px; height: 38px; flex-shrink: 0;
  place-items: center; margin-left: -.35rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); cursor: pointer;
}
.menu-toggle:hover { border-color: var(--border-2); background: var(--surface-3); }
.menu-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Mobil menü örtüsü — kenar çubuğu açıkken içeriği karartır. */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; z-index: 38;
  background: rgba(0,0,0,.5); -webkit-tap-highlight-color: transparent;
}

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }

  /* Kenar çubuğu ekran dışında; hamburger (body.menu-open) ile içeri kayar. */
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  body.menu-open .sidebar { transform: translateX(0); }
  body.menu-open .sidebar-backdrop { display: block; }
  .main { margin-left: 0; }
  .profit-row { grid-template-columns: 1fr; }
  .menu-toggle { display: grid; }

  /* Topbar mobilde sadeleşir: uzun başlık kısalır, ikincil çipler/arama gizlenir. */
  .topbar { padding: 0 .85rem; gap: .5rem; }
  .topbar-title { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .topbar .gsearch { display: none; }         /* Arama için ayrı "Ara" sayfası var. */
  .topbar .chip { display: none; }            /* Bölge/net/tazelik bilgi çipleri — mobilde yer yok. */
  .usermenu { margin-left: 0; }
  .usermenu-name { display: none; }           /* Avatar yeter; ad gizlenir. */
  .usermenu-chev { display: none; }

  /* Hover önizleme kartları (mutlak konumlu) dokunmatikte açılmaz + sağa taşıp yatay kaydırma
     yaratıyordu (ör. /nodelar). Mobilde gizle — pill/eşya tıklaması zaten detay modalını açar. */
  .pill-wrap > .item-card, .wh-cell > .item-card { display: none; }
}

/* ============================================================ Auth (Identity) sayfaları */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem; background:
  radial-gradient(1200px 600px at 70% -10%, rgba(201,162,39,.08), transparent 60%), var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card .brand { border: none; justify-content: center; padding-bottom: .3rem; }

/* Bootstrap köprüleri (Identity Razor formları Bootstrap sınıfları kullanır) */
.form-control, .form-select {
  background: var(--surface-2) !important; border: 1px solid var(--border-2) !important;
  color: var(--text) !important; border-radius: var(--radius-sm) !important; padding: .6rem .75rem !important;
}
.form-control:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3px rgba(201,162,39,.15) !important; }
.form-floating > label { color: var(--muted-2) !important; }
.btn-primary.bs, .w-100.btn-lg { }
.text-danger, .validation-message { color: var(--loss) !important; font-size: .82rem; }
h1, h2 { color: var(--text); }

/* Blazor hata arayüzü */
#blazor-error-ui {
  background: var(--warn); color: #1a1500; bottom: 0; box-shadow: 0 -1px 6px rgba(0,0,0,.4);
  display: none; left: 0; padding: .7rem 1.2rem; position: fixed; width: 100%; z-index: 1000; font-weight: 600;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; top: .6rem; }
.blazor-error-boundary { background: var(--loss); padding: 1rem; color: white; border-radius: 8px; }
.blazor-error-boundary::after { content: "Bir hata oluştu."; }
.loading-progress-text { color: var(--muted); }

/* ============================================================ Bootstrap-uyumlu yardımcılar
   (Bootstrap kaldırıldı; Identity Manage sayfaları hâlâ bu sınıfları kullanıyor) */
.w-100 { width: 100%; }
.mb-3 { margin-bottom: 1rem; }
.mt-2 { margin-top: 1rem; }
.btn-lg { padding: .7rem 1.1rem; font-size: 1rem; }
.row { }
[class^="col-"], [class*=" col-"] { }
.form-label, label { color: var(--text); }
.form-floating { position: relative; margin-bottom: 1rem; }
.form-floating > label { color: var(--muted-2); font-size: .84rem; margin-bottom: .35rem; display: block; }
.checkbox label { color: var(--text); }
.form-check-input { accent-color: var(--accent); }
h3, h4, p, span, div, td, th, label, li, a { }
.nav-scrollable, .navbar, .navbar-toggler { display: none; }  /* şablon kalıntısı gizle */
.status-message, .alert-info { color: var(--info); }
hr { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }

/* ============================================================ Tasarım cilası */
/* Kart hover derinliği */
.plan-card { transition: border-color .15s, transform .1s; }
.plan-card:hover { border-color: var(--border-2); }
/* Panel stat kartlarında hafif iç ışık */
.stat { transition: border-color .15s; }
.stat:hover { border-color: var(--border-2); }
/* Sıralama rozeti — ilk 3 altın vurgulu */
/* Bölüm başlıkları arası nefes */
.grid.gap-md > .plan-card { scroll-margin-top: 80px; }
/* Metin seçilebilirlik + kod stil */
code { background: var(--surface-2); border: 1px solid var(--border); padding: .05rem .35rem; border-radius: 5px; font-size: .85em; color: var(--accent-soft); font-family: ui-monospace, monospace; }
/* Boş metin düğmeleri (çıkış vb.) hover */
.sidebar-foot button:hover { color: var(--text); }
/* İnce ayrımlar */
.plan-title { color: var(--text); }
.stat-value { color: var(--text); }
/* ============================================================ Depo (BDO tarzı iki panel) */
.wh-shell { display: grid; grid-template-columns: 260px 1fr; gap: 1.25rem;
  height: calc(100vh - 188px); min-height: 420px; }
.wh-regions {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  height: 100%; overflow-y: auto;
}
.wh-region-head {
  display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; cursor: pointer;
  font-weight: 650; font-size: .9rem; color: var(--accent-soft);
  background: var(--surface-2); border-bottom: 1px solid var(--border); position: sticky; top: 0;
}
.wh-region-head .caret { transition: transform .15s; color: var(--muted); }
.wh-region-head.collapsed .caret { transform: rotate(-90deg); }
.wh-region-head .rcount { margin-left: auto; color: var(--muted-2); font-weight: 500; font-size: .82rem; }
.wh-item {
  display: flex; align-items: center; gap: .55rem; padding: .55rem .9rem .55rem 1.4rem;
  cursor: pointer; border-bottom: 1px solid var(--border); transition: background .1s;
}
.wh-item:hover { background: var(--surface-2); }
.wh-item.active { background: var(--surface-3); box-shadow: inset 3px 0 0 var(--accent); }
.wh-item .wh-name { flex: 1; font-size: .9rem; }
.wh-item .wh-slots { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.wh-item .wh-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); flex-shrink: 0; }
.wh-item.has .wh-dot { background: var(--accent); }

.wh-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; height: 100%; }
.wh-panel-head {
  display: flex; align-items: center; gap: .8rem; padding: 0 1.1rem; height: 58px; flex-shrink: 0;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
}
.wh-panel-head .wh-title { font-weight: 700; font-size: 1.05rem; }
.wh-panel-head .wh-count { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; }

.wh-grid {
  display: flex; flex-wrap: wrap; align-content: flex-start; gap: 7px;
  padding: 1.1rem; flex: 1; overflow-y: auto; overflow-x: hidden;
}
.wh-cell {
  position: relative; width: 54px; height: 54px; flex: 0 0 54px; box-sizing: border-box; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
/* NOT: global .empty (boş-durum) sınıfıyla çakışmayı sıfırla (padding:3rem hücreyi büyütüyordu) */
.wh-cell.empty { cursor: pointer; color: var(--muted-2); font-size: 1rem;
  padding: 0; margin: 0; border: 1px solid var(--border); background: var(--surface-2); }
.wh-cell.empty:hover { border-color: var(--accent); color: var(--accent); background: var(--surface-3); }
.wh-cell.filled { cursor: pointer; }
.wh-cell.filled:hover { border-color: var(--border-2); }
/* İkon küçük, doğal (oyundaki gibi kenar boşluklu) */
.wh-cell.filled img { width: 38px; height: 38px; object-fit: contain; }
.wh-cell .cell-qty {
  position: absolute; right: 2px; bottom: 0; font-size: .7rem; font-weight: 800;
  color: #fff; text-shadow: 0 1px 2px #000, 0 1px 3px #000, 0 0 2px #000;
  font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
/* Hover: eşya bazlı değer bilgisi (ÜSTTE açılır) */
.cell-tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  width: 200px; z-index: 30; display: none; flex-direction: column; pointer-events: none;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px;
  box-shadow: var(--shadow); padding: .55rem .7rem; text-align: left; box-sizing: border-box;
}
.wh-cell.filled:hover .cell-tip { display: flex; }
.cell-tip .tip-name { font-weight: 650; font-size: .85rem; margin-bottom: .35rem; }
.cell-tip .tip-row, .cell-tip .tip-total { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cell-tip .tip-total { margin-top: .3rem; padding-top: .3rem; border-top: 1px solid var(--border); color: var(--text); }
.cell-tip b { color: var(--text); }
.wh-cell .cell-x {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--loss); color: #fff; font-size: .7rem; display: none; align-items: center; justify-content: center;
  cursor: pointer; z-index: 3; border: 2px solid var(--surface);
}
.wh-cell.filled:hover .cell-x { display: flex; }
.wh-cell .cell-move {
  position: absolute; top: -6px; left: -6px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: #1a1500; display: none; align-items: center; justify-content: center;
  cursor: pointer; z-index: 3; border: 2px solid var(--surface);
}
.wh-cell.filled:hover .cell-move { display: flex; }

/* Özel depo (Yükseltme deposu) — sol panelde başlıksız, vurgulu */
.wh-item.special { margin-bottom: .4rem; border: 1px solid rgba(201,162,39,.3); border-radius: 8px; background: var(--surface-2); }
.wh-item.special:hover { background: var(--surface-3); }
.wh-item.special.active { background: var(--surface-3); box-shadow: inset 3px 0 0 var(--accent); }
.wh-item.special .nav-ico { color: var(--accent); }
.wh-item.special .wh-name { font-weight: 600; }

/* Tekrarlananlar toggle (sol panel) */
.dupes-toggle { margin-bottom: .4rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.dupes-toggle:hover { background: var(--surface-3); }
.dupes-toggle.active { background: var(--surface-3); box-shadow: inset 3px 0 0 var(--accent); }
.dupes-toggle .nav-ico { color: var(--accent); }

/* Tekrarlananlar listesi */
.dupe-list { padding: .75rem; overflow-y: auto; display: flex; flex-direction: column; gap: .5rem; }
.dupe-row { display: flex; align-items: center; gap: .8rem; padding: .7rem .85rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.dupe-row:hover { border-color: var(--border-2); }
.dupe-main { flex: 1; min-width: 0; }
.dupe-name { font-weight: 600; font-size: .95rem; margin-bottom: .35rem; }
.dupe-locs { display: flex; flex-wrap: wrap; gap: .35rem; }
.dupe-loc { display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .5rem; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: .8rem; color: var(--muted); cursor: pointer; }
.dupe-loc:hover { border-color: var(--accent); color: var(--text); }
.dupe-loc b { color: var(--accent-2); font-variant-numeric: tabular-nums; }
.dupe-tot { text-align: right; flex-shrink: 0; }

/* Taşıma modalı */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; display: grid; place-items: center; padding: 1rem; }
.modal-box { width: 100%; max-width: 440px; max-height: 80vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; }
.move-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.move-target { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: var(--radius-sm); cursor: pointer; font-size: .92rem; }
.move-target:hover { background: var(--surface-3); }
.move-target .wh-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border-2); }
.move-target .wh-slots { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.wh-cell.editing { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(201,162,39,.35); z-index: 10; overflow: visible; background: var(--surface-3); }
.cell-input { width: 100%; height: 100%; border: none; background: transparent; color: var(--text); text-align: center; font-size: .72rem; outline: none; }
.cell-qty-input { width: 100%; height: 100%; border: none; background: transparent; color: var(--accent-2); text-align: center; font-size: .8rem; font-weight: 700; outline: none; }
.cell-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; width: 260px; z-index: 20;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px;
  box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; padding: 4px; text-align: left;
}
.cell-dropdown .cd-hit { display: flex; align-items: center; gap: .5rem; padding: .35rem .45rem; border-radius: 6px; cursor: pointer; }
.cell-dropdown .cd-hit:hover, .cell-dropdown .cd-hit.on { background: var(--surface-3); }
.cell-dropdown .cd-hit .cd-name { flex: 1; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-dropdown .cd-hit .cd-price { font-size: .74rem; color: var(--muted); }
.cell-editing-hint { position: absolute; top: -4px; left: 0; transform: translateY(-100%); font-size: .68rem; color: var(--accent); white-space: nowrap; }

.wh-panel-foot {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .85rem 1.1rem; border-top: 1px solid var(--border); background: var(--surface-2);
  flex-shrink: 0;
}
/* Adet: sadece sayı (spinner gizli) */
.cell-qty-input::-webkit-outer-spin-button,
.cell-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cell-qty-input { -moz-appearance: textfield; appearance: textfield; }
@media (max-width: 820px) {
  .wh-shell { grid-template-columns: 1fr; }
  .wh-grid { grid-template-columns: repeat(auto-fill, 54px); }
}

/* Arama kutusu (hero) */
.search-box { position: relative; display: flex; align-items: center; }
.search-ico { position: absolute; left: .8rem; color: var(--muted-2); pointer-events: none; }
.search-input { padding-left: 2.4rem !important; font-size: 1.02rem; height: 46px; }
.search-clear { position: absolute; right: .6rem; background: none; border: none; color: var(--muted-2); cursor: pointer; font-size: 1rem; padding: .2rem .4rem; }
.search-clear:hover { color: var(--text); }
.search-results { margin-top: .6rem; display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; }
.search-hit {
  display: flex; align-items: center; gap: .7rem;
  padding: .5rem .6rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.search-hit.hit-top { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(201,162,39,.25); }
.hit-name { flex: 1; min-width: 0; }
.hit-name > div:first-child { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit-qty { width: 120px; padding: .35rem .5rem !important; text-align: right; }

/* Katlanır toplu yapıştır */
.paste-details { overflow: hidden; }
.paste-summary { list-style: none; cursor: pointer; padding: 1rem 1.25rem; display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.paste-summary::-webkit-details-marker { display: none; }
.paste-summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details[open] .paste-summary::before { transform: rotate(90deg); }

/* Yeni eklenen satır vurgusu */
@keyframes flashRow { from { background: rgba(201,162,39,.22); } to { background: transparent; } }
tr.flash td { animation: flashRow 1.4s ease-out; }

/* Eşya ikonu (bdocodex gerçek ikon) */
.item-icon {
  width: 30px; height: 30px; border-radius: 6px; flex-shrink: 0;
  background: var(--surface-3); border: 1px solid var(--border);
  object-fit: contain; vertical-align: middle; image-rendering: auto;
}
.item-icon.sm { width: 24px; height: 24px; }
.item-row { display: inline-flex; align-items: center; gap: .55rem; }

/* Dosya yükleme alanı */
.upload-zone {
  border: 1.5px dashed var(--border-2); border-radius: var(--radius);
  padding: 1.5rem; text-align: center; background: var(--surface-2);
  transition: border-color .15s, background .15s; cursor: pointer;
}
.upload-zone:hover { border-color: var(--accent); background: var(--surface-3); }
.upload-zone input[type=file] { display: block; margin: .6rem auto 0; color: var(--muted); font-size: .85rem; }
.upload-preview img { max-width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-top: .6rem; }
/* Önizleme satırı düzeltme girişi */
.fix-input { width: 100%; padding: .3rem .5rem; background: var(--surface-3); border: 1px solid var(--border-2); border-radius: 6px; color: var(--text); font-size: .85rem; }

/* ============================================================================
   PREMIUM CİLA — marka logosu, serif display, auth ekranı, uyarılar, dokunuş
   ============================================================================ */

/* ---- Cinzel (yalnız Latin wordmark/monogram; Türkçe metin Inter'de kalır) ---- */
@font-face {
  font-family: 'Cinzel'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/cinzel-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cinzel'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url('fonts/cinzel-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF;
}
:root { --font-serif: 'Cinzel', Georgia, 'Times New Roman', serif; }

/* ---- Marka logosu (SVG monogram + wordmark) ---- */
.brand-logo { display: inline-flex; align-items: center; gap: .7rem; }
.brand-logo.brand-lg { flex-direction: column; gap: .95rem; width: 100%; }
.brand-emblem { display: block; flex-shrink: 0; filter: drop-shadow(0 3px 10px rgba(201,162,39,.22)); }
.brand-sm .brand-emblem { width: 36px; height: 36px; }
.brand-lg .brand-emblem { width: 78px; height: 78px; }

.brand-word-wrap { display: flex; flex-direction: column; min-width: 0; }
.brand-lg .brand-word-wrap { align-items: center; }
.brand-word {
  font-family: var(--font-serif); font-weight: 600; line-height: 1;
  color: var(--text); letter-spacing: .06em; white-space: nowrap;
}
.brand-word b { color: var(--accent-2); font-weight: 600; }
.brand-sm .brand-word { font-size: 1.04rem; }
.brand-lg .brand-word { font-size: 1.62rem; letter-spacing: .12em; }

.brand-tag {
  font-family: var(--font); text-transform: uppercase; color: var(--accent-soft);
}
.brand-sm .brand-tag { font-size: .58rem; letter-spacing: .13em; color: var(--muted-2); margin-top: 3px; }
.brand-lg .brand-tag {
  font-size: .66rem; letter-spacing: .32em; opacity: .82; margin-top: .55rem; padding-left: .32em;
  position: relative;
}
/* tagline'ı iki yanından ince altın çizgiyle çerçevele */
.brand-lg .brand-tag::before, .brand-lg .brand-tag::after {
  content: ""; position: absolute; top: 50%; width: 18px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,162,39,.6));
}
.brand-lg .brand-tag::before { right: calc(100% + 10px); transform: scaleX(-1); }
.brand-lg .brand-tag::after  { left: calc(100% + 10px); }

/* ---- Auth ekranı (premium) ---- */
.auth-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem;
  position: relative; overflow: hidden;
  background:
    radial-gradient(900px 520px at 50% -10%, rgba(201,162,39,.11), transparent 60%),
    radial-gradient(680px 480px at 90% 112%, rgba(201,162,39,.06), transparent 58%),
    var(--bg);
}
/* logoyu yankılayan çok hafif merkezi ışıltı */
.auth-wrap::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 30%, rgba(201,162,39,.05), transparent 42%);
}
.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 410px;
  animation: authRise .5s cubic-bezier(.2,.75,.25,1) both;
}
@keyframes authRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .auth-card { animation: none; } }

.auth-card .card {
  padding: 2.1rem 1.95rem 1.85rem;
  border-color: var(--border-2);
  background: var(--auth-card-bg);
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
/* üstte ince altın parıltı hattı */
.auth-card .card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,162,39,.55), transparent);
}
.auth-card .brand-logo.brand-lg { margin-bottom: 1.55rem; }
.auth-card h2 {
  font-size: 1.18rem; font-weight: 600; text-align: center;
  margin: 0 0 1.35rem; letter-spacing: -.01em;
}
.auth-card .btn-primary { margin-top: .25rem; }

/* ---- Uyarı / durum kutuları (ikon + tam çerçeve, yan-şerit yok) ---- */
.alert {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .75rem .9rem; border-radius: var(--radius-sm);
  font-size: .88rem; line-height: 1.45; margin-bottom: 1.1rem;
}
.alert .alert-ico { flex-shrink: 0; width: 18px; height: 18px; margin-top: .07rem; }
.alert-ok  { background: var(--profit-bg); color: var(--profit); border: 1px solid rgba(76,175,125,.32); }
.alert-ok  .alert-ico { color: var(--profit); }
.alert-err { background: var(--loss-bg);   color: var(--loss); border: 1px solid rgba(224,90,78,.34); }
.alert-err .alert-ico { color: var(--loss); }
.alert-info{ background: var(--info-bg, rgba(91,155,213,.12)); color: var(--info); border: 1px solid rgba(91,155,213,.3); }
.alert-info .alert-ico { color: var(--info); }

/* Blazor ValidationSummary'yi de aynı dile getir */
.validation-errors { list-style: none; margin: 0 0 1rem; padding: .7rem .9rem;
  background: var(--loss-bg); border: 1px solid rgba(224,90,78,.34); border-radius: var(--radius-sm); }
.validation-errors li { color: var(--loss); font-size: .85rem; }

/* ---- Premium buton dokunuşu + erişilebilir odak ---- */
.btn { transition: background .14s ease, border-color .14s ease, transform .06s ease, box-shadow .14s ease; }
.btn-primary {
  background: linear-gradient(180deg, #E4CE74 0%, #C9A227 64%);
  border-color: #C9A227;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 6px 14px -6px rgba(201,162,39,.45);
}
.btn-primary:hover { background: linear-gradient(180deg, #EDDA8B 0%, #D2AC33 64%); }
.btn-primary:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(255,255,255,.2) inset; }

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 4px; }
.btn:focus-visible { outline-offset: 3px; }
.input:focus-visible, .textarea:focus-visible { outline: none; }

/* sidebar aktif öğe: altın vurgu biraz daha belirgin + yumuşak */
.nav-item { transition: background .14s ease, color .14s ease, box-shadow .14s ease; }
.nav-item.active { box-shadow: inset 2px 0 0 var(--accent), inset 0 0 24px -12px rgba(201,162,39,.4); }

/* mobilde auth kartı biraz daralt */
@media (max-width: 480px) {
  .auth-wrap { padding: 1.2rem; }
  .auth-card .card { padding: 1.7rem 1.4rem 1.5rem; }
  .brand-lg .brand-word { font-size: 1.44rem; }
}

/* ---- Sağ-üst hesap menüsü (aile adı → Ayarlar / Çıkış) ---- */
.usermenu { position: relative; margin-left: .35rem; }
.usermenu > summary { list-style: none; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu-trigger {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  padding: .28rem .55rem .28rem .32rem; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); transition: border-color .14s ease, background .14s ease;
  user-select: none;
}
.usermenu-trigger:hover { border-color: var(--border-2); background: var(--surface-3); }
.usermenu[open] .usermenu-trigger { border-color: rgba(201,162,39,.45); background: var(--surface-3); }
.usermenu-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center;
  background: radial-gradient(120% 120% at 30% 20%, var(--accent-2), var(--accent) 60%, #8a6f16);
  color: #1a1500; font-weight: 800; font-size: .82rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4);
}
.usermenu-name {
  font-size: .86rem; font-weight: 600; max-width: 140px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.usermenu-chev { width: 15px; height: 15px; color: var(--muted-2); transition: transform .16s ease; }
.usermenu[open] .usermenu-chev { transform: rotate(180deg); }

.usermenu-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 190px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px;
  box-shadow: 0 18px 40px -14px rgba(0,0,0,.65), 0 1px 0 rgba(255,255,255,.03) inset;
  animation: umPop .14s ease both;
}
@keyframes umPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .usermenu-pop { animation: none; } }
.usermenu-pop form { margin: 0; }
.usermenu-pop::before { /* çentik */
  content: ""; position: absolute; top: -5px; right: 16px; width: 9px; height: 9px;
  background: var(--surface); border-left: 1px solid var(--border-2); border-top: 1px solid var(--border-2);
  transform: rotate(45deg);
}
.usermenu-item {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: .55rem .6rem; border-radius: 7px;
  color: var(--text); font: inherit; font-size: .9rem; font-weight: 500;
  background: none; border: none; text-align: left; cursor: pointer; text-decoration: none;
  transition: background .12s ease, color .12s ease;
}
.usermenu-item svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--muted); }
.usermenu-item:hover { background: var(--surface-2); color: var(--text); }
.usermenu-item:hover svg { color: var(--accent); }
.usermenu-danger:hover { background: var(--loss-bg); color: var(--loss); }
.usermenu-danger:hover svg { color: var(--loss); }
.usermenu-sep { height: 1px; margin: 5px 4px; background: var(--border); }

/* ============================================================ Yönetim paneli */
.adm-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.adm-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 1rem; align-items: start; }

.adm-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.adm-table th {
  text-align: left; font-size: .74rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted-2); padding: 0 .55rem .5rem; border-bottom: 1px solid var(--border);
}
.adm-table th.r, .adm-table td.r { text-align: right; }
.adm-table td { padding: .5rem .55rem; border-bottom: 1px solid var(--border); }
.adm-table tbody tr { cursor: pointer; transition: background .1s ease; }
.adm-table tbody tr:hover { background: var(--surface-2); }
.adm-table tbody tr.sel { background: var(--surface-3); box-shadow: inset 2px 0 0 var(--accent); }
.adm-table tbody tr:last-child td { border-bottom: none; }
.adm-name { font-weight: 600; }

.adm-sub {
  font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted-2); margin: 1.3rem 0 .6rem;
}

/* mini günlük bar grafiği */
.adm-bars { display: flex; align-items: flex-end; gap: 4px; height: 56px; }
.adm-bar { flex: 1; height: 100%; display: flex; align-items: flex-end;
  background: linear-gradient(180deg, transparent, var(--surface-2)); border-radius: 3px; }
.adm-bar > span { display: block; width: 100%; min-height: 0; border-radius: 3px 3px 2px 2px;
  background: var(--border-2); transition: height .3s cubic-bezier(.2,.7,.2,1); }
.adm-bar.on > span { background: linear-gradient(180deg, var(--accent-2), var(--accent)); }

/* aksiyon dökümü satırı */
.adm-ev { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: .6rem; margin-bottom: .45rem; }
.adm-ev-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.adm-ev-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.adm-ev .num { text-align: right; color: var(--muted); }

/* olay rozeti */
.adm-badge { display: inline-block; padding: .16rem .48rem; border-radius: 999px; font-size: .74rem; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.adm-badge.ev-login { color: var(--profit); border-color: rgba(76,175,125,.35); background: var(--profit-bg); }
.adm-badge.ev-register { color: var(--accent-soft); border-color: rgba(201,162,39,.4); background: var(--warn-bg); }
.adm-badge.ev-login_failed, .adm-badge.ev-lockout { color: var(--loss); border-color: rgba(224,90,78,.35); background: var(--loss-bg); }
.adm-badge.ev-settings_changed { color: var(--info); border-color: rgba(91,155,213,.35); background: rgba(91,155,213,.12); }

/* depo gözlemi */
.adm-wh { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .5rem; overflow: hidden; }
.adm-wh > summary { list-style: none; cursor: pointer; padding: .55rem .7rem; display: flex; align-items: center;
  justify-content: space-between; gap: .6rem; background: var(--surface-2); }
.adm-wh > summary::-webkit-details-marker { display: none; }
.adm-wh > summary:hover { background: var(--surface-3); }
.adm-wh[open] > summary { border-bottom: 1px solid var(--border); }
.adm-wh-name { font-weight: 600; font-size: .9rem; }
.adm-wh-entries { padding: .4rem .3rem; max-height: 260px; overflow-y: auto; }
.adm-wh-row { display: flex; justify-content: space-between; gap: .6rem; padding: .32rem .4rem; font-size: .86rem; border-radius: 6px; }
.adm-wh-row:hover { background: var(--surface-2); }
.adm-wh-row .num { color: var(--accent-soft); }

/* son aktiviteler tablosu */
.adm-log-wrap { max-height: 460px; overflow-y: auto; }
.adm-log th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.adm-log td { white-space: nowrap; }
.adm-log td:nth-child(4) { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 1000px) {
  .adm-tiles { grid-template-columns: repeat(2, 1fr); }
  .adm-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .adm-tiles { grid-template-columns: 1fr 1fr; }
  .adm-ev { grid-template-columns: 110px 1fr 40px; }
}

/* ============================================================ Geri bildirim (yüzen widget) */
.fb-root { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 1200; display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; }
.fb-fab {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #1a1500; border: none; cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.45), 0 0 0 1px rgba(201,162,39,.4);
  transition: background .15s, transform .15s;
}
.fb-fab:hover { background: var(--accent-2); transform: translateY(-1px); }
.fb-root.open .fb-fab { background: var(--surface-3); color: var(--text); box-shadow: 0 4px 16px rgba(0,0,0,.45), 0 0 0 1px var(--border-2); }

.fb-panel {
  width: 340px; max-width: calc(100vw - 2rem);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.55); padding: 1rem; animation: fb-pop .14s ease-out;
}
@keyframes fb-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.fb-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; color: var(--text); margin-bottom: .5rem; }
.fb-x { background: none; border: none; color: var(--muted-2); cursor: pointer; display: flex; padding: .2rem; border-radius: 6px; }
.fb-x:hover { color: var(--text); background: var(--surface-2); }
.fb-intro { color: var(--muted); font-size: .84rem; line-height: 1.5; margin: 0 0 .7rem; }
.fb-types { display: flex; gap: .5rem; margin-bottom: .6rem; }
.fb-type {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .5rem; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: .85rem;
}
.fb-type:hover { color: var(--text); }
.fb-type.on { background: var(--surface-3); color: var(--accent-2); border-color: rgba(201,162,39,.4); }
.fb-text {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 90px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: .6rem .7rem; font: inherit; font-size: .88rem; line-height: 1.5;
}
.fb-text:focus { outline: none; border-color: var(--border-2); }
.fb-submit { width: 100%; margin-top: .6rem; }
.fb-submit:disabled { opacity: .5; cursor: not-allowed; }
.fb-thanks { text-align: center; padding: .6rem .2rem 1rem; }
.fb-thanks-ico {
  width: 54px; height: 54px; margin: .4rem auto .7rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--profit-bg); color: var(--profit);
}
.fb-thanks p { color: var(--muted); font-size: .88rem; line-height: 1.55; margin: 0 0 .9rem; }
@media (max-width: 560px) { .fb-root { right: .8rem; bottom: .8rem; } }

/* Geri bildirim yönetim kartları (admin) */
.fb-card { display: flex; flex-direction: column; gap: .7rem; }
.fb-card.done { opacity: .62; }
.fb-card-msg { color: var(--text); font-size: .92rem; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

/* Görüntüden içe aktarma (Depo) */
.imp-drop {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 2rem 1rem; border: 1.5px dashed var(--border-2, var(--border)); border-radius: var(--radius-sm);
  cursor: pointer; text-align: center; color: var(--muted); font-size: .9rem;
}
.imp-drop:hover { border-color: var(--accent); color: var(--text); }
.imp-drop input[type=file] { display: none; }
.imp-error { margin-top: .6rem; color: var(--loss); font-size: .88rem; }
.imp-legend { margin: 0 0 .55rem; }
.imp-flag.warn { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--warn); vertical-align: -1px; }
.imp-list { display: flex; flex-direction: column; gap: .3rem; overflow-y: auto; max-height: 52vh; padding-right: .2rem; }
.imp-row {
  display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.imp-row.warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--border)); background: color-mix(in srgb, var(--warn) 7%, var(--surface-2)); }
.imp-thumb { width: 34px; height: 34px; border-radius: 4px; flex: none; }
.imp-arrow { color: var(--muted); font-size: .8rem; flex: none; }
.imp-item { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; gap: .45rem; }
.imp-name { cursor: pointer; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.imp-name:hover { color: var(--accent-soft); text-decoration: underline dotted; }
.imp-name.warn { color: var(--warn); }
.imp-alt {
  flex: none; max-width: 46%; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .8rem; padding: .15rem .3rem;
}
.imp-search { flex: 1; font-size: .85rem; padding: .3rem .5rem; }
.imp-dropdown { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; }
.imp-qty {
  width: 92px; flex: none; text-align: right; font-variant-numeric: tabular-nums;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font: inherit; font-size: .88rem; padding: .3rem .45rem;
}
.imp-qty.warn { border-color: var(--warn); color: var(--warn); }
.imp-qty:focus { outline: none; border-color: var(--accent); color: var(--text); }

/* ============================================================
   Eşya detayı — ItemDetailView (modal + /esya/{id} paylaşır)
   Yoğunluk kompakt (modal) vs ferah (sayfa): .idv-compact anahtarı
   ============================================================ */

/* --- z-index ölçeği (semantik) --- */
:root {
  --z-dropdown: 50;
  --z-modal-backdrop: 100;
  --z-modal: 110;
  --z-tooltip: 200;
  --ease-out-quint: cubic-bezier(.22, 1, .36, 1);
}

/* Modal artık ItemDetailModalHost'ta (app-shell DIŞINDA) render ediliyor → topbar/sidebar stacking
   context'inden bağımsız, backdrop doğrudan body seviyesinde tüm ekranı kaplar. Eski :has() hack'i gereksiz. */

/* Tıklanabilir pill: detay modalını açar */
.flow-pill.clickable { cursor: pointer; }
.flow-pill.clickable:hover { border-color: var(--accent); }

/* Detay modal kabuğu: geniş, üstte sabit araç çubuğu, altında kayan gövde */
.modal-box.gs-modal {
  max-width: 1040px; width: min(94vw, 1040px);
  max-height: 88vh; padding: 0; overflow: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  .modal-box.gs-modal { animation: idv-in .22s var(--ease-out-quint); }
  .modal-backdrop { animation: idv-fade .18s ease-out; }
}
@keyframes idv-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes idv-fade { from { opacity: 0; } to { opacity: 1; } }

.idv-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .55rem .7rem .55rem .9rem; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.idv-topbar-nav { display: flex; align-items: center; gap: .5rem; }
.idv-fullpage {
  font-size: .82rem; color: var(--accent-2); text-decoration: none;
  padding: .28rem .55rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  transition: border-color .15s, background .15s;
}
.idv-fullpage:hover { border-color: var(--border-2); background: var(--surface-2); }

/* Modal içi detay: kayan gövde */
.gs-modal .idv { display: flex; flex-direction: column; min-height: 0; overflow: hidden; min-width: 0; }
.gs-modal .idv-body { overflow-y: auto; overflow-x: hidden; min-width: 0; }
/* Grid/flex çocukları içerik taşınca büyümesin (özellikle dar ekranda tabular sayılar) → kırp, taşma yapma. */
.gs-modal .sum-card, .gs-modal .fact, .gs-modal .mkt-row,
.gs-modal .use-row, .gs-modal .prod-opt { min-width: 0; }
.gs-modal .mkt-row b, .gs-modal .mkt-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* --- Kimlik bandı --- */
.idv-ident { display: flex; gap: .85rem; padding: 1rem 1.1rem .75rem; align-items: flex-start; }
.idv-icon {
  width: 52px; height: 52px; flex-shrink: 0; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); object-fit: contain;
}
.idv-ident-main { min-width: 0; flex: 1; }
.idv-name-row { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.idv-name { font-size: 1.15rem; font-weight: 700; margin: 0; line-height: 1.2; }
.idv-compact .idv-name { font-size: 1.05rem; }

.grade-chip {
  display: inline-flex; align-items: center; gap: .34rem;
  font-size: .74rem; font-weight: 600; padding: .16rem .5rem;
  border-radius: 999px; color: var(--grade);
  border: 1px solid color-mix(in srgb, var(--grade) 40%, transparent);
  background: color-mix(in srgb, var(--grade) 12%, transparent);
}
.grade-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--grade); flex-shrink: 0; }

.idv-meta { display: flex; flex-wrap: wrap; gap: .3rem; align-items: baseline; margin-top: .3rem; font-size: .85rem; color: var(--muted); }
.idv-dot { color: var(--muted-2); }
.idv-restrictions { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.restr-chip {
  font-size: .74rem; color: var(--muted); padding: .14rem .45rem;
  border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border);
}

/* --- Sekme çubuğu --- */
.idv-tabs {
  display: flex; gap: .15rem; padding: 0 1.1rem; border-bottom: 1px solid var(--border);
  flex-shrink: 0; position: sticky; top: 0; background: var(--surface); z-index: 1;
}
.idv-tab {
  appearance: none; background: none; border: none; cursor: pointer;
  font: inherit; font-size: .9rem; color: var(--muted); padding: .6rem .7rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  display: inline-flex; align-items: center; gap: .4rem; transition: color .15s, border-color .15s;
}
.idv-tab:hover { color: var(--text); }
.idv-tab.on { color: var(--accent-2); border-bottom-color: var(--accent); }
.idv-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.tab-count {
  font-size: .72rem; font-weight: 600; padding: .05rem .38rem; border-radius: 999px;
  background: var(--surface-3); color: var(--muted); font-variant-numeric: tabular-nums;
}
.idv-tab.on .tab-count { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-2); }

.idv-body { padding: 1rem 1.1rem 1.2rem; }
.idv-empty { color: var(--muted); font-size: .9rem; padding: 1.5rem .2rem; text-align: center; }

/* --- Yükleme iskeleti --- */
.idv-skeleton { padding: 1.2rem; }
.sk-line { height: 14px; border-radius: 6px; background: var(--surface-3); margin-bottom: .7rem; }
.sk-line.w60 { width: 60%; } .sk-line.w40 { width: 40%; }
.sk-block { height: 160px; border-radius: var(--radius-sm); background: var(--surface-2); margin-top: 1rem; }
@media (prefers-reduced-motion: no-preference) {
  .sk-line, .sk-block { animation: sk-pulse 1.3s ease-in-out infinite; }
}
@keyframes sk-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* --- Kâr işareti (renk + ok + ±) --- */
.profit-mark { display: inline-flex; align-items: center; gap: .18rem; font-variant-numeric: tabular-nums; font-weight: 600; }
.profit-mark.pos { color: var(--profit); }
.profit-mark.neg { color: var(--loss); }
.profit-mark.zero { color: var(--muted); }
.profit-mark svg { flex-shrink: 0; }

/* ============================================================
   Özet sekmesi
   ============================================================ */
.sum-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; }
.sum-card {
  padding: .7rem .8rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.sum-card.dim { opacity: .72; }
.sum-card-k { font-size: .76rem; color: var(--muted); margin-bottom: .3rem; }
.sum-card-v { font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.sum-card-sub { font-size: .74rem; color: var(--muted-2); margin-top: .25rem; }
.sum-card-sub .pos { color: var(--profit); }

.sum-facts { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; }
.fact {
  flex: 1; min-width: 120px; display: flex; flex-direction: column; gap: .2rem;
  padding: .55rem .7rem; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border);
}
.fact-k { font-size: .74rem; color: var(--muted); }
.fact-v { font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.fact.warn .fact-v { color: var(--warn); }

.sum-lore { margin-top: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.lore-desc { margin: 0; color: var(--text); font-size: .92rem; line-height: 1.55; max-width: 68ch; }
.lore-block { display: flex; flex-direction: column; gap: .2rem; font-size: .88rem; color: var(--muted); max-width: 68ch; line-height: 1.5; }
.lore-label { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-soft); }

/* ============================================================
   Üretim sekmesi
   ============================================================ */
.prod-list { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.prod-opt {
  appearance: none; text-align: left; cursor: pointer; font: inherit;
  display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border);
  transition: border-color .15s, background .15s;
}
.prod-opt:hover { border-color: var(--border-2); background: var(--surface-3); }
.prod-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.prod-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.prod-opt-icon img { width: 30px; height: 30px; object-fit: contain; display: block; }
.prod-opt-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.prod-opt-type { font-size: .72rem; color: var(--muted-2); }
.prod-opt-profit { flex-shrink: 0; font-size: .9rem; }

/* ============================================================
   Kullanım sekmesi
   ============================================================ */
.uses-toolbar { display: flex; gap: .6rem; margin-bottom: .8rem; flex-wrap: wrap; }
.uses-search {
  flex: 1; min-width: 160px; display: flex; align-items: center; gap: .45rem;
  padding: .4rem .6rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.uses-search:focus-within { border-color: var(--accent); }
.uses-search input { flex: 1; background: none; border: none; color: var(--text); font: inherit; font-size: .88rem; outline: none; min-width: 0; }
.uses-sort { display: flex; align-items: center; gap: .4rem; }
.uses-sort select {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); font: inherit; font-size: .85rem; padding: .4rem .5rem; cursor: pointer;
}
.uses-sort select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.uses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .35rem; }
.use-row {
  appearance: none; text-align: left; cursor: pointer; font: inherit;
  display: flex; align-items: center; gap: .55rem; padding: .45rem .55rem;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid transparent;
  transition: border-color .15s, background .15s;
}
.use-row:hover { border-color: var(--border-2); background: var(--surface-3); }
.use-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.use-icon { width: 30px; height: 30px; flex-shrink: 0; object-fit: contain; }
.use-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.use-name { font-size: .88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.use-recipe { font-size: .74rem; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.use-qty { color: var(--muted-2); }
.use-metric { flex-shrink: 0; font-size: .85rem; text-align: right; }

.uses-more { display: flex; align-items: center; justify-content: space-between; margin-top: .8rem; padding-top: .6rem; border-top: 1px solid var(--border); }
.link-btn {
  appearance: none; background: none; border: none; cursor: pointer; font: inherit;
  color: var(--accent-2); font-size: .86rem; padding: .2rem 0; text-decoration: none;
}
.link-btn:hover { color: var(--accent); text-decoration: underline; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ============================================================
   Pazar sekmesi
   ============================================================ */
.mkt-rows { display: flex; flex-direction: column; gap: 1px; }
.mkt-row { display: flex; align-items: center; justify-content: space-between; padding: .5rem .1rem; font-size: .9rem; border-bottom: 1px solid var(--border); }
.mkt-row:last-child { border-bottom: none; }
.mkt-row span { color: var(--muted); }
.mkt-row b { font-variant-numeric: tabular-nums; font-weight: 600; }
.mkt-row.warn b { color: var(--warn); }
.mkt-row.hl { background: var(--profit-bg); border-radius: var(--radius-sm); padding-inline: .55rem; border-bottom: none; margin-top: .3rem; }
.mkt-row.hl .pos { color: var(--profit); }

.mkt-block { margin-top: 1.1rem; }
.mkt-single { font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: .3rem; }
.mkt-note { margin: .4rem 0 0; }

/* Emir defteri merdiveni */
.orderbook { margin-top: .5rem; display: flex; flex-direction: column; gap: 2px; }
.ob-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; font-size: .8rem; font-variant-numeric: tabular-nums; }
.ob-buy { display: flex; align-items: center; justify-content: flex-end; gap: .35rem; }
.ob-sell { display: flex; align-items: center; gap: .35rem; }
.ob-price { color: var(--muted); min-width: 60px; text-align: center; }
.ob-n { color: var(--text); }
.ob-bar { height: 12px; border-radius: 2px; display: block; }
.ob-bar.buy { background: color-mix(in srgb, var(--info) 55%, transparent); }
.ob-bar.sell { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.ob-legend { display: flex; gap: 1rem; margin-top: .5rem; font-size: .74rem; color: var(--muted); }
.ob-key { display: inline-flex; align-items: center; gap: .3rem; }
.ob-key::before { content: ""; width: 10px; height: 10px; border-radius: 2px; }
.ob-key.buy::before { background: color-mix(in srgb, var(--info) 55%, transparent); }
.ob-key.sell::before { background: color-mix(in srgb, var(--accent) 55%, transparent); }

/* Fiyat geçmişi grafiği */
.phc { margin-top: .5rem; }
.phc-svg { width: 100%; height: 64px; display: block; overflow: visible; }
.phc-line { fill: none; stroke: var(--accent-2); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.phc-area { fill: color-mix(in srgb, var(--accent) 10%, transparent); stroke: none; }
.phc-axis { display: flex; justify-content: space-between; margin-top: .4rem; }
.phc-axis b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ============================================================
   /esya/{id} sayfası
   ============================================================ */
.esya-page { max-width: 960px; margin: 0 auto; }
.esya-back { margin-bottom: .8rem; }
.esya-page .idv {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.esya-page .idv-body { padding: 1.3rem 1.4rem 1.6rem; }
.esya-page .idv-name { font-size: 1.35rem; }
.esya-missing { text-align: center; padding: 4rem 1rem; }
.esya-missing h2 { margin: 0 0 .5rem; }
.esya-missing p { margin: 0 0 1.2rem; }

/* Geniş ekranda özet iki sütuna açılabilsin (sayfada ferahlık) */
@media (min-width: 720px) {
  .esya-page .sum-lore { flex-direction: row; flex-wrap: wrap; }
  .esya-page .lore-desc { flex: 1 1 100%; }
  .esya-page .lore-block { flex: 1 1 260px; }
}

/* Dar ekran: modal tam genişlik, sekmeler kaydırılabilir */
@media (max-width: 560px) {
  /* Tam genişlik modal + backdrop padding'i = taşma; mobilde padding'i sıfırla. */
  .modal-backdrop { padding: 0; }
  .modal-box.gs-modal { max-width: 100vw; width: 100vw; max-height: 92vh; border-radius: 0; }
  .idv-tabs { overflow-x: auto; scrollbar-width: none; }
  .idv-tabs::-webkit-scrollbar { display: none; }
  .uses-grid { grid-template-columns: 1fr; }
  .sum-cards { grid-template-columns: 1fr; }
  .idv-body { padding: .9rem; }
  .idv-ident { padding: .9rem .9rem .6rem; }
  .idv-tabs { padding: 0 .9rem; }
}

/* Ticaret kutuları — mesafe/pazarlık bonus girişi */
.crate-bonus { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; padding: .8rem 1rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cb-field { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; color: var(--muted); }
.cb-field .input.num { width: 110px; }
.cb-note { align-self: center; }

/* Node değer tablosu */
.node-list { display: grid; gap: .6rem; }
.node-card { padding: .8rem 1rem; }
.node-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.node-title { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; min-width: 0; }
.node-place { font-weight: 600; font-size: .98rem; }
.node-work { font-size: .8rem; color: var(--muted); }
.node-meta { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.node-chip { font-size: .74rem; padding: .12rem .45rem; border-radius: 6px; background: var(--surface-3);
  color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.node-topval { font-size: .92rem; font-weight: 600; color: var(--accent-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.node-drops { gap: .35rem; }

/* ============================================================
   Master-detail (Üretim / Kullanım sekmeleri) — sol liste (kendi scroll) + sağ detay.
   Eski "liste üstte, detay altta" düzenindeki sürekli yukarı-aşağı zıplamayı bitirir.
   ============================================================ */
/* CraftFlow kompakt başlık: sol ürün/reçete linki, sağ kâr metrikleri (kutu/kart değil, tek satır). */
.cf-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: .6rem 1.4rem; flex-wrap: wrap;
  padding-bottom: .7rem; border-bottom: 1px solid var(--border);
}
.cf-out { min-width: 0; flex: 1 1 220px; }
.cf-out-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .4rem; }
.cf-metrics { display: flex; align-items: flex-start; gap: 1.6rem; flex-shrink: 0; }
.cf-metric { display: flex; flex-direction: column; gap: .12rem; text-align: right; }
.cf-m-k { font-size: .66rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); white-space: nowrap; }
.cf-m-v { font-size: 1.02rem; font-weight: 750; letter-spacing: -.01em; display: inline-flex; align-items: center; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; }
.cf-m-v.pos { color: var(--profit); }
.cf-m-v.neg { color: var(--loss); }
@media (max-width: 560px) {
  .cf-metrics { width: 100%; justify-content: space-between; gap: 1rem; }
  .cf-metric { text-align: left; align-items: flex-start; }
  .cf-m-v { justify-content: flex-start; }
}
/* Satır içi eşya linki (ürün/reçete adı) — buton ama metin gibi görünür, tıklanınca detay açılır. */
.itemlink {
  appearance: none; background: none; border: none; padding: 0; margin: 0; font: inherit;
  color: var(--text); font-weight: 650; cursor: pointer; text-align: left; border-radius: 3px;
}
.itemlink:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.itemlink.muted { color: var(--muted); font-weight: 400; }
.itemlink.muted:hover { color: var(--accent-2); }
.itemlink:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Tıklanabilir çıktı pill'i (akıştaki üretilen ara/son ürün) */
.pill-wrap > .flow-out.clickable { cursor: pointer; }
.flow-out.clickable:hover { border-color: var(--accent); }

.md-layout { display: grid; grid-template-columns: minmax(210px, 300px) 1fr; gap: 1rem; align-items: start; }
.md-list { display: flex; flex-direction: column; gap: 3px; max-height: 58vh; overflow-y: auto; padding-right: 3px; }
.md-detail { min-width: 0; max-height: 58vh; overflow-y: auto; overflow-x: hidden; }
/* Dar sağ panelde yatay taşmayı sıfırla: min-width zincirini gevşet, uzun çıktı adı sarabilsin.
   .flow-inputs global min-width:140 dar panelde taşmanın ana kaynağıydı → burada serbest. */
.md-detail .flow-step { min-width: 0; }
.md-detail .flow-inputs { min-width: 0; }
.md-detail .flow-step > .pill-wrap { min-width: 0; max-width: 100%; }
.md-detail .flow-out { flex-wrap: wrap; min-width: 0; overflow-wrap: anywhere; }
.md-opt {
  display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid transparent; cursor: pointer; text-align: left; font: inherit;
  transition: border-color .12s, background .12s;
}
.md-opt:hover { border-color: var(--border-2); background: var(--surface-3); }
.md-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface-2)); }
.md-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.md-opt-icon img { width: 28px; height: 28px; object-fit: contain; display: block; flex-shrink: 0; }
.md-opt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.md-opt-name { font-size: .86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-opt-type { font-size: .72rem; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-opt-metric { flex-shrink: 0; font-size: .82rem; text-align: right; }
.md-more { padding: .5rem 0 .2rem; display: flex; flex-direction: column; align-items: center; gap: .2rem; border-top: 1px solid var(--border); margin-top: .3rem; }
.md-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .7rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.md-detail-title { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.md-detail-title img { width: 26px; height: 26px; object-fit: contain; flex-shrink: 0; }
.md-detail-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Planı kurulamayan / planlayıcı dışı reçete: listede soluk ama OKUNUR (gizlenmiyor, işaretleniyor). */
.md-opt.noplan .md-opt-name { color: var(--muted); }
.md-opt-noplan {
  font-size: .7rem; color: var(--muted-2); background: var(--surface-3);
  border: 1px solid var(--border); border-radius: 999px; padding: .1rem .4rem; white-space: nowrap;
}

/* ============================================================ Statik reçete kartı (plan yok) */
.rs-card { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: .8rem; }
.rs-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.rs-title { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; min-width: 0; }
.rs-name { font-weight: 600; overflow-wrap: anywhere; }
.rs-lvl { font-size: .72rem; color: var(--muted-2); white-space: nowrap; }
.rs-why {
  margin: .55rem 0 .8rem; font-size: .8rem; line-height: 1.45; color: var(--text);
  background: var(--warn-bg); border-left: 3px solid var(--warn);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: .45rem .6rem;
}
.rs-flow { display: flex; align-items: flex-start; gap: .7rem; flex-wrap: wrap; }
.rs-side { min-width: 0; flex: 1 1 240px; display: flex; flex-direction: column; gap: .3rem; }
.rs-side-k { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); }
.rs-mats, .rs-prods { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; min-width: 0; }
.rs-arrow { align-self: center; color: var(--muted-2); font-size: 1.1rem; flex-shrink: 0; }
.rs-missing {
  font-size: .68rem; color: var(--warn); background: var(--warn-bg);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  border-radius: 999px; padding: .08rem .38rem; white-space: nowrap;
}
.rs-group {
  font-size: .78rem; color: var(--muted); background: var(--surface-3);
  border: 1px dashed var(--border-2); border-radius: var(--radius-sm); padding: .18rem .45rem;
}

/* Özet içindeki pazar bölümü */
.sum-market { margin-top: 1.1rem; }

@media (max-width: 640px) {
  .md-layout { grid-template-columns: 1fr; }
  .md-list { max-height: 32vh; }
  .md-detail { max-height: none; }
}

/* ============================================================ Node haritası (/harita) */
.nmap-toolbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.nmap-legend { display: flex; flex-wrap: wrap; gap: .35rem; }
.nmap-lg {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .28rem .6rem; border-radius: 999px; font-size: .8rem; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text); cursor: pointer;
}
.nmap-lg:hover { border-color: var(--border-2); }
.nmap-lg.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); }
.nmap-lg .muted { font-weight: 500; }
.nmap-lg-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,.25); }
.nmap-lg-dot.all { background: conic-gradient(#8a94a6,#b07a42,#4fa05e,#9db63f,#cf8a3c,#9b6dc4,#3fa6c9,#d4af37); }

.nmap-controls { display: flex; align-items: center; gap: .6rem; }
.nmap-bg-switch, .nmap-zoom { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.nmap-bg-switch button, .nmap-zoom button {
  appearance: none; border: none; background: var(--surface-2); color: var(--text);
  padding: .34rem .7rem; font-size: .82rem; font-weight: 600; cursor: pointer; line-height: 1;
}
.nmap-zoom button { padding: .34rem .6rem; min-width: 30px; font-size: .95rem; }
.nmap-bg-switch button + button, .nmap-zoom button + button { border-left: 1px solid var(--border); }
.nmap-bg-switch button:hover, .nmap-zoom button:hover { background: var(--surface-3); }
.nmap-bg-switch button.on { background: var(--accent); color: #1a1500; }

/* Sahne: şematik zemin (hafif ızgara + vinyet), üstünde SVG noktalar */
.nmap-stage {
  position: relative; height: min(72vh, 760px); border-radius: var(--radius);
  border: 1px solid var(--border); overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 60%, color-mix(in srgb, var(--bg) 60%, #000 6%) 100%),
    linear-gradient(0deg, color-mix(in srgb, var(--border) 45%, transparent) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, color-mix(in srgb, var(--border) 45%, transparent) 1px, transparent 1px) 0 0 / 44px 100%,
    var(--surface);
}
.nmap-stage.real { background: #25323f; }
.nmap-svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.nmap-svg.dragging { cursor: grabbing; }
.nmap-svg image { image-rendering: auto; }
/* Bölge adı: haritada soluk, büyük; noktaların altında, tıklamayı engellemez */
.nmap-region {
  fill: var(--muted-2); opacity: .5; font-size: 21px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; pointer-events: none;
  paint-order: stroke; stroke: var(--surface); stroke-width: 3px;
}

.nmap-dot { stroke: var(--surface); stroke-width: 1; cursor: pointer; transition: r .08s ease; }
.nmap-dot:hover { stroke: var(--text); stroke-width: 1.4; }
.nmap-dot.dim { opacity: .12; pointer-events: none; }
.nmap-dot.sel { stroke: var(--accent-2); stroke-width: 2; }
/* İş tipi renkleri (light + dark ortak; orta tonlar iki temada da okunur) */
.nmap-dot.k-madencilik   { fill: #8a94a6; }
.nmap-dot.k-kesim        { fill: #b07a42; }
.nmap-dot.k-toplama      { fill: #4fa05e; }
.nmap-dot.k-yetistirme   { fill: #9db63f; }
.nmap-dot.k-kazi         { fill: #cf8a3c; }
.nmap-dot.k-ozelurun     { fill: #9b6dc4; }
.nmap-dot.k-balikkurutma { fill: #3fa6c9; }
.nmap-dot.k-uretim       { fill: #d4af37; }

/* Seçili düğüm detayı — sahne içinde sağ üstte */
.nmap-detail {
  position: absolute; top: 12px; right: 12px; width: min(320px, calc(100% - 24px));
  max-height: calc(100% - 24px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: .85rem .9rem;
}
.nmap-detail-x { position: absolute; top: .5rem; right: .55rem; appearance: none; background: none; border: none; color: var(--muted); cursor: pointer; font-size: .95rem; }
.nmap-detail-x:hover { color: var(--text); }
.nmap-detail-head { display: flex; align-items: center; gap: .55rem; padding-right: 1.2rem; }
.nmap-detail-head .nmap-lg-dot { width: 14px; height: 14px; }
.nmap-detail-place { font-weight: 700; font-size: 1rem; line-height: 1.2; }

.nmap-hint { position: absolute; left: 12px; bottom: 10px; background: color-mix(in srgb, var(--surface) 82%, transparent); padding: .2rem .5rem; border-radius: 6px; pointer-events: none; }

@media (max-width: 640px) {
  .nmap-stage { height: 62vh; }
  .nmap-detail { width: calc(100% - 24px); }
  .nmap-controls { width: 100%; justify-content: space-between; }
}

/* ============================================================ Arama sayfası (/ara, kök "/") */
.ara-page { max-width: 820px; margin: 0 auto; }
.ara-hero { padding: clamp(1.2rem, 6vh, 3.2rem) 0 1.2rem; text-align: center; }
.ara-h1 { font-size: clamp(1.4rem, 3.4vw, 2rem); font-weight: 700; margin: 0 0 .4rem; letter-spacing: -.01em; }
.ara-sub { margin: 0 auto 1.3rem; max-width: 52ch; color: var(--muted); font-size: .88rem; line-height: 1.5; }

.ara-box { position: relative; display: flex; align-items: center; }
.ara-ico { position: absolute; left: .9rem; color: var(--muted-2); pointer-events: none; }
.ara-input {
  width: 100%; padding: .85rem 2.6rem; font: inherit; font-size: 1rem;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius);
  color: var(--text); transition: border-color .12s, box-shadow .12s;
}
.ara-input::placeholder { color: var(--muted-2); }
.ara-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
/* Tarayıcının yerleşik "search" temizleme çarpısı gizlensin — kendi butonumuz var. */
.ara-input::-webkit-search-cancel-button { display: none; }
.ara-clear {
  position: absolute; right: .6rem; width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: var(--surface-3); color: var(--muted); font-size: 1.05rem; line-height: 1; cursor: pointer;
}
.ara-clear:hover { color: var(--text); background: var(--border-2); }

.ara-status, .ara-head { padding: .3rem .2rem; }
.ara-empty { text-align: center; padding: 1.6rem .5rem; }
.ara-empty p { margin: .2rem 0; }

.ara-list { display: flex; flex-direction: column; gap: 4px; }
.ara-hit {
  display: flex; align-items: center; gap: .7rem; width: 100%; padding: .55rem .7rem; text-align: left;
  background: var(--surface-2); border: 1px solid transparent; border-radius: var(--radius-sm);
  cursor: pointer; font: inherit; color: inherit; transition: border-color .12s, background .12s;
}
.ara-hit:hover, .ara-hit.on { border-color: var(--border-2); background: var(--surface-3); }
.ara-hit:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ara-hit-ico { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.ara-hit-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.ara-hit-name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ara-hit-meta {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  font-size: .72rem; color: var(--muted-2); min-width: 0;
}
.ara-hit-en { font-style: italic; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.ara-tag {
  border: 1px solid var(--border); background: var(--surface-3); border-radius: 999px;
  padding: .04rem .38rem; white-space: nowrap;
}
.ara-tag.warn { color: var(--warn); background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.ara-hit-nums {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: .15rem;
  font-variant-numeric: tabular-nums;
}
.ara-hit-price { font-size: .88rem; }
.ara-hit-stock { font-size: .72rem; color: var(--muted-2); }
.ara-hit-stock.own { color: var(--accent); }

/* Topbar açılır listesinden tam sayfa aramaya geçiş */
.gsearch-all {
  width: 100%; padding: .4rem; border: 0; border-top: 1px solid var(--border);
  background: transparent; color: var(--muted); font: inherit; font-size: .76rem; cursor: pointer;
}
.gsearch-all:hover { color: var(--text); background: var(--surface-3); }

@media (max-width: 640px) {
  .ara-hero { padding-top: 1rem; }
  .ara-hit-nums { display: none; }
}

/* ---- Akış içi alt reçete ağacı (tedarik sorunlu malzemede kendiliğinden açılır) ---- */
/* .flow-step bir flex satırı; .flow-cost gibi tam genişlik alıp alta düşmeli. */
.flow-subs { flex-basis: 100%; width: 100%; margin-top: .35rem; padding-top: .35rem; border-top: 1px dashed var(--border); }
.flow-subs-toggle {
  border: none; background: var(--surface-3); color: var(--accent-soft); font: inherit; font-size: .72rem;
  padding: .12rem .5rem; border-radius: 5px; cursor: pointer;
}
.flow-subs-toggle:hover { background: var(--surface); }
.flow-subs-why { font-size: .72rem; color: var(--warn); margin-left: .45rem; }
.flow-subs-body {
  margin-top: .35rem; padding: .3rem .5rem; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-3) 55%, transparent);
}
/* Ağaç dar sağ panelde (md-detail) de taşmasın */
.flow-subs-body .rtree-node { min-width: 0; }
.flow-subs-body .rtree-info { margin-left: 0; }
.rtree-alt { font-size: .7rem; color: var(--muted-2); white-space: nowrap; }
.rs-card .flow-subs { border-top-color: var(--border-2); margin-top: .7rem; padding-top: .6rem; }
