/* ===========================================================
   Otistify — yan panel teması
   Koyu tema varsayılan; sistem açık temadaysa açık renklere geçer.
   =========================================================== */

:root {
  --bg: #0a0b0d;
  --elev: #121418;
  --surface: #181a1f;
  --surface-2: #1f2228;
  --surface-3: #2a2e35;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);

  --text: #f2f4f7;
  --text-2: #a6acb6;
  --text-3: #6e747e;

  --accent: #1ed760;
  --accent-hover: #3be477;
  --accent-text: #1ed760;
  --accent-ink: #03170a;
  --accent-soft: rgba(30, 215, 96, 0.13);
  --accent-line: rgba(30, 215, 96, 0.38);

  --danger: #ff5c63;
  --danger-soft: rgba(255, 92, 99, 0.14);
  --warn: #f5b544;

  --playhead: #ffffff;
  --seg-selected: #2c3038;
  --shadow-pop: 0 14px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--line-strong);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);

  --r-lg: 16px;
  --r: 12px;
  --r-sm: 9px;
  --r-pill: 999px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f2f3f5;
    --elev: #ffffff;
    --surface: #f7f8fa;
    --surface-2: #eef0f3;
    --surface-3: #e2e5ea;
    --line: rgba(15, 20, 30, 0.08);
    --line-strong: rgba(15, 20, 30, 0.14);

    --text: #0f1216;
    --text-2: #4b525d;
    --text-3: #7d848f;

    --accent-text: #0a8a3d;
    --accent-soft: rgba(18, 170, 82, 0.12);
    --accent-line: rgba(18, 170, 82, 0.4);

    --danger: #d93a41;
    --danger-soft: rgba(217, 58, 65, 0.1);

    --playhead: #0f1216;
    --seg-selected: #ffffff;
    --shadow-pop: 0 14px 40px rgba(15, 20, 30, 0.16), 0 0 0 1px var(--line-strong);
    --shadow-sm: 0 1px 2px rgba(15, 20, 30, 0.08);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; opacity: 0.45; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 15px; height: 15px; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 3px solid var(--bg); }

kbd {
  font: 600 10.5px/1 var(--font);
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  color: var(--text-2);
}

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  font-weight: 650;
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.08s;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; gap: 6px; border-radius: 8px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 14px; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn-square { width: 44px; padding: 0; }

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-3); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 22%, transparent); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--text-2);
  flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.link-btn { color: var(--accent-text); font-weight: 650; font-size: 12px; }
.link-btn:hover { text-decoration: underline; }

.spacer { flex: 1; }

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 12px 0 14px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-logo { display: block; border-radius: 8px; }
.brand-name { font-size: 15px; font-weight: 800; letter-spacing: -0.3px; }
.header-actions { display: flex; align-items: center; gap: 6px; }

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 8px 0 4px;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 12px;
  font-weight: 650;
  max-width: 180px;
}
.account-chip:hover { background: var(--surface-2); }
.account-chip #userDisplay { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-chip .ic { color: var(--text-3); }
.avatar {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 800;
  flex: none;
}

.sync-status { display: inline-grid; place-items: center; width: 24px; height: 24px; color: var(--text-3); }
.sync-status .sync-error-icon { display: none; color: var(--warn); }
.sync-status[data-state="error"] .spinner { display: none; }
.sync-status[data-state="error"] .sync-error-icon { display: block; }
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--surface-3);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Ana düzen ---------- */
.app-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 12px 88px;
  max-width: 560px;
  margin: 0 auto;
}

.card {
  background: var(--elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.section-head h2 { margin: 0; font-size: 13px; font-weight: 700; color: var(--text); }

.hint { margin: 12px 0 0; font-size: 11.5px; color: var(--text-3); text-align: center; }
.hint kbd { margin: 0 1px; }

/* ---------- Şu an çalan ---------- */
#hostSlot:empty { display: none; }

.now-playing { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; min-height: 45px; }
.np-thumb {
  position: relative;
  width: 80px;
  height: 45px;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.np-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.np-thumb-fallback { width: 24px; height: 24px; }
.np-meta { min-width: 0; flex: 1; }
.np-title {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.np-status { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; }
.np-status[data-state="playing"] .status-dot { background: var(--text-2); }
.np-status[data-state="paused"] .status-dot { background: var(--warn); }
.np-status[data-state="looping"] { color: var(--accent-text); }
.np-status[data-state="looping"] .status-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px transparent; } }

.eq { position: absolute; left: 6px; bottom: 5px; display: none; gap: 2px; align-items: flex-end; height: 12px; }
.eq i { width: 3px; background: var(--accent); border-radius: 1px; animation: eq 0.9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
.is-playing .eq { display: flex; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }

/* ---------- Zaman çizelgesi ---------- */
.timeline { margin-bottom: 14px; }
.tl-track {
  position: relative;
  height: 40px;
  border-radius: 10px;
  background-color: var(--surface-2);
  /* saniye çizgileri: aralık ve konum JS'ten (background-size / background-position-x) */
  background-image: linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px);
  background-size: 10% 30%;
  background-position: 0 50%;
  background-repeat: repeat-x;
  cursor: pointer;
  touch-action: none;
  user-select: none;
}
.tl-region {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.tl-progress { position: absolute; top: 0; bottom: 0; width: 0; background: color-mix(in srgb, var(--accent) 24%, transparent); pointer-events: none; }
.tl-playhead {
  position: absolute;
  top: -3px;
  bottom: -3px;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--playhead);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--bg) 60%, transparent);
  pointer-events: none;
}
.tl-handle {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 18px;
  margin-left: -9px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  cursor: ew-resize;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  z-index: 2;
  transition: transform 0.1s;
}
.tl-handle span { font-size: 10px; font-weight: 850; }
/* Dokunmatik ekranlarda tutamacı parmakla yakalamak kolay olsun */
@media (pointer: coarse) {
  .tl-handle::before { content: ""; position: absolute; inset: -6px -14px; }
  .step-btn, .btn, .chip, .icon-btn { -webkit-touch-callout: none; user-select: none; }
}
.tl-handle:hover, .tl-handle.dragging { transform: scaleX(1.12); }
.tl-scale { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-len { padding: 1px 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); font-weight: 650; }

/* ---------- A / B alanları ---------- */
.ab-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-bottom: 14px; }
.ab-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; min-height: 18px; }
.ab-tag {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 850;
}
.ab-label { font-size: 11.5px; font-weight: 650; color: var(--text-2); flex: 1; }
.ab-head .link-btn { font-size: 11px; }

.stepper {
  display: flex;
  align-items: center;
  height: 38px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
}
.stepper:focus-within { box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 0 3px var(--accent-soft); }
.stepper input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}
.step-btn {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  color: var(--text-2);
  flex: none;
}
.step-btn:hover { background: var(--surface-3); color: var(--text); }

.player-actions { display: flex; gap: 8px; }
.player-actions #loopToggle { flex: 1; }
#loopToggle[data-active="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
#loopToggle[data-active="true"] .ic { color: var(--accent-text); }
#loopToggle[data-active="true"]:hover { background: var(--surface-3); }

/* ---------- Chip'ler ---------- */
.chips { display: flex; gap: 6px; }
.chips.wrap { flex-wrap: wrap; }
.chips.wrap .chip { padding: 0 10px; }
.chips.fill .chip { flex: 1 1 auto; justify-content: center; }
.chips.scroll {
  overflow-x: auto;
  scrollbar-width: none;
  padding: 1px;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
}
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
  flex: none;
  transition: background 0.15s, color 0.15s;
}
.chip:hover { background: var(--surface-3); color: var(--text); }
.chip[aria-checked="true"], .chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent-line); }
.chip-count { font-size: 11px; font-weight: 700; opacity: 0.7; font-variant-numeric: tabular-nums; }

/* ---------- Hız ---------- */
.speed { display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 9px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.speed .step-btn { width: 26px; height: 26px; }
.speed-value { min-width: 52px; height: 26px; border-radius: 6px; font-size: 12.5px; font-weight: 750; font-variant-numeric: tabular-nums; }
.speed-value:hover { background: var(--surface-3); }

/* ---------- Sekmeler ---------- */
.tabs { display: flex; gap: 3px; padding: 3px; border-radius: var(--r); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); margin-top: 4px; }
.tab {
  flex: 1;
  height: 32px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--seg-selected); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.tab-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--surface-3); font-size: 10.5px; font-weight: 750; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }

.tab-panel { display: flex; flex-direction: column; gap: 10px; }

/* ---------- Kitaplık ---------- */
.lib-toolbar { display: flex; align-items: center; gap: 4px; }
.lib-toolbar #btnRepeatToggle[data-mode]:not([data-mode="none"]) { color: var(--accent-text); }

.fav-list { display: flex; flex-direction: column; gap: 2px; }
.fav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 7px 6px 7px 7px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background 0.12s;
}
.fav-item:hover { background: var(--elev); }
.fav-item.playing { background: var(--accent-soft); }
.fav-item.playing .fav-name { color: var(--accent-text); }
.fav-thumb {
  position: relative;
  width: 64px;
  height: 36px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface-2);
  flex: none;
}
.fav-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fav-thumb .eq { left: 5px; bottom: 4px; }
.fav-item.playing .eq { display: flex; }
.fav-check {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
}
.fav-check .box { width: 20px; height: 20px; border-radius: 6px; border: 2px solid rgba(255, 255, 255, 0.85); display: grid; place-items: center; }
.fav-check .ic { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.selection-mode .fav-check { display: grid; }
.fav-item.selected .fav-check .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fav-item.selected .fav-check .ic { opacity: 1; }
.fav-item.selected { background: var(--accent-soft); }
.fav-text { min-width: 0; flex: 1; }
.fav-name { font-size: 13px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; margin-top: 1px; }
.fav-item .icon-btn { opacity: 0.55; }
.fav-item:hover .icon-btn, .fav-item .icon-btn[aria-expanded="true"] { opacity: 1; }
.selection-mode .fav-item .icon-btn { visibility: hidden; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 28px 16px;
  border-radius: var(--r-lg);
  border: 1px dashed var(--line-strong);
  color: var(--text-3);
  font-size: 12px;
}
.empty .ic { width: 26px; height: 26px; color: var(--text-3); margin-bottom: 4px; }
.empty strong { color: var(--text); font-size: 13px; font-weight: 650; }

.skeleton { height: 50px; border-radius: var(--r); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.select-bar {
  position: sticky;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 7px 7px 14px;
  border-radius: var(--r);
  background: var(--elev);
  box-shadow: var(--shadow-pop);
  z-index: 5;
}
.select-count { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- İstatistik ---------- */
.stat-hero {
  padding: 18px 16px 14px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 60%),
    var(--elev);
  border: 1px solid var(--line);
}
.stat-hero-label { font-size: 11.5px; font-weight: 650; color: var(--text-2); }
.stat-hero-value { font-size: 28px; font-weight: 800; letter-spacing: -0.8px; margin: 2px 0 14px; font-variant-numeric: tabular-nums; }
.stat-hero-value small { font-size: 15px; font-weight: 700; color: var(--text-2); letter-spacing: -0.2px; margin: 0 6px 0 2px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.stat-mini { display: flex; flex-direction: column; }
.stat-mini-value { font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; }
.stat-mini-label { font-size: 11px; color: var(--text-3); }

.list-head { display: flex; align-items: center; gap: 7px; margin: 8px 2px 0; font-size: 12px; font-weight: 700; color: var(--text-2); }
.list-head .ic { color: var(--text-3); }

.rank-list { display: flex; flex-direction: column; background: var(--elev); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 4px; }
.rank-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 10px; cursor: pointer; }
.rank-item:hover { background: var(--surface-2); }
.rank-no { width: 18px; text-align: center; font-size: 12px; font-weight: 800; color: var(--text-3); font-variant-numeric: tabular-nums; flex: none; }
.rank-item:first-child .rank-no { color: var(--accent-text); }
.rank-text { min-width: 0; flex: 1; }
.rank-name { font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-sub { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.rank-bar { height: 3px; border-radius: 3px; background: var(--surface-3); margin-top: 5px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.rank-empty { padding: 16px; text-align: center; font-size: 12px; color: var(--text-3); }

/* ---------- Giriş ---------- */
.auth { text-align: center; padding: 22px 18px 18px; }
.auth-logo { display: block; margin: 0 auto 12px; border-radius: 12px; }
.auth h2 { margin: 0 0 4px; font-size: 16px; font-weight: 800; letter-spacing: -0.3px; }
.auth-sub { margin: 0 auto 18px; font-size: 12px; color: var(--text-2); max-width: 280px; }
.auth form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.auth-switch { margin: 14px 0 0; font-size: 12px; color: var(--text-3); }

.field { display: flex; flex-direction: column; gap: 5px; }
.field-label { font-size: 11.5px; font-weight: 650; color: var(--text-2); }
.field input {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 0;
  outline: 0;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  transition: box-shadow 0.15s;
}
.field input::placeholder { color: var(--text-3); }
.field input:focus { box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 0 3px var(--accent-soft); }
.form-error { min-height: 0; font-size: 12px; font-weight: 600; color: var(--danger); }
.form-error:empty { display: none; }

.btn .spinner { width: 14px; height: 14px; border-color: color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; }

/* ---------- Menü ---------- */
.menu {
  position: fixed;
  z-index: 60;
  min-width: 200px;
  padding: 4px;
  border-radius: var(--r);
  background: var(--elev);
  box-shadow: var(--shadow-pop);
  animation: pop 0.12s ease-out;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text);
  text-align: left;
}
.menu-item .ic { color: var(--text-2); }
.menu-item:hover:not(:disabled), .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item.danger, .menu-item.danger .ic { color: var(--danger); }
.menu-item[aria-checked="true"] { color: var(--accent-text); }
.menu-item[aria-checked="true"] .ic { color: var(--accent-text); }
.menu-item .menu-check { margin-left: auto; opacity: 0; }
.menu-item[aria-checked="true"] .menu-check { opacity: 1; }
.menu-sep { height: 1px; margin: 4px 6px; background: var(--line); }
.menu-label { padding: 6px 10px 4px; font-size: 11px; font-weight: 650; color: var(--text-3); }
.menu-stepper { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 10px; font-size: 12.5px; }
.menu-stepper .speed { background: var(--surface-2); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } }

/* ---------- Diyalog ---------- */
.dialog {
  width: min(340px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--r-lg);
  background: var(--elev);
  color: var(--text);
  box-shadow: var(--shadow-pop);
}
.dialog[open] { animation: pop 0.14s ease-out; }
.dialog::backdrop { background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(3px); }
.dialog form { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.dialog-title { margin: 0; font-size: 15px; font-weight: 750; letter-spacing: -0.2px; }
.dialog-text { margin: -4px 0 0; font-size: 12.5px; color: var(--text-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.dialog-actions .btn-primary.danger { background: var(--danger); color: #fff; }
.code-box { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; border-radius: 10px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.code-box code { flex: 1; font: 700 15px/1.2 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0.5px; color: var(--accent-text); user-select: all; word-break: break-all; }

/* ---------- Bildirimler ---------- */
.toasts { position: fixed; left: 12px; right: 12px; bottom: 14px; z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  padding: 9px 14px 9px 11px;
  border-radius: var(--r);
  background: var(--text);
  color: var(--bg);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.18s ease-out;
  pointer-events: auto;
}
.toast .ic { color: var(--accent); }
.toast.error .ic { color: var(--danger); }
.toast.leaving { opacity: 0; transform: translateY(6px); transition: 0.2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

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