/* GooUzman UI — Apple/Stripe standard (Telegram WebApp ready) */

:root {
  --bg: #f9fafb;
  --card: #ffffff;
  --border: #f1f5f9;
  --text: #0f172a;
  --text-dim: #64748b;

  --accent: #0ea5e9;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --radius: 18px;
  --radius-sm: 14px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(900px 540px at 20% 0%, rgba(14, 165, 233, 0.10), transparent 55%),
    radial-gradient(760px 480px at 90% 100%, rgba(16, 185, 129, 0.08), transparent 55%),
    var(--bg);
  padding: var(--s-5);
  padding-bottom: 140px; /* layout safety: fixed bars */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

/* Helpers */
.hidden { display: none !important; }
.text-center { text-align: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.flex-align-center { display: flex; align-items: center; gap: var(--s-3); }
.mb-24 { margin-bottom: var(--s-5); }
.mb-12 { margin-bottom: var(--s-3); }
.mb-40 { margin-bottom: 40px; }
.mt-24 { margin-top: var(--s-5); }
.mt-12 { margin-top: var(--s-3); }
.mt-4 { margin-top: var(--s-1); }
.p-24 { padding: var(--s-5); }
.full-width { width: 100%; }
.text-gradient {
  background: linear-gradient(135deg, var(--accent), #22c1f3);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.text-success { color: var(--success); }
.text-error { color: var(--danger); }
.text-muted { color: var(--text-dim); }
.link-primary {
  color: var(--accent);
  text-decoration: none;
  font-weight: 800;
  word-break: break-all;
}
.link-primary:active { opacity: 0.85; }
.field-missing { color: var(--danger); font-weight: 900; }
.field-ok { color: var(--success); font-weight: 900; }
.paragraph { margin: 0; line-height: 1.6; }

/* Empty states */
.empty-state {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.02), rgba(15, 23, 42, 0.00));
  text-align: center;
}
.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(14, 165, 233, 0.16);
  background: rgba(14, 165, 233, 0.08);
  color: rgba(14, 165, 233, 0.95);
}
.empty-title {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: -0.01em;
}
.empty-desc {
  margin: 8px auto 0;
  max-width: 42ch;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.6;
}
.empty-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Icons (Lucide) */
.icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
svg.lucide {
  width: 18px;
  height: 18px;
  stroke-width: 2.25;
}

/* Layout */
.form-container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.content-wrapper {
  display: block;
  padding-bottom: 140px; /* extra safety on pages with fixed bars */
}

/* Card system */
.card-base,
.form-card,
.base-card,
.business-card,
.history-card,
.branch-card,
.seo-container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-card,
.base-card,
.seo-container {
  padding: var(--s-5);
}

.outline-card {
  border-color: rgba(14, 165, 233, 0.30);
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.06), rgba(14, 165, 233, 0.02));
}

.account-actions {
  margin-top: var(--s-6);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}

.header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.back-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 200ms var(--ease), background 200ms var(--ease);
}

.back-btn:active {
  transform: scale(0.98);
}

/* Section titles */
.section-title {
  margin: var(--s-6) 0 var(--s-3);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 800;
  color: rgba(100, 116, 139, 0.9);
}

/* Inputs */
.row { display: flex; gap: var(--s-3); }
.input-group { flex: 1; margin-bottom: 18px; }

.input-group label {
  display: block;
  margin-bottom: var(--s-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

.input-field {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text);
  font-size: 15px;
  outline: none;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.input-field:focus {
  border-color: rgba(14, 165, 233, 0.65);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

/* Buttons */
.main-btn {
  width: 100%;
  min-height: 48px;
  padding: 14px 16px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent) 0%, #22c1f3 55%, rgba(14, 165, 233, 0.92) 100%);
  background-size: 140% 140%;
  background-position: 0% 50%;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.18);
  transition: transform 200ms var(--ease), filter 200ms var(--ease), background-position 220ms var(--ease),
    box-shadow 220ms var(--ease);
}

.main-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14), 0 12px 28px rgba(14, 165, 233, 0.18);
}
.main-btn:hover { filter: brightness(1.02); }
.main-btn:active { transform: scale(0.98); }
.main-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.main-btn[aria-busy="true"] {
  cursor: progress;
  opacity: 0.9;
}

.main-btn[aria-busy="true"] .btn-spinner {
  display: inline-block;
}

.btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.95);
  animation: spin 900ms linear infinite;
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.16);
}

.btn-secondary {
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.22);
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.08);
}

.btn-add {
  border: 1px solid rgba(14, 165, 233, 0.22);
  background: rgba(14, 165, 233, 0.08);
  color: var(--accent);
  height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 200ms var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-add:active { transform: scale(0.98); }

/* Welcome */
.welcome-page {
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.welcome-container {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.welcome-hero {
  width: 100%;
  padding: var(--s-6) var(--s-5);
  text-align: center;
}

.welcome-mark {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  margin: 0 auto var(--s-4);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.20), rgba(16, 185, 129, 0.14));
  border: 1px solid rgba(14, 165, 233, 0.18);
  box-shadow: var(--shadow);
}

.welcome-title {
  margin: 0 0 var(--s-2);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.welcome-subtitle {
  margin: 0 auto var(--s-6);
  max-width: 30ch;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
  min-height: 22px;
}

.button-container {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

/* Profile header card */
.avatar-large {
  width: 64px;
  height: 64px;
  border-radius: 22px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 22px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #22c1f3);
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.20);
}

.user-name {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.user-role {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

/* Business cards */
.business-card {
  padding: var(--s-5);
  margin-bottom: var(--s-4);
  cursor: pointer;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease);
}

.business-card:active { transform: scale(0.99); }
.business-card:hover { border-color: rgba(14, 165, 233, 0.35); }

.business-card:hover .seo-header span:first-child { color: rgba(14, 165, 233, 0.9); }

.card-header-row { display: flex; justify-content: space-between; gap: var(--s-3); }
.business-info h3 { margin: 0 0 6px; font-size: 16px; font-weight: 900; }
.location-text { margin: 0; font-size: 13px; color: var(--text-dim); }

.rating-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 13px;
  color: #0f172a;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.18);
  white-space: nowrap;
}
.rating-badge.bg-green { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.18); }
.rating-badge.bg-yellow { background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.18); }
.rating-badge.bg-red { background: rgba(239, 68, 68, 0.10); border-color: rgba(239, 68, 68, 0.18); }

/* Progress */
.seo-mini-container { margin-top: var(--s-4); }
.seo-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--s-2); }
.seo-header span:first-child { font-size: 12px; font-weight: 800; color: rgba(100, 116, 139, 0.9); letter-spacing: 0.08em; text-transform: uppercase; }
.seo-value-text { font-size: 18px; font-weight: 900; }
.seo-value-text small { font-size: 12px; opacity: 0.75; }

.progress-bg {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  transition: width 1000ms var(--ease);
}

.bg-green { background: linear-gradient(90deg, #10b981, #34d399); }
.bg-yellow { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bg-red { background: linear-gradient(90deg, #ef4444, #f87171); }

.text-green { color: var(--success); }
.text-yellow { color: var(--warning); }
.text-red { color: var(--danger); }

/* Info rows */
.info-row {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: none; }

.info-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border);
}

.info-content small {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(100, 116, 139, 0.9);
  margin-bottom: 4px;
}
.info-content span {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

/* Loaders / status */
.status-msg { font-size: 13px; font-weight: 700; margin-top: 10px; color: var(--text-dim); }

.list-loader {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 3px solid rgba(100, 116, 139, 0.18);
  border-top-color: rgba(14, 165, 233, 0.9);
  margin: 18px auto;
  animation: spin 900ms linear infinite;
}

/* Skeleton loaders */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(241, 245, 249, 0.9);
  border-radius: 12px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.55),
    transparent
  );
  animation: shimmer 1200ms var(--ease) infinite;
}
@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.skeleton-line { height: 12px; border-radius: 999px; }
.skeleton-pill { height: 30px; border-radius: 999px; }
.skeleton-box { height: 44px; border-radius: 14px; }
.skeleton-stack { display: grid; gap: 12px; }
.w-20 { width: 20%; }
.w-30 { width: 30%; }
.w-40 { width: 40%; }
.w-55 { width: 55%; }
.w-60 { width: 60%; }
.w-70 { width: 70%; }
.w-85 { width: 85%; }
.w-95 { width: 95%; }

.card-title {
  margin: 0 0 var(--s-4);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

.flex-1 { flex: 1; }

.skeleton-progress {
  height: 10px;
  border-radius: 999px;
}
.skeleton-24 {
  width: 24px;
  height: 24px;
  border-radius: 8px;
}
.skeleton-44 {
  width: 44px;
  height: 44px;
  border-radius: 14px;
}
.skeleton-row {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
}

/* Hover-only refinements (desktop/web preview) */
@media (hover: hover) and (pointer: fine) {
  .main-btn:hover {
    background-position: 100% 50%;
    box-shadow: 0 14px 32px rgba(14, 165, 233, 0.22);
  }
  .btn-success:hover { box-shadow: 0 14px 32px rgba(16, 185, 129, 0.20); }
  .btn-secondary:hover { background: rgba(14, 165, 233, 0.04); border-color: rgba(14, 165, 233, 0.20); }
}

.loader {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: rgba(255, 255, 255, 0.95);
  animation: spin 900ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Bottom sheet */
.sheet-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 18px;
  background: rgba(2, 6, 23, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms var(--ease), visibility 220ms var(--ease);
  z-index: 1000;
}

.sheet-overlay.active {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  width: 100%;
  max-width: 520px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(241, 245, 249, 0.85);
  box-shadow: 0 28px 70px rgba(2, 6, 23, 0.34);
  padding: 18px 18px 20px;
  transform: translateY(14px);
  transition: transform 220ms var(--ease);
}

.sheet-overlay.active .bottom-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.25);
  margin: 2px auto 14px;
}

.info-sheet-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.01em;
}

.info-sheet-list {
  display: grid;
  gap: 10px;
}

.info-sheet-item {
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #ffffff;
  font-weight: 700;
}

/* Checkout bar */
.checkout-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(241, 245, 249, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  z-index: 900;
}

.checkout-bar-details .label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(100, 116, 139, 0.9);
}

.checkout-bar-details .price {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-top: 4px;
}

.checkout-summary {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid var(--border);
  display: grid;
  gap: 8px;
}

.checkout-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 700;
  color: rgba(15, 23, 42, 0.86);
}

.checkout-summary-row.accent {
  color: var(--accent);
  font-weight: 900;
}

.checkout-modal-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 900;
  color: var(--success);
}

.checkout-modal-actions {
  display: flex;
  gap: 12px;
}
.checkout-action-cancel { flex: 1; }
.checkout-action-confirm { flex: 2; }

.btn-cancel-small {
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  font-weight: 900;
  cursor: pointer;
}

.btn-compact {
  width: auto;
  min-height: 44px;
  padding: 12px 16px;
  margin: 0;
}

/* Branch cards */
.branch-card {
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.branch-selectable { cursor: pointer; }
.branch-icon { font-size: 20px; font-weight: 900; color: var(--success); }

.branch-card.active-branch { border-color: rgba(16, 185, 129, 0.35); }
.branch-card.pending-payment { border-color: rgba(245, 158, 11, 0.38); }
.branch-card.new-branch { border-color: rgba(14, 165, 233, 0.30); }

.branch-info { flex: 1; min-width: 0; }
.branch-title { font-weight: 900; font-size: 15px; color: var(--text); }
.branch-status { margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--text-dim); }
.branch-status.warning { color: var(--warning); }
.branch-status.danger { color: var(--danger); }
.branch-price { margin-top: 6px; font-weight: 900; color: var(--accent); font-size: 13px; }
.branch-price span { color: var(--text-dim); font-weight: 700; }

input[type="checkbox"] { display: none; }
.custom-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid rgba(14, 165, 233, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
}
.branch-checkbox:checked + .custom-checkbox {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.95);
}
.branch-checkbox:checked + .custom-checkbox::after {
  content: "✓";
  font-weight: 900;
  color: rgba(14, 165, 233, 0.95);
}

/* History (premium transaction list) */
.history-card {
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease);
}

.history-card:hover {
  border-color: rgba(14, 165, 233, 0.22);
}

.history-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.history-icon {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(14, 165, 233, 0.16);
  color: rgba(14, 165, 233, 0.95);
}

.history-details {
  min-width: 0;
}

.history-title {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-meta {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.history-meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(100, 116, 139, 0.55);
}

.history-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.history-amount {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--success);
  white-space: nowrap;
}

.history-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(14, 165, 233, 0.18);
  background: rgba(14, 165, 233, 0.06);
  color: rgba(14, 165, 233, 0.95);
  font-weight: 900;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}

.history-action:active {
  transform: scale(0.98);
}

@media (max-width: 520px) {
  .history-card { align-items: flex-start; }
  .history-right { padding-top: 2px; }
}

/* Footer */
.footer {
  width: 100%;
  max-width: 440px;
  margin: 16px auto 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.welcome-page .footer {
  margin-top: auto;
}

#footerMount {
  width: 100%;
}
.footer .copyright,
.footer .version {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}
.footer .copyright {
  line-height: 1.35;
}
.footer .version {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(241, 245, 249, 0.95);
  background: rgba(15, 23, 42, 0.03);
  color: rgba(100, 116, 139, 0.95);
}

/* Stat grid (business detail) */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-3);
  margin-bottom: var(--s-5);
}
.stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  text-align: center;
}
.stat-value {
  display: block;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: -0.01em;
}
.stat-label {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(100, 116, 139, 0.9);
}

/* Pricing badge */
.price-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.18);
  color: var(--success);
  font-weight: 900;
  white-space: nowrap;
}

/* Clickable rows */
.clickable-row { cursor: pointer; border-radius: 14px; }
.clickable-row:active { background: rgba(15, 23, 42, 0.03); }

/* Pricing rows (Uyelik) */
.pricing-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}
.pricing-row .info-content {
  flex: 1;
  min-width: 0;
}
.pricing-row .info-content span {
  font-weight: 900;
}
.pricing-row .price-badge {
  margin-left: auto;
}
@media (max-width: 360px) {
  .pricing-row {
    flex-wrap: wrap;
  }
  .pricing-row .price-badge {
    margin-left: 0;
    align-self: flex-end;
  }
}

/* Simple enter animation */
.slide-down { animation: slideDown 220ms var(--ease); }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  body { padding: 18px; padding-bottom: 140px; }
  .row { flex-direction: column; }
}

/* ------------------------------------
   Rakip Analizi Özel Şık Tasarımlar (GooUzman Supreme UI)
   ------------------------------------ */

body {
  background: #f8fafc;
  color: #0f172a;
}

.base-card {
  background: #ffffff;
  border: none;
  border-radius: 24px;
  box-shadow: 0 4px 24px -4px rgba(0,0,0,0.04);
}

.competitor-list-wrapper {
  background: transparent;
  border: none;
  box-shadow: none;
}

#competitorList {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rank-circle {
  width: 68px; height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 26px;
  box-shadow: inset 0 -4px 8px rgba(0,0,0,0.2), 0 8px 20px rgba(14, 165, 233, 0.3);
  position: relative;
  z-index: 1;
}

.rank-circle::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  opacity: 0.15;
  z-index: -1;
}

.rank-out { 
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%); 
  font-size: 16px; 
  box-shadow: inset 0 -4px 8px rgba(0,0,0,0.2), 0 4px 15px rgba(100, 116, 139, 0.2);
}

.rank-out::before {
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

.stat-card-premium {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: #ffffff;
  border-radius: 24px;
  border: none;
  box-shadow: 0 4px 24px -4px rgba(0,0,0,0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.stat-icon-wrapper {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
.stat-icon-wrapper.blue {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
  color: var(--accent, #0ea5e9);
}
.stat-icon-wrapper.green {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
  color: #10b981;
}

.stat-details small {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 4px;
}
.stat-details h4 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.competitor-item {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; 
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 4px 24px -4px rgba(0,0,0,0.04);
  border: 1px solid #f1f5f9;
  transition: all 0.2s ease;
}

.competitor-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.competitor-rank {
  width: 36px; height: 36px;
  border-radius: 12px;
  background: #f1f5f9;
  border: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: #0f172a;
}

.competitor-info { flex: 1; }
.competitor-name { font-weight: 700; font-size: 15px; color: #0f172a; margin-bottom: 4px; line-height: 1.3; }
.competitor-stats { font-size: 13px; color: #64748b; display: flex; gap: 8px; align-items: center; font-weight: 600; }

.star-rating { 
  color: #f59e0b; display: flex; align-items: center; gap: 4px; font-weight: 800;
  background: rgba(245, 158, 11, 0.1); padding: 2px 8px; border-radius: 6px;
}

.is-me { 
  background: #ffffff !important;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.15), 0 4px 24px -4px rgba(0,0,0,0.04) !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  position: relative;
  overflow: hidden;
}

.is-me::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #10b981, #059669);
}

.is-me .competitor-name { color: #059669; }

.badge-you {
  background: linear-gradient(135deg, #fbbf24 0%, #10b981 100%);
  color: white; padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 800;
  letter-spacing: 0.5px; box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon .input-icon { position: absolute; left: 16px; color: #0ea5e9; pointer-events: none; }
.main-input.with-icon {
  width: 100%;
  padding: 16px 16px 16px 48px;
  height: 56px;
  border-radius: 24px;
  border: 1px solid rgba(14, 165, 233, 0.3);
  background: #ffffff;
  font-size: 15px; font-weight: 700; color: #0f172a;
  transition: all 0.2s ease;
  appearance: none; cursor: pointer;
  box-shadow: 0 4px 24px -4px rgba(0,0,0,0.04);
}
.main-input.with-icon:focus {
  outline: none; border-color: #0ea5e9;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}

/* Global Loader */
#global-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#global-loader.hidden-loader {
    opacity: 0;
    visibility: hidden;
}

.loader-pin {
    width: 48px;
    height: 48px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230ea5e9' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z'/%3E%3Ccircle cx='12' cy='10' r='3' fill='%23ffffff'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    animation: bounce 1s infinite;
    position: relative;
    z-index: 2;
}

.loader-pulse {
    position: absolute;
    width: 40px;
    height: 12px;
    background: rgba(14, 165, 233, 0.4);
    border-radius: 50%;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    animation: pulse-shadow 1s infinite;
    filter: blur(4px);
    z-index: 1;
}

.loader-text {
    margin-top: 24px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: -0.01em;
    animation: pulse-text 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse-shadow {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.4; }
    50% { transform: translateX(-50%) scale(0.6); opacity: 0.2; }
}

@keyframes pulse-text {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
