/* ==========================================================================
   DOSYA YOLU : /assets/core/core.css   (MEVCUT DOSYANIN ÜZERİNE YAZ)
   AÇIKLAMA   : SezTube çekirdek tasarım sistemi v2 — kurumsal, sade, YouTube düzeni.
                Önek: st-  (modüller: lg- db- vw- ad- cm- ...). Eski sınıf adları korunmuştur,
                tüm mevcut modüller değişiklik gerektirmeden çalışır.
   İçindekiler:
     1. Değişkenler (koyu / açık)   2. Reset   3. İkon + avatar
     4. Kabuk (topbar, sidebar, tabbar, hesap menüsü, main)
     5. Butonlar   6. Form   7. Toast   8. Modal   9. Yardımcılar   10. Animasyon
   ========================================================================== */

/* ---------- 1. Değişkenler ---------- */
:root {
  color-scheme: dark;

  --st-bg: #0f0f0f;
  --st-bg-2: #0f0f0f;
  --st-surface: #181818;
  --st-surface-2: #212121;
  --st-surface-3: #303030;
  --st-glass: rgba(15, 15, 15, .94);
  --st-toast-bg: rgba(33, 33, 33, .97);

  --st-border: rgba(255, 255, 255, .10);
  --st-border-strong: rgba(255, 255, 255, .18);

  --st-text: #f1f1f1;
  --st-text-2: #aaaaaa;
  --st-text-3: #7d7d7d;

  --st-accent: #9a85ff;
  --st-accent-2: #ff4d8d;
  --st-accent-soft: rgba(154, 133, 255, .16);
  --st-grad: linear-gradient(135deg, #7c5cff 0%, #9a4dff 100%);
  --st-live: #ff2d4f;

  --st-success: #2dd48f;
  --st-danger: #ff5a73;
  --st-warning: #ffb547;
  --st-info: #4da6ff;

  --st-shadow-sm: 0 1px 4px rgba(0, 0, 0, .4);
  --st-shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .04);
  --st-ring: 0 0 0 3px rgba(154, 133, 255, .35);
  --st-glow-a: transparent;
  --st-glow-b: transparent;

  --st-ease: cubic-bezier(.22, 1, .36, 1);
  --st-spring: cubic-bezier(.34, 1.3, .64, 1);

  --st-topbar-h: 56px;
  --st-tabbar-h: 56px;
  --st-sidebar-w: 0px;
  --st-safe-t: env(safe-area-inset-top, 0px);
  --st-safe-b: env(safe-area-inset-bottom, 0px);
  --st-safe-l: env(safe-area-inset-left, 0px);
  --st-safe-r: env(safe-area-inset-right, 0px);

  --st-font: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;

  --st-bg: #ffffff;
  --st-bg-2: #ffffff;
  --st-surface: #ffffff;
  --st-surface-2: #f2f2f2;
  --st-surface-3: #e5e5e5;
  --st-glass: rgba(255, 255, 255, .94);
  --st-toast-bg: rgba(255, 255, 255, .98);

  --st-border: rgba(0, 0, 0, .10);
  --st-border-strong: rgba(0, 0, 0, .18);

  --st-text: #0f0f0f;
  --st-text-2: #606060;
  --st-text-3: #909090;

  --st-accent: #6a47f5;
  --st-accent-soft: rgba(106, 71, 245, .10);

  --st-shadow-sm: 0 1px 4px rgba(0, 0, 0, .12);
  --st-shadow-lg: 0 16px 40px -10px rgba(0, 0, 0, .25), 0 0 0 1px rgba(0, 0, 0, .05);
  --st-ring: 0 0 0 3px rgba(106, 71, 245, .25);
}

/* ---------- 2. Reset + temel ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  background: var(--st-bg); -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--st-font); font-size: 14px; line-height: 1.5;
  color: var(--st-text); background: var(--st-bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility; overscroll-behavior-y: contain;
}

h1, h2, h3, h4, p, figure { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; }
img, video { display: block; max-width: 100%; }
input, textarea, select { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
::selection { background: rgba(124, 92, 255, .4); color: #fff; }

:focus-visible { outline: 2px solid var(--st-accent); outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }

* { scrollbar-width: thin; scrollbar-color: var(--st-surface-3) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--st-surface-3); border-radius: 8px; }

.st-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.st-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.st-skip {
  position: fixed; left: 12px; top: -80px; z-index: 300;
  padding: 10px 16px; border-radius: 999px; background: var(--st-accent); color: #fff; font-weight: 600;
}
.st-skip:focus { top: calc(var(--st-safe-t) + 8px); }

/* ---------- 3. İkon + avatar ---------- */
.st-icon { display: inline-block; flex: none; vertical-align: middle; fill: none; }
.st-spin { animation: st-spin .8s linear infinite; }

.st-avatar {
  display: inline-grid; place-items: center; flex: none;
  border-radius: 50%; overflow: hidden; font-weight: 600; color: #fff; line-height: 1;
  background: var(--st-surface-3);
}
.st-avatar img { width: 100%; height: 100%; object-fit: cover; }
.st-avatar--ph { background: hsl(var(--st-h, 260), 55%, 46%); }

/* ---------- 4. Uygulama kabuğu ---------- */
.st-app { position: relative; }
.st-acct { display: contents; }

/* İlerleme çubuğu */
.st-progress {
  position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 120;
  pointer-events: none; opacity: 0; transition: opacity .3s;
}
.st-progress i {
  display: block; width: 100%; height: 100%; background: var(--st-accent);
  transform-origin: left; transform: scaleX(0); transition: transform .4s var(--st-ease);
}
.st-progress.is-active { opacity: 1; }

/* Üst bar */
.st-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 56;
  display: flex; align-items: center; gap: 4px;
  height: calc(var(--st-topbar-h) + var(--st-safe-t));
  padding: var(--st-safe-t) calc(8px + var(--st-safe-r)) 0 calc(8px + var(--st-safe-l));
  background: var(--st-glass);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
}

.st-iconbtn {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%; color: var(--st-text);
  transition: background .15s, transform .15s var(--st-ease);
}
.st-iconbtn:hover { background: var(--st-surface-2); }
.st-iconbtn:active { transform: scale(.9); background: var(--st-surface-3); }

.st-brand { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 0 6px; }
.st-brand__logo { width: 28px; height: 28px; }
.st-brand__name { font-size: 20px; font-weight: 700; letter-spacing: -.04em; }
.st-brand__name b { font-weight: 700; color: var(--st-accent); }

.st-topbar__end { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* Arama: mobilde simge, açılınca tam genişlik */
.st-search { display: none; }
.st-search__back { display: none; }
.st-topbar.is-search-open .st-search {
  display: flex; align-items: center; position: absolute; z-index: 3;
  left: calc(8px + var(--st-safe-l)); right: calc(8px + var(--st-safe-r));
  top: calc(var(--st-safe-t) + 8px); height: calc(var(--st-topbar-h) - 16px);
  border-radius: 999px; background: var(--st-surface-2); overflow: hidden;
  animation: st-fade-in .18s var(--st-ease);
}
.st-topbar.is-search-open .st-search__back { display: grid; place-items: center; width: 44px; height: 100%; flex: none; color: var(--st-text); }
.st-search__input {
  flex: 1; min-width: 0; height: 100%; padding: 0 14px;
  background: transparent; border: 0; outline: 0; font-size: 16px; color: var(--st-text);
  -webkit-appearance: none; appearance: none;
}
.st-search__input::placeholder { color: var(--st-text-3); }
.st-search__input::-webkit-search-cancel-button { display: none; }
.st-search__submit { display: grid; place-items: center; flex: none; width: 52px; height: 100%; color: var(--st-text); transition: background .15s; }
.st-search__submit:hover { background: var(--st-surface-3); }

/* Mobilde sadece gerekli olanlar */
.st-topbar__add, .st-userbtn, .st-topbar__login { display: none; }
.st-userbtn { padding: 0; border-radius: 50%; transition: transform .15s var(--st-ease); }
.st-userbtn:active { transform: scale(.92); }

/* Yan menü: mobilde çekmece */
.st-sidebar {
  position: fixed; z-index: 80; left: 0; top: 0; bottom: 0;
  width: 280px; max-width: 84vw;
  display: flex; flex-direction: column;
  padding: 0 12px calc(12px + var(--st-safe-b));
  background: var(--st-bg); border-right: 1px solid var(--st-border);
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(-104%); transition: transform .3s var(--st-ease), box-shadow .3s;
}
body.is-sidebar-open .st-sidebar { transform: none; box-shadow: var(--st-shadow-lg); }

.st-sidebar__head {
  display: flex; align-items: center; gap: 4px; flex: none;
  height: calc(var(--st-topbar-h) + var(--st-safe-t)); padding-top: var(--st-safe-t); margin: 0 -4px 4px;
}
.st-sidebar__nav { display: flex; flex-direction: column; gap: 2px; padding-top: 4px; }
.st-side-sec { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; margin-top: 8px; border-top: 1px solid var(--st-border); }
.st-side-sec__title { padding: 4px 12px 8px; font-size: 16px; font-weight: 600; }
.st-sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: 1px solid var(--st-border); }
.st-sidebar__copy { padding: 10px 12px 0; font-size: 12px; line-height: 1.5; color: var(--st-text-3); }

.st-navitem {
  display: flex; align-items: center; gap: 20px; width: 100%; height: 40px;
  padding: 0 12px; border-radius: 10px; font-size: 14px; font-weight: 400; color: var(--st-text); text-align: left;
  transition: background .15s;
}
.st-navitem:hover { background: var(--st-surface-2); }
.st-navitem:active { background: var(--st-surface-3); }
.st-navitem.is-active { background: var(--st-surface-3); font-weight: 600; }
.st-navitem.is-active .st-icon { color: var(--st-accent); }
.st-navitem span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Perde */
.st-scrim {
  position: fixed; inset: 0; z-index: 53; background: rgba(0, 0, 0, .55);
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
body.is-sidebar-open .st-scrim { opacity: 1; visibility: visible; z-index: 79; }
body.is-menu-open .st-scrim { opacity: 1; visibility: visible; z-index: 69; }

/* Tema ikonları */
:root[data-theme="dark"] .st-ico-moon { display: none; }
:root[data-theme="light"] .st-ico-sun { display: none; }

/* Hesap menüsü: mobilde alttan sheet, masaüstünde açılır kutu */
.st-menu {
  position: fixed; z-index: 90; left: 0; right: 0; bottom: 0;
  padding: 8px 8px calc(12px + var(--st-safe-b));
  border-radius: 16px 16px 0 0; background: var(--st-surface-2);
  box-shadow: var(--st-shadow-lg);
  transform: translateY(105%); visibility: hidden;
  transition: transform .32s var(--st-ease), opacity .2s, visibility 0s linear .32s;
}
.st-menu.is-open { transform: none; visibility: visible; transition-delay: 0s; }
.st-menu__grab { display: block; width: 36px; height: 4px; margin: 2px auto 10px; border-radius: 4px; background: var(--st-surface-3); }
.st-menu__head { display: flex; align-items: center; gap: 14px; padding: 10px 12px 14px; margin-bottom: 6px; border-bottom: 1px solid var(--st-border); }
.st-menu__who { display: flex; flex-direction: column; min-width: 0; }
.st-menu__who strong { font-size: 16px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-menu__who span { font-size: 14px; color: var(--st-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-menu__who a { margin-top: 4px; font-size: 14px; color: var(--st-accent); }
.st-menu__item {
  display: flex; align-items: center; gap: 16px; width: 100%; height: 44px; padding: 0 12px;
  border-radius: 10px; font-size: 14px; color: var(--st-text); transition: background .15s;
}
.st-menu__item:hover { background: var(--st-surface-3); }
.st-menu__item .st-icon { color: var(--st-text); }
.st-menu__sep { height: 1px; margin: 6px 0; background: var(--st-border); }
.st-menu__item--danger, .st-menu__item--danger .st-icon { color: var(--st-danger); }

/* Alt tab bar (mobil uygulama görünümü) */
.st-tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 52;
  display: flex; align-items: stretch;
  height: calc(var(--st-tabbar-h) + var(--st-safe-b));
  padding: 0 calc(4px + var(--st-safe-r)) var(--st-safe-b) calc(4px + var(--st-safe-l));
  background: var(--st-glass);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  border-top: 1px solid var(--st-border);
}
.st-tab {
  position: relative; flex: 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--st-text-2); font-size: 10px; font-weight: 500; transition: color .15s;
}
.st-tab__ico { display: grid; place-items: center; height: 26px; transition: transform .2s var(--st-spring); }
.st-tab__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-tab:active .st-tab__ico { transform: scale(.85); }
.st-tab.is-active { color: var(--st-text); font-weight: 600; }
.st-tab.is-active .st-tab__ico { color: var(--st-accent); }
.st-tab--fab .st-tab__ico {
  width: 44px; height: 30px; border-radius: 15px; color: #fff; background: var(--st-grad);
}
.st-tab--fab.is-active .st-tab__ico { color: #fff; }

/* İçerik */
.st-main {
  min-height: 100vh; min-height: 100dvh; outline: 0;
  padding-top: calc(var(--st-topbar-h) + var(--st-safe-t));
  padding-bottom: calc(var(--st-tabbar-h) + var(--st-safe-b) + 4px);
  padding-left: calc(var(--st-sidebar-w) + var(--st-safe-l));
  padding-right: var(--st-safe-r);
}
.st-main.is-leaving { opacity: .4; transition: opacity .14s; pointer-events: none; }
.st-view-in { animation: st-view-in .3s var(--st-ease) both; }

/* Çıplak düzen (giriş sayfası vb.) */
body[data-layout="bare"] .st-topbar,
body[data-layout="bare"] .st-sidebar,
body[data-layout="bare"] .st-tabbar,
body[data-layout="bare"] .st-menu,
body[data-layout="bare"] .st-scrim { display: none !important; }
body[data-layout="bare"] .st-main { padding: 0; }

/* Tablet: ikon rayı */
@media (min-width: 768px) {
  :root { --st-sidebar-w: 72px; --st-topbar-h: 56px; }

  .st-topbar { padding-inline: calc(16px + var(--st-safe-l)) calc(16px + var(--st-safe-r)); gap: 8px; }
  .st-topbar__searchbtn, .st-tabbar, .st-sidebar__head { display: none; }
  .st-topbar__menu { display: none; }
  .st-userbtn, .st-topbar__login { display: inline-grid; }
  .st-topbar__login { display: inline-flex; }
  .st-topbar__add { display: inline-flex; }

  .st-search {
    display: flex; align-items: center; flex: 1; max-width: 640px; height: 40px; margin: 0 auto;
    border-radius: 999px; background: var(--st-bg); border: 1px solid var(--st-border-strong);
    overflow: hidden; transition: border-color .2s, box-shadow .2s;
  }
  .st-search:focus-within { border-color: var(--st-accent); box-shadow: var(--st-ring); }
  .st-search__input { padding: 0 18px; }
  .st-search__submit { background: var(--st-surface-2); border-left: 1px solid var(--st-border-strong); }

  /* ikon rayı */
  .st-sidebar {
    z-index: 55; top: calc(var(--st-topbar-h) + var(--st-safe-t)); width: var(--st-sidebar-w); max-width: none;
    padding: 4px 4px 8px; transform: none; border-right: 0; background: var(--st-bg); box-shadow: none;
  }
  .st-navitem { flex-direction: column; justify-content: center; gap: 4px; height: 66px; padding: 0 2px; font-size: 10px; text-align: center; border-radius: 10px; }
  .st-navitem span { max-width: 100%; }
  .st-side-sec--more, .st-sidebar__copy, .st-sidebar__foot { display: none; }

  .st-main { padding-bottom: 28px; }
  body.is-sidebar-open .st-scrim { opacity: 0; visibility: hidden; }
  body.is-menu-open .st-scrim { opacity: 1; visibility: visible; background: transparent; }

  .st-menu {
    left: auto; right: 16px; bottom: auto; width: 300px; padding: 8px;
    top: calc(var(--st-topbar-h) + var(--st-safe-t) + 4px);
    border-radius: 14px; opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right;
    transition: opacity .15s, transform .2s var(--st-ease), visibility 0s linear .2s;
  }
  .st-menu.is-open { opacity: 1; transform: none; }
  .st-menu__grab { display: none; }
}

/* Masaüstü: tam yan menü (hamburger ile ray moduna alınabilir: html.st-mini) */
@media (min-width: 1100px) {
  .st-topbar__menu { display: inline-grid; }
  html:not(.st-mini) { --st-sidebar-w: 240px; }

  html:not(.st-mini) .st-sidebar { padding: 12px; overflow-y: auto; }
  html:not(.st-mini) .st-navitem { flex-direction: row; justify-content: flex-start; gap: 20px; height: 40px; padding: 0 12px; font-size: 14px; text-align: left; }
  html:not(.st-mini) .st-side-sec--more { display: flex; }
  html:not(.st-mini) .st-sidebar__foot { display: flex; }
  html:not(.st-mini) .st-sidebar__copy { display: block; }
}

/* ---------- 5. Butonlar (hap biçimli) ---------- */
.st-btn {
  --st-h: 40px; --st-spin: var(--st-text);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--st-h); padding: 0 18px; border-radius: 999px;
  border: 1px solid transparent; font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; text-align: center;
  -webkit-user-select: none; user-select: none;
  transition: transform .12s var(--st-ease), background .15s, border-color .15s, opacity .2s, filter .2s;
}
.st-btn:active { transform: scale(.97); }
.st-btn[disabled], .st-btn.is-disabled { opacity: .5; pointer-events: none; }

.st-btn--primary { --st-spin: #fff; color: #fff; background: var(--st-grad); }
.st-btn--primary:hover { filter: brightness(1.1); }

.st-btn--subtle { background: var(--st-surface-2); color: var(--st-text); }
.st-btn--subtle:hover { background: var(--st-surface-3); }

.st-btn--ghost { color: var(--st-text-2); }
.st-btn--ghost:hover { background: var(--st-surface-2); color: var(--st-text); }

.st-btn--danger { --st-spin: var(--st-danger); background: rgba(255, 90, 115, .12); color: var(--st-danger); }
.st-btn--danger:hover { background: var(--st-danger); color: #fff; }

/* Abone ol: koyuda beyaz, açıkta siyah düğme (YouTube düzeni) */
.st-btn--invert { background: var(--st-text); color: var(--st-bg); }
.st-btn--invert:hover { filter: opacity(.85); }

.st-btn--sm { --st-h: 32px; padding: 0 14px; font-size: 13px; }
.st-btn--lg { --st-h: 48px; padding: 0 26px; font-size: 15px; }
.st-btn--block { display: flex; width: 100%; }

.st-btn.is-loading { color: transparent !important; pointer-events: none; }
.st-btn.is-loading > * { opacity: 0; }
.st-btn.is-loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; border: 2.5px solid var(--st-spin); border-right-color: transparent;
  animation: st-spin .7s linear infinite;
}

/* ---------- 6. Form alanları ---------- */
.st-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.st-label { font-size: 13px; font-weight: 500; color: var(--st-text-2); }
.st-field__hint { font-size: 12.5px; color: var(--st-text-3); }
.st-field__error { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--st-danger); animation: st-fade-down .2s var(--st-ease); }
.st-field__error:empty { display: none; }

.st-input-wrap { position: relative; display: flex; align-items: center; }
.st-input-wrap__icon { position: absolute; left: 14px; display: grid; place-items: center; color: var(--st-text-3); pointer-events: none; transition: color .2s; }
.st-input-wrap:focus-within .st-input-wrap__icon { color: var(--st-accent); }
.st-input-wrap__action { position: absolute; right: 4px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--st-text-3); transition: color .2s, background .2s; }
.st-input-wrap__action:hover { color: var(--st-text); background: var(--st-surface-3); }

.st-input, .st-textarea, .st-select {
  width: 100%; min-height: 46px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--st-border-strong);
  background: var(--st-bg); color: var(--st-text);
  font-size: 16px; line-height: 1.4; outline: 0; -webkit-appearance: none; appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.st-input::placeholder, .st-textarea::placeholder { color: var(--st-text-3); }
.st-input:hover, .st-textarea:hover, .st-select:hover { border-color: var(--st-text-3); }
.st-input:focus, .st-textarea:focus, .st-select:focus { border-color: var(--st-accent); box-shadow: var(--st-ring); }
.st-input-wrap--icon .st-input { padding-left: 44px; }
.st-input-wrap--action .st-input { padding-right: 52px; }
.st-textarea { min-height: 104px; padding: 12px 14px; resize: vertical; }
.st-select {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b8ba3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.st-select option { background: var(--st-surface-2); color: var(--st-text); }
.st-input:-webkit-autofill { -webkit-box-shadow: 0 0 0 100px var(--st-surface-2) inset; -webkit-text-fill-color: var(--st-text); caret-color: var(--st-text); }

.st-field.has-error .st-input, .st-field.has-error .st-textarea, .st-field.has-error .st-select { border-color: var(--st-danger); box-shadow: 0 0 0 3px rgba(255, 90, 115, .16); }
.st-field.has-error .st-input-wrap__icon { color: var(--st-danger); }
.st-field.is-shake { animation: st-shake .38s; }

.st-check { display: inline-flex; align-items: center; gap: 10px; position: relative; cursor: pointer; font-size: 14px; color: var(--st-text-2); -webkit-user-select: none; user-select: none; }
.st-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.st-check__box { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--st-text-3); background: transparent; color: #fff; transition: background .15s, border-color .15s; }
.st-check__box .st-icon { opacity: 0; transform: scale(.4); transition: opacity .15s, transform .2s var(--st-spring); }
.st-check input:checked + .st-check__box { background: var(--st-accent); border-color: transparent; }
.st-check input:checked + .st-check__box .st-icon { opacity: 1; transform: none; }
.st-check input:focus-visible + .st-check__box { box-shadow: var(--st-ring); }

.st-switch { display: inline-flex; align-items: center; gap: 12px; position: relative; cursor: pointer; font-size: 14px; color: var(--st-text-2); }
.st-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.st-switch__track { position: relative; flex: none; width: 40px; height: 22px; border-radius: 999px; background: var(--st-surface-3); transition: background .2s; }
.st-switch__track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); transition: transform .25s var(--st-spring); }
.st-switch input:checked + .st-switch__track { background: var(--st-accent); }
.st-switch input:checked + .st-switch__track::after { transform: translateX(18px); }
.st-switch input:focus-visible + .st-switch__track { box-shadow: var(--st-ring); }

/* ---------- 7. Toast ---------- */
.st-toasts { position: fixed; z-index: 95; left: 12px; right: 12px; bottom: calc(var(--st-tabbar-h) + var(--st-safe-b) + 12px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.st-toast {
  --st-t: var(--st-info);
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  width: 100%; max-width: 420px; padding: 12px 8px 13px 12px; overflow: hidden;
  border-radius: 12px; background: var(--st-toast-bg); border: 1px solid var(--st-border-strong);
  box-shadow: var(--st-shadow-lg); pointer-events: auto;
  opacity: 0; transform: translateY(16px); transition: opacity .25s, transform .35s var(--st-spring);
}
.st-toast.is-in { opacity: 1; transform: none; }
.st-toast.is-out { opacity: 0; transform: translateY(10px); transition: opacity .2s, transform .22s var(--st-ease); }
.st-toast--success { --st-t: var(--st-success); }
.st-toast--error { --st-t: var(--st-danger); }
.st-toast--warning { --st-t: var(--st-warning); }
.st-toast--info { --st-t: var(--st-info); }
.st-toast__icon { position: relative; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: var(--st-t); }
.st-toast__icon::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--st-t); opacity: .16; }
.st-toast__icon .st-icon { position: relative; }
.st-toast__body { flex: 1; min-width: 0; padding-top: 2px; }
.st-toast__title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.st-toast__text { margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--st-text-2); word-break: break-word; }
.st-toast__close { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--st-text-3); transition: background .15s, color .15s; }
.st-toast__close:hover { background: var(--st-surface-3); color: var(--st-text); }
.st-toast__bar { position: absolute; left: 0; bottom: 0; width: 100%; height: 3px; background: var(--st-t); opacity: .85; transform-origin: left; animation: st-toast-bar var(--st-toast-dur, 4.5s) linear forwards; }
.st-toast:hover .st-toast__bar { animation-play-state: paused; }

@media (min-width: 768px) {
  .st-toasts { left: 24px; right: auto; bottom: 24px; width: 400px; align-items: stretch; }
  .st-toast { max-width: none; }
}

/* ---------- 8. Modal ---------- */
.st-modal-root { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.st-modal-backdrop { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0, 0, 0, .6); opacity: 0; pointer-events: auto; transition: opacity .2s; }
.st-modal-backdrop.is-open { opacity: 1; }
.st-modal {
  --st-t: var(--st-accent);
  width: 100%; max-width: 380px; padding: 24px 20px 16px; text-align: center;
  border-radius: 16px; background: var(--st-surface-2); box-shadow: var(--st-shadow-lg);
  opacity: 0; transform: translateY(14px) scale(.97); transition: opacity .2s, transform .35s var(--st-spring);
}
.st-modal-backdrop.is-open .st-modal { opacity: 1; transform: none; }
.st-modal--danger { --st-t: var(--st-danger); }
.st-modal--success { --st-t: var(--st-success); }
.st-modal--warning { --st-t: var(--st-warning); }
.st-modal--info { --st-t: var(--st-info); }
.st-modal__icon { position: relative; display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; color: var(--st-t); }
.st-modal__icon::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--st-t); opacity: .15; }
.st-modal__icon .st-icon { position: relative; }
.st-modal__title { font-size: 18px; font-weight: 600; }
.st-modal__text { margin-top: 6px; font-size: 14px; color: var(--st-text-2); }
.st-modal__actions { display: flex; gap: 10px; margin-top: 20px; }
.st-modal__actions .st-btn { flex: 1; }

/* ---------- 9. Yardımcı bileşenler ---------- */
.st-container { width: 100%; max-width: 1500px; margin: 0 auto; padding: 14px 14px 24px; }
@media (min-width: 768px) { .st-container { padding: 24px 28px 40px; } }

.st-card { background: var(--st-surface); border: 1px solid var(--st-border); border-radius: 14px; }

.st-chips { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.st-chips::-webkit-scrollbar { display: none; }
.st-chip {
  display: inline-flex; align-items: center; flex: none; height: 32px; padding: 0 12px; border-radius: 8px;
  background: var(--st-surface-2); font-size: 14px; font-weight: 500; white-space: nowrap; color: var(--st-text);
  transition: background .15s;
}
.st-chip:hover { background: var(--st-surface-3); }
.st-chip.is-active { background: var(--st-text); color: var(--st-bg); }

.st-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; background: var(--st-accent-soft); color: var(--st-accent); }
.st-live { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: .02em; color: #fff; background: var(--st-live); }
.st-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: st-pulse 1.4s ease-in-out infinite; }
.st-divider { height: 1px; border: 0; margin: 16px 0; background: var(--st-border); }

/* Sekmeler (kanal sayfası, kütüphane vb.) */
.st-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--st-border); }
.st-tabs::-webkit-scrollbar { display: none; }
.st-tabs__item { position: relative; flex: none; height: 44px; padding: 0 16px; display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--st-text-2); transition: color .15s; }
.st-tabs__item:hover { color: var(--st-text); }
.st-tabs__item.is-active { color: var(--st-text); }
.st-tabs__item.is-active::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--st-text); }

.st-skel {
  border-radius: 10px; min-height: 12px;
  background: linear-gradient(100deg, var(--st-surface-2) 30%, var(--st-surface-3) 50%, var(--st-surface-2) 70%);
  background-size: 220% 100%; animation: st-shimmer 1.4s linear infinite;
}

.st-empty { display: grid; justify-items: center; gap: 10px; max-width: 440px; margin: 0 auto; padding: 84px 24px; text-align: center; }
.st-empty__icon { display: grid; place-items: center; width: 76px; height: 76px; margin-bottom: 6px; border-radius: 50%; background: var(--st-surface-2); color: var(--st-text-2); }
.st-empty__title { font-size: 20px; font-weight: 600; }
.st-empty__text { margin-bottom: 10px; color: var(--st-text-2); }

/* ---------- 10. Animasyonlar ---------- */
@keyframes st-spin { to { transform: rotate(360deg); } }
@keyframes st-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes st-fade-down { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }
@keyframes st-view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes st-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes st-toast-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes st-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes st-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

html.st-theme-anim *, html.st-theme-anim *::before, html.st-theme-anim *::after {
  transition: background-color .3s, border-color .3s, color .3s, box-shadow .3s !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
