:root{
  --primary:#2563eb; --primary-ink:#ffffff;
  --bg:#ffffff; --bg-elev:#f8fafc;
  --txt:#0b1220; --muted:#64748b;
  --border:#e2e8f0; --focus:#3b82f6;
  --tap:44px;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#0b1220; --bg-elev:#0f172a; --txt:#e5e7eb;
    --muted:#94a3b8; --border:#1f2937;
    --primary:#60a5fa; --primary-ink:#0b1220; --focus:#93c5fd;
  }
}
:where(a,button,input,select,textarea,[role="button"]):focus-visible{
  outline:2px solid var(--focus); outline-offset:2px; border-radius:10px;
  box-shadow:0 0 0 3px color-mix(in oklab, var(--focus) 40%, transparent);
}
:where(button,.btn,a.btn){ min-height: var(--tap); }
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.5rem;
  padding:.5rem 1rem;border-radius:9999px;border:1px solid var(--border);
  background:var(--bg-elev);color:var(--txt);text-decoration:none}
.btn.primary{background:var(--primary);color:var(--primary-ink);
  border-color:color-mix(in oklab,var(--primary) 70%, var(--border))}
.card{background:var(--bg);border:1px solid var(--border);border-radius:16px;
  padding:1rem;box-shadow:0 1px 4px rgba(0,0,0,.05)}
.skeleton{position:relative;overflow:hidden;background:var(--bg-elev);border-radius:12px}
.skeleton::after{content:"";position:absolute;inset:0;translate:-100% 0;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.35),transparent);
  animation:shimmer 1.35s infinite}
@keyframes shimmer{to{translate:100% 0}}
@media (prefers-reduced-motion: reduce){.skeleton::after{animation:none}}

/* Mobil Responsive İyileştirmeler */
@media (max-width: 640px) {
  /* Padding ayarlamaları */
  .max-w-7xl {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Kartlar */
  .card, [class*="rounded-"] {
    border-radius: 12px !important;
  }
  
  /* Grid sistemleri */
  [class*="grid-cols-"] {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
  }
  
  [class*="gap-"] {
    gap: 0.75rem !important;
  }
  
  /* Text boyutları */
  .text-4xl {
    font-size: 1.875rem !important;
  }
  
  .text-3xl {
    font-size: 1.5rem !important;
  }
  
  .text-2xl {
    font-size: 1.25rem !important;
  }
  
  /* Buttonlar */
  button, .btn, [role="button"] {
    min-height: 44px !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.875rem !important;
  }
  
  /* Input'lar */
  input, select, textarea {
    font-size: 16px !important; /* iOS zoom önleme */
    padding: 0.75rem !important;
  }
  
  /* Flex direction */
  .md\:flex-row {
    flex-direction: column !important;
  }
  
  /* Hidden mobile */
  .md\:block {
    display: none !important;
  }
  
  .md\:flex {
    display: none !important;
  }
  
  /* Spacing */
  .space-y-6 > * + * {
    margin-top: 1rem !important;
  }
  
  .space-y-4 > * + * {
    margin-top: 0.75rem !important;
  }
  
  /* Modal/Dialog */
  [role="dialog"], .modal {
    margin: 1rem !important;
    max-width: calc(100vw - 2rem) !important;
  }
  
  /* Tablo responsive */
  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  /* Image gallery */
  .grid[class*="grid-cols-"]:has(img) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  
  /* Footer */
  footer [class*="grid-cols-"] {
    grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    text-align: center !important;
  }
  
  /* Sticky header */
  header.sticky {
    position: relative !important;
  }
  
  /* Overflow scroll için touch */
  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
  }
}

/* Tablet optimizasyonu */
@media (min-width: 641px) and (max-width: 1024px) {
  .max-w-7xl {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
  }
  
  .grid-cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  
  .grid-cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

/* Touch target iyileştirme */
@media (pointer: coarse) {
  a, button, [role="button"], [tabindex="0"] {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Safe area (iPhone notch vb.) */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}