:root {
    --bg: #0D1420; --card: #141D2B; --card2: #1A2536; --line: #253247; --line2: #314159;
    --text: #E8EDF5; --text2: #A6B1C3; --accent: #8FB4FF; --on: #0B1222;
  }
  * { box-sizing: border-box; }
  html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Pretendard, sans-serif; }
  body { min-height: 100vh; display: flex; flex-direction: column; }
  button { font-family: inherit; }

  /* 맨 위 */
  .top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
  .top .in { max-width: 720px; margin: 0 auto; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
  .top img { height: 30px; }
  .top .ttl { flex: 1; text-align: center; font-size: 16px; font-weight: 600; }
  .top a.x { color: var(--text2); text-decoration: none; font-size: 24px; line-height: 1; width: 30px; text-align: right; }
  .prog { height: 3px; background: var(--line); }
  .prog i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .35s ease; }

  /* 질문 화면 */
  main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 30px 16px 150px; position: relative; }
  .step { display: none; }
  .step.on { display: block; animation: stepIn .42s cubic-bezier(.22, .8, .28, 1) both; }
  .step.on.from-back { animation-name: stepInBack; }
  .step.leaving { display: block; position: absolute; left: 16px; right: 16px; top: 30px; pointer-events: none; animation: stepOut .32s ease forwards; }
  .step.leaving.from-back { animation-name: stepOutBack; }
  @keyframes stepIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
  @keyframes stepInBack { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
  @keyframes stepOut { to { opacity: 0; transform: translateY(-16px); } }
  @keyframes stepOutBack { to { opacity: 0; transform: translateY(18px); } }
  @media (prefers-reduced-motion: reduce) {
    .step.on, .step.leaving { animation: none; }
  }
  .count { font-size: 13px; color: var(--accent); font-weight: 600; letter-spacing: .04em; }
  h1 { margin: 8px 0 6px; font-family: "Noto Serif KR", serif; font-size: 26px; font-weight: 700; line-height: 1.4; }
  .lead { margin: 0 0 24px; color: var(--text2); font-size: 15px; line-height: 1.6; }
  .group { margin: 22px 0 8px; font-size: 12.5px; color: var(--text2); }

  /* 고르는 카드 */
  .opt { display: flex; align-items: center; gap: 14px; width: 100%; margin-bottom: 10px; padding: 18px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
  .opt:hover { border-color: var(--line2); background: var(--card2); }
  .opt .t { flex: 1; min-width: 0; }
  .opt b { display: block; font-size: 17px; font-weight: 600; }
  .opt small { display: block; margin-top: 5px; font-size: 13.5px; color: var(--text2); line-height: 1.5; }
  .opt .tag { flex: none; font-size: 13.5px; font-weight: 600; color: var(--text2); white-space: nowrap; }
  .opt .ck { flex: none; width: 22px; height: 22px; border: 1.5px solid var(--line2); border-radius: 6px; display: flex; align-items: center; justify-content: center; }
  .opt.round .ck { border-radius: 50%; }
  .opt.sel { border-color: var(--accent); background: rgba(143,180,255,.08); }
  .opt.sel .tag { color: var(--accent); }
  .opt.sel .ck { background: var(--accent); border-color: var(--accent); }
  .opt.sel .ck::after { content: ""; width: 6px; height: 11px; border: solid var(--on); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg) translate(-1px, -1px); }

  /* 길이 고르기: 작은 칸 여러 개 */
  .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .grid .opt { margin: 0; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; }
  .grid .opt b { font-size: 18px; }
  .grid .opt small { margin: 0; }
  .grid .opt .ck { display: none; }
  .more { margin-top: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); display: none; }
  .more.on { display: block; }
  .more label { font-size: 14px; color: var(--text2); }
  .more .row { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
  .more input { width: 90px; padding: 12px; border: 1px solid var(--line2); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 17px; font-family: inherit; text-align: right; }
  .more span { font-size: 15px; }

  /* 통화·현장 길이 고르기 */
  .rec { margin-bottom: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); transition: border-color .15s, background .15s; }
  .rec.sel { border-color: var(--accent); background: rgba(143,180,255,.08); }
  .rec-hd { display: flex; align-items: flex-start; gap: 12px; }
  .rec-hd .t { flex: 1; }
  .rec-hd b { display: block; font-size: 17px; font-weight: 600; }
  .rec-hd small { display: block; margin-top: 5px; font-size: 13.5px; color: var(--text2); line-height: 1.5; }
  .rec-hd .tag { flex: none; font-size: 13.5px; font-weight: 600; color: var(--text2); }
  .rec.sel .tag { color: var(--accent); }
  .rec-pick { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
  .rec-pick select { flex: 0 0 110px; padding: 12px 12px; border: 1px solid var(--line2); border-radius: 8px; background: var(--bg); color: var(--text); font-size: 16px; font-family: inherit; cursor: pointer; }
  .rec-won { margin-left: auto; font-size: 16px; font-weight: 700; color: var(--accent); }

  /* 받으실 분 정보 */
  .info { display: grid; gap: 14px; }
  .fld { display: block; }
  .fld span { display: block; margin-bottom: 7px; font-size: 14.5px; font-weight: 600; }
  .fld em { font-style: normal; color: var(--accent); }
  .fld small { margin-left: 4px; font-weight: 400; font-size: 12.5px; color: var(--text2); }
  .fld.sub { margin-top: -6px; }
  .fld input { width: 100%; padding: 15px 16px; border: 1px solid var(--line2); border-radius: 10px; background: var(--card); color: var(--text); font-size: 16px; font-family: inherit; }
  .fld input:focus { outline: none; border-color: var(--accent); }
  .fld input::placeholder { color: #66738A; }
  .agree { display: flex; gap: 10px; align-items: flex-start; margin-top: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; color: var(--text2); line-height: 1.6; cursor: pointer; }
  .agree b { color: var(--text); font-size: 14px; }
  .agree input { margin-top: 3px; width: 18px; height: 18px; accent-color: #8FB4FF; flex: none; }
  .hint { margin: 0; min-height: 18px; font-size: 13px; color: var(--accent); }

  /* 파일 올리기 */
  .up { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
  .up-hd b { display: block; font-size: 16px; }
  .up-hd small { display: block; margin-top: 4px; font-size: 13px; color: var(--text2); }
  .drop { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 14px; padding: 22px; border: 1.5px dashed var(--line2); border-radius: 10px; cursor: pointer; text-align: center; }
  .drop.over, .drop:hover { border-color: var(--accent); background: rgba(143,180,255,.06); }
  .drop input { display: none; }
  .drop b { font-size: 15px; color: var(--accent); }
  .drop span { font-size: 13px; color: var(--text2); }
  .flist { list-style: none; margin: 10px 0 0; padding: 0; }
  .flist li { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
  .flist li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .flist li small { color: var(--text2); white-space: nowrap; }
  .flist li button { border: 0; background: none; color: var(--text2); font-size: 20px; cursor: pointer; padding: 0 4px; }
  .flist li.warn { color: #FFB4A8; font-size: 13px; border: 0; }

  /* 결과 */
  .result { border: 1px solid var(--line2); border-radius: 14px; background: var(--card); overflow: hidden; }
  .result .head { padding: 26px 22px 22px; text-align: center; border-bottom: 1px solid var(--line); }
  .result .head p { margin: 0; color: var(--text2); font-size: 14px; }
  .result .big { margin: 8px 0 4px; font-family: "Noto Serif KR", serif; font-size: 42px; font-weight: 700; }
  .result .big small { font-size: 22px; margin-left: 2px; }
  .result ul { list-style: none; margin: 0; padding: 8px 22px 16px; }
  .result li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
  .result li:last-child { border-bottom: 0; }
  .result li span { color: var(--text2); }
  .result li b { font-weight: 600; text-align: right; }
  .result li.minus b { color: var(--accent); }
  .note { margin: 14px 2px 0; font-size: 13px; color: var(--text2); line-height: 1.6; }
  .acts { display: grid; gap: 10px; margin-top: 22px; }
  .acts a { display: block; padding: 16px; border-radius: 10px; text-align: center; text-decoration: none; font-size: 16px; font-weight: 700; }
  .acts .main-btn { background: var(--accent); color: var(--on); }
  .acts .sub-btn { border: 1px solid var(--line2); color: var(--text); }
  .acts .sub-btn.kakao { border-color: #FEE500; color: #FEE500; }

  /* 아래 버튼 */
  .bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--bg); border-top: 1px solid var(--line); }
  .bottom .in { max-width: 720px; margin: 0 auto; padding: 12px 16px 16px; }
  .bottom .live { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 13.5px; color: var(--text2); }
  .bottom .live b { font-size: 18px; color: var(--text); }
  .bottom .btns { display: flex; gap: 10px; }
  .bottom button { padding: 16px; border-radius: 10px; font-size: 16px; font-weight: 700; cursor: pointer; }
  .bottom .back { flex: 0 0 96px; border: 1px solid var(--line2); background: none; color: var(--text); }
  .bottom .next { flex: 1; border: 0; background: var(--accent); color: var(--on); }
  .bottom .next:disabled { background: var(--line); color: var(--text2); cursor: default; }

  @media (max-width: 520px) {
    h1 { font-size: 22px; }
    .grid { grid-template-columns: repeat(2, 1fr); }
    .result .big { font-size: 36px; }
  }
  .lead-tight { margin-bottom: 8px; }
  .ink { color: var(--text); }
  .note-center { text-align: center; margin-top: 18px; }
  .again { color: var(--text2); }

