/* LaundroLab Site Feed — denser Zillow-like cards; brand tokens from brand kit */
:root {
  --zodiac: #0F1B48;
  --pink: #FF3EB3;
  --blue-2u: #2E7DE1;
  --space: #5C708B;
  --cement-blue: #F1F4FF;
  --cherry: #FFECF4;
  --cement-grey: #C9CCD6;
  --robins: #EAF8FF;
  --white: #ffffff;
  --border: rgba(15, 27, 72, 0.08);
  --shadow: 0 1px 3px rgba(15, 27, 72, 0.06), 0 1px 2px rgba(15, 27, 72, 0.04);
  --shadow-hover: 0 4px 14px rgba(15, 27, 72, 0.1);
  --radius: 8px;
  --radius-sm: 6px;
  --font: "Proxima Soft", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tour: var(--pink);
  --call: var(--blue-2u);
  --pass: var(--space);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--space);
  background: var(--cement-blue);
}

body { line-height: 1.4; font-size: 14px; }

a { color: var(--blue-2u); text-decoration: none; }
a:hover { text-decoration: underline; }

/* —— Header —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 52px;
  padding: 0.55rem 1rem;
  background: var(--zodiac);
  color: var(--white);
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.brand-logo {
  display: block;
  width: auto;
  height: 34px;
  max-width: min(170px, 28vw);
  object-fit: contain;
  flex: 0 0 auto;
}

.brand h1 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--white);
}

.brand .sub {
  margin: 0;
  font-size: 0.68rem;
  color: var(--cement-grey);
  font-weight: 500;
}

.funnel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.funnel-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cement-blue);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.funnel-chip strong { color: var(--white); font-size: 0.82rem; }
.funnel-chip.tour strong { color: var(--pink); }
.funnel-chip.call strong { color: #7eb6ff; }
.funnel-chip.pass strong { color: var(--cement-grey); }

/* —— Layout —— */
.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - 52px);
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static !important; border-right: none; border-bottom: 1px solid var(--cement-grey); height: auto !important; }
}

.sidebar {
  position: sticky;
  top: 52px;
  align-self: start;
  height: calc(100vh - 52px);
  overflow-y: auto;
  padding: 0.9rem 0.85rem;
  background: var(--white);
  border-right: 1px solid var(--border);
}

.sidebar h2 {
  margin: 0 0 0.45rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--zodiac);
  font-weight: 700;
}

.sidebar section { margin-bottom: 1rem; }

.sidebar label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--zodiac);
  margin-bottom: 0.25rem;
}

.sidebar select,
.sidebar input[type="number"],
.sidebar input[type="search"] {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--cement-grey);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--zodiac);
  font-family: inherit;
  font-size: 0.82rem;
}

.sidebar select:focus,
.sidebar input:focus {
  outline: 2px solid var(--blue-2u);
  outline-offset: 1px;
}

.status-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.status-toggles label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  color: var(--space);
  cursor: pointer;
  margin: 0;
  font-size: 0.8rem;
}

.status-toggles input { accent-color: var(--blue-2u); }

.range-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.range-row input[type="range"] {
  flex: 1;
  accent-color: var(--pink);
}

.range-val {
  min-width: 1.6rem;
  font-weight: 700;
  color: var(--zodiac);
  font-size: 0.85rem;
}

.btn-reset {
  width: 100%;
  margin-top: 0.15rem;
  padding: 0.4rem;
  border: 1px solid var(--cement-grey);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--zodiac);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
}

.btn-reset:hover { background: var(--cement-blue); }

.hint {
  font-size: 0.65rem;
  color: var(--space);
  margin-top: 0.4rem;
  line-height: 1.35;
}

/* —— Main —— */
.main {
  padding: 0.75rem 0.85rem 1.75rem;
  min-width: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.toolbar .result-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--zodiac);
}

.toolbar .result-count span { color: var(--space); font-weight: 500; }

.sort-select {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--cement-grey);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--zodiac);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
}

/* —— Cards (dense grid) —— */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 0.55rem;
}

@media (min-width: 1200px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); }
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.12s ease;
  display: flex;
  flex-direction: column;
}

.card:hover { box-shadow: var(--shadow-hover); }

.card.is-active {
  outline: 2px solid var(--blue-2u);
  outline-offset: 0;
}

.card-media {
  position: relative;
  height: 96px;
  background: #dce3f0;
  overflow: hidden;
}

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

.card-media .ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 0.45rem 0.5rem;
  background: #d8dee9;
  color: var(--space);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  position: relative;
}

.card-media .ph::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
  background: var(--blue-2u);
  opacity: 0.45;
}

.card-media .ph.tour::after { background: var(--pink); opacity: 0.55; }
.card-media .ph.call::after { background: var(--blue-2u); }
.card-media .ph.pass::after { background: var(--space); opacity: 0.4; }

.card-media .ph-inner { display: none; }

.card-overlays {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.4rem;
}

.score-pill {
  background: rgba(255, 255, 255, 0.95);
  color: var(--zodiac);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(15, 27, 72, 0.12);
  line-height: 1.2;
}

.score-pill .lbl {
  display: block;
  font-size: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--space);
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--white);
}

.badge.tour { background: var(--pink); }
.badge.call { background: var(--blue-2u); }
.badge.pass { background: var(--space); }
.badge.new { background: var(--cement-grey); color: var(--zodiac); }

.card-body {
  padding: 0.55rem 0.6rem 0.55rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 0;
}

.card-body h3 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--zodiac);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-line {
  font-size: 0.7rem;
  color: var(--space);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.1rem;
}

.chip {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.12rem 0.35rem;
  border-radius: 4px;
  background: var(--cement-blue);
  color: var(--zodiac);
}

.chip.territory { background: var(--robins); }
.chip.flag {
  background: var(--cherry);
  color: #a0186a;
}

.card-footer {
  margin-top: auto;
  padding-top: 0.35rem;
  font-size: 0.65rem;
  color: var(--space);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem;
}

.card-footer-left {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.card-date {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--zodiac);
  opacity: 0.85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-date.is-fallback {
  font-weight: 500;
  color: var(--space);
  opacity: 0.9;
}

.card-ext {
  pointer-events: auto;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--blue-2u);
  text-decoration: none;
  white-space: nowrap;
}

.card-ext:hover { text-decoration: underline; }
.card-ext.is-disabled {
  color: var(--cement-grey);
  font-weight: 500;
  pointer-events: none;
  cursor: default;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem 1rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  color: var(--space);
}

.empty strong { color: var(--zodiac); display: block; margin-bottom: 0.35rem; }

/* —— Detail drawer —— */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 27, 72, 0.32);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100vh;
  background: var(--white);
  z-index: 60;
  box-shadow: -4px 0 24px rgba(15, 27, 72, 0.12);
  transform: translateX(100%);
  transition: transform 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer.open { transform: translateX(0); }

.drawer-header {
  padding: 0.85rem 1rem;
  background: var(--zodiac);
  color: var(--white);
  flex-shrink: 0;
}

.drawer-header .close {
  float: right;
  background: transparent;
  border: none;
  color: var(--cement-grey);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.2rem;
}

.drawer-header .close:hover { color: var(--white); }

.drawer-header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  padding-right: 1.75rem;
}

.drawer-header .loc {
  font-size: 0.78rem;
  color: var(--cement-grey);
  margin: 0;
}

.drawer-hero {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
  background: #e8edf7;
  flex-shrink: 0;
}

.drawer-hero-ph {
  height: 72px;
  background: #e8edf7;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-hero-ph .dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--zodiac);
  opacity: 0.15;
}

.drawer-body {
  padding: 0.9rem 1rem 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.drawer-section { margin-bottom: 1.1rem; }

.drawer-section h3 {
  margin: 0 0 0.5rem;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--zodiac);
  font-weight: 700;
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.stat {
  background: var(--cement-blue);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.55rem;
}

.stat .k {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--space);
  font-weight: 600;
}

.stat .v {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--zodiac);
  margin-top: 0.1rem;
}

.score-bars { display: flex; flex-direction: column; gap: 0.35rem; }

.score-bar-row {
  display: grid;
  grid-template-columns: 100px 1fr 32px;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
}

.score-bar-row .name { color: var(--space); font-weight: 500; }
.score-bar-row .pts { text-align: right; font-weight: 700; color: var(--zodiac); }

.bar-track {
  height: 6px;
  background: var(--cement-grey);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--blue-2u);
  min-width: 0;
}

.flag-list, .note-list, .check-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.flag-list li {
  background: var(--cherry);
  color: #8b1258;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.note-list li, .check-list li {
  font-size: 0.78rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--cement-blue);
  color: var(--space);
}

.check-list li::before {
  content: "☐ ";
  color: var(--blue-2u);
}

.hl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.hl {
  background: var(--robins);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.5rem;
}

.hl .k { font-size: 0.62rem; color: var(--space); font-weight: 600; text-transform: uppercase; }
.hl .v { font-size: 0.88rem; font-weight: 700; color: var(--zodiac); }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.4rem;
  padding: 0.5rem 0.85rem;
  background: var(--blue-2u);
  color: var(--white) !important;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.8rem;
  text-decoration: none !important;
}

.btn-link:hover { filter: brightness(1.06); }
.btn-link.is-disabled {
  background: var(--cement-grey);
  color: var(--zodiac) !important;
  pointer-events: none;
  opacity: 0.7;
}

.muted { color: var(--space); font-size: 0.75rem; }
.hard-fail {
  background: #fff3f3;
  border-left: 3px solid #c44;
  padding: 0.45rem 0.6rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.78rem;
  color: #8a2020;
  margin-bottom: 0.65rem;
}

.loading {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--zodiac);
  font-weight: 600;
}
