/* ==========================================================================
   앱노트 링크 — 레이아웃 스타일
   Basecoat CDN 빌드에는 Tailwind 유틸리티가 없으므로 레이아웃은 여기서 정의한다.
   색은 전부 Basecoat 토큰(--background, --foreground, --muted ...)에서 가져온다.
   ========================================================================== */

/* 라이트 모드 고정. Basecoat 은 .dark 클래스로 다크를 켜므로 클래스를 붙이지 않으면
   라이트가 기본이지만, OS 가 다크일 때 폼 컨트롤과 스크롤바까지 어두워지는 것을 막으려면
   color-scheme 을 명시해야 한다. (메타 태그는 CSS 선언에 밀린다) */
:root { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: Inter, "Noto Sans KR", -apple-system, BlinkMacSystemFont,
               "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  font-size: 0.875rem;
  line-height: 1.6;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}

code, .mono, .tabular {
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
.tabular { font-variant-numeric: tabular-nums; }

/* Basecoat 은 @layer 안에 있어 레이어 밖 규칙이 특이도와 무관하게 이긴다.
   .btn 의 글자색을 덮어쓰지 않도록 링크 규칙을 좁힌다. */
a:not(.btn) { color: inherit; }

/* Basecoat 카드는 <header>/<section>/<footer> 자식에만 좌우 여백을 준다.
   그 밖의 자식은 카드 테두리에 그대로 붙으므로 같은 여백을 채워 준다. */
.card > :not(header):not(section):not(footer) { padding-inline: 1.5rem; }

/* --------------------------------------------------------------- 레이아웃 */
.container { width: 100%; max-width: 60rem; margin: 0 auto; padding: 0 1.25rem; }
.container-sm { max-width: 40rem; }
.container-xs { max-width: 26rem; }

.stack   { display: flex; flex-direction: column; gap: 1.25rem; }
.stack-sm{ display: flex; flex-direction: column; gap: 0.75rem; }
.stack-xs{ display: flex; flex-direction: column; gap: 0.375rem; }

.row       { display: flex; align-items: center; gap: 0.5rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.row-end   { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.wrap      { flex-wrap: wrap; }
.grow      { flex: 1; min-width: 0; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.875rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.875rem; }
@media (max-width: 48rem) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 40rem) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

.center { text-align: center; }
.muted  { color: var(--muted-foreground); }
.small  { font-size: 0.75rem; }
.strong { font-weight: 600; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }

/* ------------------------------------------------------------- 사이트 헤더 */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--background);
  display: flex; flex-direction: column; align-items: center; gap: 1.125rem;
  padding: 1.75rem 1.25rem 1.375rem;
}
.site-header .logo { display: block; height: 1.25rem; width: auto; color: var(--foreground); }
.site-nav { display: flex; justify-content: center; gap: 0.5rem; }

.main { padding: 2.5rem 0 3rem; }

/* --------------------------------------------------------------- 페이지 헤드 */
.page-head { display: flex; flex-direction: column; gap: 0.375rem; margin-bottom: 1.5rem; }
.page-head.center { align-items: center; text-align: center; }
.page-head h1 { margin: 0; font-size: 1.5rem; font-weight: 600; letter-spacing: -0.028em; }
.page-head p  { margin: 0; color: var(--muted-foreground); }

/* ---------------------------------------------------------------- 단계 헤더 */
.step { display: flex; align-items: center; gap: 0.5rem; }
.step .n {
  width: 1.25rem; height: 1.25rem; border-radius: 0.375rem; flex: none;
  background: var(--primary); color: var(--primary-foreground);
  display: grid; place-items: center;
  font-family: "Geist Mono", monospace; font-size: 0.6875rem; font-weight: 500;
}
.step h2 { margin: 0; font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.018em; }
.step .hint {
  margin-left: auto; color: var(--muted-foreground); font-size: 0.75rem; font-weight: 400;
}

/* ------------------------------------------------------------ 접두사 입력 */
.prefixed { display: flex; align-items: stretch; }
.prefixed .prefix {
  display: flex; align-items: center; white-space: nowrap;
  padding: 0 0.6875rem;
  background: var(--muted); color: var(--muted-foreground);
  border: 1px solid var(--input); border-right: 0;
  border-radius: 0.5rem 0 0 0.5rem;
  font-family: "Geist Mono", monospace; font-size: 0.78125rem;
}
.prefixed .input { border-radius: 0 0.5rem 0.5rem 0; flex: 1; min-width: 0; }
.prefixed .btn { margin-left: 0.5rem; flex: none; }

/* -------------------------------------------------------------- 플랫폼 박스 */
.platform {
  border: 1px solid var(--border); border-radius: 0.625rem; padding: 0.875rem;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.platform > .head {
  display: flex; align-items: center; gap: 0.4375rem;
  font-size: 0.75rem; font-weight: 600; color: var(--muted-foreground);
}
.platform > .head .dot {
  width: 0.375rem; height: 0.375rem; border-radius: 50%;
  background: var(--input); flex: none;
}

/* ------------------------------------------------------------------ 앱 아이콘 */
.app-icon {
  border-radius: 0.5rem; flex: none; display: grid; place-items: center;
  color: #fff; font-weight: 700; letter-spacing: -0.03em;
  background: linear-gradient(145deg, #3f3f46, #18181b);
  width: 1.5rem; height: 1.5rem; font-size: 0.5625rem;
}
.app-icon.lg { width: 4rem; height: 4rem; border-radius: 1rem; font-size: 1.375rem; }
.app-icon.xl { width: 5rem; height: 5rem; border-radius: 1.25rem; font-size: 1.75rem; }
.app-icon.knock { background: linear-gradient(145deg, #57534e, #292524); }
.app-icon.coffee{ background: linear-gradient(145deg, #52525c, #27272a); }

/* 필수 항목 표시 — 라벨 끝에 위첨자로 붙는다 */
sup.req {
  font-size: 0.625rem; font-weight: 500; line-height: 0;
  color: var(--muted-foreground); margin-left: 0.1875rem;
  vertical-align: super; letter-spacing: 0;
}

/* ------------------------------------------------------------ 이미지 업로드 */
.upload { display: flex; align-items: flex-start; gap: 0.875rem; }
.upload > .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.375rem; }
.upload input[type="file"] { font-size: 0.8125rem; }

/* 업로드 전 자리를 지키는 미리보기 상자 */
.thumb {
  flex: none; border: 1px solid var(--border); border-radius: 0.5rem;
  background: var(--muted); display: grid; place-items: center; overflow: hidden;
  color: var(--muted-foreground); font-size: 0.6875rem; text-align: center;
}
.thumb.icon { width: 4rem; height: 4rem; }
.thumb.og   { width: 8.75rem; height: 4.59375rem; }  /* 1200 × 630 비율 */
.thumb img  { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 카카오톡 등에서 보일 모습 */
.share-preview {
  border: 1px solid var(--border); border-radius: 0.625rem; overflow: hidden;
  max-width: 19rem; background: var(--background);
}
.share-preview .img {
  aspect-ratio: 1200 / 630; background: var(--muted);
  display: grid; place-items: center; color: var(--muted-foreground); font-size: 0.6875rem;
  border-bottom: 1px solid var(--border);
}
.share-preview .meta { padding: 0.625rem 0.75rem; display: flex; flex-direction: column; gap: 0.125rem; }
.share-preview .meta .t { font-size: 0.8125rem; font-weight: 600; letter-spacing: -0.015em; }
.share-preview .meta .d { font-size: 0.75rem; color: var(--muted-foreground); }
.share-preview .meta .u {
  font-size: 0.6875rem; color: var(--muted-foreground); margin-top: 0.125rem;
  font-family: "Geist Mono", monospace;
}

/* ----------------------------------------------------------- 제출 버튼 */
#create-submit, #edit-submit {
  min-height: 3.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

/* --------------------------------------------------------------- 결과 URL */
.result-url {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
  padding: 0.875rem 1rem; background: var(--muted); border-radius: 0.625rem;
}
.result-url .url {
  flex: 1; min-width: 12rem; word-break: break-all;
  font-family: "Geist Mono", monospace; font-size: 0.9375rem; font-weight: 500;
}

.qr {
  width: 7rem; height: 7rem; flex: none; padding: 0.5rem;
  background: #fff; border: 1px solid var(--border); border-radius: 0.5rem;
}
.qr svg { display: block; width: 100%; height: 100%; color: #09090b; }

.kv { display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); gap: 0.4375rem 0.875rem; margin: 0; font-size: 0.78125rem; }
.kv dt { color: var(--muted-foreground); }
.kv dd { margin: 0; font-family: "Geist Mono", monospace; word-break: break-all; }

/* ------------------------------------------------------------------- 통계 */
.stat { display: flex; flex-direction: column; gap: 0.125rem; }
.stat .lab { font-size: 0.75rem; color: var(--muted-foreground); }
.stat .val { font-size: 1.625rem; font-weight: 600; letter-spacing: -0.03em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 0.75rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

.bars { display: flex; flex-direction: column; gap: 0.6875rem; }
.bar { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) 3.25rem; align-items: center; gap: 0.75rem; }
.bar .track { height: 0.5rem; border-radius: 999px; background: var(--muted); overflow: hidden; }
.bar .fill  { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.bar .fill.dim { background: var(--input); }
.bar .n { text-align: right; font-family: "Geist Mono", monospace; font-variant-numeric: tabular-nums; color: var(--muted-foreground); font-size: 0.78125rem; }

.spark { display: block; width: 100%; height: 4.75rem; max-height: 4.75rem; flex: none; }

/* --------------------------------------------------------- 리다이렉트 화면 */
.redirect-page {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  padding: 1.5rem 1.25rem 1.75rem;
  max-width: 26rem; margin: 0 auto;
}
.redirect-page .center-block {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 0.875rem;
}
.redirect-page .app-block {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 0.75rem; padding: 1.5rem 0 0.25rem;
}
.redirect-page .app-block h1 { margin: 0; font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.025em; }
.redirect-page .app-block p  { margin: 0; font-size: 0.78125rem; color: var(--muted-foreground); }
.redirect-page .actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1.25rem; }
.redirect-page .foot {
  margin-top: auto; padding-top: 1.5rem; text-align: center;
  font-size: 0.6875rem; color: var(--muted-foreground); line-height: 1.7;
}

/* 스토어 버튼 — .btn 을 세로로 크게 쓰는 변형 */
.store-btn { height: auto; padding: 0.625rem 0.875rem; justify-content: flex-start; gap: 0.625rem; width: 100%; }
.store-btn .g { width: 1.25rem; text-align: center; font-size: 0.9375rem; flex: none; }
.store-btn .t { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.35; }
.store-btn .t small { font-size: 0.65625rem; font-weight: 400; opacity: 0.7; }

.escape-hint {
  display: flex; align-items: center; justify-content: center; gap: 0.4375rem;
  padding: 0.5rem 0.625rem; border: 1px dashed var(--input); border-radius: 0.5rem;
  font-size: 0.71875rem; color: var(--muted-foreground);
}

/* 인앱 브라우저 상단 바 (목업 전용 — 실제 서비스에는 없음) */
.fake-chrome {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.8125rem; font-size: 0.71875rem; font-weight: 500;
}
.fake-chrome.kakao { background: #FAE100; color: #201B00; }
.fake-chrome.instagram { background: #18181b; color: #fafafa; }
.fake-chrome .dots { letter-spacing: 0.125rem; }

/* ------------------------------------------------------------- PC 랜딩 */
.landing {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 1.625rem; padding: 3rem 1.25rem;
}
.landing h1 { margin: 0 0 0.5rem; font-size: 1.6875rem; font-weight: 600; letter-spacing: -0.03em; }
.landing .sub { margin: 0; color: var(--muted-foreground); max-width: 44ch; }
.landing .cols { display: flex; gap: 1.125rem; flex-wrap: wrap; justify-content: center; align-items: stretch; }
.landing .col { width: 13.5rem; display: flex; flex-direction: column; align-items: center; gap: 0.8125rem; }
.landing .col > .t { font-size: 0.78125rem; font-weight: 500; color: var(--muted-foreground); }
.landing .qr { width: 7.5rem; height: 7.5rem; }

/* ------------------------------------------------------------- 목업 인덱스 */
.mockup-index .screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.875rem; }
.mockup-index .screen-card { text-decoration: none; display: flex; flex-direction: column; gap: 0.3125rem; }
.mockup-index .screen-card:hover { border-color: var(--ring); }
.mockup-index .screen-card .path {
  font-family: "Geist Mono", monospace; font-size: 0.71875rem; color: var(--muted-foreground);
}
