/* BuyLowa reusable components
   Component rules live here. Page files should set section layout and variables only.
*/

/* Component safety helpers */
.deal-row,
.voucher-row,
.voucher-ticket,
.department-tile,
.spotlight-mini,
.compact-list-item,
.shelf-item,
.community-discussion,
.comment-item,
.detail-gallery,
.detail-story,
.detail-buy-box,
.detail-community {
  min-width: 0;
}

/* Shared section tools */
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 0 0 var(--section-heading-gap, 18px);
}

.section-heading.split { align-items: center; }

.section-heading h2,
.module-title-line h2,
.feed-headline h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--section-title-size, 34px);
  line-height: 1;
}

.section-link {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 10px 14px;
  font-weight: 900;
}

.section-link:hover {
  background: var(--ink);
  color: var(--white);
}


/* Small shared states and generated labels */
.loading-text { margin: 0; color: var(--muted); font-weight: 850; }
.no-results-icon { font-size: 28px; line-height: 1; margin-bottom: 8px; }
.store-muted { color: var(--muted); font-weight: 850; }
.related-deals-section { margin-top: 18px; }
.compact-related { border: 1px solid var(--line); background: var(--white); }
.forum-strip { margin-top: 24px; }
.compact-board { min-width: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 6px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.badge-limited { color: var(--color-warning); }
.badge-store-rep { color: var(--color-community); }

/* Shared image frame */
.image-frame,
.row-image,
.spotlight-thumb,
.compact-thumb,
.shelf-image,
.detail-image,
.lead-image {
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.image-frame img,
.row-image img,
.spotlight-thumb img,
.compact-thumb img,
.shelf-image img,
.detail-image img,
.lead-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.image-placeholder { background: #e7e1d6; }
.image-placeholder span { font-weight: 950; color: var(--muted); }

/* Browse tiles: departments and stores intentionally share this component */
.department-grid-large {
  display: grid;
  grid-template-columns: repeat(var(--browse-columns, 5), minmax(0, 1fr));
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.department-tile {
  min-height: var(--browse-tile-height, 118px);
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  text-align: left;
  padding: var(--browse-tile-padding, 18px);
  display: grid;
  align-content: space-between;
  gap: 8px;
}

.department-tile strong {
  font-size: var(--browse-tile-title, 18px);
  line-height: 1.15;
}

.department-tile span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.department-tile:hover,
.department-tile.active {
  background: var(--ink);
  color: var(--white);
}

.department-tile:hover span,
.department-tile.active span {
  color: rgba(255, 255, 255, .72);
}

/* Vote control */
.vote-unit {
  display: grid;
  grid-template-columns: 28px auto 28px;
  align-items: center;
  gap: 5px;
  width: fit-content;
  background: rgba(0, 0, 0, .05);
  padding: 4px;
}

.vote-unit.large {
  background: rgba(255, 255, 255, .1);
}

.vote-arrow {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-weight: 950;
  line-height: 1;
}

.vote-unit.large .vote-arrow {
  background: rgba(255, 255, 255, .1);
  color: #fff;
  border-color: rgba(255, 255, 255, .25);
}

.vote-arrow.up.active,
.vote-arrow.up:hover {
  background: var(--color-positive);
  color: #fff;
  border-color: var(--color-positive);
}

.vote-arrow.down.active,
.vote-arrow.down:hover {
  background: var(--color-negative);
  color: #fff;
  border-color: var(--color-negative);
}

.vote-number {
  min-width: 26px;
  text-align: center;
  font-weight: 950;
}

.vote-number.positive { color: var(--color-positive); }
.vote-number.negative { color: var(--color-negative); }
.lead-deal .vote-number.positive { color: #7ff0af; }

/* Featured deal component */
.lead-deal {
  height: var(--feature-height, auto);
  min-height: var(--feature-min-height, 0);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--feature-media-width, 38%);
  background: var(--ink);
  color: var(--white);
  border: 1px solid var(--line-dark);
  cursor: pointer;
  overflow: hidden;
}

.lead-copy {
  min-width: 0;
  min-height: 0;
  padding: var(--feature-padding, 30px 34px);
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto;
  align-content: stretch;
  gap: var(--feature-content-gap, 8px);
  overflow: hidden;
}

.lead-copy .section-kicker { color: var(--gold); }

.lead-copy .offer-meta-line,
.lead-copy .poster-line { margin-top: 0; }

.lead-copy h1 {
  min-width: 0;
  min-height: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--feature-title-size, clamp(32px, 2.55vw, 46px));
  line-height: 1.04;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: var(--feature-title-lines, 3);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lead-price-row {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 0;
}

.lead-price-row strong {
  color: #7ee0a5;
  font-size: var(--feature-price-size, 38px);
  line-height: .95;
}

.lead-price-row del { color: rgba(255, 255, 255, .54); }
.lead-price-row span { color: #ffd56b; font-weight: 900; }

.lead-summary {
  min-width: 0;
  min-height: 0;
  margin: 0;
  color: rgba(255, 253, 248, .78);
  max-width: 620px;
  font-size: var(--feature-summary-size, 15px);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: var(--feature-summary-lines, 3);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lead-actions {
  min-width: 0;
  margin-top: 0;
  display: flex;
  gap: 14px;
  align-items: center;
  align-self: end;
}

.lead-image {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: #f7f4ec;
  border: 0;
  border-left: 1px solid var(--line-dark);
  padding: var(--feature-image-padding, 26px);
}

.lead-image img {
  max-width: var(--feature-image-max-w, 360px);
  max-height: var(--feature-image-max-h, 270px);
}

.lead-empty {
  background: var(--ink);
  color: #fff;
  padding: 44px;
  min-height: 360px;
}

.lead-empty h1 {
  font-family: var(--font-display);
  font-size: 54px;
  line-height: 1;
  margin: 0 0 12px;
}

.lead-empty a { color: #fff; font-weight: 900; }

/* Quick find component */
.front-side {
  height: var(--feature-height, auto);
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, .9fr) minmax(0, .9fr) minmax(0, 1.45fr);
  gap: 12px;
  align-content: stretch;
}

.side-stack-title {
  background: var(--gold);
  color: #18130b;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  padding: 12px 14px;
}

.spotlight-mini {
  min-height: 0;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
  display: grid;
  grid-template-columns: var(--quick-image-width, 94px) minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  text-align: left;
  overflow: hidden;
}

.spotlight-thumb {
  border: 0;
  background: var(--paper-2);
  width: var(--quick-image-width, 94px);
  height: var(--quick-image-height, 76px);
  max-width: 100%;
  align-self: center;
  min-height: 0;
}

.spotlight-thumb img {
  max-width: calc(var(--quick-image-width, 94px) - 10px);
  max-height: calc(var(--quick-image-height, 76px) - 10px);
}

.spotlight-text {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 6px;
}

.spotlight-text strong {
  min-width: 0;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: var(--quick-title-lines, 3);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spotlight-text span {
  color: var(--color-money);
  font-weight: 900;
}

/* Voucher components */
.voucher-strip {
  display: grid;
  grid-template-columns: repeat(var(--voucher-columns, 4), minmax(0, 1fr));
  gap: 12px;
}

.voucher-ticket {
  min-height: var(--voucher-card-min, 0);
  border: 1px solid var(--line-dark);
  background: var(--white);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.voucher-ticket::before,
.voucher-ticket::after { display: none; }

.ticket-store {
  min-width: 0;
  background: #181512;
  color: #fff;
  padding: var(--voucher-store-padding, 13px 16px);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border-bottom: 1px dashed rgba(255, 255, 255, .45);
}

.ticket-store span {
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: .1em;
}

.ticket-store strong { font-size: 14px; }

.ticket-body {
  min-width: 0;
  min-height: 0;
  padding: var(--voucher-body-padding, 16px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  overflow: hidden;
}

.ticket-body h3 {
  min-width: 0;
  margin: 0;
  line-height: 1.12;
  font-size: var(--voucher-title-size, 18px);
  font-weight: 900;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: var(--voucher-title-lines, 3);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ticket-body p {
  min-width: 0;
  min-height: 0;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.ticket-context {
  display: -webkit-box;
  -webkit-line-clamp: var(--voucher-context-lines, 2);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ticket-bottom {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  align-self: end;
  margin-top: 0;
}

.ticket-code,
.voucher-row-code {
  min-width: 0;
  max-width: 100%;
  border: 1px dashed var(--color-code-border);
  color: var(--color-code);
  background: var(--color-code-bg);
  font-size: var(--voucher-code-size, 16px);
  font-weight: 950;
  padding: 8px 12px;
  letter-spacing: .06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-bottom span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.front-side .voucher-ticket {
  height: 100%;
  min-height: 0;
  --voucher-title-lines: 2;
  --voucher-context-lines: 1;
}
.front-side .ticket-bottom { align-self: end; }


/* Page and detail components */
.collection-page,
.deal-detail-page,
.profile-page {
  --page-card-padding: 30px;
  --detail-card-padding: 26px;
  --detail-title-size: clamp(32px, 3.6vw, 54px);
  --detail-title-lines: 4;
  --detail-desc-size: 15px;
  --detail-desc-lines: 7;
  --detail-price-size: 42px;
  --detail-stat-columns: 4;
  --comment-box-min: 104px;
  --comment-gap: 12px;
}

.collection-hero,
.profile-hero,
.detail-gallery,
.detail-story,
.detail-buy-box,
.detail-community,
.no-results,
.empty-note {
  background: var(--white);
  border: 1px solid var(--line);
}

.collection-hero,
.profile-hero {
  padding: var(--page-card-padding);
  margin-bottom: 18px;
}

.search-page { min-width: 0; }

.collection-hero,
.profile-hero {
  border-left: 6px solid var(--color-brand);
}

.collection-hero h1,
.profile-hero h1,
.detail-story h1 {
  min-width: 0;
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: var(--detail-title-size);
  line-height: 1;
  letter-spacing: -.015em;
  overflow-wrap: anywhere;
}

.collection-hero p,
.profile-hero p { color: var(--muted); }

.detail-story h1 {
  display: -webkit-box;
  -webkit-line-clamp: var(--detail-title-lines, 4);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.active-filter,
.back-btn,
.profile-actions button {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 9px 12px;
  font-weight: 900;
}

.active-filter:hover,
.back-btn:hover,
.profile-actions button:hover {
  background: var(--ink);
  color: var(--white);
}

.no-results,
.empty-note {
  padding: var(--page-card-padding);
  color: var(--muted);
}

.no-results h3 { margin: 0 0 8px; color: var(--ink); }
.no-results a { color: var(--color-link); font-weight: 950; }
.empty-note.wide { grid-column: 1 / -1; }

.loading-wrap {
  display: grid;
  place-items: center;
  min-height: 360px;
  gap: 12px;
  color: var(--muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--color-brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}


.detail-gallery {
  min-height: var(--detail-gallery-min-height, 360px);
  display: grid;
  place-items: center;
}

.detail-image {
  width: 100%;
  min-height: var(--detail-image-min-height, 320px);
  border: 0;
  background: var(--paper-2);
}

.detail-image img {
  padding: var(--detail-image-padding, 24px);
  max-width: var(--detail-image-max-w, 430px);
  max-height: var(--detail-image-max-h, 470px);
}

.detail-story {
  min-width: 0;
  padding: var(--detail-card-padding);
  display: flex;
  flex-direction: column;
  align-content: start;
  gap: 14px;
}

.detail-source-line {
  min-width: 0;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.detail-source-line span:not(:last-child)::after {
  content: "/";
  margin-left: 8px;
  color: #c5beb2;
}

.detail-desc {
  margin: 0;
  min-width: 0;
  color: var(--ink-2);
  font-size: var(--detail-desc-size);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: var(--detail-desc-lines);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.deal-tag {
  border: 1px solid var(--line);
  padding: 6px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.detail-buy-box {
  min-width: 0;
  padding: var(--detail-card-padding);
  display: flex;
  flex-direction: column;
  align-content: start;
  gap: 12px;
}

.detail-buy-box .vote-unit.large {
  background: var(--paper-2);
}

.detail-buy-box .vote-unit.large .vote-arrow {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.detail-buy-box .vote-unit.large .vote-arrow.up.active,
.detail-buy-box .vote-unit.large .vote-arrow.up:hover {
  background: var(--color-positive);
  color: #fff;
  border-color: var(--color-positive);
}

.detail-buy-box .vote-unit.large .vote-arrow.down.active,
.detail-buy-box .vote-unit.large .vote-arrow.down:hover {
  background: var(--color-negative);
  color: #fff;
  border-color: var(--color-negative);
}

.detail-price-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 11px;
  font-weight: 900;
}

.detail-buy-box > strong {
  min-width: 0;
  color: var(--color-money);
  font-size: var(--detail-price-size);
  line-height: 1;
  overflow-wrap: anywhere;
}

.detail-buy-box del { color: var(--muted); }
.detail-saving { color: var(--color-saving); font-weight: 950; }

.detail-code {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border: 1px dashed var(--color-code-border);
  background: var(--color-code-bg);
}

.detail-code span {
  min-width: 0;
  padding: 10px;
  font-weight: 950;
  letter-spacing: .06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-code button {
  border: 0;
  background: var(--ink);
  color: #fff;
  padding: 10px 12px;
  font-weight: 900;
}

.report-link {
  border: 1px solid var(--line-dark);
  background: transparent;
  color: var(--ink);
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.1;
  font-weight: 900;
  justify-self: stretch;
}

.report-link:hover,
.report-link:focus-visible {
  background: var(--ink);
  color: #fff;
}

.detail-community {
  min-width: 0;
  overflow: hidden;
}

@media (min-width: 901px) {
  .detail-gallery,
  .detail-story,
  .detail-buy-box {
    height: var(--detail-panel-height, 480px);
    min-height: 0;
    max-height: var(--detail-panel-height, 480px);
  }

  .detail-gallery {
    padding: 0;
  }

  .detail-image {
    height: 100%;
    min-height: 0;
  }

  .detail-image img {
    width: 100%;
    height: 100%;
  }

  .detail-story {
    overflow: hidden;
  }

  .detail-story h1,
  .detail-source-line,
  .detail-story .row-labels,
  .detail-story .deal-tags {
    flex: 0 0 auto;
  }

  .detail-desc {
    flex: 1 1 auto;
    min-height: 0;
    display: block;
    overflow: auto;
    padding-right: 4px;
    -webkit-line-clamp: initial;
    -webkit-box-orient: initial;
  }

  .detail-buy-box {
    overflow: hidden;
  }

  .detail-buy-box .vote-unit.large {
    width: fit-content;
  }

  .report-link {
    margin-top: auto;
  }
}

@media (max-width: 900px) {
  .detail-gallery,
  .detail-story,
  .detail-buy-box {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .detail-story {
    overflow: visible;
  }

  .detail-desc {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: var(--detail-desc-lines);
    -webkit-box-orient: vertical;
  }

  .report-link {
    margin-top: 0;
  }
}

.detail-stats-row {
  display: grid;
  grid-template-columns: repeat(var(--detail-stat-columns), minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.detail-stats-row div {
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
  display: grid;
  gap: 2px;
}

.detail-stats-row div:last-child { border-right: 0; }
.detail-stats-row strong { color: var(--ink); overflow-wrap: anywhere; }
.detail-stats-row span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
}

.comments-section {
  min-width: 0;
  padding: var(--detail-card-padding);
}

.comments-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: var(--comments-title-size, 30px);
  line-height: 1;
}

.comment-form {
  display: grid;
  gap: var(--comment-gap);
  margin-bottom: 18px;
}

.comment-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: var(--comment-box-min);
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
  resize: vertical;
  font: inherit;
}

.comment-textarea:focus,
.comment-textarea:focus-visible {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 1px rgba(24, 21, 18, .18);
}

.comment-form-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.comment-as { min-width: 0; color: var(--muted); }

.btn-post-comment {
  border: 0;
  background: var(--ink);
  color: #fff;
  font-weight: 900;
  padding: 11px 14px;
  white-space: nowrap;
}

.comment-list { display: grid; gap: 10px; }
.no-comments { color: var(--ink-2); }
.comment-item { border-top: 1px solid var(--line); padding-top: 12px; }
.comment-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.comment-body { margin-top: 8px; color: var(--ink-2); line-height: 1.5; overflow-wrap: anywhere; }
.comment-avatar,
.profile-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--ink);
  color: #fff;
  font-weight: 950;
  flex: 0 0 auto;
}
.comment-avatar { width: 28px; height: 28px; }

.profile-hero {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-avatar { width: 74px; height: 74px; font-size: 28px; }
.profile-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.profile-stats span { border: 1px solid var(--line); padding: 8px 10px; color: var(--muted); }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.avail-yes { color: var(--color-positive); font-weight: 900; }
.avail-no { color: var(--color-negative); font-weight: 900; }
.toast-ok { border-left: 4px solid var(--color-positive); }
.toast-err { border-left: 4px solid var(--color-negative); }

/* Deal feed row */
.deal-ledger { display: grid; }

.deal-row,
.voucher-row {
  display: grid;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  cursor: pointer;
}

.deal-row {
  --deal-row-padding: 14px 18px;
  --deal-price-col: 170px;
  --deal-community-col: 118px;
  --deal-action-col: 122px;
  grid-template-columns: var(--feed-image-col, 118px) minmax(0, 1fr) var(--deal-price-col) var(--deal-community-col) var(--deal-action-col);
  padding: var(--deal-row-padding);
}

.deal-row:hover,
.voucher-row:hover { background: #fff9ee; }

.row-image {
  width: var(--feed-image-size, 118px);
  height: var(--feed-image-height, 96px);
}

.row-image img {
  max-width: calc(var(--feed-image-size, 118px) - 10px);
  max-height: calc(var(--feed-image-height, 96px) - 10px);
}

.row-main,
.voucher-row-main { min-width: 0; }

.row-main h3,
.voucher-row-main h3 {
  min-width: 0;
  margin: 4px 0 6px;
  line-height: 1.2;
  font-size: var(--feed-title-size, 17px);
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: var(--feed-title-lines, 2);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row-main p,
.voucher-row-main p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: var(--feed-description-lines, 2);
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row-code-note {
  width: fit-content;
  max-width: 100%;
  border: 1px dashed var(--color-code-border);
  background: var(--color-code-bg);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 900;
  text-align: left;
  overflow: hidden;
}

.row-code-note span {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.row-code-note strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-labels {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.row-labels span {
  background: var(--paper-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 3px 6px;
}

.offer-meta-line {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.store-link,
.poster-line button {
  padding: 0;
  border: 0;
  background: transparent;
  font-weight: 950;
}

.store-link { color: var(--color-link); }
.poster-line button { color: var(--color-community); }
.lead-poster button { color: var(--color-brand); }

.meta-sep { color: #c5beb2; }

.row-price {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.row-price strong {
  color: var(--color-money);
  font-size: 25px;
  line-height: 1;
}

.row-price del { color: var(--muted); font-size: 12px; }
.row-price span { color: var(--color-saving); font-size: 12px; font-weight: 950; }

.row-community {
  display: grid;
  justify-items: center;
  gap: 6px;
}

.comment-count { color: var(--muted); font-size: 12px; }

.row-action,
.deal-cta {
  min-width: 0;
  max-width: 100%;
  text-decoration: none;
  border: 0;
  background: var(--color-action);
  color: #fff;
  font-weight: 950;
  text-align: center;
  padding: 12px 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-action:hover,
.deal-cta:hover { background: var(--color-action-hover); }
.deal-cta.wide { width: 100%; }

.poster-line {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.lead-poster { color: rgba(255,255,255,.72); }
.voucher-poster { margin-top: 0; }
.community-hint {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
}

/* Voucher feed row */
.voucher-row {
  grid-template-columns: var(--feed-image-col, 118px) minmax(0, 1fr) 160px 120px;
  padding: 0 18px 0 0;
  align-items: stretch;
}

.voucher-row-store {
  align-self: stretch;
  min-height: var(--feed-image-height, 96px);
  background: #181512;
  color: #fff;
  padding: 14px;
  display: grid;
  align-content: center;
  gap: 6px;
  border-right: 2px dashed var(--gold);
}

.voucher-row-store span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.voucher-row-main {
  display: grid;
  align-content: center;
  padding: 14px 0;
}

.voucher-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

/* Compact list modules and shelves */
.compact-list-module {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 18px;
}

.module-title-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.compact-list { display: grid; }

.compact-list-item {
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  padding: 10px 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  text-align: left;
  align-items: center;
}

.compact-list-item:last-child { padding-bottom: 0; }
.compact-thumb { width: 58px; height: 52px; background: var(--paper-2); border: 0; }

.compact-list-item strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.compact-list-item small { color: var(--muted); display: block; margin-top: 2px; }
.compact-list-item em { color: var(--color-saving); font-style: normal; font-weight: 900; font-size: 12px; }

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.shelf-item {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 12px;
  display: grid;
  grid-template-rows: 150px auto auto auto;
  gap: 8px;
  text-align: left;
}

.shelf-image { background: var(--paper-2); border: 0; }
.shelf-title { font-weight: 900; line-height: 1.22; }
.shelf-price { color: var(--color-money); font-weight: 950; }
.shelf-store { color: var(--muted); font-size: 12px; }

/* Community previews */
.intro-community {
  border-left: 4px solid var(--color-community);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 12px 0 12px 16px;
  max-height: 198px;
  overflow: hidden;
  display: grid;
  gap: 8px;
  align-content: stretch;
}

.intro-community-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 1.65vw, 28px);
  line-height: 1;
}

.intro-thread-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.intro-thread {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  padding: 7px 0;
  display: grid;
  gap: 1px;
  text-decoration: none;
}

.intro-thread-list.compact .intro-thread:nth-child(n+3) { display: none; }

.intro-thread span {
  color: var(--color-community);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.intro-thread strong {
  color: var(--ink);
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.intro-thread small {
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.forum-cta {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 950;
  padding: 11px 14px;
}

.forum-cta.compact { padding: 9px 12px; font-size: 13px; }
.forum-cta:hover { background: var(--color-action-hover); }

.community-market {
  border: 1px solid var(--line-dark);
  background: var(--white);
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  margin-top: 24px;
}

.community-copy,
.community-discussions { padding: 20px; }

.community-copy {
  background: #181512;
  color: #fff;
}

.community-copy .section-kicker { color: var(--color-community); }
.community-copy h2 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: clamp(28px, 2vw, 38px);
  line-height: 1;
}

.community-copy p:not(.section-kicker) { display: none; }
.community-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.community-counts span { border: 1px solid rgba(255,255,255,.18); padding: 8px 10px; font-size: 12px; }
.community-counts strong { color: #fff; }

.community-discussions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}

.community-discussions h3 {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
}

.community-discussion {
  width: 100%;
  min-width: 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  text-decoration: none;
}

.community-discussion span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--color-ui);
  color: #fff;
  font-weight: 950;
}

.community-discussion strong,
.community-discussion small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-discussion strong { white-space: nowrap; }
.community-discussion small { color: var(--muted); }
.community-discussion:hover strong { text-decoration: underline; text-decoration-thickness: 2px; }
.community-market .board-link { grid-column: 1 / -1; margin-top: 10px; }

/* Deal freshness and community correction components */
.deal-status-badge {
  border: 1px solid var(--line-dark);
  background: var(--paper-2);
  color: var(--ink);
}

.deal-status-badge.needs-check {
  border-color: var(--gold);
  background: var(--color-code-bg);
}

.deal-status-badge.expired {
  border-color: rgba(180,35,24,.35);
  color: var(--color-negative);
  background: #fff2ef;
}

.deal-status-badge.updated {
  border-color: rgba(8,122,68,.35);
  color: var(--color-positive);
  background: var(--color-money-soft);
}

.detail-status-note {
  padding: 10px 12px;
  border: 1px solid var(--gold);
  background: var(--color-code-bg);
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.35;
}

.deal-report-box {
  width: min(620px, calc(100vw - 28px));
}

.deal-report-body,
.modal-actions {
  display: grid;
  gap: 14px;
}

.modal-note {
  margin: 0;
  color: var(--muted);
}

.report-field {
  display: grid;
  gap: 6px;
}

.report-field span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.report-field input,
.report-field select,
.report-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 11px 12px;
}

.report-field textarea {
  resize: vertical;
  min-height: 110px;
}

.report-update-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 640px) {
  .report-update-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── SEO/permalink links inside deal components ─────────── */
.deal-heading-link,
.deal-title-link {
  color: inherit;
  text-decoration: none;
}

.deal-heading-link:hover,
.deal-title-link:hover,
.detail-permalink:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.detail-permalink {
  width: fit-content;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}
