/* 차곡 목업 CSS.
   위 토큰 블록(:root, .dark)은 docs/stages/03-design.md 1절 css 블록을 그대로 복사한 것이다. 값을 새로 만들지 않는다.
   03 문서와의 일치는 examples/design-tokens/check-tokens.example.mjs 로 확인한다. */
:root {
  color-scheme: light;
  --background: oklch(1 0 0);
  --foreground: oklch(0.2 0.02 250);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.2 0.02 250);
  --muted: oklch(0.96 0.005 250);
  --muted-foreground: oklch(0.45 0.02 250);
  --border: oklch(0.9 0.01 250);
  --input: oklch(0.58 0.02 250);
  --primary: oklch(0.45 0.07 200);
  --primary-foreground: oklch(0.99 0 0);
  --primary-text: oklch(0.4 0.06 200);
  --accent: oklch(0.95 0.02 200);
  --accent-foreground: oklch(0.3 0.05 200);
  --ring: oklch(0.55 0.08 200);
  --destructive: oklch(0.5 0.19 27);
  --destructive-foreground: oklch(0.99 0 0);
  --success: oklch(0.45 0.1 150);
  --success-foreground: oklch(0.99 0 0);
  --warning: oklch(0.82 0.15 85);
  --warning-foreground: oklch(0.25 0.05 85);
  --warning-text: oklch(0.45 0.08 70);
  --shadow: 0 1px 2px 0 oklch(0.2 0.02 250 / 0.08), 0 1px 3px 0 oklch(0.2 0.02 250 / 0.1);
  --radius: 0.5rem;
}

.dark {
  color-scheme: dark;
  --background: oklch(0.18 0.01 250);
  --foreground: oklch(0.96 0 0);
  --card: oklch(0.22 0.01 250);
  --card-foreground: oklch(0.96 0 0);
  --muted: oklch(0.25 0.01 250);
  --muted-foreground: oklch(0.72 0.01 250);
  --border: oklch(0.32 0.01 250);
  --input: oklch(0.58 0.02 250);
  --primary: oklch(0.75 0.1 200);
  --primary-foreground: oklch(0.18 0.02 250);
  --primary-text: oklch(0.8 0.1 200);
  --accent: oklch(0.3 0.04 200);
  --accent-foreground: oklch(0.92 0.03 200);
  --ring: oklch(0.7 0.1 200);
  --destructive: oklch(0.72 0.17 25);
  --destructive-foreground: oklch(0.18 0.02 250);
  --success: oklch(0.75 0.14 150);
  --success-foreground: oklch(0.18 0.02 250);
  --warning: oklch(0.82 0.14 85);
  --warning-foreground: oklch(0.2 0.03 85);
  --warning-text: oklch(0.85 0.13 85);
  --shadow: none;
}

/* ===== 이하 목업 전용 컴포넌트 스타일. 색은 위 토큰 변수만 쓴다. ===== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 4.5rem;
  scroll-padding-bottom: 4.5rem;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: "Pretendard Variable", -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 1rem;
  line-height: 1.625;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
h1, h2, h3 { margin: 0 0 0.5rem; }
h1 { font-size: 1.5rem; line-height: 1.3; font-weight: 700; }
h2 { font-size: 1.25rem; line-height: 1.35; font-weight: 600; }
h3 { font-size: 1.125rem; line-height: 1.4; font-weight: 600; }
p { margin: 0 0 0.75rem; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--primary-text); text-underline-offset: 0.2em; }
.muted { color: var(--muted-foreground); }
.small { font-size: 0.875rem; line-height: 1.5; }
.num { font-variant-numeric: tabular-nums; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

.skip-link {
  position: absolute; left: 0.5rem; top: -4rem; z-index: 50;
  background: var(--card); color: var(--foreground);
  border: 1px solid var(--input); border-radius: var(--radius);
  padding: 0.75rem 1rem;
}
.skip-link:focus { top: 0.5rem; }

/* 목업 전용 영역 */
.mock-banner {
  background: var(--accent); color: var(--accent-foreground);
  font-size: 0.875rem; line-height: 1.5; text-align: center; padding: 0.5rem 1rem;
}
.mock-tools { border-bottom: 1px solid var(--border); background: var(--muted); }
.mock-tools > summary {
  min-height: 2.75rem; display: flex; align-items: center; cursor: pointer;
  padding: 0 1rem; font-size: 0.875rem; color: var(--foreground);
}
.mock-tools .inner { padding: 0 1rem 1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.mock-tools a, .mock-tools button {
  min-height: 2.75rem; display: inline-flex; align-items: center; padding: 0 0.75rem;
  border: 1px solid var(--input); border-radius: var(--radius); background: var(--card);
  color: var(--foreground); font: inherit; font-size: 0.875rem; text-decoration: none; cursor: pointer;
}
.mock-tools a[aria-current="true"] { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }

/* 레이아웃 */
.container { width: 100%; max-width: 30rem; margin: 0 auto; padding-inline: 1rem; }
.container-wide { width: 100%; max-width: 72rem; margin: 0 auto; padding-inline: 1rem; }
.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 1.5rem; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
main { display: block; padding-top: 1.5rem; padding-bottom: 3rem; }

.site-header { background: var(--background); border-bottom: 1px solid var(--border); }
.site-header .row { min-height: 3.5rem; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; color: var(--foreground); text-decoration: none; min-height: 2.75rem; }
.logo svg { height: 2rem; width: auto; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.75rem;
  color: var(--foreground); text-decoration: none; border-radius: var(--radius);
}
.site-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-foreground); font-weight: 600; }
.site-footer { border-top: 1px solid var(--border); padding: 1.5rem 0 2rem; color: var(--muted-foreground); font-size: 0.875rem; line-height: 1.5; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0 1.25rem; border-radius: var(--radius);
  border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none;
  cursor: pointer; transition: filter 150ms ease-out;
}
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { filter: brightness(0.9); }
.btn-secondary { background: var(--card); color: var(--primary-text); border-color: var(--input); }
.btn-secondary:hover { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--primary-text); }
.btn-ghost:hover { background: var(--accent); }
.btn-destructive { background: var(--destructive); color: var(--destructive-foreground); }
.btn-destructive:hover { filter: brightness(0.9); }
.btn-block { display: flex; width: 100%; }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 폼 */
.field { display: block; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.field .hint { display: block; font-size: 0.875rem; line-height: 1.5; color: var(--muted-foreground); margin-top: 0.25rem; }
.field .error { display: flex; gap: 0.375rem; align-items: flex-start; font-size: 0.875rem; line-height: 1.5; color: var(--destructive); margin-top: 0.25rem; }
input[type="text"], input[type="tel"], input[type="date"], input[type="number"], input[type="search"], input[type="email"], input[type="password"], select, textarea {
  display: block; width: 100%; min-height: 2.75rem; padding: 0.5rem 0.75rem;
  background: var(--background); color: var(--foreground);
  border: 1px solid var(--input); border-radius: var(--radius); font: inherit; font-size: 1rem;
}
textarea { min-height: 6rem; resize: vertical; }
input[aria-invalid="true"], select[aria-invalid="true"] { border-color: var(--destructive); border-width: 2px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 600; margin-bottom: 0.25rem; }
.choice-grid { display: grid; gap: 0.5rem; grid-template-columns: 1fr; }
.choice {
  display: flex; align-items: flex-start; gap: 0.75rem; min-height: 2.75rem; padding: 0.75rem;
  border: 1px solid var(--input); border-radius: var(--radius); background: var(--card); cursor: pointer;
}
.choice input { width: 1.25rem; height: 1.25rem; margin: 0.125rem 0 0; accent-color: var(--primary); flex: none; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--accent); }
.choice:focus-within { outline: 2px solid var(--ring); outline-offset: 2px; }

/* 카드·배지·알림 */
.card { background: var(--card); color: var(--card-foreground); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); padding: 1rem; box-shadow: var(--shadow); }
.card h2, .card h3 { margin-bottom: 0.25rem; }
.card-link { display: block; text-decoration: none; color: inherit; }
.card-link:hover { background: var(--accent); }
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.125rem 0.5rem;
  border-radius: calc(var(--radius) - 4px); font-size: 0.875rem; line-height: 1.5; font-weight: 600; white-space: nowrap;
}
.badge-request { background: var(--muted); color: var(--muted-foreground); border: 1px solid var(--border); }
.badge-quote { background: var(--accent); color: var(--accent-foreground); }
.badge-active { background: var(--primary); color: var(--primary-foreground); }
.badge-done { background: var(--success); color: var(--success-foreground); }
.badge-warn { background: var(--warning); color: var(--warning-foreground); }
.badge-fail { background: var(--destructive); color: var(--destructive-foreground); }
.alert { display: flex; gap: 0.5rem; padding: 0.75rem 1rem; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); font-size: 0.9375rem; line-height: 1.5; }
.alert-info { border-color: var(--primary); }
.alert-warn { border-color: var(--warning-text); color: var(--warning-text); }
.alert-error { border-color: var(--destructive); color: var(--destructive); }
.alert-ok { border-color: var(--success); color: var(--success); }
.alert > div { color: var(--foreground); }
.alert-error > div, .alert-warn > div, .alert-ok > div { color: var(--foreground); }

/* 아이콘 (CSS mask: 외부 파일·CDN 없이) */
.icon { display: inline-block; flex: none; width: 1.125em; height: 1.125em; background: currentColor; vertical-align: -0.2em;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.i-check { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5 9.5 18 20 6.5'/%3E%3C/svg%3E"); }
.i-clock { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3.5 2'/%3E%3C/svg%3E"); }
.i-doc { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h8l5 5v13H6z'/%3E%3Cpath d='M14 3v5h5M9 13h7M9 17h7'/%3E%3C/svg%3E"); }
.i-box { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7.5 12 3l9 4.5v9L12 21l-9-4.5z'/%3E%3Cpath d='M3 7.5 12 12l9-4.5M12 12v9'/%3E%3C/svg%3E"); }
.i-home { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 11 12 4l9 7v9H3z'/%3E%3Cpath d='M9 20v-6h6v6'/%3E%3C/svg%3E"); }
.i-alert { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 22 20H2z'/%3E%3Cpath d='M12 10v5M12 18v.5'/%3E%3C/svg%3E"); }
.i-info { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v6M12 7.5v.5'/%3E%3C/svg%3E"); }
.i-camera { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E"); }
.i-plus { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); }

/* 단계 표시 */
.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.stepper li {
  display: flex; align-items: center; gap: 0.375rem; min-height: 2.75rem; padding: 0.375rem 0.5rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--card);
  font-size: 0.875rem; line-height: 1.3; color: var(--muted-foreground);
}
.stepper li[data-done="true"] { color: var(--foreground); }
.stepper li[aria-current="step"] { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); font-weight: 700; }

/* 견적 표·정의 목록 */
.quote { width: 100%; border-collapse: collapse; }
.quote th, .quote td { padding: 0.5rem 0; text-align: left; border-bottom: 1px solid var(--border); font-weight: 400; vertical-align: top; }
.quote td { text-align: right; font-variant-numeric: tabular-nums; }
.quote tfoot th, .quote tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--foreground); padding-top: 0.75rem; }
.dl { display: grid; grid-template-columns: minmax(0, 8rem) minmax(0, 1fr); gap: 0.25rem 0.75rem; margin: 0; }
.dl dt { color: var(--muted-foreground); font-size: 0.875rem; line-height: 1.7; }
.dl dd { margin: 0; }

/* 비밀번호 입력·일회용 비밀 */
.pw-row { display: flex; gap: 0.5rem; align-items: stretch; flex-wrap: wrap; }
.pw-row input { flex: 1 1 10rem; min-width: 0; }
.secret-box { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: end; padding: 0.75rem; margin: 0.5rem 0; border: 1px dashed var(--input); border-radius: var(--radius); background: var(--card); }
.secret-box > label { flex: 1 1 100%; }
.secret-box input { flex: 1 1 10rem; min-width: 0; }
.divider { text-align: center; color: var(--muted-foreground); }

/* 사진 */
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.thumb {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.25rem; text-align: center;
  aspect-ratio: 1; border: 1px dashed var(--input); border-radius: var(--radius); background: var(--muted);
  color: var(--muted-foreground); font-size: 0.875rem; line-height: 1.3; padding: 0.25rem;
}
.thumb.add { background: var(--card); color: var(--primary-text); cursor: pointer; border-style: solid; font: inherit; font-size: 0.875rem; }

/* 빈 상태·스켈레톤 */
.empty { text-align: center; padding: 2rem 1rem; border: 1px dashed var(--input); border-radius: calc(var(--radius) + 4px); background: var(--card); }
.empty .icon { width: 2rem; height: 2rem; color: var(--muted-foreground); margin-bottom: 0.5rem; }
.skeleton { display: block; border-radius: var(--radius); background: var(--muted); min-height: 1rem; animation: pulse 1.4s ease-in-out infinite; }
.skeleton + .skeleton { margin-top: 0.5rem; }
@keyframes pulse { 50% { opacity: 0.5; } }

/* 탭·목록 */
.tabs ul { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tabs a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.875rem; border: 1px solid var(--input); border-radius: var(--radius); background: var(--card); color: var(--foreground); text-decoration: none; }
.tabs a[aria-current="page"] { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); font-weight: 600; }
.list > li + li { margin-top: 0.75rem; }
.tl > li { padding: 0.5rem 0 0.5rem 1rem; border-left: 2px solid var(--border); }
.tl time { font-size: 0.875rem; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }

/* 소개 페이지 */
.hero { padding: 1rem 0 0.5rem; }
.hero p.lead { font-size: 1.125rem; line-height: 1.6; }
.steps { counter-reset: s; }
.steps > li { counter-increment: s; display: flex; gap: 0.75rem; }
.steps > li::before {
  content: counter(s); flex: none; width: 2rem; height: 2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--primary); color: var(--primary-foreground); font-weight: 700;
}
.steps > li + li { margin-top: 1rem; }

/* 관리 화면 */
.admin { display: block; }
.admin-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem; padding: 0.5rem 0; }
.admin-nav a { display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.75rem; border-radius: var(--radius); color: var(--foreground); text-decoration: none; }
.admin-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-foreground); font-weight: 600; }
.cols { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }

@media (min-width: 64rem) {
  .admin { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: 2rem; align-items: start; }
  .admin-nav ul { flex-direction: column; padding: 1.5rem 0; }
  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-grid.two { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 30rem) { .choice-grid.two { grid-template-columns: repeat(2, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
