:root {
  --wecar-red: #E32929;
  --wecar-dark: #2b2b2b;
  --bg: #f5f5f5;
  --card: #ffffff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: #222;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.app-main { flex: 1; }
.app-header {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  position: sticky;
  top: 0;
  z-index: 100;
}
.brand-logo { height: 28px; width: auto; }
.brand-title { color: #111; font-weight: 700; font-size: 0.95rem; }
.hana-logo { height: 22px; width: auto; }
.hana-logo-lg { height: 28px; width: auto; }
.hamburger {
  display: block;
  width: 22px;
  height: 2px;
  background: #222;
  box-shadow: 0 6px 0 #222, 0 12px 0 #222;
  margin-bottom: 12px;
}
.app-footer {
  background: #eee;
  color: #555;
  margin-top: auto;
}

.btn-wecar {
  background: var(--wecar-red);
  border-color: var(--wecar-red);
  color: #fff;
}
.btn-wecar:hover { background: #c41f1f; border-color: #c41f1f; color: #fff; }
.btn-purple { background: #6f42c1; border-color: #6f42c1; color: #fff; }
.btn-purple:hover { background: #5a32a3; color: #fff; }

.page-auth {
  background: linear-gradient(180deg, #1a1a1a 0%, #3a3a3a 100%);
  min-height: 100vh;
}
.page-auth .app-main { display: flex; align-items: center; }
.page-auth .app-footer { background: transparent; color: #ddd; }
.auth-card {
  max-width: 420px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.auth-card-header {
  background: var(--wecar-red);
  color: #fff;
  text-align: center;
  font-weight: 700;
  padding: 0.75rem;
}
.auth-card-body { padding: 1.25rem; }
.auth-logo { max-width: 180px; height: auto; }

.welcome-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: #f0f0f0;
  border-radius: 10px;
  padding: 1rem;
}
.welcome-kicker { font-weight: 700; letter-spacing: 0.02em; }
.welcome-kicker span { color: var(--wecar-red); }

.info-list {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
}
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #eee;
}
.info-row:last-child { border-bottom: 0; }
.info-row span:first-child { color: #666; }

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0.5rem 0 0.75rem;
  padding-left: 0.5rem;
  border-left: 3px solid var(--wecar-red);
}
.required::after { content: " *"; color: #c00; }

.diag-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 0.9rem;
}
.photo-strip {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.photo-strip img {
  height: 64px;
  width: 86px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd;
  flex: 0 0 auto;
}

.diag-tabs .nav-link {
  color: #666;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
}
.diag-tabs .nav-link.active {
  color: var(--wecar-red);
  border-bottom-color: var(--wecar-red);
  background: transparent;
  font-weight: 700;
}
.sticky-actions {
  position: sticky;
  top: 56px;
  background: var(--bg);
  z-index: 50;
  padding: 0.4rem 0;
}

.hotspot-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 0.6rem;
  margin-bottom: 0.5rem;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid #ccc;
  cursor: pointer;
  background: #fff;
  color: #333;
}
.status-pill.active.status-danger,
.badge-code.badge-danger { background: #e53935; color: #fff; border-color: #e53935; }
.status-pill.active.status-secondary,
.badge-code.badge-secondary { background: #555; color: #fff; border-color: #555; }
.status-pill.active.status-success,
.badge-code.badge-success { background: #2e7d32; color: #fff; border-color: #2e7d32; }
.badge-code {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.8rem;
}

.photo-slot {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 0.5rem;
  height: 100%;
}
.photo-preview {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.photo-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f3f3;
  color: #999;
  border-radius: 4px;
  font-size: 0.8rem;
}

.metric {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 0.75rem;
}
.metric .label { font-size: 0.75rem; color: #777; }
.metric .value { font-weight: 700; margin-top: 0.2rem; }
.metric.highlight { border-color: var(--wecar-red); }
.metric.highlight .value { color: var(--wecar-red); font-size: 1.1rem; }

.report-head {
  background: #fff;
  border-left: 6px solid var(--wecar-red);
  padding: 0.75rem 1rem;
  border-radius: 4px;
}

.inapp-banner {
  background: #111;
  color: #fff;
  font-size: 0.85rem;
}

/* Quicken-inspired dashboard (Mobbin) + weCar accents */
:root {
  --dash-bg: #F5F5F7;
  --card-radius: 16px;
  --card-shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}

.page-dashboard .app-main,
body.page-dashboard {
  background: var(--dash-bg);
}
.dash-shell {
  display: flex;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
}
.dash-rail {
  width: 56px;
  flex-shrink: 0;
  background: #1c1c1e;
  border-radius: 18px;
  padding: 0.75rem 0.4rem;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-height: 280px;
}
.rail-item {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  text-decoration: none;
  font-size: 1.1rem;
}
.rail-item.active,
.rail-item:hover { background: #333; color: #fff; }
.dash-main { flex: 1; min-width: 0; }
.card-panel {
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 1.1rem 1.2rem;
  border: 0;
}
.dash-hero { background: linear-gradient(135deg, #fff 60%, #ffe9e9 100%); }
.dash-eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: #888;
  font-weight: 700;
}
.dash-title { font-size: 1.45rem; font-weight: 800; margin: 0.25rem 0; }
.dash-sub { color: #666; font-size: 0.92rem; }
.dash-tile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 1.15rem 1.1rem;
  text-decoration: none;
  color: inherit;
  min-height: 108px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.dash-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.1); color: inherit; }
.dash-tile.disabled { opacity: 0.55; pointer-events: none; }
.dash-tile-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  background: #f3f3f5; font-size: 1.25rem; flex-shrink: 0;
}
.dash-tile-result .dash-tile-icon { background: #ffe8e8; }
.dash-tile-admin .dash-tile-icon { background: #ececf3; }
.dash-tile-title { font-weight: 800; font-size: 1.05rem; }
.dash-tile-desc { color: #777; font-size: 0.85rem; }
.dash-tile-arrow { margin-left: auto; color: var(--wecar-red); font-weight: 700; font-size: 1.2rem; }
.pill-muted {
  background: #f0f0f2; color: #555; border-radius: 999px;
  padding: 0.2rem 0.7rem; font-size: 0.8rem;
}
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.info-grid > div {
  background: #f7f7f9;
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
}
.info-grid span { display: block; color: #888; font-size: 0.75rem; }
.info-grid strong { font-size: 0.9rem; }
.spent-list { display: flex; flex-direction: column; }
.spent-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.75rem 0; border-bottom: 1px solid #f0f0f2;
  text-decoration: none; color: inherit;
}
.spent-row:last-child { border-bottom: 0; }
.link-red { color: var(--wecar-red); text-decoration: none; font-weight: 600; }

.diag-mode-bar {
  display: flex;
  background: #f3f3f3;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  padding: 4px;
  gap: 4px;
  margin-bottom: 0.75rem;
}
.diag-mode {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.4rem;
  font-weight: 700;
  color: #666;
  border-radius: 11px;
  transition: background .18s ease, color .18s ease, transform .15s ease;
}
.diag-mode-label { display: block; font-size: 0.92rem; line-height: 1.2; }
.diag-mode-sub {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.72;
  margin-top: 0.12rem;
  letter-spacing: 0.02em;
}
.diag-mode.active {
  background: var(--wecar-red);
  color: #fff;
  box-shadow: 0 4px 12px rgba(227, 41, 41, 0.28);
}
.legend-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  background: transparent;
  border-radius: 0;
  padding: 0;
  font-size: 0.78rem;
  box-shadow: none;
  margin-bottom: 0.85rem;
}
.legend-box b { color: var(--wecar-red); margin-right: 0.15rem; }
.legend-pills .legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  color: #444;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.legend-pill-ok b { color: #2f7d4a; }
.hotspot-badges { display: flex; gap: 0.25rem; }

/* Diagnosis studio canvas */
.diag-studio {
  background: #fff;
  border: 0;
  border-radius: 12px;
  padding: 0.75rem 0.2rem 0.85rem;
  margin-bottom: 0.9rem;
  box-shadow: none;
}
.diag-studio .check-cols-tri {
  gap: 0.65rem;
}
.diag-studio .check-col-title span {
  border: 0;
  background: transparent;
  padding: 0;
  color: #666;
  font-size: 0.72rem;
}
.diag-studio-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.diag-studio-eyebrow {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--wecar-red);
}
.diag-studio-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0.1rem 0 0;
  color: #1a1a1a;
}
.diag-studio-hint {
  font-size: 0.75rem;
  color: #888;
  text-align: right;
  max-width: 9rem;
  line-height: 1.35;
}

/* Interactive diagram + popup (wecar diag style) */
.vehicle-banner {
  border: 2px solid var(--wecar-red);
  background: #fff;
  text-align: center;
  font-weight: 800;
  padding: 0.55rem;
  border-radius: 8px;
}
.check-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}
.check-cols-tri {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  align-items: start;
}
.check-col-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.4rem;
  color: #555;
}
.check-col-title span {
  display: inline-block;
  background: #fff;
  border: 1px solid #e6e6e8;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  letter-spacing: 0.02em;
}
.check-view-wrap {
  position: relative;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
  aspect-ratio: 828 / 2832;
  max-height: none;
  box-shadow: none;
}
/* Tri layout: width-driven, keep PNG ratio so hotspots align */
.check-view-tri {
  width: 100%;
  max-height: none;
  height: auto;
  aspect-ratio: 828 / 2832;
  margin-inline: 0;
}
.check-view-tri .diagram-bg.sedan-frame {
  object-fit: fill;
  object-position: center;
}
.check-cols-tri .hotspot-dot {
  width: 24px;
  height: 24px;
}
.check-cols-tri .hotspot-dot .dot-ring {
  width: 18px;
  height: 18px;
  border-width: 1.5px;
}
.check-cols-tri .hotspot-dot .dot-badge {
  font-size: 0.58rem;
}
@media (max-width: 576px) {
  .check-cols-tri .hotspot-dot {
    width: 20px;
    height: 20px;
  }
  .check-cols-tri .hotspot-dot .dot-ring {
    width: 15px;
    height: 15px;
  }
  .check-cols-tri .hotspot-dot .dot-badge {
    font-size: 0.5rem;
  }
  .hana-mark b {
    min-width: 0.85rem;
    height: 0.85rem;
    font-size: 0.48rem;
  }
  .diag-studio {
    padding: 0.75rem 0.55rem 0.85rem;
    border-radius: 14px;
  }
}
.diagram-bg.sedan-frame {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  opacity: 1;
  pointer-events: none;
  display: block;
}
.hotspot-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  padding: 0;
  z-index: 2;
  touch-action: manipulation;
}
.hotspot-dot .dot-ring {
  display: block;
  width: 28px;
  height: 28px;
  border: 2px dashed rgba(227, 41, 41, 0.7);
  border-radius: 50%;
  background: rgba(227, 41, 41, 0.08);
  margin: 0 auto;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  animation: hotspot-breathe 2.4s ease-in-out infinite;
}
@keyframes hotspot-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(227, 41, 41, 0.18); }
  50% { box-shadow: 0 0 0 5px rgba(227, 41, 41, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .hotspot-dot .dot-ring { animation: none; }
  .part-sheet { animation: none; }
}
.hotspot-dot.is-marked .dot-ring,
.hotspot-dot.is-ok .dot-ring {
  border-style: solid;
  background: #fff;
  animation: none;
}
.hotspot-dot.is-accident .dot-ring {
  border-color: var(--wecar-red);
  background: rgba(227, 41, 41, 0.16);
  box-shadow: 0 0 0 3px rgba(227, 41, 41, 0.12);
}
.hotspot-dot.is-accident .dot-badge {
  color: var(--wecar-red);
}
.hotspot-dot.is-active .dot-ring {
  transform: scale(1.12);
  border-color: var(--wecar-red);
  box-shadow: 0 0 0 4px rgba(227, 41, 41, 0.2);
  animation: none;
}
.hotspot-dot .dot-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--wecar-red);
  line-height: 1;
  pointer-events: none;
}
.hotspot-dot .dot-badge:empty { display: none; }
.hotspot-dot .dot-text { display: none; }
.hotspot-dot .display-css { display: none; }

.diag-summary {
  background: #fff;
  border: 1px solid #ebebeb;
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  box-shadow: 0 4px 14px rgba(20,20,30,.04);
}
.diag-summary-hint {
  font-size: 0.68rem;
  color: #999;
}
.diag-summary-body {
  font-size: 0.84rem;
  color: #555;
}
.diag-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.diag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #eee;
  background: #fafafa;
  border-radius: 999px;
  padding: 0.28rem 0.55rem 0.28rem 0.45rem;
  font-size: 0.78rem;
  color: #333;
  cursor: pointer;
}
.diag-chip:hover { border-color: #f0c0c0; background: #fff7f7; }
.diag-chip-code {
  display: inline-grid;
  place-items: center;
  min-width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  background: var(--wecar-red);
  color: #fff;
  font-weight: 800;
  font-size: 0.68rem;
}
.diag-chip-acc .diag-chip-code { background: #c41e1e; }
.diag-chip-rep .diag-chip-code { background: #d97706; }

.part-popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 20, 0.4);
  z-index: 1040;
  backdrop-filter: blur(2px);
}
.part-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(280px, calc(100vw - 2rem));
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
  z-index: 1050;
  overflow: hidden;
}
.part-sheet {
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  transform: translateY(0);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,.18);
  animation: sheet-up .22s ease-out;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@keyframes sheet-up {
  from { transform: translateY(18px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}
.part-sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: #ddd;
  margin: 0.55rem auto 0.15rem;
}
.part-popup-title {
  font-weight: 800;
  padding: 0.55rem 1rem 0.35rem;
  font-size: 1rem;
}
.part-popup-body {
  padding: 0.35rem 0.85rem 0.85rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  max-height: 48vh;
  overflow: auto;
}
.part-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  width: 100%;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  background: #fff;
  padding: 0.7rem 0.75rem;
  text-align: left;
  transition: border-color .15s ease, background .15s ease, transform .12s ease;
}
.part-option strong {
  width: auto;
  color: #111;
  font-size: 1.05rem;
}
.part-option span { color: #666; font-size: 0.78rem; }
.part-option.active,
.part-option:hover {
  border-color: var(--wecar-red);
  background: #fff5f5;
}
.part-option.active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(227, 41, 41, 0.12);
}
.part-popup-close {
  width: 100%;
  border: 0;
  border-top: 1px solid #eee;
  background: #f7f7f7;
  padding: 0.85rem;
  font-weight: 700;
}

/* 하나캐피탈 차량반납확인서 (xlsx layout) */
.hana-sheet {
  --hana-teal: #00857d;
  --hana-line: #333;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 2px;
  padding: 0.65rem 0.7rem 0.85rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  color: #111;
  font-size: 0.84rem;
}
.hana-sheet-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.35rem;
  border-bottom: 2px solid var(--hana-teal);
  padding-bottom: 0.4rem;
  margin-bottom: 0.45rem;
}
.hana-sheet-logo { height: 22px; width: auto; justify-self: start; }
.hana-sheet-logo.wecar { height: 18px; justify-self: end; }
.hana-sheet-title {
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #111;
}
.hana-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.78rem;
  margin-bottom: 0.45rem;
}
.hana-grid th,
.hana-grid td {
  border: 1px solid var(--hana-line);
  padding: 0.28rem 0.35rem;
  vertical-align: middle;
}
.hana-grid th {
  width: 11%;
  background: #f4f7f7;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
}
.hana-grid td { width: 22.3%; }
.hana-car-name {
  width: auto !important;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hana-opt { opacity: 0.35; }
.hana-opt.on {
  opacity: 1;
  font-weight: 800;
  color: var(--hana-teal);
  text-decoration: underline;
}
.hana-fuel { font-size: 0.78rem; }
.hana-diag-block {
  border: 1px solid var(--hana-line);
  padding: 0.35rem 0.4rem 0.4rem;
  margin-bottom: 0.45rem;
  background: #fafbfb;
}
.hana-diag-caption {
  font-size: 0.72rem;
  font-weight: 800;
  color: #0b4f4a;
  margin-bottom: 0.3rem;
}
.hana-body {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
  align-items: stretch;
}
.hana-diagram-col {
  border: 0;
  padding: 0.15rem 0.1rem 0.2rem;
  background: transparent;
  min-height: 0;
}
.hana-diagram-tri {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.15rem;
  align-items: start;
  justify-items: center;
}
.hana-view { width: 100%; }
.hana-view-title {
  font-size: 0.62rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 0.12rem;
  color: #444;
}
.hana-view-frame {
  position: relative;
  overflow: visible;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 420px;
  aspect-ratio: 828 / 2832;
  margin-inline: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.hana-view-frame .diagram-bg.sedan-frame {
  object-fit: fill;
}
.hana-diagram {
  position: relative;
  border: 1px solid var(--hana-line);
  background: #fafafa;
  min-height: 160px;
}
.hana-diagram img {
  display: block;
  width: 100%;
  height: auto;
}
.hana-mark {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 2px;
  pointer-events: none;
  z-index: 2;
}
.hana-mark b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0.95rem;
  height: 0.95rem;
  padding: 0 0.1rem;
  border-radius: 50%;
  font-size: 0.52rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  border: 1.5px solid var(--wecar-red);
}
.hana-mark b.acc { background: var(--wecar-red); }
.hana-mark b.rep { background: #c2410c; border-color: #c2410c; }
.hana-mark b.ok {
  background: #fff;
  color: var(--wecar-red);
}
.hana-mark-ok b.ok {
  opacity: 0.85;
}
.hana-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.55rem;
  font-size: 0.65rem;
  margin-top: 0.3rem;
  color: #444;
}
.hana-legend b { color: var(--wecar-red); }
.hana-check-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
@media (max-width: 768px) {
  .hana-check-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hana-car-name {
    white-space: normal;
  }
}
.hana-side { display: flex; flex-direction: column; gap: 0.4rem; }
.hana-box {
  border: 1px solid var(--hana-line);
  padding: 0.25rem 0.3rem 0.35rem;
}
.hana-box-title {
  font-size: 0.7rem;
  font-weight: 800;
  background: #eef5f4;
  color: #0b4f4a;
  padding: 0.18rem 0.3rem;
  margin: -0.25rem -0.3rem 0.25rem;
  border-bottom: 1px solid var(--hana-line);
}
.hana-notes { margin-bottom: 0.4rem; }
.hana-mini {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
}
.hana-mini th,
.hana-mini td {
  border: 1px solid #ccc;
  padding: 0.28rem 0.35rem;
}
.hana-mini th {
  width: 45%;
  background: #fafafa;
  font-weight: 600;
}
.hana-ox {
  text-align: center;
  letter-spacing: 0.04em;
  color: #444;
  white-space: nowrap;
}
.hana-cost {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-bottom: 0.65rem;
}
.hana-cost th,
.hana-cost td {
  border: 1px solid var(--hana-line);
  padding: 0.35rem 0.4rem;
  text-align: center;
}
.hana-cost th { background: #f4f7f7; font-weight: 700; }
.hana-cost-total-label {
  writing-mode: horizontal-tb;
  background: #fff5f5 !important;
  color: var(--wecar-red);
  font-weight: 900 !important;
  width: 12%;
}
.hana-cost-sum td { background: #fffaf0; }
.hana-cost-total-value {
  font-weight: 900;
  color: var(--wecar-red);
  font-size: 0.95rem;
}
.hana-cost-meta {
  text-align: left !important;
  font-size: 0.72rem;
  color: #555;
}
.hana-parts { margin-bottom: 0.65rem; }
.hana-parts .hana-box-title {
  margin: 0;
  border: 1px solid var(--hana-line);
  border-bottom: none;
}
.hana-parts-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.hana-parts-table th,
.hana-parts-table td {
  border: 1px solid var(--hana-line);
  padding: 0.3rem 0.4rem;
}
.hana-parts-table th {
  background: #f4f7f7;
  text-align: center;
}
.hana-consent {
  border: 1px solid var(--hana-line);
  margin-bottom: 0.65rem;
}
.hana-consent .hana-box-title { margin: 0; border-bottom: 1px solid var(--hana-line); }
.hana-consent ol {
  margin: 0;
  padding: 0.45rem 0.7rem 0.55rem 1.4rem;
  font-size: 0.72rem;
  line-height: 1.45;
}
.hana-consent li { margin-bottom: 0.25rem; }
.hana-consent .hana-ox { float: right; margin-left: 0.5rem; }
.hana-photos { margin-bottom: 0.65rem; }
.return-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}
.return-photos figure { margin: 0; }
.return-photos img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border: 1px solid #ddd;
}
.return-photos .photo-placeholder {
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  border: 1px dashed #ccc;
  color: #999;
  font-size: 0.75rem;
}
.return-photos figcaption {
  font-size: 0.7rem;
  text-align: center;
  margin-top: 0.15rem;
}
.hana-sheet-back {
  margin-top: 1.25rem;
}
@media print {
  @page {
    size: A4 portrait;
    margin: 8mm;
  }
  .hana-sheet-front {
    break-after: page;
    page-break-after: always;
    box-shadow: none;
    border: 0;
    padding: 0;
    font-size: 9pt;
  }
  .hana-sheet-back {
    margin-top: 0;
    break-before: page;
    page-break-before: always;
    box-shadow: none;
    border: 0;
    padding: 0;
  }
  .hana-mark b {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .hana-view-frame {
    max-height: 360px;
    width: 100%;
    border: 0;
  }
  .hana-diagram-col {
    border: 0;
    background: transparent;
  }
  .hana-body {
    grid-template-columns: 1.4fr 1fr;
  }
  .hana-check-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .hana-sign-box {
    min-height: 70px;
  }
  .hana-cost {
    font-size: 0.7rem;
  }
  .sign-preview {
    max-height: 48px;
  }
}
.hana-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.hana-sign-box {
  border: 1px solid var(--hana-line);
  min-height: 88px;
  padding: 0.65rem;
  font-size: 0.82rem;
}
.sign-line { margin-top: 0.65rem; }
.hana-sheet-foot {
  margin-top: 0.7rem;
  text-align: center;
  font-size: 0.68rem;
  color: #777;
  border-top: 1px solid #ddd;
  padding-top: 0.45rem;
}

@media (max-width: 768px) {
  .container { max-width: 100%; }
  .hana-sheet-head { grid-template-columns: 1fr; justify-items: center; }
  .hana-sheet-logo,
  .hana-sheet-logo.wecar { justify-self: center; }
  .hana-body { grid-template-columns: 1fr; }
  .hana-grid th { width: auto; }
  .hana-cost { font-size: 0.7rem; }
  .hana-sign { grid-template-columns: 1fr; }
  .return-photos { grid-template-columns: repeat(2, 1fr); }
  .hana-consent .hana-ox { float: none; display: block; margin: 0.15rem 0 0; }
}

/* Mobile UX: bottom nav, steps, touch targets */
.btn-touch {
  min-height: 48px;
  font-size: 1rem;
}
.form-control,
.form-control-lg {
  min-height: 44px;
  font-size: 16px; /* iOS zoom prevent */
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}
.search-bar {
  display: flex;
  gap: 0.5rem;
}
.search-bar .form-control { flex: 1; }
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: stretch;
}
.action-row form { margin: 0; }
.empty-state { padding: 2rem 1rem; }
.min-w-0 { min-width: 0; }

.has-bottom-nav .app-main {
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid #e8e8e8;
  padding: 0.35rem 0.25rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  text-decoration: none;
  color: #666;
  font-size: 0.68rem;
  font-weight: 600;
  min-height: 52px;
  margin: 0;
  background: transparent;
  border: 0;
}
.bottom-nav-item .bn-ico { font-size: 1.15rem; line-height: 1; }
.bn-start {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  border: 0;
  background: transparent;
  color: var(--wecar-red);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0;
}
.bn-plus {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--wecar-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
  margin-top: -10px;
  box-shadow: 0 4px 12px rgba(227,41,41,.35);
}
@media (min-width: 992px) {
  .bottom-nav { display: none; }
  .has-bottom-nav .app-main { padding-bottom: 0; }
}

.diag-topbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.diag-topbar-title { flex: 1; min-width: 0; }
.step-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  background: #fff;
  border-radius: 12px;
  padding: 0.35rem;
  box-shadow: var(--card-shadow);
}
.step-progress.step-5 {
  grid-template-columns: repeat(5, 1fr);
}
.step-progress.step-5 .step-item span:last-child {
  font-size: 0.62rem;
}
.step-item {
  border: 0;
  background: transparent;
  border-radius: 10px;
  padding: 0.55rem 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #888;
}
.step-item .step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
}
.step-item.active {
  background: #fff0f0;
  color: var(--wecar-red);
}
.step-item.active .step-num {
  background: var(--wecar-red);
  color: #fff;
}

.diag-pager {
  overflow: hidden;
  width: 100%;
  position: relative;
  touch-action: pan-y;
}
.diag-pager-track {
  display: flex;
  width: 100%;
  transition: transform 0.28s ease;
  will-change: transform;
}
.diag-page {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  padding-bottom: 0.5rem;
  box-sizing: border-box;
}
.diag-sub-pager {
  overflow: hidden;
  width: 100%;
  touch-action: pan-y;
}
.diag-sub-track {
  display: flex;
  width: 100%;
  transition: transform 0.25s ease;
}
.diag-sub-page {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
}
/* Keep box ratio identical to sedan PNG (828×2832) so % hotspots stay on panels */
.check-view-solo {
  width: min(100%, calc(min(72vh, 640px) * 828 / 2832));
  max-width: 100%;
  height: auto;
  max-height: min(72vh, 640px);
  aspect-ratio: 828 / 2832;
  margin-inline: auto;
}
.check-view-solo .diagram-bg.sedan-frame {
  object-fit: fill;
  object-position: center;
}
.sign-pad {
  width: 100%;
  height: auto;
  display: block;
  border: 2px dashed #ccc;
  border-radius: 10px;
  background: #fff;
  touch-action: none;
}
.sign-preview {
  max-width: 100%;
  max-height: 90px;
  display: block;
  border: 1px solid #eee;
  border-radius: 6px;
  background: #fff;
}
.customer-sign-box {
  min-height: 90px;
  border: 1px dashed #ccc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  padding: 0.5rem;
}
.customer-sign-box img { max-height: 80px; max-width: 100%; }
.sign-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}
.sign-modal:not(.d-none) { display: flex; }
.sign-modal-card {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 16px 16px 8px 8px;
  padding: 1rem;
  margin-bottom: env(safe-area-inset-bottom, 0px);
}
.list-table-wrap { overflow-x: auto; }
.list-table { font-size: 0.8rem; min-width: 860px; }
.list-table th {
  white-space: nowrap;
  background: #f7f7f7;
  font-size: 0.75rem;
}
.view-dots {
  display: none;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.view-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ddd;
}
.view-dot.active { background: var(--wecar-red); }
.view-counter { font-variant-numeric: tabular-nums; }

/* Swipeable diagnosis pager */
.swipe-hint {
  text-align: center;
  font-size: 0.75rem;
  color: #888;
  margin: 0;
}

.photo-slot-touch {
  display: block;
  cursor: pointer;
  margin: 0;
}
.repair-banner {
  background: var(--wecar-red);
  color: #fff;
  font-weight: 800;
  text-align: center;
  padding: 0.55rem;
  border-radius: 8px;
  font-size: 0.95rem;
}
.diag-ref {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.diag-ref img {
  display: block;
  width: 100%;
  height: auto;
}
.ox-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}
.ox-row:last-child { border-bottom: 0; }
.ox-group { display: flex; gap: 0.75rem; }
.ox-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  font-weight: 700;
  min-height: 36px;
}
.checklist-panel .form-label { margin-bottom: 0.2rem; }

.report-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}
.report-fab {
  display: none;
}
@media (max-width: 767px) {
  .container-mobile { padding-left: 0.85rem; padding-right: 0.85rem; }
  .dash-title { font-size: 1.2rem; }
  .dash-tile { min-height: 88px; padding: 0.9rem; }
  .check-cols.view-swipe {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 0;
    scrollbar-width: none;
    touch-action: pan-x;
  }
  .check-cols.view-swipe::-webkit-scrollbar { display: none; }
  .check-cols.view-swipe .check-view-wrap {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    max-height: min(68vh, 560px);
    aspect-ratio: 828 / 2832;
  }
  .view-dots { display: flex; }
  #diag-sub-dots { display: flex; }
  .check-view-solo {
    width: min(100%, calc(min(70vh, 640px) * 828 / 2832));
    max-height: min(70vh, 640px);
    aspect-ratio: 828 / 2832;
  }
  .step-progress.step-5 .step-item { padding: 0.4rem 0.1rem; }
  .hotspot-dot {
    width: 36px;
    height: 36px;
  }
  .hotspot-dot .dot-ring {
    width: 30px;
    height: 30px;
    border-width: 2px;
  }
  .part-popup {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    transform: none;
    width: 100%;
    border-radius: 16px 16px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .part-option { min-height: 48px; }
  .report-fab {
    display: block;
    position: sticky;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    z-index: 90;
    padding: 0.5rem 0;
    background: linear-gradient(180deg, transparent, #f5f5f5 40%);
  }
  .page-diagnosis .bottom-nav { display: none; }
  .page-diagnosis.has-bottom-nav .app-main {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .auth-card { margin: 0 0.25rem; width: 100%; max-width: 420px; }
}
