﻿:root {
  --bg: #e8ecef;
  --ink: #12202b;
  --muted: #6a7a86;
  --panel: #ffffff;
  --line: rgba(18, 32, 43, 0.14);
  --line-soft: rgba(18, 32, 43, 0.08);
  --accent: #0d7377;
  --accent-hot: #e85d04;
  --accent-hot-deep: #c2410c;
  --warn: #b45309;
  --code-bg: #f7f1e6;
  --code-border: #c4a574;
  --font: "Be Vietnam Pro", system-ui, sans-serif;
  --display: "Syne", "Be Vietnam Pro", sans-serif;
  --mono: "IBM Plex Mono", "Consolas", "Courier New", monospace;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

html, body {
  margin: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.sidebar {
  padding: 1.25rem 0.85rem 2rem;
  border-right: 1px solid var(--line);
  background: #f4f6f8;
}

.brand-bar {
  display: block;
}

.brand-mark {
  margin: 0 0 1.25rem;
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  animation: rise 0.45s ease both;
}

.menu-toggle {
  display: none;
}

.menu-backdrop {
  display: none;
}

.cats-panel-title {
  display: none;
}

.cats {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cat {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.cat:hover { background: rgba(13, 115, 119, 0.08); }

.cat.active {
  background: rgba(13, 115, 119, 0.12);
  border-color: rgba(13, 115, 119, 0.28);
  font-weight: 600;
  color: var(--accent);
}

.main {
  padding: 1rem 1.25rem 2.25rem;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  animation: rise 0.45s ease 0.04s both;
}

.live-head {
  min-width: 0;
}

.live-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.45rem 0.18rem 0.35rem;
  border-radius: 4px;
  background: linear-gradient(105deg, #ee4d2d 0%, #e85d04 55%, #ff8a3d 100%);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(238, 77, 45, 0.35);
  animation: live-badge-glow 1.6s ease-in-out infinite;
}

.live-badge-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  animation: live-dot 1.1s ease-out infinite;
}

.topbar h1 {
  margin: 0;
  font-family: var(--font);
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #c2410c 0%, #e85d04 40%, #ee4d2d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar-status {
  margin: 0.4rem 0 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  font-variant-numeric: tabular-nums;
}

.status-clock {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: rgba(238, 77, 45, 0.1);
  border: 1px solid rgba(232, 93, 4, 0.35);
  color: var(--accent-hot-deep);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  transform-origin: center;
  animation: clock-heat 1.5s ease-in-out infinite;
}

.topbar-status .rush {
  color: #ee4d2d;
  width: 1.25rem;
  height: 1.25rem;
}

.status-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent-hot);
  opacity: 0.65;
}

.status-msg {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
}

.topbar-status.is-loading .status-msg {
  color: var(--accent-hot-deep);
}

.topbar-status.is-loading .status-clock {
  animation: clock-heat 0.85s ease-in-out infinite;
}

.topbar-status.is-alert .status-msg {
  color: var(--accent-hot);
  font-weight: 800;
}

.poll-bar {
  height: 3px;
  margin: 0 0 0.75rem;
  border-radius: 0;
  background: rgba(232, 93, 4, 0.12);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.poll-bar.is-loading {
  opacity: 1;
}

.poll-bar.is-loading::after {
  content: "";
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, transparent, #ee4d2d, #e85d04, transparent);
  animation: poll-slide 0.85s ease-in-out infinite;
}

.deal.is-new {
  animation: deal-in 0.45s ease both;
  background: rgba(13, 115, 119, 0.06);
  border-color: rgba(13, 115, 119, 0.4);
}

@keyframes live-dot {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

@keyframes live-badge-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

@keyframes clock-heat {
  0%, 100% {
    color: #c2410c;
    border-color: rgba(232, 93, 4, 0.35);
    transform: scale(1);
  }
  50% {
    color: #ee4d2d;
    border-color: rgba(238, 77, 45, 0.55);
    transform: scale(1.08);
  }
}

@keyframes poll-slide {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

@keyframes deal-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@keyframes code-flash {
  0% { background: rgba(13, 115, 119, 0.22); }
  100% { background: var(--code-bg); }
}

.refresh {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 0.5rem 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.refresh:hover { border-color: var(--accent); color: var(--accent); }

.banner-error {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  background: rgba(185, 28, 28, 0.1);
  color: #991b1b;
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 760px;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.deal {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: stretch;
  width: 100%;
  max-width: 100%;
  padding: 0.75rem 0.85rem;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: background 0.2s ease, border-color 0.2s ease;
  min-width: 0;
  overflow: hidden;
}

.deal:last-child {
  border-bottom: 0;
}

.deal:hover {
  transform: none;
  background: rgba(18, 32, 43, 0.015);
}

.deal.is-teaser {
  opacity: 0.78;
  border-left: 3px dashed var(--code-border);
  padding-left: calc(0.85rem - 3px);
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(196, 165, 116, 0.06) 6px,
    rgba(196, 165, 116, 0.06) 12px
  );
}

.deal-top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  min-width: 0;
}

.deal-head {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.deal-media {
  display: block;
  width: 144px;
  height: 144px;
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  overflow: hidden;
  background: #dbe4ea;
  cursor: zoom-in;
  flex-shrink: 0;
}

.deal-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  transition: transform 0.25s ease;
}

.deal:hover .deal-media img {
  transform: scale(1.03);
}

.deal-media-empty {
  width: 144px;
  height: 144px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #dbe4ea;
  flex-shrink: 0;
}

.deal-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.55rem;
  margin: 0;
}

.deal-price {
  margin: 0;
  color: var(--accent-hot);
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.deal-discount {
  margin: 0;
  display: inline-block;
  color: var(--accent-hot-deep);
  font-weight: 800;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
  transform-origin: center;
  animation: discount-pop 0.85s ease-in-out infinite;
}

@keyframes discount-pop {
  0%, 100% {
    color: #c2410c;
    transform: scale(1) rotate(0deg) translateX(0);
    text-shadow: 0 0 0 transparent;
  }
  20% {
    color: #ee4d2d;
    transform: scale(1.22) rotate(-4deg) translateX(-1px);
    text-shadow: 0 0 8px rgba(238, 77, 45, 0.35);
  }
  45% {
    color: #ff6b1a;
    transform: scale(1.08) rotate(3deg) translateX(2px);
  }
  70% {
    color: #e85d04;
    transform: scale(1.18) rotate(-2deg) translateX(-1px);
    text-shadow: 0 0 10px rgba(232, 93, 4, 0.3);
  }
}

.deal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  border: 1px solid transparent;
  line-height: 1.3;
}

.badge-live {
  background: rgba(13, 115, 119, 0.12);
  color: var(--accent);
  border-color: rgba(13, 115, 119, 0.22);
}

.badge-good {
  background: rgba(232, 93, 4, 0.1);
  color: var(--accent-hot-deep);
  border-color: rgba(232, 93, 4, 0.22);
}

.badge-teaser {
  background: rgba(180, 83, 9, 0.1);
  color: var(--warn);
  border-color: rgba(180, 83, 9, 0.28);
}

.deal-title {
  margin: 0;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deal-title a:hover { color: var(--accent); }

.deal-code {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  margin: 0.1rem 0 0;
  padding: 0.28rem 0.55rem;
  border: 1.5px dashed var(--code-border);
  border-radius: 4px;
  background: var(--code-bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.deal-code:hover {
  border-color: var(--accent);
  background: #f3e8d4;
}

.deal-code.is-copied {
  animation: code-flash 0.7s ease;
  border-style: solid;
  border-color: var(--accent);
}

.deal-code-label {
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}

.deal-code-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0.1rem 0 0;
  font-variant-numeric: tabular-nums;
}

.deal-time {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.deal-time time {
  display: inline-block;
  transform-origin: left center;
  font-variant-numeric: tabular-nums;
}

.deal-time.is-warm {
  color: var(--warn);
  font-weight: 600;
}

.deal-time.is-warm time {
  animation: time-pop-warm 1.5s ease-in-out infinite;
}

.deal-time.is-hot {
  color: var(--accent-hot);
  font-weight: 800;
}

.deal-time.is-hot time {
  animation: time-pop-hot 0.95s ease-in-out infinite;
}

.deal.is-new .deal-time time {
  animation: time-pop-hot 0.85s ease-in-out infinite;
  font-weight: 800;
}

/* Icon người chạy + vệt tốc độ */
.rush {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  color: var(--accent-hot);
  animation: rush-lane 1.05s linear infinite;
}

.rush.is-sprint {
  animation-duration: 0.7s;
  color: #ee4d2d;
}

.rush-icon {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
  animation: rush-bob 0.35s ease-in-out infinite;
}

.rush.is-sprint .rush-icon {
  animation-duration: 0.22s;
}

.rush-trail {
  position: absolute;
  left: -0.15rem;
  top: 50%;
  width: 0.55rem;
  height: 0.12rem;
  border-radius: 99px;
  background: linear-gradient(90deg, transparent, rgba(238, 77, 45, 0.85));
  transform: translateY(-50%);
  animation: rush-trail 0.45s linear infinite;
  pointer-events: none;
}

.rush.is-sprint .rush-trail {
  animation-duration: 0.28s;
  width: 0.7rem;
}

@keyframes time-pop-hot {
  0%, 100% {
    color: var(--warn);
    transform: scale(1);
    text-shadow: 0 0 0 transparent;
  }
  40% {
    color: #ee4d2d;
    transform: scale(1.18);
    text-shadow: 0 0 10px rgba(232, 93, 4, 0.3);
  }
  70% {
    color: #ff6b1a;
    transform: scale(1.06);
  }
}

@keyframes time-pop-warm {
  0%, 100% {
    color: var(--warn);
    transform: scale(1);
  }
  50% {
    color: var(--accent-hot);
    transform: scale(1.08);
  }
}

@keyframes rush-lane {
  0% { transform: translateX(0); }
  40% { transform: translateX(3px); }
  70% { transform: translateX(-1px); }
  100% { transform: translateX(0); }
}

@keyframes rush-bob {
  0%, 100% { transform: translateY(0) rotate(-6deg); }
  50% { transform: translateY(-1.5px) rotate(4deg); }
}

@keyframes rush-trail {
  0% { opacity: 0.15; transform: translate(-2px, -50%) scaleX(0.5); }
  50% { opacity: 0.9; transform: translate(-4px, -50%) scaleX(1.15); }
  100% { opacity: 0.2; transform: translate(-6px, -50%) scaleX(0.4); }
}

.deal-snippet {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
  min-width: 0;
}

.deal-snippet .snippet-link {
  color: var(--accent);
  text-decoration: underline;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.deal-snippet .snippet-link:hover {
  color: var(--accent-hot);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  padding:
    max(1rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  box-sizing: border-box;
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(10, 16, 22, 0.88);
  cursor: zoom-out;
}

.lightbox[hidden] {
  display: none !important;
}

.lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(960px, 100%);
  max-height: min(85dvh, calc(100dvh - 2.5rem));
  object-fit: contain;
  margin: auto;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  cursor: default;
}

.lightbox-close {
  position: absolute;
  top: max(0.5rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  z-index: 1;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}

body.lightbox-open {
  overflow: hidden;
}

.deal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.tag {
  font-size: 0.68rem;
  padding: 0.12rem 0.4rem;
  border-radius: 3px;
  background: rgba(18, 32, 43, 0.06);
  color: var(--muted);
  font-weight: 500;
}

.deal-cta {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0.1rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  background: var(--accent-hot);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.3;
  text-align: center;
  white-space: normal;
  box-sizing: border-box;
  transform-origin: center;
  animation: cta-nudge 2.2s ease-in-out infinite;
}

.deal-cta:hover {
  filter: brightness(1.06);
  animation-play-state: paused;
  transform: scale(1.02);
}

.deal-cta:active {
  transform: scale(0.98);
}

.deal.is-teaser .deal-cta {
  background: transparent;
  color: var(--warn) !important;
  border: 1.5px dashed var(--code-border);
  font-weight: 600;
  animation: cta-nudge-soft 2.8s ease-in-out infinite;
}

@keyframes cta-nudge {
  0%, 100% { transform: translateX(0) scale(1); }
  12% { transform: translateX(3px) scale(1.015); }
  24% { transform: translateX(-2px) scale(1.01); }
  36% { transform: translateX(2px) scale(1.02); }
  48% { transform: translateX(0) scale(1); }
  /* nghỉ một nhịp rồi lặp — đỡ rối mắt */
}

@keyframes cta-nudge-soft {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(2px); }
  40% { transform: translateX(-1px); }
  60% { transform: translateX(0); }
}

.empty {
  color: var(--muted);
  padding: 2rem 1rem;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.feed .empty {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.new-deals-btn {
  position: fixed;
  top: max(0.85rem, env(safe-area-inset-top));
  left: 50%;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transform: translateX(-50%) translateY(-120%);
  opacity: 0;
  pointer-events: none;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 22px rgba(13, 115, 119, 0.3);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.new-deals-btn[hidden] {
  display: none !important;
}

.new-deals-btn.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.new-deals-btn:hover {
  filter: brightness(1.05);
}

.new-deals-btn:active {
  transform: translateX(-50%) translateY(1px) scale(0.98);
}

.new-deals-btn-icon {
  font-size: 1rem;
  line-height: 1;
}

.feed-sentinel {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.85rem 0 1.25rem;
}

.feed-more-text {
  color: var(--muted);
  font-size: 0.82rem;
}

.feed-sentinel.is-loading .feed-more-text {
  color: var(--accent);
}

.feed-sentinel.is-end .feed-more-text {
  opacity: 0.75;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* Tablet + phone */
@media (max-width: 900px) {
  .shell {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0.55rem 0.75rem;
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
    padding-top: max(0.55rem, env(safe-area-inset-top));
    background: rgba(244, 246, 248, 0.97);
    backdrop-filter: blur(12px);
    overflow: visible;
    box-shadow: none;
  }

  .new-deals-btn {
    top: calc(max(0.55rem, env(safe-area-inset-top)) + 3.4rem);
  }

  .brand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .brand-mark {
    margin: 0;
    font-size: 1.3rem;
    line-height: 1;
    flex-shrink: 0;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    max-width: min(68vw, 240px);
    min-height: 40px;
    padding: 0.4rem 0.65rem 0.4rem 0.55rem;
    border: 1px solid rgba(18, 32, 43, 0.12);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
  }

  .menu-toggle-bars {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    width: 16px;
    flex-shrink: 0;
  }

  .menu-toggle-bars span {
    display: block;
    height: 2px;
    border-radius: 2px;
    background: var(--ink);
  }

  .menu-toggle-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
    font-weight: 600;
  }

  .menu-toggle-caret {
    width: 0.4rem;
    height: 0.4rem;
    margin-left: 0.1rem;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(45deg) translateY(-1px);
    flex-shrink: 0;
  }

  .sidebar.is-menu-open .menu-toggle {
    border-color: rgba(13, 115, 119, 0.35);
    box-shadow: 0 0 0 3px rgba(13, 115, 119, 0.12);
  }

  .sidebar.is-menu-open .menu-toggle-caret {
    transform: rotate(225deg) translateY(1px);
  }

  .menu-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(10, 16, 22, 0.28);
  }

  .menu-backdrop[hidden] {
    display: none !important;
  }

  .cats-panel {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: max(0.75rem, env(safe-area-inset-left));
    right: max(0.75rem, env(safe-area-inset-right));
    z-index: 45;
    max-height: min(70vh, 420px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.55rem;
    border: 1px solid rgba(18, 32, 43, 0.12);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(18, 32, 43, 0.14);
  }

  .sidebar.is-menu-open .cats-panel {
    display: block;
    animation: rise 0.18s ease both;
  }

  .cats-panel-title {
    display: block;
    margin: 0 0 0.4rem 0.15rem;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .cats {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow: visible;
  }

  .cat {
    width: 100%;
    white-space: normal;
    border-radius: 6px;
    padding: 0.65rem 0.75rem;
    min-height: 44px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--ink);
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
    text-align: left;
  }

  .cat:hover {
    background: rgba(13, 115, 119, 0.08);
    border-color: transparent;
  }

  .cat.active {
    background: rgba(13, 115, 119, 0.12);
    border-color: rgba(13, 115, 119, 0.22);
    color: var(--accent);
    font-weight: 700;
    box-shadow: none;
  }

  .main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 0.7rem;
    padding-left: max(0.7rem, env(safe-area-inset-left));
    padding-right: max(0.7rem, env(safe-area-inset-right));
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    overflow-x: hidden;
  }

  .topbar {
    margin-bottom: 0.55rem;
    align-items: center;
    gap: 0.65rem;
  }

  .topbar h1 {
    font-size: 1.05rem;
  }

  .live-badge {
    font-size: 0.64rem;
  }

  .status-clock {
    font-size: 0.8rem;
  }

  .status-msg {
    font-size: 0.78rem;
  }

  .deal:hover .deal-media img {
    transform: none;
  }

  .refresh {
    min-height: 40px;
    padding: 0.4rem 0.65rem;
    font-size: 0.84rem;
  }

  .feed {
    max-width: none;
    border-radius: 6px;
  }

  .deal {
    gap: 0.45rem;
    padding: 0.65rem 0.7rem;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .deal.is-teaser {
    padding-left: calc(0.7rem - 3px);
  }

  .deal:hover {
    transform: none;
  }

  .deal-top {
    display: flex;
    gap: 0.6rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .deal-media,
  .deal-media-empty {
    width: 124px;
    height: 124px;
    max-width: 124px;
    flex: 0 0 124px;
  }

  .deal-price {
    font-size: 1.22rem;
  }

  .deal-title {
    font-size: 0.9rem;
  }

  .deal-snippet {
    font-size: 0.8rem;
  }

  .deal-cta {
    padding: 0.7rem 0.8rem;
    font-size: 0.92rem;
  }

  .lightbox {
    padding:
      max(0.75rem, env(safe-area-inset-top))
      max(0.75rem, env(safe-area-inset-right))
      max(0.75rem, env(safe-area-inset-bottom))
      max(0.75rem, env(safe-area-inset-left));
  }

  .lightbox img {
    max-width: 100%;
    max-height: min(80dvh, calc(100dvh - 3rem));
    border-radius: 6px;
  }

  .lightbox-close {
    width: 44px;
    height: 44px;
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .sidebar {
    padding: 0.5rem 0.65rem;
    padding-left: max(0.65rem, env(safe-area-inset-left));
    padding-right: max(0.65rem, env(safe-area-inset-right));
    padding-top: max(0.5rem, env(safe-area-inset-top));
  }

  .brand-mark {
    font-size: 1.15rem;
  }

  .menu-toggle {
    max-width: min(62vw, 200px);
    min-height: 38px;
  }

  .menu-toggle-label {
    font-size: 0.82rem;
  }

  .cats-panel {
    left: max(0.6rem, env(safe-area-inset-left));
    right: max(0.6rem, env(safe-area-inset-right));
  }

  .main {
    padding: 0.55rem;
    padding-left: max(0.55rem, env(safe-area-inset-left));
    padding-right: max(0.55rem, env(safe-area-inset-right));
    padding-bottom: max(1.35rem, env(safe-area-inset-bottom));
  }

  .topbar {
    width: 100%;
    max-width: 100%;
  }

  .topbar h1 {
    font-size: 0.98rem;
  }

  .deal {
    padding: 0.55rem 0.6rem;
  }

  .deal.is-teaser {
    padding-left: calc(0.6rem - 3px);
  }

  .deal-top {
    gap: 0.55rem;
  }

  .deal-media,
  .deal-media-empty {
    width: 120px;
    height: 120px;
    max-width: 120px;
    flex: 0 0 120px;
    border-radius: 5px;
  }

  .deal-price {
    font-size: 1.15rem;
  }

  .deal-cta {
    padding: 0.65rem 0.75rem;
    font-size: 0.9rem;
  }

  .deal-meta {
    font-size: 0.72rem;
  }

  .deal-title {
    font-size: 0.88rem;
  }

  .deal-snippet {
    font-size: 0.78rem;
  }

  .banner-error {
    font-size: 0.84rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .deal-time.is-hot,
  .deal-time.is-warm,
  .deal.is-new .deal-time {
    color: var(--accent-hot);
  }

  .deal-time time,
  .live-badge,
  .live-badge-dot,
  .status-clock,
  .rush,
  .rush-icon,
  .rush-trail,
  .deal-cta,
  .deal-discount {
    animation: none !important;
    transform: none !important;
    text-shadow: none !important;
  }

  .status-clock {
    color: #ee4d2d;
  }
}
