/* 연락 페이지 · 앱과 같은 톤 (흰 바탕, 남색, 차 그림). 2026-11-17 다시 디자인. */
:root {
  --navy: #1A2352;
  --text: #14182B;
  --muted: #5A5F6E;
  --off: #8A8F9C;
  --line: #E8EAEE;
  --soft: #F4F5FA;
  --tint: #E9ECF7;
  --green: #1E9E57;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #fff;
}

body {
  font-family: 'Noto Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

.screen {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
}

/* 넓은 화면에서는 가운데 흰 종이처럼 */
@media (min-width: 481px) {
  body { background: var(--soft); }
  .screen { box-shadow: 0 0 0 1px var(--line); }
}

/* 머리: 로고 · 이름 · 무엇을 하는 서비스인지 */
.top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: max(18px, calc(env(safe-area-inset-top) + 12px)) 20px 0;
}

.logo { display: inline-flex; }

.brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.brand-sub {
  margin-left: auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--tint);
  font-size: 12px;
  font-weight: 500;
  color: var(--navy);
}

/* 가운데: 차 그림 · 상태 · 차주가 남긴 말 */
.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 20px 20px;
  text-align: center;
}

.car {
  display: block;
  width: min(72%, 300px);
  height: auto;
  margin-top: clamp(0px, 2vh, 16px);
  transition: filter .2s ease, opacity .2s ease;
}

/* 연락을 받을 수 없는 카드는 그림을 흐리게 */
.screen:not([data-kind="active"]):not([data-kind="loading"]) .car { filter: grayscale(1); opacity: .45; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-top: 4px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(26, 35, 82, .06);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
}

#chip-text { overflow: hidden; text-overflow: ellipsis; }

.dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--off);
}

[data-kind="active"] .chip { color: var(--text); }
[data-kind="active"] .dot {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(30, 158, 87, .16);
}

[data-kind="loading"] .dot { animation: pulse 1.2s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

/* 차주가 남긴 말: 말풍선 */
.bubble {
  position: relative;
  align-self: stretch;
  margin-top: 22px;
  padding: 22px 20px;
  border-radius: 20px;
  background: var(--soft);
}

.bubble::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 4px 0 0 0;
  background: var(--soft);
  transform: rotate(45deg);
}

.bubble:has(.msg:empty) { visibility: hidden; }

.msg {
  margin: 0;
  font-size: 21px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.02em;
  color: var(--text);
  word-break: keep-all;
  overflow-wrap: anywhere;
  white-space: pre-line;
  text-wrap: balance;
}

.msg:empty { display: none; }
.msg .line { display: block; }
.msg .line.last { font-weight: 700; }

.sub-msg {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  word-break: keep-all;
  text-wrap: balance;
}

/* 아래: 번호 · 버튼 · 안내 */
.actions {
  padding: 0 20px max(18px, calc(env(safe-area-inset-bottom) + 12px));
  display: flex;
  flex-direction: column;
}

.vnum {
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  text-align: center;
}

.vnum-number {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  color: var(--navy);
}

.vnum-hint {
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}

.vnum-time {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text);
}

.status {
  margin: 0 0 12px;
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  word-break: keep-all;
  text-wrap: balance;
}

.call {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 56px;
  padding: 0 20px;
  border: 0;
  border-radius: 14px;
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: #fff;
  background: var(--navy);
  box-shadow: 0 8px 20px rgba(26, 35, 82, .22);
  cursor: pointer;
  transition: transform .12s ease, opacity .2s ease;
}

.call svg { flex-shrink: 0; }
.call:active { transform: scale(.985); }
.call:disabled { opacity: .55; cursor: default; transform: none; box-shadow: none; }

.text-btn {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  margin-top: 10px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--tint);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  transition: transform .12s ease, opacity .2s ease;
}

.text-btn:active { transform: scale(.985); }
.text-btn:disabled { opacity: .5; cursor: default; transform: none; }

.call:focus-visible, .text-btn:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}

.note {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--off);
  text-align: center;
  word-break: keep-all;
  white-space: pre-line;
}

.note svg { flex-shrink: 0; margin-top: 3px; }

.noscript {
  position: fixed;
  inset: auto 0 40% 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 키가 작은 폰(예: 375×667 미만)에서도 스크롤 없이 */
@media (max-height: 640px) {
  .top { padding-top: 12px; }
  .car { width: min(52%, 200px); }
  .bubble { margin-top: 16px; padding: 16px; }
  .msg { font-size: 19px; }
  .vnum { margin-bottom: 8px; padding: 10px 14px; }
}
