/* 경조사 봉투 도우미 — 지방 만들기(../style.css) 공용 모양을 옮겨 와 이 폴더만으로도 돌아가게 했어요. */
:root {
  --bg: #f6f6f4;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #5f6368;
  --line: #d9d9d6;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --ok-bg: #e8f5ec;
  --ok-text: #1b5e33;
  --warn-bg: #fff4e5;
  --warn-text: #7a4b00;
  --paper: #fffdf8;
  --ink: #111111;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --card: #1c1c1f;
    --text: #ececef;
    --muted: #a3a3aa;
    --line: #34343a;
    --accent: #4c8dff;
    --ok-bg: #16301f;
    --ok-text: #9fe0b4;
    --warn-bg: #33270f;
    --warn-text: #f3cf8a;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  line-height: 1.5;
  word-break: keep-all;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; }

.head h1 { margin: 0; font-size: 1.6rem; }
.sub { margin: 4px 0 12px; color: var(--muted); }
.privacy {
  display: inline-block;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok-text);
  font-size: 0.9rem;
  font-weight: 600;
}

.hint { margin: 8px 0 0; color: var(--muted); }
.small { font-size: 0.85rem; }

.btn {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.panel {
  margin: 16px 0 0;
  padding: 12px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  min-width: 0;
}
.panel legend { padding: 0 6px; font-weight: 700; }

.row { display: flex; gap: 8px; margin-top: 10px; }
.actions { flex-wrap: wrap; margin-top: 14px; }

.field { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; font-weight: 600; }
select {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-weight: 400;
}

.status { margin: 8px 0 0; min-height: 1.5em; font-weight: 600; color: var(--ok-text); }
.notice {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-text);
  font-size: 0.9rem;
}

.reading { color: var(--muted); font-size: 0.9rem; letter-spacing: 0.02em; }

.guide { margin-top: 28px; }
.guide h2 { font-size: 1.2rem; margin: 0 0 8px; }
.guide h3 { font-size: 1rem; margin: 18px 0 6px; }
.guide ul { padding-left: 1.2em; margin: 0; }
.guide li { margin: 6px 0; }
.sources { font-size: 0.9rem; }
.sources a { color: var(--accent); }
blockquote {
  margin: 8px 0;
  padding: 6px 12px;
  border-left: 3px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.terms { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.terms th, .terms td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.terms th { white-space: nowrap; }

.table-figure { margin: 16px 0 0; }
.table-figure svg { display: block; width: 100%; height: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.table-figure figcaption { margin-top: 6px; color: var(--muted); font-size: 0.85rem; }

.ad { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; }
.ad-note { margin: 6px 0; color: var(--muted); font-size: 0.8rem; }
.ad-frame { display: block; width: 320px; max-width: 100%; height: 140px; margin: 8px auto; border: 0; }

.tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.tools a {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
  background: var(--card);
}
.tools a[aria-current="page"] { border-color: var(--accent); color: var(--accent); font-weight: 700; }

/* 경조사 봉투 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chips label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  font-weight: 400;
}
.chips label:has(input:checked) { border-color: var(--accent); color: var(--accent); font-weight: 700; }
input[type="radio"] { width: 18px; height: 18px; accent-color: var(--accent); }
input[type="text"], input[type="number"] {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-weight: 400;
  width: 100%;
  min-width: 0;
}
input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.group-title { margin: 12px 0 0; font-weight: 600; }
.envelopes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 16px; }
.envelopes figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.envelopes canvas { display: block; width: 100%; max-width: 240px; height: auto; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12); border-radius: 2px; }
.envelopes figcaption { color: var(--muted); font-size: 0.85rem; }
.error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-text);
  font-weight: 600;
}
.btn.wide { width: 100%; margin-top: 12px; }
