/* Shared listing-card styles — used by the main dashboard (index.html /friends),
   the favorites page and the landing page's showcase, so they can never drift
   apart. Page chrome (header, nav, feed states) stays in each page. Pair this
   with card.js, which renders the markup these rules target.

   Look: the landing page's "D · Dark editorial" (#208) — plates on near-black,
   generous radii, Sora for the numbers that matter, green pills. Colours read the
   tokens from nav.css (or landing.html's own :root); every var() carries a
   fallback so the card renders the same on a page that defines neither. */

/* Card shell + collapsed (rejected) / saved states */
.listing {
  background: var(--plate, #161916); border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.05);
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
  /* Follows the app's column (--app-width in nav.css) so a card lines up with
     the panels above it. The fallback is for landing.html, which loads card.css
     but not nav.css — there the cards sit in a grid and the cap never bites. */
  width: 100%; max-width: var(--app-width, 820px);
  margin-bottom: 18px; overflow: hidden;
  position: relative;
  color: var(--text, #f3f5f2);
}
.listing.rejected { background: #1d1515; box-shadow: none; }
.listing.rejected .carousel,
.listing.rejected .carousel-no-img,
.listing.rejected .listing-meta,
.listing.rejected .listing-agency,
.listing.rejected .listing-showing,
.listing.rejected .floor-plan-link,
.listing.rejected .listing-actions,
.listing.rejected .reno-summary,
.listing.rejected .reno-badge,
.listing.rejected .new-badge,
.listing.rejected .days-badge,
.listing.rejected .invest-calc,
.listing.rejected .brf-intel,
.listing.rejected .listing-map { display: none; }
.listing.rejected .listing-body {
  position: relative;
  min-height: 64px;
  padding: 10px 96px 14px 16px;
}
.listing.rejected .listing-header { display: block; }
.listing.rejected .listing-header-actions {
  position: absolute;
  right: 16px;
  bottom: 10px;
}
.listing.rejected .location { font-size: 0.78rem; color: #6b736b; margin-bottom: 2px; }
.listing.rejected .listing-header h3 { font-size: 0.92rem; color: #9aa39a; }
.rejected-summary { display: none; font-size: 0.78rem; color: #6b736b; }
.listing.rejected .rejected-summary { display: block; }
.listing.saved { background: #13201a; border-color: rgba(76,196,106,0.28); }

/* Carousel */
.carousel {
  position: relative; width: 100%; height: 260px;
  background: #232823; overflow: hidden;
}
.carousel-track {
  display: flex; height: 100%;
  transition: transform 0.3s ease;
}
.carousel-slide {
  min-width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(11,12,11,0.55); border: none; color: #fff;
  font-size: 1.2rem; line-height: 1; width: 38px; height: 38px; cursor: pointer;
  border-radius: 50%; backdrop-filter: blur(6px); z-index: 2;
  transition: background .15s;
}
.carousel-btn:hover { background: rgba(11,12,11,0.85); }
.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }
.carousel-counter {
  position: absolute; bottom: 10px; right: 12px;
  background: rgba(11,12,11,0.6); color: #e3e8e1;
  font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  backdrop-filter: blur(6px); z-index: 2;
}
.carousel-no-img {
  width: 100%; height: 260px; background: #232823;
  display: flex; align-items: center; justify-content: center;
  color: #5a635a; font-size: 0.85rem;
}

/* Body / header / meta */
.listing-body { padding: 18px 20px 20px; }
.listing-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.listing-header h3 {
  font-family: var(--display, "Sora", sans-serif); font-weight: 800;
  font-size: 1.22rem; line-height: 1.2; letter-spacing: -0.03em; color: #fff; margin: 0;
}
.listing-header-actions { display: flex; gap: 8px; flex-shrink: 0; }
.listing-body .location { font-size: 0.86rem; color: var(--muted, #9aa39a); margin-bottom: 12px; }

.listing-meta {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 0.85rem; color: #d3dad3; margin-bottom: 12px;
}
.listing-meta span { background: var(--plate-2, #1c201c); padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.04); }
.price-tag { background: rgba(76,196,106,0.14) !important; color: var(--mint, #7fe39a) !important; font-weight: 700; border-color: rgba(76,196,106,0.25) !important; }

.listing-agency { font-size: 0.78rem; color: #6b736b; margin-bottom: 8px; }
.listing-showing { font-size: 0.8rem; color: #ffa94d; margin-bottom: 8px; }

/* Action buttons */
.listing-actions {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px;
}
.action-btn {
  flex: 1 1 auto; min-width: 130px; text-align: center; padding: 11px 14px; border: none; border-radius: 999px;
  font-family: var(--body, "Inter", sans-serif); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: filter .15s, transform .15s;
}
.action-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.reject-btn { background: #2a1818; color: #ff8888; }
.reject-btn.active { background: #4a1c1c; color: #ff6b6b; }
.save-btn-action { background: rgba(76,196,106,0.14); color: var(--mint, #7fe39a); }
.save-btn-action.active { background: linear-gradient(180deg, #4cc46a, #2f9a4b); color: #fff; }
.view-btn { background: #262b26; color: #fff; text-decoration: none; text-align: center; }
.remove-btn { background: #2a1818; color: #ff8888; }
.floor-plan-link { font-size: 0.8rem; color: var(--muted, #9aa39a); margin-bottom: 8px; }
.floor-plan-link a { color: var(--mint, #7fe39a); text-decoration: none; }
.floor-plan-link a:hover { text-decoration: underline; }

/* Renovation score badge — the landing demo card's ink chip in Sora. */
.reno-badge {
  position: absolute; top: 14px; left: 14px; z-index: 3;
  padding: 6px 12px; border-radius: 12px;
  font-family: var(--display, "Sora", sans-serif);
  font-size: 0.85rem; font-weight: 800; letter-spacing: -0.01em;
  background: rgba(11,19,13,0.88);
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.reno-badge.high   { color: var(--mint, #7fe39a); }
.reno-badge.medium { color: #ffd43b; }
.reno-badge.low    { color: #b7c0b7; }

.new-badge {
  position: absolute; top: 14px; right: 14px; z-index: 3;
  padding: 5px 11px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em;
  background: var(--mint, #7fe39a); color: var(--ink, #0b130d);
}

.days-badge {
  position: absolute; bottom: 12px; right: 12px; z-index: 3;
  padding: 4px 11px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
  background: rgba(11,12,11,0.7); color: #c3cbc3;
  backdrop-filter: blur(6px);
}
/* Stale-listing signal: a listing sitting on the market a long time is
   a flag (priced wrong / stuck), so escalate the days badge's colour. */
.days-badge.slow  { background: rgba(120,70,10,0.92); color: #ffd43b; }
.days-badge.stale { background: rgba(120,20,20,0.92); color: #ff8787; }

/* Triage-gated signal: the cheap first pass judged both wet rooms already
   renovated and skipped full scoring, so the score is a low-potential
   stand-in rather than a deep analysis. */
.gated-badge {
  position: absolute; bottom: 12px; left: 12px; z-index: 3;
  padding: 4px 11px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 600;
  background: rgba(45,45,70,0.88); color: #9aa7c7;
  backdrop-filter: blur(6px);
}

.profit-badge {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  margin: 4px;
  padding: 6px 12px; border-radius: 12px;
  font-family: var(--display, "Sora", sans-serif);
  font-size: 0.85rem; font-weight: 800; letter-spacing: -0.01em;
  backdrop-filter: blur(6px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.profit-badge.positive { background: rgba(11,19,13,0.88); color: var(--mint, #7fe39a); }
.profit-badge.negative { background: rgba(60,18,18,0.9); color: #ff8888; }
.profit-badge.neutral { background: rgba(11,12,11,0.85); color: #e3e8e1; }
.profit-badge.cautious { background: rgba(60,48,12,0.9); color: #ffd43b; }
/* Paywalled: same geometry as a real profit badge, so the feed doesn't reflow
   when someone subscribes and the numbers appear. */
.profit-badge.locked { background: rgba(11,12,11,0.85); color: #b7c0b7; font-family: var(--body, "Inter", sans-serif); font-weight: 600; }

/* Investment analysis + BRF intelligence panels: inner plates, the landing
   demo's "analysis" box. */
.invest-calc, .brf-intel {
  background: var(--plate-2, #1c201c); border-radius: 16px; padding: 16px 18px; margin-bottom: 10px;
  border: 1px solid rgba(255,255,255,0.04);
}
.invest-calc { box-shadow: inset 3px 0 0 var(--green, #4cc46a); }
.brf-intel { box-shadow: inset 3px 0 0 #5a635a; }
.invest-calc h5, .brf-intel h5 {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted, #9aa39a); margin-bottom: 10px; font-family: var(--body, "Inter", sans-serif);
}
.intel-note { color: #b7c0b7; font-size: 0.76rem; line-height: 1.45; margin-top: 8px; }
.calc-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 0.85rem; }
.calc-row .calc-label { color: var(--soft, #b7c0b7); }
.calc-row .calc-value { color: #e3e8e1; font-weight: 600; font-variant-numeric: tabular-nums; }
.calc-row.total { border-top: 1px solid #2a302a; margin-top: 6px; padding-top: 10px; font-weight: 600; }
.calc-row.total .calc-label { color: #fff; }
.calc-row.total .calc-value { color: #fff; }
.calc-row.profit { align-items: baseline; }
.calc-row.profit .calc-value { color: var(--green, #4cc46a); font-family: var(--display, "Sora", sans-serif); font-weight: 800; font-size: 1.1rem; }
.calc-row.profit .calc-label { color: var(--green, #4cc46a); font-weight: 600; }
.calc-row.loss .calc-value { color: #ff8888; }
.calc-row.loss .calc-label { color: #ff8888; }
.calc-row.sale .calc-value { color: var(--mint, #7fe39a); font-weight: 700; }
.calc-divider { border-top: 1px solid #2a302a; margin: 8px 0; }

.listing-map { width: 100%; height: 160px; border-radius: 16px; margin-bottom: 10px; z-index: 1; }

.reno-summary {
  font-size: 0.86rem; line-height: 1.55; color: #d3dad3; margin-bottom: 10px;
  padding: 12px 14px; background: var(--plate-2, #1c201c); border-radius: 14px;
  border-left: 3px solid #363d36;
}
.reno-summary.high   { border-left-color: var(--green, #4cc46a); }
.reno-summary.medium { border-left-color: #ffd43b; }
.reno-summary.low    { border-left-color: #5a635a; }
.reno-cost { font-weight: 600; color: #d3dad3; }
.coverage-warn {
  font-size: 0.76rem; color: #ffd43b; margin-bottom: 10px;
  padding: 8px 12px; background: rgba(120,70,10,0.22); border-radius: 12px;
  border-left: 3px solid #ffd43b;
}
.listing.rejected .coverage-warn { display: none; }

.cb-btn {
  background: rgba(255,255,255,0.05); border: none; border-radius: 999px;
  width: 36px; height: 36px; padding: 0; cursor: pointer; font-size: 1rem;
  transition: background .15s;
}
.cb-btn:hover { background: rgba(255,255,255,0.1); }
.cb-btn.active-reject { background: rgba(90,26,26,0.9); }
.cb-btn.active-save   { background: rgba(26,90,26,0.9); }

/* Room-by-room breakdown */
.reno-detail { display: none; margin-bottom: 10px; }
.reno-detail.open { display: block; }
.reno-detail-toggle {
  font-size: 0.82rem; font-weight: 600; color: var(--mint, #7fe39a); background: none; border: none;
  font-family: var(--body, "Inter", sans-serif); cursor: pointer; padding: 4px 0; margin-bottom: 8px;
}
.reno-detail-toggle:hover { color: #b5f0c4; }
.reno-room {
  background: var(--plate-2, #1c201c); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  border-left: 3px solid #2a302a;
}
.reno-room.needs-work { border-left-color: #ffd43b; }
.reno-room.good { border-left-color: var(--green, #4cc46a); }
/* A redacted room cost is not a zero one: neutral, never the green that means
   "no work needed". */
.reno-room.locked { border-left-color: #5a635a; }
/* Stands in for the street address on a free account. Muted, not alarming —
   it is a thing you can buy, not an error. */
.identity-locked { color: #8a928a; font-style: italic; font-family: var(--body, "Inter", sans-serif); font-weight: 500; letter-spacing: 0; }
.reno-room-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.reno-room-header h5 { font-size: 0.86rem; color: #fff; text-transform: capitalize; }
.reno-room-header .room-cost { font-size: 0.8rem; color: #ff8888; font-weight: 600; }
.reno-room-header .room-cost.none { color: var(--green, #4cc46a); }

/* The subscription upsell that stands in for the investment analysis and the
   sold-comp panel on a locked card. */
.locked-panel {
  margin-top: 12px;
  padding: 18px 20px;
  border: 1px solid rgba(76,196,106,0.22);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(76,196,106,0.10), rgba(76,196,106,0.02));
}
.locked-panel h5 { font-family: var(--display, "Sora", sans-serif); font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; color: #fff; margin-bottom: 6px; }
.locked-panel p { font-size: 0.84rem; color: var(--soft, #b7c0b7); line-height: 1.55; margin-bottom: 14px; }
.locked-cta {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 999px;
  background: linear-gradient(180deg, #4cc46a, #2f9a4b);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(76,196,106,0.28);
  transition: filter .15s, transform .15s;
}
.locked-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.reno-room .condition { font-size: 0.76rem; color: var(--muted, #9aa39a); margin-bottom: 4px; text-transform: capitalize; }
.reno-room .indicators { font-size: 0.78rem; color: var(--soft, #b7c0b7); line-height: 1.45; }
.reno-room .indicators li { margin-left: 14px; margin-bottom: 2px; }

/* Login prompt modal (shown when a signed-out visitor saves/rejects) */
.login-prompt {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.72); backdrop-filter: blur(4px); z-index: 100;
  align-items: center; justify-content: center;
}
.login-prompt.visible { display: flex; }
.login-box {
  background: var(--plate, #161916); border-radius: 26px; border: 1px solid rgba(255,255,255,0.06);
  padding: 34px 28px; text-align: center; max-width: 360px; width: 90%;
  box-shadow: 0 30px 70px rgba(0,0,0,0.55);
}
.login-box h3 { color: #fff; margin-bottom: 8px; font-size: 1.3rem; font-family: var(--display, "Sora", sans-serif); letter-spacing: -0.03em; }
.login-box p  { color: var(--soft, #b7c0b7); font-size: 0.9rem; line-height: 1.5; margin-bottom: 22px; }
.dismiss { margin-top: 12px; background: none; border: none; color: #6b736b; font-size: 0.86rem; cursor: pointer; font-family: inherit; }
.dismiss:hover { color: #b7c0b7; }

/* Share-link modal — a clear "copy this, then paste it" flow (no OS share sheet) */
.share-modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.72); backdrop-filter: blur(4px); z-index: 100; align-items: center; justify-content: center; padding: 20px; }
.share-modal.visible { display: flex; }
.share-box { background: var(--plate, #161916); border: 1px solid rgba(255,255,255,0.06); border-radius: 26px; padding: 28px; max-width: 460px; width: 100%; box-sizing: border-box; box-shadow: 0 30px 70px rgba(0,0,0,0.55); }
.share-box h3 { color: #fff; margin-bottom: 6px; font-size: 1.3rem; font-family: var(--display, "Sora", sans-serif); letter-spacing: -0.03em; }
.share-box p { color: var(--soft, #b7c0b7); font-size: 0.88rem; margin-bottom: 14px; line-height: 1.5; }
.share-box textarea { width: 100%; box-sizing: border-box; background: #0f110f; color: #f3f5f2; border: 1px solid #2a302a; border-radius: 14px; padding: 12px 14px; font-size: 0.92rem; font-family: inherit; line-height: 1.45; resize: vertical; }
.share-copy-btn { display: block; width: 100%; margin-top: 14px; background: linear-gradient(180deg, #4cc46a, #2f9a4b); color: #fff; border: none; border-radius: 999px; padding: 14px; font-size: 0.98rem; font-weight: 700; cursor: pointer; font-family: inherit; box-shadow: 0 8px 24px rgba(76,196,106,0.3); }
.share-copy-btn.copied { background: #262b26; color: var(--mint, #7fe39a); box-shadow: none; }

/* Google sign-in button (used inside the login modal): the landing's green pill,
   matching nav.css's sign-in button. */
.google-btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(180deg, #4cc46a, #2f9a4b); color: #fff;
  font-family: var(--body, "Inter", sans-serif); font-size: 0.9rem; font-weight: 700;
  padding: 12px 22px; border-radius: 999px; text-decoration: none; border: 0;
  box-shadow: 0 6px 20px rgba(76,196,106,0.28);
}
.google-btn:hover { filter: brightness(1.08); }
.google-btn img { width: 16px; height: 16px; border-radius: 50%; background: #fff; padding: 1px; }


/* "Kommande" (pre-market) listings: announced before open-market bidding, so they
   have no asking price and deliberately carry no profit badge. The badge and the
   valuation row exist to make that state obvious rather than looking like missing
   data. */
.upcoming-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(90, 60, 160, 0.92);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}
.calc-box.upcoming-calc {
  border-left: 3px solid rgba(90, 60, 160, 0.9);
}

/* ---------------------------------------------------------------------------
   Feed controls (view tabs, sort tabs, filter pills).
   Lives here, next to the shared card, because more than one page shows the
   same feed: the dashboard and Favorites both mount these via FlipControls.
   Kept out of any single page's <style> so the two can't drift apart — the
   same reason the card itself is one module.
   --------------------------------------------------------------------------- */
/* width + max-width match every other block in the column (#stats, .filter-bar,
   .nav-menu), so the row can't hang off the column edges. */
.view-tabs {
  width: 100%; max-width: var(--app-width, 820px);
  display: flex; gap: 8px; margin: 18px 0 8px;
  justify-content: center; flex-wrap: wrap;
}
.view-tab {
  padding: 10px 16px; border-radius: 999px; cursor: pointer;
  font-family: var(--body, "Inter", sans-serif);
  font-size: 0.86rem; font-weight: 600;
  background: var(--plate, #161916); color: var(--soft, #b7c0b7); border: 1px solid rgba(255,255,255,0.06);
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.view-tab:hover { color: #fff; background: #1c201c; }
.view-tab.active {
  background: linear-gradient(180deg, #7fe39a, #4cc46a); color: var(--ink, #0b130d);
  border-color: transparent; font-weight: 700;
  box-shadow: 0 6px 18px rgba(76,196,106,0.28);
}
/* Sort toggle reuses the tab look but in light-on-dark, so it reads as a
   different control from the green view tabs. */
.sort-tab { padding: 7px 14px; font-size: 0.8rem; }
.sort-tab.active { background: var(--light, #f2f5f1); color: var(--ink, #0b130d); border-color: transparent; box-shadow: none; }

.filter-bar {
  width: 100%; max-width: var(--app-width, 820px);
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  margin-bottom: 14px;
}
.filter-btn {
  padding: 6px 13px; border: 1px solid #2a302a; border-radius: 999px;
  background: transparent; color: var(--muted, #9aa39a);
  font-family: var(--body, "Inter", sans-serif); font-size: 0.8rem; font-weight: 500;
  cursor: pointer; transition: all 0.2s;
}
.filter-btn:hover { border-color: #5a635a; color: #e3e8e1; }
.filter-btn.active { background: rgba(76,196,106,0.14); border-color: var(--green, #4cc46a); color: var(--mint, #7fe39a); }
