.app-body { background: #f3f7ff; }

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.app-bar {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.app-bar .wordmark { font-size: 28px; }
.bar-right { display: flex; align-items: center; gap: 8px; position: relative; }
.like-counter {
  display: inline-flex; align-items: center; gap: 5px;
  color: #e0245e; font-weight: 700; font-size: 14px;
  background: #fff; border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 999px;
  font-family: inherit; cursor: pointer;
}
.like-counter:hover { border-color: #e0245e; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-family: inherit; font-weight: 600; font-size: 14px;
  padding: 9px 16px; border-radius: 999px; cursor: pointer;
}
.filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-count {
  background: var(--brand); color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}
.app-sub { max-width: 520px; margin: 0 auto; padding: 4px 18px 14px; }
.app-sub h1 { font-size: 20px; letter-spacing: -.5px; }
.app-sub p { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* Feed — single column, scroll down */
.feed { max-width: 520px; margin: 0 auto; padding: 16px 18px 60px; display: flex; flex-direction: column; gap: 22px; }
.loading, .empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* Swipe card */
.swipe-card {
  position: relative;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(12,19,34,.08);
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
  will-change: transform;
}
.swipe-card.gone { transition: transform .35s ease, opacity .35s ease; }
.sc-imgwrap {
  position: relative;
  aspect-ratio: 4/5;
  background: linear-gradient(135deg,#e3edff,#e6f6ff);
}
.sc-imgwrap img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.sc-noimg { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:#9bb0d6; font-size:13px; }
.sc-brand-tag {
  position: absolute; top: 12px; left: 12px;
  background: rgba(255,255,255,.92); color: var(--ink);
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
  padding: 4px 10px; border-radius: 8px;
}
.sc-sale {
  position: absolute; top: 12px; right: 12px;
  background: #0B4FE3; color: #fff; font-size: 12px; font-weight: 700;
  padding: 4px 9px; border-radius: 8px;
}
/* swipe stamps */
.stamp {
  position: absolute; top: 18px; font-size: 26px; font-weight: 800;
  padding: 6px 14px; border-radius: 10px; border: 3px solid; opacity: 0;
  transform: rotate(-12deg); transition: opacity .08s;
  letter-spacing: 1px; pointer-events: none;
}
.stamp.like { left: 18px; color: #16a34a; border-color: #16a34a; transform: rotate(-12deg); }
.stamp.nope { right: 18px; color: #e0245e; border-color: #e0245e; transform: rotate(12deg); }

.sc-info { padding: 14px 16px 16px; }
.sc-info .brand { font-size: 12px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .3px; }
.sc-info .title { font-size: 16px; color: #1b2336; margin-top: 3px; line-height: 1.35; }
.sc-info .prow { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.sc-info .price { font-size: 18px; font-weight: 700; }
.sc-info .orig { font-size: 13px; color: #9aa6bd; text-decoration: line-through; }
.sc-meta { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11px; color: #59667f; background: #eef3fb; padding: 3px 9px; border-radius: 999px; text-transform: capitalize; }

/* Action bar */
.sc-actions { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 0 16px 16px; }
.act {
  width: 56px; height: 56px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(12,19,34,.12); transition: transform .12s ease;
}
.act:hover { transform: translateY(-2px); }
/* Default = outlined; active (card tagged) = filled. */
.act.dislike { background: #fff; color: #e0245e; }
.act.view { width: 46px; height: 46px; font-size: 18px; background: #fff; color: var(--brand); }
.act.like { background: #fff; color: #16a34a; }
.swipe-card.liked .act.like { background: #16a34a; color: #fff; }
.swipe-card.disliked .act.dislike { background: #e0245e; color: #fff; }

/* State chips in the info row (shown only when the card is tagged). */
.state-like, .state-dislike { display: none; }
.swipe-card.liked .state-like { display: inline-flex; background: #dcfce7; color: #15803d; }
.swipe-card.disliked .state-dislike { display: inline-flex; background: #fde7ee; color: #be123c; }
/* Coloured glow on tagged cards. The ring itself is an overlay (.liked::after /
   .disliked::after below) so the product image can't cover it on the top/sides. */
.swipe-card.liked { box-shadow: 0 10px 30px rgba(22,163,74,.16); }
.swipe-card.disliked { box-shadow: 0 10px 30px rgba(224,36,94,.16); }

/* Full-card ring drawn on top of everything (image included), following the
   card's rounded corners. pointer-events:none so it never blocks taps. */
.swipe-card.liked::after, .swipe-card.disliked::after,
.grid-card.liked::after, .grid-card.disliked::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  pointer-events: none; z-index: 6;
}
.swipe-card.liked::after, .grid-card.liked::after { box-shadow: inset 0 0 0 2.5px #16a34a; }
.swipe-card.disliked::after, .grid-card.disliked::after { box-shadow: inset 0 0 0 2.5px #e0245e; }

/* Filter sheet */
[hidden] { display: none !important; }
.overlay { position: fixed; inset: 0; background: rgba(12,19,34,.45); z-index: 40; }
.sheet {
  position: fixed; z-index: 50; right: 0; top: 0; bottom: 0;
  width: min(380px, 92vw); background: #fff;
  display: flex; flex-direction: column;
  box-shadow: -16px 0 40px rgba(12,19,34,.18); animation: slideIn .18s ease;
}
@keyframes slideIn { from { transform: translateX(100%);} to { transform: translateX(0);} }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 8px; }
.sheet-head strong { font-size: 18px; }
.reset { border: none; background: none; color: var(--muted); font-family: inherit; font-size: 14px; cursor: pointer; }
.reset:hover { color: var(--ink); }
.sheet-body { flex: 1; overflow-y: auto; padding: 8px 20px 20px; }
.sheet-body section { margin-top: 18px; }
.sheet-body h3 { font-size: 13px; font-weight: 700; color: #2b3550; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 14px; font-size: 13px; font-family: inherit; color: #2b3550;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px; text-transform: capitalize;
}
.chip:hover { border-color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.chip .swatch { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.apply {
  margin: 0 20px 20px; background: var(--grad); color: #fff; border: none;
  border-radius: 12px; padding: 14px; font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.apply:hover { box-shadow: 0 10px 24px rgba(11,79,227,.28); }

.hint { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 0 0; }

/* ===== Auth gate (mandatory login wall) ===== */
.auth-gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1000px 560px at 50% -10%, rgba(34,184,255,.16), transparent 60%),
    radial-gradient(800px 500px at 100% 110%, rgba(11,79,227,.14), transparent 55%),
    #f3f7ff;
}
.auth-card {
  width: 100%; max-width: 400px;
  background: #fff; border: 1px solid var(--line); border-radius: 22px;
  padding: 36px 28px; text-align: center;
  box-shadow: 0 24px 60px rgba(12,19,34,.12);
}
.auth-logo { font-size: 40px; display: inline-block; margin-bottom: 18px; }
.auth-card h2 { font-size: 22px; letter-spacing: -.5px; line-height: 1.15; }
.auth-card > p { color: var(--muted); font-size: 15px; margin: 12px 0 24px; line-height: 1.5; }
.google-btn {
  width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff; color: #1f2330;
  border: 1px solid #dadce0; border-radius: 12px;
  padding: 13px 18px; font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: box-shadow .15s ease, border-color .15s ease;
}
.google-btn:hover { box-shadow: 0 4px 14px rgba(12,19,34,.12); border-color: #c9ccd1; }
.google-btn:disabled { opacity: .6; cursor: default; }
.auth-error { color: #e0245e; font-size: 13px; margin-top: 12px; }
.auth-fine { color: #9aa6bd; font-size: 12px; margin-top: 18px; line-height: 1.5; }
.auth-fine a { color: var(--brand); }

/* ===== User button + menu ===== */
.user-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--grad);
  background-size: cover; background-position: center;
  color: #fff; font-family: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.user-menu {
  position: absolute; top: 46px; right: 0; z-index: 40;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(12,19,34,.16);
  padding: 12px; min-width: 200px;
}
.um-id { display: flex; flex-direction: column; padding: 4px 8px 10px; border-bottom: 1px solid var(--line); }
.um-id b { font-size: 14px; }
.um-id span { font-size: 12px; color: var(--muted); word-break: break-all; }
.um-signout {
  width: 100%; margin-top: 10px; padding: 9px;
  background: #fff; color: #e0245e; border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
}
.um-signout:hover { border-color: #e0245e; }

/* ===== Favorites view ===== */
.back-btn {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 16px; font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--ink); cursor: pointer; margin-bottom: 4px; align-self: flex-start;
}
.back-btn:hover { border-color: var(--brand); color: var(--brand); }
.fav-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.fav-card { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; }
.fav-imgwrap { position: relative; aspect-ratio: 3/4; background: linear-gradient(135deg,#e3edff,#e6f6ff); }
.fav-imgwrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fav-remove {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.92); border: none; color: #e0245e;
  font-size: 14px; cursor: pointer; line-height: 1;
}
.fav-info { padding: 10px 12px 4px; }
.fav-info .brand { font-size: 11px; font-weight: 700; color: var(--brand); text-transform: uppercase; }
.fav-info .title { font-size: 13px; color: #1b2336; margin-top: 2px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.fav-info .price { font-size: 15px; font-weight: 700; margin-top: 4px; }
.fav-open {
  margin: 10px 12px 12px; padding: 9px; border: none; border-radius: 10px;
  background: var(--grad); color: #fff; font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer;
}

/* ===== Email auth form ===== */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: #9aa6bd; font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.email-form { display: flex; flex-direction: column; gap: 10px; }
.email-form input {
  width: 100%; padding: 12px 14px; font-family: inherit; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.email-form input:focus { outline: none; border-color: var(--brand); }
.email-submit {
  width: 100%; padding: 13px; border: none; border-radius: 12px;
  background: var(--grad); color: #fff; font-family: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
}
.email-submit:hover { box-shadow: 0 10px 24px rgba(11,79,227,.28); }
.email-submit:disabled { opacity: .6; cursor: default; }
.auth-msg { color: #16a34a; font-size: 13px; margin-top: 12px; }
.auth-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.auth-actions a { color: var(--brand); font-size: 13px; font-weight: 500; }
.auth-actions a:hover { text-decoration: underline; }

/* ===== Email-verify reminder banner ===== */
.verify-banner {
  max-width: 520px; margin: 0 auto; padding: 8px 18px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #fff7e6; color: #8a5a00; font-size: 13px; border-bottom: 1px solid #ffe2ad;
}
.verify-banner button {
  background: none; border: 1px solid #d9a441; color: #8a5a00;
  border-radius: 8px; padding: 4px 10px; font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}

/* ===== View toggle button (header) ===== */
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 1px solid var(--line); background: #fff;
  color: var(--ink); border-radius: 999px; cursor: pointer; flex: none;
}
.icon-btn:hover { border-color: var(--brand); color: var(--brand); }

/* ===== Grid view ===== */
.feed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.grid-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.gc-imgwrap { position: relative; aspect-ratio: 3/4; background: linear-gradient(135deg,#e3edff,#e6f6ff); cursor: pointer; }
.gc-imgwrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gc-brand { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.92); color: var(--ink); font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 6px; }
.gc-sale { position: absolute; top: 8px; right: 8px; background: #0B4FE3; color: #fff; font-size: 10px; font-weight: 700; padding: 3px 6px; border-radius: 6px; }
.gc-info { padding: 8px 10px 2px; flex: 1; }
.gc-info .title { font-size: 12px; color: #2b3550; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gc-info .price { font-size: 14px; font-weight: 700; margin-top: 3px; }
.gc-actions { display: flex; align-items: center; justify-content: space-around; padding: 6px 8px 10px; gap: 6px; }
.gc-act { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.gc-act.dislike { color: #e0245e; }
.gc-act.like { color: #16a34a; }
.gc-act.view { color: var(--brand); font-size: 13px; }
/* Ring is drawn by .grid-card.liked::after / .disliked::after (defined with the
   swipe-card overlay above) so it wraps the whole card, image included. */
.grid-card.liked { box-shadow: 0 8px 20px rgba(22,163,74,.14); }
.grid-card.disliked { box-shadow: 0 8px 20px rgba(224,36,94,.14); }
.grid-card.liked .gc-act.like { background: #16a34a; color: #fff; border-color: #16a34a; }
.grid-card.disliked .gc-act.dislike { background: #e0245e; color: #fff; border-color: #e0245e; }

/* Verify-card spam reminder */
.vp-spam {
  background: #fff7e6; border: 1px solid #ffe2ad; color: #8a5a00;
  font-size: 12.5px; line-height: 1.5; border-radius: 10px; padding: 10px 12px; margin: 14px 0 0;
}
.vp-spam i { font-style: normal; font-weight: 600; }

/* Labelled brand/category groups (Moda / Kozmetik) in the filter sheet */
.chip-groups { display: flex; flex-direction: column; gap: 14px; }
.chip-group-label { font-size: 11px; font-weight: 700; color: #8a94a8; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }

/* Product title as a link + clickable images (open product on the brand site) */
.title.plink { text-decoration: none; color: inherit; cursor: pointer; display: block; }
.sc-info .title.plink:hover, .gc-info .title.plink:hover { text-decoration: underline; text-decoration-color: var(--brand); }
.sc-imgwrap { cursor: pointer; }

/* ===== Dark-mode toggle row (user menu) ===== */
.um-row {
  width: 100%; margin-top: 8px; padding: 9px 8px; display: flex; align-items: center; justify-content: space-between;
  background: none; border: none; border-radius: 10px; font-family: inherit; font-size: 14px; color: var(--ink); cursor: pointer;
}
.um-row:hover { background: var(--soft); }
.um-switch { font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-soft); padding: 3px 10px; border-radius: 999px; }

/* =========================================================
   DARK MODE — applied when <html data-theme="dark">
   ========================================================= */
html[data-theme="dark"] {
  --ink: #e7ecf5; --muted: #97a3ba; --line: #2a3446; --brand-soft: #202c46; --soft: #111826; --bg: #19202e;
}
html[data-theme="dark"] body.app-body,
html[data-theme="dark"] body.admin-body,
html[data-theme="dark"] body.action-body { background: #0e131e; color: var(--ink); }

/* Header + bar controls */
html[data-theme="dark"] .app-header { background: rgba(16,21,32,.92); border-bottom-color: #232c3d; }
html[data-theme="dark"] .app-sub h1 { color: var(--ink); }
html[data-theme="dark"] .like-counter,
html[data-theme="dark"] .filter-btn,
html[data-theme="dark"] .icon-btn { background: #19202e; border-color: #2a3446; color: #cdd6e6; }
html[data-theme="dark"] .like-counter { color: #ff5c8a; }

/* Cards */
html[data-theme="dark"] .swipe-card,
html[data-theme="dark"] .grid-card { background: #19202e; }
html[data-theme="dark"] .swipe-card { box-shadow: 0 10px 30px rgba(0,0,0,.45); }
html[data-theme="dark"] .grid-card { border-color: #283246; }
html[data-theme="dark"] .sc-info .title,
html[data-theme="dark"] .sc-info .price,
html[data-theme="dark"] .gc-info .title,
html[data-theme="dark"] .gc-info .price { color: #e7ecf5; }
html[data-theme="dark"] .tag { background: #232e42; color: #aeb9cd; }
html[data-theme="dark"] .sc-brand-tag,
html[data-theme="dark"] .gc-brand { background: rgba(25,32,46,.92); color: #e7ecf5; }
html[data-theme="dark"] .act,
html[data-theme="dark"] .gc-act { background: #222c3e; }
html[data-theme="dark"] .gc-act { border-color: #2f3a50; }

/* Filter sheet */
html[data-theme="dark"] .sheet { background: #161c28; }
html[data-theme="dark"] .sheet-head strong,
html[data-theme="dark"] .sheet-body h3,
html[data-theme="dark"] .chip-group-label { color: #e7ecf5; }
html[data-theme="dark"] .chip { background: #19202e; border-color: #2a3446; color: #cdd6e6; }
html[data-theme="dark"] .chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* User menu */
html[data-theme="dark"] .user-menu { background: #1d2433; border-color: #2a3446; }
html[data-theme="dark"] .um-id b { color: #e7ecf5; }
html[data-theme="dark"] .um-signout { background: #19202e; border-color: #2a3446; }
html[data-theme="dark"] .um-row { color: #e7ecf5; }
html[data-theme="dark"] .um-row:hover { background: #232c3d; }

/* Auth gate + cards (login wall, verify card) */
html[data-theme="dark"] .auth-gate,
html[data-theme="dark"] .action-body {
  background:
    radial-gradient(1000px 560px at 50% -10%, rgba(34,184,255,.10), transparent 60%),
    radial-gradient(800px 500px at 100% 110%, rgba(11,79,227,.12), transparent 55%),
    #0e131e;
}
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .action-card,
html[data-theme="dark"] .admin-login-card { background: #19202e; border-color: #2a3446; }
html[data-theme="dark"] .auth-card h2,
html[data-theme="dark"] .action-content h1 { color: #e7ecf5; }
html[data-theme="dark"] .email-form input,
html[data-theme="dark"] .action-form input { background: #11161f; border-color: #2a3446; color: #e7ecf5; }
html[data-theme="dark"] .google-btn { background: #11161f; border-color: #2a3446; color: #e7ecf5; }
html[data-theme="dark"] .auth-divider span { background: #19202e; }
html[data-theme="dark"] .vp-spam { background: #2a230f; border-color: #4a3c12; color: #e8c98a; }

/* Empty / hint / loading text */
html[data-theme="dark"] .loading, html[data-theme="dark"] .empty { color: #97a3ba; }

/* Dark-mode: keep auth error text legible on the dark card */
html[data-theme="dark"] .auth-error { color: #ff6b9d; }
