/* 사주 선배 공통 디자인 토큰·기본 요소 (랜딩·회원 앱·매니저 콘솔 공용)
   11/2 홈페이지(인스타 프로필) 팔레트로 통일: 아이보리 바탕 + 먹색 글씨·버튼, 강조는 불(빨강) 기운 한 색. 다크 모드 없음 (밝은 화면만) */
@font-face { font-family: "Sunbae Serif"; src: url(/assets/fonts/serif-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
:root {
  color-scheme: light;
  --bg: #F7F4EE; --page: #EFEAE1; --surface: #FFFFFF; --surface-2: #F2EEE7;
  --ink: #1B1A18; --ink2: #4A4640; --muted: #6B665F; --line: #E6E0D6; --line-strong: #D3CBBE;
  --accent: #B8432C; --accent-press: #9A3823; --accent-soft: #F7E3DC;
  --good: #2F6B4F; --good-soft: #E2EDE0; --warn: #7C5410; --warn-soft: #F6ECD4; --bad: #A3312A; --bad-soft: #F6DCDA;
  --btn: #1B1A18; --btn-ink: #FFFFFF; --btn-press: #34322E;
  --serif: "Sunbae Serif", "Noto Serif KR", "AppleMyungjo", "Batang", serif;
  --r: 18px; --r-sm: 12px;
  --shadow: 0 1px 2px rgba(27, 26, 24, .05), 0 8px 24px rgba(27, 26, 24, .06);
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 52px; padding: 0 20px; border-radius: 14px; font-weight: 700; font-size: 16px; transition: transform .12s ease, background-color .15s ease, opacity .15s; text-decoration: none; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--btn); color: var(--btn-ink); }   /* 홈페이지처럼 주 버튼은 먹색 */
.btn-primary:hover:not(:disabled) { background: var(--btn-press); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: var(--surface); border: 1px solid var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--line-strong); }
.btn-sm { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-text { color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: 8px; }

/* 카드·칩·배지 */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--ink2); display: inline-flex; align-items: center; gap: 6px; transition: background-color .15s, border-color .15s, color .15s; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip .num { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill-good { background: var(--good-soft); color: var(--good); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-accent { background: var(--accent-soft); color: var(--accent-press); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-muted { background: var(--line); color: var(--ink2); }

/* 입력 */
.inp, .sel, .txt { width: 100%; min-width: 0; height: 48px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); padding: 0 14px; font-size: 16px; }
.txt { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.inp:focus, .sel:focus, .txt:focus { outline: none; border-color: var(--ink2); box-shadow: 0 0 0 3px rgba(185, 71, 47, .2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent); }
/* 잘못 입력한 칸: 앱이 aria-invalid="true" 를 붙이면 빨간 테두리 (포커스 중이면 빨간 링) */
.inp[aria-invalid="true"], .sel[aria-invalid="true"], .txt[aria-invalid="true"],
input:not([type="checkbox"]):not([type="radio"])[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
.inp[aria-invalid="true"]:focus, .sel[aria-invalid="true"]:focus, .txt[aria-invalid="true"]:focus { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(163, 49, 42, .2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 24%, transparent); }
.lab { display: block; font-weight: 700; font-size: 15px; margin-bottom: 10px; }
.lab .hint { font-weight: 500; color: var(--muted); font-size: 13px; margin-left: 4px; }
.err { color: var(--bad); font-size: 14px; font-weight: 600; }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 14px; color: var(--ink2); cursor: pointer; align-items: start; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); }

/* 시트·토스트 */
.scrim { position: fixed; inset: 0; background: rgba(27, 26, 24, .42); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease both; }
.sheet { width: 100%; max-width: 440px; background: var(--surface); border-radius: 22px 22px 0 0; padding: 22px 20px calc(18px + env(safe-area-inset-bottom)); animation: up .28s cubic-bezier(.2, .8, .2, 1) both; max-height: 92dvh; overflow: auto; }
.sheet h2 { font-size: 20px; letter-spacing: -.02em; }
.sheet .desc { color: var(--muted); font-size: 14px; margin: 6px 0 16px; }
@media (min-width: 720px) { .scrim { align-items: center; } .sheet { border-radius: 22px; } }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; z-index: 60; max-width: calc(100% - 32px); text-align: center; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* 브랜드: 다섯 기운 표식 + 명조 글자 (모든 화면 같은 마크업 `사주<i>선배</i>`) */
.brand { display: inline-flex; align-items: center; font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: -.01em; text-decoration: none; }
.brand::before { content: ""; width: 24px; height: 24px; margin-right: 9px; flex: none; background: url(/assets/mark.svg) center / contain no-repeat; }
.brand i { font-style: normal; color: inherit; margin-left: .26em; }
.pill.wrap { white-space: normal; height: auto; padding: 3px 9px; line-height: 1.35; }   /* 긴 알약은 줄바꿈 (99차) */
/* hidden 속성은 언제나 숨김 — display:flex 같은 규칙이 덮어 보이던 일(76차 콘솔 선택 막대) 방지 */
[hidden] { display: none !important; }
