/* ════════════════════════════════════════
   CSS 변수 & 리셋
════════════════════════════════════════ */
:root {
  /* 색상 */
  --primary:    #0f7fef;
  --primary-dk: #0066cc;
  --primary-lt: #e8f4fd;
  --accent:     #f97316;
  --ok:         #16a34a;
  --ok-lt:      #f0fdf4;
  --warn:       #d97706;
  --warn-lt:    #fffbeb;
  --err:        #dc2626;
  --err-lt:     #fef2f2;

  /* 배경 / 표면 */
  --bg:         #f0f2f5;
  --surface:    #ffffff;
  --surface-2:  #f8f9fb;
  --border:     #e4e7ec;
  --border-dk:  #d1d5db;

  /* 텍스트 */
  --text-1: #111827;
  --text-2: #374151;
  --text-3: #6b7280;
  --text-4: #9ca3af;

  /* 헤더 / 탭 */
  --hdr-bg:  #0d1117;
  --nav-bg:  #161b22;
  --nav-bdr: #21262d;

  /* 치수 */
  --header-h: 54px;
  --nav-h:    44px;
  --aside-w:  360px;

  /* 기타 */
  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 8px rgba(0,0,0,.04);
  --shadow:    0 2px 8px rgba(0,0,0,.08), 0 4px 20px rgba(0,0,0,.05);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
  --transition: .18s cubic-bezier(.4,0,.2,1);
}

/* 다크모드 */
[data-theme="dark"] {
  --bg:        #0d1117;
  --surface:   #161b22;
  --surface-2: #1c2128;
  --border:    #30363d;
  --border-dk: #484f58;
  --text-1:    #e6edf3;
  --text-2:    #c9d1d9;
  --text-3:    #8b949e;
  --text-4:    #6e7681;
  --primary-lt: rgba(15,127,239,.12);
  --ok-lt:      rgba(22,163,74,.12);
  --warn-lt:    rgba(217,119,6,.12);
  --err-lt:     rgba(220,38,38,.12);
  --shadow-sm:  0 1px 3px rgba(0,0,0,.3);
  --shadow:     0 2px 8px rgba(0,0,0,.4);
}

*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html { font-size:14px; -webkit-text-size-adjust:100%; }
body {
  font-family: 'IBM Plex Sans KR', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ════════════════════════════════════════
   헤더
════════════════════════════════════════ */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--hdr-bg);
  z-index: 1000;
  box-shadow: 0 1px 0 rgba(255,255,255,.06);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}
.header-logo { display:flex; align-items:center; gap:10px; }
.logo-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), #0ea5e9);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .95rem;
  box-shadow: 0 2px 8px rgba(15,127,239,.35);
}
.logo-text { display:flex; flex-direction:column; }
.logo-main { color:#fff; font-size:.95rem; font-weight:700; line-height:1.2; letter-spacing:-.3px; }
.logo-main strong { color:#38bdf8; }
.logo-sub { color:rgba(255,255,255,.38); font-size:.65rem; font-weight:400; }
.header-actions { display:flex; align-items:center; gap:8px; }
.btn-icon-only {
  width:32px; height:32px;
  background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.1);
  border-radius:7px; color:rgba(255,255,255,.6); cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  font-size:.8rem; transition:var(--transition);
}
.btn-icon-only:hover { background:rgba(255,255,255,.14); color:#fff; }

/* ════════════════════════════════════════
   탭 네비게이션
════════════════════════════════════════ */
.tab-nav {
  position: fixed;
  top: var(--header-h); left: 0; right: 0;
  height: var(--nav-h);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-bdr);
  z-index: 999;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display:none; }
.tab-nav-inner {
  display: flex;
  height: 100%;
  min-width: max-content;
  padding: 0 4px;
}
.tab-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 0 16px; height: 100%;
  background: none; border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,.45);
  font-family: inherit; font-size: .8rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: var(--transition);
}
.tab-btn i { font-size: .78rem; }
.tab-btn:hover { color: rgba(255,255,255,.8); }
.tab-btn.active { color: #38bdf8; border-bottom-color: #38bdf8; }

/* ════════════════════════════════════════
   페이지 컨테이너
════════════════════════════════════════ */
.page {
  position: fixed;
  top: calc(var(--header-h) + var(--nav-h));
  left: 0; right: 0; bottom: 0;
  display: none;
}
.page.active { display: flex; }
.page-flex.active { display: flex; }
.page-scroll.active {
  display: block;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ════════════════════════════════════════
   콘텐츠 레이아웃 (scroll 페이지용)
════════════════════════════════════════ */
.content-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}
.page-header {
  margin-bottom: 20px;
}
.page-header h2 {
  font-size: 1.25rem; font-weight: 700; color: var(--text-1);
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.page-header h2 i { color: var(--primary); font-size: 1rem; }
.page-header p { font-size: .8rem; color: var(--text-3); }

/* ════════════════════════════════════════
   카드
════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap; gap: 8px;
}
.card-header h3 {
  font-size: .9rem; font-weight: 700; color: var(--text-1);
  display: flex; align-items: center; gap: 7px;
}
.card-header h3 i { color: var(--primary); font-size: .82rem; }
.card-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.card-note { font-size:.7rem; color:var(--text-4); }
.card-desc { font-size:.78rem; color:var(--text-3); line-height:1.65; margin-bottom:12px; }

/* ════════════════════════════════════════
   시뮬레이터 레이아웃
════════════════════════════════════════ */
.sim-aside {
  width: var(--aside-w);
  min-width: var(--aside-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sim-aside::-webkit-scrollbar { width: 3px; }
.sim-aside::-webkit-scrollbar-thumb { background: var(--border-dk); border-radius:4px; }

.aside-toggle {
  display: none; /* 모바일에서만 표시 */
  align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  cursor: pointer; font-size:.82rem; font-weight:600; color:var(--text-2);
  user-select: none;
}
.aside-toggle i { transition: transform .25s; }
.aside-toggle.collapsed i { transform: rotate(-90deg); }

.aside-body { display:flex; flex-direction:column; }

.aside-sec {
  padding: 14px 15px;
  border-bottom: 1px solid var(--border);
}
.aside-sec:last-child { border-bottom: none; }

.sim-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ════════════════════════════════════════
   섹션 타이틀
════════════════════════════════════════ */
.sec-title {
  display: flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 10px;
}
.sec-title i { color: var(--primary); font-size: .72rem; width:12px; }
.sec-badge {
  font-size: .58rem; font-weight: 600; background: var(--primary-lt);
  color: var(--primary); padding: 1px 6px; border-radius: 10px;
  text-transform: none; letter-spacing: 0; margin-left: auto;
}
.sec-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; gap: 6px;
}
.sec-title-row .sec-title { margin-bottom: 0; }

/* ════════════════════════════════════════
   차량 그리드
════════════════════════════════════════ */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.vehicle-card {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px 7px 8px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  background: var(--surface-2);
  position: relative;
  user-select: none;
}
.vehicle-card:hover {
  border-color: var(--primary);
  background: var(--primary-lt);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.vehicle-card.active {
  border-color: var(--primary);
  background: var(--primary-lt);
  box-shadow: 0 0 0 3px rgba(15,127,239,.12);
}
.vehicle-card.active::after {
  content: '✓';
  position: absolute; top: 3px; right: 6px;
  color: var(--primary); font-size: .65rem; font-weight: 800;
}
/* SVG 일러스트 */
.vc-svg {
  display: block;
  width: 100%;
  height: 52px;
  margin-bottom: 6px;
}
.vc-name { font-size: .68rem; font-weight: 700; color: var(--text-2); margin: 0 0 1px; line-height: 1.25; }
.vc-type { font-size: .58rem; color: var(--text-4); }
.vc-max { font-size: .63rem; font-weight: 600; color: var(--primary); margin-top: 1px; }

/* ════════════════════════════════════════
   스펙 입력
════════════════════════════════════════ */
.spec-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}
.spec-field { display: flex; flex-direction: column; gap: 3px; }
.spec-field-full { grid-column: span 2; }
.spec-field label { font-size: .67rem; font-weight: 600; color: var(--text-3); }
.spec-input-wrap { display: flex; align-items: center; gap: 4px; }
.spec-input {
  flex: 1; min-width: 0;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 5px; padding: 4px 6px;
  font-family: 'IBM Plex Mono', monospace; font-size: .78rem; font-weight: 600;
  color: var(--text-1); text-align: center;
  transition: var(--transition);
}
.spec-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(15,127,239,.1); }
.spec-unit { font-size: .65rem; color: var(--text-4); flex-shrink: 0; width: 14px; }
.spec-highlight .spec-input { background: var(--primary-lt); border-color: rgba(15,127,239,.3); color: var(--primary); font-weight: 700; }

/* ════════════════════════════════════════
   폼 요소
════════════════════════════════════════ */
.form-group { margin-bottom: 8px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { display: block; font-size: .72rem; font-weight: 600; color: var(--text-3); margin-bottom: 4px; }
.form-input {
  width: 100%;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 7px; padding: 8px 10px;
  font-family: inherit; font-size: .8rem; color: var(--text-1);
  caret-color: var(--text-1);
  -webkit-text-fill-color: var(--text-1);
  opacity: 1;
  transition: var(--transition);
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,127,239,.1); }
.form-input::placeholder { color: var(--text-4); }
.form-input[readonly] { background: var(--surface-2); color: var(--text-3); cursor: default; -webkit-text-fill-color: var(--text-3); }
.form-input[type='number'],
.qty-input[type='number'] { font-variant-numeric: tabular-nums; }
.mono { font-family: 'IBM Plex Mono', monospace !important; }

/* 단위 선택 */
.unit-selector {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 9px;
}
.unit-label { font-size: .7rem; color: var(--text-3); white-space: nowrap; }
.unit-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.unit-btn {
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 5px; padding: 3px 10px;
  font-family: inherit; font-size: .72rem; font-weight: 600;
  color: var(--text-3); cursor: pointer; transition: var(--transition);
  white-space: nowrap;
}
.unit-btn:hover { border-color: var(--primary); color: var(--primary); }
.unit-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 치수 그리드 */
.dim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 9px;
}
.input-unit-wrap { position: relative; display: flex; align-items: center; }
.input-unit-wrap .form-input { padding-right: 38px; }
.input-unit-badge {
  position: absolute; right: 10px;
  font-size: .65rem; font-weight: 700; color: var(--text-4); pointer-events: none;
}

/* 수량 컨트롤 */
.qty-control {
  display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: 7px; overflow: hidden;
  background: var(--surface);
  transition: var(--transition);
}
.qty-control:focus-within { border-color: var(--primary); }
.qty-btn {
  width: 34px; height: 36px; flex-shrink: 0;
  background: var(--surface-2); border: none;
  font-size: 1.05rem; font-weight: 700; cursor: pointer;
  color: var(--text-2); transition: var(--transition);
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.qty-btn:hover { background: var(--primary); color: #fff; }
.qty-btn:active { transform: scale(.9); }
.qty-input {
  flex: 1; min-width: 0; border: none; background: transparent;
  text-align: center; font-family: 'IBM Plex Mono', monospace;
  font-size: .85rem; font-weight: 700; color: var(--text-1);
  caret-color: var(--text-1);
  -webkit-text-fill-color: var(--text-1);
  opacity: 1;
  padding: 0 4px;
}
.qty-input:focus { outline: none; }

/* 색상 스와치 */
.color-row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.color-swatches { display: flex; gap: 5px; flex-wrap: wrap; margin-left: auto; }
.swatch {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid transparent; cursor: pointer;
  transition: var(--transition); flex-shrink: 0;
}
.swatch:hover { transform: scale(1.12); }
.swatch.active { border-color: var(--text-1); transform: scale(1.15); box-shadow: 0 0 0 2px var(--surface); }

/* 피드백 */
.fit-feedback {
  font-size: .7rem; font-weight: 600; padding: 6px 10px;
  border-radius: 6px; margin-bottom: 8px;
  display: none;
}
.fit-feedback.ok  { display:block; background:var(--ok-lt);   color:#15803d; border:1px solid #bbf7d0; }
.fit-feedback.warn{ display:block; background:var(--warn-lt); color:#b45309; border:1px solid #fde68a; }
.fit-feedback.over{ display:block; background:var(--err-lt);  color:#b91c1c; border:1px solid #fecaca; }

.weight-alert {
  display: flex; align-items: center; gap: 6px;
  background: var(--err-lt); color: #b91c1c;
  border: 1px solid #fecaca; border-radius: 6px;
  padding: 6px 10px; font-size: .7rem; font-weight: 600;
  margin-bottom: 8px;
}
.weight-alert.hidden { display: none; }

/* ════════════════════════════════════════
   버튼
════════════════════════════════════════ */
.btn-primary {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--primary); color: #fff; border: none;
  border-radius: 8px; padding: 10px 16px;
  font-family: inherit; font-size: .82rem; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.btn-primary:hover { background: var(--primary-dk); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(15,127,239,.3); }
.btn-primary:active { transform: none; box-shadow: none; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--surface-2); color: var(--text-2); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 8px 14px;
  font-family: inherit; font-size: .8rem; font-weight: 600;
  cursor: pointer; transition: var(--transition);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-lt); }

.btn-apply {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--surface-2); color: var(--text-2); border: 1.5px solid var(--border);
  border-radius: 7px; padding: 7px;
  font-family: inherit; font-size: .75rem; font-weight: 700;
  cursor: pointer; transition: var(--transition);
}
.btn-apply:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.btn-sm {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 5px; padding: 4px 10px;
  font-family: inherit; font-size: .7rem; font-weight: 600;
  cursor: pointer; color: var(--text-2); transition: var(--transition);
  white-space: nowrap;
}
.btn-sm:hover { background: var(--surface); border-color: var(--border-dk); }
.btn-green { color: #16a34a; }
.btn-green:hover { background: var(--ok-lt); border-color: #86efac; color: #15803d; }
.btn-red { color: var(--err); padding: 4px 8px; }
.btn-red:hover { background: var(--err-lt); border-color: #fca5a5; }

.btn-group {
  display: flex; gap: 8px; margin-top: 4px;
  flex-wrap: wrap;
}
.btn-group .btn-primary,
.btn-group .btn-secondary { flex: 1; min-width: 0; }

/* ════════════════════════════════════════
   화물 목록
════════════════════════════════════════ */
.cargo-list { display: flex; flex-direction: column; gap: 4px; }
.empty-state {
  text-align: center; padding: 24px 16px; color: var(--text-4);
}
.empty-state i { font-size: 1.8rem; display: block; margin-bottom: 6px; opacity:.5; }
.empty-state p { font-size: .75rem; }

.cargo-item {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 9px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; transition: var(--transition);
}
.cargo-item:hover { border-color: var(--border-dk); }
.ci-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.ci-info { flex: 1; min-width: 0; }
.ci-name { font-size: .74rem; font-weight: 700; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-detail { font-size: .65rem; color: var(--text-4); }
.ci-wgt { font-size: .63rem; color: var(--text-3); }
.ci-qty {
  display: flex; align-items: center; gap: 2px; flex-shrink: 0;
}
.ci-qty-btn {
  width: 20px; height: 20px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 4px; font-size: .8rem; cursor: pointer; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.ci-qty-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.ci-qty-num { font-size: .7rem; font-weight: 700; width: 22px; text-align: center; font-family: 'IBM Plex Mono', monospace; }
.ci-cbm { font-size: .72rem; font-weight: 700; color: var(--primary); font-family: 'IBM Plex Mono', monospace; flex-shrink: 0; }
.ci-remove {
  background: none; border: none; color: var(--text-4);
  cursor: pointer; padding: 2px 3px; border-radius: 4px;
  transition: var(--transition); flex-shrink: 0;
}
.ci-remove:hover { color: var(--err); background: var(--err-lt); }

/* ════════════════════════════════════════
   시뮬레이터 결과 대시보드
════════════════════════════════════════ */
.result-dashboard {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.result-card {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  border-right: 1px solid var(--border);
}
.result-card:last-child { border-right: none; }
.result-icon {
  width: 30px; height: 30px; border-radius: 7px;
  background: var(--primary-lt); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; flex-shrink: 0;
}
.result-info { min-width: 0; }
.result-label { display: block; font-size: .62rem; color: var(--text-4); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap; }
.result-value { display: block; font-size: .85rem; font-weight: 800; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-value.ok   { color: var(--ok); }
.result-value.warn { color: var(--warn); }
.result-value.err  { color: var(--err); }

.result-status.ok   .result-icon { background: var(--ok-lt);   color: var(--ok); }
.result-status.warn .result-icon { background: var(--warn-lt); color: var(--warn); }
.result-status.err  .result-icon { background: var(--err-lt);  color: var(--err); }

/* 적재율 바 */
.load-bar-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 7px 14px; flex-shrink: 0;
}
.load-bar-track { flex: 1; background: var(--surface-2); border-radius: 6px; height: 8px; overflow: hidden; border: 1px solid var(--border); }
.load-bar-fill { height: 100%; border-radius: 6px; background: var(--ok); transition: width .4s ease, background .3s; }
.load-bar-fill.warn { background: var(--warn); }
.load-bar-fill.err  { background: var(--err); }
.load-bar-text { font-size: .72rem; font-weight: 700; font-family: 'IBM Plex Mono', monospace; color: var(--text-3); min-width: 38px; text-align: right; }

/* ════════════════════════════════════════
   뷰 탭
════════════════════════════════════════ */
.view-tab-bar {
  display: flex; align-items: center;
  background: var(--surface); border-bottom: 1px solid var(--border);
  flex-shrink: 0; overflow-x: auto; scrollbar-width: none;
}
.view-tab-bar::-webkit-scrollbar { display: none; }
.view-tab {
  display: flex; align-items: center; gap: 5px;
  padding: 9px 14px; background: none; border: none;
  border-bottom: 2px solid transparent;
  font-family: inherit; font-size: .75rem; font-weight: 600;
  color: var(--text-3); cursor: pointer; white-space: nowrap;
  transition: var(--transition);
}
.view-tab:hover { color: var(--text-1); }
.view-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.view-tab-actions {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto; padding: 0 10px; flex-shrink: 0;
}
.btn-view-action {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 8px;
  font-family: inherit; font-size: .7rem; font-weight: 600;
  cursor: pointer; color: var(--text-2); transition: var(--transition);
  white-space: nowrap;
}
.btn-view-action:hover { background: var(--primary-lt); color: var(--primary); border-color: rgba(15,127,239,.3); }
.btn-text { display: inline; }

/* 뷰 패널 */
.view-panel { flex: 1; display: none; overflow: hidden; position: relative; min-height: 0; }
.view-panel.active { display: flex; flex-direction: column; }
.canvas-3d-wrap { flex: 1; position: relative; min-height: 0; }
.canvas-3d-wrap canvas { width: 100% !important; height: 100% !important; display: block; }
.canvas-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  background: rgba(0,0,0,.56);
  color: rgba(255,255,255,.84);
  font-size: .64rem;
  line-height: 1.45;
  padding: 7px 13px;
  border-radius: 16px;
  text-align: center;
  max-width: min(calc(100% - 24px), 760px);
  pointer-events: none;
  white-space: normal;
  word-break: keep-all;
  box-sizing: border-box;
  backdrop-filter: blur(4px);
}
.no-vehicle-msg {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: rgba(255,255,255,.2); gap: 10px; text-align: center;
  pointer-events: none;
}
.no-vehicle-msg i { font-size: 2.8rem; }
.no-vehicle-msg p { font-size: .82rem; }
.no-vehicle-msg.hidden { display: none; }

.canvas-2d-wrap { flex: 1; position: relative; overflow: hidden; background: var(--surface-2); }
.canvas-2d-wrap canvas { display: block; }

/* 범례 */
.view-legend {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 5px 12px; display: flex; flex-wrap: wrap; gap: 8px;
  flex-shrink: 0; min-height: 28px;
}
.legend-item { display: flex; align-items: center; gap: 5px; font-size: .65rem; color: var(--text-3); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ════════════════════════════════════════
   CBM 계산기 레이아웃
════════════════════════════════════════ */
.cbm-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 16px;
  align-items: start;
}
.cbm-right-col { display: flex; flex-direction: column; gap: 14px; }

/* CBM 미리보기 */
.cbm-preview {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
  margin-bottom: 10px;
}
.cbm-preview.hidden { display: none; }
.preview-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .74rem; color: var(--text-3); margin-bottom: 4px;
}
.preview-row:last-child { margin-bottom: 0; }
.preview-row .mono { color: var(--primary); font-weight: 700; font-size: .8rem; }
.preview-row-total { border-top: 1px dashed var(--border); padding-top: 5px; margin-top: 5px; font-weight: 700; }
.preview-row-total .mono { font-size: .9rem; color: var(--text-1); }

/* 품목 목록 */
.list-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 0 7px; border-top: 1px solid var(--border); padding-top: 12px;
}
.list-title { font-size: .75rem; font-weight: 700; color: var(--text-2); }
.cbm-item-list { display: flex; flex-direction: column; gap: 4px; }
.cbm-item {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 9px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px;
}
.cbm-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cbm-info { flex: 1; min-width: 0; }
.cbm-name { font-size: .73rem; font-weight: 700; color: var(--text-1); }
.cbm-dim { font-size: .64rem; color: var(--text-4); }
.cbm-result { text-align: right; flex-shrink: 0; }
.cbm-val { font-size: .75rem; font-weight: 800; color: var(--primary); font-family: 'IBM Plex Mono', monospace; }
.cbm-each { font-size: .62rem; color: var(--text-4); }

/* 합계 */
.cbm-summary {
  background: linear-gradient(135deg, var(--primary-lt), var(--ok-lt));
  border: 1px solid rgba(15,127,239,.15);
  border-radius: 8px; padding: 11px 12px; margin-top: 10px;
}
.cbm-summary.hidden { display: none; }
.summary-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .74rem; color: var(--text-3); margin-bottom: 5px;
}
.summary-row .mono { font-weight: 700; color: var(--text-1); }
.summary-total {
  border-top: 1px solid rgba(15,127,239,.2);
  padding-top: 7px; margin-top: 4px; margin-bottom: 0;
  font-weight: 700; color: var(--text-1);
}
.summary-total .mono { font-size: 1rem; color: var(--primary); }

/* 정보 */
.info-content { font-size: .75rem; color: var(--text-3); line-height: 1.7; }
.info-formula {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 12px;
  font-family: 'IBM Plex Mono', monospace; font-size: .78rem;
  color: var(--text-1); font-weight: 600; margin-bottom: 10px;
  text-align: center;
}
.info-list { padding-left: 1rem; margin-bottom: 10px; }
.info-list li { margin-bottom: 4px; }
.info-block { margin-bottom: 10px; }
.info-block:last-child { margin-bottom: 0; }
.info-block strong { color: var(--text-1); display: block; margin-bottom: 2px; }
.info-block p { color: var(--text-3); font-size: .73rem; }
.unit-convert-table { font-family: 'IBM Plex Mono', monospace; font-size: .72rem; }
.uc-row { display: grid; grid-template-columns: 40px 16px 1fr; gap: 4px; padding: 2px 0; color: var(--text-3); }

/* 차량 비교 그리드 */
.vehicle-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.vc-compare-card {
  border: 1.5px solid var(--border);
  border-radius: 8px; padding: 10px 11px;
  background: var(--surface-2);
  transition: var(--transition);
}
.vc-compare-card.ok   { border-color: #86efac; background: var(--ok-lt); }
.vc-compare-card.warn { border-color: #fcd34d; background: var(--warn-lt); }
.vc-compare-card.err  { border-color: #fca5a5; background: var(--err-lt); }
.vcc-header { display: flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.vcc-emoji { font-size: 1.05rem; }
.vcc-vehicle-mark {
  width: 16px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  line-height: 1;
}
.vcc-name { font-size: .72rem; font-weight: 700; color: var(--text-2); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcc-badge {
  font-size: .6rem; font-weight: 700; padding: 1px 6px; border-radius: 10px; flex-shrink: 0;
}
.vcc-badge.ok   { background: #dcfce7; color: #15803d; }
.vcc-badge.warn { background: #fef3c7; color: #92400e; }
.vcc-badge.err  { background: #fee2e2; color: #991b1b; }
.vcc-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2px 6px; font-size: .63rem; margin-bottom: 6px;
}
.vcc-sl { color: var(--text-4); }
.vcc-sv { font-weight: 700; color: var(--text-2); font-family: 'IBM Plex Mono', monospace; }
.vcc-bar-bg { background: rgba(0,0,0,.06); border-radius: 3px; height: 4px; overflow: hidden; margin-bottom: 3px; }
.vcc-bar { height: 100%; border-radius: 3px; background: var(--ok); transition: width .4s; }
.vcc-bar.warn { background: var(--warn); }
.vcc-bar.err  { background: var(--err); }
.vcc-rate { font-size: .65rem; font-weight: 700; font-family: 'IBM Plex Mono', monospace; }
.vcc-rate.ok   { color: var(--ok); }
.vcc-rate.warn { color: var(--warn); }
.vcc-rate.err  { color: var(--err); }

/* ════════════════════════════════════════
   운임 계산기
════════════════════════════════════════ */
.fare-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.fare-input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.fare-result {
  background: var(--hdr-bg); border-radius: 10px;
  padding: 14px; margin-top: 14px;
}
.fare-result.hidden { display: none; }
.fare-result-row {
  display: flex; justify-content: space-between; align-items: center;
  color: rgba(255,255,255,.55); font-size: .74rem;
  padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.06);
}
.fare-result-row:last-child { border-bottom: none; }
.fare-result-row .mono { color: rgba(255,255,255,.7); font-size: .76rem; }
.fare-total-row { border-top: 1px solid rgba(255,255,255,.15) !important; padding-top: 10px; margin-top: 4px; }
.fare-total-row span:first-child { color: #fff; font-weight: 700; }
.fare-total-row .mono { color: #38bdf8; font-size: 1.1rem; font-weight: 800; }

/* ════════════════════════════════════════
   템플릿
════════════════════════════════════════ */
.tpl-layout { display: flex; flex-direction: column; gap: 14px; }
.tpl-list { display: flex; flex-direction: column; gap: 5px; }
.tpl-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--surface-2); cursor: pointer;
  transition: var(--transition);
}
.tpl-item:hover { border-color: var(--primary); background: var(--primary-lt); transform: translateX(2px); }
.tpl-icon { font-size: 1.2rem; }
.tpl-info { flex: 1; min-width: 0; }
.tpl-name { font-size: .78rem; font-weight: 700; color: var(--text-1); }
.tpl-meta { font-size: .66rem; color: var(--text-4); }
.tpl-del { background: none; border: none; color: var(--text-4); cursor: pointer; padding: 4px; border-radius: 4px; transition: var(--transition); }
.tpl-del:hover { color: var(--err); background: var(--err-lt); }

/* ════════════════════════════════════════
   공유 / PDF
════════════════════════════════════════ */
.content-wrap-narrow { max-width: 860px; }
.share-url-card { margin-bottom: 14px; }
.share-url-card .btn-primary { width: auto; min-width: 200px; }
.pdf-form-card { grid-column: unset; }
.share-url-box {
  display: flex; gap: 8px; margin-top: 12px; align-items: center;
}
.share-url-box.hidden { display: none; }
.share-url-input {
  flex: 1; background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 7px; padding: 9px 12px; font-size: .76rem; color: var(--text-2);
  min-width: 0;
}
#pdfPreviewContent { font-size: .8rem; color: var(--text-2); line-height: 1.75; }
#pdfPreviewContent h3 { font-size: 1rem; margin-bottom: 8px; color: var(--text-1); }
#pdfPreviewContent table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: .75rem; }
#pdfPreviewContent th { background: var(--surface-2); padding: 6px 8px; text-align: left; font-weight: 700; border-bottom: 2px solid var(--border); }
#pdfPreviewContent td { padding: 5px 8px; border-bottom: 1px solid var(--border); color: var(--text-3); }
#pdfPreviewContent tfoot td { font-weight: 700; color: var(--text-1); border-top: 2px solid var(--border); border-bottom: none; }

/* ════════════════════════════════════════
   토스트
════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 20px; left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--hdr-bg); color: #fff;
  padding: 9px 18px; border-radius: 25px;
  font-size: .76rem; font-weight: 600;
  z-index: 9999; opacity: 0;
  transition: all .28s cubic-bezier(.34,1.56,.64,1);
  display: flex; align-items: center; gap: 7px;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  white-space: nowrap; pointer-events: none;
  border: 1px solid rgba(255,255,255,.08);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ════════════════════════════════════════
   모달
════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5); backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  width: 100%; max-width: 360px;
  box-shadow: var(--shadow-lg);
  animation: modalIn .2s cubic-bezier(.34,1.56,.64,1);
}
@keyframes modalIn { from { opacity:0; transform:scale(.92); } to { opacity:1; transform:scale(1); } }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.modal-header h3 { font-size: .9rem; font-weight: 700; color: var(--text-1); display: flex; align-items: center; gap: 7px; }
.modal-header h3 i { color: var(--primary); }
.modal-close { background: none; border: none; color: var(--text-3); cursor: pointer; padding: 3px; font-size: .85rem; border-radius: 4px; transition: var(--transition); }
.modal-close:hover { color: var(--err); }
.modal-body { margin-bottom: 14px; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; }
.modal-footer .btn-primary { width: auto; flex: none; }
.modal-footer .btn-secondary { width: auto; flex: none; }

.hidden { display: none !important; }

/* ════════════════════════════════════════
   유틸리티
════════════════════════════════════════ */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance:none; }
input[type=number] { -moz-appearance: textfield; }

/* ════════════════════════════════════════
   반응형 - 태블릿 (≤900px)
════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --aside-w: 320px; }

  .result-dashboard { grid-template-columns: repeat(3, 1fr); }
  .result-card:nth-child(4),
  .result-card:nth-child(5) { border-top: 1px solid var(--border); }

  .cbm-layout { grid-template-columns: 1fr; }
  .fare-layout { grid-template-columns: 1fr; }
  .share-layout { grid-template-columns: 1fr; }
  .vehicle-compare-grid { grid-template-columns: repeat(2, 1fr); }
  .btn-text { display: none; }
}

/* ════════════════════════════════════════
   반응형 - 모바일 (≤600px)
════════════════════════════════════════ */
@media (max-width: 600px) {
  :root {
    --header-h: 50px;
    --nav-h: 42px;
  }
  html { font-size: 13px; }

  /* 시뮬레이터: 세로 레이아웃으로 전환 */
  .page-flex.active { flex-direction: column; overflow: hidden; }

  .sim-aside {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    max-height: none;
    flex-shrink: 0;
  }
  .aside-toggle { display: flex; }
  .aside-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
  .aside-body.open { max-height: 70vh; overflow-y: auto; }

  .sim-main { flex: 1; min-height: 0; }

  /* 결과 대시보드 */
  .result-dashboard { grid-template-columns: repeat(2, 1fr); }
  .result-card:last-child { grid-column: span 2; border-top: 1px solid var(--border); }

  /* 뷰 탭 */
  .view-tab-bar { gap: 0; }
  .view-tab { padding: 8px 10px; font-size: .7rem; }
  .btn-view-action { padding: 4px 6px; font-size: .68rem; }
  .canvas-hint {
    bottom: 8px;
    max-width: calc(100% - 16px);
    padding: 6px 10px;
    font-size: .6rem;
  }

  /* 차량 그리드 */
  .vehicle-grid { grid-template-columns: repeat(3, 1fr); }

  /* 탭 아이콘만 표시 */
  .tab-btn span { display: none; }
  .tab-btn { padding: 0 14px; }

  /* 카드 패딩 줄이기 */
  .card { padding: 14px 12px; }
  .content-wrap { padding: 16px 12px 32px; }

  /* 차량 비교 그리드 */
  .vehicle-compare-grid { grid-template-columns: 1fr 1fr; }

  /* 운임 입력 */
  .fare-input-grid { grid-template-columns: 1fr; }

  /* 버튼 그룹 */
  .btn-group { flex-direction: column; }

  /* 스펙 그리드 */
  .spec-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .result-dashboard { grid-template-columns: 1fr 1fr; }
  .vehicle-compare-grid { grid-template-columns: 1fr; }
  .vehicle-grid { grid-template-columns: repeat(2, 1fr); }
  .tab-btn { padding: 0 11px; }
}

/* ════════════════════════════════════════
   인쇄 스타일 (PDF)
════════════════════════════════════════ */
@media print {
  .header, .tab-nav, #pdfPreviewCard .card-header button,
  .btn-primary, .btn-secondary { display: none !important; }
  .page { position: static !important; display: block !important; height: auto !important; overflow: visible !important; }
  #page-share { display: block !important; }
  #pdfPreviewCard { display: block !important; border: none !important; box-shadow: none !important; }
  body { background: #fff !important; color: #000 !important; }
}

/* ════════════════════════════════════════
   PDF 견적서 폼
════════════════════════════════════════ */
.pdf-form-card { grid-column: span 2; }
.pdf-form-section { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.pdf-form-section:last-of-type { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.pdf-form-section-title { font-size: .72rem; font-weight: 700; color: var(--text-3); margin-bottom: 10px; letter-spacing: .3px; }
.pdf-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (max-width: 600px) { .pdf-form-grid { grid-template-columns: 1fr; } .pdf-form-card { grid-column: span 1; } }

/* PDF 미리보기 툴바 */
.pdf-preview-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--hdr-bg); color: rgba(255,255,255,.7);
  padding: 10px 18px; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  font-size: .78rem; font-weight: 600; margin-top: 20px;
  flex-wrap: wrap; gap: 8px;
}
.pdf-preview-toolbar i { color: #38bdf8; margin-right: 6px; }

/* A4 페이지 래퍼 */
.pdf-page-wrap {
  background: #6b7280;
  padding: 32px 20px;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow-x: auto;
}

/* ── 실제 견적서 A4 페이지 ── */
.pdf-page {
  width: 794px; /* A4 96dpi */
  min-height: 1123px;
  background: #ffffff;
  margin: 0 auto;
  padding: 0;
  font-family: 'IBM Plex Sans KR', 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', '맑은 고딕', sans-serif;
  font-size: 11pt;
  color: #1a1a2e;
  box-shadow: 0 4px 32px rgba(0,0,0,.35);
  position: relative;
  overflow: hidden;
  word-break: keep-all;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* 견적서 상단 헤더 띠 */
.q-header {
  background: linear-gradient(135deg, #0d1b2a 0%, #1b2838 50%, #0f3460 100%);
  padding: 28px 36px 22px;
  position: relative;
  overflow: hidden;
}
.q-header::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #0f7fef, #38bdf8, #0ea5e9);
}
.q-header-inner { display: flex; align-items: flex-start; justify-content: space-between; }
.q-company-block { flex: 1; }
.q-company-name { font-size: 18pt; font-weight: 800; color: #ffffff; letter-spacing: -.5px; line-height: 1.1; }
.q-company-name span { color: #38bdf8; }
.q-company-sub { font-size: 8.5pt; color: rgba(255,255,255,.45); margin-top: 4px; }
.q-title-block { text-align: right; }
.q-title-main { font-size: 26pt; font-weight: 900; color: #ffffff; letter-spacing: -1px; line-height: 1; }
.q-title-sub { font-size: 8pt; color: rgba(255,255,255,.4); letter-spacing: 4px; text-transform: uppercase; margin-top: 4px; }
.q-doc-no { font-size: 8pt; color: #38bdf8; font-family: 'IBM Plex Mono', monospace; margin-top: 6px; }

/* 문서 정보 바 */
.q-info-bar {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #f8f9fb; border-bottom: 2px solid #e4e7ec;
  padding: 0;
}
.q-info-cell {
  padding: 10px 16px; border-right: 1px solid #e4e7ec;
  display: flex; flex-direction: column; gap: 2px;
}
.q-info-cell:last-child { border-right: none; }
.q-info-label { font-size: 7pt; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .5px; }
.q-info-value { font-size: 9.5pt; font-weight: 700; color: #1a1a2e; }

/* 수신/발신 섹션 */
.q-parties { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid #e4e7ec; }
.q-party { padding: 18px 24px; }
.q-party:first-child { border-right: 1px solid #e4e7ec; }
.q-party-badge {
  display: inline-block; font-size: 7pt; font-weight: 800; padding: 2px 8px;
  border-radius: 10px; margin-bottom: 8px; letter-spacing: .5px;
}
.q-party-badge.to { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.q-party-badge.from { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.q-party-name { font-size: 13pt; font-weight: 800; color: #111827; margin-bottom: 4px; }
.q-party-detail { font-size: 8.5pt; color: #6b7280; line-height: 1.7; }

/* 운송 정보 바 */
.q-route-bar {
  display: flex; align-items: center;
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border-bottom: 1px solid #e4e7ec;
  padding: 12px 24px; gap: 0;
}
.q-route-item { flex: 1; text-align: center; padding: 0 12px; }
.q-route-item:not(:last-child) { border-right: 1px dashed #cbd5e1; }
.q-route-label { font-size: 7pt; font-weight: 700; color: #9ca3af; text-transform: uppercase; margin-bottom: 2px; }
.q-route-value { font-size: 9.5pt; font-weight: 700; color: #1e3a5f; }
.q-route-arrow { font-size: 14pt; color: #0f7fef; padding: 0 8px; flex-shrink: 0; }

/* 섹션 타이틀 */
.q-section { padding: 0 24px 18px; }
.q-section-title {
  font-size: 9pt; font-weight: 800; color: #0f3460;
  padding: 10px 0 8px; border-bottom: 2px solid #0f3460;
  margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
  letter-spacing: .3px;
}
.q-section-title .q-stitle-icon {
  width: 18px; height: 18px; background: #0f3460; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  color: white; font-size: 8pt;
}

/* 화물 명세 테이블 */
.q-table { width: 100%; border-collapse: collapse; font-size: 9pt; }
.q-table thead tr { background: #1b2838; }
.q-table thead th {
  padding: 8px 10px; color: #ffffff; font-weight: 700;
  font-size: 8pt; text-align: left; letter-spacing: .3px;
}
.q-table thead th:nth-child(n+3) { text-align: right; }
.q-table tbody tr { border-bottom: 1px solid #f1f5f9; }
.q-table tbody tr:nth-child(even) { background: #fafbfc; }
.q-table tbody tr:hover { background: #eff6ff; }
.q-table tbody td { padding: 7px 10px; color: #374151; vertical-align: middle; }
.q-table tbody td:nth-child(n+3) { text-align: right; font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.q-table tbody td .cargo-color-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: middle; flex-shrink: 0;
}
.q-table tfoot tr { background: #1b2838; border-top: 2px solid #0f7fef; }
.q-table tfoot td {
  padding: 8px 10px; color: #ffffff; font-weight: 800;
  font-size: 9pt; font-family: 'IBM Plex Mono', monospace;
}
.q-table tfoot td:first-child { color: rgba(255,255,255,.7); font-family: inherit; }

/* CBM / 차량 요약 */
.q-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 0; }
.q-summary-box {
  background: #f8f9fb; border: 1px solid #e4e7ec; border-radius: 6px; padding: 12px 14px;
}
.q-summary-box.highlight { background: linear-gradient(135deg, #eff6ff, #e0f2fe); border-color: #bfdbfe; }
.q-summary-label { font-size: 7.5pt; font-weight: 700; color: #9ca3af; text-transform: uppercase; margin-bottom: 6px; }
.q-summary-stat { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.q-summary-stat:last-child { margin-bottom: 0; }
.q-summary-stat-label { font-size: 8.5pt; color: #6b7280; }
.q-summary-stat-value { font-size: 10pt; font-weight: 800; color: #1e3a5f; font-family: 'IBM Plex Mono', monospace; }
.q-summary-stat-value.accent { color: #0f7fef; font-size: 12pt; }

/* 차량 적재 분석 */
.q-vehicle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.q-v-card {
  border: 1px solid #e4e7ec; border-radius: 5px; padding: 8px 10px;
  background: #fafbfc;
}
.q-v-card.ok   { border-color: #86efac; background: #f0fdf4; }
.q-v-card.warn { border-color: #fcd34d; background: #fffbeb; }
.q-v-card.err  { border-color: #fca5a5; background: #fef2f2; }
.q-v-name { font-size: 8pt; font-weight: 700; color: #1e3a5f; margin-bottom: 4px; }
.q-v-rate-bar { height: 4px; background: #e4e7ec; border-radius: 2px; margin-bottom: 3px; overflow: hidden; }
.q-v-rate-fill { height: 100%; border-radius: 2px; background: #16a34a; }
.q-v-rate-fill.warn { background: #d97706; }
.q-v-rate-fill.err  { background: #dc2626; }
.q-v-stats { display: flex; justify-content: space-between; font-size: 7pt; }
.q-v-stat-rate { font-weight: 800; }
.q-v-stat-rate.ok   { color: #15803d; }
.q-v-stat-rate.warn { color: #b45309; }
.q-v-stat-rate.err  { color: #b91c1c; }
.q-v-stat-cbm { color: #9ca3af; }

/* 운임 박스 */
.q-price-box {
  background: linear-gradient(135deg, #0d1b2a, #1b2838);
  border-radius: 6px; padding: 14px 18px; color: white;
}
.q-price-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 5px; font-size: 8.5pt; color: rgba(255,255,255,.6); }
.q-price-row:last-child { margin-bottom: 0; border-top: 1px solid rgba(255,255,255,.1); padding-top: 8px; margin-top: 4px; }
.q-price-row .val { font-family: 'IBM Plex Mono', monospace; font-weight: 700; color: rgba(255,255,255,.85); }
.q-price-total-label { color: white; font-weight: 700; font-size: 9.5pt; }
.q-price-total-val { font-family: 'IBM Plex Mono', monospace; font-size: 14pt; font-weight: 900; color: #38bdf8; }

/* 특기사항 */
.q-notes {
  background: #fafbfc; border: 1px solid #e4e7ec; border-left: 3px solid #0f7fef;
  border-radius: 0 5px 5px 0; padding: 10px 14px;
  font-size: 8.5pt; color: #374151; line-height: 1.8; white-space: pre-line;
}

/* 서명란 */
.q-sign-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.q-sign-box { border: 1px solid #e4e7ec; border-radius: 5px; overflow: hidden; }
.q-sign-title { background: #f8f9fb; padding: 6px 12px; font-size: 8pt; font-weight: 700; color: #6b7280; border-bottom: 1px solid #e4e7ec; }
.q-sign-body { height: 70px; padding: 8px 12px; display: flex; flex-direction: column; justify-content: space-between; }
.q-sign-name { font-size: 11pt; font-weight: 700; color: #1e3a5f; }
.q-sign-stamp { font-size: 7.5pt; color: #9ca3af; }

/* 푸터 */
.q-footer {
  background: #f8f9fb; border-top: 1px solid #e4e7ec;
  padding: 10px 24px; display: flex; justify-content: space-between; align-items: center;
  font-size: 7.5pt; color: #9ca3af;
}
.q-footer-left { line-height: 1.6; }
.q-footer-right { text-align: right; }
.q-footer strong { color: #6b7280; }

/* ── 인쇄 스타일 ── */
@media print {
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  body > *:not(#page-share) { display: none !important; }
  #page-share {
    position: static !important; display: block !important;
    height: auto !important; overflow: visible !important;
  }
  .header, .tab-nav, .page-header,
  .share-url-card, .pdf-preview-toolbar, .btn-group,
  .pdf-form-card, .card-actions, #shareUrlBox { display: none !important; }
  #pdfPreviewCard { display: block !important; }
  .pdf-page-wrap { background: none !important; padding: 0 !important; }
  .pdf-page {
    box-shadow: none !important;
    width: 100% !important;
    margin: 0 !important;
    font-family: 'Malgun Gothic','Apple SD Gothic Neo','맑은 고딕',sans-serif !important;
  }
  .content-wrap, .content-wrap-narrow { padding: 0 !important; max-width: 100% !important; }
  @page { margin: 0; size: A4; }
}

/* ════════════════════════════════════════
   치수 텍스트 자동 파싱
════════════════════════════════════════ */
.parse-row {
  display: flex; gap: 6px; margin-bottom: 6px; align-items: center;
}
.parse-input {
  flex: 1; min-width: 0; font-size: .75rem !important;
}
.btn-parse {
  flex-shrink: 0; background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff; border: none; border-radius: 7px;
  padding: 8px 11px; font-family: inherit; font-size: .72rem; font-weight: 700;
  cursor: pointer; white-space: nowrap; transition: var(--transition);
  display: flex; align-items: center; gap: 5px;
}
.btn-parse:hover { opacity: .88; transform: translateY(-1px); }
.parse-feedback {
  font-size: .7rem; font-weight: 600; padding: 5px 9px;
  border-radius: 6px; margin-bottom: 8px;
}
.parse-feedback.hidden { display: none; }
.parse-ok  { background: var(--ok-lt);   color: #15803d; border: 1px solid #bbf7d0; }
.parse-err { background: var(--err-lt);  color: #b91c1c; border: 1px solid #fecaca; }

/* ════════════════════════════════════════
   QR코드
════════════════════════════════════════ */
.qr-section {
  margin-top: 16px; padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.qr-section.hidden { display: none; }
.qr-label {
  font-size: .78rem; font-weight: 700; color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
}
.qr-label i { color: var(--primary); }
.qr-wrap canvas {
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.qr-hint { font-size: .7rem; color: var(--text-4); }

/* ════════════════════════════════════════
   팔레트 계산기
════════════════════════════════════════ */
.pallet-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 700px) { .pallet-layout { grid-template-columns: 1fr; } }

.pallet-input-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}

/* 팔레트 프리셋 버튼 */
.pallet-presets {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 2px;
}
.pallet-preset {
  display: flex; flex-direction: column; align-items: center;
  border: 1.5px solid var(--border); border-radius: 7px;
  padding: 6px 10px; cursor: pointer; background: var(--surface-2);
  transition: var(--transition); gap: 1px;
}
.pallet-preset:hover { border-color: var(--primary); background: var(--primary-lt); }
.pallet-preset.active { border-color: var(--primary); background: var(--primary-lt); box-shadow: 0 0 0 2px rgba(15,127,239,.12); }
.pp-name { font-size: .68rem; font-weight: 700; color: var(--text-2); }
.pp-size { font-size: .62rem; color: var(--text-4); font-family: 'IBM Plex Mono', monospace; }

/* 팔레트 결과 요약 */
.pallet-summary-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
@media (max-width: 700px) { .pallet-summary-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 420px) { .pallet-summary-grid { grid-template-columns: 1fr 1fr; } }

.pallet-summary-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 11px 13px;
}
.pallet-summary-card.accent {
  background: var(--primary-lt); border-color: rgba(15,127,239,.25);
}
.psc-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--primary-lt); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.pallet-summary-card.accent .psc-icon { background: var(--primary); color: #fff; }
.psc-info { min-width: 0; }
.psc-label { display: block; font-size: .63rem; color: var(--text-4); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.psc-value { display: block; font-size: .88rem; font-weight: 800; color: var(--text-1); font-family: 'IBM Plex Mono', monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 팔레트 시각화 */
.pallet-viz-title {
  font-size: .75rem; font-weight: 700; color: var(--text-3);
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: .4px;
}
.pallet-viz-wrap {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; padding: 4px;
}
.pallet-viz-wrap canvas {
  display: block; width: 100%; height: auto; max-height: 300px;
}

/* 상세 테이블 공통 스타일 */
#palletDetailTable table thead th { text-align: center; }
#palletDetailTable table tbody tr:nth-child(even) { background: var(--surface-2); }
#palletDetailTable table tbody td { border-bottom: 1px solid var(--border); color: var(--text-2); }

/* ════════════════════════════════════════
   2026 Refine: simulator polish / label generator
════════════════════════════════════════ */
.vehicle-card {
  position: relative;
  overflow: hidden;
  min-height: 128px;
  border-radius: 14px;
  padding: 10px 8px 9px;
  background:
    radial-gradient(circle at top right, rgba(255,255,255,.24), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,250,252,.82));
}
[data-theme="dark"] .vehicle-card {
  background:
    radial-gradient(circle at top right, rgba(96,165,250,.16), transparent 34%),
    linear-gradient(180deg, rgba(30,41,59,.74), rgba(15,23,42,.9));
}
.vehicle-card-glow {
  position: absolute;
  inset: auto -28% -38% auto;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(56,189,248,.16), transparent 68%);
  pointer-events: none;
}
.vc-svg {
  height: 48px;
  margin-bottom: 6px;
  filter: drop-shadow(0 10px 10px rgba(15,23,42,.12));
}
.vc-meta {
  font-size: .56rem;
  color: var(--text-4);
  margin-top: 2px;
}
.vc-max {
  margin-top: 4px;
  font-size: .61rem;
}

.result-card {
  backdrop-filter: blur(10px);
}

.canvas-3d-wrap,
.canvas-2d-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.12), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.82), rgba(248,250,252,.94));
}
[data-theme="dark"] .canvas-3d-wrap,
[data-theme="dark"] .canvas-2d-wrap {
  background:
    radial-gradient(circle at top left, rgba(96,165,250,.14), transparent 30%),
    linear-gradient(180deg, rgba(15,23,42,.92), rgba(2,6,23,.98));
}
.canvas-hint {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: .71rem;
  background: rgba(15,23,42,.76);
  color: rgba(255,255,255,.86);
  backdrop-filter: blur(10px);
}
.no-vehicle-msg {
  backdrop-filter: blur(12px);
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(148,163,184,.24);
}
[data-theme="dark"] .no-vehicle-msg {
  background: rgba(15,23,42,.82);
  border-color: rgba(148,163,184,.16);
}

.cargo-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(248,250,252,.9));
  margin-bottom: 8px;
}
[data-theme="dark"] .cargo-item {
  background: linear-gradient(180deg, rgba(30,41,59,.72), rgba(15,23,42,.9));
}
.ci-subline {
  margin-top: 3px;
  font-size: .67rem;
  color: var(--text-4);
}
.ci-fit {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 700;
}
.ci-fit.ok { background: var(--ok-lt); color: var(--ok); }
.ci-fit.warn { background: var(--warn-lt); color: var(--warn); }
.legend-empty {
  font-size: .74rem;
  color: var(--text-4);
  padding: 8px 0;
}
.legend-summary-card {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 12px 14px;
  border-radius: 16px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, rgba(59,130,246,.12), rgba(15,118,110,.08));
  border: 1px solid rgba(59,130,246,.16);
}
.legend-summary-card strong {
  width: 100%;
  font-size: .8rem;
}
.legend-summary-card span {
  font-size: .68rem;
  color: var(--text-3);
}
.legend-item-rich {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 7px;
}
.legend-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.legend-copy strong {
  font-size: .74rem;
  color: var(--text-2);
}
.legend-copy span {
  font-size: .65rem;
  color: var(--text-4);
}
.legend-badge {
  font-size: .63rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.legend-badge.ok { background: var(--ok-lt); color: var(--ok); }
.legend-badge.warn { background: var(--warn-lt); color: var(--warn); }

.label-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
}
.label-config-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 10px;
}
.label-toggle-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: .76rem;
  font-weight: 600;
  color: var(--text-2);
}
.toggle-chip input { accent-color: var(--primary); }
.label-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}
.label-summary strong { font-size: .76rem; color: var(--text-2); }
.label-summary span { font-size: .68rem; color: var(--text-4); }
.label-preview-grid {
  --label-columns: 2;
  display: grid;
  grid-template-columns: repeat(var(--label-columns), minmax(0, 1fr));
  gap: 14px;
}
.label-empty {
  grid-column: 1 / -1;
  min-height: 260px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-4);
  border-radius: 18px;
  border: 1px dashed var(--border-dk);
  background: var(--surface-2);
}
.label-empty i { font-size: 2rem; margin-bottom: 8px; }
.cargo-label-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 218px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(148,163,184,.22);
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.98)),
    linear-gradient(135deg, rgba(59,130,246,.08), transparent 44%);
  box-shadow: 0 16px 32px rgba(15,23,42,.08);
}
[data-theme="dark"] .cargo-label-card {
  background:
    linear-gradient(180deg, rgba(15,23,42,.96), rgba(15,23,42,.98)),
    linear-gradient(135deg, rgba(59,130,246,.12), transparent 46%);
  border-color: rgba(71,85,105,.46);
  box-shadow: 0 20px 36px rgba(2,6,23,.35);
}
.cargo-label-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(59,130,246,.10), transparent 30%);
}
.cargo-label-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.cargo-label-kicker {
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--primary);
}
.cargo-label-head h3 {
  margin-top: 5px;
  font-size: 1.04rem;
  letter-spacing: -.02em;
  color: var(--text-1);
}
.cargo-label-seq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  padding: 7px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--label-accent, #38bdf8) 18%, white);
  color: #0f172a;
  font-size: .72rem;
  font-weight: 800;
}
.cargo-label-body {
  display: grid;
  gap: 10px;
}
.cargo-label-meta,
.cargo-label-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cargo-label-meta span,
.cargo-label-grid span {
  font-size: .61rem;
  letter-spacing: .08em;
  font-weight: 800;
  color: var(--text-4);
}
.cargo-label-meta strong,
.cargo-label-grid strong {
  font-size: .82rem;
  color: var(--text-1);
  line-height: 1.45;
}
.cargo-label-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.cargo-label-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}
.cargo-label-stripe {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}
.cargo-label-qr {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.22);
  overflow: hidden;
}
.cargo-label-qr canvas,
.cargo-label-qr img {
  display: block;
  width: 74px !important;
  height: 74px !important;
  background: #fff;
  image-rendering: pixelated;
}
.cargo-label-qr-loading,
.cargo-label-qr-fallback {
  font-size: .58rem;
  font-weight: 800;
  color: #475569;
  letter-spacing: .04em;
}
.cargo-label-qr.placeholder {
  background: var(--surface-2);
  color: var(--text-3);
}

@media (max-width: 900px) {
  .label-layout { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .cargo-item {
    grid-template-columns: 10px minmax(0, 1fr) auto auto;
    grid-template-areas:
      "dot info qty remove"
      "dot info cbm remove";
  }
  .cargo-item .ci-dot { grid-area: dot; }
  .cargo-item .ci-info { grid-area: info; }
  .cargo-item .ci-qty { grid-area: qty; justify-self: end; }
  .cargo-item .ci-cbm { grid-area: cbm; justify-self: start; }
  .cargo-item .ci-remove { grid-area: remove; }
  .label-config-grid,
  .cargo-label-grid { grid-template-columns: 1fr; }
  .label-preview-grid { grid-template-columns: 1fr; }
  .label-summary { align-items: flex-start; text-align: left; }
}
@media (max-width: 600px) {
  .vehicle-card { min-height: 120px; }
  .canvas-hint { left: 10px; right: 10px; bottom: 10px; border-radius: 12px; }
  .legend-item-rich { grid-template-columns: 10px minmax(0, 1fr); }
  .legend-badge { grid-column: 2; justify-self: start; }
  .tab-btn[data-tab="label"] span { display: none; }
}

#canvas3d,
#canvasTop,
#canvasSide {
  touch-action: none;
  user-select: none;
}
.canvas-3d-wrap.is-dragging {
  box-shadow: 0 0 0 2px rgba(14,165,233,.28), 0 16px 36px rgba(14,165,233,.12);
}
.canvas-3d-wrap.is-dragging .canvas-hint {
  background: rgba(14,165,233,.9);
  color: #fff;
}

@media print {
  body.print-label-mode .header,
  body.print-label-mode .tab-nav,
  body.print-label-mode #page-sim,
  body.print-label-mode #page-cbm,
  body.print-label-mode #page-fare,
  body.print-label-mode #page-tpl,
  body.print-label-mode #page-share,
  body.print-label-mode #page-pallet,
  body.print-label-mode .btn-primary,
  body.print-label-mode .btn-secondary,
  body.print-label-mode .label-config-card,
  body.print-label-mode .toast,
  body.print-label-mode .modal-overlay {
    display: none !important;
  }
  body.print-label-mode .page {
    display: none !important;
    position: static !important;
    overflow: visible !important;
    height: auto !important;
  }
  body.print-label-mode #page-label {
    display: block !important;
    position: static !important;
  }
  body.print-label-mode #page-label .content-wrap {
    max-width: none;
    padding: 0;
  }
  body.print-label-mode .label-layout {
    display: block;
  }
  body.print-label-mode .label-preview-card {
    border: none;
    box-shadow: none;
    padding: 0;
  }
  body.print-label-mode .label-preview-card .card-header {
    display: none;
  }
  body.print-label-mode .label-preview-grid {
    grid-template-columns: repeat(var(--label-columns), 1fr);
    gap: 10mm;
  }
  body.print-label-mode .cargo-label-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #d6dee8;
    min-height: 72mm;
  }
}

/* ════════════════════════════════════════
   2026 Final polish: mobile / simulator / footer
════════════════════════════════════════ */
:root {
  --footer-h: 46px;
}

html {
  font-size: 15px;
}

body {
  line-height: 1.55;
}

.page {
  bottom: var(--footer-h);
}

.content-wrap {
  padding-bottom: calc(44px + var(--footer-h));
}

.sim-main {
  overflow: auto;
}

.vehicle-grid {
  gap: 8px;
}

.vehicle-card {
  min-height: 146px;
  padding: 12px 10px 11px;
}

.vc-emoji {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.78);
  box-shadow: 0 8px 16px rgba(15,23,42,.08);
  font-size: 1rem;
}

[data-theme="dark"] .vc-emoji {
  background: rgba(15,23,42,.72);
}

.vc-svg {
  height: 58px;
  margin: 4px 0 8px;
}

.vc-name {
  font-size: .8rem;
}

.vc-type,
.vc-meta,
.vc-max {
  font-size: .69rem;
}

.sec-title,
.form-label,
.unit-label,
.card-note,
.card-desc,
.result-label,
.load-bar-text,
.legend-copy span,
.legend-badge,
.ci-detail,
.ci-subline,
.ci-fit {
  font-size: .78rem;
}

.form-input,
.spec-input,
.qty-input,
.share-url-input,
.btn-primary,
.btn-secondary,
.btn-apply,
.btn-view-action,
.view-tab,
.tab-btn,
.btn-sm,
.modal-header h3,
.modal-close,
.result-value,
.ci-name,
.ci-cbm,
.preview-row .mono,
.summary-total .mono,
.cbm-val,
.vcc-name,
.vcc-rate,
.summary-row,
.preview-row,
.info-content,
#pdfPreviewContent,
#pdfPreviewContent table {
  font-size: .92rem;
}

.result-value {
  font-size: 1.02rem;
}

.result-icon {
  width: 34px;
  height: 34px;
  font-size: .95rem;
}

.load-bar-wrap {
  padding: 10px 14px;
}

.load-bar-track {
  height: 10px;
}

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

.spec-field label {
  font-size: .76rem;
  line-height: 1.25;
  white-space: normal;
  word-break: keep-all;
}

.spec-input-wrap {
  gap: 6px;
}

.spec-input {
  padding: 7px 8px;
}

.spec-unit {
  width: auto;
  min-width: 1.9em;
  text-align: center;
  font-size: .72rem;
}

.view-tab-bar {
  position: sticky;
  top: 0;
  z-index: 4;
}

.view-panel.active {
  padding: 12px;
}

.canvas-3d-wrap,
.canvas-2d-wrap {
  height: clamp(340px, 56vh, 560px);
  flex: 0 0 auto;
  border: 1px solid rgba(148,163,184,.16);
}

.canvas-hint {
  font-size: .78rem;
}

.view-legend {
  padding: 10px 12px;
  min-height: 42px;
}

.app-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;
  height: var(--footer-h);
  background: rgba(13,17,23,.96);
  border-top: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px);
}

.app-footer-inner {
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255,255,255,.72);
  font-size: .82rem;
}

.app-footer a {
  color: #7dd3fc;
  text-decoration: none;
  font-weight: 600;
}

.app-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 900px) {
  .canvas-3d-wrap,
  .canvas-2d-wrap {
    height: clamp(320px, 52vh, 480px);
  }

  .app-footer-inner {
    font-size: .78rem;
    padding: 0 14px;
  }
}

@media (max-width: 600px) {
  :root {
    --footer-h: 54px;
  }

  html {
    font-size: 14.8px;
  }

  #page-sim.page-flex.active {
    flex-direction: column;
    align-items: stretch;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  .sim-aside {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg);
  }

  .aside-body.open {
    max-height: min(46svh, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .content-wrap {
    padding: 18px 14px calc(44px + var(--footer-h));
  }

  .vehicle-card {
    min-height: 132px;
    padding: 10px 8px;
  }

  .vc-svg {
    height: 50px;
  }

  .result-card {
    padding: 11px 10px;
  }

  .result-value {
    font-size: 1rem;
  }

  .sim-main {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .view-panel.active {
    padding: 10px;
    overflow: visible;
  }

  .canvas-3d-wrap,
  .canvas-2d-wrap {
    height: clamp(320px, 52svh, 440px);
    min-height: 320px;
    border-radius: 16px;
  }

  .canvas-hint {
    font-size: .74rem;
    white-space: normal;
    text-align: center;
  }

  .spec-grid {
    gap: 8px;
  }

  .spec-field label {
    font-size: .72rem;
  }

  .view-legend {
    margin-bottom: 12px;
  }

  .app-footer {
    height: auto;
    min-height: var(--footer-h);
  }

  .app-footer-inner {
    padding: 8px 12px;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    font-size: .76rem;
    line-height: 1.35;
  }
}

@media (max-width: 420px) {
  html {
    font-size: 14.6px;
  }

  .spec-field label {
    font-size: .69rem;
  }

  .vc-type,
  .vc-meta,
  .vc-max {
    font-size: .64rem;
  }
}

@media print {
  .app-footer {
    display: none !important;
  }

  .page {
    bottom: 0 !important;
  }
}

/* ════════════════════════════════════════
   2026 Luxury redesign: typography / forms / vehicle cards
════════════════════════════════════════ */
body,
input,
button,
select,
textarea {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.mono,
.spec-input,
.qty-input,
.ci-cbm,
.result-value,
.load-bar-text,
.vcc-rate,
.preview-row .mono,
.summary-total .mono,
.cbm-val {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.logo-main,
.page-header h2,
.card-header h3,
.vc-name,
.ci-name,
.result-value,
.btn-primary,
.btn-secondary,
.btn-apply {
  letter-spacing: -0.02em;
}

.aside-sec-premium {
  position: relative;
  margin: 12px;
  padding: 18px;
  border: 1px solid rgba(148,163,184,.16);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96)),
    radial-gradient(circle at top right, rgba(15,127,239,.08), transparent 32%);
  box-shadow: 0 18px 36px rgba(15,23,42,.06);
}

[data-theme="dark"] .aside-sec-premium {
  background:
    linear-gradient(180deg, rgba(22,28,37,.94), rgba(15,23,42,.98)),
    radial-gradient(circle at top right, rgba(56,189,248,.12), transparent 34%);
  border-color: rgba(71,85,105,.42);
  box-shadow: 0 20px 36px rgba(2,6,23,.28);
}

.aside-helper {
  margin: 0 0 14px;
  color: var(--text-3);
  font-size: .8rem;
  line-height: 1.65;
}

.spec-sec .sec-title,
.cargo-sec .sec-title {
  margin-bottom: 6px;
  font-size: .8rem;
}

.spec-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(248,250,252,.98));
  border: 1px solid rgba(148,163,184,.18);
}

[data-theme="dark"] .spec-grid {
  background: linear-gradient(180deg, rgba(30,41,59,.72), rgba(15,23,42,.9));
}

.spec-field {
  gap: 6px;
}

.spec-field-full {
  grid-column: span 1;
}

.spec-field-emphasis .spec-input-wrap {
  box-shadow: inset 0 0 0 1px rgba(15,127,239,.08);
  border-radius: 14px;
}

.spec-field label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-2);
}

.spec-input-wrap {
  align-items: stretch;
  gap: 8px;
}

.spec-input {
  min-height: 48px;
  padding: 11px 12px;
  border-radius: 14px;
  border-width: 1px;
  background: rgba(255,255,255,.96);
  font-size: .96rem;
  font-weight: 700;
  text-align: left;
}

[data-theme="dark"] .spec-input {
  background: rgba(15,23,42,.94);
}

.spec-highlight .spec-input {
  background: linear-gradient(180deg, rgba(232,244,253,.96), rgba(255,255,255,.98));
}

.spec-unit {
  min-width: 40px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(148,163,184,.12);
  color: var(--text-3);
  font-size: .78rem;
  font-weight: 700;
}

.btn-apply {
  min-height: 50px;
  margin-top: 14px;
  border-radius: 16px;
  border-width: 1px;
  font-size: .94rem;
  font-weight: 800;
}

.cargo-sec .form-group {
  margin-bottom: 12px;
}

.form-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
}

.form-input {
  min-height: 48px;
  padding: 12px 13px;
  border-radius: 14px;
  border-width: 1px;
  background: rgba(255,255,255,.96);
  font-size: .95rem;
}

[data-theme="dark"] .form-input {
  background: rgba(15,23,42,.92);
}

.parse-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-bottom: 12px;
}

.btn-parse {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(15,127,239,.18);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(232,244,253,.96), rgba(248,250,252,.98));
  color: var(--primary);
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
}

.unit-selector {
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 16px;
  background: rgba(15,127,239,.05);
  border: 1px solid rgba(15,127,239,.10);
}

.unit-btns {
  gap: 6px;
}

.unit-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: .84rem;
  font-weight: 800;
}

.dim-grid {
  gap: 12px;
  margin-bottom: 12px;
}

.input-unit-wrap .form-input {
  padding-right: 44px;
}

.input-unit-badge {
  right: 14px;
  font-size: .78rem;
  font-weight: 800;
}

.qty-control {
  min-height: 48px;
  border-radius: 14px;
  border-width: 1px;
}

.qty-btn {
  width: 42px;
  height: 46px;
  font-size: 1.18rem;
}

.qty-input {
  font-size: .96rem;
}

.color-row {
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(148,163,184,.06);
  border: 1px solid rgba(148,163,184,.12);
}

.color-swatches {
  gap: 8px;
}

.swatch {
  width: 26px;
  height: 26px;
}

.fit-feedback,
.weight-alert {
  border-radius: 14px;
  padding: 10px 12px;
  font-size: .84rem;
}

.btn-primary {
  min-height: 52px;
  border-radius: 16px;
  font-size: .96rem;
  font-weight: 800;
}

.vehicle-card {
  min-height: 138px;
  padding: 12px 10px 10px;
  border-radius: 18px;
}

.vehicle-card::after {
  top: 8px;
  right: 10px;
}

.vc-svg {
  height: 64px;
  margin: 6px 0 10px;
}

.vc-name {
  font-size: .82rem;
  font-weight: 800;
}

.vc-type {
  font-size: .7rem;
  font-weight: 700;
}

.vc-meta {
  font-size: .68rem;
}

.vc-max {
  font-size: .7rem;
  font-weight: 800;
}

.view-tab,
.btn-view-action {
  min-height: 42px;
}

.canvas-hint {
  padding: 10px 14px;
}

.app-footer,
.app-footer a,
.app-footer-inner {
  color: #ffffff !important;
}

.app-footer a {
  opacity: .92;
}

@media (max-width: 900px) {
  .spec-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .aside-sec-premium {
    margin: 10px;
    padding: 16px;
    border-radius: 18px;
  }

  .spec-grid,
  .dim-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

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

  .unit-selector,
  .color-row {
    flex-direction: column;
    align-items: stretch;
  }

  .color-swatches {
    margin-left: 0;
  }

  .btn-parse,
  .btn-primary,
  .btn-apply,
  .form-input,
  .spec-input,
  .qty-control {
    min-height: 46px;
  }
}

@media (max-width: 420px) {
  .spec-grid,
  .dim-grid {
    grid-template-columns: 1fr;
  }
}


/* ════════════════════════════════════════
   2026-04 premium simulator refinement
════════════════════════════════════════ */
:root {
  --aside-w: 392px;
}

html {
  font-size: 15.5px;
  text-rendering: optimizeLegibility;
}

body,
input,
button,
select,
textarea {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, -apple-system, sans-serif !important;
  font-kerning: normal;
}

body {
  letter-spacing: -0.01em;
  line-height: 1.58;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.mono,
.spec-input,
.qty-input,
.ci-cbm,
.ci-qty-num,
.result-value,
.load-bar-text,
.preview-row .mono,
.summary-total .mono,
.cbm-val,
.vcc-rate,
.vcc-sv {
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}

.sec-title {
  font-size: .98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  gap: 10px;
}

.aside-helper {
  font-size: .84rem;
  line-height: 1.72;
}

.sim-aside {
  backdrop-filter: blur(12px);
}

.aside-sec-premium {
  margin: 14px;
  padding: 20px;
  border-radius: 24px;
  border: 1px solid rgba(148,163,184,.16);
  background:
    radial-gradient(circle at top right, rgba(56,189,248,.10), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
  box-shadow: 0 18px 48px rgba(15,23,42,.07);
}

[data-theme="dark"] .aside-sec-premium {
  background:
    radial-gradient(circle at top right, rgba(56,189,248,.14), transparent 32%),
    linear-gradient(180deg, rgba(20,28,38,.96), rgba(15,23,42,.98));
  border-color: rgba(71,85,105,.42);
  box-shadow: 0 20px 48px rgba(2,6,23,.34);
}

.spec-sec .sec-title,
.cargo-sec .sec-title {
  font-size: 1rem;
  margin-bottom: 8px;
}

.sec-badge {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
}

.spec-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(247,250,252,.98));
  border: 1px solid rgba(148,163,184,.16);
}

[data-theme="dark"] .spec-grid {
  background: linear-gradient(180deg, rgba(30,41,59,.72), rgba(15,23,42,.94));
}

.spec-field {
  gap: 7px;
}

.spec-field label {
  font-size: .83rem;
  font-weight: 800;
  color: var(--text-2);
  line-height: 1.35;
}

.spec-input-wrap {
  gap: 8px;
  align-items: stretch;
}

.spec-input {
  min-height: 52px;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.22);
  background: rgba(255,255,255,.98);
  font-size: .98rem;
  font-weight: 700;
  text-align: left;
}

[data-theme="dark"] .spec-input,
[data-theme="dark"] .form-input {
  background: rgba(15,23,42,.96);
}

.spec-unit {
  min-width: 44px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(148,163,184,.12);
  font-size: .78rem;
  font-weight: 800;
  color: var(--text-3);
}

.form-label,
.unit-label {
  font-size: .84rem;
  font-weight: 800;
  color: var(--text-2);
}

.form-input {
  min-height: 52px;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.22);
  background: rgba(255,255,255,.98);
  font-size: .96rem;
}

.parse-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-bottom: 14px;
}

.btn-parse,
.btn-apply,
.btn-primary {
  min-height: 54px;
  border-radius: 16px;
  font-size: .97rem;
  font-weight: 800;
}

.btn-parse {
  padding: 0 18px;
}

.unit-selector,
.color-row {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.14);
}

.unit-selector {
  justify-content: space-between;
  background: rgba(15,127,239,.05);
}

.color-row {
  align-items: flex-start;
  gap: 12px;
  background: rgba(148,163,184,.06);
}

.dim-grid {
  gap: 14px;
  margin-bottom: 14px;
}

.input-unit-wrap .form-input {
  padding-right: 46px;
}

.input-unit-badge {
  right: 14px;
  font-size: .79rem;
  font-weight: 800;
}

.qty-control {
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.22);
}

.qty-btn {
  width: 44px;
  height: 50px;
  font-size: 1.18rem;
}

.qty-input {
  font-size: .98rem;
  font-weight: 800;
}

.swatch {
  width: 28px;
  height: 28px;
}

.fit-feedback,
.weight-alert {
  font-size: .84rem;
  line-height: 1.5;
  padding: 11px 13px;
  border-radius: 14px;
}

.vehicle-grid {
  gap: 12px;
}

.vehicle-card {
  min-height: 164px;
  padding: 14px 14px 12px;
  border-radius: 22px;
  text-align: left;
  border: 1px solid rgba(148,163,184,.18);
  background:
    radial-gradient(circle at top right, rgba(56,189,248,.14), transparent 30%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.94));
  box-shadow: 0 16px 30px rgba(15,23,42,.05);
}

[data-theme="dark"] .vehicle-card {
  background:
    radial-gradient(circle at top right, rgba(56,189,248,.16), transparent 34%),
    linear-gradient(180deg, rgba(30,41,59,.78), rgba(15,23,42,.96));
}

.vehicle-card-top,
.vc-max-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.vehicle-card-art {
  margin: 6px 0 10px;
}

.vehicle-card-glow {
  inset: auto -20% -34% auto;
  width: 110px;
  height: 110px;
  background: radial-gradient(circle, rgba(56,189,248,.18), transparent 68%);
}

.vc-svg {
  width: 100%;
  height: 68px;
  margin: 0;
  filter: drop-shadow(0 14px 16px rgba(15,23,42,.12));
}

.vc-type-pill,
.vc-ton-badge,
.vcc-type-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: 0;
}

.vc-type-pill,
.vcc-type-pill {
  background: rgba(15,127,239,.10);
  color: var(--primary);
}

.vc-ton-badge {
  background: rgba(15,23,42,.06);
  color: var(--text-3);
}

[data-theme="dark"] .vc-ton-badge {
  background: rgba(255,255,255,.08);
}

.vc-name {
  font-size: .9rem;
  font-weight: 800;
  color: var(--text-1);
  margin: 0 0 4px;
}

.vc-meta {
  font-size: .74rem;
  color: var(--text-3);
  margin-top: 0;
}

.vc-max-row {
  margin-top: 8px;
}

.vc-max,
.vc-load {
  font-size: .75rem;
  font-weight: 800;
}

.vc-load {
  color: var(--text-3);
}

.vc-emoji,
.vcc-emoji {
  display: none !important;
}

.app-footer,
.app-footer a,
.app-footer-inner {
  color: #ffffff !important;
}

.app-footer a {
  text-decoration: none;
  opacity: .96;
}

.app-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 1180px) {
  :root {
    --aside-w: 372px;
  }
}

@media (max-width: 900px) {
  html {
    font-size: 15px;
  }

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

  .vehicle-card {
    min-height: 154px;
  }
}

@media (max-width: 600px) {
  html {
    font-size: 14.7px;
  }

  .aside-sec-premium {
    margin: 10px;
    padding: 16px;
    border-radius: 20px;
  }

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

  .spec-grid,
  .dim-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .unit-selector,
  .color-row {
    flex-direction: column;
    align-items: stretch;
  }

  .color-swatches {
    margin-left: 0;
  }

  .vehicle-card {
    min-height: 148px;
    padding: 12px;
  }

  .vc-svg {
    height: 58px;
  }
}

@media (max-width: 420px) {
  .spec-grid,
  .dim-grid {
    grid-template-columns: 1fr;
  }
}


/* 2026 final simulator polish */
html,
body,
input,
button,
textarea,
select {
  font-family: 'IBM Plex Sans KR', 'Pretendard', 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

.spec-overview-card,
.cargo-preview-card {
  margin: 14px 0 16px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,.16);
  background:
    radial-gradient(circle at top right, rgba(56,189,248,.10), transparent 28%),
    linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,250,252,.96));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65), 0 14px 32px rgba(15,23,42,.06);
}

[data-theme="dark"] .spec-overview-card,
[data-theme="dark"] .cargo-preview-card {
  background:
    radial-gradient(circle at top right, rgba(56,189,248,.16), transparent 34%),
    linear-gradient(180deg, rgba(30,41,59,.78), rgba(15,23,42,.96));
  border-color: rgba(71,85,105,.42);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 16px 34px rgba(2,6,23,.28);
}

.soc-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.soc-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(15,127,239,.10);
  color: var(--primary);
  font-size: .72rem;
  font-weight: 800;
}

.soc-head strong {
  color: var(--text-1);
  font-size: .96rem;
  line-height: 1.45;
}

.soc-head em,
.soc-foot {
  color: var(--text-3);
  font-size: .8rem;
  line-height: 1.5;
  font-style: normal;
}

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

.soc-grid > div {
  padding: 12px 13px;
  border-radius: 16px;
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(148,163,184,.14);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

[data-theme="dark"] .soc-grid > div {
  background: rgba(15,23,42,.44);
}

.soc-grid span {
  font-size: .73rem;
  font-weight: 700;
  color: var(--text-3);
}

.soc-grid strong {
  font-size: .92rem;
  font-weight: 800;
  color: var(--text-1);
}

.soc-progress {
  margin-top: 12px;
  height: 10px;
  border-radius: 999px;
  background: rgba(148,163,184,.16);
  overflow: hidden;
}

.soc-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8 55%, #60a5fa);
}

.spec-overview-card.is-empty .soc-progress,
.cargo-preview-card.is-empty .soc-progress {
  display: none;
}

.vehicle-card {
  overflow: hidden;
}

.vehicle-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,0));
}

.vehicle-card.active {
  box-shadow: 0 18px 36px rgba(14,165,233,.18);
}

.vc-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.vc-type-mini {
  flex: none;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(15,23,42,.06);
  color: var(--text-3);
  font-size: .68rem;
  font-weight: 800;
}

[data-theme="dark"] .vc-type-mini {
  background: rgba(255,255,255,.08);
}

.vc-dim-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.vc-dim-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(15,127,239,.06);
  color: var(--text-2);
  font-size: .68rem;
  font-weight: 700;
}

.vc-floor-bar {
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  background: rgba(148,163,184,.14);
  overflow: hidden;
}

.vc-floor-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(56,189,248,.92), rgba(96,165,250,.96));
}

@media (max-width: 600px) {
  .soc-grid {
    grid-template-columns: 1fr;
  }

  .vc-name-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ════════════════════════════════════════
   FINAL UI POLISH OVERRIDES (SIM + CBM)
════════════════════════════════════════ */
:root {
  --ui-gap: 14px;
  --field-h: 40px;
  --btn-h: 42px;
  --btn-h-sm: 32px;
}

body {
  letter-spacing: -0.01em;
}

.content-wrap {
  max-width: 1320px;
  padding: 28px 22px 44px;
}

.page-header {
  margin-bottom: 22px;
}

.page-header h2 {
  font-size: 1.34rem;
  gap: 10px;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}

.page-header p {
  font-size: .84rem;
  line-height: 1.6;
}

.card {
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05), 0 2px 8px rgba(15, 23, 42, 0.04);
}

[data-theme="dark"] .card {
  box-shadow: 0 10px 26px rgba(0,0,0,.22);
}

.card-header {
  margin-bottom: 16px;
  gap: 10px;
}

.card-header h3 {
  font-size: .96rem;
  gap: 8px;
  letter-spacing: -0.02em;
}

.card-actions,
.sec-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-note {
  font-size: .72rem;
}

.sim-aside {
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(248,250,252,.96));
}

[data-theme="dark"] .sim-aside {
  background: linear-gradient(180deg, rgba(22,27,34,.96), rgba(18,23,30,.98));
}

.aside-body {
  gap: 10px;
  padding: 12px;
}

.aside-sec {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 84%, var(--surface-2) 16%);
}

.aside-sec + .aside-sec {
  margin-top: 0;
}

.aside-sec-premium {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 18px rgba(15,23,42,.04);
}

[data-theme="dark"] .aside-sec-premium {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 8px 18px rgba(0,0,0,.18);
}

.sec-title,
.sec-title-row {
  margin-bottom: 12px;
}

.sec-title {
  gap: 8px;
  font-size: .76rem;
  letter-spacing: .55px;
}

.sec-badge {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .6rem;
}

.aside-helper {
  margin-bottom: 14px;
  font-size: .74rem;
  line-height: 1.6;
}

.vehicle-grid {
  gap: 10px;
}

.vehicle-card {
  min-height: 156px;
  padding: 12px 10px 11px;
  border-radius: 14px;
  box-shadow: 0 3px 10px rgba(15,23,42,.04);
}

.vehicle-card:hover {
  transform: translateY(-2px);
}

.vc-svg {
  height: 56px;
  margin-bottom: 8px;
}

.vc-name {
  font-size: .75rem;
  line-height: 1.28;
}

.vc-type-mini {
  padding: 5px 9px;
  font-size: .67rem;
}

.vc-meta {
  margin-top: 6px;
  font-size: .67rem;
  line-height: 1.45;
}

.vc-dim-badges {
  gap: 5px;
  margin-top: 10px;
}

.vc-dim-badges span {
  min-height: 25px;
  padding: 0 9px;
  font-size: .66rem;
}

.vc-max-row {
  margin-top: 10px;
  align-items: center;
}

.spec-grid,
.dim-grid {
  gap: 10px;
}

.spec-grid {
  padding: 12px;
  border-radius: 14px;
  margin-bottom: 12px;
}

.spec-field {
  gap: 5px;
}

.spec-field label,
.form-label,
.unit-label {
  font-size: .73rem;
  font-weight: 700;
}

.spec-input-wrap {
  gap: 6px;
}

.spec-input,
.form-input,
.qty-control {
  min-height: var(--field-h);
}

.spec-input {
  border-radius: 10px;
  padding: 8px 10px;
  font-size: .82rem;
}

.spec-unit {
  width: 18px;
  font-size: .68rem;
}

.form-group {
  margin-bottom: 12px;
}

.form-label {
  margin-bottom: 6px;
}

.form-input {
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .82rem;
}

.input-unit-wrap .form-input {
  padding-right: 42px;
}

.input-unit-badge {
  right: 12px;
  font-size: .67rem;
}

.unit-selector {
  gap: 10px;
  margin-bottom: 12px;
}

.unit-btns {
  gap: 6px;
}

.unit-btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: .73rem;
}

.qty-control {
  border-radius: 10px;
}

.qty-btn {
  width: 38px;
  height: var(--field-h);
  font-size: 1rem;
}

.qty-input {
  font-size: .88rem;
}

.color-row {
  gap: 10px;
  margin-bottom: 12px;
}

.color-swatches {
  gap: 7px;
}

.swatch {
  width: 24px;
  height: 24px;
}

.fit-feedback,
.weight-alert,
.parse-feedback {
  border-radius: 10px;
  padding: 9px 12px;
  font-size: .73rem;
  line-height: 1.45;
}

.parse-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 12px;
}

.btn-parse,
.btn-primary,
.btn-secondary,
.btn-apply {
  min-height: var(--btn-h);
  border-radius: 11px;
}

.btn-primary,
.btn-secondary,
.btn-apply {
  gap: 8px;
  font-size: .82rem;
}

.btn-primary {
  padding: 10px 16px;
}

.btn-secondary {
  padding: 9px 16px;
}

.btn-apply {
  padding: 9px 14px;
}

.btn-sm,
.btn-view-action {
  min-height: var(--btn-h-sm);
  border-radius: 9px;
}

.btn-sm {
  padding: 0 11px;
  font-size: .71rem;
}

.btn-view-action {
  padding: 0 10px;
  font-size: .71rem;
}

.cargo-list,
.cbm-item-list {
  gap: 8px;
}

.cargo-item,
.cbm-item {
  min-height: 58px;
  padding: 10px 11px;
  border-radius: 12px;
}

.ci-name,
.cbm-name {
  font-size: .76rem;
  line-height: 1.3;
}

.ci-detail,
.cbm-dim,
.ci-wgt,
.cbm-each {
  font-size: .66rem;
  line-height: 1.45;
}

.ci-cbm,
.cbm-val {
  font-size: .76rem;
}

.ci-qty {
  gap: 4px;
}

.ci-qty-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.ci-qty-num {
  width: 24px;
}

.result-dashboard {
  background: color-mix(in srgb, var(--surface) 92%, var(--surface-2) 8%);
}

.result-card {
  min-height: 72px;
  padding: 12px 14px;
  gap: 10px;
}

.result-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: .86rem;
}

.result-label {
  font-size: .64rem;
}

.result-value {
  font-size: .9rem;
}

.load-bar-wrap {
  padding: 10px 14px;
  gap: 10px;
}

.load-bar-track {
  height: 10px;
  border-radius: 999px;
}

.load-bar-fill {
  border-radius: inherit;
}

.load-bar-text {
  min-width: 58px;
  font-size: .73rem;
}

.view-tab-bar {
  padding: 0 6px;
}

.view-tab {
  min-height: 42px;
  gap: 6px;
  padding: 10px 14px;
  font-size: .76rem;
}

.view-tab-actions {
  gap: 6px;
  padding: 0 8px 0 12px;
}

.view-legend {
  padding: 8px 12px;
  gap: 10px;
  min-height: 38px;
}

.legend-item {
  font-size: .67rem;
}

.cbm-layout {
  grid-template-columns: minmax(380px, 420px) 1fr;
  gap: 20px;
}

.cbm-right-col {
  gap: 16px;
}

.cbm-preview,
.cbm-summary {
  border-radius: 12px;
  padding: 12px 14px;
}

.preview-row,
.summary-row {
  min-height: 24px;
  font-size: .75rem;
}

.preview-row .mono,
.summary-total .mono {
  font-size: .94rem;
}

.list-header {
  margin: 16px 0 10px;
  padding-top: 14px;
}

.list-title {
  font-size: .78rem;
}

.info-content {
  font-size: .76rem;
  line-height: 1.74;
}

.info-formula {
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.vehicle-compare-grid {
  gap: 10px;
}

.vc-compare-card {
  border-radius: 14px;
  padding: 12px 13px;
  box-shadow: 0 3px 10px rgba(15,23,42,.03);
}

.vcc-header {
  gap: 6px;
  margin-bottom: 8px;
}

.vcc-name {
  font-size: .74rem;
}

.vcc-badge,
.vcc-type-pill {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
}

.vcc-stats {
  gap: 4px 8px;
  margin-bottom: 8px;
}

.vcc-rate {
  font-size: .67rem;
}

.spec-overview-card,
.cargo-preview-card {
  margin-top: 12px;
  border-radius: 14px;
  padding: 14px;
}

.soc-head {
  gap: 6px;
  margin-bottom: 12px;
}

.soc-head strong {
  font-size: .83rem;
  line-height: 1.4;
}

.soc-head em,
.soc-foot {
  font-size: .7rem;
  line-height: 1.5;
}

.soc-grid {
  gap: 8px;
}

.soc-grid > div {
  min-height: 62px;
  border-radius: 12px;
}

.soc-grid span {
  font-size: .67rem;
}

.soc-grid strong {
  font-size: .83rem;
  line-height: 1.35;
}

.soc-progress {
  height: 10px;
  border-radius: 999px;
  margin-top: 12px;
}

.toast {
  padding: 11px 18px;
  border-radius: 999px;
}

@media (max-width: 900px) {
  .content-wrap {
    padding: 20px 16px 36px;
  }

  .aside-body {
    padding: 10px;
  }

  .cbm-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .vehicle-grid {
    gap: 8px;
  }

  .vehicle-card {
    min-height: 148px;
  }
}

@media (max-width: 600px) {
  .content-wrap {
    padding: 16px 12px 30px;
  }

  .aside-body {
    padding: 8px;
    gap: 8px;
  }

  .aside-sec,
  .card {
    padding: 14px 12px;
    border-radius: 14px;
  }

  .page-header h2 {
    font-size: 1.18rem;
  }

  .page-header p,
  .aside-helper,
  .info-content {
    font-size: .74rem;
  }

  .vehicle-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }

  .vehicle-card {
    min-height: 136px;
    padding: 10px 8px 9px;
  }

  .spec-grid,
  .dim-grid,
  .soc-grid,
  .vehicle-compare-grid {
    gap: 8px;
  }

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

  .btn-parse,
  .btn-primary,
  .btn-secondary,
  .btn-apply {
    width: 100%;
  }

  .result-card {
    min-height: 66px;
  }

  .view-tab {
    min-height: 40px;
    padding: 8px 10px;
  }

  .canvas-hint {
    font-size: .6rem;
    line-height: 1.4;
  }
}

/* ════════════════════════════════════════
   Final UI fix pack - 2026-04-13
════════════════════════════════════════ */
.canvas-hint {
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: none;
  max-width: none;
  width: auto;
  padding: 8px 12px;
  border-radius: 14px;
  text-wrap: balance;
  overflow-wrap: anywhere;
  z-index: 2;
}

.canvas-3d-wrap {
  isolation: isolate;
}

.cbm-dim-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end;
}

.cbm-dim-grid > .form-group {
  min-width: 0;
  margin-bottom: 0;
}

.cbm-dim-grid .input-unit-wrap,
.cbm-dim-grid .qty-control,
.cbm-dim-grid .form-input,
.cbm-dim-grid .qty-input {
  width: 100%;
}

.cbm-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
}

.cbm-info {
  min-width: 0;
}

.cbm-qty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.cbm-qty-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: .88rem;
  line-height: 1;
  transition: var(--transition);
}

.cbm-qty-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.cbm-qty-num {
  min-width: 22px;
  text-align: center;
  font-size: .72rem;
  font-weight: 800;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text-1);
}

@media (max-width: 1180px) {
  .cbm-dim-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .canvas-hint {
    font-size: .62rem;
    line-height: 1.45;
  }
}

@media (max-width: 640px) {
  .canvas-hint {
    top: 8px;
    left: 10px;
    right: 10px;
    bottom: auto;
    padding: 6px 9px;
    font-size: .56rem;
    line-height: 1.38;
  }

  .cbm-item {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      'dot info remove'
      'dot qty result';
    align-items: start;
  }

  .cbm-dot { grid-area: dot; }
  .cbm-info { grid-area: info; }
  .cbm-qty { grid-area: qty; }
  .cbm-result { grid-area: result; }
  .ci-remove { grid-area: remove; justify-self: end; }
}

/* ════════════════════════════════════════
   Mobile 3D view optimization patch
════════════════════════════════════════ */
@media (max-width: 600px) {
  .page-flex.active {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  .sim-aside {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--surface);
  }

  .aside-body.open {
    max-height: min(46svh, 420px);
    overflow-y: auto;
  }

  .sim-main {
    flex: 0 0 auto;
    min-height: auto;
    overflow: visible;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .view-panel,
  .view-panel.active {
    overflow: visible;
  }

  .canvas-3d-wrap,
  .canvas-2d-wrap {
    height: clamp(320px, 52svh, 440px);
    min-height: 320px;
  }

  .view-legend {
    margin-bottom: 12px;
  }
}
