/* 짝공 v12 목업 · 시안(Codex 생성 보드) 재현
   레이아웃: 데스크톱은 휴대폰 프레임 + 체험 패널, 폰 폭에서는 앱 전체 화면 */
:root {
  --bg: #fbf8f2;          /* 앱 아이보리 바탕 */
  --stage: #efe9de;       /* 데스크톱 무대 */
  --card: #ffffff;
  --ink: #0f3d47;         /* 짙은 청록 제목 */
  --ink-2: #44575e;       /* 본문 */
  --muted: #8b979b;       /* 보조 */
  --line: #ebe6dc;
  --teal: #0e5160;        /* 보조 버튼 */
  --teal-2: #3bb8b0;      /* 캐릭터 청록 */
  --coral: #f4605a;       /* 주 버튼 */
  --coral-press: #e14f4a;
  --green: #2f9256; --green-bg: #e3f4e6;
  --amber: #e1861b; --amber-bg: #fff0dc;
  --gray: #6b787d;  --gray-bg: #eef0f1;
  --blue-bg: #e9f3fb; --yellow-bg: #fff3d3; --lav-bg: #f2edfb;
  --shadow: 0 6px 22px rgba(70, 55, 30, .08);
  --shadow-lg: 0 30px 80px rgba(60, 45, 25, .22);
  --font: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --hand: "Gaegu", "Noto Sans KR", cursive;
  color-scheme: light;
}
html, body { height: 100%; }
body {
  margin: 0; background: var(--stage); color: var(--ink-2);
  font-family: var(--font); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
* { box-sizing: border-box; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid rgba(14, 81, 96, .45); outline-offset: 2px; border-radius: 10px; }
img { display: block; max-width: 100%; }

/* ── 무대 ─────────────────────────────── */
.stage { min-height: 100%; display: flex; gap: 40px; justify-content: center; align-items: center; padding: 32px 24px; }
.phone {
  position: relative; width: 390px; height: 844px; flex: none;
  background: var(--bg); border-radius: 52px; overflow: hidden;
  box-shadow: 0 0 0 10px #fffdf9, 0 0 0 11px #e2dccf, var(--shadow-lg);
}
.panel { width: 300px; flex: none; display: grid; gap: 14px; align-self: center; }
.panel h1 { margin: 0; font-size: 26px; font-weight: 900; color: var(--ink); letter-spacing: -.5px; }
.panel .lead { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.pbox { background: #fffdf8; border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; gap: 10px; }
.pbox h2 { margin: 0; font-size: 12px; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.pbtn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pbtn small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; }
.pbtn:hover { border-color: #cfc7b8; }
.pbtn .tag { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--teal); }
.pbtn .tag.b { background: var(--coral); }
.seg { display: flex; background: var(--gray-bg); border-radius: 10px; padding: 3px; }
.seg button { flex: 1; padding: 7px 4px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--gray); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.jump { display: flex; flex-wrap: wrap; gap: 6px; }
.jump button { padding: 6px 9px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 12px; color: var(--ink-2); }
.jump button[aria-current="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.pnote { font-size: 11.5px; color: var(--muted); line-height: 1.55; margin: 0; }
.fab { display: none; }

@media (max-width: 760px) {
  body { background: var(--bg); }
  .stage { padding: 0; height: 100%; min-height: 0; display: block; }
  .phone { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
  .phone .statusbar { display: none; }
  .panel { position: fixed; inset: auto 0 0 0; width: auto; z-index: 60; background: var(--bg); border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -10px 40px rgba(0,0,0,.18); max-height: 82%; overflow: auto; transform: translateY(105%); transition: transform .28s ease; }
  .panel.open { transform: none; }
  .fab { display: block; position: fixed; z-index: 55; right: 0; top: 42%; writing-mode: vertical-rl; padding: 12px 5px; border-radius: 10px 0 0 10px; background: rgba(15, 61, 71, .82); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; box-shadow: 0 4px 14px rgba(0,0,0,.16); }
  .scrim-panel { position: fixed; inset: 0; z-index: 58; background: rgba(20, 30, 32, .35); }
}

/* ── 앱 골격 ─────────────────────────── */
.app { position: absolute; inset: 0; display: flex; flex-direction: column; }
.statusbar { height: 50px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 14px 30px 0 34px; font-size: 15px; font-weight: 700; color: #111; }
.statusbar .sys { display: flex; gap: 6px; align-items: center; }
.view { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; scrollbar-width: none; }
.view::-webkit-scrollbar { display: none; }
.pad { padding: 0 20px; }
.stack { display: grid; gap: 12px; }

.topbar { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; height: 52px; padding: 0 8px; background: var(--bg); }
.topbar h2 { margin: 0; text-align: center; font-size: 17px; font-weight: 700; color: var(--ink); }
.iconbtn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; color: var(--ink); }
.iconbtn:active { background: rgba(0,0,0,.05); }

.brandbar { display: flex; align-items: flex-start; justify-content: space-between; padding: 10px 20px 0; }
.brand { font-size: 28px; font-weight: 900; color: var(--ink); letter-spacing: -1px; line-height: 1.1; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

h1.hl { margin: 0; font-size: 30px; line-height: 1.22; font-weight: 900; color: var(--ink); letter-spacing: -1px; text-wrap: balance; }
h1.hl.center { text-align: center; }
h1.hl em { font-style: normal; color: var(--coral); }
.sub { margin: 6px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.sub.center { text-align: center; }
.label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.bold { font-weight: 700; color: var(--ink); }

/* 일러스트 */
.hero { position: relative; margin-top: 10px; }
.hero img { width: 100%; height: auto; }
.hero.fade::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40px; background: linear-gradient(transparent, var(--bg)); }
.hero.invite { margin: 2px 0 6px; padding: 0 20px; }
.hero.invite img { mix-blend-mode: multiply; max-height: 220px; width: auto; margin: 0 auto; }
.av.md { width: 44px; height: 44px; }
.note-hand { position: absolute; font-family: var(--hand); font-weight: 700; font-size: 17px; color: var(--ink); transform: rotate(-12deg); }
.overlap { position: relative; z-index: 2; margin-top: -26px; }

/* 카드 */
.card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 16px; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.chev { color: #9aa5a8; flex: none; }
.listrow { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); width: 100%; text-align: left; }
.listrow .t { font-size: 15px; font-weight: 600; color: var(--ink); }
.listrow .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.ico-tile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-bg); color: #3577c4; flex: none; }

/* 버튼 */
.btn { width: 100%; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16.5px; font-weight: 700; transition: transform .08s ease, background .15s; }
.btn:active { transform: scale(.985); }
.btn.coral { background: var(--coral); color: #fff; box-shadow: 0 8px 18px rgba(244, 96, 90, .28); }
.btn.coral:active { background: var(--coral-press); }
.btn.teal { background: var(--teal); color: #fff; box-shadow: 0 8px 18px rgba(14, 81, 96, .22); }
.btn.line { background: var(--card); color: var(--ink); border: 1.5px solid #d8dcdc; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink); height: 44px; font-size: 14.5px; font-weight: 600; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; }
.link { font-size: 14px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 4px; }

/* 칩 */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.gray { background: var(--gray-bg); color: var(--gray); }
.chip.teal { background: #e3f1f1; color: var(--teal); }
.chip.soft { background: #f1ede5; color: var(--ink-2); }
.chip.big { padding: 9px 14px; font-size: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill-note { display: inline-flex; align-items: center; gap: 6px; background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; color: var(--ink); box-shadow: var(--shadow); }

/* 아바타 */
.av { width: 36px; height: 36px; border-radius: 50%; background: #f6f3ec center/118% no-repeat; flex: none; box-shadow: 0 0 0 2px #fff; }
.av.sm { width: 28px; height: 28px; }
.av.lg { width: 56px; height: 56px; }
.av.ghost { background: #eceae4; }
.avs { display: flex; }
.avs .av + .av { margin-left: -6px; }

/* 자리 그리드 (03) */
.seats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seat { background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); text-align: left; position: relative; }
.seat img { width: 100%; aspect-ratio: 152 / 116; object-fit: cover; }
.seat.empty img { opacity: .9; }
.seat .meta { padding: 9px 11px 11px; display: grid; gap: 6px; justify-items: start; }
.seat .who { font-size: 14px; font-weight: 700; color: var(--ink); }
.seat.me { outline: 2px solid var(--teal-2); outline-offset: -2px; }
.seat.dim img { filter: saturate(.5) brightness(1.04); }
.seat .flag { position: absolute; top: 8px; left: 8px; background: rgba(255,255,255,.92); border-radius: 999px; padding: 3px 8px; font-size: 11px; font-weight: 700; color: var(--teal); }

/* 타이머 */
.timer { font-size: 74px; font-weight: 900; color: var(--ink); letter-spacing: -2px; text-align: center; font-variant-numeric: tabular-nums; line-height: 1.05; }
.speed-tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--amber); background: var(--amber-bg); border-radius: 6px; padding: 2px 6px; vertical-align: middle; }
.progress { height: 6px; background: #ece7dc; border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--teal-2); border-radius: 99px; transition: width .4s linear; }

/* 반응 타일 (05) */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { border-radius: 16px; padding: 12px 6px 10px; display: grid; justify-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); }
.tile .em { font-size: 24px; line-height: 1; }
.tile.y { background: var(--yellow-bg); } .tile.b { background: var(--blue-bg); } .tile.l { background: var(--lav-bg); }
.tile.sent { outline: 2px solid var(--teal-2); }

/* 폼 */
.field { display: grid; gap: 7px; }
.field > span { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.input { height: 50px; border-radius: 14px; border: 1.5px solid #e2ded5; background: var(--card); padding: 0 14px; font-size: 15.5px; color: var(--ink); width: 100%; }
.input:focus { outline: none; border-color: var(--teal-2); }
.input.err { border-color: var(--coral); }
.help { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.err-text { font-size: 12.5px; color: var(--coral); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice button { height: 50px; border-radius: 14px; border: 1.5px solid #e2ded5; background: var(--card); font-size: 15.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; justify-content: center; gap: 6px; }
.choice button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.chips-sel { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-sel button { padding: 9px 14px; border-radius: 999px; border: 1.5px solid #e2ded5; background: var(--card); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chips-sel button[aria-pressed="true"] { border-color: var(--teal); color: var(--teal); background: #e7f3f2; }
.dob { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 8px; }
.dob select { height: 50px; border-radius: 14px; border: 1.5px solid #e2ded5; background: var(--card); padding: 0 10px; font-size: 15px; color: var(--ink); }

/* 토글 */
.toggle { position: relative; width: 50px; height: 30px; border-radius: 99px; background: #dfe3e3; flex: none; transition: background .2s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .2s; }
.toggle[aria-checked="true"] { background: var(--teal); }
.toggle[aria-checked="true"]::after { transform: translateX(20px); }

/* 정보 줄 */
.info { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.info svg { flex: none; margin-top: 1px; }
.info.center { justify-content: center; text-align: center; }
.banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; font-size: 13.5px; color: var(--ink); background: var(--blue-bg); }
.banner.warn { background: #fff1ee; color: #b5443f; }
.banner.ok { background: var(--green-bg); color: var(--green); }

/* 탭바 */
.tabbar { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 6px calc(10px + env(safe-area-inset-bottom, 0px)); background: rgba(255,255,255,.96); border-top: 1px solid var(--line); }
.tab { display: grid; justify-items: center; gap: 3px; font-size: 11.5px; color: #8e999d; padding: 4px 0; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 700; }
.phone .tabbar { padding-bottom: 24px; }

/* 시트 / 토스트 */
.scrim { position: absolute; inset: 0; z-index: 30; background: rgba(20, 32, 34, .38); animation: fade .2s ease; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 31; background: var(--bg); border-radius: 26px 26px 0 0; padding: 10px 20px calc(22px + env(safe-area-inset-bottom, 0px)); max-height: 88%; overflow-y: auto; animation: up .26s ease; display: grid; gap: 14px; }
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: #d9d4ca; margin: 0 auto 4px; }
.sheet h3 { margin: 0; font-size: 20px; font-weight: 800; color: var(--ink); }
.toast { position: absolute; left: 50%; bottom: 96px; z-index: 40; transform: translateX(-50%); background: rgba(15, 45, 52, .94); color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 13.5px; font-weight: 500; width: max-content; max-width: 86%; text-align: center; animation: toast 2.6s ease forwards; pointer-events: none; }
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(100%) } }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 8px) } 8%, 85% { opacity: 1; transform: translate(-50%, 0) } 100% { opacity: 0 } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0 } 60% { transform: scale(1.08) } 100% { transform: scale(1); opacity: 1 } }
@keyframes spin { to { transform: rotate(360deg) } }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 4px solid #e4ded2; border-top-color: var(--teal); animation: spin .8s linear infinite; margin: 0 auto; }
.pop { animation: pop .45s ease both; }

/* 기록 차트 */
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 120px; padding-top: 6px; }
.bar { display: grid; gap: 6px; justify-items: center; height: 100%; grid-template-rows: 1fr auto; }
.bar .col { width: 100%; max-width: 26px; background: #ece7dc; border-radius: 7px; position: relative; overflow: hidden; height: 100%; }
.bar .col i { position: absolute; left: 0; right: 0; bottom: 0; background: #73c9c2; border-radius: 7px; }
.bar.today .col i { background: var(--teal-2); }
.bar span { font-size: 11.5px; color: var(--muted); }
.stat2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--card); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; }
.stat b { display: block; font-size: 19px; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat small { font-size: 12px; color: var(--muted); }

/* 가격 (07) */
.price { display: flex; align-items: baseline; gap: 8px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; }
.price b { font-size: 27px; font-weight: 900; color: var(--ink); letter-spacing: -.5px; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14.5px; color: var(--ink); }
.check i { width: 22px; height: 22px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; flex: none; }
.ribbon { justify-self: center; margin-top: -30px; background: #f4efe4; color: var(--ink-2); font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; border: 1px solid #fff; }

/* 카메라 시험 */
.camwrap { position: relative; border-radius: 20px; overflow: hidden; background: #1d2a2d; aspect-ratio: 3 / 4; }
.camwrap video, .camwrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camwrap .ph { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #cfe0e0; font-size: 14px; padding: 24px; line-height: 1.6; }
.camwrap .live { position: absolute; top: 12px; left: 12px; }
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric { background: var(--card); border-radius: 14px; padding: 10px; text-align: center; box-shadow: var(--shadow); }
.metric b { display: block; font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.metric small { font-size: 11.5px; color: var(--muted); }
.trylist { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); line-height: 1.8; }

.center { text-align: center; }
.mt0 { margin-top: 0 } .mt4 { margin-top: 4px } .mt8 { margin-top: 8px } .mt12 { margin-top: 12px } .mt16 { margin-top: 16px } .mt20 { margin-top: 20px } .mt24 { margin-top: 24px }
.pb24 { padding-bottom: 24px; }
.sep { height: 1px; background: var(--line); margin: 4px 0; }
.hidden-sm { }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
