:root {
  --primary: #7858d6;
  --primary-dark: #5c3bb8;
  --primary-light: #f1edfa;
  --accent: #92e038;
  --bg: #f7f7fb;
  --card-bg: #ffffff;
  --text: #1e1b26;
  --muted: #7e788c;
  --line: #ede9f4;
  --danger: #e53935;
  --danger-bg: #ffebee;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --shadow-sm: 0 2px 8px rgba(34, 25, 59, 0.04);
  --shadow-md: 0 8px 24px rgba(34, 25, 59, 0.07);
  --shadow-lg: 0 16px 40px rgba(34, 25, 59, 0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  touch-action: pan-y;
  -ms-touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-x: none;
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f1edf7;
  color: var(--text);
  line-height: 1.45;
  padding-top: var(--safe-top);
  padding-bottom: calc(75px + var(--safe-bottom));
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100%;
  touch-action: pan-y;
  -ms-touch-action: pan-y;
  overscroll-behavior-x: none;
  user-select: none;
  -webkit-user-select: none;
  position: relative;
}

@media (max-width: 580px) {
  body {
    background-color: var(--bg);
  }
}

/* Perfect Native App Centered Frame */
.app-shell {
  width: 100%;
  max-width: 580px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
  box-shadow: 0 0 45px rgba(30, 20, 50, 0.05);
  box-sizing: border-box;
  overflow-x: clip;
}
@media (max-width: 580px) {
  .app-shell {
    box-shadow: none;
  }
}

/* App Bar / Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 850;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.app-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 4px 12px rgba(120, 88, 214, 0.3);
  flex-shrink: 0;
}

.app-brand-icon svg {
  width: 18px;
  height: 18px;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.app-icon-btn {
  width: 35px;
  height: 35px;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  border: none;
  display: grid;
  place-items: center;
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.app-icon-btn:active {
  transform: scale(0.92);
}

/* Quick Story/Filter Chips */
.app-chips-scroll {
  display: flex;
  gap: 8px;
  padding: 12px 14px 6px;
  overflow-x: auto;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.app-chips-scroll::-webkit-scrollbar {
  display: none;
}

.app-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  color: #4b4657;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.app-chip.active, .app-chip:active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* App Hero Scan Card */
.app-hero-card {
  margin: 12px 14px;
  padding: 20px;
  background: linear-gradient(135deg, #2f2054 0%, #563aa6 60%, #7858d6 100%);
  border-radius: var(--radius-lg);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(92, 59, 184, 0.25);
  box-sizing: border-box;
}

.app-hero-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.app-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.app-hero-card h2 {
  font-size: 23px;
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 8px;
}

.app-hero-card p {
  font-size: 13px;
  color: #dfd7f5;
  margin-bottom: 18px;
  max-width: 85%;
}

.app-hero-actions {
  display: flex;
  gap: 10px;
}

.btn-app-hero {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease;
}

.btn-app-hero:active {
  transform: scale(0.96);
}

.btn-app-hero-alt {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  backdrop-filter: blur(10px);
}

/* Product Feed */
.app-section {
  padding: 16px 14px 8px;
  box-sizing: border-box;
}

.app-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.app-section-head h3 {
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.app-section-head a {
  font-size: 12px;
  color: var(--primary);
  font-weight: 750;
  text-decoration: none;
}

.app-product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.app-product-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
}

.app-product-card:active {
  transform: scale(0.97);
}

.app-product-thumb {
  width: 100%;
  height: 110px;
  background: #fbfafd;
  border-radius: 10px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  overflow: hidden;
}

.app-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.app-product-info h4 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-product-brand {
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

.app-product-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.app-score-pill {
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 850;
  background: var(--primary-light);
  color: var(--primary);
}

.app-rating-pill {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 800;
  color: #b45309;
}

/* Bottom Navigation Bar (Dock) */
.app-dock {
  position: fixed;
  bottom: 0;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  width: 100%;
  max-width: 580px;
  height: calc(64px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 900;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

@media (min-width: 581px) {
  .app-dock {
    bottom: 12px;
    border-radius: 24px;
    border: 1px solid rgba(120, 88, 214, 0.18);
    box-shadow: 0 10px 30px rgba(30, 20, 60, 0.15);
    height: 64px;
    padding-bottom: 0;
  }
}

.dock-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #8c8599;
  text-decoration: none;
  font-size: 10px;
  font-weight: 750;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
}

.dock-item svg {
  width: 22px;
  height: 22px;
}

.dock-item.active {
  color: var(--primary);
}

.dock-item:active {
  transform: scale(0.92);
}

/* Floating Center Camera Button */
.dock-scan-btn {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #8862f2, #5a37ba);
  color: #fff;
  border: 4px solid #fff;
  box-shadow: 0 8px 24px rgba(120, 88, 214, 0.45);
  display: grid;
  place-items: center;
  transform: translateY(-16px);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.dock-scan-btn:active {
  transform: translateY(-13px) scale(0.94);
  box-shadow: 0 4px 12px rgba(120, 88, 214, 0.3);
}

.dock-scan-btn svg {
  width: 26px;
  height: 26px;
}

/* Full-Screen Scanner Overlay / Bottom Sheet */
.app-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 12, 26, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.app-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.app-sheet {
  position: fixed;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) translateY(100%);
  bottom: 0;
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: 26px 26px 0 0;
  z-index: 1001;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

.app-sheet.open {
  transform: translateX(-50%) translateY(0) !important;
}

.sheet-handle-bar {
  width: 42px;
  height: 5px;
  background: #d8d3e2;
  border-radius: 999px;
  margin: 12px auto 6px;
}

.sheet-head {
  padding: 10px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.sheet-head h3 {
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.sheet-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1edfa;
  border: none;
  display: grid;
  place-items: center;
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.sheet-body {
  padding: 18px 20px calc(24px + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Scanner Viewport */
.scanner-container {
  position: relative;
  width: 100%;
  height: clamp(190px, 32vh, 260px);
  background: #0d0a17;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.scanner-video-shell {
  width: 100%;
  height: 100%;
}

.scanner-reticle {
  position: absolute;
  width: min(220px, 78%);
  height: min(170px, 68%);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

.scanner-laser {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #b6ef6c, transparent);
  box-shadow: 0 0 8px #b6ef6c;
  animation: laserScan 2s ease-in-out infinite alternate;
}

@keyframes laserScan {
  0% { top: 10%; }
  100% { top: 90%; }
}

.scanner-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.scanner-mode-tabs {
  display: flex;
  background: #f1edfa;
  border-radius: var(--radius-full);
  padding: 4px;
  margin-bottom: 14px;
}

.scanner-mode-tab {
  flex: 1;
  text-align: center;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  border: none;
  background: transparent;
  color: #695e80;
  border-radius: var(--radius-full);
  cursor: pointer;
}

.scanner-mode-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(120, 88, 214, 0.15);
}

/* Result Sheet Display */
.score-circle-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #faf9fd, #f2effa);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.score-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: var(--primary);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  font-weight: 900;
  box-shadow: 0 6px 18px rgba(120, 88, 214, 0.35);
  flex-shrink: 0;
}

.score-details h3 {
  font-size: 16px;
  font-weight: 850;
  margin-bottom: 4px;
}

.score-details p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* Install Banner Toast */
.pwa-toast {
  position: fixed;
  top: calc(12px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%) translateY(-180%);
  width: calc(100% - 28px);
  max-width: 540px;
  padding: 12px 14px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(47, 39, 72, 0.16);
  border: 1px solid rgba(120, 88, 214, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 2000;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.pwa-toast.show {
  transform: translateX(-50%) translateY(0);
}

.pwa-toast-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pwa-toast-info strong {
  font-size: 12px;
  display: block;
}

.pwa-toast-info span {
  font-size: 10px;
  color: var(--muted);
}

.btn-pwa-install {
  padding: 6px 12px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 800;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

/* AI Chat Chips */
.chat-chip {
  background: #fff;
  border: 1px solid #ded7ec;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  color: #554d66;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.chat-chip:hover, .chat-chip:active {
  background: #f1edfa;
  border-color: #7858d6;
  color: #7858d6;
}

/* Drawer / Sheet Modals for Cart & History */
.app-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 11, 23, 0.55);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  backdrop-filter: blur(4px);
}
.app-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.app-drawer-sheet {
  position: fixed;
  bottom: 0;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 580px;
  max-height: 85vh;
  background: #ffffff;
  border-radius: 24px 24px 0 0;
  z-index: 1001;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}
.app-drawer-backdrop.open .app-drawer-sheet {
  transform: translateX(-50%) translateY(0) !important;
}
.app-drawer-drag {
  width: 44px;
  height: 5px;
  background: #e2e0eb;
  border-radius: 3px;
  margin: 10px auto 4px;
}
.app-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid #f1edf7;
}
.app-drawer-close {
  background: #f4f2f8;
  border: none;
  font-size: 20px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: #554d66;
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-drawer-body {
  padding: 16px 20px 85px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* Cart Health Audit */
.cart-audit-card {
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  color: #fff;
}
.cart-audit-card.grade-green {
  background: linear-gradient(135deg, #059669, #10b981);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
}
.cart-audit-card.grade-yellow {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
}
.cart-audit-card.grade-red {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.25);
}
.cart-audit-score {
  font-size: 26px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.22);
  padding: 4px 12px;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.cart-audit-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 10px;
}
.audit-stat-pill {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 6px 4px;
  text-align: center;
}
.audit-stat-pill b {
  display: block;
  font-size: 14px;
  font-weight: 900;
}
.audit-stat-pill span {
  font-size: 9.5px;
  opacity: 0.9;
  text-transform: uppercase;
}

.cart-item-card, .history-item-card {
  background: #fdfdfd;
  border: 1px solid #ebe7f5;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: all 0.15s;
}
.history-item-card {
  cursor: pointer;
}
.history-item-card:hover {
  border-color: #7858d6;
  background: #faf9fd;
}
.history-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f7fc;
  border: 1px solid #ede9f5;
  border-radius: 14px;
  padding: 10px 14px;
}
.h-stat b {
  display: block;
  font-size: 16px;
  font-weight: 900;
  color: #1e1b26;
}
.h-stat span {
  font-size: 11px;
  color: #7e788c;
}

/* App Toast Popup */
.app-toast-popup {
  position: fixed;
  bottom: 85px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e1b26;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}
.app-toast-popup.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-icon {
  font-size: 14px;
}

/* --- Titreşimli Kırmızı Alarm & Alerjen Koruma Kalkanı --- */
@keyframes emergencyPulse {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7); transform: scale(1); }
  50% { box-shadow: 0 0 0 18px rgba(220, 38, 38, 0); transform: scale(1.05); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); transform: scale(1); }
}

.emergency-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 8, 8, 0.82);
  backdrop-filter: blur(8px);
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.emergency-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.emergency-alert-card {
  background: #ffffff;
  border-radius: 24px;
  max-width: 480px;
  width: 100%;
  padding: 24px 20px 20px;
  text-align: center;
  border: 2px solid #ef4444;
  box-shadow: 0 20px 50px rgba(220, 38, 38, 0.35);
  animation: modalPop 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes modalPop {
  0% { transform: scale(0.85) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.emergency-pulse-shield {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #fee2e2;
  color: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  animation: emergencyPulse 1.8s infinite;
}
.emergency-pulse-shield svg {
  width: 36px;
  height: 36px;
}
.emergency-badge {
  display: inline-block;
  background: #dc2626;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.emergency-title {
  font-size: 20px;
  font-weight: 900;
  color: #991b1b;
  margin: 0 0 6px;
}
.emergency-sub {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.45;
  margin: 0 0 14px;
}
.emergency-alerts-list {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
}
.emergency-alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #fecaca;
}
.emergency-alert-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.emergency-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-emergency-clean {
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-emergency-clean:hover {
  background: #059669;
}
.btn-emergency-view {
  background: transparent;
  color: #7e788c;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Shield Switch & Rows */
.shield-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f3f0f7;
}
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider-toggle {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #e2e0eb;
  transition: 0.25s;
  border-radius: 34px;
}
.slider-toggle:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch-toggle input:checked + .slider-toggle {
  background-color: #7858d6;
}
.switch-toggle input:checked + .slider-toggle:before {
  transform: translateX(18px);
}
.shield-active-badge {
  font-size: 10px;
  font-weight: 900;
  background: #10b981;
  color: #fff;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 4px;
}
.shield-btn-icon.shield-on {
  color: #10b981;
}

/* ========================================================
   RESPONSIVE DESIGN & MULTI-SCREEN OPTIMIZATION
   (Mobil, Tablet, Masaüstü ve Küçük Ekran Uyumluluğu)
   ======================================================== */

/* Quick Action Strip (Sonuç Ekranı Butonları) */
.result-action-strip {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.result-action-strip > button {
  flex: 1 1 calc(50% - 6px);
  min-width: calc(50% - 6px);
  min-height: 40px;
  font-size: 12px;
  font-weight: 750;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* iOS Safari Input Auto-Zoom Engellemesi */
@media (max-width: 768px) {
  input[type="text"],
  input[type="search"],
  input[type="number"],
  textarea {
    font-size: 16px !important;
  }
}

/* --- KÜÇÜK VE ORTA BOY MOBİL EKRANLAR (<= 420px: iPhone SE, Galaxy, Pixel) --- */
@media (max-width: 420px) {
  .app-header {
    padding: 10px 12px;
  }
  .app-brand {
    font-size: 16px;
    gap: 7px;
  }
  .app-brand-icon {
    width: 32px;
    height: 32px;
  }
  .app-brand-icon svg {
    width: 17px;
    height: 17px;
  }
  .app-header-actions {
    gap: 4px;
  }
  .app-icon-btn {
    width: 33px;
    height: 33px;
  }
  .app-icon-btn svg {
    width: 16px;
    height: 16px;
  }
  .app-hero-card {
    margin: 10px 12px;
    padding: 16px;
  }
  .app-hero-card h2 {
    font-size: 19px;
  }
  .app-hero-card p {
    font-size: 12px;
    max-width: 100%;
    margin-bottom: 14px;
  }
  .btn-app-hero {
    padding: 10px 10px;
    font-size: 12px;
    gap: 5px;
  }
  .btn-app-hero svg {
    width: 14px;
    height: 14px;
  }
  .app-section {
    padding: 14px 12px 6px;
  }
  .app-product-grid {
    gap: 10px;
  }
  .app-product-card {
    padding: 10px;
  }
  .app-product-thumb {
    height: 95px;
  }
  .app-chips-scroll {
    padding: 10px 12px 4px;
    gap: 6px;
  }
  .app-chip {
    padding: 6px 11px;
    font-size: 11px;
  }
  .cart-audit-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }
  .audit-stat-pill span {
    font-size: 8.5px;
  }
  .emergency-alert-card {
    padding: 18px 14px 14px;
    border-radius: 20px;
  }
  .emergency-title {
    font-size: 17px;
  }
  .emergency-pulse-shield {
    width: 54px;
    height: 54px;
  }
  .emergency-pulse-shield svg {
    width: 28px;
    height: 28px;
  }
}

/* --- ÇOK DAR MOBİL EKRANLAR (<= 340px: Eski telefonlar, katlanabilir dış ekran) --- */
@media (max-width: 340px) {
  .app-header {
    padding: 8px 8px;
  }
  .app-brand span {
    display: none; /* Logo ikonu görünür kalır, taşma tamamen önlenir */
  }
  .app-icon-btn {
    width: 30px;
    height: 30px;
  }
  .app-hero-actions {
    flex-direction: column;
  }
  .result-action-strip > button {
    flex: 1 1 100%;
    min-width: 100%;
  }
}

/* --- TABLET VE MASAÜSTÜ EKRANLAR (>= 580px) --- */
@media (min-width: 580px) {
  body {
    background-color: #f1edf7;
  }
  .app-shell {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
  .app-header {
    border-radius: 0 0 16px 16px;
  }
  .result-action-strip > button {
    flex: 1 1 calc(25% - 8px);
    min-width: calc(25% - 8px);
  }
}

