:root {
  --canvas: #dde2df;
  --surface: #f5f6f3;
  --surface-strong: #d9dfdc;
  --ink: #17211f;
  --muted: #66706d;
  --line: #c7ceca;
  --accent: #285b52;
  --accent-soft: #d7e4df;
  --warm: #b46b43;
  --danger: #9b3f37;
  --shadow: 0 18px 50px rgba(27, 39, 36, 0.08);
  --safe-top: max(16px, env(safe-area-inset-top));
  --safe-bottom: max(20px, env(safe-area-inset-bottom));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  position: relative;
  min-width: 300px;
  min-height: 100vh;
  margin: 0;
  background: var(--canvas);
  isolation: isolate;
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  inset: -30%;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(122deg, transparent 15%, rgba(34, 45, 42, 0.19) 40%, rgba(255, 255, 255, 0.52) 58%, transparent 81%),
    linear-gradient(36deg, transparent 24%, rgba(75, 88, 83, 0.15) 48%, rgba(247, 249, 247, 0.34) 61%, transparent 73%);
  background-size: 145% 145%, 170% 170%;
  animation: ambient-drift 24s ease-in-out infinite alternate;
}

body::after {
  opacity: 0.78;
  background: repeating-linear-gradient(
    158deg,
    transparent 0,
    transparent 92px,
    rgba(45, 58, 54, 0.075) 94px,
    transparent 98px,
    transparent 176px
  );
  animation: ambient-contours 32s linear infinite;
}

@keyframes ambient-drift {
  0% {
    background-position: 5% 12%, 92% 78%;
    transform: scale(1) rotate(-1deg);
  }
  100% {
    background-position: 88% 72%, 12% 20%;
    transform: scale(1.08) rotate(1deg);
  }
}

@keyframes ambient-contours {
  from { transform: translate3d(-2%, -1%, 0); }
  to { transform: translate3d(5%, 4%, 0); }
}

button,
input {
  font: inherit;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--warm);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1240px);
  min-height: 100vh;
  margin: 0 auto;
  padding: var(--safe-top) clamp(18px, 5vw, 68px) var(--safe-bottom);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  border-bottom: 1px solid var(--line);
  background: rgba(231, 234, 232, 0.28);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-name {
  font-size: 15px;
  font-weight: 720;
}

.topbar-context {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 620;
}

.entry {
  display: flex;
  min-height: min(760px, calc(100vh - 96px));
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 48px;
  padding: 72px 0;
}

.entry-heading {
  text-align: center;
}

h1 {
  max-width: 800px;
  margin: 0 auto;
  font-size: 60px;
  font-weight: 620;
  line-height: 1.04;
}

.search-tool {
  width: 100%;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(245, 246, 243, 0.88);
  box-shadow: var(--shadow);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.input-row input {
  width: 100%;
  min-width: 0;
  height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  background: #eef1ef;
  font-size: 15px;
  transition: border-color 160ms ease, background 160ms ease;
}

.input-row input::placeholder {
  color: #8a928f;
}

.input-row input:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.submit-button {
  display: inline-flex;
  min-width: 148px;
  height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  color: var(--surface);
  background: var(--ink);
  font-size: 13px;
  font-weight: 680;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}

.submit-button:hover {
  background: var(--accent);
}

.submit-button:active {
  transform: translateY(1px);
}

.field-error {
  min-height: 0;
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

.field-error:not(:empty) {
  margin-top: 10px;
}

.loading-view {
  display: flex;
  min-height: calc(100vh - 116px);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 48px 0;
  text-align: center;
}

.loading-copy {
  width: min(100%, 560px);
}

.loading-copy p {
  margin: 0 0 18px;
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 590;
}

.progress-track {
  height: 2px;
  overflow: hidden;
  background: var(--line);
}

.progress-track i {
  display: block;
  width: 34%;
  height: 100%;
  background: var(--accent);
  animation: progress 1.6s ease-in-out infinite;
}

.loading-footnote {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

@keyframes progress {
  0% { transform: translateX(-100%); }
  55% { transform: translateX(160%); }
  100% { transform: translateX(300%); }
}

.result {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 26px 0 46px;
}

@media (max-width: 899px) {
  .topbar {
    justify-content: center;
  }

  .topbar-context {
    display: none;
  }

  .entry {
    min-height: min(690px, calc(100vh - 120px));
    padding: 52px 0;
  }

  h1 {
    margin: 0 auto;
    font-size: 42px;
  }

}

.result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.text-action,
.export-button {
  display: inline-flex;
  height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
  font-weight: 680;
  cursor: pointer;
}

.export-button {
  min-width: 70px;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
}

.result-intro {
  display: grid;
  gap: 28px;
}

.result-summary {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.vehicle-photo {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin: 0;
  aspect-ratio: 16 / 10;
  border-radius: 6px;
  background: var(--surface-strong);
}

.vehicle-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.source-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 7px 9px;
  border-radius: 3px;
  color: var(--surface);
  background: rgba(23, 33, 31, 0.88);
  font-size: 10px;
  font-weight: 720;
}

.vehicle-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  padding: 26px 0 28px;
  border-bottom: 1px solid var(--line);
}

.vehicle-heading h2 {
  max-width: 620px;
  margin: 0;
  font-size: clamp(27px, 6vw, 46px);
  font-weight: 610;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.vehicle-id {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}

.vehicle-highlights {
  display: none;
}

.total-band {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  margin: 28px 0 0;
  padding: clamp(20px, 5vw, 34px);
  border-radius: 6px;
  color: var(--surface);
  background: var(--ink);
}

.data-grid {
  display: block;
}

.total-band p,
.total-band strong {
  margin: 0;
}

.total-band p {
  margin-bottom: 8px;
  color: #aeb8b4;
  font-size: 11px;
  font-weight: 650;
}

.total-band strong {
  display: block;
  font-size: clamp(27px, 7vw, 49px);
  font-weight: 590;
  white-space: nowrap;
}

.total-band span {
  color: #aeb8b4;
  font-size: 11px;
  text-align: right;
}

.data-section {
  display: grid;
  grid-template-columns: minmax(130px, 0.34fr) 1fr;
  gap: 34px;
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.section-title {
  margin: 0;
  color: var(--accent);
  font-size: 10px;
  font-weight: 760;
}

.data-list {
  margin: 0;
}

.data-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(199, 206, 202, 0.68);
}

.data-row:first-child {
  padding-top: 0;
}

.data-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.data-row dt,
.data-row dd {
  margin: 0;
  font-size: 13px;
}

.data-row dt {
  color: var(--muted);
}

.data-row dd {
  max-width: 330px;
  font-weight: 620;
  text-align: right;
  overflow-wrap: anywhere;
}

.data-row.total-row dt,
.data-row.total-row dd {
  color: var(--ink);
  font-weight: 740;
}

.notice {
  margin-top: 24px;
  padding: 16px 18px;
  border-left: 2px solid var(--warm);
  color: var(--muted);
  background: var(--surface);
  font-size: 12px;
  line-height: 1.55;
}

.listing-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 28px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 680;
  text-decoration: none;
}

.toast {
  position: fixed;
  z-index: 10;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  left: 18px;
  max-width: 520px;
  margin: auto;
  padding: 13px 16px;
  border-radius: 4px;
  color: var(--surface);
  background: var(--ink);
  font-size: 12px;
  font-weight: 620;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 900px) {
  .topbar {
    min-height: 76px;
    border-bottom-color: rgba(117, 130, 125, 0.28);
    background: transparent;
  }

  .brand-name {
    font-size: 24px;
    font-weight: 730;
  }

  .topbar-context {
    font-size: 13px;
  }

  .entry {
    min-height: min(760px, calc(100vh - 112px));
    gap: 54px;
    padding: 72px 0 92px;
  }

  .search-tool {
    width: min(100%, 900px);
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .input-row {
    grid-template-columns: minmax(0, 1fr) 190px;
    gap: 12px;
  }

  .input-row input,
  .submit-button {
    height: 64px;
  }

  .input-row input {
    padding: 0 20px;
    border-color: rgba(116, 130, 124, 0.42);
    background: rgba(245, 246, 243, 0.56);
    font-size: 17px;
  }

  .submit-button {
    padding: 0 20px;
    font-size: 14px;
  }

  .result {
    padding-top: 34px;
  }

  .result-toolbar {
    margin-bottom: 32px;
  }

  .text-action,
  .export-button {
    height: 44px;
    font-size: 13px;
  }

  .result-intro {
    grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
    gap: 36px;
    align-items: stretch;
  }

  .result-intro.no-photo {
    grid-template-columns: 1fr;
  }

  .vehicle-photo {
    aspect-ratio: 4 / 3;
  }

  .vehicle-heading {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 34px 4px 30px;
    border-top: 1px solid rgba(117, 130, 125, 0.38);
    border-bottom: 0;
  }

  .vehicle-heading h2 {
    max-width: none;
    font-size: 46px;
    line-height: 1.06;
  }

  .vehicle-id {
    margin-top: 18px;
    font-size: 12px;
  }

  .vehicle-highlights {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 28px 0 0;
    padding-top: 22px;
    border-top: 1px solid rgba(117, 130, 125, 0.34);
  }

  .vehicle-highlight dt,
  .vehicle-highlight dd {
    margin: 0;
  }

  .vehicle-highlight dt {
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 10px;
  }

  .vehicle-highlight dd {
    font-size: 14px;
    font-weight: 680;
    overflow-wrap: anywhere;
  }

  .total-band {
    grid-template-columns: 1fr;
    gap: 22px;
    margin-top: auto;
    padding: 30px 34px;
  }

  .total-band p,
  .total-band span {
    font-size: 13px;
  }

  .total-band strong {
    font-size: clamp(38px, 4vw, 52px);
  }

  .total-band span {
    text-align: left;
  }

  .data-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 64px;
    margin-top: 38px;
  }

  .data-section {
    display: block;
    padding: 48px 0;
  }

  .section-title {
    margin-bottom: 28px;
    font-size: 12px;
  }

  .data-row {
    padding: 16px 0;
  }

  .data-row dt,
  .data-row dd {
    font-size: 15px;
  }

  .data-row dd {
    max-width: 360px;
  }

  .landed-data {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 52px;
    padding-top: 42px;
  }

  .landed-data .section-title {
    margin: 3px 0 0;
  }

  .landed-data .data-list {
    display: block;
  }

  .landed-data .data-row {
    grid-template-columns: minmax(240px, 1fr) auto;
    padding: 18px 0;
  }

  .landed-data .data-row:first-child {
    padding-top: 0;
  }

  .landed-data .total-row {
    margin-top: 8px;
    padding-top: 22px;
    border-top: 1px solid rgba(117, 130, 125, 0.5);
  }

  .notice {
    padding: 18px 20px;
    background: rgba(245, 246, 243, 0.42);
    font-size: 14px;
  }

  .listing-link {
    padding: 22px 0;
    font-size: 15px;
  }
}

@media (max-width: 560px) {
  .entry {
    min-height: calc(100vh - 100px);
    gap: 34px;
    padding: 42px 0;
  }

  h1 {
    font-size: 34px;
  }

  .search-tool {
    padding: 18px;
  }

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

  .submit-button {
    width: 100%;
  }

  .vehicle-heading,
  .total-band,
  .data-section {
    grid-template-columns: 1fr;
  }

  .vehicle-heading {
    gap: 12px;
  }

  .total-band {
    gap: 16px;
  }

  .total-band span {
    text-align: left;
  }

  .data-section {
    gap: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
