/* Wedraw Pro Web — 공통 스타일. 색·간격은 토큰으로만 쓴다. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --line: #e2e5ea;
  --line-strong: #c9ced6;
  --text: #1c2330;
  --text-2: #5b6474;
  --text-3: #8a93a3;
  --accent: #1f6feb;
  --accent-soft: #e7f0ff;
  --accent-text: #ffffff;
  --ok: #1a7f4b;
  --warn: #b26a00;
  --warn-soft: #fff4e0;
  --danger: #c62f2f;
  --danger-soft: #fdecec;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px rgba(16, 24, 40, 0.06);
  --font: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

/* ── 홈 ── */
.home { max-width: 880px; margin: 0 auto; padding: 72px 16px 48px; }
.home-eyebrow { margin: 0 0 8px; color: var(--accent); font-weight: 600; }
.home-title { margin: 0 0 16px; font-size: clamp(26px, 4vw, 38px); line-height: 1.25; letter-spacing: -0.02em; }
.home-lead { margin: 0 0 32px; color: var(--text-2); font-size: 16px; max-width: 640px; }
.home-steps { list-style: none; counter-reset: step; display: grid; gap: 12px; padding: 0; margin: 0 0 32px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.home-steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; display: grid; gap: 4px; }
.home-steps li::before { content: counter(step); display: inline-grid; place-items: center; width: 24px; height: 24px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; }
.home-steps span { color: var(--text-2); }
.home-version { color: var(--text-3); font-size: 12px; }

/* ── 공통 컴포넌트 ── */
:root { --appbar-h: 52px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px;
  padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: #195ec8; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { color: var(--danger); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { min-height: 44px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }

.field { display: grid; gap: 4px; }
.field-grow { flex: 1; }
.field-label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.field-hint { font-size: 12px; color: var(--text-3); }
.input { width: 100%; min-height: 36px; padding: 0 10px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); background: var(--surface); }
.input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.input[aria-invalid="true"] { border-color: var(--danger); }

.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 600; }
.tag-soft { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.tag-warn { background: var(--warn-soft); color: var(--warn); }

.notice { margin: 8px 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2);
  border: 1px solid var(--line); font-size: 13px; }
.notice-warn { background: var(--warn-soft); border-color: #f3d6a4; color: #7a4a00; }
.notice-danger { background: var(--danger-soft); border-color: #f2c2c2; color: #8f1f1f; }

.appbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; height: var(--appbar-h);
  padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.appbar-brand { color: var(--text); text-decoration: none; font-size: 16px; white-space: nowrap; }
.appbar-brand strong { color: var(--accent); }
.appbar-nav { display: flex; gap: 4px; flex: 1; }
.appbar-nav a { padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none;
  font-weight: 600; white-space: nowrap; }
.appbar-nav a:hover { background: var(--surface-2); color: var(--text); }
.appbar-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.appbar-user { display: flex; align-items: center; gap: 8px; min-width: 0; }
.appbar-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.appbar-logout { margin: 0; }
.appbar-demo { height: auto; min-height: 20px; white-space: normal; line-height: 1.3; }
/* 데모 로그아웃 확인: <details> 로 펼친다(스크립트 없음). */
.appbar-confirm { position: relative; }
.appbar-confirm > summary { list-style: none; }
.appbar-confirm > summary::-webkit-details-marker { display: none; }
.appbar-confirm[open] > summary { background: var(--surface-2); }
.appbar-confirm-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: min(280px, 90vw);
  display: grid; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); }
.appbar-confirm-text { margin: 0; font-size: 13px; color: var(--text); }
.appbar-confirm-pop .btn { width: 100%; }
/* 목록·미리보기 오류 줄의 [다시 시도] */
.retry-btn { margin-left: 6px; vertical-align: middle; }
.viewport-canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.home-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 32px; }
.home-actions form { margin: 0; }
@media (max-width: 640px) {
  .appbar { gap: 8px; }
  .appbar-name { display: none; }
  /* 좁은 화면은 "데모"만(자세한 말은 title 과 로그아웃 확인 창에) — 메뉴 글자가 꺾이지 않게. */
  .appbar-demo-more { display: none; }
}
