:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --ink: #1d1d1b;
  --sub: #6b6a66;
  --line: #e4e2dc;
  --accent: #c94f17;      /* 매뉴얼 그림의 주황을 흰 글씨 대비(4.5:1) 맞게 조금 진하게 */
  --accent-ink: #ffffff;
  --q: #1d1d1b;
  --q-ink: #ffffff;
  --chip: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151514; --card: #1f1f1d; --ink: #f1f0ec; --sub: #a3a29d; --line: #33322f;
    --q: #f1f0ec; --q-ink: #151514; --chip: #1f1f1d; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 19px; line-height: 1.6; letter-spacing: -0.01em;
  min-height: 100dvh; display: flex; flex-direction: column;
}
button { font: inherit; color: inherit; cursor: pointer; }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; padding-top: max(14px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo { width: 60px; height: 60px; border-radius: 15px; flex: none; display: block; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.brand h1 { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 800; letter-spacing: -0.03em; }
.brand p { margin: 0; font-size: 14px; color: var(--sub); }
.ghost { flex: none; white-space: nowrap; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 15px; color: var(--sub); }

main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 20px 16px 24px; }

.welcome .hello { font-size: 23px; font-weight: 700; line-height: 1.45; margin: 8px 0 26px; letter-spacing: -0.03em; }
.welcome .label { font-size: 15px; color: var(--sub); margin: 0 0 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  background: var(--chip); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 16px; font-size: 17px; text-align: left; box-shadow: var(--shadow);
}
.chips button:active { transform: scale(.98); }

.msg { margin: 0 0 18px; display: flex; flex-direction: column; }
.msg.q { align-items: flex-end; }
.msg.q .bubble {
  background: var(--q); color: var(--q-ink); border-radius: 20px 20px 6px 20px;
  padding: 11px 16px; max-width: 85%; font-weight: 600; white-space: pre-wrap;
}
.msg.a .bubble {
  background: var(--card); border: 1px solid var(--line); border-radius: 6px 20px 20px 20px;
  padding: 16px 18px; box-shadow: var(--shadow);
}
.body p { margin: 0 0 10px; }
.body p:last-child { margin-bottom: 0; }
.body ol, .body ul { margin: 6px 0 12px; padding-left: 0; list-style: none; counter-reset: s; }
.body ol li { counter-increment: s; position: relative; padding-left: 40px; margin: 0 0 10px; }
.body ol li::before {
  content: counter(s); position: absolute; left: 0; top: 1px;
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff;
  font-weight: 800; font-size: 16px; display: grid; place-items: center;
}
.body ul li { position: relative; padding-left: 20px; margin: 0 0 6px; }
.body ul li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 7px; height: 7px; border-radius: 50%; background: var(--sub); }
.body strong { font-weight: 800; }
.body .err { color: #c23b22; }

.typing { display: inline-flex; gap: 5px; padding: 6px 0; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--sub); opacity: .4; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: 1; } }

.figs { display: grid; gap: 10px; margin-top: 14px; }
.figs:empty { display: none; }
.figs button { padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; display: block; }
.figs img { display: block; width: 100%; height: auto; }
.figs .cap { font-size: 13px; color: var(--sub); margin: -2px 2px 0; }

.tools { display: flex; gap: 8px; margin-top: 14px; }
.tools button { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 16px; }
.tools button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

.items:empty { display: none; }
.items { margin-top: 10px; }
.item {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px;
}
.item img { width: 58px; height: 58px; border-radius: 10px; object-fit: cover; flex: none; background: #eee; }
.item .t { font-size: 13px; color: var(--sub); }
.item .n { font-size: 16px; font-weight: 700; line-height: 1.35; }
.item .go { margin-left: auto; color: var(--sub); font-size: 22px; }

.composer {
  position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line);
  padding: 10px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom));
}
form { max-width: 720px; margin: 0 auto; display: flex; align-items: flex-end; gap: 8px; }
textarea {
  flex: 1; min-width: 0; resize: none; font: inherit; font-size: 18px; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 26px;
  padding: 12px 18px; line-height: 1.4; max-height: 140px; outline: none;
}
textarea:focus { border-color: var(--ink); }
.cam { background: var(--card); border: 1.5px solid var(--line) !important; }
.cam svg { width: 26px; height: 26px; stroke: var(--ink); }
.mic, .send, .cam { flex: none; width: 50px; height: 50px; border-radius: 50%; border: none; display: grid; place-items: center; }
.mic { background: var(--accent); }
.mic svg { width: 26px; height: 26px; fill: #fff; stroke: #fff; }
.mic.on { animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(201,79,23,.5); } 100% { box-shadow: 0 0 0 16px rgba(201,79,23,0); } }
.send { background: var(--ink); }
.send svg { width: 24px; height: 24px; stroke: var(--bg); }
.send:disabled { opacity: .35; }
.fine { max-width: 720px; margin: 8px auto 0; font-size: 12.5px; color: var(--sub); line-height: 1.45; text-align: center; }

.viewer { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.88); display: grid; place-items: center; padding: 16px; }
.viewer[hidden] { display: none; }
.viewer img { max-width: 100%; max-height: 82dvh; border-radius: 12px; background: #fff; }
.viewer button { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; background: #fff; border: none; border-radius: 999px; padding: 8px 16px; font-weight: 700; }

.welcome .tip { font-size: 16px; color: var(--sub); background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin: -10px 0 24px; }
.welcome .tip b { color: var(--ink); }

.attach { max-width: 720px; margin: 0 auto 8px; display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--sub); }
.attach[hidden] { display: none; }
.attach img { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.attach button { margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 50%; width: 34px; height: 34px; }

.msg.q .qphoto { width: 180px; max-width: 60%; border-radius: 14px; margin-bottom: 6px; border: 1px solid var(--line); }
.shot { position: relative; margin-top: 14px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.shot[hidden] { display: none; }
.shot img { display: block; width: 100%; height: auto; }
.shot .ring {
  position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  border: 4px solid var(--accent); box-shadow: 0 0 0 3px #fff, 0 0 0 9999px rgba(0,0,0,.28);
}
.shot .tag {
  position: absolute; transform: translate(-50%, 36px); background: var(--accent); color: #fff;
  font-size: 15px; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}

/* ---- 화면 따라하기 ---- */
.walk { margin-top: 2px; }
.sc-stage { cursor: pointer; }
.sc-screen {
  position: relative; aspect-ratio: 776 / 485; border-radius: 14px; overflow: hidden;
  background: #e9e9ea; border: 1px solid var(--line); color: #222;
}
.sc-screen > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sc-screen.fig > img { object-fit: contain; background: #fff; }
.sc-screen.blank { display: grid; place-items: center; font-size: 48px; background: var(--card); }
.sc-ring {
  position: absolute; width: 10%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  border: 4px solid var(--accent); box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 0 0 9999px rgba(0,0,0,.30);
  animation: tap 1.4s ease-in-out infinite; pointer-events: none;
}
.sc-ring.swipe { border-radius: 999px; width: 30%; aspect-ratio: auto; height: 12%; transform: translate(-50%, 0); }
.sc-ring.swipe::after { content: "↓"; position: absolute; left: 50%; top: 110%; transform: translateX(-50%); color: #fff; font-size: 28px; font-weight: 900; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
@keyframes tap { 50% { transform: translate(-50%, -50%) scale(.86); } }
.sc-ring.swipe { animation: none; }

/* 차량기능 설정 화면 (그린 것) */
.sc-zoom { position: absolute; inset: 0; transform-origin: 0 0; transition: transform .7s ease; }
.sc-zoom > img { width: 100%; height: 100%; display: block; }
.sc-set { aspect-ratio: 4 / 3; background: #f3f3f4; font-size: clamp(12px, 3.6vw, 17px); line-height: 1.2; }
.sc-hl {
  position: absolute; border: 4px solid var(--accent); border-radius: 10px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.30); animation: hl 1.4s ease-in-out infinite;
}
@keyframes hl { 50% { border-color: rgba(201,79,23,.45); } }
.sc-set .sc-top { position: absolute; left: 0; right: 0; top: 0; height: 12%; display: flex; align-items: center; gap: 8px; padding: 0 3%; border-bottom: 1px solid #ddd; background: #fafafa; }
.sc-set .sc-top b { font-weight: 700; }
.sc-set .sc-tabs { position: absolute; left: 0; top: 12%; bottom: 0; width: 34%; margin: 0; padding: 1.5% 0; list-style: none; background: #fafafa; border-right: 1px solid #ddd; display: flex; flex-direction: column; justify-content: space-around; }
.sc-set .sc-tabs li { padding: 0 10%; color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-set .sc-tabs li.on { color: #111; font-weight: 800; background: #e6e6e8; border-radius: 6px; margin: 0 5%; padding: 2% 5%; }
.sc-set .sc-main { position: absolute; left: 34%; right: 0; top: 12%; bottom: 0; padding: 3% 4%; display: flex; flex-direction: column; gap: 4%; }
.sc-set .sc-crumb { color: #777; font-weight: 700; }
.sc-set .sc-row { background: #fff; border-radius: 8px; min-height: 14%; flex-wrap: wrap; display: flex; align-items: center; justify-content: space-between; padding: 0 4%; gap: 4%; }
.sc-set .sc-row.ghost { background: #fff; opacity: .7; }
.sc-set .sc-row.ghost::before { content: ""; width: 40%; height: 18%; border-radius: 4px; background: #e2e2e4; }
.sc-set .sc-row.target, .sc-set .sc-row.item { font-weight: 800; }
.sc-set .sc-row i { font-style: normal; color: #999; font-size: 1.4em; }
.sc-set .sc-seg { display: flex; background: #ececee; border-radius: 6px; padding: 2px; }
.sc-set .sc-seg b { font-weight: 600; padding: .35em .9em; border-radius: 5px; color: #555; }
.sc-set .sc-seg b.pick { background: #fff; color: #111; font-weight: 800; }


.sc-say { display: flex; align-items: flex-start; gap: 10px; margin: 14px 2px 4px; }
.sc-say .sc-n { flex: none; background: var(--accent); color: #fff; font-weight: 800; font-size: 15px; padding: 3px 10px; border-radius: 999px; margin-top: 3px; }
.sc-say p { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.4; letter-spacing: -0.03em; }
.sc-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.sc-nav button { flex: 1; font-size: 18px; font-weight: 800; padding: 12px 0; border-radius: 14px; border: 1px solid var(--line); background: var(--card); }
.sc-nav .next { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sc-nav button:disabled { opacity: .35; }
.sc-dots { display: flex; gap: 6px; }
.sc-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.sc-dots i.on { background: var(--accent); }
.sc-note { font-size: 12.5px; color: var(--sub); margin: 10px 2px 0; }
.body.small { font-size: 16px; color: var(--sub); }
