/* ============================================
   RESTOCK - Web Frontend Styles
   iOS-inspired clean design, mobile-first
   ============================================ */

/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-padding-top: 56px;
  overscroll-behavior-y: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans',
    'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  background: #f5f5f7;
  color: #1c1c1e;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: none;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

input, textarea {
  font: inherit;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* === Header === */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid #e5e5ea;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  max-width: 1200px;
  margin: 0 auto;
}

.header-logo {
  display: flex;
  align-items: baseline;
  text-decoration: none;
}

.logo-re {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 300;
  color: #aaa;
  letter-spacing: -0.5px;
}

.logo-stock {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #1a1a1a;
  letter-spacing: -0.5px;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #1c1c1e;
  transition: background 0.2s;
}

/* Desktop header nav (hidden on mobile) */
.header-nav {
  display: none;
}

.header-nav-item {
  font-size: 14px;
  font-weight: 500;
  color: #8e8e93;
  padding: 8px 16px;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}

.header-nav-item:hover {
  color: #1c1c1e;
  background: #f5f5f7;
}

.header-nav-item.active {
  color: #1c1c1e;
  font-weight: 600;
}

.header-btn:active {
  background: #f0f0f0;
}

/* === Main Content === */
.app-content {
  padding-top: 52px;
  padding-bottom: 72px;
  min-height: 100dvh;
  min-height: 100vh; /* fallback for older browsers */
  max-width: 1200px;
  margin: 0 auto;
}
@supports (min-height: 100dvh) {
  .app-content { min-height: 100dvh; }
}

/* === Bottom Navigation === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #ffffff;
  border-top: 1px solid #e5e5ea;
  display: flex;
  justify-content: space-around;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  flex: 1;
  color: #8e8e93;
  font-size: 10px;
  font-weight: 500;
  transition: color 0.2s;
  gap: 2px;
}

.nav-item.active {
  color: #1c1c1e;
}

.nav-item svg {
  width: 24px;
  height: 24px;
}

.nav-item.active svg {
  stroke-width: 2.5;
}

.nav-item span {
  margin-top: 2px;
}

/* === Search Hero (B1: Card, compact) === */
.search-hero-outer {
  padding: 10px 12px 0;
}

.search-hero {
  padding: 20px 18px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.search-hero-tagline {
  font-size: 9px;
  font-weight: 600;
  color: #aeaeb2;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.search-hero-copy {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: #1c1c1e;
  margin-bottom: 12px;
}

.search-hero-stats {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
}

.search-hero-stat {
  flex: 1;
  text-align: center;
  border-right: 1px solid #f0f0f0;
}

.search-hero-stat:last-child {
  border-right: none;
}

.search-hero-stat-num {
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: #1c1c1e;
}

.search-hero-stat-num span {
  font-size: 12px;
  font-weight: 500;
  color: #aeaeb2;
}

.search-hero-stat-label {
  font-size: 10px;
  color: #aeaeb2;
  margin-top: 1px;
}

.search-hero-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-hero-input-container {
  flex: 1;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  padding: 0 12px;
  height: 42px;
  gap: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-hero-input-container:focus-within {
  border-color: #1c1c1e;
  box-shadow: 0 0 0 2px rgba(28,28,30,0.08);
}

.search-hero-input-container svg {
  flex-shrink: 0;
  color: #8e8e93;
  width: 16px;
  height: 16px;
}

.search-hero-input-container input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  height: 100%;
}

.search-hero-input-container input::placeholder {
  color: #aaa;
}

.search-hero-btn {
  flex-shrink: 0;
  height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  background: #1c1c1e;
  color: #ffffff;
  transition: opacity 0.2s;
}

.search-hero-btn:active {
  opacity: 0.7;
}

.search-hero-links {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.search-hero-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 4px;
  border-radius: 8px;
  background: #f5f5f7;
  font-size: 12px;
  font-weight: 600;
  color: #1c1c1e;
  text-decoration: none;
  transition: background 0.2s;
}

.search-hero-link:active {
  background: #e5e5ea;
}

.search-hero-link svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* AI Diagnosis & Gallery Section (mobile only, replaces carousel) */
.home-ai-section {
  display: flex;
  gap: 10px;
  margin: 10px 12px 6px;
}
.home-ai-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e5e5ea;
  text-decoration: none;
  color: #1c1c1e;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.home-ai-card:active {
  background: #f5f5f7;
}
.home-ai-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.home-ai-card-icon svg {
  width: 20px;
  height: 20px;
}
.home-ai-card-icon.ai-diagnosis {
  background: #f5f5f7;
  color: #1c1c1e;
}
.home-ai-card-icon.ai-gallery {
  background: #f5f5f7;
  color: #1c1c1e;
}
.home-ai-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.home-ai-card-title {
  font-size: 13px;
  font-weight: 700;
}
.home-ai-card-sub {
  font-size: 10px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 768px) {
  .home-ai-section { display: none !important; }
}

.search-quick-tags {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.search-quick-tags::-webkit-scrollbar {
  display: none;
}

.quick-tag {
  flex-shrink: 0;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  background: #ffffff;
  border: 1px solid #ddd;
  color: #555;
  transition: all 0.15s;
  cursor: pointer;
}

.quick-tag:hover {
  background: #1c1c1e;
  color: #ffffff;
  border-color: #1c1c1e;
}

.quick-tag:active {
  transform: scale(0.96);
}

/* === Accent Sections (between card rows) === */
.accent-cta {
  margin: 8px 16px;
  padding: 18px 20px;
  background: #1c1c1e;
  border-radius: 14px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: opacity 0.2s;
}
.accent-cta:active { opacity: 0.85; }
.accent-cta-text { font-size: 14px; font-weight: 600; line-height: 1.4; }
.accent-cta-sub { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 3px; }
.accent-cta-arrow {
  width: 32px; height: 32px; background: rgba(255,255,255,0.1);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-left: 12px;
}
.accent-cta-arrow svg { width: 16px; height: 16px; color: #fff; }

.accent-cta-light {
  margin: 8px 16px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: background 0.2s;
}
.accent-cta-light:active { background: #f9f9f9; }
.accent-cta-light-text { font-size: 14px; font-weight: 600; color: #1c1c1e; }
.accent-cta-light-sub { font-size: 11px; color: #8e8e93; margin-top: 2px; }
.accent-cta-light-arrow {
  width: 28px; height: 28px; background: #f5f5f7;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-left: 12px;
}
.accent-cta-light-arrow svg { width: 14px; height: 14px; color: #636366; }

/* Home CTA Banner (Register / Invite) */
.home-cta-banner {
  display: flex;
  align-items: center;
  margin: 4px 16px 12px;
  padding: 14px 16px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s;
}

.home-cta-banner:active {
  transform: scale(0.98);
}

.home-cta-register {
  background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
  color: #fff;
}

.home-cta-invite {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%);
  color: #fff;
}

.home-cta-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 12px;
}

.home-cta-banner-icon svg {
  width: 20px;
  height: 20px;
}

.home-cta-banner-body {
  flex: 1;
  min-width: 0;
}

.home-cta-banner-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

.home-cta-banner-sub {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 2px;
  line-height: 1.4;
}

.home-cta-banner-arrow {
  flex-shrink: 0;
  margin-left: 8px;
  opacity: 0.6;
}

.home-cta-banner-arrow svg {
  width: 18px;
  height: 18px;
}

/* PC: show after carousel, hide mobile one */
.home-cta-mobile { display: flex; }
.home-cta-pc { display: none; }
@media (min-width: 768px) {
  .home-cta-mobile { display: none !important; }
  .home-cta-pc { display: flex !important; }
}

.accent-brand {
  margin: 8px 16px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #eee;
}
.accent-brand-head {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.accent-brand-logo {
  width: 40px; height: 40px; border-radius: 10px;
  background: #1c1c1e; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Outfit', sans-serif; font-size: 16px; font-weight: 800;
  flex-shrink: 0;
}
.accent-brand-name { font-size: 14px; font-weight: 700; }
.accent-brand-desc { font-size: 11px; color: #8e8e93; margin-top: 2px; }
.accent-brand-items {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 0 24px 8px;
  max-width: 280px;
}
.accent-brand-thumb {
  aspect-ratio: 1/1; background: #f5f5f7;
  overflow: hidden;
  position: relative;
  border-radius: 6px;
}
.accent-brand-thumb img {
  width: 100%; height: 100%; object-fit: contain;
  display: block;
}
.accent-brand-source {
  position: absolute;
  bottom: 2px;
  left: 0;
  right: 0;
  font-size: 8px;
  color: #aeaeb2;
  text-align: center;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 2px;
}
.accent-brand-arrow {
  color: #c7c7cc;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* === Search Bar === */
.search-bar {
  padding: 12px 16px;
  position: sticky;
  top: 52px;
  z-index: 50;
  background: #f5f5f7;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  padding: 0 12px;
  height: 40px;
  gap: 8px;
}

.search-input-wrap svg {
  flex-shrink: 0;
  color: #8e8e93;
}

.search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  height: 100%;
}

.search-input-wrap input::placeholder {
  color: #8e8e93;
}

.search-clear-btn {
  display: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #c7c7cc;
  color: #fff;
  font-size: 12px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-clear-btn.visible {
  display: flex;
}

/* === Category Filter (horizontal scroll) === */
.category-filter {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-filter::-webkit-scrollbar {
  display: none;
}

.category-chip {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: #ffffff;
  border: 1px solid #e5e5ea;
  color: #636366;
  transition: all 0.2s;
  white-space: nowrap;
}

.category-chip.active {
  background: #1c1c1e;
  color: #ffffff;
  border-color: #1c1c1e;
}

/* === Sort Bar === */
.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
}

.sort-bar .result-count {
  font-size: 13px;
  color: #8e8e93;
}

.sort-select {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #e5e5ea;
  background: #ffffff;
  font-size: 13px;
  color: #1c1c1e;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

/* === Product Grid === */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px 16px;
}

.product-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eee;
  box-shadow: none;
  transition: transform 0.15s;
  cursor: pointer;
}

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

.product-card-image {
  position: relative;
  width: 100%;
  padding-top: 80%;
  max-height: 180px;
  background: #fff;
  overflow: hidden;
}

.product-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.product-card-source {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #ffffff;
  font-size: 10px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

.product-card-image .placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c7c7cc;
  background: #f5f5f7;
}

.product-card-image .placeholder svg {
  width: 40px;
  height: 40px;
}

.product-card-badges {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  gap: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.badge-sale {
  background: rgba(220, 38, 38, 0.9);
  color: #ffffff;
}

.badge-new {
  background: #1c1c1e;
  color: #ffffff;
}

.badge-shops {
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
}

.badge-pr {
  background: rgba(37, 99, 235, 0.9);
  color: #ffffff;
}

.badge-out-of-stock {
  background: #8e8e93;
  color: #ffffff;
}

.badge-sold {
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

.badge-unknown {
  background: rgba(142, 142, 147, 0.8);
  color: #ffffff;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
}

.product-card-info {
  padding: 10px 10px 12px;
}

.product-card-brand {
  font-size: 11px;
  color: #8e8e93;
  font-weight: 500;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-name {
  font-size: 13px;
  font-weight: 500;
  color: #1c1c1e;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
  min-height: 34px;
}

.product-card-price-area {
  border-top: 1px solid #f0f0f0;
  padding-top: 8px;
  margin-top: 2px;
}

.product-card-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.price-current {
  font-size: 15px;
  font-weight: 700;
  color: #1c1c1e;
}

.price-current.sale {
  color: #dc2626;
}

.price-original {
  font-size: 12px;
  color: #8e8e93;
  text-decoration: line-through;
}

.price-discount {
  font-size: 11px;
  font-weight: 600;
  color: #dc2626;
}

.product-card-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
}

.product-card-shop {
  font-size: 11px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.product-card-colors {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: #f0f0f0;
  color: #1c1c1e;
}

.product-card-shops-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: #f0f0f0;
  color: #555;
}

.price-lowest-label {
  font-size: 10px;
  font-weight: 700;
  color: #555;
  background: #f0f0f0;
  padding: 1px 5px;
  border-radius: 3px;
}

.product-card-shop-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  background: #636366;
  color: #ffffff;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.product-card-shop-link:active {
  opacity: 0.7;
}

/* === Loading === */
.loading-overlay {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  bottom: 0;
  background: #f5f5f7;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 90;
}

.loading-overlay.visible {
  display: flex;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e5ea;
  border-top-color: #1c1c1e;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.loading-more {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.loading-more .spinner {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

/* === Empty State === */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: #c7c7cc;
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 17px;
  font-weight: 600;
  color: #1c1c1e;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: #8e8e93;
  max-width: 280px;
}

.empty-state .btn {
  margin-top: 20px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  transition: opacity 0.2s;
  gap: 8px;
}

.btn:active {
  opacity: 0.7;
}

.btn-primary {
  background: #1c1c1e;
  color: #ffffff;
}

.btn-secondary {
  background: #f0f0f0;
  color: #1c1c1e;
}

.btn-outline {
  background: transparent;
  border: 1px solid #e5e5ea;
  color: #1c1c1e;
}

.btn-danger {
  background: #ef4444;
  color: #ffffff;
}

.btn-block {
  display: flex;
  width: 100%;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* === Toast === */
.toast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: #1c1c1e;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s ease;
  white-space: nowrap;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.error {
  background: #ef4444;
}

.toast.success {
  background: #10b981;
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 300;
}

.modal-overlay.visible {
  display: flex;
}

.modal-content {
  background: #ffffff;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px 20px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

.modal-handle {
  width: 36px;
  height: 5px;
  background: #e5e5ea;
  border-radius: 3px;
  margin: 0 auto 16px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 24px;
}

.modal-content .login-form {
  gap: 20px;
}

.modal-content .form-group {
  gap: 8px;
}

.modal-content .form-label {
  font-size: 14px;
}

/* === Brand List === */
.brand-list {
  padding: 0 16px;
}

.brand-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #ffffff;
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.15s;
}

.brand-card:active {
  transform: scale(0.98);
}

.brand-card-info {
  flex: 1;
  min-width: 0;
}

.brand-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #1c1c1e;
}

.brand-card-meta {
  font-size: 12px;
  color: #8e8e93;
  margin-top: 2px;
}

.brand-card-arrow {
  color: #c7c7cc;
  flex-shrink: 0;
  margin-left: 8px;
}

/* === Product Detail === */
.product-detail {
  padding-bottom: 80px;
}

.product-detail-image {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 360px;
  max-width: 360px;
  margin: 0 auto;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-detail-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.product-detail-source {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  font-size: 12px;
  line-height: 1.4;
  z-index: 2;
}

.product-detail-image .placeholder {
  color: #c7c7cc;
}

.product-detail-image .placeholder svg {
  width: 80px;
  height: 80px;
}

.product-detail-body {
  padding: 20px 16px;
}

.product-detail-brand {
  font-size: 13px;
  color: #8e8e93;
  font-weight: 500;
  margin-bottom: 6px;
}

.product-detail-name {
  font-size: 18px;
  font-weight: 600;
  color: #1c1c1e;
  line-height: 1.4;
  margin-bottom: 12px;
}

.product-detail-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.product-detail-price .price-current {
  font-size: 22px;
}

.product-detail-price .price-original {
  font-size: 15px;
}

.product-detail-price .price-discount {
  font-size: 13px;
  padding: 2px 8px;
  background: #fef2f2;
  border-radius: 4px;
}

.product-detail-stock {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

.stock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.stock-dot.in-stock {
  background: #10b981;
}

.stock-dot.out-of-stock {
  background: #ef4444;
}

.product-detail-shop {
  padding: 14px 16px;
  background: #f5f5f7;
  border-radius: 12px;
  margin-bottom: 16px;
}

.product-detail-shop-name {
  font-size: 14px;
  font-weight: 600;
  color: #1c1c1e;
  margin-bottom: 8px;
}

.product-detail-shop-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #636366;
}

.product-detail-shop-link svg {
  width: 14px;
  height: 14px;
}

/* Multi-shop prices */
.shop-prices-section {
  margin-bottom: 16px;
}

.shop-prices-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}

.shop-price-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #f5f5f7;
  border-radius: 10px;
  margin-bottom: 6px;
}

.shop-price-name {
  font-size: 14px;
  font-weight: 500;
}

.shop-price-value {
  font-size: 15px;
  font-weight: 700;
}

.shop-price-value.cheapest {
  color: #10b981;
}

.product-detail-actions {
  position: fixed;
  bottom: 72px;
  left: 0;
  right: 0;
  background: #ffffff;
  border-top: 1px solid #e5e5ea;
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  z-index: 90;
}

.product-detail-actions .btn {
  flex: 1;
}

.btn-favorite {
  width: 48px;
  flex: 0 0 48px !important;
  padding: 0;
}

.btn-favorite.active svg {
  fill: #ef4444;
  stroke: #ef4444;
}

/* === Login Page === */
.login-page {
  padding: 40px 16px;
}

.verify-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  background: #d1fae5;
  border-radius: 12px;
  margin-bottom: 24px;
  color: #065f46;
}

.verify-email-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 16px;
}

.login-tabs {
  display: flex;
  margin-bottom: 32px;
  border-bottom: 1px solid #e5e5ea;
}

.login-tab {
  flex: 1;
  padding: 12px 0;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #8e8e93;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.login-tab.active {
  color: #1c1c1e;
  border-bottom-color: #1c1c1e;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: #636366;
}

.form-input {
  padding: 12px 14px;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  font-size: 16px;
  background: #ffffff;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #1c1c1e;
}

.form-error {
  font-size: 14px;
  color: #ef4444;
  display: none;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 8px;
  margin-bottom: 4px;
}

.form-error.visible {
  display: block;
}

/* Social Login Buttons */
.social-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  background: #ffffff;
  font-size: 15px;
  font-weight: 500;
  color: #1c1c1e;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.social-login-btn:hover {
  background: #f5f5f7;
  border-color: #d1d1d6;
}

.social-login-btn-apple {
  background: #000000;
  color: #ffffff;
  border-color: #000000;
}

.social-login-btn-apple:hover {
  background: #1c1c1e;
  border-color: #1c1c1e;
}

/* === Settings Page === */
.settings-page {
  padding: 16px;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #8e8e93;
  text-transform: uppercase;
  padding: 0 4px;
  margin-bottom: 8px;
}

.settings-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.settings-item-label {
  font-size: 15px;
  color: #1c1c1e;
}

.settings-item-value {
  font-size: 14px;
  color: #8e8e93;
}

.settings-item-arrow {
  color: #c7c7cc;
}

/* Settings quick action grid */
.settings-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.settings-quick-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.settings-quick-card:active {
  transform: scale(0.97);
}

.settings-quick-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.settings-quick-label {
  font-size: 13px;
  font-weight: 600;
  color: #1c1c1e;
}

.settings-quick-count {
  font-size: 12px;
  color: #8e8e93;
}

/* User info card */
.user-info-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 16px;
  background: #ffffff;
  border-radius: 12px;
  margin-bottom: 24px;
}

.user-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #1c1c1e;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 22px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-info-text h3 {
  font-size: 17px;
  font-weight: 600;
  color: #1c1c1e;
}

.user-info-text p {
  font-size: 13px;
  color: #8e8e93;
  margin-top: 2px;
}

.user-plan-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.user-plan-badge.free {
  background: #f0f0f0;
  color: #636366;
}

.user-plan-badge.premium {
  background: #fef3c7;
  color: #b45309;
}

/* === Page Title === */
.page-title {
  font-size: 20px;
  font-weight: 700;
  padding: 20px 16px 16px;
  color: #1c1c1e;
}
.back-btn + .page-title {
  padding-top: 4px;
}

/* === Back Button === */
.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px 0;
  font-size: 15px;
  color: #1c1c1e;
}

.back-btn svg {
  width: 20px;
  height: 20px;
}

/* === Skeleton Loading === */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
}

.skeleton-image {
  width: 100%;
  padding-top: 80%;
}

.skeleton-text {
  height: 14px;
  margin: 10px;
}

.skeleton-text.short {
  width: 60%;
}

/* === Invite Page === */
.invite-page {
  padding: 0 16px 32px;
  text-align: center;
}

.invite-hero {
  background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
  border-radius: 16px;
  padding: 24px 20px;
  margin-bottom: 16px;
  color: #fff;
}

.invite-hero-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
}

.invite-hero-sub {
  font-size: 13px;
  color: #aeaeb2;
  margin-top: 6px;
  line-height: 1.5;
}

.invite-code-inline {
  margin-top: 16px;
}

.invite-code-inline .invite-code {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 5px;
  padding: 14px 16px;
  border-radius: 10px;
  margin: 0;
}

.invite-code-inline .invite-count {
  font-size: 12px;
  color: #aeaeb2;
  margin: 6px 0 0;
}

.invite-hero-btns {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.invite-hero-btns .btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 10px;
}

.invite-hero-btns .btn-primary {
  background: #10b981;
  border-color: #10b981;
}

.invite-share-btn {
  color: #fff !important;
  border-color: rgba(255,255,255,0.3) !important;
}

.invite-share-btn:hover {
  border-color: rgba(255,255,255,0.5) !important;
  background: rgba(255,255,255,0.08) !important;
}

.invite-benefits {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.invite-benefit-card {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  border: 1px solid #e5e5ea;
}

.invite-benefit-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.invite-benefit-badge--friend {
  background: #ecfdf5;
  color: #059669;
}

.invite-benefit-badge--you {
  background: #fffbeb;
  color: #d97706;
}

.invite-benefit-main {
  margin: 8px 0 10px;
}

.invite-benefit-highlight {
  font-size: 20px;
  font-weight: 800;
  color: #1c1c1e;
}

.invite-benefit-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.invite-benefit-list li {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 12px;
  color: #48484a;
  line-height: 1.4;
  padding: 3px 0;
}

.invite-benefit-list li svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.invite-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #f9fafb;
  border-radius: 12px;
  padding: 14px 12px;
}

.invite-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.invite-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #1c1c1e;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.invite-step-text {
  font-size: 11px;
  color: #48484a;
  line-height: 1.3;
  text-align: center;
}

.invite-step-arrow {
  flex-shrink: 0;
  margin-bottom: 14px;
}

/* === Utility === */
.text-center { text-align: center; }
.text-muted { color: #8e8e93; }
.text-sm { font-size: 13px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.p-16 { padding: 16px; }
.gap-8 { gap: 8px; }
.hidden { display: none !important; }

/* ============================================
   Quick Access Cards
   ============================================ */
.quick-access {
  display: flex;
  gap: 10px;
  padding: 16px 16px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.quick-access::-webkit-scrollbar {
  display: none;
}

.quick-card {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e5e5ea;
  min-width: 0;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

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

.quick-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-card-icon.new { background: #ecfdf5; color: #10b981; }
.quick-card-icon.sale { background: #fef2f2; color: #ef4444; }
.quick-card-icon.rank { background: #eff6ff; color: #3b82f6; }
.quick-card-icon.recommend { background: #faf5ff; color: #8b5cf6; }

.quick-card-text {
  min-width: 0;
}

.quick-card-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.quick-card-sub {
  font-size: 11px;
  color: #8e8e93;
  white-space: nowrap;
}

/* ============================================
   Section Header
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 12px;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
}

.section-more {
  font-size: 13px;
  font-weight: 500;
  color: #8e8e93;
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.section-more svg {
  width: 16px;
  height: 16px;
}

/* === Home Featured Section (Multi-shop highlight) === */
.home-featured-section .section-header {
  padding-bottom: 8px;
}
.home-featured-subtitle {
  padding: 0 16px 10px;
  font-size: 12px;
  color: #8e8e93;
  line-height: 1.4;
}

/* ============================================
   Horizontal Scroll Section
   ============================================ */
.h-scroll {
  display: flex;
  gap: 12px;
  padding: 0 16px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.h-scroll::-webkit-scrollbar {
  display: none;
}

.h-scroll .product-card {
  width: 150px;
  flex-shrink: 0;
}


.h-scroll-wrap {
  position: relative;
}

.h-scroll-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  border: 1px solid #e5e5ea;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: #1c1c1e;
  transition: opacity 0.2s;
}

.h-scroll-arrow:hover {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.h-scroll-arrow-left {
  left: 4px;
}

.h-scroll-arrow-right {
  right: 4px;
}

.h-scroll-arrow.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ============================================
   Collapsible Filter
   ============================================ */
.filter-collapse {
  padding: 0 16px;
}

.filter-toggle-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid #e5e5ea;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background 0.15s;
}

.filter-toggle-bar:active {
  background: #f5f5f7;
}

.filter-toggle-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #636366;
}

.filter-toggle-bar-left svg {
  color: #8e8e93;
}

.filter-toggle-bar .badge-count {
  font-size: 11px;
  font-weight: 600;
  background: #1c1c1e;
  color: #ffffff;
  padding: 1px 7px;
  border-radius: 10px;
}

.filter-toggle-bar-arrow {
  color: #c7c7cc;
  transition: transform 0.2s;
}

.filter-toggle-bar-arrow.open {
  transform: rotate(180deg);
}

.filter-panel {
  display: none;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e5e5ea;
  padding: 14px;
  margin-bottom: 12px;
}

.filter-panel.open {
  display: block;
}

.sp-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  flex-wrap: wrap;
}
@media (max-width: 767px) {
  .sp-filter-row { gap: 6px; }
  .sp-filter-row .filter-toggle { flex: 0 0 auto; gap: 5px; }
  .sp-filter-row .filter-toggle-slider { width: 34px; height: 20px; border-radius: 10px; }
  .sp-filter-row .filter-toggle-slider::after { width: 16px; height: 16px; }
  .sp-filter-row .filter-toggle input[type="checkbox"]:checked + .filter-toggle-slider::after { transform: translateX(14px); }
  .sp-filter-row .filter-toggle-label { font-size: 12px; }
  .sp-filter-row .price-range-inputs { flex: 1 1 100%; margin-top: 4px; }
  .sp-filter-row .filter-reset-btn { margin-left: auto; }
}
@media (min-width: 768px) {
  .sp-filter-row { flex-wrap: nowrap; }
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-row:last-child {
  margin-bottom: 0;
}

/* ============================================
   Page Divider
   ============================================ */
.page-divider {
  width: 100%;
  height: 8px;
  background: #f0f0f2;
}

/* ============================================
   Home Footer
   ============================================ */
.home-footer {
  margin-top: 40px;
  background: #1a1a1a;
  border-radius: 14px 14px 0 0;
  padding: 40px 32px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.footer-left .footer-logo {
  display: flex;
  align-items: baseline;
}

.footer-left .footer-logo .logo-re {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 300;
  color: #555;
  letter-spacing: -0.5px;
}

.footer-left .footer-logo .logo-stock {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.footer-desc {
  font-size: 11px;
  color: #555;
  margin-top: 10px;
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 40px;
}

.footer-col-title {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #666;
  font-weight: 600;
  margin-bottom: 12px;
  font-family: 'Outfit', sans-serif;
}

.footer-col a {
  display: block;
  font-size: 12px;
  color: #888;
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #ccc;
}

.home-footer-copy {
  font-size: 10px;
  color: #444;
  text-align: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #2a2a2a;
}

@media (max-width: 767px) {
  .home-footer {
    flex-direction: column;
    gap: 28px;
    padding: 32px 20px;
  }
  .footer-links {
    flex-direction: column;
    gap: 20px;
  }
}

/* ============================================
   Product Detail - Best/Sold shop card states
   ============================================ */
.pd-shop-card.best {
  border-color: #10b981;
  border-width: 2px;
}

.pd-shop-card.sold {
  opacity: 0.6;
}

.pd-best-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #ecfdf5;
  color: #10b981;
  font-size: 11px;
  font-weight: 700;
  border-radius: 0 0 8px 0;
}

/* ============================================
   Responsive Breakpoints (mobile-first)
   ============================================ */

/* --- Tablet (768px+) --- */
@media (min-width: 768px) {
  .header-inner {
    padding: 0 24px;
    height: 56px;
  }

  .header-logo .logo-re,
  .header-logo .logo-stock {
    font-size: 22px;
  }

  .header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 24px;
    flex: 1;
  }

  .header-icons {
    display: none;
  }

  .app-content {
    padding-top: 56px;
  }

  .search-bar {
    top: 56px;
    padding: 14px 24px;
  }

  .category-filter {
    padding: 0 24px 14px;
    gap: 10px;
  }

  .category-chip {
    padding: 7px 18px;
    font-size: 14px;
  }

  .sort-bar {
    padding: 0 24px 14px;
  }

  .sort-bar .result-count {
    font-size: 14px;
  }

  .sort-select {
    font-size: 14px;
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 0 24px 24px;
  }

  .product-card-info {
    padding: 12px;
  }

  .product-card-name {
    font-size: 14px;
  }

  .brand-list {
    padding: 0 24px;
  }

  .brand-card {
    padding: 16px 20px;
  }

  .brand-card-name {
    font-size: 16px;
  }

  .page-title {
    font-size: 20px;
    padding: 24px 24px 20px;
  }

  .back-btn {
    padding: 10px 24px 0;
  }

  .product-detail-body {
    padding: 24px;
  }

  .product-detail-name {
    font-size: 20px;
  }

  .product-detail-price .price-current {
    font-size: 24px;
  }

  .settings-page {
    padding: 24px;
  }

  .login-page {
    padding: 48px 24px;
    max-width: 480px;
    margin: 0 auto;
  }

  .invite-page {
    padding: 16px 24px 32px;
    max-width: 600px;
    margin: 0 auto;
  }

  .quick-access {
    padding: 20px 24px 8px;
    gap: 12px;
  }

  .quick-card {
    padding: 16px 22px;
  }

  .section-header {
    padding: 24px 24px 14px;
  }

  .h-scroll {
    padding: 0 24px 8px;
    gap: 14px;
  }

  .h-scroll .product-card {
    width: 170px;
  }

  .filter-collapse {
    padding: 0 24px;
  }

  .empty-state {
    padding: 80px 24px;
  }

  .modal-content {
    padding: 24px;
  }
}

/* --- Desktop (1024px+) --- */
@media (min-width: 1024px) {
  /* Header: show nav links, enlarge */
  .header-inner {
    height: 60px;
    padding: 0 32px;
  }

  .header-logo .logo-re,
  .header-logo .logo-stock {
    font-size: 24px;
  }

  .header-logo {
    flex-shrink: 0;
  }

  .header-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 32px;
    flex: 1;
  }

  .header-icons {
    display: none;
  }

  /* Hide bottom nav */
  .bottom-nav {
    display: none;
  }

  /* Main content: remove bottom padding, add side padding */
  .app-content {
    padding-top: 60px;
    padding-bottom: 24px;
    padding-left: 32px;
    padding-right: 32px;
  }

  /* Search hero (PC) */
  .search-hero-outer {
    padding: 12px 0 0;
  }
  .search-hero {
    padding: 24px 24px;
  }
  .search-hero-copy {
    font-size: 18px;
  }
  .search-hero-stat-num {
    font-size: 24px;
  }
  .search-hero-input-wrap {
    max-width: 520px;
  }
  .search-hero-input-container {
    height: 44px;
  }

  /* Accent sections (PC) */
  .accent-cta {
    margin: 12px 0;
    padding: 20px 28px;
  }
  .accent-cta-text { font-size: 16px; }
  .accent-cta-light {
    margin: 12px 0;
    padding: 18px 24px;
  }
  .accent-cta-light-text { font-size: 15px; }
  .accent-brand {
    margin: 12px 0;
    display: flex;
    border-radius: 14px;
  }
  .accent-brand-head {
    padding: 20px;
    flex-direction: column;
    align-items: flex-start;
    width: 200px;
    flex-shrink: 0;
    justify-content: center;
    gap: 8px;
  }
  .accent-brand-items {
    flex: 1;
  }
  .accent-brand-action {
    display: none;
  }
  .accent-brand-head .accent-brand-name {
    font-size: 16px;
  }

  /* Search bar */
  .search-bar {
    top: 60px;
    padding: 16px 0;
  }

  .search-input-wrap {
    max-width: 480px;
    height: 44px;
  }

  /* Category filter */
  .category-filter {
    padding: 0 0 16px;
    flex-wrap: wrap;
  }

  .category-chip {
    padding: 8px 20px;
    font-size: 14px;
    cursor: pointer;
  }

  .category-chip:hover {
    border-color: #1c1c1e;
    color: #1c1c1e;
  }

  /* Sort bar */
  .sort-bar {
    padding: 0 0 16px;
  }

  .sort-select {
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
  }

  /* Product grid: 4 columns */
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 0 24px;
  }

  /* Product card hover effects for desktop */
  .product-card {
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  }

  .product-card:active {
    transform: translateY(-1px);
  }

  .product-card-info {
    padding: 14px;
  }

  .product-card-brand {
    font-size: 12px;
  }

  .product-card-name {
    font-size: 14px;
    margin-bottom: 8px;
  }

  .price-current {
    font-size: 16px;
  }

  .product-card-shop {
    font-size: 12px;
  }

  /* Brand list: 2-column grid */
  .brand-list {
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .brand-card {
    margin-bottom: 0;
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .brand-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .brand-card:active {
    transform: translateY(0);
  }

  .brand-card-name {
    font-size: 16px;
  }

  .brand-card-meta {
    font-size: 13px;
  }

  /* Page title */
  .page-title {
    font-size: 20px;
    padding: 24px 0 16px;
  }

  .back-btn {
    padding: 12px 0 0;
  }

  /* Product detail: side-by-side image + info */
  .product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding-bottom: 24px;
  }

  .product-detail-image {
    aspect-ratio: 4 / 5;
    max-height: 400px;
    max-width: 400px;
    border-radius: 12px;
    margin: 24px;
    position: sticky;
    top: 84px;
    align-self: start;
  }

  .product-detail-body {
    padding: 24px 24px 24px 0;
  }

  .product-detail-name {
    font-size: 22px;
  }

  .product-detail-price .price-current {
    font-size: 26px;
  }

  .product-detail-price .price-original {
    font-size: 16px;
  }

  .product-detail-actions {
    position: static;
    border-top: none;
    padding: 24px 0 0;
    max-width: none;
  }

  /* Shop price items hover */
  .shop-price-item {
    transition: background 0.2s;
  }

  .shop-price-item:hover {
    background: #eeeef0;
  }

  /* Settings */
  .settings-page {
    padding: 0;
    max-width: none;
  }

  .settings-quick-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .settings-quick-card {
    padding: 20px 16px;
  }

  .settings-quick-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  }

  .user-info-card {
    padding: 24px 28px;
  }

  .settings-item {
    padding: 16px 20px;
    transition: background 0.2s;
  }

  .settings-item:hover {
    background: #fafafa;
  }

  /* Alerts */
  .alerts-page {
    max-width: none;
  }

  .alert-tabs {
    padding: 0;
  }

  .alert-settings-header {
    padding: 0 0 12px;
  }

  .alert-list, .alert-history-list {
    padding: 0;
  }

  .alert-history-header {
    padding: 0 0 12px;
  }

  .alert-item {
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .alert-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  }

  .alert-history-item {
    transition: transform 0.2s, box-shadow 0.2s;
  }

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

  /* Login */
  .login-page {
    padding: 60px 32px;
    max-width: 440px;
    margin: 0 auto;
  }

  .form-input {
    padding: 14px 16px;
  }

  /* Invite */
  .invite-page {
    max-width: 640px;
    padding: 24px 32px 32px;
    margin: 0 auto;
  }

  /* Modal: centered on desktop */
  .modal-overlay {
    align-items: center;
  }

  .modal-content {
    border-radius: 16px;
    max-width: 560px;
    max-height: 85vh;
    padding: 32px 36px;
  }

  .modal-content.modal-wide {
    max-width: 1260px;
    padding: 48px 350px;
  }

  .modal-content .modal-handle {
    display: none;
  }

  .modal-content .login-form {
    gap: 24px;
  }

  /* Toast */
  .toast {
    top: 68px;
  }

  /* Buttons: hover states */
  .btn-primary:hover {
    opacity: 0.9;
  }

  .btn-outline:hover {
    border-color: #1c1c1e;
  }

  .btn-secondary:hover {
    background: #e8e8e8;
  }

  .quick-access {
    padding: 24px 0 8px;
  }

  .section-header {
    padding: 28px 0 14px;
  }

  .h-scroll {
    padding: 0 0 8px;
  }

  .h-scroll .product-card {
    width: 190px;
  }

  .filter-collapse {
    padding: 0;
  }

  /* Login tab hover */
  .login-tab {
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
  }

  .login-tab:hover {
    color: #636366;
  }
}

/* --- Wide Desktop (1440px+) --- */
@media (min-width: 1440px) {
  .product-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .brand-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .article-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .article-detail-title {
    font-size: 28px;
  }

  .article-body {
    font-size: 16px;
  }

  .article-hero img {
    max-height: 280px;
  }
}

/* ============================================
   Article / Featured Page Styles
   ============================================ */
.article-page-title {
  font-size: 20px;
  font-weight: 700;
  padding: 16px 16px 0;
}

.article-page-sub {
  font-size: 13px;
  color: #8e8e93;
  padding: 0 16px 12px;
}

/* Article card grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  padding: 0 16px 24px;
}

.article-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.article-card-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f2f2f7;
}

.article-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c7c7cc;
}

.article-card-placeholder svg {
  width: 40px;
  height: 40px;
}

.article-card-body {
  padding: 12px;
}

.article-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.article-type-badge.brand_feature {
  background: #e8f5e9;
  color: #2e7d32;
}

.article-type-badge.theme_collection {
  background: #e3f2fd;
  color: #1565c0;
}

.article-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-summary {
  font-size: 12px;
  color: #636366;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.article-card-date {
  font-size: 11px;
  color: #aeaeb2;
}

/* Article detail */
.article-hero {
  width: 100%;
  overflow: hidden;
}

.article-hero img {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  display: block;
}

.article-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 0;
}

.article-detail-date {
  font-size: 13px;
  color: #8e8e93;
}

.article-detail-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  padding: 8px 16px 0;
}

.article-body {
  padding: 16px;
  font-size: 15px;
  line-height: 1.9;
  color: #333;
  letter-spacing: 0.02em;
  word-break: break-word;
}

.article-body p {
  margin-bottom: 16px;
}

.article-body h2, .article-body h3 {
  font-weight: 700;
  margin: 24px 0 12px;
}

.article-body h2 { font-size: 18px; }
.article-body h3 { font-size: 16px; }

/* Admin article form */
.admin-article-form {
  padding: 16px;
  max-width: 720px;
}

.admin-article-form .form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #636366;
  margin: 12px 0 4px;
}

.admin-article-form .form-input {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

.admin-article-form textarea.form-input {
  resize: vertical;
  font-family: monospace;
}

/* ============================================
   Hero Slider (Home top) - Full-width auto slide
   ============================================ */
/* ============================================
   Hero Slider - full-width band with cards
   ============================================ */
.hero-slider {
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  margin-top: 0;
  margin-bottom: 6px;
  padding: 16px 0;
  overflow: clip;
}

.hero-slider-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0 16px;
}
.hero-slider-track::-webkit-scrollbar { display: none; }

.hero-slide {
  flex: 0 0 75%;
  scroll-snap-align: start;
  height: 150px;
  border-radius: 10px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: flex-end;
}

.hero-slide-overlay {
  width: 100%;
  padding: 20px 14px 12px;
  background: linear-gradient(transparent 0%, rgba(0,0,0,0.65) 100%);
  color: #fff;
  border-radius: 0 0 10px 10px;
}

.hero-slide-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 2px 8px;
  border-radius: 10px;
  margin-bottom: 4px;
}

.hero-slide-title {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-slider-dots {
  display: flex;
  justify-content: center;
  gap: 5px;
  padding-top: 8px;
}

.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0,0,0,0.15);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}
.hero-dot.active {
  background: #1c1c1e;
  transform: scale(1.3);
}

.hero-arrow {
  display: none;
}

/* Mobile: hide hero slider */
@media (max-width: 767px) {
  .hero-slider { display: none !important; }
}

/* Desktop: show 2-3 cards + arrows */
@media (min-width: 768px) {
  .hero-slider { padding: 20px 0 16px; margin-bottom: 8px; position: relative; }
  .hero-slider-track { gap: 16px; padding: 0 32px; }
  .hero-slide { flex: 0 0 42%; height: 170px; border-radius: 12px; }
  .hero-slide-overlay { padding: 24px 16px 14px; }
  .hero-slide-title { font-size: 16px; }
  .hero-slider-dots { padding-top: 14px; gap: 6px; }
  .hero-dot { width: 7px; height: 7px; }
  .hero-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-60%);
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 1px 6px rgba(0,0,0,0.12);
    font-size: 22px;
    color: #1c1c1e;
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
  }
  .hero-arrow:hover {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  }
  .hero-arrow-left { left: 12px; }
  .hero-arrow-right { right: 12px; }
}
@media (min-width: 1100px) {
  .hero-slide { flex: 0 0 30%; }
}

/* Article detail page - white background */
.article-detail-page {
  background: #fff;
  margin: -16px -16px 0;
  padding: 16px 16px 32px;
  min-height: calc(100vh - 120px);
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans',
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Yu Gothic', sans-serif;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px 0;
}

/* Thumbnail upload */
.thumb-upload-area {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.thumb-upload-area input[type="file"] {
  font-size: 13px;
}
.thumb-preview {
  display: inline-block;
}
.thumb-preview img {
  max-width: 180px;
  max-height: 120px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #e5e5ea;
}

/* Quill editor in admin form */
.admin-article-form .quill-wrap {
  background: #fff;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  overflow: hidden;
  margin-top: 4px;
}
.admin-article-form .quill-wrap .ql-toolbar {
  border: none;
  border-bottom: 1px solid #e5e5ea;
  background: #f9f9fb;
}
.admin-article-form .quill-wrap .ql-container {
  border: none;
  min-height: 120px;
  font-size: 14px;
}
.admin-article-form .quill-wrap .ql-editor {
  min-height: 120px;
  line-height: 1.6;
}
.sec-row .quill-wrap .ql-container {
  min-height: 80px;
}
.sec-row .quill-wrap .ql-editor {
  min-height: 80px;
}

/* ============================================
   Product Detail - New (pd-* classes)
   Shop-grouped layout matching mobile app
   ============================================ */
.pd-container {
  padding: 0 16px 24px;
}

.pd-header {
  margin-bottom: 20px;
}

.pd-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pd-header-left {
  flex: 1;
  min-width: 0;
}

.pd-brand {
  font-size: 13px;
  color: #8e8e93;
  font-weight: 500;
  margin-bottom: 4px;
}

.pd-name {
  font-size: 18px;
  font-weight: 700;
  color: #1c1c1e;
  line-height: 1.4;
}

.pd-header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.pd-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f7;
  color: #636366;
  transition: background 0.2s;
}

.pd-action-btn:active {
  background: #e5e5ea;
}

.pd-action-btn.active {
  color: #ef4444;
}

.pd-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.pd-price {
  font-size: 22px;
  font-weight: 800;
  color: #1c1c1e;
}

.pd-price.sale {
  color: #ef4444;
}

.pd-price-original {
  font-size: 14px;
  color: #8e8e93;
  text-decoration: line-through;
}

.pd-discount {
  font-size: 12px;
  font-weight: 700;
  color: #ef4444;
  padding: 2px 8px;
  background: #fef2f2;
  border-radius: 4px;
}

/* Shop list section */
.pd-shops-section {
  margin-bottom: 20px;
}

.pd-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #1c1c1e;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f0f0f0;
}

.pd-shop-card {
  background: #ffffff;
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid #f0f0f0;
  overflow: hidden;
}

.pd-shop-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.pd-shop-row:active {
  background: #f9f9fb;
}

.pd-affiliate-note {
  display: block;
  font-size: 10px;
  color: #aaa;
  margin-top: 2px;
}

.pr-disclosure {
  font-size: 11px;
  color: #999;
  text-align: right;
  padding: 4px 16px 0;
}

/* Thumbnail (56px - copyright compliant) */
.pd-shop-thumb-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.pd-shop-thumb {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  object-fit: contain;
  background: #f5f5f7;
  padding: 4px;
}

.pd-shop-thumb-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c7c7cc;
}

.pd-shop-thumb-source {
  font-size: 9px;
  color: #8e8e93;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* Shop info (name + stock) */
.pd-shop-info {
  flex: 1;
  min-width: 0;
}

.pd-shop-name {
  font-size: 14px;
  font-weight: 600;
  color: #1c1c1e;
  margin-bottom: 4px;
}

.pd-stock {
  font-size: 12px;
  font-weight: 600;
}

.pd-stock.in-stock {
  color: #10b981;
}

.pd-stock.stock-unknown {
  color: #f59e0b;
}

.pd-stock.out-of-stock {
  color: #8e8e93;
}

/* Price (right side) */
.pd-shop-price-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pd-shop-price-value {
  font-size: 15px;
  font-weight: 700;
  color: #1c1c1e;
}

.pd-shop-price-value.lowest {
  color: #10b981;
}

.pd-lowest-label {
  font-size: 10px;
  font-weight: 700;
  color: #ffffff;
  background: #10b981;
  padding: 1px 6px;
  border-radius: 4px;
}

/* Variant chips (color/size per shop - inside shop card) */
.pd-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 14px 12px;
  border-top: 1px solid #f5f5f7;
}

.pd-variant-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #f5f5f7;
  border: 1px solid #e5e5ea;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}

.pd-variant-chip:active {
  background: #eeeef0;
}

.pd-variant-chip.sold-out {
  opacity: 0.5;
}

.pd-variant-text {
  font-size: 12px;
  color: #1c1c1e;
}

.pd-variant-text.sold-out {
  text-decoration: line-through;
  color: #8e8e93;
}

.pd-variant-x {
  font-size: 10px;
  color: #ef4444;
}

/* Description section */
.pd-section {
  margin-bottom: 20px;
}

.pd-description {
  font-size: 14px;
  color: #636366;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* --- Related PR Products (horizontal scroll) --- */

.pd-rel-card {
  flex: 0 0 140px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s;
}
.pd-rel-card:active { opacity: 0.85; }

.pd-rel-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
}
.pd-rel-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.pd-rel-img-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f7;
}

.pd-rel-sale-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(220,38,38,0.9);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
}
.pd-rel-sold-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
}

.pd-rel-info {
  padding: 8px;
}
.pd-rel-brand {
  font-size: 10px;
  color: #8e8e93;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pd-rel-name {
  font-size: 12px;
  color: #1c1c1e;
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 4px;
  min-height: 31px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pd-rel-price {
  font-size: 13px;
  font-weight: 700;
  color: #1c1c1e;
}
.pd-rel-price.sale {
  color: #dc2626;
}
.pd-rel-shop {
  font-size: 10px;
  color: #aeaeb2;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Product Detail Responsive: Tablet (768px+) --- */
@media (min-width: 768px) {
  .pd-container {
    padding: 0 24px 32px;
  }

  .pd-name {
    font-size: 20px;
  }

  .pd-price {
    font-size: 24px;
  }

  .pd-shop-thumb {
    width: 110px;
    height: 110px;
  }

  .pd-shop-thumb-placeholder {
    width: 110px;
    height: 110px;
  }

  .pd-shop-thumb-source {
    max-width: 110px;
  }

  .pd-rel-card {
    flex: 0 0 160px;
  }
}

/* --- Product Detail Responsive: Desktop (1024px+) --- */
@media (min-width: 1024px) {
  .pd-container {
    padding: 0 0 32px;
  }

  .pd-name {
    font-size: 22px;
  }

  .pd-price {
    font-size: 26px;
  }

  .pd-shop-card {
    transition: box-shadow 0.2s;
  }

  .pd-shop-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  .pd-shop-row:hover {
    background: #f9f9fb;
  }

  .pd-shop-thumb {
    width: 120px;
    height: 120px;
  }

  .pd-shop-thumb-placeholder {
    width: 120px;
    height: 120px;
  }

  .pd-shop-thumb-source {
    max-width: 120px;
  }

  .pd-variant-chip:hover {
    background: #eeeef0;
    border-color: #d1d1d6;
  }

  .pd-action-btn:hover {
    background: #eeeef0;
  }

  .pd-rel-card {
    flex: 0 0 170px;
  }
  .pd-rel-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  }
}

/* ============================================
   Brand Filter & Filter Bar
   ============================================ */

/* --- Filter Section --- */
.filter-section {
  padding: 0 16px 8px;
}

/* --- Brand Filter (horizontal scroll) --- */
.brand-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0;
}

.brand-filter::-webkit-scrollbar {
  display: none;
}

.brand-chip {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  background: #ffffff;
  border: 1px solid #e5e5ea;
  color: #636366;
  transition: all 0.2s;
  white-space: nowrap;
  cursor: pointer;
}

.brand-chip.active {
  background: #1c1c1e;
  color: #ffffff;
  border-color: #1c1c1e;
}

.brand-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  font-size: 14px;
  line-height: 1;
  color: #8e8e93;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.brand-chip.active .brand-chip-remove {
  color: rgba(255, 255, 255, 0.7);
}

.brand-chip-remove:hover {
  color: #ef4444;
}

.brand-chip-add {
  border-style: dashed;
  color: #8e8e93;
}

.brand-chip-add:hover {
  border-color: #1c1c1e;
  color: #1c1c1e;
}

/* Brand add modal list */
.brand-add-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 50vh;
  overflow-y: auto;
}

.brand-add-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  color: #1c1c1e;
  text-align: left;
  transition: background 0.15s;
}

.brand-add-item:hover {
  background: #f5f5f7;
}

.brand-add-item:active {
  background: #eeeef0;
}

.brand-add-plus {
  font-size: 18px;
  font-weight: 600;
  color: #10b981;
}

/* --- Filter Bar --- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

/* --- Filter Toggle --- */
.filter-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}

.filter-toggle input[type="checkbox"] {
  display: none;
}

.filter-toggle-slider {
  width: 40px;
  height: 22px;
  background: #e5e5ea;
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.filter-toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.filter-toggle input[type="checkbox"]:checked + .filter-toggle-slider {
  background: #1c1c1e;
}

.filter-toggle input[type="checkbox"]:checked + .filter-toggle-slider::after {
  transform: translateX(18px);
}

.filter-toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: #636366;
  white-space: nowrap;
}

/* --- Price Range --- */
.price-range {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.price-range-label {
  font-size: 13px;
  font-weight: 500;
  color: #636366;
  white-space: nowrap;
}

.price-range-inputs {
  display: flex;
  align-items: center;
  gap: 4px;
}

.price-range-inputs input[type="number"] {
  width: 80px;
  padding: 6px 8px;
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  font-size: 13px;
  background: #ffffff;
  outline: none;
  text-align: right;
  transition: border-color 0.2s;
  -moz-appearance: textfield;
}

.price-range-inputs input[type="number"]::-webkit-inner-spin-button,
.price-range-inputs input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.price-range-inputs input[type="number"]:focus {
  border-color: #1c1c1e;
}

.price-range-sep {
  font-size: 13px;
  color: #8e8e93;
}

/* --- Filter Reset Button --- */
.filter-reset-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  background: #f0f0f0;
  color: #636366;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.filter-reset-btn:hover {
  background: #e5e5ea;
  color: #1c1c1e;
}

.filter-reset-btn:active {
  opacity: 0.7;
}

/* --- Filter Responsive: Tablet --- */
@media (min-width: 768px) {
  .filter-section {
    padding: 0 24px 8px;
  }

  .brand-filter {
    gap: 10px;
  }

  .brand-chip {
    padding: 7px 18px;
    font-size: 14px;
  }

  .filter-bar {
    padding: 8px 24px 14px;
  }
}

/* --- Filter Responsive: Desktop --- */
@media (min-width: 1024px) {
  .filter-section {
    padding: 0 0 8px;
  }

  .brand-filter {
    flex-wrap: wrap;
  }

  .brand-chip {
    padding: 8px 20px;
    font-size: 14px;
  }

  .brand-chip:hover {
    border-color: #1c1c1e;
    color: #1c1c1e;
  }

  .brand-chip.active:hover {
    color: #ffffff;
  }

  .filter-bar {
    padding: 8px 0 16px;
    flex-wrap: wrap;
  }

  .price-range-inputs input[type="number"] {
    width: 100px;
  }
}

/* ============================================
   Shops Page (batch1)
   ============================================ */
.shop-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 0 16px 16px;
}

.shop-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: transform 0.15s;
  position: relative;
}

.shop-card:active {
  transform: scale(0.98);
}

.shop-card-header {
  margin-bottom: 8px;
}

.shop-card-name {
  font-size: 15px;
  font-weight: 600;
  color: #1c1c1e;
  display: flex;
  align-items: center;
  gap: 4px;
}

.shop-card-verified {
  flex-shrink: 0;
}

.shop-card-meta {
  font-size: 12px;
  color: #8e8e93;
  margin-top: 2px;
}

.shop-card-brands {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.shop-card-brand-chip {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: #f5f5f7;
  color: #636366;
}

.shop-card-brand-chip.more {
  background: #e5e5ea;
  color: #8e8e93;
}

.shop-card-desc {
  font-size: 13px;
  color: #636366;
  line-height: 1.4;
}

.shop-card-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #c7c7cc;
}

/* ============================================
   Shop Detail Page (batch1)
   ============================================ */
.shop-detail-header {
  padding: 0 16px 20px;
}

.shop-detail-name {
  font-size: 22px;
  font-weight: 700;
  color: #1c1c1e;
  margin-bottom: 8px;
}

.shop-detail-desc {
  font-size: 14px;
  color: #636366;
  line-height: 1.5;
  margin-bottom: 12px;
}

.shop-detail-address {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #8e8e93;
  margin-bottom: 12px;
}

.shop-detail-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shop-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #f5f5f7;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #1c1c1e;
  transition: background 0.2s;
}

.shop-detail-link:hover {
  background: #eeeef0;
}

.shop-detail-section {
  padding: 0 16px;
  margin-bottom: 12px;
}

.shop-detail-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #1c1c1e;
  margin-bottom: 10px;
}

.shop-detail-brand-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shop-detail-brand-chip {
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
  background: #f5f5f7;
  color: #1c1c1e;
  border: 1px solid #e5e5ea;
  cursor: pointer;
  transition: all 0.2s;
}

.shop-detail-brand-chip:hover {
  border-color: #1c1c1e;
}

/* ============================================
   Alerts Page (batch1)
   ============================================ */
.alerts-page {
  padding: 0 16px;
}

.alert-tabs {
  display: flex;
  padding: 0 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid #e5e5ea;
}

.alert-tab {
  flex: 1;
  padding: 12px 0;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #8e8e93;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
}

.alert-tab.active {
  color: #1c1c1e;
  border-bottom-color: #1c1c1e;
}

.alert-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
}

.alert-count-info {
  font-size: 13px;
  color: #8e8e93;
}

.alert-list {
  padding: 0 16px;
}

.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #ffffff;
  border-radius: 12px;
  margin-bottom: 8px;
}

.alert-item-info {
  flex: 1;
  min-width: 0;
}

.alert-item-type {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.alert-type-badge {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
}

.alert-type-new_arrival {
  background: #10b981;
}

.alert-type-restock {
  background: #3b82f6;
}

.alert-type-price_drop {
  background: #ef4444;
}

.alert-type-sale {
  background: #f59e0b;
}

.alert-paused {
  font-size: 11px;
  color: #8e8e93;
}

.alert-item-target {
  font-size: 14px;
  font-weight: 500;
  color: #1c1c1e;
}

.alert-item-meta {
  font-size: 12px;
  color: #8e8e93;
  margin-top: 2px;
}

.alert-delete-btn {
  flex-shrink: 0;
  color: #ef4444 !important;
  border-color: #fecaca !important;
}

/* Alert History */
.alert-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 12px;
}

.alert-unread-count {
  font-size: 13px;
  font-weight: 600;
  color: #ef4444;
}

.alert-history-list {
  padding: 0 16px;
}

.alert-history-item {
  position: relative;
  padding: 14px 16px;
  background: #ffffff;
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 0.15s;
}

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

.alert-history-item.unread {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}

.alert-history-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.alert-history-date {
  font-size: 12px;
  color: #8e8e93;
}

.alert-history-message {
  font-size: 14px;
  color: #1c1c1e;
  line-height: 1.4;
  margin-bottom: 4px;
}

.alert-history-product {
  font-size: 13px;
  color: #636366;
}

.alert-unread-dot {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3b82f6;
}

/* --- Shops/Alerts Responsive: Tablet (768px+) --- */
@media (min-width: 768px) {
  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 24px 24px;
  }

  .shop-card {
    padding: 16px 20px;
  }

  .shop-detail-header {
    padding: 0 24px 24px;
  }

  .shop-detail-section {
    padding: 0 24px;
  }

}

/* --- Shops/Alerts Responsive: Desktop (1024px+) --- */
@media (min-width: 1024px) {
  .shop-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 0 0 24px;
  }

  .shop-card {
    transition: transform 0.2s, box-shadow 0.2s;
  }

  .shop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .shop-card:active {
    transform: translateY(0);
  }

  .shop-detail-header {
    padding: 0 0 24px;
  }

  .shop-detail-section {
    padding: 0;
  }

  .alert-tab:hover {
    color: #636366;
  }
}

/* --- Shops Responsive: Wide Desktop (1440px+) --- */
@media (min-width: 1440px) {
  .shop-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   Plan Page (batch2)
   ============================================ */
.plan-page {
  padding: 0 16px 24px;
}

.plan-billing-toggle {
  display: flex;
  background: #f0f0f0;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 24px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

.plan-toggle-btn {
  flex: 1;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  color: #636366;
  transition: all 0.2s;
  position: relative;
}

.plan-toggle-btn.active {
  background: #ffffff;
  color: #1c1c1e;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.plan-toggle-discount {
  font-size: 10px;
  font-weight: 700;
  color: #ef4444;
  margin-left: 4px;
}

.plan-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plan-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px 20px;
  position: relative;
  border: 2px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.plan-card.current {
  border-color: #1c1c1e;
}

.plan-card.popular {
  border-color: #f59e0b;
}

.plan-card-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  padding: 2px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  background: #f59e0b;
  color: #ffffff;
}

.plan-card-badge.current-badge {
  background: #1c1c1e;
  left: 16px;
  right: auto;
}

.plan-card-name {
  font-size: 18px;
  font-weight: 700;
  color: #1c1c1e;
  margin-bottom: 12px;
}

.plan-card-price {
  margin-bottom: 4px;
}

.plan-price-amount {
  font-size: 28px;
  font-weight: 800;
  color: #1c1c1e;
}

.plan-price-period {
  font-size: 14px;
  color: #8e8e93;
  margin-left: 2px;
}

.plan-card-savings {
  font-size: 13px;
  font-weight: 600;
  color: #10b981;
  margin-bottom: 8px;
}

.plan-features {
  list-style: none;
  padding: 16px 0;
  border-top: 1px solid #f0f0f0;
  margin-top: 12px;
}

.plan-feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #1c1c1e;
  padding: 5px 0;
}

.plan-feature-item svg {
  flex-shrink: 0;
}

.plan-card-action {
  margin-top: 12px;
}

/* === Tweet Generator === */
.tweet-gen-card {
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.tweet-gen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.tweet-gen-chars {
  font-size: 12px;
  color: #8e8e93;
  font-family: 'Outfit', monospace;
}
.tweet-gen-text {
  background: #f5f5f7;
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0 0 12px;
  font-family: inherit;
  color: #1c1c1e;
  max-height: 300px;
  overflow-y: auto;
}
.tweet-gen-copy {
  width: 100%;
}

/* ============================================
   Search / Discover Page
   ============================================ */
.search-page {
  padding: 0;
  position: relative;
}

/* --- Search Sidebar (Mobile: Bottom Sheet) --- */
.search-sidebar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: #fff;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.12);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.search-sidebar.open {
  transform: translateY(0);
}

.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 199;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.search-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.sidebar-title {
  font-size: 16px;
  font-weight: 700;
  color: #1c1c1e;
}
.sidebar-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #636366;
  cursor: pointer;
  transition: background 0.15s;
  line-height: 1;
}
.sidebar-close-btn:active {
  background: #e5e5ea;
}

.sidebar-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
}
.sidebar-section {
  padding: 10px 20px;
}
.sidebar-label {
  font-size: 12px;
  font-weight: 600;
  color: #8e8e93;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.sidebar-search-wrap {
  display: flex;
  align-items: center;
  background: #f5f5f7;
  border-radius: 10px;
  padding: 0 12px;
  height: 40px;
  gap: 8px;
}
.sidebar-search-wrap svg {
  flex-shrink: 0;
  color: #8e8e93;
}
.sidebar-search-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  height: 100%;
}
.sidebar-search-wrap input::placeholder {
  color: #aaa;
}

.sidebar-categories {
  padding: 0 !important;
  flex-wrap: wrap;
}
.sidebar-toggles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-price-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e5e5ea;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  outline: none;
  transition: border-color 0.2s;
}
.sidebar-price-row input:focus {
  border-color: #1c1c1e;
}
.sidebar-brands {
  padding: 0 !important;
  flex-wrap: wrap;
}

.sidebar-footer {
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.sidebar-reset-btn {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #636366;
  background: #f5f5f7;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-reset-btn:active {
  background: #e5e5ea;
}

/* --- Search Topbar --- */
.search-topbar {
  position: sticky;
  top: 52px;
  z-index: 10;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
}
.filter-trigger-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #636366;
  cursor: pointer;
  transition: background 0.15s;
}
.filter-trigger-btn:active {
  background: #f5f5f7;
}
.filter-trigger-btn svg {
  color: #8e8e93;
}
.filter-trigger-btn .badge-count {
  font-size: 11px;
  font-weight: 600;
  background: #1c1c1e;
  color: #fff;
  padding: 1px 7px;
  border-radius: 10px;
}
.search-topbar .result-count {
  margin-left: auto;
  font-size: 13px;
  color: #8e8e93;
  white-space: nowrap;
}
.search-topbar .sort-select {
  flex-shrink: 0;
}

.search-quick {
  padding: 12px 0 16px;
}

.discover-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.discover-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 8px 16px;
  background: #fff;
  border-radius: 14px;
  text-align: center;
  transition: transform 0.15s;
}

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

.discover-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.discover-card-label {
  font-size: 14px;
  font-weight: 700;
  color: #1c1c1e;
  margin-top: 4px;
}

.discover-card-sub {
  font-size: 11px;
  color: #8e8e93;
}

.search-section-title {
  font-size: 16px;
  font-weight: 700;
  padding: 16px 0 12px;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.search-brand-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
}

.search-price-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-price-range .form-input {
  flex: 1;
  min-width: 0;
}

.search-price-sep {
  font-size: 14px;
  color: #8e8e93;
  flex-shrink: 0;
}

.search-toggles {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.search-results {
  margin-top: 8px;
}

/* ============================================
   Contact Page (batch2)
   ============================================ */
.contact-page {
  padding: 0 16px 24px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 16px;
}

.contact-success h3 {
  font-size: 20px;
  font-weight: 700;
  color: #1c1c1e;
  margin-top: 16px;
  margin-bottom: 8px;
}

.contact-success p {
  font-size: 14px;
  color: #8e8e93;
  line-height: 1.6;
}

/* ============================================
   Legal Pages (batch2)
   ============================================ */
.legal-page {
  background: #fff;
  margin: -16px -16px 0;
  padding: 16px 16px 32px;
  min-height: calc(100vh - 120px);
}

.legal-content {
  padding: 0 0 40px;
}

.legal-updated {
  font-size: 13px;
  color: #8e8e93;
  margin-bottom: 24px;
}

.legal-content h3 {
  font-size: 16px;
  font-weight: 700;
  color: #1c1c1e;
  margin-top: 24px;
  margin-bottom: 8px;
}

.legal-content p {
  font-size: 14px;
  color: #636366;
  line-height: 1.7;
  margin-bottom: 8px;
}

.legal-content ul {
  list-style: disc;
  padding-left: 20px;
  margin-bottom: 8px;
}

.legal-content li {
  font-size: 14px;
  color: #636366;
  line-height: 1.7;
  margin-bottom: 4px;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.legal-table th,
.legal-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e5e5ea;
  font-size: 14px;
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  font-weight: 600;
  color: #1c1c1e;
  width: 30%;
  white-space: nowrap;
  background: #f9f9fb;
}

.legal-table td {
  color: #636366;
  line-height: 1.6;
}

/* --- batch2 Responsive: Tablet (768px+) --- */
@media (min-width: 768px) {
  .plan-page {
    padding: 0 24px 32px;
  }

  .plan-cards {
    flex-direction: row;
    gap: 16px;
  }

  .plan-card {
    flex: 1;
    min-width: 0;
  }

  .contact-page {
    padding: 0 24px 32px;
    max-width: none;
  }

  .legal-content {
    padding: 0 24px 40px;
  }
}

/* --- batch2 Responsive: Desktop (1024px+) --- */
@media (min-width: 1024px) {
  .plan-page {
    padding: 0 0 32px;
  }

  .plan-cards {
    gap: 20px;
  }

  .plan-card {
    padding: 28px 24px;
  }

  .plan-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  }

  .contact-page {
    padding: 0 0 32px;
    max-width: none;
    margin: 0 auto;
  }

  .legal-content {
    padding: 0 0 40px;
  }

  .legal-table th {
    width: 25%;
  }
}

/* ============================================
   App Download Page
   ============================================ */
.app-download-page { padding: 24px 16px 60px; }
.app-dl-hero { text-align: center; padding: 40px 0 32px; }
.app-dl-icon { width: 80px; height: 80px; border-radius: 20px; background: #eef2ff; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.app-dl-title { font-size: 32px; font-weight: 800; letter-spacing: 4px; color: #1c1c1e; margin: 0; }
.app-dl-subtitle { font-size: 16px; color: #636366; margin-top: 12px; line-height: 1.6; }

.app-dl-features { display: flex; flex-direction: column; gap: 16px; margin-bottom: 32px; }
.app-dl-feature { background: #fff; border: 1px solid #e5e5ea; border-radius: 16px; padding: 20px; display: flex; align-items: flex-start; gap: 16px; }
.app-dl-feature-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.app-dl-feature h3 { font-size: 15px; font-weight: 600; margin: 0 0 4px; color: #1c1c1e; }
.app-dl-feature p { font-size: 13px; color: #636366; margin: 0; line-height: 1.5; }

.app-dl-stats { display: flex; justify-content: center; gap: 32px; padding: 24px 0; border-top: 1px solid #e5e5ea; border-bottom: 1px solid #e5e5ea; margin-bottom: 32px; }
.app-dl-stat { text-align: center; }
.app-dl-stat-num { display: block; font-size: 22px; font-weight: 700; color: #1c1c1e; }
.app-dl-stat-label { display: block; font-size: 12px; color: #8e8e93; margin-top: 2px; }

.app-dl-buttons { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.app-dl-store-btn { display: flex; align-items: center; gap: 10px; padding: 14px 28px; border-radius: 12px; border: 1px solid #e5e5ea; background: #f5f5f7; color: #8e8e93; font-size: 15px; font-weight: 500; cursor: not-allowed; width: 100%; max-width: 300px; justify-content: center; }
.app-dl-store-btn:not(:disabled) { background: #1c1c1e; color: #fff; cursor: pointer; border-color: #1c1c1e; }

.app-dl-back { color: #6366f1; text-decoration: none; font-size: 14px; font-weight: 500; }
.app-dl-back:hover { text-decoration: underline; }

/* ============================================
   Favorites Tabs
   ============================================ */
.fav-tabs { display: flex; gap: 4px; padding: 0 16px 12px; }
.fav-tab { flex: 1; padding: 10px; text-align: center; border-radius: 10px; background: transparent; border: 1px solid #e5e5ea; font-size: 14px; font-weight: 500; color: #636366; cursor: pointer; }
.fav-tab.active { background: #1c1c1e; color: #fff; border-color: #1c1c1e; }

/* ============================================
   Heart Button (Favorites)
   ============================================ */
.heart-btn { background: none; border: none; padding: 8px; cursor: pointer; color: #c7c7cc; transition: color 0.2s, transform 0.2s; flex-shrink: 0; }
.heart-btn:hover { color: #ef4444; }
.heart-btn.active { color: #ef4444; }
.heart-btn.active:active { transform: scale(1.2); }

/* ============================================
   Searchable Dropdown (Alert create)
   ============================================ */
.alert-picker { }
.alert-picker .search-input-wrap { margin-bottom: 0; }
.alert-picker-list {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #e5e5ea;
  border-radius: 10px;
  margin-top: 6px;
  background: #fff;
}
.alert-picker-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  background: none;
  border: none;
  border-bottom: 1px solid #f2f2f7;
  cursor: pointer;
  text-align: left;
  color: #1c1c1e;
}
.alert-picker-item:last-child { border-bottom: none; }
.alert-picker-item:hover { background: #f2f2f7; }
.alert-picker-item:active { background: #e5e5ea; }
.alert-picker-plus {
  margin-left: auto;
  font-size: 18px;
  font-weight: 600;
  color: #6366f1;
  flex-shrink: 0;
  padding-left: 8px;
}
.alert-picker-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: #4338ca;
}
.alert-picker-selected span { flex: 1; }
.alert-picker-selected .remove-btn {
  background: none;
  border: none;
  color: #8e8e93;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}

/* Confirm modal */
.confirm-modal { text-align: center; padding: 8px 0; }
.confirm-modal h3 { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.confirm-modal p { font-size: 14px; color: #636366; margin: 0 0 20px; }
.confirm-modal .confirm-btns { display: flex; gap: 12px; }
.confirm-modal .confirm-btns .btn { flex: 1; }

/* ── Ad Units ─────────────────────────── */
.ad-unit {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #f0f0f0;
  padding: 12px;
  margin: 16px 0;
  position: relative;
  min-height: 100px;
  overflow: hidden;
  text-align: center;
}
@media (max-width: 767px) {
  .ad-unit { min-height: 60px; padding: 8px; margin: 12px auto; max-width: 340px; }
}
.ad-label {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #8e8e93;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.ad-unit-infeed {
  margin: 0;
  padding: 10px;
  min-height: 80px;
}
.ad-card-infeed {
  cursor: default;
}
.ad-card-infeed:active {
  transform: none;
}

/* ── Interstitial Ad Overlay (pre-diagnosis) ── */
.ads-interstitial-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: adsFadeIn 0.3s ease;
}
@keyframes adsFadeIn { from { opacity: 0; } to { opacity: 1; } }

.ads-interstitial-content {
  background: #fff;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.ads-interstitial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: #f5f5f7;
  border-bottom: 1px solid #e5e5ea;
}
.ads-interstitial-label {
  font-size: 11px;
  font-weight: 700;
  color: #8e8e93;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.ads-interstitial-timer {
  font-size: 12px;
  font-weight: 600;
  color: #636366;
}
.ads-interstitial-ad {
  padding: 16px;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ads-interstitial-footer {
  padding: 12px 18px 16px;
  border-top: 1px solid #e5e5ea;
}
.ads-interstitial-progress {
  height: 3px;
  background: #e5e5ea;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}
.ads-interstitial-progress-bar {
  height: 100%;
  width: 0;
  background: #34C759;
  border-radius: 2px;
}
.ads-interstitial-skip {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: #f5f5f7;
  color: #8e8e93;
  font-size: 14px;
  font-weight: 600;
  cursor: not-allowed;
  transition: all 0.2s;
}
.ads-interstitial-skip:not(:disabled) {
  background: #1c1c1e;
  color: #fff;
  cursor: pointer;
}
.ads-interstitial-skip:not(:disabled):active {
  transform: scale(0.97);
}

/* ============================================
   Brand Shops Section (Affiliate)
   ============================================ */
.brand-shops-section {
  margin-top: 16px;
}
.brand-shops-title {
  font-size: 15px;
  font-weight: 600;
  color: #1c1c1e;
  margin-bottom: 10px;
}
.brand-shops-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.brand-shop-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 20px;
  font-size: 13px;
  color: #1c1c1e;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.brand-shop-chip:hover {
  background: #f0f0f5;
  border-color: #c7c7cc;
}
.brand-shop-chip:active {
  background: #e5e5ea;
}
.brand-shop-chip svg {
  color: #8e8e93;
  flex-shrink: 0;
}
.brand-shop-name {
  font-weight: 500;
}
.brand-shop-badge {
  font-size: 10px;
  color: #fff;
  background: #34c759;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
}
.brand-shop-external {
  border-style: dashed;
}
.brand-shop-external:hover {
  border-color: #007aff;
  color: #007aff;
}

/* ============================================
   Admin Dashboard v2
   ============================================ */
.admin-page {
  padding: 0 16px 24px;
}
.admin-header {
  padding: 16px 0 8px;
}
.admin-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}
/* Tabs */
.admin-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e5e5ea;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #8e8e93;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
}
.admin-tab.active {
  color: #007AFF;
  border-bottom-color: #007AFF;
}
.admin-tab:hover { color: #3a3a3c; }
/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.kpi-card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 12px;
  text-align: center;
  border: 1px solid #e5e5ea;
}
.kpi-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}
.kpi-label {
  font-size: 11px;
  color: #8e8e93;
  margin-top: 4px;
}
.kpi-delta {
  font-size: 10px;
  font-weight: 600;
  margin-left: 4px;
}
.kpi-delta.up { color: #34C759; }
.kpi-delta.down { color: #FF3B30; }
/* Bar Chart */
.chart-bar-wrap {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  border: 1px solid #e5e5ea;
}
.chart-bars {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 160px;
  gap: 8px;
}
.chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.chart-count {
  font-size: 11px;
  font-weight: 600;
  color: #3a3a3c;
  margin-bottom: 4px;
}
.chart-bar {
  width: 100%;
  max-width: 40px;
  background: linear-gradient(180deg, #007AFF, #5856D6);
  border-radius: 4px 4px 0 0;
  transition: height 0.3s;
}
.chart-date {
  font-size: 10px;
  color: #8e8e93;
  margin-top: 4px;
}
/* Toolbar */
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.admin-toolbar-left,
.admin-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-badge {
  font-size: 13px;
  font-weight: 600;
  color: #3a3a3c;
  background: #f2f2f7;
  padding: 4px 10px;
  border-radius: 8px;
}
.admin-filter, .admin-sort {
  font-size: 12px;
  padding: 5px 8px;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  background: #fff;
  color: #3a3a3c;
  cursor: pointer;
}
.admin-filter:focus, .admin-sort:focus {
  outline: none;
  border-color: #007AFF;
}
/* Section */
.admin-section {
  margin-bottom: 24px;
}
.admin-section-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #1c1c1e;
}
/* Table */
.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e5ea;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  padding: 10px 12px;
  background: #f9f9fb;
  font-weight: 600;
  color: #6e6e73;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
  border-bottom: 1px solid #e5e5ea;
  position: sticky;
  top: 0;
}
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f2f2f7;
  vertical-align: middle;
}
.admin-table tbody tr:hover { background: #f9f9fb; }
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table .mono {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 12px;
  color: #5856D6;
}
.td-num {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
/* Badges */
.badge-admin {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  background: #FF3B30;
  padding: 1px 5px;
  border-radius: 4px;
  vertical-align: middle;
}
.badge-plan {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
}
.badge-free { background: #f2f2f7; color: #8e8e93; }
.badge-pro { background: #007AFF20; color: #007AFF; }
.badge-premium { background: #FF950020; color: #FF9500; }
.badge-device {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.badge-mobile { background: #34C75920; color: #34C759; }
.badge-desktop { background: #007AFF20; color: #007AFF; }
.badge-bot { background: #8E8E9320; color: #8E8E93; }
/* User cell */
.user-cell { line-height: 1.3; }
.user-name { font-weight: 600; font-size: 13px; }
.user-email { font-size: 11px; color: #8e8e93; }
/* Tweet cards */
.tweet-type-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.tweet-type-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f2f2f7;
  color: #3a3a3c;
}
.type-new_arrival { background: #34C75920; color: #34C759; }
.type-sale { background: #FF3B3020; color: #FF3B30; }
.type-daily_summary { background: #007AFF20; color: #007AFF; }
.type-brand_spotlight { background: #AF52DE20; color: #AF52DE; }
.type-price_comparison { background: #FF950020; color: #FF9500; }
.type-sold_out_report { background: #8E8E9320; color: #6e6e73; }
.type-weekly_thread { background: #5856D620; color: #5856D6; }
.type-manual { background: #1c1c1e15; color: #1c1c1e; }
.tweet-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tweet-card {
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 12px;
  padding: 12px 14px;
}
.tweet-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.tweet-date {
  font-size: 11px;
  color: #8e8e93;
  margin-left: auto;
}
.tw-ok {
  font-size: 10px; font-weight: 700; color: #34C759;
  background: #34C75915; padding: 1px 6px; border-radius: 4px;
}
.tw-fail {
  font-size: 10px; font-weight: 700; color: #FF3B30;
  background: #FF3B3015; padding: 1px 6px; border-radius: 4px;
}
.tw-img {
  font-size: 10px; font-weight: 600; color: #007AFF;
  background: #007AFF15; padding: 1px 6px; border-radius: 4px;
}
.tweet-text {
  font-size: 13px;
  line-height: 1.5;
  color: #1c1c1e;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 120px;
  overflow: hidden;
}
.tweet-error {
  font-size: 12px;
  color: #FF3B30;
  margin-top: 6px;
  padding: 4px 8px;
  background: #FF3B3008;
  border-radius: 6px;
}
.tweet-link {
  display: inline-block;
  font-size: 12px;
  color: #1DA1F2;
  margin-top: 6px;
  text-decoration: none;
}
.tweet-link:hover { text-decoration: underline; }
/* Pagination */
.admin-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 8px 0;
}
.pg-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #d1d1d6;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pg-btn:disabled { opacity: 0.3; cursor: default; }
.pg-btn:not(:disabled):hover { background: #f2f2f7; }
.pg-info { font-size: 13px; color: #8e8e93; }
/* Loading */
.admin-loading {
  display: flex;
  justify-content: center;
  padding: 40px;
}
.admin-error {
  color: #FF3B30;
  padding: 20px;
  text-align: center;
  font-size: 14px;
}
/* Traffic source bar */
.traffic-bar {
  height: 8px;
  background: linear-gradient(90deg, #007AFF, #5AC8FA);
  border-radius: 4px;
  min-width: 2%;
  transition: width 0.3s ease;
}

/* === Product Search Modal === */
.psm-modal {
  max-height: 90vh;
  padding: 0 !important;
}
.psm-container {
  display: flex;
  flex-direction: column;
  height: 85vh;
  max-height: 85vh;
}
.psm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 0;
}
.psm-title {
  font-size: 18px;
  font-weight: 700;
}
.psm-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #8e8e93;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.psm-search {
  padding: 12px 20px;
  border-bottom: 1px solid #e5e5ea;
}
.psm-search .form-input {
  margin-bottom: 8px;
}
.psm-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}
.psm-filter-select {
  flex: 1;
  font-size: 13px !important;
  padding: 6px 8px !important;
}
.psm-check {
  font-size: 13px;
  white-space: nowrap;
  color: #636366;
  display: flex;
  align-items: center;
  gap: 4px;
}
.psm-selected-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: #f0f4ff;
  font-size: 13px;
  font-weight: 600;
  color: #1565c0;
  border-bottom: 1px solid #d0d8f0;
}
.psm-selected-bar .btn {
  margin-left: auto;
}
.psm-results {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}
.psm-hint {
  padding: 40px 20px;
  text-align: center;
  color: #8e8e93;
  font-size: 14px;
}
.psm-item {
  display: flex;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s;
  align-items: center;
}
.psm-item:hover {
  background: #f5f5f7;
}
.psm-item.selected {
  background: #e8f0fe;
}
.psm-item-img {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f5f5f7;
}
.psm-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.psm-item-noimg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #c7c7cc;
}
.psm-item-info {
  flex: 1;
  min-width: 0;
}
.psm-item-brand {
  font-size: 11px;
  font-weight: 600;
  color: #8e8e93;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.psm-item-name {
  font-size: 13px;
  font-weight: 500;
  color: #1c1c1e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.psm-item-meta {
  display: flex;
  gap: 8px;
  font-size: 12px;
  color: #636366;
  margin-top: 2px;
}
.psm-stock.in-stock { color: #34C759; }
.psm-stock.sold { color: #FF3B30; }
.psm-stock.unknown { color: #8e8e93; }
.psm-shop {
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}
.psm-item-check {
  width: 24px;
  height: 24px;
  border-radius: 12px;
  border: 2px solid #d1d1d6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #007AFF;
  flex-shrink: 0;
}
.psm-item.selected .psm-item-check {
  background: #007AFF;
  border-color: #007AFF;
  color: #fff;
}

/* ============================================
   Search Sidebar: Desktop (1024px+)
   ============================================ */
@media (min-width: 1024px) {
  .search-sidebar {
    position: fixed;
    top: 52px;
    left: 0;
    bottom: auto;
    right: auto;
    width: 280px;
    height: calc(100vh - 52px);
    transform: translateX(-100%);
    border-radius: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
    max-height: none;
    z-index: 200;
    transition: transform 0.3s ease;
  }
  .search-sidebar.open {
    transform: translateX(0);
  }
  .search-sidebar.collapsed {
    transform: translateX(-100%);
  }
  .search-overlay {
    display: block;
    z-index: 199;
  }
  .sidebar-footer {
    padding-bottom: 12px;
  }
  .sidebar-header {
    padding: 14px 16px 10px;
  }
  .sidebar-section {
    padding: 8px 16px;
  }
}

/* ============================================
   AI Fashion Diagnosis
   ============================================ */
.fashion-ai-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.fashion-ai-upload {
  aspect-ratio: 3/4;
  border: 2px dashed #d1d1d6;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  background: #f9f9fb;
  transition: border-color 0.2s, background 0.2s;
}
.fashion-ai-upload:hover { border-color: #007AFF; background: #f0f4ff; }
.fashion-ai-upload.dragover { border-color: #007AFF; background: #e8f0fe; }
.fashion-ai-upload.has-image { border-style: solid; border-color: #e5e5ea; }
.fashion-ai-upload-placeholder { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fashion-ai-upload img { width: 100%; height: 100%; object-fit: cover; }
.fashion-ai-options { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 600px) {
  .fashion-ai-form { grid-template-columns: 1fr; }
  .fashion-ai-upload { max-height: 300px; }
}

/* Score bars (thin, green only) */
.fashion-ai-score-bar { height: 4px; background: #f0f0f0; border-radius: 2px; overflow: hidden; }
.fashion-ai-score-fill { height: 100%; border-radius: 2px; background: #34C759; transition: width 0.6s ease; }

/* Result layout */
.fashion-ai-result { margin-top: 20px; }

/* ===== Fashion Diagnosis: Plan A Glass Morphism Hero ===== */
.fai-hero-glass {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 28px;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  min-height: 400px;
}
.fai-hero-glass-photo {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 60%, rgba(0,0,0,0));
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 60%, rgba(0,0,0,0));
}
.fai-hero-glass-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px;
  color: #fff;
}
.fai-score-ring {
  display: flex;
  align-items: center;
  gap: 20px;
}
.fai-score-circle {
  position: relative;
  width: 100px;
  height: 100px;
  flex-shrink: 0;
}
.fai-score-circle svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.fai-ring-bg { fill: none; stroke: rgba(255,255,255,0.15); stroke-width: 6; }
.fai-ring-fill { fill: none; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 283; transition: stroke-dashoffset 1.5s ease; }
.fai-ring-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  color: #fff;
}
.fai-ring-number span { font-size: 14px; font-weight: 600; opacity: 0.6; margin-left: 2px; }
.fai-ring-summary {
  font-size: 13px;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
}
@media (max-width: 480px) {
  .fai-hero-glass { border-radius: 0; margin-left: -16px; margin-right: -16px; }
  .fai-hero-glass-photo { height: 260px; }
  .fai-score-circle { width: 80px; height: 80px; }
  .fai-ring-number { font-size: 28px; }
}

/* ===== Fashion Diagnosis: Plan B Magazine Layout (legacy) ===== */
.fai-section { margin-bottom: 24px; }
.fai-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #8e8e93;
  margin-bottom: 12px;
  padding-left: 4px;
}

/* ─── Hero: Magazine layout (photo + text side by side) ─── */
.fai-hero-magazine {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 28px;
  background: #fff;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
}
.fai-hero-photo-wrap {
  position: relative;
  overflow: hidden;
  min-height: 340px;
}
.fai-hero-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fai-hero-score-badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.fai-badge-num { font-size: 24px; font-weight: 800; line-height: 1; color: #1c1c1e; }
.fai-badge-unit { font-size: 10px; color: #8e8e93; font-weight: 600; }
.fai-hero-text {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.fai-hero-eyecatch {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #34C759;
  margin-bottom: 12px;
}
.fai-hero-type {
  font-size: 22px;
  font-weight: 800;
  color: #1c1c1e;
  line-height: 1.3;
  margin-bottom: 8px;
}
.fai-hero-desc {
  font-size: 13px;
  color: #636366;
  line-height: 1.7;
  margin-bottom: 16px;
}
.fai-hero-score-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.fai-hero-big-score {
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.fai-big-num {
  font-size: 48px;
  font-weight: 800;
  color: #1c1c1e;
  line-height: 1;
}
.fai-big-unit { font-size: 16px; color: #8e8e93; font-weight: 600; }
.fai-hero-meta {
  font-size: 12px;
  color: #8e8e93;
  margin-top: 12px;
}

/* Mini scores (pill chips) */
.fai-mini-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fai-mini-score {
  padding: 5px 10px;
  border-radius: 20px;
  background: #f2f2f7;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  color: #3a3a3c;
}
.fai-ms-val {
  font-weight: 800;
  color: #34C759;
}

/* Mobile: stack vertically */
@media (max-width: 520px) {
  .fai-hero-magazine { grid-template-columns: 1fr; }
  .fai-hero-photo-wrap { min-height: 280px; max-height: 320px; }
  .fai-hero-text { padding: 20px; }
  .fai-big-num { font-size: 40px; }
}

/* ─── Glass card (Plan A style) ─── */
.fai-glass-card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.04);
}
.fai-card-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.fai-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.fai-icon-green { background: #E8F8ED; color: #34C759; }
.fai-icon-orange { background: #FFF3E0; color: #FF9500; }
.fai-icon-blue { background: #E3F2FD; color: #007AFF; }

/* ─── Strengths (Plan A vertical list) ─── */
.fai-strength-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f0faf2;
  border-radius: 12px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #1c1c1e;
  line-height: 1.5;
  transition: transform 0.15s;
}
.fai-strength-item:last-child { margin-bottom: 0; }
.fai-strength-item:hover { transform: translateX(4px); }
.fai-sc-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #34C759;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── Improvements (Plan A orange card) ─── */
.fai-glass-card.fai-improve-card {
  background: linear-gradient(135deg, #FFF8F0, #FFF3E0);
  border: 1px solid #FFE0B2;
}
.fai-improve-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  font-size: 14px;
  color: #3a3a3c;
  line-height: 1.5;
}
.fai-improve-item + .fai-improve-item {
  border-top: 1px solid #FFE0B2;
  margin-top: 4px;
  padding-top: 14px;
}
.fai-improve-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #FF9500;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── Score detail (Plan A 2-column grid) ─── */
.fai-score-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (max-width: 480px) { .fai-score-grid { grid-template-columns: 1fr; } }
.fai-score-card {
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 14px;
  padding: 16px;
  transition: box-shadow 0.2s;
}
.fai-score-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.fai-score-card:last-child:nth-child(odd) { grid-column: span 2; }
@media (max-width: 480px) { .fai-score-card:last-child:nth-child(odd) { grid-column: span 1; } }
.fai-sc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.fai-sc-label { font-size: 12px; font-weight: 700; color: #636366; }
.fai-sc-value { font-size: 24px; font-weight: 800; color: #1c1c1e; }
.fai-sc-bar { height: 4px; background: #f0f0f0; border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.fai-sc-bar-fill { height: 100%; border-radius: 2px; transition: width 0.8s ease; }
.fai-sc-bar-fill.high { background: linear-gradient(90deg, #34C759, #30D158); }
.fai-sc-bar-fill.mid { background: linear-gradient(90deg, #FFD60A, #FF9F0A); }
.fai-sc-bar-fill.low { background: linear-gradient(90deg, #FF6B6B, #FF3B30); }
.fai-sc-comment { font-size: 12px; color: #8e8e93; line-height: 1.4; }

/* ─── Tips section (glass card) ─── */
.fai-tip-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  font-size: 14px;
  color: #3a3a3c;
  line-height: 1.5;
  border-bottom: 1px solid #f0f0f0;
}
.fai-tip-item:last-child { border-bottom: none; }
.fai-tip-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #007AFF;
  flex-shrink: 0;
  margin-top: 7px;
}

/* ─── Style tags ─── */
.fai-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}
.fai-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 16px;
  background: #1c1c1e;
  color: #fff;
}
.fai-tag-sm {
  font-size: 10px !important;
  padding: 2px 8px !important;
}

/* ─── Products grid (3 columns) ─── */
.fai-products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 480px) { .fai-products-grid { grid-template-columns: repeat(2, 1fr); } }
.fai-products-grid .product-card { width: auto; }

/* ─── Products carousel (horizontal scroll + arrows) ─── */
.fai-products-carousel { position: relative; }
.fai-products-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0;
  scrollbar-width: none;
}
.fai-products-scroll::-webkit-scrollbar { display: none; }
.fai-products-scroll .product-card {
  flex-shrink: 0;
  width: 160px;
  scroll-snap-align: start;
}
.fai-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #e5e5ea;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 14px;
  color: #1c1c1e;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: box-shadow 0.15s;
}
.fai-carousel-arrow:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.fai-arrow-prev { left: -12px; }
.fai-arrow-next { right: -12px; }
@media (max-width: 480px) {
  .fai-arrow-prev { left: -6px; }
  .fai-arrow-next { right: -6px; }
}

/* ─── CTA button ─── */
.fai-cta-btn {
  display: block;
  width: 100%;
  padding: 16px;
  text-align: center;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: #1c1c1e;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.15s;
}
.fai-cta-btn:hover { background: #3a3a3c; }

/* ─── Actions (publish + share) ─── */
.fai-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #e5e5ea;
}
.fai-action-btn {
  padding: 10px 24px;
  border-radius: 10px;
  border: 1.5px solid #e5e5ea;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #1c1c1e;
}
.fai-action-btn:hover { border-color: #1c1c1e; }
.fai-action-btn.published { color: #8e8e93; border-color: #d1d1d6; cursor: default; }
.fai-unpub-btn { color: #FF3B30; border-color: #FF3B30; }
.fai-unpub-btn:hover { color: #FF3B30; border-color: #FF3B30; }

/* ─── Share menu modal ─── */
.fai-share-menu {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px 16px;
  max-width: 340px;
  margin: 0 auto;
  text-align: left;
}
.fai-share-menu-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
  color: #1c1c1e;
}
.fai-share-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 12px;
  border-radius: 10px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: #1c1c1e;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.fai-share-menu-item:hover { background: #f2f2f7; }
.fai-share-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.fai-share-x { background: #000; }
.fai-share-line { background: #06c755; }
.fai-share-clip { background: #636366; font-size: 18px; }
.fai-share-menu-close {
  display: block;
  width: 100%;
  padding: 12px;
  text-align: center;
  border: none;
  background: #f2f2f7;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #636366;
  cursor: pointer;
  margin-top: 12px;
}
.fai-share-menu-close:hover { background: #e5e5ea; }
.fai-share-preview {
  margin-bottom: 16px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e5ea;
}
.fai-share-preview img {
  width: 100%;
  height: auto;
  display: block;
}

/* ─── History grid ─── */
.fai-history-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fai-hist-card {
  display: flex;
  gap: 14px;
  background: #fff;
  border: 1px solid #e5e5ea;
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.fai-hist-card:hover {
  border-color: #007AFF;
  box-shadow: 0 2px 12px rgba(0,122,255,0.1);
}
.fai-hist-thumb {
  width: 72px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f5f5f7;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fai-hist-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fai-hist-no-img {
  display: flex;
  align-items: center;
  justify-content: center;
}
.fai-hist-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fai-hist-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fai-hist-score {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: #1c1c1e;
}
.fai-hist-date {
  font-size: 12px;
  color: #8e8e93;
  margin-left: auto;
}
.fai-hist-cond {
  font-size: 12px;
  color: #636366;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fai-hist-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* ─── Page layout ─── */
.fai-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 32px;
}
.fai-page-header {
  text-align: center;
  padding: 24px 0 16px;
}
.fai-page-title {
  font-size: 22px;
  font-weight: 800;
  color: #1c1c1e;
}
.fai-page-desc {
  font-size: 13px;
  color: #8e8e93;
  margin-top: 4px;
}
.fai-page-tabs {
  display: flex;
  gap: 0;
  background: #f0f0f0;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 20px;
}
.fai-ptab {
  flex: 1;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  border-radius: 8px;
  color: #636366;
  transition: background 0.2s, color 0.2s;
  border: none;
  background: none;
  cursor: pointer;
}
.fai-ptab.active {
  background: #fff;
  color: #1c1c1e;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.fai-form-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid #e5e5ea;
  padding: 20px;
}

/* ─── Analyzing animation ─── */
.fai-analyzing {
  text-align: center;
  padding: 48px 16px;
}
.fai-analyzing-spinner {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.fai-analyzing-text {
  font-size: 16px;
  font-weight: 700;
  color: #1c1c1e;
  margin-bottom: 6px;
}
.fai-analyzing-sub {
  font-size: 13px;
  color: #8e8e93;
}

/* ===== Gallery Page ===== */
.gal-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 32px;
}
.gal-page-header {
  text-align: center;
  padding: 24px 0 16px;
}
.gal-page-title {
  font-size: 22px;
  font-weight: 800;
  color: #1c1c1e;
}
.gal-page-desc {
  font-size: 13px;
  color: #8e8e93;
  margin-top: 4px;
}
.gal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.gal-tab {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  background: #f2f2f7;
  color: #636366;
  transition: background 0.2s, color 0.2s;
}
.gal-tab.active {
  background: #1c1c1e;
  color: #fff;
}

/* Gallery Grid */
.gal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 640px) { .gal-grid { grid-template-columns: repeat(3, 1fr); } }

/* Gallery Card */
.gal-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e5ea;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.gal-card:hover {
  border-color: #1c1c1e;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.gal-card-image {
  aspect-ratio: 3/4;
  overflow: hidden;
  position: relative;
  background: #f5f5f7;
}
.gal-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gal-card-no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gal-card-score {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 14px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
}
.gal-card-score { color: #1c1c1e; }
.gal-card-info {
  padding: 10px 12px;
}
.gal-card-type {
  font-size: 13px;
  font-weight: 700;
  color: #1c1c1e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.gal-card-tags {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}
.gal-card-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 11px;
  color: #8e8e93;
}
.gal-card-meta svg {
  vertical-align: -2px;
}
.gal-card-like, .gal-card-comment {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.gal-card-user {
  margin-left: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

/* Gallery Detail */
.gal-detail-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.gal-detail-user {
  font-size: 14px;
  font-weight: 600;
  color: #1c1c1e;
}
.gal-detail-date {
  font-size: 12px;
  color: #8e8e93;
}
.gal-detail-comment {
  font-size: 14px;
  color: #3a3a3c;
  padding: 12px 16px;
  background: #fafafa;
  border-radius: 12px;
  margin-bottom: 16px;
  line-height: 1.6;
}
.gal-detail-image {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #e5e5ea;
  margin-bottom: 16px;
  max-width: 400px;
}
.gal-detail-image img {
  width: 100%;
  display: block;
}

/* Gallery Actions (like + share + views) */
.gal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  margin: 16px 0;
}
.gal-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #8e8e93;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid #e5e5ea;
  background: #fff;
  transition: all 0.2s;
  cursor: pointer;
}
.gal-like-btn:hover {
  border-color: #FF3B30;
  color: #FF3B30;
}
.gal-like-btn.liked {
  color: #FF3B30;
  border-color: #FF3B30;
  background: #FFF0F0;
}
.gal-like-btn.liked svg {
  fill: #FF3B30;
  stroke: #FF3B30;
}
.gal-view-count {
  font-size: 12px;
  color: #aeaeb2;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* SNS Share links */
.gal-share-links {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.gal-share-x, .gal-share-line {
  flex: 1;
  text-align: center;
}

/* Gallery Comments */
.gal-comments {
  margin-top: 20px;
}
.gal-comments-title {
  font-size: 15px;
  font-weight: 700;
  color: #1c1c1e;
  margin-bottom: 12px;
}
.gal-comment {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}
.gal-comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.gal-comment-user {
  font-size: 13px;
  font-weight: 600;
  color: #1c1c1e;
}
.gal-comment-date {
  font-size: 11px;
  color: #aeaeb2;
}
.gal-comment-del {
  margin-left: auto;
  font-size: 16px;
  color: #c7c7cc;
  cursor: pointer;
  padding: 0 4px;
  border: none;
  background: none;
}
.gal-comment-del:hover {
  color: #FF3B30;
}
.gal-comment-body {
  font-size: 14px;
  color: #3a3a3c;
  line-height: 1.6;
}
.gal-comment-input {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  align-items: flex-end;
}
.gal-comment-input textarea {
  flex: 1;
  min-height: 60px;
  resize: vertical;
}
.gal-comment-input .btn {
  flex-shrink: 0;
}
