/* ============ Tasarım değişkenleri ============ */
:root {
  --bg: #f6f3ee;
  --bg-2: #efe9e1;
  --surface: #ffffff;
  --surface-2: #faf8f5;
  --text: #221d19;
  --text-2: #4a423b;
  --muted: #857a70;
  --line: #e6dfd5;
  --line-2: #d8cfc3;
  --accent: #a24f2c;
  --accent-2: #c46a3f;
  --accent-soft: #f6e6dc;
  --accent-ink: #ffffff;
  --ok: #2c7a4b;
  --ok-soft: #e1f2e7;
  --bad: #b23b2b;
  --bad-soft: #f9e2dd;
  --shadow-sm: 0 1px 2px rgb(40 25 10 / .06);
  --shadow: 0 6px 20px -8px rgb(40 25 10 / .18), 0 2px 6px -2px rgb(40 25 10 / .08);
  --shadow-lg: 0 24px 60px -20px rgb(30 15 5 / .35);
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --sidebar: 236px;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #15120f;
  --bg-2: #1c1814;
  --surface: #211c18;
  --surface-2: #29231e;
  --text: #f1ebe4;
  --text-2: #d3c9be;
  --muted: #9d9184;
  --line: #342d27;
  --line-2: #433a32;
  --accent: #e3895c;
  --accent-2: #f0a27a;
  --accent-soft: #3a271d;
  --accent-ink: #1a110c;
  --ok: #6cc28c;
  --ok-soft: #1c3226;
  --bad: #f08d7c;
  --bad-soft: #3a221d;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow: 0 8px 24px -10px rgb(0 0 0 / .6);
  --shadow-lg: 0 24px 60px -20px rgb(0 0 0 / .8);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15120f; --bg-2: #1c1814; --surface: #211c18; --surface-2: #29231e; --text: #f1ebe4; --text-2: #d3c9be; --muted: #9d9184;
    --line: #342d27; --line-2: #433a32; --accent: #e3895c; --accent-2: #f0a27a; --accent-soft: #3a271d; --accent-ink: #1a110c;
    --ok: #6cc28c; --ok-soft: #1c3226; --bad: #f08d7c; --bad-soft: #3a221d;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .4); --shadow: 0 8px 24px -10px rgb(0 0 0 / .6); --shadow-lg: 0 24px 60px -20px rgb(0 0 0 / .8);
    color-scheme: dark;
  }
}

/* ============ Temel ============ */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased; transition: background-color .3s var(--ease), color .3s var(--ease);
}
h1 { font-size: 26px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 6px; }
h2 { font-size: 18px; letter-spacing: -.01em; margin: 0; }
h3 { font-size: 14px; margin: 0; line-height: 1.3; }
a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ============ Düğmeler / form ============ */
.btn {
  display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 550; font-size: 14px;
  padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text);
  cursor: pointer; transition: transform .15s var(--ease), background .2s, border-color .2s, box-shadow .2s; touch-action: manipulation; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(.97); }
.btn svg { width: 17px; height: 17px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px var(--accent); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .6; pointer-events: none; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; transition: transform .15s var(--ease), background .2s; }
.icon-btn:active { transform: scale(.93); }
select, input { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 14px; }
select { padding-right: 30px; max-width: 260px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link { font-weight: 600; font-size: 14px; }

/* ============ Yerleşim ============ */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); padding: 22px 14px; display: flex; flex-direction: column; gap: 22px;
  background: var(--surface); border-right: 1px solid var(--line); z-index: 20;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 17px; letter-spacing: -.01em; padding: 0 8px; }
.logo-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 800; box-shadow: var(--shadow-sm); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-weight: 550; transition: background .2s, color .2s; }
.nav a:hover { background: var(--bg-2); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--accent); }
.badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.badge.pop { animation: pop .5s var(--spring); }
.theme-toggle { margin-top: auto; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); padding: 10px 12px; border-radius: 12px; font: inherit; font-weight: 550; cursor: pointer; }
.theme-toggle .moon, :root[data-theme="dark"] .theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .sun { display: none; } :root:not([data-theme="light"]) .theme-toggle .moon { display: block; } }
main { margin-left: var(--sidebar); padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: calc(1320px + var(--sidebar)); }
.mtop, .bottombar { display: none; }

.view { display: none; }
.view.active { display: block; animation: viewIn .35s var(--ease) both; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.view-head h1 { margin: 0; }

/* ============ Ana sayfa ============ */
.hero {
  display: grid; grid-template-columns: 1fr minmax(320px, 520px); gap: 24px; align-items: end;
  padding: 26px; border-radius: 22px; margin-bottom: 18px;
  background: radial-gradient(120% 140% at 100% 0%, var(--accent-soft), transparent 60%), var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.hero h1 { font-size: 30px; }
.hero p { margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 6px !important; }
.searchbar { position: relative; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 6px 5px 16px; transition: border-color .2s, box-shadow .2s; }
.searchbar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.searchbar > svg { color: var(--muted); }
.searchbar input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 0; font-size: 16px; outline: none; }
.searchbar.big input { font-size: 17px; padding: 12px 0; }
.searchbar .kbd { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12.5px; padding-right: 12px; white-space: nowrap; }
.searchbar .kbd svg { width: 16px; height: 16px; }
.searchbar.sticky { position: sticky; top: 12px; z-index: 6; box-shadow: var(--shadow); margin-bottom: 10px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); animation: fadeUp .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.stat b { display: block; font-size: 26px; letter-spacing: -.02em; line-height: 1.15; }
.stat span { color: var(--muted); font-size: 13px; }
.stat.accent { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: 0; color: #fff; }
.stat.accent span { color: rgb(255 255 255 / .85); }

.special { display: flex; gap: 16px; align-items: center; padding: 16px 18px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); margin-bottom: 8px; }
.special .em { font-size: 28px; }
.special p { margin: 2px 0 0; color: var(--text-2); font-size: 14px; }

.block { margin: 26px 0 8px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.block-head .nav-arrows { display: flex; gap: 6px; }
.block-head .icon-btn { width: 34px; height: 34px; }
.block-head .icon-btn svg { width: 17px; height: 17px; }
.shelf { display: grid; grid-auto-flow: column; grid-auto-columns: 158px; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.shelf > * { scroll-snap-align: start; }

.pulse { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.pulse-item { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; animation: fadeUp .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); }
.pulse-item:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: var(--shadow); }
.pulse-item img { width: 44px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--bg-2); box-shadow: var(--shadow-sm); }
.pulse-item .p-name { font-weight: 650; font-size: 14px; }
.pulse-item .p-top { color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pulse-item .p-count { font-size: 11.5px; color: var(--accent); font-weight: 600; }

/* ============ Kitap kartı ============ */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px 16px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 8px; cursor: pointer; animation: fadeUp .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 22ms); content-visibility: auto; contain-intrinsic-size: auto 330px; }
.tile-cover { position: relative; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: var(--bg-2); box-shadow: var(--shadow); transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.tile-cover img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .35s var(--ease); }
.tile-cover img.ok { opacity: 1; }
.tile:hover .tile-cover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tile.is-hidden { opacity: .45; }
.rank { position: absolute; left: 8px; top: 8px; min-width: 26px; height: 26px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; background: rgb(20 14 10 / .78); color: #fff; font-size: 12.5px; font-weight: 750; backdrop-filter: blur(4px); }
.chg { position: absolute; left: 8px; bottom: 8px; padding: 2px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 750; background: rgb(255 255 255 / .92); }
.chg.up { color: #1f7a45; }
.chg.down { color: #b23b2b; }
.chg.new { color: #a24f2c; }
.tile-add {
  position: absolute; right: 8px; top: 8px; z-index: 2; width: 36px; height: 36px; border-radius: 999px; border: 0; display: grid; place-items: center;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow); cursor: pointer; opacity: 0; transform: scale(.85);
  transition: opacity .2s, transform .25s var(--spring), background .2s, color .2s;
}
.tile:hover .tile-add, .tile-add:focus-visible, .tile-add.added { opacity: 1; transform: scale(1); }
.tile-add svg { width: 19px; height: 19px; stroke-width: 2.3; }
.tile-add.added { background: var(--ok); color: #fff; }
@media (hover: none) { .tile-add { opacity: 1; transform: scale(1); } }
.tile-body { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; min-width: 0; }
.t-title { font-size: 14px; font-weight: 650; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.t-author { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; font-size: 13px; }
.price { font-weight: 700; color: var(--text); }
.pill { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--bg-2); color: var(--text-2); white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* İskelet (yükleniyor) */
.skel .tile-cover, .skel-line { background: linear-gradient(90deg, var(--bg-2) 25%, var(--surface-2) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; box-shadow: none; }
.skel-line { height: 11px; border-radius: 6px; margin-top: 6px; }
.skel-line.short { width: 60%; }

/* ============ Kategoriler ============ */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { font: inherit; font-size: 13.5px; font-weight: 550; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .15s; white-space: nowrap; }
.chips button:hover { border-color: var(--line-2); color: var(--text); }
.chips button:active { transform: scale(.96); }
.chips button.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chips.cat { margin-bottom: 18px; }
.chips.sub button { font-size: 13px; padding: 5px 12px; }
.chips.sub button.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.filters { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.seg { display: inline-flex; padding: 4px; background: var(--bg-2); border-radius: 999px; gap: 2px; }
.seg button { font: inherit; font-size: 13.5px; font-weight: 600; border: 0; background: transparent; color: var(--muted); padding: 7px 15px; border-radius: 999px; cursor: pointer; transition: background .25s var(--ease), color .2s, box-shadow .25s; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.note { background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--radius-sm); padding: 10px 14px; color: var(--text-2); font-size: 13.5px; margin: 0 0 14px; }
.more { text-align: center; margin: 26px 0 6px; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 50px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ============ Liste ============ */
.summary { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow-sm); position: sticky; top: 10px; z-index: 5; }
.sum-grid { display: flex; gap: 22px; flex-wrap: wrap; }
.sum-grid div b { display: block; font-size: 20px; letter-spacing: -.01em; }
.sum-grid div span { font-size: 12.5px; color: var(--muted); }
.pub { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; animation: fadeUp .35s var(--ease) both; }
.pub-head { display: flex; justify-content: space-between; align-items: center; padding: 11px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); font-weight: 650; }
.li { display: grid; grid-template-columns: 44px 1fr auto 96px 36px; gap: 14px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); transition: background .2s, opacity .25s, transform .25s; }
.pub-head + .li { border-top: 0; }
.li:hover { background: var(--surface-2); }
.li.removing { opacity: 0; transform: translateX(20px); }
.li img { width: 44px; height: 64px; object-fit: cover; border-radius: 6px; background: var(--bg-2); }
.li-main { min-width: 0; }
.li-main b { display: block; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-main span { font-size: 12.5px; color: var(--muted); }
.li-meta { text-align: right; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; overflow: hidden; }
.qty button { width: 30px; height: 32px; border: 0; background: transparent; color: var(--text); font-size: 16px; cursor: pointer; }
.qty button:hover { background: var(--bg-2); }
.qty input { width: 34px; border: 0; border-radius: 0; padding: 0; text-align: center; background: transparent; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.li .icon-btn { width: 34px; height: 34px; border-color: transparent; background: transparent; color: var(--muted); }
.li .icon-btn:hover { color: var(--bad); background: var(--bad-soft); }

/* ============ Ayarlar ============ */
.card-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 14px 0; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; max-width: 720px; }
.card-block p { margin: 0; }

/* ============ Detay paneli ============ */
dialog#drawer {
  position: fixed; margin: 0; inset: 0 0 0 auto; height: 100dvh; max-height: none; width: min(520px, 100vw); max-width: 100vw;
  border: 0; padding: 0 0 24px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow-y: auto; overscroll-behavior: contain;
}
dialog#drawer[open] { animation: drawerIn .38s var(--ease) both; }
dialog#drawer.closing { animation: drawerOut .25s var(--ease) both; }
dialog#drawer::backdrop { background: rgb(15 10 6 / .45); backdrop-filter: blur(2px); animation: fade .3s var(--ease) both; }
dialog#drawer .close { position: sticky; top: 14px; float: right; margin: 14px 14px 0 0; z-index: 3; box-shadow: var(--shadow-sm); }
.d-hero { display: flex; gap: 18px; padding: 24px 24px 8px; }
.d-cover { width: 150px; flex: none; aspect-ratio: 2 / 3; border-radius: 10px; object-fit: cover; background: var(--bg-2); box-shadow: var(--shadow-lg); }
.d-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding-top: 30px; }
.d-info h2 { font-size: 21px; line-height: 1.25; }
.d-price { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.d-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 24px 4px; }
.d-sec { padding: 12px 24px; }
.d-sec p { margin: 0; color: var(--text-2); }
.d-tags { display: flex; gap: 6px; flex-wrap: wrap; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
details.desc summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details.desc p { white-space: pre-line; margin-top: 8px !important; font-size: 14px; }
.tag-editor { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip-check { display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 11px; font-size: 13px; cursor: pointer; }

/* ============ Bildirim ============ */
#toast { position: fixed; left: 50%; bottom: 28px; z-index: 60; transform: translate(-50%, 20px) scale(.96); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 10px; background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 550;
  box-shadow: var(--shadow-lg); transition: opacity .25s var(--ease), transform .35s var(--spring); max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#toast svg { width: 18px; height: 18px; color: var(--ok); stroke-width: 2.4; }
.fly { position: fixed; z-index: 70; border-radius: 8px; object-fit: cover; pointer-events: none; box-shadow: var(--shadow-lg); }

/* ============ Animasyonlar ============ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes drawerIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drawerOut { to { transform: translateX(40px); opacity: 0; } }
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheetOut { to { transform: translateY(40px); opacity: 0; } }
@keyframes checkDraw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
.tile-add.added svg, .btn.added svg { stroke-dasharray: 24; animation: checkDraw .35s var(--ease) both; }
.btn.added { background: var(--ok); border-color: var(--ok); color: #fff; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ============ Duyarlı tasarım ============ */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  main { margin-left: 0; padding: 14px 14px calc(84px + env(safe-area-inset-bottom)); }
  .mtop { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 15; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top));
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
  .bottombar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .bottombar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0 8px; color: var(--muted); font-size: 11px; font-weight: 600; transition: color .2s; }
  .bottombar a.active { color: var(--accent); }
  .bottombar a.active svg { transform: translateY(-1px) scale(1.08); }
  .bottombar svg { transition: transform .25s var(--spring); }
  .bottombar .badge { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 5px; }
  h1 { font-size: 22px; }
  .hero { padding: 18px; border-radius: 18px; }
  .hero h1 { font-size: 24px; }
  .searchbar .kbd { display: none; }
  .searchbar.sticky { top: 64px; }
  .stats { gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat b { font-size: 21px; }
  .chips.cat, .chips.sub { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -14px; padding-right: 14px; }
  .chips.cat::-webkit-scrollbar, .chips.sub::-webkit-scrollbar { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 16px 12px; }
  .shelf { grid-auto-columns: 132px; gap: 12px; margin-right: -14px; padding-right: 14px; }
  .block-head .nav-arrows { display: none; }
  .summary { top: 62px; }
  .li { grid-template-columns: 40px 1fr auto; grid-template-rows: auto auto; gap: 4px 12px; padding: 10px 12px; }
  .li img { grid-row: 1 / span 2; width: 40px; height: 58px; }
  .li .li-meta { grid-column: 2; grid-row: 2; flex-direction: row; justify-content: flex-start; align-items: center; gap: 8px; }
  .li .qty { grid-column: 3; grid-row: 1 / span 2; }
  .li .icon-btn { display: none; }
  dialog#drawer { inset: auto 0 0 0; width: 100vw; height: auto; max-height: 92dvh; border-radius: 22px 22px 0 0; }
  dialog#drawer[open] { animation-name: sheetIn; }
  dialog#drawer.closing { animation-name: sheetOut; }
  .d-hero { padding: 18px 18px 6px; gap: 14px; }
  .d-cover { width: 112px; }
  .d-info { padding-top: 6px; }
  .d-actions, .d-sec { padding-left: 18px; padding-right: 18px; }
  #toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
}

/* Giriş sayfası */
.login-page { display: grid; place-items: center; min-height: 100dvh; padding: 16px; background: radial-gradient(80% 60% at 50% 0%, var(--accent-soft), transparent 70%), var(--bg); }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 30px; width: min(380px, 100%); display: grid; gap: 14px; text-align: center; box-shadow: var(--shadow-lg); animation: fadeUp .45s var(--ease) both; }
.login-card .brand { font-weight: 750; font-size: 20px; }
.login-card input { border-radius: 12px; padding: 12px 14px; }
.login-card button { font: inherit; font-weight: 650; border: 0; border-radius: 12px; padding: 12px; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.login-card p { margin: 0; }
.err { color: var(--bad); }

/* ============ Şube girişi ============ */
.login-card .brand { display: flex; align-items: center; justify-content: center; gap: 10px; }
.branch-pick { display: grid; gap: 10px; margin-top: 4px; }
.branch-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer; text-align: left; font: inherit; transition: border-color .2s, transform .15s var(--ease), box-shadow .2s; }
.branch-btn:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.branch-btn .b-city { font-size: 18px; font-weight: 750; }
.branch-btn .b-sub { font-size: 13px; color: var(--muted); }
.login-card form { display: grid; gap: 12px; }
.chosen { display: flex; justify-content: center; align-items: center; gap: 10px; font-weight: 650; }
.linkbtn { background: none !important; border: 0; color: var(--accent) !important; padding: 0 !important; font: inherit; font-size: 13px; cursor: pointer; }

/* ============ Şube rozeti / stok ============ */
.branch-tag { display: inline-flex; align-items: center; gap: 6px; margin: -6px 8px 0; padding: 6px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-weight: 650; font-size: 13px; }
.mtop .branch-tag { margin: 0; }
.pill.qty { background: var(--bg-2); color: var(--text-2); }
.pill.qty.neg { background: var(--bad-soft); color: var(--bad); }
.pill.qty.zero { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--line-2); }

/* ============ Şube sekmesi ============ */
.tabs-line { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 4px 0 16px; overflow-x: auto; scrollbar-width: none; }
.tabs-line button { position: relative; font: inherit; font-weight: 600; font-size: 14.5px; background: none; border: 0; color: var(--muted); padding: 10px 14px; cursor: pointer; white-space: nowrap; }
.tabs-line button .count { margin-left: 6px; font-size: 12px; padding: 1px 7px; border-radius: 999px; background: var(--bg-2); color: var(--text-2); }
.tabs-line button.active { color: var(--text); }
.tabs-line button.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.onso-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); margin-bottom: 14px; }
.onso-bar .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: 1px; }
.onso-bar .dot.ok { background: var(--ok); }
.onso-bar .dot.run { background: var(--accent); animation: pulse 1.2s infinite; }
.onso-bar .dot.bad { background: var(--bad); }
@keyframes pulse { 50% { opacity: .35; } }
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.prow { display: grid; grid-template-columns: 40px 1fr auto auto; gap: 14px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--line); transition: opacity .3s var(--ease), transform .3s var(--ease), background .2s; animation: fadeUp .3s var(--ease) both; }
.prow:first-child { border-top: 0; }
.prow:hover { background: var(--surface-2); }
.prow.gone { opacity: 0; transform: translateX(24px); }
.prow img { width: 40px; height: 58px; object-fit: cover; border-radius: 5px; background: var(--bg-2); }
.prow .p-main { min-width: 0; }
.prow .p-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.prow .p-main span { font-size: 12.5px; color: var(--muted); }
.prices { display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }
.prices .old { color: var(--muted); text-decoration: line-through; }
.prices .new { font-weight: 750; }
.prices .delta { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.prices .delta.up { background: var(--bad-soft); color: var(--bad); }
.prices .delta.down { background: var(--ok-soft); color: var(--ok); }
.done-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 650; font-size: 13.5px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .15s; white-space: nowrap; }
.done-btn:hover { border-color: var(--ok); color: var(--ok); }
.done-btn.on { background: var(--ok); border-color: var(--ok); color: #fff; }
.done-btn svg { width: 16px; height: 16px; stroke-width: 2.4; }
.qtybig { font-size: 18px; font-weight: 800; min-width: 44px; text-align: right; }
.qtybig.neg { color: var(--bad); }
.qtybig.zero { color: var(--muted); }
@media (max-width: 860px) {
  .prow { grid-template-columns: 36px 1fr auto; grid-template-rows: auto auto; gap: 4px 10px; padding: 10px 12px; }
  .prow img { grid-row: 1 / span 2; width: 36px; height: 52px; }
  .prow .prices { grid-column: 2; grid-row: 2; }
  .prow .done-btn, .prow .qtybig { grid-column: 3; grid-row: 1 / span 2; }
  .branch-tag { margin: 0; }
}
.badge.alert { background: var(--bad); color: #fff; }
.bottombar { grid-template-columns: repeat(5, 1fr) !important; }
.mtop .branch-tag { padding: 5px 10px; font-size: 12.5px; }
/* Şube düğmeleri giriş formunun genel düğme stilinden etkilenmesin */
.login-card .branch-btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--line-2); padding: 16px 18px; border-radius: 14px; font-weight: 400; }
.login-card .branch-btn:hover { border-color: var(--accent); background: var(--surface); }
.login-card .branch-btn .b-city { color: var(--text); }
.login-card .branch-btn .b-sub { color: var(--muted); }
