/* 체크리스트 메이커 */
:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --green: #16a34a;
  --green2: #15803d;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif; font-size: 14px; }

.wrap { max-width: 100%; padding: 0 0 60px; }

/* ── 헤더 ── */
.top { padding: 20px 0 16px; }
.brand { display: flex; align-items: center; gap: 14px; }
.logo {
  width: 48px; height: 48px; flex-shrink: 0;
  background: linear-gradient(135deg, #16a34a, #0891b2);
  border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 22px;
}
h1 { font-size: 22px; font-weight: 700; }
.sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ── 카드 ── */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; }

/* ── 2컬럼 그리드 ── */
.main-grid { display: grid; grid-template-columns: 280px 1fr; gap: 12px; }

/* ── 템플릿 패널 ── */
.tpl-list { display: flex; flex-direction: column; gap: 6px; }
.tpl-item {
  padding: 10px 14px; border-radius: 9px; border: 1.5px solid var(--line);
  cursor: pointer; transition: all .12s; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.tpl-item:hover { border-color: var(--green); background: #f0fdf4; }
.tpl-item.active { border-color: var(--green); background: var(--green); color: #fff; }

/* ── 체크리스트 편집 패널 ── */
.cl-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.cl-title-input {
  font-size: 18px; font-weight: 800; border: none; background: transparent;
  outline: none; flex: 1; min-width: 0; color: var(--ink);
}
.cl-meta { font-size: 12px; color: var(--muted); }
.cl-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-action {
  padding: 7px 12px; border-radius: 8px; font-size: 12px; font-weight: 700;
  border: 1.5px solid var(--line); background: var(--bg); cursor: pointer;
  color: var(--ink); transition: all .12s; white-space: nowrap;
}
.btn-action:hover { border-color: var(--green); color: var(--green); }
.btn-action.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-action.primary:hover { background: var(--green2); }
.btn-action.danger { color: #dc2626; }
.btn-action.danger:hover { border-color: #dc2626; background: #fef2f2; }

/* ── 섹션 ── */
.cl-section { margin-bottom: 16px; }
.cl-section-title { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.cl-items { display: flex; flex-direction: column; gap: 4px; }

/* ── 체크 아이템 ── */
.cl-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px; border: 1px solid transparent;
  transition: all .12s; cursor: pointer;
}
.cl-item:hover { background: #f0fdf4; border-color: #bbf7d0; }
.cl-item.checked { opacity: .6; }
.cl-item.checked .ci-text { text-decoration: line-through; color: var(--muted); }
.ci-check {
  width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--line);
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: all .12s; font-size: 12px;
}
.cl-item.checked .ci-check { background: var(--green); border-color: var(--green); color: #fff; }
.ci-text { flex: 1; font-size: 13px; color: var(--ink); }
.ci-del {
  opacity: 0; background: none; border: none; color: #dc2626; cursor: pointer;
  font-size: 16px; padding: 0 2px; transition: opacity .12s; flex-shrink: 0;
}
.cl-item:hover .ci-del { opacity: 1; }

/* ── 항목 추가 ── */
.add-item-row { display: flex; gap: 8px; margin-top: 8px; }
.add-item-input {
  flex: 1; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: 8px;
  font-size: 13px; outline: none; transition: border-color .12s;
}
.add-item-input:focus { border-color: var(--green); }
.add-section-input {
  flex: 1; padding: 8px 12px; border: 1.5px dashed var(--line); border-radius: 8px;
  font-size: 12px; outline: none; font-weight: 700; color: var(--muted);
  background: var(--bg); transition: border-color .12s;
}
.add-section-input:focus { border-color: var(--green); color: var(--ink); }
.add-btn {
  padding: 9px 14px; background: var(--green); color: #fff;
  border: none; border-radius: 8px; font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}

/* ── 진행률 ── */
.progress-bar-wrap { margin-bottom: 16px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.progress-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 4px; transition: width .3s; }

/* ── 인쇄 ── */
@media print {
  .top, .card:first-of-type, .cl-actions, .add-item-row, .add-section-input,
  .ci-del, .btn-action, .guide-section { display: none !important; }
  .main-grid { grid-template-columns: 1fr; }
  .card { box-shadow: none; border: none; }
  .cl-item.checked { display: none; }
}

/* ── 사용 안내 섹션 공통 ── */
.guide-section {
  margin-top: 24px; background: rgba(246,248,255,.6);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.guide-section h2 { font-size: 15px; font-weight: 800; margin: 0 0 10px; color: var(--ink); }
.guide-section h2:not(:first-child) { margin-top: 18px; }
.guide-steps, .guide-features, .guide-usecase {
  margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.8;
}
.guide-steps li, .guide-features li, .guide-usecase li { margin-bottom: 4px; }
.guide-steps strong, .guide-features strong { color: var(--ink); }
.guide-privacy {
  margin-top: 16px; background: #eff6ff; border: 1px solid rgba(37,99,235,.22);
  border-radius: 12px; padding: 12px 14px; font-size: 12px; color: #1e40af; line-height: 1.55;
}

@media (max-width: 640px) {
  .main-grid { grid-template-columns: 1fr; }
}
