:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --surface-soft: #eef1f3;
  --surface-raised: #f7f8fa;
  --ink: #15191f;
  --muted: #6b7280;
  --line: #d9dee4;
  --red: #c8102e;
  --red-dark: #8f0c21;
  --gold: #c69b43;
  --success: #0f766e;
  --header-bg: rgba(255, 255, 255, 0.96);
  --card-shadow: 0 10px 24px rgba(18, 24, 38, 0.06);
  --soft-shadow: 0 8px 20px rgba(18, 24, 38, 0.05);
  --text-soft: #394150;
  --dark-panel: #15191f;
  --dark-panel-text: #ffffff;
  --dark-panel-muted: #d1d5db;
  --shadow: 0 18px 50px rgba(18, 24, 38, 0.12);
}

:root[data-theme="dark"] {
  --bg: #0f1217;
  --surface: #181d25;
  --surface-soft: #222936;
  --surface-raised: #202632;
  --ink: #f3f5f8;
  --muted: #aeb6c2;
  --line: #303846;
  --red: #e3374f;
  --red-dark: #ff6b7e;
  --gold: #ddb75e;
  --success: #39b7a9;
  --header-bg: rgba(18, 22, 29, 0.96);
  --card-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  --soft-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  --text-soft: #c6ccd6;
  --dark-panel: #12161d;
  --dark-panel-text: #ffffff;
  --dark-panel-muted: #c6ccd6;
  --shadow: 0 18px 54px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px max(clamp(14px, 3vw, 34px), calc((100vw - 1440px) / 2 + 34px));
  border-top: 4px solid var(--red);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: var(--header-bg);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
}

.brand-block {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: min(430px, 31vw);
  line-height: 0;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 58px;
  object-fit: contain;
  object-position: left center;
}

.brand-logo .brand-logo-dark {
  display: none;
}

:root[data-theme="dark"] .brand-logo .brand-logo-light {
  display: none;
}

:root[data-theme="dark"] .brand-logo .brand-logo-dark {
  display: block;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 360px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 850;
  white-space: nowrap;
}

.site-nav a:hover {
  border-color: rgba(200, 16, 46, 0.28);
  color: var(--red-dark);
}

.site-nav a.is-active,
.site-nav a[aria-current="page"] {
  border-color: var(--red);
  color: #fff;
  background: var(--red);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(21px, 3vw, 30px);
  letter-spacing: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.reset-button,
.theme-toggle,
.ghost-button,
.line-button,
.detail-button,
.chip {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  cursor: pointer;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 104px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
  font-size: 14px;
  font-weight: 850;
}

.theme-toggle-icon {
  position: relative;
  width: 20px;
  height: 20px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.theme-toggle-icon::after {
  content: "";
  position: absolute;
  inset: 2px 2px 2px 8px;
  border-radius: 999px;
  background: currentColor;
}

:root[data-theme="dark"] .theme-toggle-icon::after {
  inset: 2px 8px 2px 2px;
}

.reset-button {
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface-soft);
  border-color: var(--line);
  font-size: 14px;
  font-weight: 800;
}

.reset-button:disabled {
  opacity: 0.42;
  cursor: default;
}

.contact-control {
  position: relative;
  display: block;
}

.contact-control .contact-label {
  position: absolute;
  top: calc(100% + 3px);
  left: 0;
  right: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.file-input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.line-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 66px;
  padding: 0 12px;
  color: #fff;
  text-decoration: none;
  background: #15191f;
  border-color: #15191f;
  font-weight: 700;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 34px) 40px;
}

.admin-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(200, 16, 46, 0.08), transparent 34%),
    var(--bg);
}

.admin-shell {
  display: grid;
  place-items: center;
  width: min(760px, 100%);
  min-height: 100vh;
  padding: clamp(18px, 4vw, 42px);
}

.admin-panel {
  width: 100%;
  padding: clamp(18px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.admin-heading p {
  margin: 8px 0 0;
  color: var(--muted);
  font-weight: 650;
}

.admin-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0;
}

.admin-meta div {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.admin-meta dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.admin-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 850;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-submit {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--red);
  border-radius: 8px;
  color: #fff;
  background: var(--red);
  cursor: pointer;
  font-weight: 900;
}

.admin-submit:disabled {
  opacity: 0.62;
  cursor: wait;
}

.admin-status {
  min-height: 22px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.admin-status.is-working {
  color: var(--red-dark);
}

.admin-status.is-error {
  color: var(--red);
}

.admin-status.is-success {
  color: var(--success);
}

.summary-strip {
  display: grid;
  grid-template-columns: minmax(520px, 1.8fr) minmax(420px, 1fr);
  gap: 10px;
  align-items: stretch;
  min-width: 0;
  margin-bottom: 14px;
}

.summary-strip article {
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.summary-side {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}

.summary-strip .sales-banner {
  position: relative;
  height: 488px;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: #11151b;
}

.banner-track {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.banner-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.banner-slide.is-active {
  opacity: 1;
}

.banner-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #fff;
}

.banner-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5px;
  background: linear-gradient(90deg, #c8102e, #f3c967);
  transform-origin: left center;
  animation: bannerProgress 7s linear infinite;
}

@keyframes bannerProgress {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

.summary-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.summary-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.summary-strip strong {
  font-size: clamp(20px, 2.2vw, 30px);
  line-height: 1.1;
}

.loan-summary {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}

.loan-summary .summary-card-head {
  align-items: flex-start;
}

.loan-summary .summary-label {
  flex: 1 1 auto;
  line-height: 1.35;
}

.loan-summary .summary-card-head strong {
  flex: 0 0 auto;
  color: var(--red-dark);
  font-size: clamp(18px, 1.8vw, 24px);
  white-space: nowrap;
}

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

.loan-grid label,
.loan-rate-preview {
  gap: 4px;
}

.loan-grid label span,
.loan-rate-preview span {
  font-size: 12px;
}

.loan-grid input,
.loan-grid select {
  min-height: 38px;
  padding-inline: 10px;
}

.amount-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.amount-input:focus-within {
  outline: 3px solid rgba(200, 16, 46, 0.22);
  outline-offset: 2px;
}

.amount-input input {
  min-height: 36px;
  border: 0;
  outline: 0;
  background: transparent;
}

.amount-input span {
  padding-right: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.loan-rate-preview {
  display: grid;
}

.loan-rate-preview strong {
  display: grid;
  min-height: 38px;
  align-items: center;
  padding-inline: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--ink);
  font-size: 15px;
}

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

.loan-result div {
  min-height: 56px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
}

.loan-result span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.loan-result strong {
  display: block;
  color: var(--ink);
  font-size: clamp(18px, 1.9vw, 25px);
}

.loan-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.year-summary {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.year-chart {
  min-width: 0;
  min-height: 92px;
}

.year-chart svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 92px;
  overflow: visible;
}

.chart-axis {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--red);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart-dot {
  fill: var(--surface);
  stroke: var(--red);
  stroke-width: 3;
}

.chart-count {
  fill: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-anchor: middle;
}

.chart-year {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-anchor: middle;
}

.chart-empty {
  display: grid;
  min-height: 70px;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
}

.toolbar .search-box {
  grid-column: 1 / -1;
  position: relative;
}

.toolbar .search-box::after {
  content: "";
  position: absolute;
  left: 14px;
  bottom: 13px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--muted);
  border-radius: 999px;
  pointer-events: none;
}

.toolbar .search-box::before {
  content: "";
  position: absolute;
  left: 27px;
  bottom: 11px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: var(--muted);
  transform: rotate(45deg);
  transform-origin: left center;
  pointer-events: none;
}

.toolbar .search-box input[type="search"] {
  padding-left: 40px;
}

.toolbar-reset {
  grid-column: span 2;
  align-self: end;
  min-height: 44px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(200, 16, 46, 0.22);
  outline-offset: 2px;
}

.amount-input input:focus {
  outline: 0;
}

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

.filter-panel {
  position: sticky;
  top: 94px;
  max-height: calc(100vh - 116px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--soft-shadow);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.filter-panel::-webkit-scrollbar {
  display: none;
}

.panel-title,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-title h2,
.section-heading h2 {
  margin-bottom: 0;
  font-size: 22px;
}

.panel-title span {
  color: var(--red);
  font-weight: 800;
}

.chip-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface-raised);
}

.chip.is-active {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
}

.panel-section {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.stock-prep-section {
  margin-top: 14px;
}

.panel-title-compact h3 {
  margin-bottom: 0;
}

.chip-list-compact {
  margin-bottom: 0;
}

.panel-section h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.panel-section p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.content-area {
  min-width: 0;
}

.section-heading {
  min-height: 52px;
  margin-bottom: 14px;
}

.ghost-button {
  padding: 0 14px;
  color: var(--ink);
  background: var(--surface);
}

.ghost-button[hidden] {
  display: none;
}

.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.vehicle-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.vehicle-card:hover {
  transform: translateY(-2px);
  border-color: rgba(200, 16, 46, 0.22);
  box-shadow: 0 16px 34px rgba(18, 24, 38, 0.1);
}

.photo-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--surface-soft);
}

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

.photo-frame img.photo-fallback-probe {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 1;
}

.photo-frame img.photo-fallback-probe.is-loaded {
  opacity: 1;
}

.photo-placeholder {
  display: grid;
  place-content: center;
  gap: 5px;
  width: 100%;
  height: 100%;
  padding: 22px;
  text-align: center;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(17, 20, 24, 0.88), rgba(143, 12, 33, 0.82)),
    repeating-linear-gradient(45deg, #222831 0 12px, #2d333d 12px 24px);
}

.photo-placeholder span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
}

.photo-placeholder strong {
  font-size: clamp(22px, 4vw, 36px);
}

.photo-placeholder small {
  color: #d1d5db;
}

.badge-row {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.badge {
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(17, 20, 24, 0.86);
  font-size: 12px;
  font-weight: 800;
}

.badge.certified {
  background: var(--red);
}

.badge.prep {
  background: #15191f;
}

.vehicle-card-body {
  padding: 14px;
}

.vehicle-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 80px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.vehicle-title-price {
  min-width: 0;
  display: grid;
  gap: 5px;
  align-content: start;
}

.vehicle-card h3 {
  margin-bottom: 0;
  font-size: 19px;
  line-height: 1.25;
}

.price {
  color: var(--red);
  font-size: 26px;
  font-weight: 850;
}

.certification-logo {
  display: grid;
  place-items: center;
}

.certification-logo img {
  display: block;
  width: 80px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 7px 12px rgba(17, 20, 24, 0.3));
}

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

.meta-grid span {
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--text-soft);
  background: var(--surface-soft);
  font-size: 13px;
}

.feature-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-height: 30px;
  margin-bottom: 14px;
}

.feature-list span {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--red-dark);
  background: rgba(200, 16, 46, 0.08);
  font-size: 12px;
  font-weight: 700;
}

.detail-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 100%;
  color: #fff;
  background: #15191f;
  border-color: #15191f;
  font-weight: 800;
}

.vehicle-detail {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  align-items: start;
}

.detail-hero .photo-frame {
  min-height: 0;
  aspect-ratio: 16 / 9;
}

.detail-summary {
  padding: clamp(20px, 4vw, 34px);
  background: var(--dark-panel);
  color: var(--dark-panel-text);
}

.detail-summary h2 {
  margin-bottom: 10px;
  font-size: clamp(28px, 5vw, 46px);
}

.detail-summary .price {
  color: #fff;
}

.detail-summary p {
  color: var(--dark-panel-muted);
}

.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.detail-actions .line-button,
.detail-actions .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 0 14px;
  text-decoration: none;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
}

.detail-grid div {
  min-height: 82px;
  padding: 16px;
  background: var(--surface);
}

.detail-grid span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 13px;
}

.detail-grid strong {
  font-size: 18px;
}

.detail-section {
  padding: 24px;
}

.detail-section h3 {
  font-size: 20px;
}

.remark-box {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.remark-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.remark-box p {
  margin-bottom: 0;
}

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

.gallery-thumb {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: var(--surface-soft);
  cursor: pointer;
}

.gallery-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-soft);
  transition: transform 160ms ease;
}

.gallery-thumb:hover img {
  transform: scale(1.03);
}

.viewer-open {
  overflow: hidden;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
}

.photo-viewer[hidden] {
  display: none;
}

.viewer-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(9, 12, 18, 0.76);
  cursor: pointer;
}

.viewer-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(1040px, 100%);
  max-height: min(92vh, 780px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #101319;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.viewer-topbar,
.viewer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  color: #fff;
}

.viewer-label {
  display: block;
  color: #aeb6c2;
  font-size: 12px;
  font-weight: 800;
}

.viewer-topbar strong {
  display: block;
  margin-top: 2px;
  font-size: 17px;
}

.viewer-close {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.viewer-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 240px;
  background: #05070a;
}

.viewer-stage img {
  display: block;
  width: 100%;
  max-height: 68vh;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.viewer-nav {
  position: absolute;
  top: 50%;
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  background: rgba(16, 19, 25, 0.72);
  cursor: pointer;
  font-size: 42px;
  line-height: 1;
  transform: translateY(-50%);
}

.viewer-prev {
  left: 12px;
}

.viewer-next {
  right: 12px;
}

.viewer-footer {
  justify-content: center;
  color: #cdd3dc;
  font-weight: 800;
}

.empty-state {
  padding: 40px 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  background: var(--surface);
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.info-page {
  display: grid;
  gap: 20px;
}

.info-hero,
.info-article {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
}

.info-hero {
  display: grid;
  gap: 16px;
  padding: clamp(14px, 2.2vw, 22px);
}

.info-hero-copy {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.info-hero-copy h1 {
  margin: 0;
}

.cpo-visual {
  display: block;
  width: min(100%, 1100px);
  margin: 0 auto;
  height: auto;
  border-radius: 8px;
  background: #000;
}

.info-article {
  padding: clamp(20px, 3vw, 30px);
}

.info-article h2 {
  margin-bottom: 8px;
  font-size: clamp(22px, 3vw, 30px);
}

.info-article p:last-child {
  margin-bottom: 0;
}

.cpo-article {
  font-size: 17px;
  line-height: 1.82;
}

.cpo-article p {
  color: var(--text-soft);
}

.cpo-article .article-lead {
  color: var(--ink);
  font-size: clamp(18px, 2.2vw, 21px);
  font-weight: 800;
  line-height: 1.65;
}

.cpo-feature-section {
  margin: 22px 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--red);
  border-radius: 8px;
  background: var(--surface-raised);
}

.cpo-feature-section h3 {
  margin-bottom: 10px;
  color: var(--red-dark);
  font-size: 22px;
}

.cpo-check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 16px;
  padding: 0;
  list-style: none;
}

.cpo-check-list-wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cpo-check-list li {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(200, 16, 46, 0.13);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font-weight: 850;
}

.cpo-check-list li::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--red);
  font-size: 13px;
  line-height: 1;
}

.cpo-closing {
  display: grid;
  gap: 8px;
  margin: 24px 0;
  padding: 22px;
  border-radius: 8px;
  color: #fff;
  background: #15191f;
}

.cpo-closing strong {
  font-size: clamp(20px, 3vw, 28px);
}

.cpo-closing span {
  color: #e5e9ef;
  font-size: 17px;
}

.cpo-closing em {
  color: var(--gold);
  font-style: normal;
  font-weight: 900;
}

.cpo-article p:last-child {
  color: var(--muted);
}

.warranty-hero {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 97%, transparent), color-mix(in srgb, var(--surface) 90%, transparent)),
    linear-gradient(135deg, rgba(200, 16, 46, 0.12), rgba(21, 25, 31, 0.08));
}

.warranty-mark {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(200, 16, 46, 0.22);
  border-radius: 8px;
  color: var(--red-dark);
  background: var(--surface);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.warranty-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0 24px;
}

.warranty-summary-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--dark-panel);
  color: var(--dark-panel-text);
}

.warranty-summary-card span {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #15191f;
  background: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.warranty-summary-card h3 {
  margin-bottom: 8px;
  font-size: 22px;
}

.warranty-summary-card strong {
  display: block;
  margin-bottom: 10px;
  color: var(--dark-panel-text);
  font-size: 20px;
}

.warranty-summary-card p {
  margin-bottom: 0;
  color: var(--dark-panel-muted);
}

.warranty-note-list {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--text-soft);
}

.warranty-note-list li {
  padding-left: 4px;
}

.warranty-table-wrap {
  overflow-x: auto;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.warranty-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
}

.warranty-table th,
.warranty-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.warranty-table th {
  color: #fff;
  background: var(--red);
  font-size: 14px;
}

.warranty-table tr:last-child td {
  border-bottom: 0;
}

.warranty-table td:last-child {
  color: var(--red-dark);
  font-weight: 900;
}

.warranty-disclaimer {
  padding: 14px 16px;
  border: 1px solid rgba(200, 16, 46, 0.18);
  border-radius: 8px;
  color: #6b2530;
  background: rgba(200, 16, 46, 0.06);
  font-size: 14px;
}

.locations-page {
  max-width: 1180px;
}

.locations-hero {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 96%, transparent), color-mix(in srgb, var(--surface) 90%, transparent)),
    linear-gradient(135deg, rgba(200, 16, 46, 0.13), rgba(198, 155, 67, 0.13));
}

.locations-hero .article-lead {
  max-width: 880px;
  margin: 0;
  color: var(--text-soft);
}

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

.location-card {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 0 0 clamp(18px, 2.4vw, 24px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.location-card:first-child {
  border-color: rgba(200, 16, 46, 0.28);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--surface) 88%, transparent)),
    linear-gradient(135deg, rgba(200, 16, 46, 0.1), rgba(21, 25, 31, 0.08));
}

.location-card-head {
  display: grid;
  gap: 7px;
  margin: 0 clamp(18px, 2.4vw, 24px);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.location-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  overflow: hidden;
  background: #15191f;
}

.location-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(21, 25, 31, 0.04), rgba(21, 25, 31, 0.34)),
    linear-gradient(90deg, rgba(200, 16, 46, 0.08), transparent 42%);
  pointer-events: none;
}

.location-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.location-card:hover .location-photo img {
  transform: scale(1.025);
}

.location-photo figcaption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 1;
  padding: 5px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #fff;
  background: rgba(21, 25, 31, 0.72);
  font-size: 12px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.location-card-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(21px, 2.2vw, 27px);
}

.location-details {
  display: grid;
  gap: 12px;
  margin: 0 clamp(18px, 2.4vw, 24px);
}

.location-details div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.location-details dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.location-details dd {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.55;
}

.location-details a {
  color: var(--red-dark);
  text-decoration: none;
}

.location-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 2px clamp(18px, 2.4vw, 24px) 0;
}

.location-map-link,
.location-call-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--red);
  border-radius: 8px;
  color: #fff;
  background: var(--red);
  text-decoration: none;
  font-weight: 900;
}

.location-call-link {
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface-raised);
}

.location-call-link.is-copied {
  border-color: var(--success);
  color: #fff;
  background: var(--success);
}

.site-footer {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  color: #d7dde5;
  background: #15191f;
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr) minmax(220px, 1fr);
  gap: 18px;
  align-items: center;
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 44px);
}

.footer-brand {
  display: grid;
  gap: 5px;
}

.footer-brand strong {
  color: #fff;
  font-size: 17px;
}

.footer-brand span,
.site-footer p {
  margin: 0;
  color: #aeb6c2;
  font-size: 13px;
}

.footer-contact {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  color: #d7dde5;
  font-style: normal;
  font-size: 14px;
  font-weight: 700;
}

.footer-contact a {
  color: #fff;
  text-decoration: none;
}

.site-footer p {
  text-align: right;
}

@media (max-width: 1120px) {
  .app-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }

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

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

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .summary-strip .sales-banner {
    min-height: 0;
  }

  .loan-summary {
    grid-column: 1 / -1;
  }

  .site-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
    padding-top: 0;
  }
}

@media (max-width: 860px) {
  .app-header {
    align-items: flex-start;
  }

  .toolbar,
  .layout,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .toolbar-reset {
    grid-column: auto;
  }

  .filter-panel {
    display: none;
  }

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

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .footer-contact {
    justify-content: flex-start;
  }

  .site-footer p {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .admin-shell {
    align-items: start;
    padding: 14px;
  }

  .admin-meta {
    grid-template-columns: 1fr;
  }

  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 14px 8px;
    overflow: hidden;
  }

  .brand-block {
    width: 100%;
    order: 1;
  }

  .brand-logo {
    width: 100%;
    max-width: 460px;
  }

  .brand-logo img {
    max-height: 54px;
  }

  .header-actions {
    order: 2;
    flex: 0 0 auto;
  }

  .site-nav,
  .header-actions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scroll-padding-inline: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .header-actions {
    overflow-y: visible;
    padding-bottom: 18px;
  }

  .site-nav {
    order: 3;
    flex: 0 0 auto;
  }

  .site-nav::-webkit-scrollbar,
  .header-actions::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    flex: 0 0 auto;
  }

  .contact-control {
    flex: 0 0 auto;
  }

  .summary-strip,
  .loan-grid,
  .vehicle-grid,
  .detail-grid,
  .chip-list,
  .gallery-grid,
  .location-grid,
  .warranty-summary-grid,
  .cpo-check-list,
  .cpo-check-list-wide {
    grid-template-columns: 1fr;
  }

  .location-details div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .summary-strip .sales-banner {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 876 / 488;
    min-height: 0;
  }

  .banner-track,
  .banner-slide {
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow: hidden;
  }

  .banner-slide img {
    object-fit: contain;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .info-hero-copy {
    display: block;
  }

  .cpo-visual {
    width: 100%;
  }

  .photo-viewer {
    padding: 10px;
  }

  .viewer-topbar,
  .viewer-footer {
    padding: 10px;
  }

  .viewer-nav {
    width: 40px;
    height: 48px;
    font-size: 34px;
  }

  .footer-contact {
    display: grid;
    gap: 6px;
  }
}
