/* SEALO 공통 — 본문 17px/1.6 · 버튼 18px · 입력 16px 하한 · 터치 48px · Light/Thin 금지 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--surface); color: var(--fg); font-family: var(--kr);
  font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font-family: inherit; font-size: 16px; color: var(--fg); }
button { cursor: pointer; }
a { color: var(--primary-weak-fg); }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* 상단 */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.mark {
  width: 36px; height: 36px; border: 2px solid var(--seal); border-radius: 7px; color: var(--seal);
  font-weight: 700; font-size: 11px; letter-spacing: -.5px; display: grid; place-items: center; transform: rotate(-4deg);
}
.brand { font-weight: 700; font-size: 17px; color: var(--fg); text-decoration: none; }
.brand small { display: block; font-weight: 500; font-size: 13px; color: var(--muted); }
.site-header nav { margin-left: auto; }
.site-header nav a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 12px; font-size: 16px; font-weight: 600; text-decoration: none; color: var(--body); }

/* 전 화면 공통 — 상단 고정 헤더 (화면 v2 P1 §2). 로고=홈, 우측은 내 말투 상태(이번 세션 한정). */
.gheader { position: sticky; top: 0; z-index: 8; background: var(--surface); border-bottom: 1px solid var(--line); }
.gheader .wrap { display: flex; align-items: center; min-height: 52px; gap: 12px; }
.glogo { font-weight: 800; font-size: 18px; color: var(--fg); text-decoration: none; letter-spacing: -.01em; display: inline-flex; align-items: center; min-height: 48px; }
.gvoice { margin-left: auto; display: inline-flex; align-items: center; min-height: 48px; padding: 0 12px; font-size: 14.5px; font-weight: 700; color: var(--primary-weak-fg); background: var(--primary-weak-bg); border-radius: 999px; text-decoration: none; }

/* 전 화면 공통 — 하단 고정 탭바, 정확히 4개 (화면 v2 P1 §3). 아이콘+글자 항상 함께,
   현재 위치는 색 하나가 아니라 색+굵기+상단 밑선 2개 이상으로 표시(색약 대응).
   padding-bottom(safe-area)은 /voice에서 .foot이 뜬 결과 화면에는 가려 시각적으로
   무의미해 보이지만 지우면 안 된다 — .foot이 보이는 동안(.app.has-foot, voice.css)만
   .gtabs가 bottom:72px로 뜨고, 그 상태에서도 이 값이 함께 늘어나야 .foot 위 오프셋이
   safe-area 유무와 무관하게 유지된다. .foot이 숨는 화면(원장 S-021 이후 기본값)에서는
   .gtabs가 이 선언 그대로 화면 바닥에 붙는다(sealo-reviewer PR #43·#44 실측). */
.gtabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; display: flex; background: var(--surface); border-top: 1px solid var(--line); max-width: 720px; margin: 0 auto; padding-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
.gtab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 60px; padding: 6px 4px 8px; border: 0; border-top: 2px solid transparent; background: none;
  color: var(--muted); font-size: 12px; font-weight: 600; text-decoration: none;
}
.gtab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.gtab.on { color: var(--primary); font-weight: 800; border-top-color: var(--primary); }

/* 빵부스러기 */
.crumb { font-size: 14px; color: var(--muted); padding: 12px 0 0; }
.crumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.crumb li + li::before { content: "›"; margin-right: 6px; color: var(--muted); }
.crumb a { color: var(--body); text-decoration: none; display: inline-flex; align-items: center; min-height: 48px; }
.crumb li { display: inline-flex; align-items: center; min-height: 48px; }

/* 히어로·본문 */
main { padding: 40px 0 64px; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
h1 { font-size: clamp(1.7rem, 5.2vw, 2.4rem); font-weight: 700; line-height: 1.35; letter-spacing: -.02em; }
h1 .accent { color: var(--primary); }
h2 { font-size: 21px; font-weight: 700; line-height: 1.35; letter-spacing: -.01em; }
.define { margin-top: 20px; padding-left: 16px; border-left: 3px solid var(--primary); color: var(--body); font-size: 17px; max-width: 56ch; }
.define strong { color: var(--fg); font-weight: 600; }
.slogan { margin-top: 16px; color: var(--muted); font-size: 16px; }
.lead { color: var(--body); font-size: 17px; margin-top: 8px; }

.trust { display: flex; flex-direction: column; gap: 6px; margin: 18px 0 0; padding: 12px 14px; background: var(--bg2); border-radius: 10px; font-size: 15px; color: var(--body); }
.trust span::before { content: "✓ "; color: var(--state-ok); font-weight: 700; }

/* 버튼·칩 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 48px; padding: 0 18px; border-radius: 10px; border: 0;
  background: var(--primary); color: #fff; font-size: 18px; font-weight: 700; text-decoration: none;
  transition: background .15s;
}
.btn:hover { background: var(--primary-hover); }
.btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--fg); border: 1px solid var(--line); font-weight: 600; font-size: 16px; }
.btn.ghost:hover { background: var(--bg2); }
.btn.seal { background: var(--seal); color: #fff; }
.btn.seal.done { background: var(--fg); }
.btn.sm { width: auto; padding: 0 14px; font-size: 15px; }
.btn.full { width: 100%; }
.row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.row .btn { flex: 1; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.chip {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px; border: 1px solid var(--line);
  background: var(--surface); border-radius: 999px; font-size: 15px; color: var(--body);
}
.chip.on { border-color: var(--primary); color: var(--primary-weak-fg); background: var(--primary-weak-bg); font-weight: 600; }
.alt { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* 카드·입력 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.card + .card { margin-top: 12px; }
.card h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
textarea {
  width: 100%; min-height: 120px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  font-size: 16px; line-height: 1.6; resize: vertical; background: var(--surface);
}
textarea:focus { outline: none; border-color: var(--primary); }
input[type="text"], input[type="email"] {
  width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 10px; padding: 0 14px; font-size: 16px; background: var(--surface);
}
input:focus { outline: none; border-color: var(--primary); }
.hint { font-size: 14px; color: var(--muted); margin-top: 10px; }

/* 공통 입력 시스템 — 파일 첨부 + 글자 수 카운터 */
.attach { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.attach-note { font-size: 13px; color: var(--muted); }
.card.dragover { outline: 2px dashed var(--primary); outline-offset: -2px; background: var(--primary-weak-bg); }
.filelist { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.filechip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg2); font-size: 14px; }
.filechip .fname { flex: 1 1 auto; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filechip .fsize { color: var(--muted); font-size: 13px; flex: 0 0 auto; }
.filechip .fdel { flex: 0 0 auto; min-width: 48px; min-height: 48px; margin: -12px -6px -12px 0; border: 0; background: none; color: var(--muted); font-size: 18px; }
.charcount { text-align: right; font-size: 13px; color: var(--muted); margin-top: 6px; }
.state { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--primary-weak-bg); color: var(--primary-weak-fg); font-size: 15px; font-weight: 600; }
.state.err { background: var(--state-bad-bg); color: var(--state-bad); }
.dots::after { content: ""; animation: dots 1.4s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* 진입 화면 — 단일 입력 카드 */
.start-card { margin-top: 24px; }
.start-h2 { margin-bottom: 4px; }
.alt-link { margin-top: 14px; font-size: 15px; color: var(--muted); }

/* 대기목록·FAQ (랜딩·격자) */
.cta-box { margin-top: 40px; padding: 24px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg2); }
.cta-box p { margin-top: 6px; color: var(--body); font-size: 16px; }
.cta-box form { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.cta-box input[type="email"] { flex: 1 1 220px; }
.form-note { margin-top: 10px; font-size: 14px; color: var(--muted); }
.form-done { margin-top: 12px; color: var(--state-ok); font-size: 16px; font-weight: 600; }
.faq { margin-top: 40px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { min-height: 56px; display: flex; align-items: center; cursor: pointer; font-size: 17px; font-weight: 600; list-style: none; padding: 8px 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; color: var(--muted); font-size: 20px; }
.faq details[open] summary::after { content: "−"; }
.faq p { padding: 0 0 16px; color: var(--body); font-size: 16px; }
.free-note { margin-top: 12px; font-size: 15px; color: var(--primary-weak-fg); background: var(--primary-weak-bg); border-radius: 8px; padding: 10px 12px; }

footer { border-top: 1px solid var(--line); padding: 24px 0 100px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
footer a { color: var(--muted); }

/* 본문 속 텍스트 링크 — 시각 크기는 그대로 두고 터치 영역만 48px (음수 마진으로 줄 간격 불변) */
p a, footer a, .free a, .free-note a, .define a, .trust a {
  display: inline-block; line-height: 24px; padding: 12px 0; margin: -12px 0;
}

/* 토스트 */
#toast {
  position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%) translateY(8px);
  background: var(--fg); color: #fff; font-size: 14px; padding: 10px 16px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 10; max-width: 92vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
