/* 삼선 공통 스타일
   여러 페이지(index.html, drawing/, admin/)에서 공유하는 토대(팔레트·리셋·body·브랜드·토스트).
   페이지별 레이아웃/컴포넌트 스타일은 각 페이지의 <style>에서 이 파일을 덮어쓰거나 확장합니다. */

:root {
  --ink: #1a1613;          /* 먹선 */
  --paper: #f7f1e6;        /* 한지 종이 */
  --mat: #d6efe6;          /* 배경(민트) */
  --accent: #bf3a2f;       /* 인주 주홍 */
  --accent-deep: #9c2a22;
  --topic: #2a6f97;        /* 쪽빛(청) - 최근 주제 칩 */
  --topic-deep: #1f5575;
  --border: #e5e7eb;
  --muted: rgba(26, 22, 19, 0.6);  /* 보조 글자 */
  --line: rgba(26, 22, 19, 0.2);   /* 버튼 테두리 */
}

* { box-sizing: border-box; }

/* 모바일 탭 지연(300ms)·더블탭 확대로 인한 "두 번 탭/무반응" 방지 */
button,
a,
input[type="submit"],
[role="button"] {
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  background: var(--mat);
  color: var(--ink);
  padding: 24px;
}

/* 브랜드(로고 + 삼선) — 클릭 시 홈으로 이동 */
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  text-decoration: none;
  font-size: 20px;
  font-weight: 700;
}

.brand-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 6px;
}

.brand-logo { width: 28px; height: 28px; display: block; }

/* 토스트 알림 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 10;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--accent-deep); }

/* 인앱 브라우저 안내 오버레이 (inapp.js) */
.inapp-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(26, 22, 19, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.inapp-card {
  width: min(92vw, 380px);
  background: var(--paper);
  color: var(--ink);
  border-radius: 16px;
  padding: 24px 22px;
  text-align: center;
  box-shadow: 0 24px 60px -18px rgba(26, 22, 19, 0.5);
}

.inapp-card h2 { margin: 0 0 10px; font-size: 19px; font-weight: 800; }
.inapp-card p { margin: 0 0 14px; font-size: 14px; line-height: 1.6; color: var(--muted); }
.inapp-guide { color: var(--ink) !important; }
.inapp-guide b { color: var(--accent); }

.inapp-actions { display: flex; flex-direction: column; gap: 10px; }

.inapp-btn {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  touch-action: manipulation;
}

.inapp-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.inapp-url {
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
}

.inapp-dismiss {
  margin-top: 16px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
  touch-action: manipulation;
}
