/* 아직 — 청원의 그 후.
   디자인 토큰은 Ajik MVP 시안 v2 "부드럽게, 덜어내기"(Turn 3) 기준.
   흰 카드 + 둥근 모서리 + Pretendard, 숫자만 IBM Plex Mono. */
:root {
  --bg: #EDEBE4;
  --card: #FFFFFF;
  --ink: #14181B;
  --ink-soft: #3E464C;
  --muted: #5A646B;
  --faint: #8B9298;
  --border: #DFE3E5;
  --line: #E7EAEC;
  --line-soft: #EBEEF0;
  --chip: #F0F2F3;
  --panel: #F3F5F6;
  --hover: #F7F8F9;
  --field: #E3DFD6;
  --teal: #1E4E57;
  --teal-dark: #143A41;
  --teal-bg: #E6EFF0;
  --amber: #A85A0A;
  --amber-bg: #FAF2E4;
  --amber-border: #E4C79E;
  --dark: #1C1B18;
  --sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui,
          'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-card: 14px;
  --r-panel: 12px;
  --r: 8px;
  --shadow: 0 1px 3px rgba(20, 24, 27, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font-family: var(--sans);
  color: var(--ink);
  line-height: 1.5;
  word-break: keep-all;        /* 한글은 어절 단위로 줄바꿈 */
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  padding: 32px 16px 80px;
}
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); text-decoration: underline; }
h1, h2, h3, p { margin: 0; }

.mono { font-family: var(--mono); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── 카드 ── */
.paper {
  max-width: 390px;   /* 시안 아트보드 폭 — PC에서도 같은 한 컬럼 */
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}
.paper--narrow { max-width: 390px; }
.paper.admin { max-width: 1200px; }

/* ── 상단 (브랜드) ── */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px 0;
}
.brand-group { display: flex; align-items: baseline; gap: 12px; }
.brand {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand .dot {
  display: inline-block;
  width: 5px; height: 5px;
  background: var(--teal);
  border-radius: 50%;
  margin-left: 4px;
}
.brand--sm { font-size: 18px; }
.brand-sub { font-size: 14px; color: var(--ink-soft); }
.as-of { font-size: 12px; color: var(--muted); }
.back { font-size: 14px; color: var(--ink-soft); white-space: nowrap; }
.back:hover { color: var(--ink); text-decoration: none; }

/* ── 홈: 하나의 질문, 하나의 숫자 ── */
.hero { padding: 36px 24px 28px; text-align: center; }
.hero-q { font-size: 18px; line-height: 1.6; }
.hero-days {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 88px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-top: 10px;
}
.hero-post { font-size: 17px; font-weight: 700; margin-top: 2px; }
.hero-title {
  font-size: 15px;
  line-height: 1.7;
  margin-top: 16px;
  padding: 0 8px;
  text-wrap: pretty;
}
.hero .btn { margin-top: 18px; padding: 13px 28px; font-size: 15px; }
.collecting { font-size: 12px; color: var(--muted); white-space: nowrap; }

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0 24px 24px;
}
.chip {
  display: inline-block;
  background: var(--chip);
  border-radius: var(--r);
  padding: 8px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.chip strong { font-family: var(--mono); font-weight: 600; color: var(--ink); }
.chip em { font-style: normal; font-size: 11px; color: var(--muted); }
.chip--amber { background: var(--amber-bg); color: var(--amber); }
.chip--amber strong { color: var(--amber); }
.hero-title-link { color: var(--ink); font-weight: 600; }
.hero-title-link:hover { color: var(--teal); text-decoration: none; }
.chip--white { background: var(--card); color: var(--ink); padding: 6px 12px; }

.next { border-top: 1px solid var(--line); padding: 20px 24px 8px; }
.section-label { font-size: 14px; font-weight: 400; color: var(--ink-soft); margin-bottom: 4px; }
.next-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}
a.next-row:hover { text-decoration: none; color: var(--ink); }
a.next-row:hover .next-title { color: var(--teal); }
.next-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.next-title { font-size: 15px; font-weight: 600; line-height: 1.5; }
.next-meta { font-size: 12px; color: var(--muted); }
.next-days {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 600;
  white-space: nowrap;
}
.next-days .unit, .days .unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 1px;
}
.see-all { text-align: center; padding: 14px 0 16px; font-size: 14px; font-weight: 600; }

/* ── 구독: 화면 아래 고정 알약 (작은 알약 → 누르면 입력 패널이 올라온다) ── */
[hidden] { display: none !important; }
body.has-bar { padding-bottom: 88px; }
.subscribe-bar {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  justify-content: center;
}
.subscribe-bar-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--dark);
  color: #FFFFFF;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(20, 24, 27, 0.18);
  font: inherit;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.subscribe-bar-pill:hover { background: #000000; }
.subscribe-bar-panel {
  display: none;
  width: min(390px, calc(100vw - 20px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: 0 8px 28px rgba(20, 24, 27, 0.16);
  padding: 16px 20px 18px;
  flex-direction: column;
  gap: 10px;
}
.subscribe-bar.is-open .subscribe-bar-pill { display: none; }
.subscribe-bar.is-open .subscribe-bar-panel { display: flex; animation: rise 180ms ease-out; }
@keyframes rise {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.subscribe-bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.subscribe-bar-close {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.subscribe-bar-close:hover { color: var(--ink); }
.subscribe-title { font-size: 14px; font-weight: 600; }
.subscribe-form { display: flex; gap: 8px; }
.subscribe-form .input { flex: 1; width: auto; min-width: 0; }
.subscribe-form .btn { height: 44px; padding: 0 18px; }
.fine { font-size: 11px; color: var(--muted); line-height: 1.6; }
.fine a { color: var(--muted); text-decoration: underline; }

.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 0 24px 20px;
  font-size: 12px;
  color: var(--muted);
}
.card-foot a { color: var(--muted); white-space: nowrap; }

/* ── 폼 요소: 시안의 이메일 인풋(테두리 #E3DFD6 · 8px 모서리 · 11px 패딩)을 모든 컨트롤의 기준으로 ── */
.input, .select {
  border: 1px solid var(--field);
  background: var(--card);
  border-radius: var(--r);
  padding: 11px 16px;
  font-size: 14px;
  line-height: 20px;           /* 한 줄 컨트롤 높이 = 44px */
  font-family: var(--sans);
  color: var(--ink);
}
.input { width: 280px; }
.input::placeholder { color: var(--faint); }
.select {
  -webkit-appearance: none;
  appearance: none;
  height: 44px;
  padding-right: 38px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5l3.5 3.5 3.5-3.5' fill='none' stroke='%235A646B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 12px;
}
.input:focus, .select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(30, 78, 87, 0.12);
}
/* 체크박스도 같은 상자 모양으로 */
.filter-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--field);
  border-radius: var(--r);
  background: var(--card);
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.filter-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--teal); }
.filter-check:has(input:checked) { border-color: var(--teal); color: var(--teal); background: var(--teal-bg); }
.btn {
  display: inline-block;
  border: none;
  border-radius: var(--r);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  padding: 11px 18px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn--teal { background: var(--teal); color: #FFFFFF; }
.btn--teal:hover { background: var(--teal-dark); color: #FFFFFF; }
.btn--dark { background: var(--dark); color: #FFFFFF; }
.btn--dark:hover { background: #000000; color: #FFFFFF; }
.btn--outline { background: transparent; border: 1px solid var(--field); color: var(--ink-soft); font-weight: 600; }
.btn--outline:hover { border-color: var(--ink); color: var(--ink); }
.btn--outline-teal { background: transparent; border: 1px solid var(--teal); color: var(--teal); }
.btn--outline-teal:hover { background: var(--teal); color: #FFFFFF; }
.btn--block { display: block; width: 100%; padding: 14px; font-size: 15px; }
.fine-print { font-size: 11px; color: var(--faint); }

/* ── 목록 페이지 (시안 1a 모바일 대시보드의 목록부를 v2 톤으로) ── */
.list-intro { padding: 24px 24px 4px; }
.list-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.list-sub { margin-top: 6px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 24px 4px;
}
.filter-row { display: flex; gap: 8px; }
.filter-row .input, .filter-row .select { flex: 1; width: auto; min-width: 0; }
.filter-row .btn { height: 44px; padding: 0 18px; }
.filter-status { padding: 6px 24px 0; font-size: 12px; color: var(--muted); }
.list-head {
  display: flex;
  justify-content: space-between;
  padding: 16px 24px 6px;
  font-size: 12px;
  color: var(--muted);
}
.petition-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
a.petition-row:hover { background: var(--hover); text-decoration: none; color: var(--ink); }
/* 줄 구성은 홈의 "다음 청원" 줄과 동일: 제목 · 동의 수 · 일수 */
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.petition-title { font-size: 15px; font-weight: 600; line-height: 1.5; }
.row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.tag {
  background: var(--chip);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--ink-soft);
  white-space: nowrap;
}
.tag--teal { background: var(--teal-bg); color: var(--teal); }
.meta-text { font-size: 12px; color: var(--muted); }
.days {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}
.empty { padding: 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 4px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
}
.pager-pos { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--muted); }
.list-page .card-foot { padding-top: 16px; }

/* ── 상세: 부드러운 카운터 ── */
.counter { padding: 32px 24px 24px; text-align: center; }
.counter-pre { font-size: 16px; }
.counter-days {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 96px;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.counter-post { font-size: 17px; font-weight: 700; }
.pill {
  display: inline-block;
  margin-top: 14px;
  background: var(--chip);
  color: var(--ink-soft);
  border-radius: var(--r);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
}
.pill--amber { background: var(--amber-bg); color: var(--amber); }
.pill--teal { background: var(--teal-bg); color: var(--teal); }

.panel {
  margin: 0 24px;
  background: var(--panel);
  border-radius: var(--r-panel);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.detail-title { font-size: 17px; font-weight: 700; line-height: 1.5; }
.detail-explainer { font-size: 15px; line-height: 1.7; }
.panel-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.excerpt { margin: 16px 24px 0; padding: 0 4px; }
.excerpt-text { font-size: 15px; line-height: 1.8; }
.excerpt-source { font-size: 12px; color: var(--muted); white-space: nowrap; }
.excerpt-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.excerpt-link { display: inline-block; font-size: 13px; font-weight: 600; }
.excerpt-link--sub { color: var(--muted); font-weight: 500; }
.excerpt-link--sub:hover { color: var(--ink); }

.timeline { margin: 20px 24px 0; padding: 20px 4px 0; border-top: 1px solid var(--line); }
.tl-item { display: flex; gap: 14px; }
.tl-rail { display: flex; flex-direction: column; align-items: center; }
.tl-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ink);
  margin-top: 5px;
  flex-shrink: 0;
}
.tl-dot--deadline { background: var(--amber); }
.tl-dot--today { background: var(--card); border: 2px solid var(--teal); }
.tl-line { width: 1px; flex: 1; background: var(--border); }
.tl-item--deadline .tl-line { background: var(--amber-border); }
.tl-content { padding-bottom: 18px; }
.tl-date { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.tl-title { font-size: 14px; font-weight: 600; margin-top: 2px; }
.tl-desc { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.6; }
.tl-item--deadline .tl-date, .tl-item--deadline .tl-title { color: var(--amber); }
.tl-item--today .tl-date { color: var(--teal); }

.detail-actions { padding: 20px 24px 8px; display: flex; flex-direction: column; gap: 10px; }
.action-caption { text-align: center; font-size: 11px; color: var(--faint); }
.report-line { text-align: center; font-size: 12px; color: var(--muted); padding: 10px 24px 24px; }
.report-line a { font-weight: 600; }

/* ── 시트 (지켜보기 플로우·메시지) ── */
.sheet-page { max-width: 390px; margin: 48px auto 0; }
.sheet {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}
.sheet-step { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-bottom: 14px; }
.sheet-title { font-size: 20px; font-weight: 700; line-height: 1.5; }
.sheet-desc { font-size: 14px; color: var(--muted); line-height: 1.7; margin-top: 8px; }
.sheet-form { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.sheet-form .input { width: 100%; font-size: 15px; padding: 13px 14px; }
.sheet-form .btn { padding: 14px; font-size: 15px; }
.sheet-note {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--chip);
  border-radius: var(--r);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.sheet-actions { margin-top: 20px; display: flex; gap: 10px; }
.sheet-actions .btn { flex: 1; }
.done-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); margin-bottom: 14px; }
.form-error { font-size: 13px; color: var(--amber); margin-top: 10px; }
.message-page { margin-top: 80px; }

/* ── 소개·원칙·약관 ── */
.about { padding: 28px 24px 32px; }
.about-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}
.about-header .brand { font-size: 20px; }
.about-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-top: 24px; }
.about-section { margin-top: 28px; }
.about-title + .about-section { margin-top: 20px; }
.about-kicker { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.about-text { font-size: 15px; line-height: 1.9; color: var(--ink); text-wrap: pretty; }
.principles { display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.8; }
.principle { display: flex; gap: 12px; }
.principle .no { font-size: 14px; color: var(--teal); }  /* 한자 숫자 — 모노 폰트엔 없어 폴백이 섞이므로 본문 서체 */
.about-footer {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.about-footer .who { font-size: 13px; color: var(--muted); }

/* ── 뱃지 (어드민·과거 호환) ── */
.badge {
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  padding: 2px 8px;
  white-space: nowrap;
}
.badge--over { color: var(--amber); border-color: var(--amber-border); background: var(--amber-bg); }
.badge--teal { color: var(--teal); border-color: var(--teal); }

/* ── 어드민 ── */
.admin { padding: 28px 32px 48px; }
.admin h1 { font-size: 20px; font-weight: 800; }
.admin h2 { font-size: 15px; font-weight: 700; margin: 32px 0 12px; }
.admin table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin th {
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  padding: 8px;
  border-bottom: 1px solid var(--ink);
}
.admin td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin tr:target { background: var(--amber-bg); outline: 2px solid var(--amber-border); }
.admin .field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.admin form.inline { display: flex; gap: 6px; align-items: center; }
.admin .input, .admin select, .admin textarea {
  font-family: var(--sans);
  font-size: 13px;
  border: 1px solid var(--field);
  border-radius: 6px;
  background: #fff;
  padding: 7px 8px;
  width: auto;
}
.admin .create-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 720px;
}
.admin .create-grid .full { grid-column: 1 / -1; }
.admin .btn { padding: 8px 14px; }

/* ── 주간 요약 검수 (2분할) ── */
.summary-split {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(480px, 640px);
  gap: 32px;
  align-items: start;
  margin-top: 8px;
}
.summary-preview {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--bg);
  padding: 16px 8px;
}
@media (max-width: 1100px) {
  .summary-split { grid-template-columns: 1fr; }
  .summary-preview { position: static; max-height: none; }
}

/* ── 반응형: 카드 폭은 항상 390px(시안 그대로), 폰에서는 여백만 줄인다 ── */
@media (max-width: 640px) {
  body { padding: 12px 10px 48px; }
  .input, .select { font-size: 16px; }   /* iOS 포커스 확대 방지 */
  .sheet-page { margin-top: 24px; }
  .message-page { margin-top: 48px; }
}
