:root {
  --orange: #f59a19;
  --orange-dark: #d9840c;
  --orange-soft: rgba(245, 154, 25, 0.08);
  --ink: #252724;
  --mute: #82847e;
  --line: #e9eae5;
  --paper: #fafbf8;
  --white: #ffffff;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.test-banner {
  background: #fff4e0;
  color: var(--orange-dark);
  text-align: center;
  font-size: 14px;
  padding: 6px 16px;
}

.top {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px;
}

.brand {
  background: none;
  border: 0;
  font-weight: 700;
  font-size: 18px;
  padding: 0;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 64px;
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

h1 {
  font-size: 26px;
  margin: 8px 0 8px;
}

h2 {
  font-size: 20px;
  margin: 0 0 12px;
}

h3 {
  font-size: 17px;
  margin: 0 0 6px;
}

.mute {
  color: var(--mute);
}

.small {
  font-size: 14px;
}

.btn {
  display: inline-block;
  border: 0;
  border-radius: 12px;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  padding: 14px 24px;
  min-height: 52px;
}

.btn:hover {
  background: var(--orange-dark);
}

.btn:disabled {
  background: var(--line);
  color: var(--mute);
  cursor: default;
}

.btn.ghost {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn.ghost:hover {
  background: var(--orange-soft);
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.row.between {
  justify-content: space-between;
}

.home-actions .btn {
  flex: 1 1 220px;
  font-size: 19px;
  min-height: 72px;
}

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
}

.check input {
  width: 24px;
  height: 24px;
  margin-top: 2px;
  accent-color: var(--orange);
  flex: none;
}

.check ul {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--mute);
  font-size: 14px;
}

.input {
  width: 100%;
  font: inherit;
  font-size: 24px;
  letter-spacing: 1px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.input:focus,
.btn:focus-visible,
.choice:focus-visible,
.oil:focus-visible {
  outline: 3px solid rgba(245, 154, 25, 0.45);
  outline-offset: 2px;
}

.error {
  color: #c0392b;
  margin-top: 8px;
  min-height: 1.6em;
}

/* 진행 막대 */
.progress {
  height: 8px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0 20px;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--orange);
  width: 0;
  transition: width 0.2s;
}

.q-section {
  color: var(--orange-dark);
  font-weight: 700;
  font-size: 15px;
}

.q-text {
  font-size: 22px;
  font-weight: 700;
  margin: 8px 0 20px;
}

.choices {
  display: grid;
  gap: 10px;
}

.choice {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  min-height: 56px;
}

.choice:hover {
  background: var(--orange-soft);
}

.choice.on {
  border-color: var(--orange);
  background: var(--orange-soft);
  font-weight: 700;
}

.scale10 {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 6px;
}

.scale10 .choice {
  text-align: center;
  padding: 12px 0;
  min-height: 56px;
}

.scale-ends {
  display: flex;
  justify-content: space-between;
  color: var(--mute);
  font-size: 14px;
  margin-top: 8px;
}

@media (max-width: 560px) {
  .scale10 {
    grid-template-columns: repeat(6, 1fr);
  }
}

/* 오일 고르기 */
.oils {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.oil {
  position: relative;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 12px;
  min-height: 120px;
  text-align: center;
}

.oil .dot {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--oil, var(--orange));
  margin: 0 auto 8px;
}

.oil .name {
  display: block;
  font-weight: 700;
  font-size: 18px;
}

.oil .kw {
  display: block;
  color: var(--mute);
  font-size: 13px;
}

.oil:hover {
  background: var(--orange-soft);
}

.oil.on {
  border-color: var(--oil, var(--orange));
}

.oil .badge {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  line-height: 30px;
}

.order-line {
  margin-top: 16px;
  color: var(--mute);
  min-height: 1.6em;
}

/* 보고서 */
.report-head {
  border-top: 6px solid var(--orange);
}

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: 14px;
  font-weight: 700;
}

.bar-row {
  display: grid;
  grid-template-columns: 110px 1fr 76px;
  gap: 10px;
  align-items: center;
  margin: 8px 0;
}

.bar {
  height: 12px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  background: var(--orange);
  width: var(--w, 0%);
}

.trait {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}

.trait:first-of-type {
  border-top: 0;
}

.oil-read {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.oil-read .rank {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--oil, var(--orange));
  color: #fff;
  font-weight: 700;
  text-align: center;
  line-height: 34px;
}

.oil-read.rejected .rank {
  opacity: 0.55;
}

.tag {
  font-size: 13px;
  color: var(--mute);
  margin-left: 6px;
}

.caution {
  background: #fff4e0;
  border-color: #f5c27a;
}

.list {
  margin: 0;
  padding-left: 20px;
}

.list li {
  margin: 6px 0;
}

table.compare,
table.history {
  width: 100%;
  border-collapse: collapse;
}

table.compare th,
table.compare td,
table.history th,
table.history td {
  border-bottom: 1px solid var(--line);
  padding: 10px 6px;
  text-align: left;
}

table.history tr.click {
  cursor: pointer;
}

table.history tr.click:hover {
  background: var(--orange-soft);
}

.up {
  color: #2e8b57;
}

.down {
  color: #c0392b;
}

@media print {
  .test-banner,
  .top,
  .no-print {
    display: none;
  }
  .card {
    break-inside: avoid;
  }
}

/* ---- 고객 화면 추가 ---- */
.slide {
  text-align: center;
  padding: 32px 20px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: fade-in 0.35s ease;
}

.slide .emoji {
  font-size: 64px;
  line-height: 1.2;
  margin-bottom: 12px;
}

.slide h2 {
  font-size: 24px;
}

.slide p {
  font-size: 18px;
  margin: 8px 0 0;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
}

.dots span.on {
  background: var(--orange);
  width: 22px;
  border-radius: 99px;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .slide {
    animation: none;
  }
}

.code-input {
  text-align: center;
  font-size: 36px;
  letter-spacing: 12px;
}

.done {
  text-align: center;
  padding: 48px 24px;
}

.done .emoji {
  font-size: 64px;
}

.done .big {
  font-size: 22px;
  font-weight: 700;
  margin: 16px 0 8px;
}

/* 플리비 캐릭터 (00.plibee.character) */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.brand-bee {
  width: 40px;
  height: 40px;
}
.slide .bee,
.done .bee {
  display: block;
  width: 150px;
  height: 150px;
  margin: 0 auto 12px;
}

.intro-video {
  display: block;
  width: 100%;
  max-height: 70vh;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 16px;
  margin-top: 12px;
}

/* ---- 휴대폰·웹뷰에 딱 맞게 (2026-11-21) ---- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* 아이폰 노치·아래 막대 피하기 */
.top {
  padding-top: max(16px, env(safe-area-inset-top));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

main {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(32px, calc(env(safe-area-inset-bottom) + 16px));
}

img,
video {
  max-width: 100%;
}

.btn,
.choice,
.oil {
  touch-action: manipulation; /* 두 번 눌러 확대 막기 */
  user-select: none;
  -webkit-user-select: none;
}

/* 소개 영상: 제목·버튼까지 한 화면에 들어가게 높이를 맞춘다 */
.intro-video {
  width: min(100%, calc((100vh - 330px) * 9 / 16));
  width: min(100%, calc((100svh - 330px) * 9 / 16));
  max-height: none;
  margin: 12px auto 0;
  object-fit: contain;
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .top {
    padding-bottom: 10px;
  }

  .brand {
    font-size: 17px;
  }

  .brand-bee {
    width: 32px;
    height: 32px;
  }

  .card {
    padding: 18px 16px;
    border-radius: 14px;
  }

  h2 {
    font-size: 19px;
  }

  .q-text {
    font-size: 20px;
    margin-bottom: 16px;
  }

  /* 아래 버튼 두 개는 반반으로 꽉 차게 */
  .row {
    margin-top: 16px;
    gap: 10px;
  }

  .row.between > .btn {
    flex: 1 1 0;
    padding: 14px 8px;
  }

  /* 오일은 2개씩 */
  .oils {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .oil {
    padding: 16px 8px;
    min-height: 104px;
  }

  .slide {
    min-height: 0;
    padding: 12px 4px;
  }

  .slide .bee,
  .done .bee {
    width: 120px;
    height: 120px;
  }

  .done {
    padding: 32px 16px;
  }

  .code-input {
    font-size: 32px;
    letter-spacing: 10px;
  }

  .intro-video {
    width: min(100%, calc((100vh - 312px) * 9 / 16));
    width: min(100%, calc((100svh - 312px) * 9 / 16));
  }
}

/* 아주 좁은 휴대폰 (갤럭시 폴드 접은 화면 등) */
@media (max-width: 360px) {
  .scale10 {
    grid-template-columns: repeat(4, 1fr);
  }

  .oil .name {
    font-size: 16px;
  }
}

/* 버튼 줄 안의 버튼 묶음(다시 고르기·다음) */
.row .row {
  margin-top: 0;
}

@media (max-width: 560px) {
  .row.between > .row {
    flex: 2 1 0;
    flex-wrap: nowrap;
  }

  .row.between > .row > .btn {
    flex: 1 1 0;
    padding: 14px 6px;
  }
}

.btn {
  white-space: nowrap;
}

@media (max-width: 560px) {
  .row.between > .btn:first-child {
    flex: 0 0 auto;
    padding: 14px 18px;
  }

  .row.between > .btn:only-child,
  .row.between > .btn + .btn {
    flex: 1 1 0;
  }

  .oil {
    min-height: 88px;
    padding: 14px 8px;
  }
}

/* ===== 소개 영상: 들어오면 바로 눈에 띄게 (2026-11-21) ===== */
.intro-card {
  text-align: center;
}
.intro-head {
  margin-bottom: 12px;
}
.step-badge {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  border-radius: 99px;
  padding: 3px 12px;
}
.intro-title {
  font-size: 24px;
  margin: 8px 0 2px;
}
.intro-sub {
  margin: 0;
  color: var(--orange-dark);
  font-weight: 700;
  font-size: 15px;
}
.video-wrap {
  position: relative;
  width: min(100%, calc((100vh - 352px) * 9 / 16));
  width: min(100%, calc((100svh - 352px) * 9 / 16));
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(245, 154, 25, 0.28);
}
.video-wrap .intro-video {
  width: 100%;
  margin: 0;
  border-radius: 0;
}
.play-cover {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 35%, rgba(0, 0, 0, 0.45) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: pointer;
  touch-action: manipulation;
}
.play-cover[hidden] {
  display: none;
}
.play-circle {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.play-circle::after {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 4px solid rgba(245, 154, 25, 0.7);
  animation: play-ring 1.6s ease-out infinite;
}
.play-tri {
  width: 0;
  height: 0;
  margin-left: 8px;
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  border-left: 30px solid #fff;
}
.play-text {
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-weight: 700;
  font-size: 16px;
  border-radius: 99px;
  padding: 8px 18px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
@keyframes play-ring {
  from {
    transform: scale(0.9);
    opacity: 1;
  }
  to {
    transform: scale(1.35);
    opacity: 0;
  }
}
.intro-actions {
  justify-content: center;
  margin-top: 14px;
}
.intro-actions .btn {
  min-width: 200px;
}
.intro-actions .btn.ghost {
  min-height: 44px;
  padding: 10px 18px;
  font-size: 14px;
  color: var(--mute);
}
.btn.pulse {
  animation: btn-pulse 1.4s ease-in-out infinite;
}
@keyframes btn-pulse {
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 0 8px rgba(245, 154, 25, 0.18);
  }
}
@media (prefers-reduced-motion: reduce) {
  .play-circle::after,
  .btn.pulse {
    animation: none;
  }
}
@media (max-width: 560px) {
  .video-wrap {
    width: min(100%, calc((100vh - 322px) * 9 / 16));
    width: min(100%, calc((100svh - 322px) * 9 / 16));
  }
  .intro-title {
    font-size: 22px;
  }
  .row.intro-actions > .btn:first-child {
    flex: 0 0 auto;
  }
}
