:root {
  --page: #f8fafd;
  --surface: #ffffff;
  --surface-soft: #fdfcfb;
  --surface-strong: #f2f2f2;
  --ink: #1f1f1f;
  --muted: #5f6368;
  --quiet: #757575;
  --line: #e0e0e0;
  --line-soft: #eceff1;
  --firebase-yellow: #ffc400;
  --firebase-orange: #ff9100;
  --firebase-red: #dd2c00;
  --firebase-blue: #4285f4;
  --firebase-green: #34a853;
  --firebase-pink: #fdadee;
  --blue: #4285f4;
  --blue-soft: #e8f0fe;
  --green: #188038;
  --green-soft: #e6f4ea;
  --amber: #b06000;
  --amber-soft: #fff7e0;
  --red: #d93025;
  --red-soft: #fce8e6;
  --grade-s-plus: #0b57d0;
  --grade-s-plus-soft: #e8f0fe;
  --grade-s-zero: #1a73e8;
  --grade-s-zero-soft: #eef4ff;
  --grade-a-plus: #188038;
  --grade-a-plus-soft: #e6f4ea;
  --grade-a-zero: #34a853;
  --grade-a-zero-soft: #eff8f1;
  --grade-b-plus: #1a73e8;
  --grade-b-plus-soft: #e8f0fe;
  --grade-b-zero: #4285f4;
  --grade-b-zero-soft: #eef4ff;
  --grade-c-plus: #e37400;
  --grade-c-plus-soft: #fff4e5;
  --grade-c-zero: #f29900;
  --grade-c-zero-soft: #fff8e1;
  --grade-d: #dd2c00;
  --grade-d-soft: #fce8e6;
  --grade-reject: #b3261e;
  --grade-reject-soft: #fce8e6;
  --shadow: 0 1px 2px rgba(60, 64, 67, 0.12), 0 8px 24px rgba(60, 64, 67, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  color: var(--ink);
  font-family:
    "Google Sans Text",
    "Google Sans",
    Roboto,
    -apple-system,
    BlinkMacSystemFont,
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    Arial,
    sans-serif;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  border: 0;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px 32px;
  background: rgba(253, 252, 251, 0.92);
  border-bottom: 1px solid rgba(224, 224, 224, 0.82);
  backdrop-filter: saturate(160%) blur(18px);
}

.brand,
.top-actions {
  display: flex;
  align-items: center;
}

.brand {
  min-width: 0;
  gap: 12px;
}

.brand > div {
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--ink);
  background:
    linear-gradient(135deg, var(--firebase-yellow) 0 46%, var(--firebase-orange) 46% 72%, var(--firebase-red) 72% 100%);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 950;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12);
}

.brand h1,
.brand p {
  margin: 0;
}

.brand h1 {
  color: var(--ink);
  font-size: 22px;
  font-weight: 850;
  line-height: 1.08;
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.top-actions {
  gap: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--blue-soft);
  border-color: rgba(66, 133, 244, 0.45);
}

.icon-button svg,
.primary-button svg,
.open-link svg,
.photo-nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.shell {
  width: min(1760px, 100%);
  margin: 0 auto;
  padding: 18px 32px 36px;
}

.mode-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.mode-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.mode-tabs button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.16);
}

.mode-tabs strong {
  min-width: 22px;
  padding: 2px 6px;
  color: var(--quiet);
  background: var(--surface-strong);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
}

.mode-tabs button.active strong {
  color: var(--ink);
  background: var(--firebase-yellow);
}

.scan-band {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 118px 112px;
  gap: 12px;
  align-items: stretch;
  padding: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.target-manager {
  margin-top: 14px;
}

.target-manager-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.target-manager-head span,
.target-panel-title span,
.target-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.target-manager-head h2 {
  margin: 3px 0;
  color: var(--ink);
  font-size: 25px;
  font-weight: 950;
  line-height: 1.1;
}

.target-manager-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.target-new-button,
.target-ghost-button,
.target-card-actions button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--firebase-blue);
  background: #fff;
  border: 1px solid rgba(25, 103, 210, 0.24);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.target-new-button:hover,
.target-ghost-button:hover,
.target-card-actions button:hover {
  background: var(--blue-soft);
}

.target-manager-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.75fr) minmax(520px, 1.25fr);
  gap: 14px;
  margin-top: 14px;
  align-items: start;
}

.target-list-panel,
.target-editor-panel {
  min-width: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.target-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.target-panel-title strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.target-card-list {
  display: grid;
  gap: 9px;
}

.target-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.target-card.active {
  border-color: rgba(25, 103, 210, 0.5);
  box-shadow: 0 0 0 3px rgba(25, 103, 210, 0.1);
}

.target-card strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.target-card span,
.target-card p,
.target-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.target-card p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.target-card-actions em {
  margin-right: auto;
  color: var(--quiet);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.target-card-actions button.danger {
  color: var(--danger);
  border-color: rgba(217, 48, 37, 0.24);
}

.target-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.target-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.target-field.wide {
  grid-column: 1 / -1;
}

.target-field input,
.target-field select,
.target-field textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  outline: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.target-field input,
.target-field select {
  height: 40px;
  padding: 0 11px;
}

.target-field textarea {
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.45;
}

.target-field textarea[readonly] {
  color: var(--muted);
  background: var(--surface);
}

.target-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.target-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--firebase-blue);
}

.target-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.scan-band > * {
  min-width: 0;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 4px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  overflow: hidden;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmented button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.16);
}

.field,
.range-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.field span,
.range-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.field.compact {
  align-self: stretch;
  padding: 5px 10px 6px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.field input,
.range-field input,
.search,
.select {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  outline: 0;
}

.field input {
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-weight: 850;
}

.search,
.select {
  height: 42px;
  padding: 0 12px;
}

.search:focus,
.select:focus,
.range-field input:focus,
.field input:focus {
  border-color: rgba(66, 133, 244, 0.62);
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.14);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 16px;
  color: var(--ink);
  background: var(--firebase-yellow);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 950;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.16);
}

.primary-button:hover {
  background: var(--firebase-orange);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.select:disabled {
  cursor: progress;
  opacity: 0.64;
}

.job-meter {
  display: grid;
  grid-column: 1 / -1;
  align-content: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 10px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.meter-line,
.meter-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.meter-line span:first-child,
.meter-stats {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meter-track {
  height: 5px;
  overflow: hidden;
  background: var(--surface-strong);
  border-radius: 999px;
}

.meter-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--firebase-yellow), var(--firebase-orange), var(--firebase-blue));
  border-radius: inherit;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.metric {
  min-width: 0;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.metric strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.home-dashboard {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 14px;
  align-items: stretch;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 247, 224, 0.92), rgba(255, 255, 255, 0.96) 52%, rgba(232, 240, 254, 0.72));
  border: 1px solid rgba(255, 196, 0, 0.32);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.home-hero span,
.home-section-head span,
.home-card-kicker,
.home-metric span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.home-hero h2 {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 950;
  line-height: 1;
}

.home-hero p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.home-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.home-metric {
  display: grid;
  align-content: space-between;
  min-height: 92px;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.home-metric strong {
  margin-top: 12px;
  color: var(--ink);
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
}

.home-metric.fresh {
  border-color: rgba(66, 133, 244, 0.28);
}

.home-metric.down,
.home-metric.strong {
  border-color: rgba(52, 168, 83, 0.28);
}

.home-metric.favorite {
  border-color: rgba(255, 145, 0, 0.36);
}

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

.home-section {
  min-width: 0;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.home-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.home-section-head > div:first-child {
  min-width: 0;
}

.home-section-head h3 {
  margin: 2px 0 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 950;
  line-height: 1.1;
}

.home-section-head strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 9px;
  color: var(--ink);
  background: var(--surface-strong);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

.home-section-actions {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
}

.home-section-more {
  height: 28px;
  padding: 0 10px;
  color: var(--firebase-blue);
  background: #fff;
  border: 1px solid rgba(25, 103, 210, 0.22);
  border-radius: 999px;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.home-section-more:hover {
  background: var(--blue-soft);
  border-color: rgba(25, 103, 210, 0.42);
  transform: translateY(-1px);
}

.home-card-list {
  display: grid;
  gap: 8px;
}

.home-car-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 9px;
  color: var(--ink);
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.home-car-card:hover {
  border-color: rgba(66, 133, 244, 0.45);
  box-shadow: 0 4px 12px rgba(60, 64, 67, 0.14);
}

.home-car-card.is-favorite {
  border-color: rgba(255, 145, 0, 0.28);
  box-shadow: inset 3px 0 0 var(--firebase-orange);
}

.home-card-photo {
  display: block;
  width: 92px;
  height: 70px;
  overflow: hidden;
  background: var(--surface-strong);
  border-radius: 7px;
}

.home-card-photo img,
.home-card-photo div {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-card-main,
.home-card-side {
  display: grid;
  min-width: 0;
}

.home-card-main {
  gap: 3px;
}

.home-card-main strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-card-main em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-card-kicker {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.home-favorite-tag,
.favorite-fact {
  color: var(--amber);
  background: var(--amber-soft);
}

.home-card-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 3px;
}

.home-card-facts span {
  min-height: 20px;
  padding: 0 6px;
  color: var(--muted);
  background: var(--surface-strong);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
}

.home-card-options {
  display: block;
  min-width: 0;
  margin-top: 2px;
}

.home-card-options .option-strip {
  flex-wrap: nowrap;
  gap: 4px;
  overflow: hidden;
}

.home-card-options .option-chip {
  min-width: 0;
  min-height: 22px;
  padding: 0 7px;
  font-size: 10px;
  font-weight: 900;
}

.home-card-options .option-chip:not(.more) {
  max-width: 178px;
}

.home-card-options .option-chip.more {
  flex: 0 0 auto;
}

.home-card-side {
  justify-items: end;
  gap: 5px;
}

.home-card-side > strong {
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.home-card-side > em {
  min-height: 22px;
  padding: 0 7px;
  color: var(--muted);
  background: var(--surface-strong);
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.home-card-side > em.down,
.history-summary .down,
.history-head em.down {
  color: var(--green);
}

.home-card-side > em.up,
.history-summary .up,
.history-head em.up {
  color: var(--red);
}

.home-empty {
  min-height: 76px;
  padding: 18px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 800;
}

.metric-loading span,
.metric-loading strong,
.loading-block,
.loading-line,
.loading-photo,
.loading-grid span {
  overflow: hidden;
  color: transparent;
  background: linear-gradient(90deg, #eceff1 0%, #fdfcfb 46%, #eceff1 100%);
  background-size: 220% 100%;
  border-radius: 999px;
  animation: loading-sheen 1.25s ease-in-out infinite;
}

.metric-loading span {
  width: 56px;
  height: 12px;
}

.metric-loading strong {
  width: 74px;
  height: 27px;
}

@keyframes loading-sheen {
  0% {
    background-position: 120% 0;
  }

  100% {
    background-position: -120% 0;
  }
}

.workbench {
  display: grid;
  grid-template-columns: minmax(560px, 0.96fr) minmax(520px, 1.04fr);
  gap: 18px;
  align-items: start;
  margin-top: 16px;
}

.results-panel {
  min-width: 0;
}

.panel-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
}

.panel-head h2,
.panel-head p {
  margin: 0;
}

.panel-head h2 {
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.1;
}

.panel-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.panel-tools {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.favorite-view-button,
.favorite-refresh-button,
.favorite-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.favorite-view-button {
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
}

.favorite-view-button strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--surface-strong);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
}

.favorite-view-button:hover,
.favorite-action:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 145, 0, 0.34);
}

.favorite-view-button.is-active,
.favorite-action.is-favorite {
  color: var(--ink);
  background: var(--amber-soft);
  border-color: rgba(255, 145, 0, 0.36);
}

.favorite-view-button.is-active strong {
  color: var(--ink);
  background: var(--firebase-yellow);
}

.favorite-refresh-button {
  gap: 6px;
  color: var(--ink);
  background: var(--firebase-yellow);
  border-color: rgba(255, 145, 0, 0.4);
}

.favorite-refresh-button:hover {
  transform: translateY(-1px);
}

.favorite-refresh-button:disabled {
  cursor: not-allowed;
  transform: none;
  opacity: 0.48;
}

.filter-row,
.range-row {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin-bottom: 8px;
}

.filter-row {
  grid-template-columns: minmax(180px, 1fr) 146px;
}

.grade-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  margin: 0 0 8px;
}

.exterior-color-filter {
  min-width: 0;
  margin: 0 0 10px;
}

.grade-filter-button {
  --filter-color: var(--muted);
  --filter-bg: rgba(255, 255, 255, 0.72);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--filter-color);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.grade-filter-button:hover,
.grade-filter-button.is-active {
  color: var(--filter-color);
  background: var(--filter-bg);
  border-color: color-mix(in srgb, var(--filter-color) 32%, transparent);
}

.grade-filter-button.is-active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--filter-color) 22%, transparent);
}

.grade-filter-button em {
  min-width: 20px;
  padding: 2px 6px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  font-style: normal;
  font-weight: 950;
}

.grade-filter-all {
  --filter-color: var(--ink);
  --filter-bg: var(--surface-strong);
}

.grade-filter-open {
  --filter-color: var(--firebase-blue);
  --filter-bg: var(--blue-soft);
}

.grade-filter-button.filter-grade-a-plus {
  --filter-color: var(--grade-a-plus);
  --filter-bg: var(--grade-a-plus-soft);
}

.grade-filter-button.filter-grade-s-plus {
  --filter-color: var(--grade-s-plus);
  --filter-bg: var(--grade-s-plus-soft);
}

.grade-filter-button.filter-grade-s-zero {
  --filter-color: var(--grade-s-zero);
  --filter-bg: var(--grade-s-zero-soft);
}

.grade-filter-button.filter-grade-a-zero {
  --filter-color: var(--grade-a-zero);
  --filter-bg: var(--grade-a-zero-soft);
}

.grade-filter-button.filter-grade-b-plus {
  --filter-color: var(--grade-b-plus);
  --filter-bg: var(--grade-b-plus-soft);
}

.grade-filter-button.filter-grade-b-zero {
  --filter-color: var(--grade-b-zero);
  --filter-bg: var(--grade-b-zero-soft);
}

.grade-filter-button.filter-grade-c-plus {
  --filter-color: var(--grade-c-plus);
  --filter-bg: var(--grade-c-plus-soft);
}

.grade-filter-button.filter-grade-c-zero {
  --filter-color: var(--grade-c-zero);
  --filter-bg: var(--grade-c-zero-soft);
}

.grade-filter-button.filter-grade-d {
  --filter-color: var(--grade-d);
  --filter-bg: var(--grade-d-soft);
}

.grade-filter-button.filter-grade-reject {
  --filter-color: var(--grade-reject);
  --filter-bg: var(--grade-reject-soft);
}

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

.color-filter-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  max-width: 100%;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.color-filter-button:hover,
.color-filter-button.is-active {
  color: var(--ink);
  background: #fff;
  border-color: rgba(66, 133, 244, 0.36);
  box-shadow: inset 0 0 0 1px rgba(66, 133, 244, 0.12);
}

.color-filter-button strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.color-filter-button em {
  min-width: 20px;
  padding: 2px 6px;
  color: var(--ink);
  background: rgba(242, 242, 242, 0.9);
  border-radius: 999px;
  font-style: normal;
  font-weight: 950;
}

.color-filter-swatch {
  display: block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.64);
}

.color-filter-swatch.all {
  background:
    linear-gradient(135deg, #ffffff 0 33%, #9aa0a6 33% 66%, #202124 66% 100%);
}

.range-row {
  grid-template-columns: minmax(160px, 1fr) minmax(118px, 0.56fr) minmax(118px, 0.56fr);
  align-items: stretch;
  padding: 10px;
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.range-head {
  display: grid;
  align-content: center;
  min-width: 0;
}

.range-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.range-head strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.range-field input {
  height: 34px;
  padding: 0 10px;
}

.option-filters {
  margin: 10px 0 12px;
}

.filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.filter-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.filter-title button {
  padding: 0;
  color: var(--firebase-blue);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.option-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.option-group-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  max-width: 100%;
  padding: 0 10px;
  color: #7c4b00;
  background: #fff7e0;
  border: 1px solid rgba(255, 145, 0, 0.28);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.option-group-button:hover,
.option-group-button.is-active {
  color: var(--ink);
  background: #fff;
  border-color: rgba(255, 145, 0, 0.52);
  box-shadow: inset 0 0 0 1px rgba(255, 145, 0, 0.18);
}

.option-group-button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-group-button small,
.option-group-button em {
  flex: 0 0 auto;
  font-style: normal;
}

.option-group-button small {
  padding: 2px 5px;
  color: #fff;
  background: var(--firebase-orange);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
}

.option-group-button em {
  color: var(--quiet);
  font-weight: 950;
}

.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.check-chip input {
  width: 13px;
  height: 13px;
  margin: 0;
  accent-color: var(--blue);
}

.check-chip:has(input:checked) {
  color: var(--firebase-blue);
  background: var(--blue-soft);
  border-color: rgba(66, 133, 244, 0.36);
}

.check-chip em {
  color: var(--quiet);
  font-style: normal;
}

.listing-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
}

.list-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 850;
}

.list-more button {
  min-height: 34px;
  padding: 0 12px;
  color: var(--firebase-blue);
  background: var(--blue-soft);
  border: 1px solid rgba(66, 133, 244, 0.24);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
}

.list-more button:hover {
  background: #fff;
  border-color: rgba(66, 133, 244, 0.42);
}

.loading-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.loading-panel.compact {
  padding: 0;
  background: transparent;
  border: 0;
}

.loading-panel strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.loading-panel p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.loading-panel em,
.home-hero p em {
  display: inline-block;
  margin-top: 3px;
  color: var(--firebase-blue);
  font-style: normal;
  font-weight: 900;
}

.loading-spinner {
  display: inline-block;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 3px solid var(--surface-strong);
  border-top-color: var(--firebase-orange);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.listing-row {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) minmax(138px, auto);
  gap: 14px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 116px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
  cursor: pointer;
}

.loading-card {
  pointer-events: none;
}

.loading-card .row-main,
.loading-card .row-score {
  gap: 10px;
}

.loading-line {
  display: block;
  width: 68%;
  height: 14px;
}

.loading-line.wide {
  width: 92%;
  height: 18px;
}

.loading-line.short {
  width: 48%;
}

.loading-line.tiny {
  width: 78px;
  height: 20px;
}

.loading-line.price {
  width: 104px;
  height: 28px;
}

.loading-line.hero {
  width: 72%;
  height: 38px;
  border-radius: 12px;
}

.listing-row:hover,
.listing-row.active {
  border-color: rgba(66, 133, 244, 0.52);
  box-shadow: 0 4px 14px rgba(60, 64, 67, 0.14);
}

.listing-row.is-new {
  border-color: rgba(66, 133, 244, 0.62);
  box-shadow:
    inset 3px 0 0 var(--firebase-blue),
    0 1px 2px rgba(60, 64, 67, 0.08);
}

.listing-row.is-new.active,
.listing-row.is-new:hover {
  box-shadow:
    inset 3px 0 0 var(--firebase-blue),
    0 4px 14px rgba(60, 64, 67, 0.14);
}

.listing-row.is-favorite {
  border-color: rgba(255, 145, 0, 0.34);
}

.listing-row.is-favorite:not(.is-new) {
  box-shadow:
    inset 3px 0 0 var(--firebase-orange),
    0 1px 2px rgba(60, 64, 67, 0.08);
}

.listing-row.is-favorite.active,
.listing-row.is-favorite:hover {
  border-color: rgba(255, 145, 0, 0.48);
  box-shadow:
    inset 3px 0 0 var(--firebase-orange),
    0 4px 14px rgba(60, 64, 67, 0.14);
}

.thumb {
  display: block;
  width: 116px;
  height: 94px;
  object-fit: cover;
  background: var(--surface-strong);
  border-radius: 7px;
}

.row-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.row-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.row-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-title span {
  flex: 0 1 auto;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.facts span,
.signal-mini,
.market-mini {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  color: var(--muted);
  background: var(--surface-strong);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.reason-line {
  display: block;
  width: fit-content;
  max-width: 100%;
  min-height: 24px;
  min-width: 0;
  overflow: hidden;
  padding: 0 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--surface-strong);
  border: 1px solid transparent;
  border-radius: 999px;
}

.reason-line.warning {
  color: #8a4d00;
  background: #fff3c4;
  border-color: rgba(245, 166, 35, 0.42);
}

.reason-line.danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: rgba(217, 48, 37, 0.26);
}

.reason-line.good {
  color: var(--green);
  background: var(--green-soft);
  border-color: rgba(52, 168, 83, 0.24);
}

.row-score {
  display: grid;
  gap: 6px;
  min-width: 138px;
  align-content: center;
  justify-items: end;
}

.favorite-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: end;
  width: 36px;
  height: 28px;
  color: var(--quiet);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  font-size: 17px;
  font-weight: 950;
  line-height: 1;
}

.listing-row:hover .favorite-toggle {
  color: var(--firebase-orange);
  border-color: rgba(255, 145, 0, 0.3);
}

.listing-row.is-favorite .favorite-toggle {
  color: var(--ink);
  background: var(--firebase-yellow);
  border-color: rgba(255, 145, 0, 0.4);
}

.price-major {
  color: var(--ink);
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.grade-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 3px;
  background: var(--surface-strong);
  border: 1px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
}

.grade-score.large {
  min-height: 36px;
  padding: 4px;
}

.grade,
.score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.grade-score.large .grade,
.grade-score.large .score-badge {
  min-height: 28px;
  padding: 0 11px;
  font-size: 13px;
}

.grade {
  min-width: 28px;
  padding: 0 8px;
  color: #fff;
}

.score-badge {
  padding: 0 8px;
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.grade-s-plus {
  background: var(--grade-s-plus);
}

.grade-s-zero {
  background: var(--grade-s-zero);
}

.grade-a-plus {
  background: var(--grade-a-plus);
}

.grade-a-zero {
  background: var(--grade-a-zero);
}

.grade-b-plus {
  background: var(--grade-b-plus);
}

.grade-b-zero {
  background: var(--grade-b-zero);
}

.grade-c-plus {
  color: #fff;
  background: var(--grade-c-plus);
}

.grade-c-zero {
  color: #fff;
  background: var(--grade-c-zero);
}

.grade-d {
  color: #fff;
  background: var(--grade-d);
}

.grade-reject {
  background: var(--grade-reject);
}

.grade-score:has(.grade-a-plus) {
  background: var(--grade-a-plus-soft);
  border-color: rgba(11, 127, 53, 0.25);
}

.grade-score:has(.grade-s-plus) {
  background: var(--grade-s-plus-soft);
  border-color: rgba(11, 87, 208, 0.28);
}

.grade-score:has(.grade-s-zero) {
  background: var(--grade-s-zero-soft);
  border-color: rgba(26, 115, 232, 0.28);
}

.grade-score:has(.grade-a-zero) {
  background: var(--grade-a-zero-soft);
  border-color: rgba(47, 168, 79, 0.25);
}

.grade-score:has(.grade-b-plus) {
  background: var(--grade-b-plus-soft);
  border-color: rgba(0, 102, 204, 0.25);
}

.grade-score:has(.grade-b-zero) {
  background: var(--grade-b-zero-soft);
  border-color: rgba(74, 131, 232, 0.25);
}

.grade-score:has(.grade-c-plus) {
  background: var(--grade-c-plus-soft);
  border-color: rgba(155, 95, 0, 0.28);
}

.grade-score:has(.grade-c-zero) {
  background: var(--grade-c-zero-soft);
  border-color: rgba(199, 129, 0, 0.28);
}

.grade-score:has(.grade-d) {
  background: var(--grade-d-soft);
  border-color: rgba(216, 79, 31, 0.28);
}

.grade-score:has(.grade-reject) {
  background: var(--grade-reject-soft);
  border-color: rgba(179, 38, 30, 0.28);
}

.grade-a-plus + .score-badge {
  color: var(--grade-a-plus);
}

.grade-s-plus + .score-badge {
  color: var(--grade-s-plus);
}

.grade-s-zero + .score-badge {
  color: var(--grade-s-zero);
}

.grade-a-zero + .score-badge {
  color: var(--grade-a-zero);
}

.grade-b-plus + .score-badge {
  color: var(--grade-b-plus);
}

.grade-b-zero + .score-badge {
  color: var(--grade-b-zero);
}

.grade-c-plus + .score-badge {
  color: var(--grade-c-plus);
}

.grade-c-zero + .score-badge {
  color: var(--grade-c-zero);
}

.grade-d + .score-badge {
  color: var(--grade-d);
}

.grade-reject + .score-badge {
  color: var(--grade-reject);
}

.market-good,
.signal-strong,
.signal-good,
.signal-fresh {
  color: var(--green);
  background: var(--green-soft);
}

.market-high,
.signal-watch {
  color: var(--red);
  background: var(--red-soft);
}

.market-fair,
.signal-note,
.signal-neutral,
.signal-muted {
  color: var(--muted);
  background: var(--surface-strong);
}

.color-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.color-pair.large {
  margin-top: 12px;
}

.color-badge {
  display: inline-grid;
  grid-template-columns: 18px auto minmax(0, auto);
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 28px;
  padding: 4px 8px 4px 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.color-pair.large .color-badge {
  grid-template-columns: 22px auto minmax(0, auto);
  min-height: 34px;
  padding: 5px 11px 5px 6px;
  font-size: 12px;
}

.color-badge i {
  display: block;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.64);
}

.color-pair.large .color-badge i {
  width: 22px;
  height: 22px;
}

.color-badge strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.option-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 0 9px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid rgba(66, 133, 244, 0.22);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.option-chip.more {
  color: var(--muted);
  background: var(--surface-strong);
  border-color: transparent;
}

.option-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-chip.has-help {
  cursor: help;
}

.option-info {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  display: none;
  width: min(520px, calc(100vw - 36px));
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.option-chip:hover .option-info,
.option-chip:focus .option-info,
.option-chip:focus-within .option-info {
  display: grid;
  gap: 5px;
}

.option-info strong,
.option-info span,
.option-info small,
.option-info em {
  display: block;
  white-space: normal;
}

.option-info strong {
  font-size: 13px;
  font-weight: 950;
}

.option-info span,
.option-info small,
.option-info em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.option-detail-tree {
  display: grid;
  gap: 7px;
  margin-top: 6px;
  padding-top: 7px;
  border-top: 1px solid var(--line-soft);
}

.option-detail-children {
  display: grid;
  gap: 7px;
}

.option-detail-tree b {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.option-detail-node {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.option-detail-node.depth-1 {
  margin-left: 10px;
}

.option-detail-node.depth-2 {
  margin-left: 20px;
}

.option-detail-node strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
}

.option-detail-node span,
.option-detail-node small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.42;
}

.inspector {
  position: sticky;
  top: 92px;
  min-width: 0;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

.empty-state span {
  display: block;
  color: var(--quiet);
  font-size: 12px;
  font-weight: 850;
}

.empty-state strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
}

.load-error span {
  color: var(--red);
}

.photo-stage {
  position: relative;
  overflow: hidden;
  margin: 0;
  background: #202124;
  border-radius: var(--radius) var(--radius) 0 0;
}

.photo-stage.empty {
  background: var(--line-soft);
}

.hero-photo {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 8.8;
  object-fit: contain;
  background: #202124;
}

.photo-stage.empty .hero-photo {
  min-height: 340px;
  background: var(--line-soft);
}

.photo-count {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  color: #fff;
  background: rgba(0, 0, 0, 0.54);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.photo-count strong {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 800;
}

.photo-nav {
  position: absolute;
  top: 50%;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.46);
  border-radius: 999px;
  cursor: pointer;
  transform: translateY(-50%);
}

.photo-nav.prev {
  left: 12px;
}

.photo-nav.next {
  right: 12px;
}

.photo-strip {
  display: grid;
  grid-auto-columns: 64px;
  grid-auto-flow: column;
  gap: 6px;
  overflow-x: auto;
  padding: 8px;
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(216, 216, 223, 0.72);
}

.photo-strip button {
  width: 64px;
  height: 46px;
  overflow: hidden;
  padding: 0;
  background: var(--line-soft);
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
}

.photo-strip button.active {
  border-color: var(--blue);
}

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

.inspector-body {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.inspector-loading {
  min-width: 0;
}

.loading-photo {
  width: 100%;
  aspect-ratio: 16 / 8.8;
  border-radius: var(--radius) var(--radius) 0 0;
}

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

.loading-grid span {
  height: 72px;
  border-radius: var(--radius);
}

.inspector-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.inspector-title > div {
  min-width: 0;
}

.inspector-title h2,
.inspector-title p {
  margin: 0;
}

.inspector-title h2 {
  margin-top: 8px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 31px;
  font-weight: 950;
  line-height: 1.08;
}

.inspector-title p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}

.inspector-price {
  margin-top: 10px;
  color: var(--ink);
  font-size: 40px;
  font-weight: 950;
  line-height: 1;
}

.inspector-price small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.inspector-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.favorite-action {
  gap: 7px;
  color: var(--ink);
  background: #fff;
}

.favorite-action span {
  color: var(--quiet);
  font-size: 17px;
  font-weight: 950;
  line-height: 1;
}

.favorite-action.is-favorite span {
  color: var(--firebase-orange);
}

.open-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 850;
}

.risk-highlight,
.good-highlight,
.detail-loading-note,
.favorite-tools,
.price-history,
.option-spotlight {
  min-width: 0;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.detail-loading-note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: var(--firebase-blue);
  background: var(--blue-soft);
  border-color: rgba(66, 133, 244, 0.24);
  font-size: 13px;
  font-weight: 950;
}

.detail-loading-note .loading-spinner {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.risk-highlight.danger {
  border-color: rgba(217, 48, 37, 0.32);
  background: var(--red-soft);
}

.risk-highlight.warning {
  border-color: rgba(155, 95, 0, 0.32);
  background: var(--amber-soft);
}

.favorite-tools {
  border-color: rgba(255, 145, 0, 0.32);
  background: var(--amber-soft);
}

.favorite-tools-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.favorite-tools-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.favorite-tools-head strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
}

.favorite-tools-head em {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 4px 9px;
  color: var(--amber);
  background: rgba(255, 196, 0, 0.18);
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.favorite-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.favorite-tag-row button {
  min-height: 30px;
  padding: 0 9px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}

.favorite-tag-row button.active {
  color: var(--amber);
  background: rgba(255, 196, 0, 0.18);
  border-color: rgba(255, 145, 0, 0.32);
}

.favorite-note {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 82px;
  resize: vertical;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  outline: 0;
  font-size: 13px;
  font-weight: 750;
}

.favorite-note:focus,
.favorite-alert-field input:focus {
  border-color: rgba(255, 145, 0, 0.42);
  box-shadow: 0 0 0 3px rgba(255, 145, 0, 0.12);
}

.favorite-alert-field {
  display: grid;
  grid-template-columns: auto minmax(90px, 140px) auto;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.favorite-alert-field input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  outline: 0;
  font-weight: 900;
}

.risk-highlight.clean,
.good-highlight {
  border-color: rgba(52, 168, 83, 0.24);
  background: var(--green-soft);
}

.risk-head,
.good-head,
.option-spotlight-head,
.history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 12px;
}

.risk-head span,
.good-head span,
.option-spotlight-head span,
.history-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.risk-head strong,
.good-head strong,
.option-spotlight-head strong,
.history-head strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  font-weight: 950;
  line-height: 1.14;
}

.option-spotlight-head em,
.history-head em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.risk-lanes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.risk-lane {
  min-width: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
}

.risk-lane h3,
.reason-panel h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.risk-lane ul,
.good-highlight ul,
.reason-panel ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.risk-lane li,
.good-highlight li,
.reason-panel li {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.quiet {
  color: var(--quiet) !important;
}

.key-signals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.signal-card {
  min-width: 0;
  padding: 15px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

.signal-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.signal-card strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 950;
}

.signal-card em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.history-chart {
  min-width: 0;
}

.history-chart.loading,
.history-chart.empty {
  display: grid;
  min-height: 190px;
  place-items: center;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: var(--radius);
  font-weight: 800;
}

.history-chart svg {
  width: 100%;
  height: auto;
}

.history-gridline,
.history-axis,
.history-x-tick {
  stroke: var(--line);
  stroke-width: 1;
}

.history-y-label,
.history-x-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.history-y-label {
  text-anchor: end;
}

.history-x-label {
  text-anchor: middle;
}

.history-area {
  fill: url("#historyFill");
}

.history-glow {
  fill: none;
  stroke: rgba(66, 133, 244, 0.16);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 9;
}

.history-line {
  fill: none;
  stroke: url("#historyStroke");
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.history-chart circle {
  fill: #fff;
  stroke: var(--blue);
  stroke-width: 2;
}

.history-current circle {
  fill: var(--blue);
  stroke: #fff;
  stroke-width: 2;
}

.history-current text {
  fill: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.history-meta,
.history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.history-meta {
  margin-top: 4px;
}

.history-meta span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-meta span:nth-child(2) {
  text-align: center;
}

.history-meta span:last-child {
  text-align: right;
}

.history-summary {
  margin-top: 10px;
}

.history-summary div {
  min-width: 0;
  padding: 10px;
  background: var(--surface-soft);
  border-radius: var(--radius);
}

.history-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.history-summary strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.down {
  color: var(--green) !important;
}

.up {
  color: var(--red) !important;
}

.flat {
  color: var(--muted) !important;
}

.option-spotlight.empty {
  background: var(--surface-soft);
}

.option-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.fact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-soft);
  border-left: 1px solid var(--line-soft);
}

.fact-box {
  min-width: 0;
  padding: 12px;
  background: rgba(255, 255, 255, 0.68);
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.fact-box span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.fact-box strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 14px;
  font-weight: 850;
}

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

.reason-panel {
  min-width: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}

@media (max-width: 1320px) {
  .scan-band {
    grid-template-columns: minmax(360px, 1fr) 118px 112px;
  }

  .job-meter {
    grid-column: 1 / -1;
  }

  .workbench {
    grid-template-columns: 1fr;
  }

  .target-manager-grid {
    grid-template-columns: 1fr;
  }

  .inspector {
    position: static;
    max-height: none;
  }
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    padding: 12px 14px;
  }

  .brand p {
    white-space: normal;
  }

  .shell {
    padding: 14px 14px 28px;
  }

  .scan-band,
  .home-hero,
  .home-grid,
  .filter-row,
  .range-row,
  .panel-head,
  .key-signals,
  .risk-lanes,
  .reason-grid,
  .history-meta,
  .history-summary,
  .target-form {
    grid-template-columns: 1fr;
  }

  .target-manager-head {
    display: grid;
  }

  .segmented {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-car-card {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .home-card-photo {
    width: 82px;
    height: 64px;
  }

  .home-card-side {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, auto);
    justify-content: start;
    justify-items: start;
    align-items: center;
  }

  .listing-row {
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: start;
  }

  .thumb {
    width: 96px;
    height: 76px;
  }

  .row-score {
    grid-column: 1 / -1;
    grid-template-columns: repeat(5, auto);
    justify-content: start;
    justify-items: start;
    min-width: 0;
  }

  .price-major {
    font-size: 22px;
  }

  .inspector-title {
    display: grid;
  }

  .inspector-actions {
    justify-content: flex-start;
  }

  .open-link {
    justify-self: start;
  }

  .fact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .top-actions {
    align-self: flex-start;
  }

  .status-pill {
    display: none;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p {
    font-size: 12px;
    overflow-wrap: anywhere;
  }

  .segmented button {
    min-height: 38px;
    white-space: normal;
    line-height: 1.12;
  }

  .mode-tabs {
    display: grid;
    grid-template-columns: 1fr;
    border-radius: var(--radius);
  }

  .mode-tabs button {
    justify-content: space-between;
    border-radius: 6px;
  }

  .home-hero h2 {
    font-size: 32px;
  }

  .home-metrics {
    grid-template-columns: 1fr;
  }

  .target-card-actions,
  .target-editor-actions {
    justify-content: stretch;
  }

  .target-card-actions {
    flex-wrap: wrap;
  }

  .target-card-actions em {
    width: 100%;
  }

  .target-card-actions button,
  .target-editor-actions button {
    flex: 1 1 auto;
  }

  .home-car-card {
    grid-template-columns: 1fr;
  }

  .home-card-photo {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .favorite-alert-field {
    grid-template-columns: 1fr;
  }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .listing-row {
    grid-template-columns: 1fr;
  }

  .thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .row-score {
    grid-template-columns: repeat(2, auto);
  }

  .favorite-toggle {
    justify-self: start;
  }

  .inspector-body {
    padding: 14px;
  }

  .inspector-price {
    font-size: 32px;
  }

  .inspector-title h2 {
    font-size: 25px;
  }

  .fact-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .metric-loading span,
  .metric-loading strong,
  .loading-block,
  .loading-line,
  .loading-photo,
  .loading-grid span,
  .loading-spinner {
    animation: none;
  }
}
