/* [AP] Shop — extras: badges, ratings, countdowns, quick view, compare,
   rewards, changelog, toasts, support chat, staff tickets */

/* ── Card badges, tools, ratings ───────────────────────────────────── */

.card-badges {
  position: absolute;
  left: 0.6rem;
  bottom: 0.6rem;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: calc(100% - 6.5rem);
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 8, 14, 0.78);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  backdrop-filter: blur(6px);
}

.card-badge-best { border-color: rgba(251, 146, 60, 0.6); color: #fdba74; }
.card-badge-new { border-color: rgba(var(--accent-rgb), 0.7); color: var(--volt); }
.card-badge-low { border-color: rgba(250, 204, 21, 0.6); color: #fde047; }
.card-badge-out { border-color: rgba(248, 113, 113, 0.6); color: #fca5a5; }

.card-tools {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  z-index: 2;
  display: flex;
  gap: 0.35rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.group:hover .card-tools,
.store-card:hover .card-tools,
.card-tools:focus-within {
  opacity: 1;
  transform: none;
}

.card-tool {
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(8, 8, 14, 0.82);
  color: #fff;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.card-tool:hover,
.card-tool.is-active,
[data-compare].is-active {
  border-color: rgba(var(--accent-rgb), 0.8);
  background: rgba(var(--accent-rgb), 0.28);
  color: #fff;
}

@media (hover: none) {
  .card-tools {
    opacity: 1;
    transform: none;
  }
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
  color: var(--stone);
  font-size: 0.76rem;
  font-weight: 600;
}

.stars {
  display: inline-block;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  line-height: 1;
}

.stars::before {
  content: "★★★★★";
  background: linear-gradient(90deg, #fbbf24 calc(var(--rating, 0) / 5 * 100%), rgba(255, 255, 255, 0.18) 0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── Countdowns ────────────────────────────────────────────────────── */

.sale-countdown {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  color: var(--ivory-soft);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.sale-countdown:empty {
  display: none;
}

.sale-countdown::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.8);
}

.sale-countdown.is-urgent {
  color: #fca5a5;
}

.sale-countdown.is-urgent::before {
  background: #f87171;
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.9);
  animation: ring-ping 1.2s ease-out infinite;
}

.sale-event-sub[data-countdown] {
  font-variant-numeric: tabular-nums;
  color: #fff;
}

/* ── Deal of the day ───────────────────────────────────────────────── */

.deal-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background:
    radial-gradient(ellipse 70% 120% at 100% 50%, rgba(var(--accent-rgb), 0.22), transparent 65%),
    linear-gradient(180deg, #12101c, #08080e);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 70px rgba(var(--accent-rgb), 0.12);
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease);
}

.deal-card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--accent-rgb), 0.65);
}

.deal-media {
  position: relative;
  min-height: 260px;
  background: #08080e;
}

.deal-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deal-percent {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  background: var(--accent-color);
  color: #0b0614;
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(var(--accent-rgb), 0.5);
}

.deal-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.deal-price {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin: 0 0 0.9rem;
}

.deal-price b {
  font-family: var(--display);
  font-size: 2.4rem;
  letter-spacing: -0.04em;
  color: var(--accent-color);
}

.deal-price s {
  color: var(--stone);
}

.deal-countdown {
  font-size: 0.95rem;
}

/* ── Modals: quick view, image zoom ────────────────────────────────── */

.store-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 3, 8, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: cmdk-fade 0.2s ease both;
}

.store-modal-close {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  background: rgba(8, 8, 14, 0.8);
  color: #fff;
  cursor: pointer;
}

.quick-panel {
  position: relative;
  width: min(100%, 860px);
  max-height: 90vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: auto;
  border-radius: 24px;
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  background: #0d0d14;
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.7), 0 0 70px rgba(var(--accent-rgb), 0.16);
  animation: cmdk-rise 0.3s var(--ease) both;
}

.quick-loading {
  grid-column: 1 / -1;
  margin: 0;
  padding: 4rem 1rem;
  text-align: center;
  color: var(--stone);
}

.quick-media {
  min-height: 300px;
  background: #08080e;
}

.quick-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.quick-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 2rem 1.75rem 1.75rem;
}

.quick-body h2 {
  margin: 0;
  padding-right: 2.5rem;
  font-size: 1.8rem;
  line-height: 1.05;
}

.quick-price {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: 0;
}

.quick-price b {
  font-family: var(--display);
  font-size: 1.9rem;
  color: var(--accent-color);
}

.quick-price s {
  color: var(--stone);
}

.quick-summary {
  margin: 0;
  color: var(--ivory-soft);
  font-size: 0.92rem;
  line-height: 1.6;
}

.quick-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.quick-facts .chip {
  min-height: 30px;
  padding: 0.2rem 0.7rem;
  font-size: 0.74rem;
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.zoom-view img {
  max-width: 94vw;
  max-height: 90vh;
  border-radius: 16px;
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.7);
  animation: cmdk-rise 0.3s var(--ease) both;
}

.product-frame img {
  cursor: zoom-in;
}

/* ── Flash + compare bar ───────────────────────────────────────────── */

.store-flash {
  position: fixed;
  left: 50%;
  bottom: 5.5rem;
  z-index: 10001;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  background: #0d0d14;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
}

.store-flash.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

.compare-bar {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: calc(100vw - 2rem);
  padding: 0.5rem;
  border-radius: 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  background: rgba(10, 10, 16, 0.94);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: cmdk-rise 0.3s var(--ease) both;
}

.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 38px;
  max-width: 11rem;
  padding: 0.3rem 0.7rem;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.compare-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-chip i {
  font-size: 0.65rem;
  opacity: 0.7;
}

.compare-bar .store-cta {
  min-height: 38px;
  padding: 0.4rem 0.95rem;
  border-radius: 11px;
  font-size: 0.84rem;
}

.compare-bar .store-cta.is-disabled {
  pointer-events: none;
  filter: grayscale(0.7) brightness(0.7);
}

/* ── Compare table ─────────────────────────────────────────────────── */

.compare-scroll {
  overflow-x: auto;
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: var(--plate);
}

.compare-table {
  width: 100%;
  min-width: calc(9rem + var(--cols, 2) * 13rem);
  border-collapse: collapse;
  table-layout: fixed;
}

.compare-table th,
.compare-table td {
  padding: 1rem 1.1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.compare-table th[scope="row"] {
  width: 9rem;
  color: var(--stone);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.compare-table thead th:first-child {
  width: 9rem;
}

.compare-head {
  display: grid;
  gap: 0.75rem;
  color: #fff;
}

.compare-head img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px;
  background: #08080e;
}

/* ── Changelog timeline ────────────────────────────────────────────── */

.changelog {
  position: relative;
  margin: 0;
  padding: 0 0 0 1.6rem;
  list-style: none;
}

.changelog::before {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.4rem;
  bottom: 0.4rem;
  width: 1px;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.7), transparent);
}

.changelog-item {
  position: relative;
  margin-bottom: 1rem;
  padding: 1.1rem 1.2rem;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: var(--plate);
}

.changelog-item::before {
  content: "";
  position: absolute;
  left: -1.6rem;
  top: 1.45rem;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  border: 2px solid var(--stone);
  background: var(--ink);
}

.changelog-item.is-latest::before {
  border-color: var(--accent-color);
  background: var(--accent-color);
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.9);
}

.changelog-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.changelog-head time {
  margin-left: auto;
  color: var(--stone);
  font-size: 0.78rem;
}

.changelog-version {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 750;
  color: #fff;
}

.changelog-body {
  margin: 0;
  color: var(--ivory-soft);
  font-size: 0.9rem;
  line-height: 1.65;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.update-product {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
}

.update-product img {
  width: 54px;
  height: 34px;
  object-fit: cover;
  border-radius: 8px;
  background: #08080e;
}

/* ── Rewards ───────────────────────────────────────────────────────── */

.tier-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.tier-fill {
  height: 100%;
  min-width: 10px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-color), var(--volt));
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.7);
}

.tier-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.tier-step {
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem 0.8rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: var(--stone);
  font-size: 0.72rem;
}

.tier-step b {
  font-family: var(--display);
  font-size: 0.95rem;
}

.tier-step.is-current {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--ivory-soft);
}

.reward-option {
  padding: 1.2rem;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
  text-align: center;
}

.reward-option.is-locked {
  opacity: 0.55;
}

button:disabled,
.store-cta:disabled {
  cursor: not-allowed;
  filter: grayscale(0.6) brightness(0.75);
}

.referral-box {
  display: flex;
  gap: 0.5rem;
}

.referral-box input {
  flex: 1;
  min-width: 0;
}

.reward-flash {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  border-radius: 14px;
  border: 1px solid rgba(var(--accent-rgb), 0.45);
  background: rgba(var(--accent-rgb), 0.1);
  font-weight: 600;
}

.reward-flash-error {
  border-color: rgba(248, 113, 113, 0.5);
  background: rgba(248, 113, 113, 0.08);
}

.reward-code {
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-weight: 700;
  cursor: pointer;
}

.leaderboard {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.leaderboard li {
  display: grid;
  grid-template-columns: 2.2rem 1fr auto auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.9rem;
}

.leaderboard li.is-you {
  border-color: rgba(var(--accent-rgb), 0.55);
  background: rgba(var(--accent-rgb), 0.1);
}

.leaderboard-rank {
  font-family: var(--display);
  font-weight: 800;
  color: var(--stone);
}

.leaderboard li:nth-child(-n + 3) .leaderboard-rank {
  color: #fbbf24;
}

.leaderboard-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.leaderboard-name em {
  margin-left: 0.3rem;
  color: var(--accent-color);
  font-size: 0.72rem;
  font-style: normal;
  text-transform: uppercase;
}

.leaderboard-tier {
  font-size: 0.74rem;
  font-weight: 700;
}

.leaderboard-points {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Purchase toasts ───────────────────────────────────────────────── */

.purchase-toast {
  position: fixed;
  left: 1.2rem;
  bottom: 1.2rem;
  z-index: 44;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(330px, calc(100vw - 2.4rem));
  padding: 0.7rem 0.8rem;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: rgba(13, 13, 20, 0.96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s var(--ease);
}

.purchase-toast.is-on {
  opacity: 1;
  transform: none;
}

.purchase-toast-icon {
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent-color);
}

.purchase-toast-copy {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
}

.purchase-toast-copy p {
  margin: 0;
  color: var(--ivory-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-toast-copy b {
  color: #fff;
}

.purchase-toast-copy span {
  color: var(--stone);
  font-size: 0.72rem;
}

.purchase-toast-close {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--stone);
  cursor: pointer;
}

.purchase-toast-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ── Support chat ──────────────────────────────────────────────────── */

.chat-launcher {
  position: fixed;
  right: 1.5rem;
  bottom: 5.4rem;
  z-index: 46;
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  border-radius: 14px;
  background: #101018;
  color: var(--accent-color);
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5), 0 0 26px rgba(var(--accent-rgb), 0.22);
  transition: transform 0.3s var(--ease), background 0.3s ease, color 0.3s ease;
}

.chat-launcher:hover,
.chat-launcher.is-open {
  transform: translateY(-2px);
  background: var(--accent-color);
  color: #0b0614;
}

body:has(.holiday-toggle-btn) .chat-launcher {
  bottom: 7.6rem;
  right: 2.5rem;
}

.chat-panel {
  /* Sits above the sticky nav (z 50) and never grows past the top of the
     window, so its header stays reachable on short screens. */
  --chat-bottom: 9.2rem;
  position: fixed;
  right: 1.5rem;
  bottom: var(--chat-bottom);
  z-index: 70;
  width: min(370px, calc(100vw - 2rem));
  height: min(520px, calc(100vh - var(--chat-bottom) - 0.75rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(var(--accent-rgb), 0.38);
  background: #0d0d14;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65), 0 0 60px rgba(var(--accent-rgb), 0.14);
  animation: cmdk-rise 0.3s var(--ease) both;
}

body:has(.holiday-toggle-btn) .chat-panel {
  --chat-bottom: 11.4rem;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: radial-gradient(ellipse 80% 140% at 50% 0%, rgba(var(--accent-rgb), 0.2), transparent 70%);
}

.chat-head b {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--display);
  font-size: 1rem;
}

.chat-icon-btn {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
}

.chat-list,
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 0.8rem;
  scrollbar-width: thin;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chat-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 0.6rem;
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.7rem 0.8rem;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
  text-align: left;
  cursor: pointer;
}

.chat-row:hover {
  border-color: rgba(var(--accent-rgb), 0.5);
}

.chat-row b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.9rem;
}

.chat-row p {
  grid-column: 1 / -1;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--stone);
  font-size: 0.78rem;
}

.chat-note {
  margin: 0;
  padding: 1.5rem 1rem;
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
  color: var(--stone);
  font-size: 0.88rem;
}

.chat-start {
  margin: 0 0.8rem 0.8rem;
  min-height: 44px;
}

.chat-msg {
  max-width: 85%;
  display: grid;
  gap: 0.2rem;
}

.chat-msg span {
  color: var(--stone);
  font-size: 0.68rem;
  font-weight: 700;
}

.chat-msg p {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ivory);
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-msg-user {
  align-self: flex-end;
  justify-items: end;
}

.chat-msg-user p {
  background: rgba(var(--accent-rgb), 0.28);
  border-bottom-right-radius: 4px;
}

.chat-msg-staff p {
  border-bottom-left-radius: 4px;
}

.chat-composer {
  display: flex;
  gap: 0.5rem;
  padding: 0.7rem;
  border-top: 1px solid var(--line);
}

.chat-composer textarea,
.chat-new textarea {
  flex: 1;
  min-height: 0;
  resize: none;
  font-size: 0.88rem;
}

.chat-composer .store-cta {
  min-height: 0;
  padding: 0 0.9rem;
  border-radius: 12px;
}

.chat-new {
  display: grid;
  gap: 0.6rem;
  padding: 0.9rem;
}

.ticket-status {
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticket-status-open { border-color: rgba(74, 222, 128, 0.5); color: #86efac; }
.ticket-status-pending { border-color: rgba(250, 204, 21, 0.5); color: #fde047; }
.ticket-status-closed { color: var(--stone); }

/* ── Staff ticket desk ─────────────────────────────────────────────── */

.ticket-row {
  display: block;
  padding: 0.9rem 1rem;
  border-radius: 14px !important;
  color: #fff;
}

.ticket-row.is-selected {
  border-color: rgba(var(--accent-rgb), 0.6) !important;
}

.ticket-thread {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.ticket-msg {
  max-width: 88%;
  display: grid;
  gap: 0.25rem;
}

.ticket-msg span {
  color: var(--stone);
  font-size: 0.7rem;
  font-weight: 700;
}

.ticket-msg p {
  margin: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ticket-msg-staff {
  align-self: flex-end;
  justify-items: end;
}

.ticket-msg-staff p {
  background: rgba(var(--accent-rgb), 0.24);
}

/* ── Notification bell ─────────────────────────────────────────────── */

.bell-dot {
  top: -0.4rem;
  right: -0.4rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
}

.bell-panel {
  position: fixed;
  z-index: 70;
  width: min(360px, calc(100vw - 1.5rem));
  max-height: min(480px, calc(100vh - 6rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(var(--accent-rgb), 0.38);
  background: #0d0d14;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65), 0 0 60px rgba(var(--accent-rgb), 0.14);
  animation: cmdk-rise 0.25s var(--ease) both;
}

.bell-head {
  margin: 0;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-weight: 750;
}

.bell-list {
  overflow-y: auto;
  padding: 0.4rem;
  scrollbar-width: thin;
}

.bell-empty {
  margin: 0;
  padding: 1.6rem 1rem;
  text-align: center;
  color: var(--stone);
  font-size: 0.86rem;
}

.bell-item {
  display: flex;
  gap: 0.7rem;
  padding: 0.65rem 0.7rem;
  border-radius: 12px;
  color: var(--ivory-soft);
}

a.bell-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.bell-item.is-unread {
  background: rgba(var(--accent-rgb), 0.1);
}

.bell-icon {
  width: 2.1rem;
  height: 2.1rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent-color);
  font-size: 0.8rem;
}

.bell-copy {
  min-width: 0;
  font-size: 0.84rem;
}

.bell-copy b {
  display: block;
  color: #fff;
}

.bell-copy p {
  margin: 0.15rem 0;
  overflow-wrap: anywhere;
}

.bell-copy span {
  color: var(--stone);
  font-size: 0.7rem;
}

.maintenance-strip {
  padding: 0.5rem 1rem;
  background: #7c2d12;
  color: #ffedd5;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
}

html.staff-desk .maintenance-strip {
  position: fixed;
  inset: auto 0 0 260px;
  z-index: 53;
}

/* ── Product gallery, trial, guide ─────────────────────────────────── */

.product-thumbs {
  display: flex;
  gap: 0.6rem;
  margin-top: -1rem;
  padding-bottom: 0.3rem;
  overflow-x: auto;
  scrollbar-width: thin;
}

.product-thumb {
  position: relative;
  width: 104px;
  aspect-ratio: 16 / 10;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 0;
  border-radius: 12px;
  border: 2px solid transparent;
  background: #08080e;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity 0.25s ease, border-color 0.25s ease;
}

.product-thumb:hover,
.product-thumb.is-active {
  opacity: 1;
  border-color: var(--accent-color);
}

.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-thumb-video i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.1rem;
  background: rgba(0, 0, 0, 0.35);
}

.product-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.trial-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px dashed rgba(var(--accent-rgb), 0.5);
  background: rgba(var(--accent-rgb), 0.07);
}

.trial-box > div {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  flex: 1 1 12rem;
}

.trial-box span {
  color: var(--ivory-soft);
  font-size: 0.8rem;
}

.social-proof {
  margin: 0 0 1rem;
  color: #fdba74;
  font-size: 0.82rem;
  font-weight: 700;
}

.product-faq {
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--plate);
}

.product-faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.product-faq summary::-webkit-details-marker {
  display: none;
}

.product-faq summary i {
  color: var(--accent-color);
  font-size: 0.8rem;
  transition: transform 0.3s var(--ease);
}

.product-faq[open] summary i {
  transform: rotate(180deg);
}

.product-faq p {
  margin: 0;
  padding: 0 1.1rem 1.1rem;
  color: var(--ivory-soft);
  line-height: 1.65;
  white-space: pre-line;
}

.product-guide img {
  max-width: 100%;
  border-radius: 10px;
}

/* ── Catalogue filters ─────────────────────────────────────────────── */

.catalog-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
}

.catalog-filters[hidden] {
  display: none;
}

.catalog-filters .chip {
  cursor: pointer;
}

.catalog-filters .chip:has(input:checked) {
  border-color: rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.16);
  color: #fff;
}

.catalog-filters input[type="checkbox"] {
  accent-color: var(--accent-color);
}

.catalog-price {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ivory-soft);
  font-size: 0.82rem;
  font-weight: 600;
}

.catalog-price input[type="range"] {
  width: 9rem;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  accent-color: var(--accent-color);
}

.catalog-count {
  color: var(--stone);
  font-size: 0.8rem;
}

.catalog-none {
  text-align: center;
  color: var(--ivory-soft);
  margin-bottom: 2rem;
}

.is-filtered-out {
  display: none !important;
}

/* ── Roadmap ───────────────────────────────────────────────────────── */

.roadmap-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.roadmap-column {
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.roadmap-column h2 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
}

.roadmap-column h2 span {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--stone);
}

.roadmap-column h2 em {
  margin-left: auto;
  color: var(--stone);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-style: normal;
}

.roadmap-planned h2 span { background: var(--accent-color); }
.roadmap-progress h2 span { background: #fbbf24; }
.roadmap-done h2 span { background: #4ade80; }

.roadmap-empty {
  margin: 0;
  color: var(--stone);
  font-size: 0.84rem;
}

.roadmap-card {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: var(--plate);
}

.roadmap-card h3 {
  margin: 0 0 0.25rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.roadmap-card p {
  margin: 0;
  color: var(--ivory-soft);
  font-size: 0.82rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.roadmap-vote {
  width: 2.8rem;
  min-height: 3.2rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ivory-soft);
  cursor: pointer;
}

.roadmap-vote.is-voted {
  border-color: var(--accent-color);
  background: rgba(var(--accent-rgb), 0.22);
  color: #fff;
}

.roadmap-vote.is-done {
  cursor: default;
  color: #86efac;
}

.roadmap-staff {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.roadmap-staff select {
  width: auto !important;
  min-height: 34px !important;
  padding: 0.2rem 0.6rem !important;
  font-size: 0.78rem;
}

.roadmap-staff .chip {
  min-height: 34px;
  padding: 0.2rem 0.7rem;
  font-size: 0.76rem;
  cursor: pointer;
}

.roadmap-review,
.canned-row,
.gift-card-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.roadmap-review > div,
.canned-row > div {
  flex: 1 1 14rem;
}

.roadmap-review p,
.canned-row p {
  margin: 0.2rem 0 0;
  color: var(--ivory-soft);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.canned-row .chip {
  cursor: pointer;
}

.gift-card-row code {
  flex: 1 1 10rem;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-weight: 700;
}

.gift-card-row em {
  color: var(--stone);
  font-size: 0.78rem;
  font-style: normal;
}

.gift-card-row.is-used code {
  color: var(--stone);
  text-decoration: line-through;
}

/* ── Ticket rating ─────────────────────────────────────────────────── */

.ticket-rate {
  display: grid;
  gap: 0.6rem;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
}

.ticket-rate fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

/* Stars are listed 5→1 and laid out right-to-left, so hovering or picking
   one also lights every star before it. */
.ticket-rate-stars {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 0.2rem;
}

.ticket-rate-stars input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.ticket-rate-stars label {
  color: rgba(255, 255, 255, 0.2);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease;
}

.ticket-rate-stars label:hover,
.ticket-rate-stars label:hover ~ label,
.ticket-rate-stars input:checked ~ label {
  color: #fbbf24;
}

.ticket-rate-stars input:focus-visible + label {
  outline: 2px solid rgba(var(--accent-rgb), 0.85);
  outline-offset: 3px;
}

/* ── Staff: reports, extras ────────────────────────────────────────── */

.report-range {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.6rem;
}

.report-range label {
  display: grid;
  gap: 0.25rem;
  color: var(--stone);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.report-range input[type="date"] {
  width: auto !important;
  min-height: 42px !important;
  color-scheme: dark;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent !important;
  font-size: 0.88rem;
}

.report-table th,
.report-table td {
  padding: 0.6rem 0.5rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

.report-table tbody tr:last-child td {
  border-bottom: 0;
}

.faq-edit {
  display: grid;
  gap: 0.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.faq-edit textarea {
  min-height: 80px;
}

.gallery-edit {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

.gallery-edit label {
  display: grid;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.gallery-edit img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
}

/* ── Language switch ───────────────────────────────────────────────── */

.lang-switch {
  display: inline-flex;
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
}

.lang-switch button {
  padding: 0.25rem 0.6rem;
  border: 0;
  background: transparent;
  color: var(--stone);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.lang-switch button.is-active {
  background: rgba(var(--accent-rgb), 0.25);
  color: #fff;
}

/* ── Account page ──────────────────────────────────────────────────── */

.account-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem;
  margin-top: 1.5rem;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.account-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-height: 0;
  padding: 0 0.9rem;
  border: 0;
  border-radius: 10px;
  color: var(--ivory-soft);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.account-tabs a:hover,
.account-tabs a:focus-visible {
  background: rgba(var(--accent-rgb), 0.16);
  color: #fff;
}

.account-tabs a[href^="/"] {
  color: var(--ivory);
}

.account-tabs a[href^="/"]::after {
  content: "\2197";
  margin-left: 0.35rem;
  font-size: 0.75em;
  opacity: 0.55;
}

@media (max-width: 640px) {
  .account-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
}

.order-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem 1rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.order-row span {
  margin-left: 0.5rem;
  color: var(--stone);
  font-size: 0.78rem;
}

.order-row p {
  margin: 0.25rem 0 0;
  color: var(--ivory-soft);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.order-side {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.order-side span {
  margin: 0;
}

.order-side .chip {
  min-height: 32px;
  padding: 0.2rem 0.7rem;
  font-size: 0.76rem;
}

.order-refund {
  grid-column: 1 / -1;
  font-size: 0.84rem;
}

.order-refund summary {
  color: var(--stone);
  cursor: pointer;
}

.order-refund form {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.7rem;
  justify-items: start;
}

.order-refund textarea {
  min-height: 90px;
}

.ledger {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.4rem;
}

.ledger li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 0.86rem;
}

.ledger span {
  display: block;
  color: var(--stone);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.ledger em {
  flex: 0 0 auto;
  font-style: normal;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ledger em.is-in { color: #86efac; }
.ledger em.is-out { color: var(--ivory-soft); }

.mission {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
}

.mission b {
  display: block;
  font-size: 0.9rem;
}

.mission span {
  color: var(--accent-color);
  font-size: 0.76rem;
  font-weight: 700;
}

.mission em {
  flex: 0 0 auto;
  color: var(--stone);
  font-size: 0.76rem;
  font-style: normal;
}

.mission.is-claimed {
  opacity: 0.6;
}

.mission .store-cta {
  min-height: 36px;
  padding: 0.3rem 0.9rem;
  border-radius: 10px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px dashed var(--line-strong);
  color: var(--stone);
  font-size: 0.76rem;
  font-weight: 600;
}

.badge.is-earned {
  border-style: solid;
  border-color: rgba(var(--accent-rgb), 0.6);
  background: rgba(var(--accent-rgb), 0.14);
  color: #fff;
}

.badge.is-earned i {
  color: var(--accent-color);
}

.code-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
  margin: 0.6rem 0;
}

.code-grid code {
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.3);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.86rem;
  font-weight: 700;
  user-select: all;
}

.setup-steps {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 1rem;
  color: var(--ivory-soft);
  font-size: 0.9rem;
  list-style: decimal;
}

.setup-steps .chip {
  cursor: pointer;
}

/* ── Reviews: photo and store reply ────────────────────────────────── */

.review-photo {
  display: block;
  margin-top: 0.8rem;
}

.review-photo img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
}

.review-reply {
  margin-top: 0.8rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border-left: 3px solid var(--accent-color);
  background: rgba(var(--accent-rgb), 0.08);
  font-size: 0.86rem;
}

.review-reply b {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--accent-color);
  font-size: 0.74rem;
}

.review-reply p {
  margin: 0;
  color: var(--ivory-soft);
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.review-form {
  display: grid;
  gap: 0.4rem;
  justify-items: start;
  margin-top: 0.8rem;
}

.review-form textarea {
  min-height: 70px;
}

.review-form .chip {
  cursor: pointer;
}

/* ── Small screens ─────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .roadmap-board {
    grid-template-columns: 1fr;
  }

  html.staff-desk .maintenance-strip {
    left: 0;
  }
}

@media (max-width: 480px) {
  /* The bell takes the heart's place; the wishlist stays in the menu. */
  .store-nav a.store-icon-btn[href="/wishlist"] {
    display: none;
  }
}

@media (max-width: 760px) {
  .deal-card,
  .quick-panel {
    grid-template-columns: 1fr;
  }

  .deal-media {
    min-height: 200px;
  }

  .quick-media {
    min-height: 200px;
    max-height: 240px;
  }

  .tier-steps {
    grid-template-columns: 1fr 1fr;
  }

  .referral-box {
    flex-direction: column;
  }

  .leaderboard li {
    grid-template-columns: 1.8rem 1fr auto;
  }

  .leaderboard-tier {
    display: none;
  }

  .compare-bar {
    bottom: 0.8rem;
    overflow-x: auto;
  }

  .purchase-toast {
    left: 0.8rem;
    bottom: 0.8rem;
  }

  body:has(.compare-bar) .purchase-toast {
    bottom: 4.6rem;
  }

  .chat-panel {
    right: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .store-modal,
  .quick-panel,
  .zoom-view img,
  .compare-bar,
  .chat-panel,
  .sale-countdown.is-urgent::before {
    animation: none;
  }
}

/* Grid columns default to min-width:auto, so the scrolling thumbnail row
   (and long words/code in the description) widened the whole page on phones. */
.product-layout > * {
  min-width: 0;
}
