:root {
  /* Sea-wave palette — light, green–cyan–blue, high readability */
  --bg: #e8f6f8;
  --bg-elevated: #ffffff;
  --card: #ffffff;
  --card-solid: #ffffff;
  --border: rgba(14, 116, 144, 0.16);
  --border-focus: rgba(8, 145, 178, 0.5);
  --text: #0c4a6e;
  --muted: #5b7c8a;
  --accent: #0d9488;
  --accent-2: #0284c7;
  --accent-blue: #0369a1;
  --accent-purple: #0e7490;
  --accent-grad: linear-gradient(135deg, #14b8a6 0%, #0ea5e9 55%, #0284c7 100%);
  --accent-soft: rgba(13, 148, 136, 0.14);
  --good: #059669;
  --warn: #d97706;
  --bad: #dc2626;
  --tier-low: #059669;
  --tier-mid: #d97706;
  --tier-high: #dc2626;
  --radius: 12px;
  --shadow: 0 4px 18px rgba(8, 47, 73, 0.07);
  --font: "Outfit", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --hdr-h: 54px;
  --surface: #f0fbfd;
  --surface-2: #dff5f7;
  --line: rgba(14, 116, 144, 0.14);
  --sea-deep: #0e7490;
  --sea-foam: #ccfbf1;
  --sea-sky: #e0f2fe;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font); background:
    radial-gradient(1200px 700px at 8% -12%, rgba(20, 184, 166, 0.16), transparent 55%),
    radial-gradient(1000px 600px at 92% 0%, rgba(14, 165, 233, 0.14), transparent 50%),
    radial-gradient(800px 500px at 50% 100%, rgba(45, 212, 191, 0.08), transparent 55%),
    var(--bg);
  color: var(--text); line-height: 1.5; min-height: 100vh;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .9rem 1.25rem; border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 20;
}
.topbar-actions { display: flex; gap: .45rem; align-items: center; }
h1 { margin: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
h2 { margin: 0 0 .6rem; font-size: 1.05rem; font-weight: 700; }
.glass {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.sub, .hint, .empty, .status { color: var(--muted); font-size: .82rem; }
.hint code { background: #e0f2fe; padding: .05rem .3rem; border-radius: 4px; font-size: .72rem; }
.shell {
  display: grid; grid-template-columns: 280px 1fr; min-height: calc(100vh - 70px);
}
@media (max-width: 900px) { .shell { grid-template-columns: 1fr; } }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.scan-sidebar { border-radius: 0; border-top: 0; border-left: 0; border-bottom: 0; padding: 1rem; overflow: auto; max-height: calc(100vh - 70px); }
.scan-list { display: flex; flex-direction: column; gap: .4rem; }
.scan-item {
  text-align: left; width: 100%; margin: 0; padding: .55rem .65rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); cursor: pointer; font: inherit;
}
.scan-item:hover { border-color: rgba(13, 148, 136, .4); background: #f1f5f9; }
.scan-item.active { border-color: var(--accent); background: var(--accent-soft); }
.scan-item .t { font-weight: 600; font-size: .85rem; display: block; }
.scan-item .m { font-size: .72rem; color: var(--muted); }
.scan-item.compare-on { border-color: #22c55e; }
.scan-item-inner { display: flex; gap: .45rem; align-items: flex-start; width: 100%; }
.scan-item input[type=checkbox] { width: auto; margin: .15rem 0 0; flex-shrink: 0; }
.scan-item-body {
  flex: 1; min-width: 0; text-align: left; background: transparent; border: none;
  color: inherit; padding: 0; margin: 0; cursor: pointer; font: inherit;
}
.scan-item-body:hover { background: transparent; }
.sidebar-actions { display: flex; gap: .35rem; margin-bottom: .65rem; }
.sidebar-actions button { margin: 0; font-size: .78rem; padding: .4rem .5rem; flex: 1; }
.sidebar-delete { margin-bottom: .75rem; padding: .55rem .6rem; background: #fef2f2; border: 1px solid #4a2030; border-radius: 8px; }
.sidebar-del-hint { margin: 0 0 .4rem; font-size: .7rem; }
.sidebar-delete-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.sidebar-delete-actions button { margin: 0; font-size: .76rem; padding: .38rem .5rem; flex: 1; min-width: 4.5rem; }
.btn-danger { background: #991b1b; color: #fecaca; border: 1px solid #b91c1c; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-danger:disabled { opacity: .45; cursor: not-allowed; }
.scan-item.marked-del { border-color: #b91c1c; background: #fef2f2; }
.scan-del-cb { accent-color: #ef4444; }
.scan-del-one {
  width: auto; margin: 0; padding: .1rem .35rem; flex-shrink: 0;
  background: transparent; border: 1px solid transparent; color: #f87171;
  font-size: 1rem; line-height: 1; border-radius: 6px; cursor: pointer;
}
.scan-del-one:hover { background: #3f1515; border-color: #7f1d1d; }
.compare-panel { margin-bottom: 1.25rem; }
.compare-panel h3 { font-size: .95rem; margin: 0 0 .5rem; }
.insights { margin: 0; padding-left: 1.1rem; }
.insights li { margin: .4rem 0; color: #c7d2e5; font-size: .88rem; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: .78rem; margin-bottom: 1rem; }
.cmp-table th, .cmp-table td { border-bottom: 1px solid var(--border); padding: .45rem .35rem; text-align: left; vertical-align: top; }
.cmp-table th { color: var(--muted); font-weight: 600; }
.cmp-table tr.best td { background: rgba(34, 197, 94, 0.08); }
.cmp-table .win { color: #86efac; font-size: .7rem; }
.room-row { font-size: .82rem; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.room-row strong { display: block; margin-bottom: .2rem; }
.view-tabs { display: flex; gap: .35rem; margin-bottom: .75rem; }
.report-main { padding: 1rem 1.25rem 2rem; overflow: auto; }
.report-head { margin-bottom: 1rem; }
.report-head h2 { font-size: 1.15rem; margin-bottom: .25rem; }
.source-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin: .75rem 0; }
.tab {
  width: auto; margin: 0; padding: .35rem .7rem; font-size: .78rem;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.stats-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 1rem; }
.stat-pill { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: .25rem .6rem; font-size: .75rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; }
.cards-dense {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .45rem;
}
.cards-dense .card img, .cards-dense .placeholder, .cards-dense .carousel-stage { height: 110px; }
.cards-dense .card .body { padding: .45rem .5rem .55rem; }
.cards-dense .card .title { font-size: .8rem; margin-bottom: .25rem; line-height: 1.25; }
.cards-dense .card-tap-hint { display: none; }
.cards-dense .chip { font-size: .62rem; padding: .08rem .32rem; }
.layout-switch {
  display: flex; flex-wrap: wrap; gap: .35rem; margin: .45rem 0 .55rem; align-items: center;
}
.layout-btn {
  font-family: inherit; font-size: .75rem; font-weight: 700;
  padding: .35rem .65rem; min-height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: #ffffff; color: var(--text); cursor: pointer;
}
.layout-btn.active, .layout-btn:hover {
  border-color: #6366f1; background: rgba(99, 102, 241, .15);
}
.listing-table-wrap { overflow-x: auto; margin-top: .35rem; border-radius: 12px; border: 1px solid var(--border); }
.listing-table {
  width: 100%; border-collapse: collapse; font-size: .78rem; background: #ffffff;
}
.listing-table th, .listing-table td {
  padding: .4rem .5rem; border-bottom: 1px solid #e2e8f0; text-align: left; vertical-align: middle;
}
.listing-table th { background: #f8fafc; color: var(--muted); font-weight: 700; font-size: .7rem; position: sticky; top: 0; }
.listing-table tr.table-row:hover { background: rgba(13, 148, 136, .06); cursor: pointer; }
.table-thumb {
  width: 56px; height: 42px; object-fit: cover; border-radius: 6px; display: block; background: #e0f2fe;
}
.table-thumb.ph {
  display: flex; align-items: center; justify-content: center; font-size: .85rem; color: #64748b;
}
.td-title strong { font-size: .8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.td-price { font-weight: 800; white-space: nowrap; color: #0e7490; font-size: .88rem; }
.td-price-sub { display: block; font-size: .68rem; font-weight: 600; color: var(--muted); }
/* Light sea cards — readable titles/chips */
.card {
  background: #ffffff !important;
  border: 1px solid var(--border) !important;
  border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow);
  color: var(--text);
}
.card-img-wrap { position: relative; background: #e0f2fe; }
.card img, .card .carousel-img { width: 100%; height: 140px; object-fit: cover; background: #bae6fd; display: block; }
.card-img-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.card-img-link:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: -2px;
}
.detail-img-link { display: block; margin-bottom: .65rem; }
.detail-img-link img { margin-bottom: 0; }
.card.card-clickable { cursor: pointer; transition: border-color .15s, transform .15s, box-shadow .15s; }
.card.card-clickable:hover { border-color: #0ea5e9; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(14,116,144,.12); }
.card.card-clickable .card-tap-hint { font-size: .68rem; color: var(--muted); margin: .35rem 0 .2rem; }
.card-hist-badge {
  position: absolute; bottom: .4rem; left: .4rem; z-index: 2;
  background: rgba(255, 255, 255, 0.94); border: 1px solid var(--accent);
  color: #0e7490; font-size: .68rem; font-weight: 700; padding: .15rem .4rem; border-radius: 6px;
}
.card.highlight-pulse { animation: pulse-highlight 1.2s ease 2; border-color: #3b82f6; }
@keyframes pulse-highlight {
  0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
  50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.35); }
}
.cross-scan-row {
  display: grid; grid-template-columns: 1fr auto; gap: .25rem .5rem;
  padding: .3rem 0; border-bottom: 1px dashed rgba(42, 53, 72, 0.8);
}
.cross-scan-row:last-child { border-bottom: none; }
.cross-scan-row.current { background: rgba(59, 130, 246, 0.12); margin: 0 -.35rem; padding: .35rem; border-radius: 6px; }
.cross-scan-row .cs-date { color: var(--muted); font-size: .68rem; }
.cross-scan-row .cs-price { font-weight: 700; text-align: right; }
.cross-scan-row .cs-price.cheaper { color: #059669; }
.cross-scan-row .cs-price.dearer { color: #dc2626; }
.detail-card { width: min(640px, 96vw); max-height: 92vh; overflow: auto; }
.detail-card img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; margin-bottom: .65rem; }
.detail-chips { margin: .5rem 0; }
.detail-history { margin-top: .85rem; }
.detail-history h4 { margin: 0 0 .25rem; font-size: .92rem; }
.detail-hint { margin: 0 0 .5rem; font-size: .78rem; }
.detail-summary {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: .45rem; margin-bottom: .65rem; padding: .55rem; background: var(--sea-sky);
  border: 1px solid var(--border); border-radius: 8px;
}
.detail-summary-item { font-size: .78rem; }
.detail-summary-item .ds-label { display: block; color: var(--muted); font-size: .68rem; }
.detail-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.detail-scan-table { width: 100%; border-collapse: collapse; font-size: .76rem; }
.detail-scan-table th, .detail-scan-table td {
  border-bottom: 1px solid var(--border); padding: .45rem .35rem; text-align: left; vertical-align: top;
}
.detail-scan-table th { color: var(--muted); font-weight: 600; font-size: .7rem; }
.detail-scan-table .cs-date { color: var(--muted); font-size: .66rem; margin-top: .1rem; }
.detail-scan-table .cs-price { font-weight: 700; white-space: nowrap; }
.detail-scan-table .cs-price.cheaper { color: #059669; }
.detail-scan-table .cs-price.dearer { color: #dc2626; }
.detail-scan-table tr.detail-row-current { background: rgba(14, 165, 233, 0.1); }
.detail-actions { margin-top: .75rem; }
.detail-ext-link { color: #0369a1; font-size: .82rem; font-weight: 600; }
.card .detail-ext-link { position: relative; z-index: 2; }
.card .body { padding: .65rem .75rem .75rem; background: #ffffff !important; }
.card .title { font-weight: 700; font-size: .88rem; margin-bottom: .35rem; color: #0c4a6e !important; }
.card .empty, .card .m, .card .card-tap-hint { color: var(--muted) !important; }
.card .detail-ext-link, .card a.detail-ext-link { color: #0369a1 !important; }
.chips { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .4rem; }
.chip { font-size: .68rem; padding: .12rem .4rem; border-radius: 999px; background: #e0f2fe; color: #0c4a6e; font-weight: 600; }
.chip.deal { background: #ccfbf1; color: #0f766e; font-weight: 800; }
.chip.good { background: #d1fae5; color: #065f46; }
.chip.sea { background: #e0f2fe; color: #075985; }
.chip.sea-map { background: #cffafe; color: #0e7490; }
.chip.warn { background: #fef3c7; color: #92400e; }
.chip.bad { background: #fee2e2; color: #991b1b; }
.chip.muted { background: #f1f5f9; color: #64748b; }
.chip.rating, .chip.score { background: #dbeafe; color: #1e40af; }
.chip.src-airbnb { background: #fce7f3; color: #9d174d; }
.chip.src-booking { background: #dbeafe; color: #1e40af; }
.chip.src-other { background: #e2e8f0; color: #334155; }
.chip.src-all { background: #ccfbf1; color: #0f766e; }
.card .chip { background: #e0f2fe !important; color: #0c4a6e !important; }
.card .chip.deal { background: #ccfbf1 !important; color: #0f766e !important; font-weight: 800 !important; }
.card .chip.warn { background: #fef3c7 !important; color: #92400e !important; }
.card .chip.good { background: #d1fae5 !important; color: #065f46 !important; }
.card .chip.sea, .card .chip.sea-map { background: #e0f2fe !important; color: #075985 !important; }
.card .chip.bad { background: #fee2e2 !important; color: #991b1b !important; }
.card .chip.src-airbnb { background: #fce7f3 !important; color: #9d174d !important; }
.card .chip.src-booking { background: #dbeafe !important; color: #1e40af !important; }
.card .chip.rating, .card .chip.score { background: #dbeafe !important; color: #1e40af !important; }
.cell-best { background: rgba(16, 185, 129, 0.12) !important; font-weight: 600; }
.cell-worst { background: rgba(239, 68, 68, 0.08) !important; }
.panel-accent { border-left: 4px solid #14b8a6; }
.panel-primary { border-left: 4px solid #0ea5e9; }
.compare-panel { background: #ffffff; border: 1px solid var(--border); border-radius: 10px; padding: .85rem; margin-bottom: 1rem; }
.cmp-table .win { color: #059669; font-weight: 600; font-size: .72rem; }
.card a { color: #0369a1; font-size: .78rem; }
.placeholder { height: 140px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .75rem; }
button, input, textarea, select {
  width: 100%; font: inherit; border-radius: 8px; border: 1px solid var(--border);
  background: #fff; color: var(--text); padding: .5rem .65rem;
}
button { margin-top: .5rem; cursor: pointer; font-weight: 600; border: none; background: var(--accent); color: #fff; }
.btn-secondary { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); width: auto; margin: 0; }
.btn-accent { background: #2563eb; }
.icon-btn { width: auto; margin: 0; padding: .2rem .55rem; background: transparent; border: 1px solid var(--border); font-size: 1.2rem; }
label { display: block; font-size: .82rem; color: var(--muted); margin: .55rem 0 .2rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.modal-card { position: relative; z-index: 1; width: min(520px, 94vw); max-height: 90vh; overflow: auto; padding: 1rem; }
.toast-card { width: min(420px, 92vw); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .75rem; }
.suggestions { max-height: 140px; overflow: auto; border: 1px solid var(--border); border-radius: 8px; margin-bottom: .5rem; }
.suggestion {
  display: block; width: 100%; text-align: left; margin: 0; border: 0; border-bottom: 1px solid var(--border);
  border-radius: 0; background: #ffffff; padding: .4rem .6rem; font-size: .82rem;
}
.selected-cities { display: flex; flex-wrap: wrap; gap: .35rem; margin: .35rem 0 .75rem; min-height: 1.5rem; }
.city-tag {
  display: inline-flex; align-items: center; gap: .35rem; background: #e0f2fe;
  border-radius: 999px; padding: .2rem .55rem; font-size: .75rem;
}
.city-tag button { width: auto; margin: 0; padding: 0 .2rem; background: transparent; border: none; color: #f87171; font-size: .9rem; }
.report-link { margin-top: .75rem; font-size: .82rem; }
.report-link a { color: #93c5fd; }
.source-filter-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.src-check {
  display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .55rem;
  border-radius: 8px; border: 1px solid var(--border); background: #ffffff;
  font-size: .76rem; cursor: pointer; user-select: none;
}
.src-check.on { border-color: var(--accent); background: #ccfbf1; }
.src-check input { width: auto; margin: 0; padding: 0; }
.src-all-btn.active { background: #0f766e; border-color: #14b8a6; }
.compare-hero {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .65rem; margin-bottom: 1rem;
}
.hero-card {
  display: flex; gap: .65rem; align-items: flex-start; padding: .75rem;
  border-radius: 10px; border: 1px solid var(--border); background: #ffffff;
}
.hero-card.hero-price { border-left: 4px solid var(--tier-low); }
.hero-card.hero-sea { border-left: 4px solid #06b6d4; }
.hero-card.hero-cancel { border-left: 4px solid var(--accent); }
.hero-icon { font-size: 1.5rem; line-height: 1; }
.hero-card strong { display: block; font-size: .78rem; color: var(--muted); }
.hero-card p { margin: .15rem 0; font-size: .82rem; font-weight: 600; }
.hero-val { font-size: .95rem; color: #fde68a; font-weight: 700; }
.priority-1 { order: -2; }
.priority-2 { order: -1; }
.panel-warn { border-left: 4px solid var(--warn); }
.stat-pill.stat-price { border-color: #713f12; color: #fde68a; }
.stat-pill.stat-min { border-color: var(--tier-low); color: #bbf7d0; }
.stat-pill.stat-sea { border-color: #0e7490; color: #99f6e4; }
.stat-pill.stat-cancel { border-color: #166534; color: #bbf7d0; }
.card { position: relative; }
.card.tier-low { border-color: rgba(34, 197, 94, 0.35); }
.card.tier-mid { border-color: rgba(245, 158, 11, 0.35); }
.card.tier-high { border-color: rgba(239, 68, 68, 0.35); }
.chip.tier-low { background: #14532d; color: #bbf7d0; }
.chip.tier-mid { background: #713f12; color: #fde68a; }
.chip.tier-high { background: #7f1d1d; color: #fecaca; }
.chip.score { background: #4c1d95; color: #ddd6fe; }
.chip.rating { background: #1e3a5f; color: #bfdbfe; }
.chip.scan { background: #334155; color: #e2e8f0; }
.rank-badge {
  position: absolute; top: .45rem; left: .45rem; z-index: 2;
  background: #2563eb; color: #fff; font-size: .68rem; font-weight: 700;
  padding: .12rem .38rem; border-radius: 6px;
}
.rank-badge.rank-1 { background: #ca8a04; }
.rank-badge.rank-2 { background: #64748b; }
.rank-badge.rank-3 { background: #92400e; }
.listing-no {
  position: absolute; top: .45rem; right: .45rem; z-index: 3;
  background: #ffffff; border: 2px solid #3b82f6; color: #93c5fd;
  font-size: .82rem; font-weight: 800; padding: .2rem .5rem; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.listing-filters {
  display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center;
  margin: .65rem 0; padding: .55rem .65rem; background: #ffffff;
  border: 1px solid var(--border); border-radius: 10px;
}
.listing-filters label { margin: 0; display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--text); }
.listing-filters select { width: auto; min-width: 7rem; margin: 0; padding: .25rem .4rem; font-size: .76rem; }
.listing-filters label:has([data-lf="sort"]) select { min-width: 11.5rem; }
.lf-label { font-weight: 700; font-size: .8rem; }
.lf-hint { font-size: .72rem; width: 100%; }
.stat-pill.stat-rating { border-color: #1e3a5f; color: #bfdbfe; }

/* Stitch / chain planner */
.panel-inset {
  margin: .85rem 0; padding: .75rem .8rem;
  background: #f0fbfd; border: 1px solid var(--border); border-radius: 10px;
}
.stitch-toggle { display: flex; align-items: center; gap: .5rem; cursor: pointer; margin-bottom: .35rem; }
.stitch-toggle input { width: auto; margin: 0; }
.btn-stitch { background: #0e7490; border-color: #0891b2; }
.btn-stitch:hover { filter: brightness(1.08); }
.stitch-coverage { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .5rem 0 .75rem; }
.cov-cell {
  font-size: .72rem; padding: .2rem .45rem; border-radius: 999px;
  border: 1px solid var(--border); background: #f0fbfd;
}
.cov-cell.cov-ok { border-color: #166534; color: #bbf7d0; background: #14532d55; }
.cov-cell.cov-miss { border-color: #7f1d1d; color: #fecaca; background: #7f1d1d44; }
.stitch-toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .5rem 0; }
.stitch-toolbar select, .stitch-toolbar input { width: auto; min-width: 8rem; margin: 0; }
.stitch-plan {
  margin: .85rem 0; padding: 1rem 1.1rem 1.15rem; border-radius: 16px;
  border: 1px solid var(--border); background: #ffffff;
}
.stitch-plan.moves-0 { border-left: 4px solid #22c55e; }
.stitch-plan.moves-1 { border-left: 4px solid #eab308; }
.stitch-plan.moves-2 { border-left: 4px solid #f97316; }
.stitch-plan-head { margin-bottom: .65rem; }
.stitch-plan-head strong { display: block; margin-bottom: .35rem; font-size: 1rem; }
.stitch-timeline {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: stretch;
}
.stitch-arrow {
  align-self: center; color: #64748b; font-weight: 800; padding: 0 .2rem;
  font-size: 1.1rem;
}
/* Larger apartment cards in chain (+~30–40% photo) */
.stitch-seg {
  display: flex; flex-direction: column; gap: 0;
  min-width: min(100%, 260px); max-width: 340px; flex: 1 1 260px;
  background: #f0fbfd; border: 1px solid var(--border); border-radius: 14px;
  padding: 0; overflow: hidden;
}
.stitch-seg.card-clickable { cursor: pointer; transition: border-color .15s, transform .15s; }
.stitch-seg.card-clickable:hover { border-color: #818cf8; transform: translateY(-2px); }
.stitch-seg-img-link { display: block; width: 100%; flex-shrink: 0; line-height: 0; }
.stitch-seg-thumb {
  width: 100%; height: 160px; object-fit: cover; border-radius: 0;
  display: block; background: #f0fbfd;
}
.placeholder-thumb {
  width: 100%; height: 160px; display: flex; align-items: center; justify-content: center;
  background: #f0fbfd; border-radius: 0; color: #64748b; font-size: 1.4rem;
}
.stitch-seg-body {
  min-width: 0; font-size: .88rem; padding: .7rem .8rem .85rem;
}
.stitch-seg-dates { color: #93c5fd; font-weight: 700; font-size: .8rem; }
.stitch-seg-title { font-weight: 700; margin: .25rem 0 .35rem; line-height: 1.3; font-size: .95rem; }
.stitch-seg-open { font-size: .8rem; margin-left: .25rem; }
.chip.moves-0 { background: #14532d; color: #bbf7d0; }
.chip.moves-1 { background: #713f12; color: #fde68a; }
.chip.moves-2 { background: #7c2d12; color: #fed7aa; }
.chip.city-route { background: #1e3a5f; color: #bfdbfe; }
.stitch-empty { padding: 1rem; color: var(--muted); }
.stitch-seg-city {
  color: #93c5fd; font-size: .8rem; font-weight: 700; margin: .15rem 0;
}
.stitch-legs-head {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
  margin: .65rem 0 .35rem;
}
.stitch-legs-head strong { margin-right: .25rem; }
.stitch-legs { display: flex; flex-direction: column; gap: .45rem; margin: .35rem 0; }
.stitch-leg-row {
  display: grid; grid-template-columns: auto 1fr minmax(4rem, 5rem) auto;
  gap: .4rem; align-items: center;
  padding: .45rem .5rem; background: #ffffff; border: 1px solid var(--border); border-radius: 8px;
}
.stitch-leg-row .leg-idx { font-weight: 700; color: #93c5fd; font-size: .8rem; min-width: 1.5rem; }
.stitch-leg-row select, .stitch-leg-row input { margin: 0; width: 100%; min-width: 0; font-size: .8rem; padding: .3rem .4rem; }
.stitch-leg-row .btn-icon-sm {
  background: transparent; border: 1px solid var(--border); color: #fca5a5;
  border-radius: 6px; width: 2rem; height: 2rem; cursor: pointer; font-size: 1rem; line-height: 1;
}
.cov-cell.cov-day { background: #e0f2fe; border-color: #334155; color: #e2e8f0; }
.stitch-heroes { margin: .85rem 0 1rem; }
.stitch-heroes h3 { margin: 0 0 .5rem; font-size: 1rem; }
.stitch-heroes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .55rem;
}
.stitch-hero {
  display: flex; gap: .55rem; padding: .65rem .7rem; border-radius: 10px;
  background: #ffffff; border: 1px solid var(--border); cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.stitch-hero:hover { border-color: #3b82f6; transform: translateY(-1px); }
.stitch-hero-icon { font-size: 1.35rem; line-height: 1; }
.stitch-hero-label { font-weight: 700; font-size: .8rem; margin-bottom: .2rem; }
.stitch-hero-route { color: #93c5fd; font-size: .75rem; font-weight: 600; margin-bottom: .15rem; }
.stitch-plan.highlight-pulse { outline: 2px solid #3b82f6; box-shadow: 0 0 0 4px #3b82f644; animation: plan-pulse 1.2s ease 2; }
@keyframes plan-pulse {
  0%, 100% { box-shadow: 0 0 0 4px #3b82f644; }
  50% { box-shadow: 0 0 0 8px #3b82f622; }
}
.continuous-banner {
  margin: .4rem 0 .15rem; padding: .4rem .65rem; border-radius: 10px;
  font-size: .8rem; font-weight: 600;
}
.continuous-banner.ok {
  background: rgba(20, 83, 45, .45); color: #bbf7d0; border: 1px solid #22c55e55;
}
.continuous-banner.soft {
  background: rgba(30, 58, 138, .35); color: #bfdbfe; border: 1px solid #3b82f655;
}
/* Rich interactive alt picker */
.rich-alt {
  position: relative;
  margin-top: .55rem;
  z-index: 2;
}
.rich-alt.is-open { z-index: 40; }
.rich-alt-bar {
  display: flex; align-items: stretch; gap: .3rem;
}
.rich-alt-nav {
  flex: 0 0 40px; min-height: 44px; margin: 0; padding: 0;
  border-radius: 10px; border: 1px solid #334155;
  background: #ffffff; color: #e2e8f0; font-size: 1rem; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.rich-alt-nav:hover { border-color: #6366f1; background: #e0f2fe; color: #fff; }
.rich-alt-trigger {
  flex: 1 1 auto; min-height: 44px; margin: 0; padding: .35rem .55rem;
  display: flex; align-items: center; gap: .45rem; text-align: left;
  border-radius: 10px; border: 1px solid #3b82f688;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  color: var(--text); cursor: pointer; font-family: inherit;
}
.rich-alt-trigger:hover { border-color: #60a5fa; }
.rich-alt.is-open .rich-alt-trigger { border-color: #818cf8; box-shadow: 0 0 0 2px #6366f133; }
.rich-alt-trigger-ico { font-size: 1rem; line-height: 1; }
.rich-alt-trigger-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .05rem; }
.rich-alt-trigger-city {
  font-size: .68rem; font-weight: 600; color: #93c5fd;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rich-alt-trigger-more { font-size: .78rem; font-weight: 700; color: #e2e8f0; }
.rich-alt-trigger-chev { color: #94a3b8; font-size: .85rem; }

.rich-alt-popover {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px);
  max-height: 380px; display: flex; flex-direction: column;
  background: #e0f2fe; border: 1px solid #334155; border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0,0,0,.55), 0 0 0 1px #1e293b;
  overflow: hidden; z-index: 50;
}
.rich-alt-popover.hidden { display: none !important; }
.rich-alt-popover-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem;
  padding: .55rem .7rem; border-bottom: 1px solid #1e293b;
  background: #ffffff; font-size: .78rem;
}
.rich-alt-popover-head strong { flex: 1 1 auto; }
.rich-alt-close {
  margin: 0; width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid #334155; background: transparent; color: #cbd5e1;
  cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.rich-alt-close:hover { background: #e0f2fe; }
.rich-alt-list {
  overflow-y: auto; max-height: 320px; padding: .35rem;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
.rich-alt-item {
  width: 100%; display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: .55rem; align-items: center;
  margin: 0 0 .3rem; padding: .4rem .45rem;
  border: 1px solid transparent; border-radius: 12px;
  background: transparent; color: var(--text); text-align: left;
  cursor: pointer; font-family: inherit;
  transition: background .12s, border-color .12s;
}
.rich-alt-item:hover,
.rich-alt-item.is-focused {
  background: rgba(59, 130, 246, .12);
  border-color: #3b82f655;
}
.rich-alt-item.is-active,
.rich-alt-item.is-selected {
  background: rgba(34, 197, 94, .12);
  border-color: #22c55e55;
}
.rich-alt-item.is-focused.is-active {
  box-shadow: 0 0 0 2px #6366f166;
}
.rich-alt-thumb-wrap {
  position: relative; width: 80px; height: 60px; border-radius: 10px; overflow: hidden;
  background: #e0f2fe; flex-shrink: 0;
}
.rich-alt-thumb {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.rich-alt-thumb-ph {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 1.2rem; color: #64748b;
}
.rich-alt-check {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #22c55e; color: #052e16; font-size: .7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.rich-alt-meta { min-width: 0; }
.rich-alt-title {
  font-size: .82rem; font-weight: 700; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100%;
}
.rich-alt-sub {
  display: flex; flex-wrap: wrap; gap: .2rem .4rem;
  margin-top: .2rem; font-size: .7rem; color: #94a3b8;
}
.rich-alt-src {
  text-transform: capitalize; color: #93c5fd; font-weight: 600;
}
.rich-alt-price-col { text-align: right; min-width: 4.2rem; }
.rich-alt-price {
  font-size: .95rem; font-weight: 800; color: #f8fafc; line-height: 1.1;
}
.rich-alt-per { font-size: .65rem; font-weight: 600; color: #94a3b8; }
.rich-alt-delta { font-size: .7rem; font-weight: 700; margin-top: .1rem; }
.rich-alt-delta.delta-up { color: #fca5a5; }
.rich-alt-delta.delta-down { color: #86efac; }
.rich-alt-delta.delta-same { color: #64748b; }
.rich-alt-total { font-size: .65rem; color: #64748b; margin-top: .1rem; }

/* Mobile: bottom sheet */
@media (max-width: 768px) {
  .rich-alt-popover {
    position: fixed; left: 0; right: 0; top: auto; bottom: 0;
    max-height: min(72vh, 520px); border-radius: 18px 18px 0 0;
    box-shadow: 0 -12px 40px rgba(0,0,0,.55);
    z-index: 80;
  }
  .rich-alt-list { max-height: min(58vh, 420px); }
  .rich-alt-item {
    grid-template-columns: 72px 1fr auto;
    min-height: 68px; padding: .5rem;
  }
  .rich-alt-thumb-wrap { width: 72px; height: 54px; }
  .rich-alt-nav { min-height: 48px; flex-basis: 44px; }
  .rich-alt-trigger { min-height: 48px; }
  body.rich-alt-sheet-open::after {
    content: "";
    position: fixed; inset: 0; background: rgba(2, 6, 23, .55);
    z-index: 70; pointer-events: none;
  }
}
.share-row { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; align-items: center; }

/* Source badges (Airbnb / Booking) */
.src-badge {
  display: inline-flex; align-items: center; gap: .15rem;
  font-size: .68rem; font-weight: 800; padding: .12rem .4rem;
  border-radius: 999px; letter-spacing: .01em; vertical-align: middle;
  white-space: nowrap;
}
.src-badge.src-airbnb {
  background: rgba(255, 90, 95, .18); color: #fecaca; border: 1px solid rgba(255, 90, 95, .45);
}
.src-badge.src-booking {
  background: rgba(0, 53, 128, .45); color: #93c5fd; border: 1px solid rgba(59, 130, 246, .55);
}
.src-badge.src-other {
  background: rgba(100, 116, 139, .25); color: #cbd5e1; border: 1px solid #475569;
}

/* Feature panel — proof the 3 stitch strategies are live */
.feature-panel {
  margin: .75rem 0 1rem;
  padding: .85rem .9rem 1rem;
  border-radius: 16px;
  border: 1px solid #334155;
  background: linear-gradient(145deg, rgba(15, 23, 42, .95), rgba(30, 58, 138, .22));
}
.feature-panel-title {
  margin: 0 0 .65rem; font-size: .95rem; font-weight: 800;
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
}
.feature-ver {
  font-size: .68rem; font-weight: 700; color: #93c5fd;
  background: #ffffff; border: 1px solid #334155; border-radius: 999px;
  padding: .1rem .45rem;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: .55rem;
}
.feature-card {
  border-radius: 12px; padding: .65rem .7rem .7rem;
  border: 1px solid #334155; background: #e0f2fe;
  display: flex; flex-direction: column; gap: .4rem; min-height: 120px;
}
.feature-card.on { border-color: #22c55e66; box-shadow: inset 0 0 0 1px #22c55e22; }
.feature-card.off { opacity: .75; }
.feature-card-h { font-size: .78rem; font-weight: 800; color: #e2e8f0; }
.feature-card-b { font-size: .75rem; color: #cbd5e1; line-height: 1.35; flex: 1; }
.feature-hint { margin: .65rem 0 0; font-size: .72rem; color: #94a3b8; }
.feature-pulse {
  outline: 3px solid #38bdf8 !important;
  box-shadow: 0 0 0 6px #38bdf833, 0 8px 28px rgba(56, 189, 248, .25) !important;
  animation: feature-pulse 1s ease 3;
}
@keyframes feature-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.01); }
}
.rich-alt-trigger {
  border-width: 2px !important;
  border-color: #38bdf8aa !important;
}
.rich-alt-trigger-more {
  color: #7dd3fc !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.stitch-plan-title-row {
  display: flex; flex-wrap: wrap; gap: .4rem .65rem; align-items: center; margin-bottom: .35rem;
}
.cmp-check { font-size: .75rem; color: var(--muted); display: inline-flex; align-items: center; gap: .25rem; }
.cmp-check input { width: auto; margin: 0; }
.btn-sm { font-size: .72rem; padding: .2rem .45rem; }
.stitch-filters label { font-size: .75rem; }
.stitch-filters input[type="number"] { margin: 0; }
.chk { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; }
.chk input { width: auto; margin: 0; }
.stitch-calendar { margin: .45rem 0 .55rem; }
.cal-label { font-size: .72rem; color: var(--muted); margin-bottom: .3rem; }
.cal-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.cal-cell {
  min-width: 4.2rem; padding: .35rem .4rem; border-radius: 8px;
  background: color-mix(in srgb, var(--cal, #334155) 22%, #0c1522);
  border: 1px solid color-mix(in srgb, var(--cal, #334155) 55%, #1e293b);
  text-align: center; font-size: .68rem;
}
.cal-cell.cal-ok .cal-mark { color: #86efac; font-weight: 800; }
.cal-cell.cal-bad .cal-mark { color: #fca5a5; font-weight: 800; }
.cal-date { color: #94a3b8; }
.cal-city { font-weight: 700; color: #e2e8f0; margin: .1rem 0; }
.match-badge { font-size: .65rem; margin-left: .25rem; padding: .05rem .3rem; border-radius: 999px; }
.match-badge.ok { background: #14532d; color: #bbf7d0; }
.match-badge.bad { background: #7f1d1d; color: #fecaca; }
.travel-note { font-size: .72rem; margin: .25rem 0 0; }
.stitch-compare-section { margin: .75rem 0; padding: .75rem; }
.stitch-compare-wrap { overflow-x: auto; }
.stitch-compare-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.stitch-compare-table th, .stitch-compare-table td {
  border: 1px solid var(--border); padding: .4rem .5rem; vertical-align: top; text-align: left;
}
.stitch-compare-table th[scope="row"] { background: #f0fbfd; width: 8rem; }
.stitch-checklist { margin: .75rem 0; padding: .75rem; }
.stitch-checklist h4 { margin: 0 0 .5rem; }
.checklist-table { width: 100%; border-collapse: collapse; font-size: .75rem; }
.checklist-table th, .checklist-table td { border: 1px solid var(--border); padding: .35rem .4rem; vertical-align: top; }
.chk-note { width: 100%; min-width: 5rem; margin: 0; font-size: .75rem; padding: .25rem; }
.preset-row { display: flex; flex-wrap: wrap; gap: .35rem; margin: .5rem 0; }
/* leg-row mobile rules live in the main ≤768px block */
.spread-low .good-text { color: #86efac; }
.spread-mid .good-text { color: #fde68a; }
.spread-high .good-text { color: #fca5a5; }
.good-text { color: #86efac; font-weight: 600; }
.bad-text { color: #fca5a5; }
.cmp-table .th-label { display: block; font-weight: 600; }
.insights strong { color: #fde68a; }
.chip.bad { background: #7f1d1d; color: #fecaca; }
.chip.muted { background: #374151; color: #d1d5db; }
.insight-cards {
  display: flex; flex-direction: column; gap: .55rem;
}
.insight-card {
  background: #ffffff; border: 1px solid var(--border); border-radius: 10px;
  padding: .85rem 1rem; border-left: 4px solid var(--accent);
  display: grid; grid-template-columns: auto 1fr; gap: .15rem .75rem; align-items: start;
}
.insight-card .insight-head { grid-column: 1; grid-row: 1 / span 3; flex-direction: column; align-items: center; gap: .25rem; margin: 0; }
.insight-card .insight-title { grid-column: 2; margin: 0; }
.insight-card .insight-body { grid-column: 2; }
.insight-card .insight-highlight { grid-column: 2; margin-top: .35rem; }
.insight-link {
  color: #93c5fd; text-decoration: none; font-weight: 600;
  border-bottom: 1px dashed rgba(147, 197, 253, 0.45);
}
.insight-link:hover { color: #bfdbfe; border-bottom-color: #bfdbfe; }
.insight-refs { grid-column: 2; display: flex; flex-wrap: wrap; gap: .35rem .5rem; margin-top: .35rem; }
.insight-card.insight-price { border-left-color: var(--tier-low); }
.insight-card.insight-sea { border-left-color: #06b6d4; }
.insight-card.insight-cancel { border-left-color: #3b82f6; }
.insight-card.insight-pick { border-left-color: #14b8a6; background: #f0fdfa; }
.insight-card.insight-warn { border-left-color: var(--warn); }
.insight-card.insight-dates { border-left-color: #a855f7; }
.insight-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; }
.insight-icon { font-size: 1.35rem; }
.insight-tag {
  font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: .12rem .4rem; border-radius: 6px; background: #e0f2fe; color: var(--muted);
}
.insight-title { margin: 0 0 .3rem; font-size: .9rem; font-weight: 700; }
.insight-body { margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.4; }
.insight-highlight {
  margin: .45rem 0 0; font-size: .85rem; font-weight: 700; color: #fde68a;
  padding: .4rem .5rem; background: rgba(253, 230, 138, 0.08); border-radius: 6px;
}
.btn-icon {
  width: auto; margin: 0; padding: .45rem .65rem; font-size: 1.2rem; line-height: 1;
  background: #e0f2fe; border: 1px solid var(--border); border-radius: 8px; display: none;
}
.topbar-title { flex: 1; min-width: 0; }
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 25;
}
.cmp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -.25rem; padding: 0 .25rem; }

/* Tablet: iPad / landscape phones (~769–1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
  .shell { grid-template-columns: 240px 1fr; }
  .scan-sidebar { padding: .85rem; }
  .report-main { padding: 1rem 1rem 2rem; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .card img, .placeholder { height: 170px; }
  .stitch-timeline { gap: .85rem; }
  .stitch-seg { flex: 1 1 280px; max-width: 380px; min-width: 260px; }
  .stitch-seg-thumb, .placeholder-thumb { height: 180px; }
  .stitch-seg-body { font-size: .9rem; padding: .75rem .9rem .9rem; }
  .stitch-seg-title { font-size: 1rem; }
  .stitch-heroes-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .modal-wide { max-width: min(720px, 94vw); }
  .sticky-actions { gap: .65rem; }
}

/* Mobile + small tablet: phones (~390–768px) */
@media (max-width: 768px) {
  .btn-icon, .icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 44px; min-height: 44px; flex-shrink: 0;
  }
  .topbar {
    padding: .55rem .65rem; gap: .4rem; flex-wrap: nowrap;
    padding-top: max(.55rem, env(safe-area-inset-top));
  }
  .topbar h1 { font-size: 1rem; }
  .topbar .sub { font-size: .68rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .topbar-actions { gap: .3rem; flex-shrink: 0; }
  .topbar-actions .btn-ghost,
  .topbar-actions .btn-primary,
  .topbar .btn-secondary {
    padding: .4rem .55rem; font-size: .72rem; min-height: 40px; white-space: nowrap;
  }
  .topbar-actions .btn-ghost:not(.btn-reset-queue) { display: none; } /* free space: open via main search tabs */
  .topbar-actions .btn-reset-queue { display: inline-flex; padding: .4rem .5rem; font-size: .72rem; }
  .shell { grid-template-columns: 1fr; min-height: auto; }
  .scan-sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(90vw, 340px); z-index: 30;
    max-height: none; transform: translateX(-105%); transition: transform .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.45);
    padding: max(1rem, env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom));
  }
  body.sidebar-open .scan-sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .report-main {
    padding: .7rem .7rem 2.25rem;
    padding-bottom: calc(2.25rem + env(safe-area-inset-bottom));
  }
  .cards { grid-template-columns: 1fr; gap: .75rem; }
  .card img, .placeholder { height: 200px; }
  .card .title { font-size: .95rem; }
  .stats-row { gap: .35rem; }
  .stat-pill { font-size: .7rem; padding: .35rem .55rem; }
  /* listing/stitch labels may stack on narrow; source pills stay in a row */
  .listing-filters, .stitch-toolbar, .stitch-filters {
    flex-direction: column; align-items: stretch;
  }
  .source-filter-row, .src-pills, .chip-toggle-row {
    flex-direction: row !important; flex-wrap: wrap; align-items: center;
  }
  .listing-filters label, .stitch-filters label {
    width: 100%; justify-content: space-between; min-height: 44px;
  }
  .listing-filters select, .stitch-filters select,
  .stitch-filters input[type="number"] {
    flex: 1; min-width: 0; min-height: 44px; width: 100% !important;
  }
  .src-check { min-height: 44px; padding: .5rem .65rem; }
  .tab, .src-all-btn { min-height: 44px; padding: .5rem .7rem; font-size: .82rem; }
  .compare-hero { grid-template-columns: 1fr; }
  .insight-card { grid-template-columns: auto 1fr; }
  .detail-scan-table { font-size: .7rem; min-width: 520px; }
  .detail-card { width: 100%; max-height: 95dvh; border-radius: 16px 16px 0 0; }
  .detail-card img { max-height: 240px; }
  .cmp-table { font-size: .72rem; min-width: 520px; }
  .modal-card, .modal-wide {
    width: 100% !important; max-width: none !important; max-height: 100vh; max-height: 100dvh;
    border-radius: 16px 16px 0 0 !important; margin-top: auto; align-self: flex-end;
    padding: 1rem .9rem calc(1rem + env(safe-area-inset-bottom)) !important;
  }
  .modal { align-items: flex-end; padding: 0; }
  .modal-actions, .sticky-actions {
    grid-template-columns: 1fr; display: flex; flex-direction: column; width: 100%;
  }
  .modal-actions button, .sticky-actions button { min-height: 48px; width: 100%; margin: 0; }
  .sticky-actions { position: sticky; bottom: 0; z-index: 5; }
  .sidebar-actions button { min-height: 44px; }
  .sidebar-delete-actions button { min-height: 40px; }
  .scan-del-one { min-width: 40px; min-height: 40px; }
  .scan-item { padding: .7rem .75rem; }
  .scan-item input[type=checkbox] { width: 22px; height: 22px; }
  .view-tabs { flex-wrap: wrap; gap: .4rem; }
  .view-tabs .tab { flex: 1 1 calc(50% - .25rem); min-height: 44px; }
  .hero-card { padding: .65rem; }
  .listing-no { font-size: .9rem; padding: .25rem .55rem; }
  .report-head h2 { font-size: 1.05rem; line-height: 1.35; }
  .welcome-hero { margin: 1.25rem .25rem; padding: 1.5rem 1.1rem; border-radius: 20px; }
  .welcome-hero h2 { font-size: 1.2rem; }
  .welcome-actions { flex-direction: column; }
  .welcome-actions button { width: 100%; min-height: 48px; }

  /* Chain / route: full-width large cards */
  .stitch-plan { padding: .85rem .75rem 1rem; margin: .65rem 0; }
  .stitch-timeline {
    flex-direction: column; gap: .85rem; align-items: stretch;
  }
  .stitch-arrow {
    align-self: center; transform: rotate(90deg); padding: .15rem 0; font-size: 1.25rem;
  }
  .stitch-seg {
    min-width: 0; max-width: none; flex: 1 1 auto; width: 100%;
    border-radius: 16px;
  }
  .stitch-seg-thumb, .placeholder-thumb { height: 210px; }
  .stitch-seg-body { padding: .85rem .9rem 1rem; font-size: .92rem; }
  .stitch-seg-title { font-size: 1.05rem; }
  .stitch-seg-dates { font-size: .85rem; }
  .stitch-seg-city { font-size: .85rem; }
  .stitch-heroes-grid { grid-template-columns: 1fr; }
  .stitch-hero { min-height: 72px; padding: .8rem; }
  .cal-row { gap: .4rem; }
  .cal-cell { min-width: calc(33.33% - .3rem); flex: 1 1 calc(33.33% - .3rem); padding: .45rem .3rem; font-size: .72rem; }
  .stitch-compare-table { font-size: .72rem; min-width: 560px; }
  .checklist-table { font-size: .7rem; display: block; overflow-x: auto; }
  .stitch-plan-title-row { gap: .5rem; }
  .cmp-check { min-height: 40px; font-size: .8rem; }
  .btn-sm { min-height: 40px; padding: .4rem .65rem; font-size: .78rem; }
  .preset-row { gap: .4rem; }
  .preset-row .btn-sm { flex: 1 1 calc(50% - .25rem); min-height: 42px; }
  .mode-tabs { gap: .35rem; }
  .mode-tab { min-height: 48px; font-size: .8rem; padding: .55rem .4rem; }
  .chip-btn { min-height: 40px; padding: .45rem .85rem; }
  .stepper { min-height: 48px; }
  .stepper-btn { width: 2.4rem; height: 2.4rem; min-width: 44px; min-height: 44px; }
  .radio-card { min-height: 56px; padding: .8rem; }
  .toggle-row { min-height: 52px; }
  .stitch-leg-row {
    grid-template-columns: auto 1fr; gap: .5rem;
    padding: .55rem .6rem;
  }
  .stitch-leg-row select { grid-column: 1 / -1; min-height: 44px; }
  .stitch-leg-row input[type=number] { min-height: 44px; }
  .cov-cell { font-size: .7rem; padding: .28rem .5rem; }
  .stitch-coverage { gap: .4rem; }
  .cmp-table-wrap { display: block; }
}

/* Narrow phones */
@media (max-width: 400px) {
  .topbar h1 { font-size: .95rem; }
  .topbar-actions .btn-primary { padding: .4rem .5rem; font-size: .7rem; }
  .stitch-seg-thumb, .placeholder-thumb { height: 190px; }
  .view-tabs .tab { min-width: 100%; flex: 1 1 100%; }
  .stat-pill { font-size: .66rem; }
}

/* ===== Redesign additions ===== */
.btn-primary, .btn-accent {
  background: var(--accent-grad); color: #fff; border: none; border-radius: 12px;
  padding: .55rem 1rem; font-weight: 700; font-family: inherit; cursor: pointer;
  box-shadow: 0 6px 20px rgba(99,102,241,.35); transition: transform .15s, filter .15s;
}
.btn-primary:hover, .btn-accent:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-lg { padding: .75rem 1.25rem; font-size: 1rem; border-radius: 14px; }
.btn-ghost {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  border-radius: 12px; padding: .5rem .85rem; font-family: inherit; cursor: pointer;
}
.btn-ghost:hover { border-color: #64748b; background: rgba(255,255,255,.04); }
.btn-secondary {
  background: #e0f2fe; border: 1px solid var(--border); color: var(--text);
  border-radius: 12px; padding: .5rem .85rem; font-family: inherit; cursor: pointer;
}
.btn-secondary:hover { border-color: #6366f1; }
.btn-icon, .icon-btn {
  background: #e0f2fe; border: 1px solid var(--border); color: var(--text);
  width: 2.4rem; height: 2.4rem; border-radius: 12px; cursor: pointer; font-size: 1.1rem;
}
.hidden { display: none !important; }
.modal-wide { max-width: 640px; width: min(640px, 96vw); max-height: 92vh; overflow: auto; }
.modal-card { padding: 1.1rem 1.2rem 1.25rem; border-radius: 20px !important; }
.modal-sub { margin: .15rem 0 0; }
.mode-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin: .75rem 0 1rem;
  background: #ffffff; padding: .3rem; border-radius: 14px; border: 1px solid var(--border);
}
.mode-tab {
  border: none; background: transparent; color: var(--muted); font-family: inherit;
  font-weight: 600; font-size: .85rem; padding: .65rem .5rem; border-radius: 11px; cursor: pointer;
}
.mode-tab.active {
  background: var(--accent-grad); color: #fff; box-shadow: 0 4px 14px rgba(99,102,241,.3);
}
.form-section { margin-bottom: 1rem; }
.field-label-row {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .35rem;
  font-size: .82rem; font-weight: 600;
}
.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.15rem; height: 1.15rem; border-radius: 999px; font-size: .7rem; font-weight: 800;
  background: #e0f2fe; color: #94a3b8; border: 1px solid var(--border); cursor: help;
}
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .45rem; }
.chip-btn {
  border: 1px solid var(--border); background: #ffffff; color: var(--text);
  border-radius: 999px; padding: .35rem .75rem; font-family: inherit; cursor: pointer; font-weight: 600;
}
.chip-btn.on { background: rgba(99,102,241,.25); border-color: #818cf8; color: #e0e7ff; }
.stepper {
  display: flex; align-items: center; gap: .35rem; background: #ffffff; border: 1px solid var(--border);
  border-radius: 12px; padding: .25rem;
}
.stepper input { width: 3rem; text-align: center; border: none; background: transparent; color: var(--text); font-weight: 700; }
.stepper-btn {
  width: 2rem; height: 2rem; border-radius: 10px; border: none; background: #e0f2fe; color: var(--text);
  cursor: pointer; font-size: 1.1rem; font-weight: 700;
}
.toggle-row {
  display: flex; gap: .65rem; align-items: flex-start; margin-top: .65rem; cursor: pointer;
  padding: .65rem .75rem; background: #ffffff; border-radius: 12px; border: 1px solid var(--border);
}
.toggle-row input { margin-top: .2rem; width: auto; }
.toggle-row small { display: block; font-weight: 400; margin-top: .15rem; }
.radio-cards { display: flex; flex-direction: column; gap: .45rem; }
.radio-card {
  display: flex; gap: .65rem; align-items: flex-start; padding: .7rem .8rem;
  border: 1px solid var(--border); border-radius: 14px; background: #ffffff; cursor: pointer;
}
.radio-card:has(input:checked) { border-color: #818cf8; background: rgba(99,102,241,.12); }
.radio-card input { margin-top: .25rem; width: auto; }
.radio-card small { display: block; color: var(--muted); font-size: .75rem; margin-top: .15rem; }
.sticky-actions {
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; align-items: center;
  padding-top: .75rem; border-top: 1px solid var(--border); margin-top: .5rem;
  position: sticky; bottom: 0; background: linear-gradient(180deg, transparent, #0f172a 30%);
  padding-bottom: .25rem;
}
.welcome-hero {
  max-width: 640px; margin: 2.5rem auto; padding: 2rem 1.75rem; border-radius: 24px; text-align: center;
}
.welcome-hero h2 { font-size: 1.45rem; margin-bottom: .5rem; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: .55rem; justify-content: center; margin-top: 1.25rem; }
.selected-cities { display: flex; flex-wrap: wrap; gap: .35rem; margin: .45rem 0; min-height: 1.5rem; }
.city-tag {
  display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .55rem;
  background: rgba(99,102,241,.18); border: 1px solid rgba(129,140,248,.4);
  border-radius: 999px; font-size: .78rem; font-weight: 600;
}
.city-tag button {
  border: none; background: transparent; color: #c7d2fe; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0;
}
input, select, textarea {
  width: 100%; margin: 0 0 .45rem; padding: .55rem .7rem; border-radius: 12px;
  border: 1px solid var(--border); background: #ffffff; color: var(--text); font-family: inherit; font-size: .9rem;
}
input[type=range] { padding: 0; accent-color: #818cf8; }
label { display: block; font-size: .8rem; font-weight: 600; margin: .15rem 0 .3rem; color: #cbd5e1; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } .mode-tabs { grid-template-columns: 1fr; } }
.suggestions { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .5rem; max-height: 180px; overflow: auto; }
.suggestion {
  text-align: left; border: 1px solid var(--border); background: #ffffff; color: var(--text);
  border-radius: 10px; padding: .45rem .6rem; cursor: pointer; font-family: inherit;
}
.suggestion:hover { border-color: #818cf8; }
.scan-item {
  background: rgba(15, 23, 42, 0.85) !important; border-radius: 12px !important;
  transition: border-color .15s, transform .15s;
}
.scan-item:hover { transform: translateX(2px); }
.card, .stitch-plan {
  border-radius: 16px !important; border-color: var(--border) !important;
  background: rgba(15, 23, 42, 0.75) !important;
}
.tab.active { background: var(--accent-grad) !important; border: none !important; }
.stat-pill {
  background: rgba(15,23,42,.9) !important; border-radius: 999px !important;
  border-color: var(--border) !important;
}
.stitch-empty-state {
  text-align: center; padding: 2rem 1.25rem; border-radius: 20px;
  background: rgba(15,23,42,.7); border: 1px dashed var(--border); margin: 1rem 0;
}
.stitch-empty-state h3 { margin: 0 0 .5rem; }
.stitch-empty-state .actions { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; margin-top: 1rem; }
.error-box {
  background: rgba(127,29,29,.35); border: 1px solid #b91c1c; color: #fecaca;
  padding: .75rem 1rem; border-radius: 12px; margin: .75rem 0; font-size: .85rem;
}



/* ===== Scan task bar ===== */
.scan-taskbar {
  position: sticky; top: 58px; z-index: 19;
  padding: 0 .75rem;
  margin: 0;
  animation: taskbar-in .25s ease;
}
.scan-taskbar.hidden { display: none !important; }
@keyframes taskbar-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.scan-taskbar-inner {
  max-width: 1100px; margin: .55rem auto 0;
  padding: .7rem .9rem .75rem;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(99, 102, 241, 0.45);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
  backdrop-filter: blur(12px);
}
.scan-taskbar.active .scan-taskbar-inner {
  border-color: rgba(129, 140, 248, 0.65);
}
.scan-taskbar.done .scan-taskbar-inner {
  border-color: rgba(52, 211, 153, 0.55);
}
.scan-taskbar.error .scan-taskbar-inner {
  border-color: rgba(248, 113, 113, 0.6);
}
.scan-taskbar-top {
  display: flex; flex-wrap: wrap; gap: .45rem .75rem;
  align-items: center; justify-content: space-between; margin-bottom: .45rem;
}
.scan-taskbar-status { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.scan-taskbar-dot {
  width: .65rem; height: .65rem; border-radius: 999px; flex-shrink: 0;
  background: #818cf8; box-shadow: 0 0 0 0 rgba(129,140,248,.6);
}
.scan-taskbar.active .scan-taskbar-dot {
  animation: taskbar-pulse 1.2s ease infinite;
  background: #a5b4fc;
}
.scan-taskbar.done .scan-taskbar-dot { background: #34d399; animation: none; }
.scan-taskbar.error .scan-taskbar-dot { background: #f87171; animation: none; }
@keyframes taskbar-pulse {
  0% { box-shadow: 0 0 0 0 rgba(129,140,248,.55); }
  70% { box-shadow: 0 0 0 8px rgba(129,140,248,0); }
  100% { box-shadow: 0 0 0 0 rgba(129,140,248,0); }
}
.scan-taskbar-title {
  font-weight: 700; font-size: .9rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55vw;
}
.scan-taskbar-meta { display: flex; flex-wrap: wrap; gap: .35rem; }
.scan-taskbar-chip {
  font-size: .72rem; font-weight: 600; padding: .2rem .5rem; border-radius: 999px;
  background: #e0f2fe; border: 1px solid var(--border); color: #cbd5e1;
}
.scan-taskbar-track {
  height: 8px; border-radius: 999px; background: #ffffff; border: 1px solid var(--border);
  overflow: hidden;
}
.scan-taskbar-fill {
  height: 100%; width: 0%; border-radius: 999px;
  background: var(--accent-grad);
  transition: width .45s ease;
}
.scan-taskbar.done .scan-taskbar-fill {
  background: linear-gradient(90deg, #059669, #34d399);
}
.scan-taskbar.error .scan-taskbar-fill {
  background: linear-gradient(90deg, #b91c1c, #f87171);
}
.scan-taskbar-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .35rem;
  margin-top: .4rem; font-size: .75rem; color: var(--muted);
}
.scan-taskbar-detail {
  min-width: 0; flex: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scan-taskbar-elapsed { flex-shrink: 0; color: #94a3b8; }
.scan-taskbar-actions {
  display: flex; align-items: center; gap: .5rem; flex-shrink: 0;
}
.scan-taskbar-cancel {
  width: auto; margin: 0; padding: .35rem .7rem; min-height: 36px;
  border-radius: 10px; border: 1px solid rgba(248, 113, 113, 0.55);
  background: rgba(127, 29, 29, 0.45); color: #fecaca;
  font-family: inherit; font-size: .75rem; font-weight: 700; cursor: pointer;
}
.scan-taskbar-cancel:hover:not(:disabled) { background: rgba(185, 28, 28, 0.65); }
.scan-taskbar-cancel:disabled { opacity: .55; cursor: wait; }
.scan-taskbar-cancel.hidden { display: none !important; }

.btn-reset-queue {
  border-color: rgba(248, 113, 113, 0.4) !important;
  color: #fecaca !important;
}
.btn-reset-queue:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.75) !important;
  background: rgba(127, 29, 29, 0.35) !important;
}
.btn-reset-queue:disabled { opacity: .55; cursor: wait; }

@media (max-width: 768px) {
  .scan-taskbar { top: 52px; padding: 0 .5rem; }
  .scan-taskbar-inner { padding: .6rem .7rem .65rem; border-radius: 12px; }
  .scan-taskbar-title { font-size: .82rem; max-width: 100%; white-space: normal; }
  .scan-taskbar-top { flex-direction: column; align-items: flex-start; }
  .scan-taskbar-chip { font-size: .68rem; }
  .scan-taskbar-detail { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .scan-taskbar-bottom { flex-direction: column; align-items: stretch; gap: .45rem; }
  .scan-taskbar-actions { justify-content: space-between; }
  .scan-taskbar-cancel { min-height: 40px; flex: 0 0 auto; }
}

/* ═══════════════════════════════════════════════════════════
   APP V2 — shell, header, sidebar, search sheet, density
   ═══════════════════════════════════════════════════════════ */
.app-v2 {
  --hdr-h: 56px;
  --side-w: 300px;
  --gap: .5rem;
  --pad: .75rem;
  --radius-sm: 10px;
  --radius-md: 14px;
  --accent-soft: rgba(13, 148, 136, .12);
  --surface: #f8fafc;
  --surface-2: #eef2f7;
  --line: rgba(15, 23, 42, .1);
}
.app-v2 body, body.app-v2 { line-height: 1.4; }

/* —— Header (slim: no center nav) —— */
.app-v2 .topbar { display: none !important; }
.app-v2 { --hdr-h: 48px; }
.app-header {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  min-height: var(--hdr-h);
  height: var(--hdr-h);
  padding: 0 .5rem 0 .35rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
}
.app-header-left {
  display: flex; align-items: center; gap: .35rem; min-width: 0; flex: 1 1 auto;
}
.app-header-right {
  display: flex; align-items: center; gap: .3rem; flex: 0 0 auto;
}
.app-nav { display: none !important; } /* removed fat pills */
.brand {
  display: flex; align-items: center; gap: .4rem;
  text-decoration: none; color: inherit; min-width: 0;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center;
  font-size: .62rem; font-weight: 800; letter-spacing: .03em;
  background: var(--accent-grad); color: #fff; flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
.brand-text strong { font-size: .82rem; font-weight: 800; }
.brand-sub, #headerSub {
  font-size: .62rem; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(46vw, 280px);
}
.btn-header-search {
  margin: 0 !important; padding: .35rem .7rem !important;
  min-height: 34px !important; font-size: .78rem !important;
  border-radius: 10px !important; white-space: nowrap;
}
.header-status {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .45rem; border-radius: 999px;
  background: rgba(34, 197, 94, .12); border: 1px solid rgba(34, 197, 94, .35);
  font-size: .68rem; font-weight: 700; color: #86efac; max-width: 8.5rem;
}
.header-status.is-err {
  background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .4); color: #fecaca;
}
.header-status[hidden] { display: none !important; }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #64748b; flex-shrink: 0;
}
.status-dot.idle { background: #64748b; }
.status-dot.run { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); animation: pulse-dot 1.2s infinite; }
.status-dot.err { background: #f87171; }
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,.35); }
  50% { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}
.status-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-tool {
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0; padding: 0; width: 34px; height: 34px;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer;
}
.btn-tool:hover:not(:disabled) { border-color: #6366f1; }
.btn-tool:disabled { opacity: .4; cursor: not-allowed; }
.btn-tool[hidden] { display: none !important; }
.btn-tool.primary { background: var(--accent-soft); border-color: #6366f188; color: #c7d2fe; }
.btn-tool.danger { border-color: #7f1d1d; color: #fecaca; background: rgba(127,29,29,.25); }
.btn-tool.danger:hover:not(:disabled) { background: rgba(185,28,28,.4); }
.btn-icon {
  width: 34px; height: 34px; margin: 0; padding: 0;
  border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); cursor: pointer;
  display: grid; place-items: center; flex-shrink: 0;
}
.btn-icon-bars {
  width: 14px; height: 2px; background: currentColor; border-radius: 2px;
  box-shadow: 0 -4px 0 currentColor, 0 4px 0 currentColor;
}
@media (max-width: 520px) {
  .brand-text strong { font-size: .75rem; }
  .brand-sub, #headerSub { max-width: 28vw; }
  .btn-header-search { padding: .35rem .55rem !important; font-size: .72rem !important; }
}
.btn-primary {
  background: var(--accent-grad); border: none; color: #fff;
  border-radius: 12px; padding: .55rem 1rem; font: inherit; font-weight: 800; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary.btn-lg, .btn-cta { padding: .7rem 1.25rem; font-size: .95rem; min-height: 48px; }
.btn-secondary {
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: .55rem 1rem; font: inherit; font-weight: 700; cursor: pointer;
}
.btn-ghost {
  background: transparent; border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: .45rem .75rem; font: inherit; cursor: pointer;
}
.btn-sm { font-size: .72rem; padding: .3rem .5rem; min-height: 32px; border-radius: 8px; }

/* —— Shell —— */
.app-shell {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: calc(100vh - var(--hdr-h));
}
.app-sidebar {
  border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column;
  max-height: calc(100vh - var(--hdr-h));
  position: sticky; top: var(--hdr-h);
  overflow: hidden;
}
.sidebar-head { padding: .7rem .7rem .45rem; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.sidebar-head-row {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: .45rem;
}
.sidebar-head h2 { margin: 0; font-size: .95rem; }
.sidebar-count {
  font-size: .7rem; font-weight: 800; color: #93c5fd;
  background: #e0f2fe; border: 1px solid var(--line); border-radius: 999px;
  padding: .1rem .45rem; min-width: 1.6rem; text-align: center;
}
.sidebar-seg, .mode-seg {
  display: flex; gap: .2rem; background: #e0f2fe; border-radius: 10px; padding: .2rem;
  border: 1px solid var(--line);
}
.seg-btn, .mode-tab {
  flex: 1; margin: 0; padding: .35rem .4rem; min-height: 32px;
  border: none; border-radius: 8px; background: transparent;
  color: var(--muted); font: inherit; font-size: .72rem; font-weight: 700; cursor: pointer;
}
.seg-btn.active, .mode-tab.active {
  background: var(--accent-soft); color: #e2e8f0; box-shadow: inset 0 0 0 1px #6366f155;
}
.sidebar-toolbar {
  display: flex; gap: .35rem; padding: .5rem .65rem; flex-wrap: wrap; flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}
.tool-group { display: flex; gap: .25rem; flex: 1 1 auto; }
.tool-group .btn-tool { flex: 1; justify-content: center; }
.sidebar-legend {
  display: flex; gap: .55rem; flex-wrap: wrap;
  margin: 0; padding: .3rem .7rem .45rem;
  font-size: .62rem; color: #64748b; flex-shrink: 0;
}
.scan-list {
  flex: 1; overflow: auto; padding: .4rem .5rem .8rem;
  display: flex; flex-direction: column; gap: .3rem;
  -webkit-overflow-scrolling: touch;
}
/* Dense history cards */
.scan-item {
  text-align: left; width: 100%; margin: 0; padding: 0;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px;
  color: var(--text); font: inherit;
}
.scan-item:hover { border-color: #475569; }
.scan-item.active {
  border-color: #6366f1; background: linear-gradient(135deg, rgba(99,102,241,.16), var(--surface-2));
}
.scan-item.compare-on { box-shadow: inset 3px 0 0 #22c55e; }
.scan-item.marked-del { box-shadow: inset 3px 0 0 #ef4444; background: #fef2f2; }
.scan-item-inner {
  display: grid;
  grid-template-columns: 18px 18px 1fr auto;
  gap: .35rem; align-items: start; padding: .45rem .45rem .45rem .4rem;
}
.scan-item input[type=checkbox] { width: 15px; height: 15px; margin: .2rem 0 0; accent-color: #6366f1; }
.scan-del-cb { accent-color: #ef4444 !important; }
.scan-item-body {
  flex: 1; min-width: 0; text-align: left; background: transparent; border: none;
  color: inherit; padding: 0; margin: 0; cursor: pointer; font: inherit;
}
.scan-item .t {
  font-weight: 700; font-size: .78rem; display: block; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.scan-item .m { font-size: .65rem; color: var(--muted); margin-top: .15rem; display: block; }
.scan-item .scan-badges {
  display: flex; flex-wrap: wrap; gap: .2rem; margin-top: .3rem;
}
.scan-badge {
  font-size: .6rem; font-weight: 800; padding: .08rem .32rem; border-radius: 999px;
  background: #e0f2fe; border: 1px solid var(--line); color: #cbd5e1;
}
.scan-badge.route { color: #67e8f9; border-color: #0891b255; }
.scan-badge.ab { color: #fecaca; border-color: #f43f5e44; }
.scan-badge.bk { color: #93c5fd; border-color: #3b82f644; }
.scan-del-one {
  width: 26px; height: 26px; margin: 0; padding: 0; border-radius: 8px;
  background: transparent; border: 1px solid transparent; color: #f87171;
  font-size: .95rem; line-height: 1; cursor: pointer;
}
.scan-del-one:hover { background: #3f1515; border-color: #7f1d1d; }

/* —— Main —— */
.app-main, .app-v2 .report-main {
  padding: .75rem .9rem 2rem;
  overflow: auto;
  min-width: 0;
  max-height: calc(100vh - var(--hdr-h));
}
.app-v2 .report-head {
  position: sticky; top: 0; z-index: 5;
  background: linear-gradient(180deg, rgba(11,18,32,.97) 70%, transparent);
  padding-bottom: .5rem; margin-bottom: .65rem;
}
.app-v2 .report-head h2 { font-size: 1.05rem; margin: 0 0 .2rem; }
.app-v2 .view-tabs { gap: .3rem; margin: .45rem 0 .55rem; flex-wrap: wrap; }
.app-v2 .tab {
  border-radius: 999px; padding: .4rem .75rem; font-weight: 700;
  background: var(--surface-2); border-color: var(--line);
}
.app-v2 .tab.active { background: var(--accent-grad); border-color: transparent; }
.app-v2 .stats-row { gap: .35rem; margin: .35rem 0 .55rem; }
.app-v2 .stat-pill {
  font-size: .7rem; padding: .2rem .5rem; background: var(--surface-2);
}
.app-v2 .layout-switch {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: .3rem; gap: .25rem; display: inline-flex;
}
.app-v2 .layout-btn {
  border: none; background: transparent; border-radius: 9px; min-height: 34px;
}
.app-v2 .layout-btn.active {
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px #6366f155;
}

/* Empty workspace — compact, NOT a half-screen splash */
.empty-workspace {
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .75rem;
  padding: .65rem .75rem; margin: .25rem 0 .75rem;
  border: 1px dashed var(--line); border-radius: 12px;
  background: var(--surface);
}
.empty-workspace-line { margin: 0; flex: 1 1 200px; color: var(--muted); font-size: .85rem; }
.empty-workspace-actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.empty-workspace .btn-primary, .empty-workspace .btn-secondary {
  min-height: 38px; padding: .4rem .75rem; font-size: .8rem;
}

/* ── Dense command bar (scan report chrome) ── */
.cmd-bar {
  position: sticky; top: 0; z-index: 8;
  margin: 0 0 .45rem; padding: .35rem .4rem .4rem;
  background: rgba(255, 255, 255, .95);
  border: 1px solid var(--line); border-radius: 12px;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(15, 23, 42, .05);
}
.cmd-bar-main {
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .45rem;
  min-height: 34px;
}
.cmd-mode {
  display: inline-flex; gap: .15rem; padding: .12rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
  flex-shrink: 0;
}
.cmd-mode-btn {
  margin: 0; padding: .25rem .5rem; min-height: 28px;
  border: none; border-radius: 7px; background: transparent;
  color: var(--muted); font: inherit; font-size: .72rem; font-weight: 800; cursor: pointer;
  width: auto !important;
}
.cmd-mode-btn.active {
  background: var(--accent-soft); color: #0f766e;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, .35);
}
.cmd-title {
  margin: 0; font-size: .82rem; font-weight: 800; line-height: 1.2;
  flex: 1 1 120px; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cmd-meta {
  font-size: .68rem; color: var(--muted); white-space: nowrap;
  flex: 0 1 auto;
}
.cmd-actions {
  display: inline-flex; align-items: center; gap: .25rem; margin-left: auto; flex-shrink: 0;
}
.cmd-bar-filters {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem .5rem;
  margin-top: .35rem;
  padding-top: .35rem;
  border-top: 1px solid var(--border);
}
.cmd-sep {
  width: 1px; height: 22px; background: var(--border); margin: 0 .1rem; flex-shrink: 0;
}
/* Source filter ALWAYS one horizontal row: Все | Airbnb N | Booking N */
.src-pills,
.chip-toggle-row,
.source-filter-row {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem;
  width: auto !important;
  max-width: 100%;
  flex: 0 1 auto;
}
/* Override global button { width:100% } so filters don't stack as a column */
.src-pills > button,
.chip-toggle-row > button,
.source-filter-row > button,
.src-pill,
.cmd-bar-filters .chip-toggle,
.cmd-bar-filters .src-pill {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: .28rem;
  margin: 0 !important;
  padding: .28rem .6rem;
  min-height: 30px;
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}
.src-pill:hover,
.cmd-bar-filters .chip-toggle:hover { border-color: var(--accent); }
.src-pill.active,
.cmd-bar-filters .chip-toggle.active {
  background: var(--accent-soft);
  border-color: rgba(13, 148, 136, 0.45);
  color: #0f766e;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.15);
}
.src-pill-ico { line-height: 1; }
.src-pill-lab { font-weight: 700; }
.src-pill-n {
  font-size: .68rem; font-weight: 800;
  background: rgba(15, 23, 42, 0.06);
  border-radius: 6px; padding: .05rem .3rem; color: var(--muted);
}
.src-pill.active .src-pill-n {
  background: rgba(13, 148, 136, 0.15); color: #0f766e;
}

.layout-seg {
  display: inline-flex; gap: .1rem; padding: .1rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
}
.layout-ico {
  width: 30px; height: 28px; margin: 0; padding: 0;
  border: none; border-radius: 6px; background: transparent;
  color: var(--muted); font-size: .85rem; cursor: pointer; line-height: 1;
}
.layout-ico.active {
  background: var(--accent-soft); color: #0f766e;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.35);
}
.layout-ico:hover { color: var(--text); }
.chip-toggle {
  margin: 0; padding: .2rem .4rem; min-height: 28px;
  border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted);
  font: inherit; font-size: .7rem; font-weight: 700; cursor: pointer; white-space: nowrap;
  width: auto !important;
}
.chip-toggle.active {
  background: var(--accent-soft); border-color: rgba(13, 148, 136, 0.4); color: #0f766e;
}
.chip-toggle.accent {
  background: rgba(5, 150, 105, .1); border-color: rgba(5, 150, 105, .35); color: #047857;
}
label.chip-toggle {
  display: inline-flex; align-items: center; cursor: pointer; user-select: none;
}
label.chip-toggle input.hidden {
  position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none;
}
.cmd-bar-note { margin: .25rem 0 0; font-size: .72rem; }
.cmd-bar .stitch-coverage {
  margin: .3rem 0 0; font-size: .68rem; max-height: 4.5rem; overflow: auto;
}
.cmd-bar .cov-cell { font-size: .62rem; padding: .15rem .3rem; }
.stitch-cmd-filters { gap: .25rem !important; flex-direction: row !important; }
.mini-sel {
  width: auto !important; min-width: 0 !important; min-height: 28px !important;
  margin: 0 !important; padding: .15rem .3rem !important;
  font-size: .7rem !important; border-radius: 7px !important;
  background: var(--bg-elevated) !important; border: 1px solid var(--border) !important;
  color: var(--text) !important;
}
@media (max-width: 720px) {
  .cmd-meta { display: none; }
  .cmd-title { flex: 1 1 100%; order: 3; font-size: .78rem; }
  .cmd-bar-main { gap: .25rem; }
  .src-pill-lab { display: none; } /* keep icons + counts on narrow */
}
.mini-sel {
  width: auto !important; min-width: 0 !important; min-height: 28px !important;
  margin: 0 !important; padding: .15rem .3rem !important;
  font-size: .7rem !important; border-radius: 7px !important;
  background: var(--bg-elevated) !important; border: 1px solid var(--border) !important;
  color: var(--text) !important;
}
.report-body { min-width: 0; margin-top: .15rem; }
.empty-inline { margin: .5rem 0; padding: .5rem; font-size: .82rem; }
/* legacy chrome hidden / collapsed */
.app-v2 .report-head { position: static !important; background: transparent !important; padding: 0; margin: 0 0 .4rem; }
.app-v2 .layout-switch, .layout-switch { display: none !important; }
.app-v2 .listing-filters.toolbar-row { display: none !important; }
.lf-hint { display: none !important; }
.stats-compact { display: none !important; }
.source-tabs { display: contents; }

/* Stitch toolbar — wrap cleanly, no overlap */
.stitch-toolbar, .stitch-filters {
  display: flex; flex-wrap: wrap; gap: .4rem .5rem; align-items: flex-end;
  margin: .4rem 0 .55rem; padding: .5rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
}
.stitch-toolbar label, .stitch-filters label {
  display: flex; flex-direction: column; gap: .15rem;
  font-size: .68rem; color: var(--muted); margin: 0;
}
.stitch-toolbar select, .stitch-toolbar input,
.stitch-filters select, .stitch-filters input {
  width: auto; min-width: 5.5rem; max-width: 9rem;
  min-height: 34px; margin: 0; font-size: .75rem;
}
.stitch-toolbar .chk, .stitch-filters .chk {
  flex-direction: row; align-items: center; gap: .3rem;
  font-size: .72rem; min-height: 34px;
}
.stitch-coverage, .stitch-heroes { margin: .4rem 0; max-width: 100%; overflow-x: auto; }
.feature-strip {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem;
  margin: .35rem 0 .5rem; padding: .35rem .5rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  font-size: .72rem;
}
.feature-strip .fs-item { color: #cbd5e1; white-space: nowrap; }
.feature-strip .btn-sm { min-height: 30px; padding: .2rem .45rem; }
.feature-panel { display: none !important; } /* old bloated panel */

/* Tables: never overflow layout */
.listing-table-wrap, .stitch-compare-wrap, .detail-table-wrap, .cmp-table-wrap {
  max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.listing-table { min-width: 640px; }
.app-main, .app-v2 .report-main {
  overflow-x: hidden; /* scroll inside table wraps only */
  overflow-y: auto;
}
.scan-taskbar {
  top: var(--hdr-h, 56px) !important;
  z-index: 30;
}
.plan-id { font-size: .65rem; word-break: break-all; }

/* Prevent absolute popovers clipping badly */
.rich-alt { z-index: 3; }
.rich-alt.is-open { z-index: 20; }
.stitch-plan { overflow: visible; }
.stitch-timeline { max-width: 100%; overflow-x: auto; }

/* —— Search sheet modal —— */
.app-v2 .modal {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: stretch; justify-content: center;
}
.app-v2 .modal.hidden { display: none !important; }
.app-v2 .modal-backdrop {
  position: absolute; inset: 0; background: rgba(2, 6, 23, .72); backdrop-filter: blur(6px);
}
.modal-sheet {
  position: relative; z-index: 1;
  width: min(980px, 100%);
  margin: .5rem;
  max-height: calc(100vh - 1rem);
  display: flex; flex-direction: column;
  border-radius: 18px; border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(8, 47, 73, .12);
  overflow: hidden;
}
.sheet-header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: .5rem .75rem; align-items: center;
  padding: .75rem .9rem;
  border-bottom: 1px solid var(--line);
  background: #f0fbfd;
  flex-shrink: 0;
}
.sheet-title-block h2 { margin: 0; font-size: 1.05rem; }
.sheet-sub { margin: .15rem 0 0; font-size: .72rem; color: var(--muted); }
.sheet-close { justify-self: end; }
.sheet-body {
  flex: 1; overflow: auto;
  display: grid; grid-template-columns: 1fr 1.05fr;
  gap: 0; min-height: 0;
}
.sheet-col {
  padding: .85rem .95rem 1rem;
  border-right: 1px solid var(--line);
}
.sheet-col:last-child { border-right: none; }
.col-title {
  margin: 0 0 .55rem; font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em; color: #94a3b8;
}
.field { display: flex; flex-direction: column; gap: .28rem; margin-bottom: .65rem; }
.field-label { font-size: .75rem; font-weight: 600; color: #cbd5e1; }
.field-label small { color: #64748b; font-weight: 500; }
.field input, .field select, .field textarea,
.app-v2 select, .app-v2 input, .app-v2 textarea {
  width: 100%; margin: 0;
  background: #e0f2fe; border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: .5rem .6rem; font: inherit; font-size: .85rem;
  min-height: 40px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field-radius input[type=range] { min-height: 0; padding: 0; accent-color: #6366f1; }
.radius-scale {
  display: flex; justify-content: space-between; font-size: .62rem; color: #64748b;
}
.field-block { margin-top: .85rem; padding-top: .75rem; border-top: 1px dashed var(--line); }
.guest-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: .45rem; font-size: .85rem;
}
.stepper {
  display: inline-flex; align-items: center; gap: .2rem;
  background: #e0f2fe; border: 1px solid var(--line); border-radius: 10px; padding: .15rem;
}
.stepper input {
  width: 2.4rem; min-height: 32px; text-align: center; border: none; background: transparent;
  padding: 0; font-weight: 800;
}
.stepper-btn {
  width: 32px; height: 32px; margin: 0; border: none; border-radius: 8px;
  background: var(--surface-2); color: var(--text); font-size: 1rem; cursor: pointer;
}
.stepper-btn:hover { background: var(--accent-soft); }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .4rem; }
.chip-btn {
  margin: 0; padding: .35rem .7rem; min-height: 36px; border-radius: 999px;
  border: 1px solid var(--line); background: #e0f2fe; color: var(--text);
  font: inherit; font-weight: 700; font-size: .8rem; cursor: pointer;
}
.chip-btn.on, .chip-btn.active {
  background: var(--accent-soft); border-color: #6366f1; color: #e0e7ff;
}
.info-callout {
  margin-top: .5rem; padding: .65rem .75rem; border-radius: 12px;
  background: rgba(6, 182, 212, .08); border: 1px solid rgba(6, 182, 212, .25);
  font-size: .78rem; color: #a5f3fc; line-height: 1.4;
}
.route-dates { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.stitch-legs-head {
  display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .35rem;
}
.inline-actions { display: flex; gap: .25rem; }
.stitch-legs { display: flex; flex-direction: column; gap: .4rem; }
.stitch-leg-row {
  display: grid;
  grid-template-columns: 1.6rem minmax(0, 1fr) auto auto;
  gap: .35rem; align-items: center;
  padding: .4rem .45rem; border-radius: 10px;
  background: #e0f2fe; border: 1px solid var(--line);
}
.stitch-leg-row .leg-idx { font-size: .72rem; font-weight: 800; color: #93c5fd; }
.stitch-leg-row select {
  min-width: 0; width: 100%; min-height: 36px; font-size: .78rem; margin: 0;
}
.leg-nights-range {
  display: inline-flex; align-items: center; gap: .2rem; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  padding: .15rem .3rem;
}
.leg-n-lab {
  display: inline-flex; align-items: center; gap: .15rem;
  font-size: .62rem; color: var(--muted); margin: 0; white-space: nowrap;
}
.leg-nights-range input[type=number] {
  width: 2.4rem; min-height: 30px; margin: 0; padding: .15rem .2rem;
  font-size: .78rem; font-weight: 800; text-align: center;
}
.leg-n-sep { color: #64748b; font-weight: 700; }
.leg-n-unit { font-size: .65rem; color: #94a3b8; font-weight: 700; }
#stitchLegsSummary.summary-warn { color: #fca5a5 !important; }
#stitchLegsSummary b { color: #e2e8f0; }
.toggle-row {
  display: flex; gap: .55rem; align-items: flex-start;
  padding: .55rem .65rem; border-radius: 12px; border: 1px solid var(--line);
  background: #e0f2fe; margin: .5rem 0; cursor: pointer; font-size: .82rem;
}
.toggle-row input { width: auto; margin-top: .2rem; }
.toggle-row small { display: block; color: var(--muted); font-size: .72rem; margin-top: .15rem; }
.radio-cards { display: grid; gap: .4rem; margin-top: .5rem; }
.radio-card {
  display: flex; gap: .55rem; align-items: flex-start;
  padding: .55rem .65rem; border-radius: 12px; border: 1px solid var(--line);
  background: #e0f2fe; cursor: pointer;
}
.radio-card:has(input:checked) {
  border-color: #6366f1; background: var(--accent-soft);
}
.radio-card input { width: auto; margin-top: .2rem; }
.radio-card strong { display: block; font-size: .82rem; }
.radio-card small { color: var(--muted); font-size: .72rem; }
.selected-cities { display: flex; flex-wrap: wrap; gap: .3rem; margin: .2rem 0 .5rem; min-height: 1.5rem; }
.suggestions {
  max-height: 160px; overflow: auto; margin: 0 0 .4rem;
  border-radius: 10px; border: 1px solid var(--line); background: #e0f2fe;
}
.sheet-footer {
  flex-shrink: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  padding: .65rem .9rem; border-top: 1px solid var(--line);
  background: rgba(8, 13, 24, .95);
}
.footer-status { flex: 1 1 120px; margin: 0; min-height: 1.2em; }
.sheet-footer-actions {
  display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-left: auto;
}
.btn-cta {
  min-width: 9.5rem;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .35);
}

/* Listing density defaults under v2 */
.app-v2 .cards {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .5rem;
}
.app-v2 .cards-dense {
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: .35rem;
}
.app-v2 .cards-dense .card img, .app-v2 .cards-dense .placeholder { height: 96px; }
.app-v2 .listing-table { font-size: .76rem; }
.app-v2 .listing-table th, .app-v2 .listing-table td { padding: .35rem .4rem; }

/* Sidebar mobile drawer */
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; z-index: 35;
  background: rgba(2,6,23,.55);
}
body.sidebar-open .sidebar-backdrop { display: block; }

@media (max-width: 960px) {
  .app-header { grid-template-columns: auto 1fr auto; }
  .nav-label { display: none; }
  .nav-pill { padding: .4rem .55rem; }
  .brand-text strong { font-size: .82rem; }
  .btn-tool-label { display: none; }
  .app-shell { grid-template-columns: 1fr; }
  .app-sidebar {
    position: fixed; left: 0; top: var(--hdr-h); bottom: 0; width: min(92vw, 320px);
    z-index: 36; transform: translateX(-105%); transition: transform .22s ease;
    max-height: none; box-shadow: 8px 0 32px rgba(0,0,0,.4);
  }
  body.sidebar-open .app-sidebar { transform: translateX(0); }
  .sheet-body { grid-template-columns: 1fr; }
  .sheet-col { border-right: none; border-bottom: 1px solid var(--line); }
  .modal-sheet { margin: 0; width: 100%; max-height: 100vh; border-radius: 0; }
  .sheet-header { grid-template-columns: 1fr auto; }
  .mode-seg { grid-column: 1 / -1; order: 3; }
  .welcome-tips { grid-template-columns: 1fr; }
  .header-status { display: none; }
}
@media (max-width: 560px) {
  .filter-grid, .route-dates { grid-template-columns: 1fr; }
  .sheet-footer-actions { width: 100%; }
  .btn-cta { flex: 1; }
}
/* ═══════════════════════════════════════════
   APP V3 — header ribbon + drawer sidebar + modal
   ═══════════════════════════════════════════ */
body.app-v3 {
  background:
    radial-gradient(1400px 700px at 15% -10%, rgba(16, 185, 129, 0.12), transparent 60%),
    radial-gradient(1000px 600px at 85% 0%, rgba(59, 130, 246, 0.12), transparent 55%),
    var(--bg);
}
body.app-v3 .topbar { display: none !important; }

body.app-v3 .app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  min-height: var(--hdr-h);
  height: auto;
  padding: .4rem .75rem;
  flex-wrap: nowrap;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(15, 23, 42, .04);
}
body.app-v3 .app-header-brand {
  display: flex; align-items: center; gap: .55rem; flex-shrink: 0; min-width: 0;
}
body.app-v3 .brand-mark {
  background: var(--accent-grad); color: #fff; font-weight: 800;
  font-size: .82rem; padding: .2rem .5rem; border-radius: 8px;
  width: auto; height: auto; letter-spacing: -0.02em;
  display: inline-flex; align-items: center;
}
body.app-v3 .brand-title { font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; }
body.app-v3 .brand-text { display: none; }
body.app-v3 .header-subtitle {
  color: var(--muted); font-size: .72rem; max-width: 160px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.app-v3 .header-scan-ribbon {
  display: flex; align-items: center; gap: .4rem; flex: 1; min-width: 0; overflow: hidden;
}
body.app-v3 .ribbon-label {
  font-size: .68rem; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; flex-shrink: 0;
}
body.app-v3 .scan-ribbon-list {
  display: flex; align-items: center; gap: .35rem;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding: .1rem 0; min-width: 0;
}
body.app-v3 .scan-ribbon-list::-webkit-scrollbar { display: none; }
body.app-v3 .scan-ribbon-item {
  display: inline-flex; align-items: center; gap: .3rem;
  background: var(--card-solid); border: 1px solid var(--border);
  border-radius: 8px; padding: .2rem .5rem;
  font-size: .72rem; color: var(--text); cursor: pointer;
  white-space: nowrap; margin: 0; font-weight: 600;
  transition: border-color .12s, background .12s;
}
body.app-v3 .scan-ribbon-item:hover { border-color: var(--accent-blue); background: #eff6ff; }
body.app-v3 .scan-ribbon-item.active {
  border-color: var(--accent); background: rgba(13, 148, 136, 0.12); font-weight: 700;
}
body.app-v3 .ribbon-date { font-weight: 800; color: #2563eb; }
body.app-v3 .ribbon-city { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; }
body.app-v3 .ribbon-count {
  background: rgba(15,23,42,.06); padding: .05rem .28rem; border-radius: 4px;
  font-size: .65rem; color: var(--muted);
}
body.app-v3 .app-header-actions {
  display: flex; align-items: center; gap: .35rem; flex-shrink: 0;
}
body.app-v3 .btn-primary {
  background: var(--accent); color: #fff; border: none; font-weight: 800;
}
body.app-v3 .btn-primary:hover { background: #0f766e; filter: none; }
body.app-v3 .btn-secondary {
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
body.app-v3 .btn-sm { padding: .3rem .55rem; font-size: .75rem; min-height: 32px; border-radius: 8px; }
body.app-v3 .btn-icon-danger {
  background: rgba(239, 68, 68, 0.15); color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: .3rem .45rem; font-size: .78rem; border-radius: 8px; cursor: pointer; margin: 0;
}
body.app-v3 .btn-icon-danger[hidden] { display: none !important; }
body.app-v3 .header-status {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .45rem; border-radius: 999px;
  background: rgba(5, 150, 105, 0.1); border: 1px solid rgba(5, 150, 105, 0.3);
  font-size: .68rem; font-weight: 700; color: #047857;
}
body.app-v3 .header-status[hidden] { display: none !important; }
body.app-v3 .header-status.is-err {
  background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.3); color: #b91c1c;
}

body.app-v3 .app-shell {
  display: block; min-height: calc(100vh - var(--hdr-h));
  grid-template-columns: unset;
}
body.app-v3 .app-main, body.app-v3 .report-main {
  width: 100%; max-width: 100%;
  padding: .65rem .9rem 1.5rem;
  max-height: none; min-height: calc(100vh - var(--hdr-h));
}
body.app-v3 .app-sidebar {
  position: fixed; top: var(--hdr-h); right: 0; bottom: 0; left: auto;
  width: min(360px, 92vw);
  max-height: none;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border); border-right: none;
  box-shadow: -8px 0 32px rgba(0,0,0,.55);
  z-index: 50;
  transform: translateX(100%);
  transition: transform .22s cubic-bezier(.16,1,.3,1);
  display: flex; flex-direction: column;
  padding: .75rem;
  overflow: hidden;
}
body.app-v3.sidebar-open .app-sidebar,
body.sidebar-open.app-v3 .app-sidebar { transform: translateX(0); }
body.app-v3 .sidebar-backdrop {
  display: none; position: fixed; inset: 0; top: var(--hdr-h);
  background: rgba(2,6,15,.55); z-index: 45;
}
body.app-v3.sidebar-open .sidebar-backdrop,
body.sidebar-open.app-v3 .sidebar-backdrop { display: block; }
body.app-v3 .sidebar-head-row {
  display: flex; align-items: center; gap: .4rem; margin-bottom: .45rem;
}
body.app-v3 .sidebar-head-row h2 { margin: 0; flex: 1; font-size: .95rem; }
body.app-v3 .icon-btn-close {
  background: transparent; border: none; font-size: 1.35rem; color: var(--muted);
  cursor: pointer; padding: 0 .25rem; line-height: 1;
}
body.app-v3 .scan-list { flex: 1; overflow: auto; }

body.app-v3 .modal-sheet {
  width: min(880px, 96vw); max-height: 92vh;
  border-radius: 16px; background: var(--bg-elevated);
  border: 1px solid var(--border); margin: 0; display: flex; flex-direction: column;
}
body.app-v3 .sheet-header {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .7rem 1rem; background: #f8fafc; border-bottom: 1px solid var(--border);
}
body.app-v3 .sheet-header h2 { margin: 0; font-size: 1.05rem; flex: 1; }
body.app-v3 .mode-seg {
  display: flex; gap: .2rem; background: var(--surface-2); padding: .15rem; border-radius: 8px;
}
body.app-v3 .mode-tab {
  background: transparent; border: none; padding: .3rem .65rem;
  font-size: .75rem; color: var(--muted); border-radius: 6px; cursor: pointer; font-weight: 700;
  width: auto !important; margin: 0;
}
body.app-v3 .mode-tab.active { background: var(--accent); color: #fff; font-weight: 800; }
body.app-v3 .sheet-body {
  display: flex; flex-direction: column; gap: .7rem;
  padding: .85rem 1rem; overflow-y: auto; grid-template-columns: unset;
}
body.app-v3 .sheet-col { display: contents; border: none; padding: 0; }
body.app-v3 .form-row-group {
  display: flex; align-items: flex-end; gap: .6rem; flex-wrap: wrap;
}
body.app-v3 .form-row-group.column-group { flex-direction: column; align-items: stretch; }
body.app-v3 .field-inline {
  display: flex; flex-direction: column; gap: .25rem; font-size: .8rem;
}
body.app-v3 .field-inline.flex-grow { flex: 1 1 200px; min-width: 180px; }
body.app-v3 .field-inline label {
  color: var(--muted); font-weight: 600; font-size: .72rem; margin: 0;
}
body.app-v3 .field-inline select,
body.app-v3 .field-inline input,
body.app-v3 .field-inline textarea {
  width: 100%; margin: 0; min-height: 36px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: .35rem .5rem; color: var(--text); font: inherit;
}
body.app-v3 .selected-cities-row, body.app-v3 #selectedCities {
  display: flex; flex-wrap: wrap; gap: .3rem; min-height: 0;
}
body.app-v3 .city-tag {
  display: inline-flex; align-items: center; gap: .25rem;
  background: rgba(13,148,136,.1); border: 1px solid rgba(13,148,136,.3);
  color: #0f766e; border-radius: 999px; padding: .15rem .5rem; font-size: .72rem; font-weight: 700;
}
body.app-v3 .city-tag button {
  background: transparent; border: none; color: inherit; cursor: pointer; padding: 0 .15rem;
  width: auto !important; margin: 0;
}
body.app-v3 .sheet-footer {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .65rem 1rem; background: #f8fafc; border-top: 1px solid var(--border);
}
body.app-v3 .btn-cta {
  background: var(--accent); color: #fff; border: none; font-weight: 800;
  padding: .55rem 1.1rem; border-radius: 10px; min-height: 42px;
  box-shadow: 0 6px 20px rgba(13,148,136,.25);
}
body.app-v3 .radio-cards-row { display: flex; gap: .4rem; flex-wrap: wrap; }
body.app-v3 .radio-card {
  display: inline-flex; gap: .35rem; align-items: center;
  padding: .35rem .55rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); cursor: pointer; font-size: .78rem;
}
body.app-v3 .radio-card:has(input:checked) {
  border-color: var(--accent); background: rgba(13,148,136,.1);
}
body.app-v3 .radio-card input { width: auto; margin: 0; }
body.app-v3 .toggle-row {
  display: inline-flex; gap: .4rem; align-items: center;
  padding: .35rem .55rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: .78rem; cursor: pointer; margin: 0;
}
body.app-v3 .toggle-row input { width: auto; }
body.app-v3 .stitch-legs-horizontal .stitch-leg-row {
  grid-template-columns: 1.5rem minmax(0,1.2fr) auto auto;
}

body.app-v3 .empty-workspace {
  display: flex; align-items: center; justify-content: center;
  min-height: 50vh; padding: 1rem;
}
body.app-v3 .hero-card {
  text-align: center; max-width: 480px; padding: 1.75rem 1.5rem;
  border-radius: 16px; background: var(--card); border: 1px solid var(--border);
}
body.app-v3 .hero-icon { font-size: 2.2rem; margin-bottom: .35rem; }
body.app-v3 .hero-card h2 { margin: 0 0 .35rem; font-size: 1.15rem; }
body.app-v3 .hero-sub { color: var(--muted); font-size: .82rem; margin: 0 0 1rem; }
body.app-v3 .empty-workspace-actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }

body.app-v3 .scan-taskbar { top: var(--hdr-h); }

body.app-v3 .cmd-mode-btn.active {
  background: rgba(13, 148, 136, 0.14);
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.35);
  color: #0f766e;
}
body.app-v3 .chip-toggle.active,
body.app-v3 .src-pill.active {
  background: rgba(13, 148, 136, 0.12);
  border-color: rgba(13, 148, 136, 0.4);
  color: #0f766e;
}
body.app-v3 .layout-ico.active {
  background: rgba(13, 148, 136, 0.14);
  color: #0f766e;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.35);
}

.suggestions {
  position: absolute; z-index: 20; left: 0; right: 0; top: 100%;
  max-height: 180px; overflow: auto; margin-top: 2px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,23,42,.1);
}
.city-search-wrap { position: relative; }
.suggestions button, .suggestions .sug-item {
  display: block; width: 100%; text-align: left; background: transparent;
  border: none; border-bottom: 1px solid var(--border); padding: .45rem .6rem;
  color: var(--text); cursor: pointer; font-size: .8rem;
}
.suggestions button:hover { background: #f1f5f9; }

@media (max-width: 900px) {
  body.app-v3 .app-header { flex-wrap: wrap; }
  body.app-v3 .header-scan-ribbon { order: 3; width: 100%; }
  body.app-v3 .brand-title { display: none; }
  body.app-v3 .header-subtitle { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   LIGHT THEME — eye-friendly surfaces (overrides leftover dark)
   ═══════════════════════════════════════════════════════════ */
.hint code { background: #e2e8f0; color: #334155; }
.layout-btn {
  background: #fff !important; color: var(--text) !important;
  border-color: var(--border) !important;
}
.layout-btn.active, .layout-btn:hover {
  border-color: var(--accent) !important;
  background: var(--accent-soft) !important; color: #0f766e !important;
}
.detail-summary,
.compare-panel,
.hero-card,
.insight-card,
.listing-filters,
.stitch-segment,
.stitch-leg-row,
.src-check,
.suggestion,
.card-body-meta,
.cov-cell,
.rich-alt-panel,
.rich-alt-head,
.rich-alt-nav,
.feature-panel,
.welcome-card,
.empty-workspace .hero-card {
  background: #fff !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
/* Light chips only outside listing cards (cmd-bar, insights, stitch, detail may use dark chips via .card) */
.cmd-bar .chip, .stitch-toolbar .chip, .insight-card .chip, .welcome-card .chip {
  background: #eef2f7 !important;
  color: #334155 !important;
}
.chip.good, .chip.moves-0, .chip.tier-low, .match-badge.ok {
  background: #d1fae5 !important; color: #065f46 !important;
}
.chip.sea, .chip.sea-map { background: #e0f2fe !important; color: #075985 !important; }
.chip.src-airbnb { background: #ffe4e6 !important; color: #9f1239 !important; }
.chip.src-booking { background: #dbeafe !important; color: #1e40af !important; }
.chip.src-all { background: #ccfbf1 !important; color: #0f766e !important; }
.chip.rating, .chip.city-route { background: #e0e7ff !important; color: #3730a3 !important; }
.chip.tier-mid { background: #fef3c7 !important; color: #92400e !important; }
.chip.tier-high { background: #fee2e2 !important; color: #991b1b !important; }
.card .chip.good { background: #d1fae5 !important; color: #065f46 !important; }
.card .chip.sea, .card .chip.sea-map { background: #e0f2fe !important; color: #075985 !important; }
.card .chip.src-airbnb { background: #fce7f3 !important; color: #9d174d !important; }
.card .chip.src-booking { background: #dbeafe !important; color: #1e40af !important; }
.card .chip.rating, .card .chip.score { background: #dbeafe !important; color: #1e40af !important; }
.card a.detail-ext-link { color: #0369a1 !important; }
.report-link a { color: #0369a1 !important; }
.hero-val, .td-price { color: #0e7490 !important; }
.insights li { color: var(--text) !important; }
.btn-tool.primary { color: #0f766e !important; border-color: rgba(13,148,136,.35) !important; }
.btn-tool.danger { color: #b91c1c !important; background: #fef2f2 !important; border-color: #fecaca !important; }
.header-status { color: #047857 !important; background: rgba(5,150,105,.1) !important; }
.cross-scan-row .cs-price.cheaper,
.detail-scan-table .cs-price.cheaper { color: #059669 !important; }
.cross-scan-row .cs-price.dearer,
.detail-scan-table .cs-price.dearer { color: #dc2626 !important; }
.card-hist-badge {
  background: rgba(255,255,255,.92) !important;
  color: #1d4ed8 !important;
  border-color: #93c5fd !important;
}
.modal-card, .modal-wide, .detail-card, .modal-sheet {
  background: #fff !important;
  color: var(--text) !important;
}
.modal-backdrop, body.app-v3 .sidebar-backdrop {
  background: rgba(15, 23, 42, .35) !important;
}
body.app-v3 .app-sidebar {
  background: #fff !important;
  box-shadow: -8px 0 32px rgba(15,23,42,.12) !important;
}
/* final safety: source filters never stack full-width */
.cmd-bar-filters {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
}
.cmd-bar-filters .src-pills,
.cmd-bar-filters .chip-toggle-row {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
}
.cmd-bar-filters button.src-pill,
.cmd-bar-filters button.chip-toggle,
.cmd-bar-filters button[data-src-all],
.cmd-bar-filters button[data-src-btn] {
  width: auto !important;
  flex: 0 0 auto !important;
  margin-top: 0 !important;
}

/* ── Photo carousel ── */
.photo-carousel {
  position: relative;
  width: 100%;
  background: #e0f2fe;
  overflow: hidden;
  user-select: none;
}
.carousel-stage { position: relative; width: 100%; height: 140px; }
.cards-dense .carousel-stage { height: 110px; }
.carousel-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity .18s ease;
  pointer-events: none;
}
.carousel-img.is-active { opacity: 1; pointer-events: auto; }
.carousel-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 3; width: 28px !important; height: 28px; margin: 0 !important;
  padding: 0; border: none; border-radius: 50%;
  background: rgba(15, 23, 42, 0.72); color: #f8fafc;
  font-size: 1.1rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.carousel-nav:hover { background: rgba(15, 23, 42, 0.92); }
.carousel-nav.prev { left: .35rem; }
.carousel-nav.next { right: .35rem; }
.carousel-dots {
  position: absolute; bottom: .35rem; left: 50%; transform: translateX(-50%);
  z-index: 3; display: flex; gap: .25rem; pointer-events: auto;
}
.carousel-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.4); cursor: pointer;
}
.carousel-dot.is-active { background: #fff; }
.carousel-count {
  position: absolute; top: .35rem; right: .35rem; z-index: 3;
  font-size: .65rem; font-weight: 800; color: #f8fafc;
  background: rgba(15,23,42,.7); padding: .1rem .35rem; border-radius: 6px;
}
.photo-carousel-detail { border-radius: 10px; margin-bottom: .65rem; }
.photo-carousel-detail .carousel-stage { height: 240px; }
.photo-carousel-detail .carousel-img { border-radius: 10px; }
.card-img-link .photo-carousel { display: block; }

/* ── Map view ── */
.map-view-wrap { margin-top: .25rem; }
.map-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .55rem;
  margin-bottom: .4rem;
}
.map-stats { font-size: .75rem; flex: 1 1 auto; }
.map-toggle { cursor: pointer; user-select: none; }
.map-container {
  width: 100%;
  height: min(72vh, 640px);
  min-height: 360px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #e2e8f0;
  z-index: 1;
}
.map-hint { margin: .4rem 0 0; font-size: .72rem; }
.price-marker-wrap { background: transparent !important; border: none !important; }
.price-marker {
  display: inline-flex; align-items: center; justify-content: center; gap: .2rem;
  padding: .2rem .5rem; border-radius: 999px;
  background: #0f766e; color: #ecfdf5; font-weight: 800; font-size: .72rem;
  border: 2px solid #5eead4; box-shadow: 0 2px 8px rgba(15,23,42,.35);
  white-space: nowrap;
}
.price-marker .pm-ico { font-size: .7rem; line-height: 1; }
.price-marker .pm-price { line-height: 1; }
/* Airbnb = rose/coral so pins are easy to tell from Booking */
.price-marker.src-ab {
  background: #9f1239 !important;
  color: #ffe4e6 !important;
  border-color: #fb7185 !important;
}
.price-marker.src-ab.verified {
  background: #be123c !important;
  border-color: #fda4af !important;
  color: #fff1f2 !important;
}
/* Booking = blue */
.price-marker.src-bk {
  background: #1d4ed8 !important;
  color: #eff6ff !important;
  border-color: #60a5fa !important;
}
.price-marker.src-bk.verified {
  background: #1e40af !important;
  border-color: #93c5fd !important;
  color: #eff6ff !important;
}
.price-marker.src-ot {
  background: #57534e !important;
  color: #fafaf9 !important;
  border-color: #a8a29e !important;
}
.price-marker.verified {
  border-color: #10b981; background: #064e3b; color: #a7f3d0;
}
.price-marker.approx {
  border-color: #94a3b8; color: #e2e8f0; background: #334155;
  border-style: dashed;
}
.price-marker.conflict {
  border-color: #f59e0b; background: #78350f; color: #fde68a;
}
.map-legend { display: inline-flex; gap: .35rem; align-items: center; flex-wrap: wrap; }
.map-leg {
  font-size: .68rem; font-weight: 700; padding: .12rem .4rem; border-radius: 999px;
  border: 1px solid transparent;
}
.map-leg-ab { background: #ffe4e6; color: #9f1239; border-color: #fb7185; }
.map-leg-bk { background: #dbeafe; color: #1d4ed8; border-color: #60a5fa; }
.map-leg-vrbo { background: #fef3c7; color: #b45309; border-color: #fbbf24; }
.map-leg-htg { background: #ede9fe; color: #6d28d9; border-color: #a78bfa; }
.map-leg-hol { background: #ffedd5; color: #c2410c; border-color: #fb923c; }
.price-marker.src-vrbo {
  background: #b45309 !important;
  color: #fffbeb !important;
  border-color: #fbbf24 !important;
}
.price-marker.src-htg {
  background: #6d28d9 !important;
  color: #f5f3ff !important;
  border-color: #a78bfa !important;
}
.price-marker.src-hol {
  background: #c2410c !important;
  color: #fff7ed !important;
  border-color: #fb923c !important;
}
.map-popup-src { font-size: .68rem; font-weight: 700; color: #64748b; margin-bottom: .15rem; }
/* v2.1 quality banner */
.quality-banner {
  width: 100%;
  display: flex; flex-wrap: wrap; gap: .35rem .5rem; align-items: center;
  padding: .25rem 0 .15rem;
}
.quality-banner-flags { display: flex; flex-wrap: wrap; gap: .3rem; }
.q-chip {
  font-size: .68rem; font-weight: 600;
  padding: .12rem .45rem; border-radius: 999px;
  background: #fff7ed; color: #9a3412; border: 1px solid #fdba74;
}
.quality-banner-time { font-size: .68rem; }

.map-popup { font-family: var(--font); font-size: .8rem; color: #0f172a; }
.map-popup-img {
  width: 100%; height: 110px; object-fit: cover; border-radius: 8px;
  display: block; margin-bottom: .4rem; background: #e2e8f0;
}
.map-popup-title { display: block; font-size: .85rem; margin-bottom: .2rem; line-height: 1.25; }
.map-popup-meta { color: #64748b; font-size: .75rem; margin-bottom: .35rem; }
.map-approx { font-size: .68rem; color: #b45309; margin-bottom: .3rem; }
.map-geo-ok { font-size: .68rem; color: #047857; margin-bottom: .25rem; font-weight: 600; }
.map-geo-warn { font-size: .68rem; color: #b45309; margin-bottom: .25rem; font-weight: 600; }
.map-popup-coords { font-size: .65rem; margin-bottom: .35rem; font-family: ui-monospace, monospace; }
.map-popup-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.map-popup-open {
  width: auto !important; margin: 0 !important; padding: .3rem .55rem !important;
  border-radius: 8px; border: none; background: #0d9488; color: #fff;
  font-weight: 700; font-size: .75rem; cursor: pointer;
}
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-container a.detail-ext-link { color: #0369a1; }

/* ── Detail tabs + date price calendar ── */
.detail-tabs {
  display: flex; flex-wrap: wrap; gap: .3rem;
  margin: .65rem 0 .45rem;
}
.detail-tab {
  width: auto !important; margin: 0 !important;
  padding: .35rem .7rem !important; min-height: 34px;
  border-radius: 999px !important;
  border: 1px solid rgba(14, 116, 144, 0.22) !important;
  background: #f0fbfd !important;
  color: #0c4a6e !important;
  font: inherit; font-size: .78rem; font-weight: 700;
  cursor: pointer;
}
.detail-tab.active {
  background: #ccfbf1 !important;
  border-color: #14b8a6 !important;
  color: #0f766e !important;
}
.detail-tab-panel[hidden] { display: none !important; }
.price-day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: .4rem;
  margin: .4rem 0 .55rem;
}
.price-day {
  border: 1px solid rgba(14, 116, 144, 0.18);
  border-radius: 10px;
  padding: .4rem .35rem .45rem;
  background: #fff;
  text-align: center;
  min-height: 88px;
}
.price-day.is-planned {
  border-color: #0ea5e9;
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.35);
  background: #e0f2fe;
}
.price-day.is-best {
  border-color: #10b981;
  background: #ecfdf5;
}
.price-day.is-worst:not(.is-best) {
  border-color: #f59e0b;
  background: #fffbeb;
}
.price-day.is-empty {
  background: #f8fafc;
  opacity: .92;
}
.price-day.is-past {
  opacity: .55;
  background: #f1f5f9;
}
.map-empty-msg {
  padding: 1.25rem 1rem; color: #0c4a6e; font-size: .88rem; line-height: 1.45;
}
.map-empty-msg .empty { margin-top: .4rem; }
.pd-off {
  font-size: .65rem; font-weight: 800; color: #0e7490;
  text-transform: uppercase; letter-spacing: .02em;
}
.pd-date {
  font-size: .78rem; font-weight: 700; color: #0c4a6e; margin: .1rem 0 .25rem;
}
.pd-date small { font-weight: 600; color: #5b7c8a; }
.pd-ppn {
  display: block; font-size: .82rem; font-weight: 800; color: #0f766e;
}
.pd-total {
  display: block; font-size: .62rem; color: #5b7c8a; margin-top: .1rem;
}
.pd-miss {
  display: block; font-size: .68rem; color: #94a3b8; margin-top: .35rem;
}
.date-price-summary { margin-bottom: .5rem; }
.date-price-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
  margin: .25rem 0 .5rem;
}
.price-day.is-live {
  border-color: #8b5cf6;
  box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.25);
}
.pd-live {
  display: inline-block; margin-top: .15rem;
  font-size: .58rem; font-weight: 800; color: #6d28d9;
  background: #ede9fe; border-radius: 4px; padding: .05rem .25rem;
}
.price-disclaimer {
  margin: .15rem 0 .35rem; font-size: .72rem !important;
}
.gallery-actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  margin: .35rem 0 .5rem;
}
.photo-empty .placeholder { height: 180px; }
.carousel-count.single {
  position: absolute; top: .35rem; right: .35rem;
  font-size: .65rem; background: rgba(15,23,42,.65); color: #fff;
  padding: .1rem .35rem; border-radius: 6px;
}
.favorites-head .btn-primary.btn-sm {
  margin-left: auto;
}

/* ── Favorites ── */
.favorites-panel {
  margin: .35rem 0 .75rem;
  padding: .55rem .65rem .65rem;
  background: #f0fdfa;
  border: 1px solid rgba(13, 148, 136, 0.22);
  border-radius: 12px;
}
.favorites-head {
  display: flex; align-items: center; gap: .45rem; flex-wrap: wrap;
  margin-bottom: .4rem;
}
.favorites-head strong { color: #0f766e; font-size: .88rem; }
.favorites-list {
  display: flex; flex-wrap: wrap; gap: .35rem; min-height: 1.5rem;
}
.fav-empty { margin: .15rem 0 0; font-size: .75rem; }
.fav-chip {
  display: inline-flex; align-items: center; gap: .1rem;
  background: #fff; border: 1px solid rgba(13, 148, 136, 0.28);
  border-radius: 999px; overflow: hidden;
}
.fav-chip.on { border-color: #0d9488; background: #ccfbf1; }
.fav-chip .fav-pick {
  width: auto !important; margin: 0 !important; padding: .22rem .55rem !important;
  border: none; background: transparent; color: #0f766e;
  font: inherit; font-size: .75rem; font-weight: 700; cursor: pointer;
}
.fav-chip .fav-pick small { font-weight: 600; opacity: .7; }
.fav-chip .fav-del {
  width: auto !important; margin: 0 !important; padding: .15rem .4rem !important;
  border: none; border-left: 1px solid rgba(13, 148, 136, 0.2);
  background: transparent; color: #94a3b8; cursor: pointer; font-size: .95rem;
}
.fav-chip .fav-del:hover { color: #dc2626; background: #fef2f2; }
.city-tag { display: inline-flex; align-items: center; gap: .25rem; }
.city-tag .city-fav-btn {
  width: auto !important; margin: 0 !important; padding: 0 .15rem !important;
  border: none; background: transparent; color: #94a3b8; cursor: pointer; font-size: .95rem;
}
.city-tag.is-fav .city-fav-btn, .city-tag .city-fav-btn:hover { color: #d97706; }
.suggestion-row {
  display: flex; align-items: stretch; border-bottom: 1px solid var(--border);
}
.suggestion-row .suggestion {
  flex: 1; border-bottom: none !important; text-align: left;
}
.suggestion-row .sug-fav {
  width: auto !important; margin: 0 !important; padding: .4rem .55rem !important;
  border: none; background: transparent; color: #94a3b8; cursor: pointer; font-size: 1rem;
}
.suggestion-row .sug-fav:hover { color: #d97706; background: #fffbeb; }
.fav-custom-form {
  margin-top: .5rem; padding-top: .45rem;
  border-top: 1px dashed rgba(13, 148, 136, 0.25);
}
.fav-custom-form.hidden { display: none !important; }
.fav-custom-form .form-row-group { margin: 0; }

/* ═══════════════════════════════════════════════════════════
   SEA WAVE FINAL — kill leftover dark panels (scan / route / stitch)
   ═══════════════════════════════════════════════════════════ */
body.app-v3,
body.app-v2 {
  background:
    radial-gradient(1400px 700px at 12% -10%, rgba(20, 184, 166, 0.18), transparent 58%),
    radial-gradient(1100px 620px at 88% 0%, rgba(14, 165, 233, 0.16), transparent 52%),
    radial-gradient(900px 500px at 50% 110%, rgba(45, 212, 191, 0.1), transparent 50%),
    #e8f6f8 !important;
  color: #0c4a6e !important;
}
body.app-v3 .app-header,
.app-header {
  background: rgba(255, 255, 255, 0.94) !important;
  border-bottom: 1px solid rgba(14, 116, 144, 0.14) !important;
  box-shadow: 0 1px 10px rgba(8, 47, 73, 0.05) !important;
}
body.app-v3 .app-main,
body.app-v3 .report-main,
.report-main,
.app-main {
  background: transparent !important;
  color: #0c4a6e !important;
}
.cmd-bar,
.cmd-bar-stitch,
.stitch-toolbar,
.stitch-filters,
.report-head,
.compare-panel,
.insight-card,
.stitch-segment,
.stitch-plan-card,
.plan-card,
.feature-panel,
.rich-alt-panel,
.modal-card,
.modal-sheet,
.detail-card,
.listing-table-wrap,
.panel,
.glass {
  background: #ffffff !important;
  color: #0c4a6e !important;
  border-color: rgba(14, 116, 144, 0.16) !important;
}
.cmd-mode {
  background: #dff5f7 !important;
  border-color: rgba(14, 116, 144, 0.16) !important;
}
.cmd-mode-btn { color: #5b7c8a !important; background: transparent !important; }
.cmd-mode-btn.active {
  background: rgba(13, 148, 136, 0.16) !important;
  color: #0f766e !important;
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.35) !important;
}
.cmd-title, .cmd-meta, h1, h2, h3, h4, strong { color: #0c4a6e !important; }
.cmd-meta, .empty, .hint, .sub, .status { color: #5b7c8a !important; }
.card,
.cards .card,
.cards-dense .card {
  background: #ffffff !important;
  color: #0c4a6e !important;
  border: 1px solid rgba(14, 116, 144, 0.16) !important;
}
.card .body { background: #ffffff !important; }
.card .title { color: #0c4a6e !important; }
.listing-table { background: #fff !important; color: #0c4a6e !important; }
.listing-table th {
  background: #e0f2fe !important;
  color: #0e7490 !important;
  border-bottom-color: rgba(14, 116, 144, 0.14) !important;
}
.listing-table td { border-bottom-color: rgba(14, 116, 144, 0.1) !important; color: #0c4a6e !important; }
.listing-table tr.table-row:hover { background: rgba(14, 165, 233, 0.06) !important; }
.scan-item,
.app-sidebar .scan-item,
.seg-btn {
  background: #f0fbfd !important;
  color: #0c4a6e !important;
  border-color: rgba(14, 116, 144, 0.14) !important;
}
.scan-item.active,
.seg-btn.active {
  background: #ccfbf1 !important;
  border-color: #14b8a6 !important;
  color: #0f766e !important;
}
body.app-v3 .app-sidebar,
.app-sidebar {
  background: #ffffff !important;
  border-color: rgba(14, 116, 144, 0.14) !important;
}
body.app-v3 .sheet-header,
body.app-v3 .sheet-footer {
  background: #f0fbfd !important;
  border-color: rgba(14, 116, 144, 0.14) !important;
}
body.app-v3 .mode-seg { background: #dff5f7 !important; }
body.app-v3 .mode-tab { color: #5b7c8a !important; }
body.app-v3 .mode-tab.active {
  background: #0d9488 !important;
  color: #fff !important;
}
body.app-v3 .field-inline select,
body.app-v3 .field-inline input,
body.app-v3 .field-inline textarea,
input, textarea, select {
  background: #ffffff !important;
  color: #0c4a6e !important;
  border-color: rgba(14, 116, 144, 0.2) !important;
}
body.app-v3 .btn-secondary,
.btn-secondary,
.btn-tool,
.btn-ghost,
.layout-ico,
.chip-toggle,
.src-pill {
  background: #f0fbfd !important;
  color: #0c4a6e !important;
  border-color: rgba(14, 116, 144, 0.18) !important;
}
body.app-v3 .btn-primary,
.btn-primary,
.btn-cta {
  background: linear-gradient(135deg, #14b8a6, #0ea5e9) !important;
  color: #fff !important;
  border: none !important;
}
.src-pill.active,
.chip-toggle.active,
.layout-ico.active {
  background: #ccfbf1 !important;
  color: #0f766e !important;
  border-color: rgba(13, 148, 136, 0.45) !important;
}
.scan-ribbon-item {
  background: #ffffff !important;
  color: #0c4a6e !important;
  border-color: rgba(14, 116, 144, 0.16) !important;
}
.scan-ribbon-item.active {
  background: #ccfbf1 !important;
  border-color: #14b8a6 !important;
}
.ribbon-date { color: #0284c7 !important; }
.ribbon-count { background: #e0f2fe !important; color: #0e7490 !important; }
/* stitch / route blocks */
.stitch-leg-row,
.cov-cell,
.cov-cell.cov-day,
.rich-alt-head,
.rich-alt-nav,
.suggestion,
.suggestions {
  background: #ffffff !important;
  color: #0c4a6e !important;
  border-color: rgba(14, 116, 144, 0.14) !important;
}
.cov-cell.cov-ok {
  background: #d1fae5 !important;
  color: #065f46 !important;
  border-color: #6ee7b7 !important;
}
.mini-sel {
  background: #ffffff !important;
  color: #0c4a6e !important;
  border-color: rgba(14, 116, 144, 0.2) !important;
}
.price-marker:not(.src-ab):not(.src-bk):not(.src-ot) {
  background: #0f766e !important;
  color: #ecfdf5 !important;
  border-color: #5eead4 !important;
}
.price-marker.approx {
  background: #64748b !important;
  border-style: dashed !important;
  color: #f1f5f9 !important;
}
.photo-carousel { background: #e0f2fe !important; }
.listing-no, .rank-badge {
  background: rgba(14, 165, 233, 0.9) !important;
  color: #fff !important;
}
.good-text { color: #059669 !important; }
.bad-text { color: #dc2626 !important; }
.scan-taskbar-inner {
  background: #ffffff !important;
  border: 1px solid rgba(14, 116, 144, 0.16) !important;
  color: #0c4a6e !important;
}
