:root {
  color-scheme: light;
  --black: #101214;
  --charcoal: #202326;
  --muted: #6d7176;
  --line: #dadddf;
  --paper: #ffffff;
  --canvas: #f2f3f4;
  --red: #bb0a30;
  --red-dark: #85051f;
  --green: #187a55;
  --amber: #a85c00;
  --shadow: 0 20px 60px rgba(16, 18, 20, .08);
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--black);
  background:
    radial-gradient(circle at 90% 8%, rgba(187, 10, 48, .055), transparent 26rem),
    var(--canvas);
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}
button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 clamp(22px, 5vw, 72px);
  border-top: 5px solid var(--red);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
}

.brand { display: flex; align-items: center; gap: 16px; color: inherit; text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 9px; letter-spacing: .16em; }

.ring-mark { display: flex; align-items: center; }
.ring-mark i { width: 32px; height: 32px; margin-left: -9px; border: 2px solid currentColor; border-radius: 50%; opacity: .9; }
.ring-mark i:first-child { margin-left: 0; }
.ring-mark.small i { width: 22px; height: 22px; margin-left: -6px; }

.top-actions { display: flex; align-items: center; gap: 18px; }
.sync-badge { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.sync-badge span { width: 8px; height: 8px; border-radius: 50%; background: #969ba0; }
.sync-badge.success span { background: var(--green); box-shadow: 0 0 0 4px rgba(24, 122, 85, .11); }
.sync-badge.failed span { background: var(--red); box-shadow: 0 0 0 4px rgba(187, 10, 48, .11); }
.text-button { padding: 4px 0; border: 0; color: var(--muted); background: transparent; font-size: 12px; }
.text-button:hover { color: var(--black); }

.page-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 56px 0 80px; }
.hero-grid { display: grid; grid-template-columns: 1fr 360px; gap: 60px; align-items: end; }
.kicker { margin: 0 0 10px; color: var(--red); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.kicker.light { color: #c8cbce; }
h1, h2, p { margin-top: 0; }
.hero-grid h1 { max-width: 650px; margin-bottom: 18px; font-size: clamp(42px, 6vw, 72px); line-height: 1.08; letter-spacing: -.04em; }
.hero-copy { max-width: 650px; margin-bottom: 0; color: var(--muted); font-size: 15px; line-height: 1.9; }

.update-card { padding: 26px 28px; color: white; background: var(--charcoal); box-shadow: var(--shadow); }
.update-time { display: flex; align-items: baseline; gap: 10px; margin-bottom: 18px; }
.update-time span { color: #b6babd; font-size: 12px; }
.update-time strong { font-size: 28px; }
.update-card dl { margin: 0 0 20px; border-top: 1px solid #484c50; }
.update-card dl div { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid #484c50; }
.update-card dt { color: #b6babd; font-size: 11px; }
.update-card dd { margin: 0; font-size: 12px; font-weight: 700; }

.sync-progress { margin: 0 0 16px; padding: 13px 14px; border: 1px solid #50555a; background: #17191b; }
.sync-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sync-progress-heading strong { font-size: 12px; }
.sync-progress-heading span { color: #b6babd; font-size: 11px; font-variant-numeric: tabular-nums; }
.sync-progress-track { height: 5px; margin: 10px 0 8px; overflow: hidden; background: #4a4e52; }
.sync-progress-track span { display: block; width: 0; height: 100%; background: #d9dde0; transition: width .3s ease; }
.sync-progress.running .sync-progress-track span { background: #f2b544; }
.sync-progress.success .sync-progress-track span { background: #42b889; }
.sync-progress.failed .sync-progress-track span { background: #e04b68; }
.sync-progress-track.indeterminate span { width: 35% !important; animation: sync-indeterminate 1.2s ease-in-out infinite; }
.sync-progress p { margin: 0; color: #b6babd; font-size: 10px; line-height: 1.5; }

@keyframes sync-indeterminate {
  from { transform: translateX(-110%); }
  to { transform: translateX(310%); }
}

.outline-button, .secondary-button, .primary-button { min-height: 44px; padding: 0 18px; border-radius: 3px; font-weight: 700; }
.outline-button { width: 100%; border: 1px solid #71767b; color: white; background: transparent; }
.outline-button:hover { background: rgba(255,255,255,.08); }
.outline-button:disabled { cursor: wait; opacity: .55; }
.primary-button { border: 1px solid var(--red); color: #fff; background: var(--red); }
.primary-button:hover { border-color: var(--red-dark); background: var(--red-dark); }
.primary-button:disabled { cursor: wait; opacity: .6; }
.secondary-button { border: 1px solid #a8acb0; color: var(--black); background: white; }
.full { width: 100%; }

.search-card { margin-top: 48px; padding: 28px; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.search-card label, dialog label, .login-form label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; }
.search-controls { display: grid; grid-template-columns: 1fr 150px; gap: 10px; }
input { width: 100%; min-height: 49px; padding: 0 15px; border: 1px solid #aeb2b6; border-radius: 3px; color: var(--black); background: #fff; outline: none; }
input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgba(187, 10, 48, .1); }
#vinInput { font-family: Consolas, "SFMono-Regular", monospace; font-size: 18px; letter-spacing: .04em; text-transform: uppercase; }
.field-hint { margin: 8px 0 0; color: var(--muted); font-size: 11px; }

.message-panel { display: flex; gap: 12px; align-items: center; margin-top: 18px; padding: 15px 17px; border-left: 3px solid var(--amber); background: #fff8ec; }
.message-panel.error { border-color: var(--red); background: #fff1f0; }
.message-panel.success { border-color: var(--green); background: #edf8f3; }
.message-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; background: var(--amber); font-family: Georgia, serif; font-weight: bold; }
.message-panel.error .message-icon { background: var(--red); }
.message-panel.success .message-icon { background: var(--green); }
.message-panel strong { font-size: 12px; }
.message-panel p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }

.result-panel { margin-top: 22px; overflow: hidden; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.result-header { display: flex; align-items: center; justify-content: space-between; padding: 27px 30px; color: white; background: linear-gradient(110deg, #17191b, #2a2d30); }
.inquiry-number { margin: 0; font-size: 36px; font-weight: 800; letter-spacing: .045em; }
.light-button { width: auto; }
.vehicle-summary { display: grid; grid-template-columns: 1.2fr 1.1fr .9fr 1fr; background: #fbefef; }
.vehicle-summary div { min-width: 0; padding: 17px 22px; border-right: 1px solid #ebcece; }
.vehicle-summary div:last-child { border: 0; }
.vehicle-summary span, .vehicle-summary strong { display: block; }
.vehicle-summary span { margin-bottom: 5px; color: var(--muted); font-size: 10px; }
.vehicle-summary strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

.options-section { padding: 28px 30px 34px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.section-heading h2 { margin: 0; font-size: 23px; }
.count-pill { padding: 6px 11px; border-radius: 999px; color: var(--red-dark); background: #f4e4e8; font-size: 11px; font-weight: 800; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 10px 12px; color: var(--muted); background: #f2f3f4; text-align: left; font-size: 10px; letter-spacing: .04em; }
td { padding: 13px 12px; border-bottom: 1px solid #e6e8e9; }
th:nth-child(n+3), td:nth-child(n+3) { text-align: right; white-space: nowrap; }
.option-code { color: var(--red-dark); font-family: Consolas, monospace; font-weight: 800; }
.empty-row { padding: 28px; color: var(--muted); text-align: center !important; }

dialog { width: min(430px, calc(100% - 32px)); padding: 0; border: 0; border-radius: 5px; box-shadow: 0 30px 90px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(10, 12, 14, .65); backdrop-filter: blur(3px); }
dialog form { padding: 28px; }
dialog h2 { margin-bottom: 8px; }
dialog label + input + label { margin-top: 16px; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.7; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 30px; background: #181a1c; }
.login-shell { display: grid; grid-template-columns: 1.05fr .95fr; width: min(980px, 100%); min-height: 590px; overflow: hidden; background: white; box-shadow: 0 35px 100px rgba(0,0,0,.38); }
.login-brand { display: flex; flex-direction: column; justify-content: center; padding: clamp(42px, 7vw, 76px); color: white; background: linear-gradient(150deg, #24272a, #111315); }
.login-brand .ring-mark { margin-bottom: 50px; }
.login-brand h1 { margin-bottom: 22px; font-size: clamp(42px, 5vw, 66px); line-height: 1.06; letter-spacing: -.05em; }
.login-lead { max-width: 390px; margin-bottom: 32px; color: #d1d4d6; line-height: 1.8; }
.login-note { margin: auto 0 0; padding-top: 25px; border-top: 1px solid #44484b; color: #aeb2b5; font-size: 11px; }
.login-form-wrap { display: grid; place-items: center; padding: 45px; }
.login-form { width: min(330px, 100%); }
.login-form h2 { margin-bottom: 8px; font-size: 25px; }
.login-form label { margin-top: 28px; }
.login-form .primary-button { margin-top: 12px; }
.form-error { padding: 10px 12px; color: #8e071f; background: #fff0f2; font-size: 12px; }
.security-note { display: flex; justify-content: center; align-items: center; gap: 7px; margin: 18px 0 0; color: var(--muted); font-size: 10px; }
.security-note span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

@media (max-width: 780px) {
  .topbar { min-height: 66px; padding-inline: 18px; }
  .brand strong { font-size: 12px; }
  .brand small, .ring-mark.small { display: none; }
  .sync-badge b { display: none; }
  .page-shell { width: min(100% - 28px, 650px); padding-top: 34px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-grid h1 { font-size: 42px; }
  .search-card { margin-top: 28px; padding: 20px; }
  .search-controls { grid-template-columns: 1fr; }
  .vehicle-summary { grid-template-columns: 1fr 1fr; }
  .vehicle-summary div:nth-child(2) { border-right: 0; }
  .vehicle-summary div:nth-child(-n+2) { border-bottom: 1px solid #ebcece; }
  .result-header, .options-section { padding-inline: 20px; }
  .login-page { padding: 0; }
  .login-shell { grid-template-columns: 1fr; min-height: 100vh; }
  .login-brand { padding: 36px 28px; }
  .login-brand .ring-mark { margin-bottom: 30px; }
  .login-brand h1 { font-size: 42px; }
  .login-note { display: none; }
  .login-form-wrap { padding: 40px 28px; }
}
