/* 은혜와언약교회 — 하늘색·화이트 디자인 시스템 */
:root {
  --primary: #3B9FE8;
  --primary-dark: #176AA6;
  --primary-ink: #0F5A92;      /* 흰 배경 위 링크·강조 텍스트 (대비 확보) */
  --primary-soft: #E3F1FC;
  --primary-softer: #F0F8FE;
  --bg: #F3F9FE;
  --surface: #FFFFFF;
  --text: #18354A;
  --text-2: #617789;
  --border: #DFEDF7;
  --border-strong: #C6DDEE;
  --danger: #C2410C;
  --danger-soft: #FEF1EA;
  --success: #15803D;
  --success-soft: #EAF7EF;
  --warn: #A16207;
  --warn-soft: #FEF7E6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(24, 53, 74, .05), 0 4px 16px rgba(24, 53, 74, .05);
  --sidebar-w: 260px;
  --bottom-h: 68px;
  font-size: 17px;
}
html[data-font="sm"] { font-size: 15px; }
html[data-font="md"] { font-size: 17px; }
html[data-font="lg"] { font-size: 19px; }
html[data-font="xl"] { font-size: 21px; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-ink); }
h1, h2, h3, h4 { line-height: 1.4; margin: 0 0 .5rem; color: var(--text); }
h1 { font-size: 1.5rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.08rem; }
p { margin: 0 0 .75rem; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.2em; }
h1 > svg, h2 > svg, h3 > svg, dt > svg { color: var(--primary); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── 레이아웃 ── */
.app { min-height: 100vh; display: flex; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 860px; margin: 0 auto; padding: 16px 16px calc(var(--bottom-h) + 32px); outline: none; }
.content.wide { max-width: 1120px; }

.topbar {
  position: sticky; top: 0; z-index: 20; height: 60px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px 0 16px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.05rem; flex: 1; min-width: 0; }
.topbar .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--primary); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 20px; height: 20px; color: #fff; }
.icon-btn {
  position: relative; width: 48px; height: 48px; border: 0; background: transparent; border-radius: 12px;
  display: grid; place-items: center; color: var(--text); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--primary-softer); }
.icon-btn svg { width: 24px; height: 24px; }
.dot-badge { position: absolute; top: 8px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; font-weight: 700; text-align: center; }

.sidebar { display: none; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--bottom-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--text-2); font-size: .78rem; font-weight: 500; min-height: 56px;
}
.bottom-nav a svg { width: 24px; height: 24px; }
.bottom-nav a.active { color: var(--primary-dark); font-weight: 700; }
.bottom-nav a.active svg { color: var(--primary); }

@media (min-width: 960px) {
  .bottom-nav { display: none; }
  .content { padding: 28px 32px 48px; }
  .sidebar {
    display: flex; flex-direction: column; width: var(--sidebar-w); flex: none; position: sticky; top: 0; height: 100vh;
    background: var(--surface); border-right: 1px solid var(--border); padding: 20px 14px; overflow-y: auto;
  }
  .topbar .brand { visibility: hidden; }
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.1rem; }
.side-group { margin-top: 14px; }
.side-label { font-size: .78rem; color: var(--text-2); font-weight: 700; padding: 6px 12px; letter-spacing: .02em; }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--text);
  text-decoration: none; font-weight: 500; min-height: 48px;
}
.side-link svg { width: 22px; height: 22px; color: var(--text-2); }
.side-link:hover { background: var(--primary-softer); }
.side-link.active { background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }
.side-link.active svg { color: var(--primary-dark); }
.side-foot { margin-top: auto; padding: 14px 12px 0; font-size: .82rem; color: var(--text-2); }

/* ── 공통 컴포넌트 ── */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--text-2); margin: 2px 0 0; font-size: .95rem; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); text-decoration: none; margin-bottom: 8px; min-height: 40px; }
.back-link svg { width: 20px; height: 20px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card.flat { box-shadow: none; }
.card h2, .card h3 { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card-head h2, .card-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-head h2 svg, .card-head h3 svg { width: 22px; height: 22px; color: var(--primary); }
.more-link { color: var(--primary-ink); text-decoration: none; font-weight: 500; font-size: .92rem; display: inline-flex; align-items: center; min-height: 40px; }
.grid-2 { display: grid; gap: 14px; }
.grid-2 > * { min-width: 0; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-2 > .card { margin-bottom: 0; } }
.stack > * + * { margin-top: 10px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.muted { color: var(--text-2); }
.small { font-size: .88rem; }
.hr { height: 1px; background: var(--border); margin: 14px 0; border: 0; }

.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 22px 20px; margin-bottom: 14px;
  background: radial-gradient(120% 140% at 85% -10%, #FFFFFF 0%, #E8F4FD 45%, #D6EBFA 100%);
  border: 1px solid var(--border);
}
.hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.9), rgba(255,255,255,0) 70%); }
.hero h1 { font-size: 1.35rem; margin-bottom: 4px; position: relative; z-index: 1; }
.hero p { color: var(--text-2); margin: 0; position: relative; z-index: 1; }
.hero .hero-cross { position: absolute; right: 18px; bottom: 12px; width: 64px; height: 64px; color: rgba(59, 159, 232, .25); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent; font-weight: 700; cursor: pointer; text-decoration: none; font-size: 1rem;
  background: var(--primary-dark); color: #fff; transition: background .15s;
}
.btn:hover { background: #125A8E; }
.btn svg { width: 20px; height: 20px; }
.btn.secondary { background: var(--surface); color: var(--primary-dark); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--primary-softer); }
.btn.soft { background: var(--primary-soft); color: var(--primary-dark); }
.btn.soft:hover { background: #D3E9FA; }
.btn.ghost { background: transparent; color: var(--text); }
.btn.ghost:hover { background: var(--primary-softer); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: #F3C9B5; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.small { min-height: 40px; padding: 0 12px; font-size: .9rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 500; cursor: pointer; font-size: .93rem;
}
.chip.active { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--primary-soft); color: var(--primary-dark); white-space: nowrap; }
.badge.gray { background: #EEF3F7; color: #4A6275; }
.badge.green { background: var(--success-soft); color: var(--success); }
.badge.orange { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.official { background: var(--primary-dark); color: #fff; }
.badge svg { width: 14px; height: 14px; }

.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); min-height: 56px; }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--primary-softer); border-radius: 10px; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 600; display: block; }
.list-item .li-sub { color: var(--text-2); font-size: .88rem; display: block; }
.list-item .li-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; flex: none; }
.list-item .li-icon svg { width: 22px; height: 22px; }
.list-item > svg.chev { width: 20px; height: 20px; color: var(--text-2); flex: none; }
.date-box { width: 52px; flex: none; text-align: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary-dark); padding: 6px 0; line-height: 1.2; }
.date-box b { display: block; font-size: 1.15rem; }
.date-box span { font-size: .75rem; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 폼 */
.field { margin-bottom: 14px; }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { color: var(--text-2); font-size: .86rem; margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; padding: 11px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface);
}
textarea.input { min-height: 140px; line-height: 1.7; resize: vertical; }
textarea.input.tall { min-height: 320px; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59, 159, 232, .2); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; min-height: 44px; }
.check input { width: 22px; height: 22px; margin-top: 3px; accent-color: var(--primary-dark); flex: none; }
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented label { flex: 1 1 auto; min-width: 90px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: 6px 12px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 500; }
.segmented input:checked + span { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-dark); font-weight: 700; }
.segmented input:focus-visible + span { outline: 3px solid var(--primary); }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-weight: 500; }
.notice { background: var(--primary-softer); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; color: var(--text); margin-bottom: 12px; font-size: .94rem; }
.notice.warn { background: var(--warn-soft); border-color: #F2DFAF; }
.notice.ok { background: var(--success-soft); border-color: #BFE3CB; }
.notice svg { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }

/* 소셜 버튼 */
.social-btn { width: 100%; min-height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; cursor: pointer; text-decoration: none; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); margin-bottom: 10px; }
.social-btn.kakao { background: #FEE500; border-color: #FEE500; color: #191600; }
.social-btn .logo { width: 22px; height: 22px; }
.social-btn.disabled { opacity: .6; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: .88rem; margin: 16px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* 상태 화면 */
.state-box { text-align: center; padding: 48px 16px; color: var(--text-2); }
.state-box .state-icon { width: 64px; height: 64px; border-radius: 20px; background: var(--primary-soft); color: var(--primary-dark); display: grid; place-items: center; margin: 0 auto 14px; }
.state-box .state-icon svg { width: 32px; height: 32px; }
.state-box h2 { color: var(--text); }
.state-box .btn-row { justify-content: center; margin-top: 14px; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--primary-soft); border-top-color: var(--primary); animation: spin 1s linear infinite; margin: 0 auto 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, #EEF5FB 25%, #F7FBFE 50%, #EEF5FB 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 10px; height: 18px; margin: 10px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* 본문 */
.prose { font-size: 1.04rem; line-height: 1.9; white-space: pre-wrap; }
.prose p { margin: 0 0 1em; }
.post-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--text-2); font-size: .9rem; align-items: center; }
.post-images { display: grid; gap: 8px; margin: 12px 0; }
.post-images img { width: 100%; border-radius: 12px; border: 1px solid var(--border); }
.official-box { border: 2px solid var(--primary); border-radius: var(--radius); padding: 16px; background: var(--primary-softer); }
.personal-box { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 10px 14px; background: #FBFDFF; color: var(--text-2); font-size: .9rem; margin-bottom: 12px; }
.video-wrap { position: relative; padding-top: 56.25%; border-radius: 14px; overflow: hidden; background: #DDEBF6; margin-bottom: 14px; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.order-table { width: 100%; border-collapse: collapse; }
.order-table td { padding: 10px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.order-table td:first-child { font-weight: 700; width: 30%; color: var(--primary-dark); }
.order-table td:last-child { text-align: right; color: var(--text-2); width: 25%; }

/* 댓글 */
.comment { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment.reply { margin-left: 24px; padding-left: 14px; border-left: 3px solid var(--primary-soft); }
.comment .c-head { display: flex; gap: 8px; align-items: center; font-size: .9rem; color: var(--text-2); flex-wrap: wrap; }
.comment .c-head b { color: var(--text); }
.comment .c-body { margin: 4px 0; white-space: pre-wrap; }
.comment .c-deleted { color: var(--text-2); font-style: italic; }
.comment .c-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; color: var(--text-2); cursor: pointer; padding: 6px 8px; min-height: 36px; border-radius: 8px; font-size: .88rem; display: inline-flex; align-items: center; gap: 4px; }
.link-btn:hover { background: var(--primary-softer); color: var(--primary-dark); }
.link-btn svg { width: 16px; height: 16px; }
.link-btn.on { color: var(--primary-dark); font-weight: 700; }

/* 캘린더 */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal .dow { font-size: .8rem; color: var(--text-2); padding: 6px 0; font-weight: 700; }
.cal .dow.sun { color: #C2410C; }
.cal-day { min-height: 52px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; padding: 4px 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cal-day:hover { background: var(--primary-softer); }
.cal-day.other { color: #A9B9C6; }
.cal-day.today .num { background: var(--primary-dark); color: #fff; }
.cal-day.selected { background: var(--primary-soft); }
.cal-day .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 500; }
.cal-day .dots { display: flex; gap: 3px; height: 6px; }
.cal-day .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.cal-day .dots i.worship { background: var(--primary-dark); }

/* 진행 바 · 칸반 */
.progress { height: 8px; border-radius: 4px; background: var(--primary-soft); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.task { border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; background: var(--surface); }
.task.done { background: #F8FCF9; }
.task .t-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.task .t-title { font-weight: 700; }
.task select.input { min-height: 44px; padding: 6px 10px; }
.status-todo { background: #EEF3F7; color: #4A6275; }
.status-doing { background: var(--primary-soft); color: var(--primary-dark); }
.status-review { background: var(--warn-soft); color: var(--warn); }
.status-done { background: var(--success-soft); color: var(--success); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tab { padding: 10px 14px; min-height: 48px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--text-2); border-bottom: 3px solid transparent; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; }
.kv dt { color: var(--text-2); font-weight: 500; }
.kv dd { margin: 0; }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .94rem; }
table.data th, table.data td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.data th { color: var(--text-2); font-weight: 600; white-space: nowrap; }

.fab { position: fixed; right: 18px; bottom: calc(var(--bottom-h) + 18px + env(safe-area-inset-bottom)); z-index: 25; width: 60px; height: 60px; border-radius: 20px; background: var(--primary-dark); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(23, 106, 166, .35); text-decoration: none; }
.fab svg { width: 28px; height: 28px; }
@media (min-width: 960px) { .fab { bottom: 28px; right: 28px; } }

/* 토스트 · 모달 */
.toast-root { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--bottom-h) + 20px); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--text); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 500; animation: rise .2s; }
.toast.error { background: var(--danger); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
.modal-back { position: fixed; inset: 0; background: rgba(24, 53, 74, .35); z-index: 70; display: flex; align-items: flex-end; justify-content: center; }
.modal { background: var(--surface); width: 100%; max-width: 560px; max-height: 90vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); animation: rise .2s; }
@media (min-width: 640px) { .modal-back { align-items: center; } .modal { border-radius: 20px; } }
.modal h2 { margin-bottom: 12px; }
.modal .btn-row { justify-content: flex-end; margin-top: 16px; }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--primary-softer); display: grid; place-items: center; font-size: .75rem; text-align: center; padding: 4px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(24,53,74,.7); color: #fff; cursor: pointer; display: grid; place-items: center; z-index: 1; }
.thumb button svg { width: 16px; height: 16px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; text-decoration: none; color: var(--text); }
.file-row svg { width: 22px; height: 22px; color: var(--primary-dark); flex: none; }
.integration { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.integration:last-child { border-bottom: 0; }
.space-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .space-grid { grid-template-columns: repeat(4, 1fr); } }
.space-tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text); font-weight: 700; min-height: 96px; }
.space-tile svg { width: 26px; height: 26px; color: var(--primary); }
.space-tile span { font-size: .82rem; color: var(--text-2); font-weight: 400; }
.space-tile:hover { border-color: var(--primary); }

.counts { display: flex; gap: 10px; flex: none; align-items: center; }
.counts > span, .counts > svg { display: inline-flex; align-items: center; gap: 3px; }
.counts svg { width: 16px; height: 16px; }

/* ── Seedream 5.5 생성 이미지 (public/img/gen, tools/gen-images.mjs) ── */
.hero.photo {
  min-height: 190px; display: flex; flex-direction: column; justify-content: flex-end; padding: 22px 20px;
  background: linear-gradient(90deg, rgba(255,255,255,.94) 0%, rgba(255,255,255,.78) 45%, rgba(255,255,255,.1) 100%), url('/img/gen/hero.jpg') center 70% / cover no-repeat;
  border: 1px solid var(--border);
}
.hero.photo::after { display: none; }
.hero.photo h1 { font-size: 1.45rem; max-width: 20em; }
.hero .hero-actions { margin-top: 12px; position: relative; z-index: 1; }
@media (min-width: 720px) { .hero.photo { min-height: 240px; padding: 32px; } .hero.photo h1 { font-size: 1.7rem; } }

.banner {
  position: relative; border-radius: 20px; overflow: hidden; margin: 0 0 16px; min-height: 132px;
  display: flex; align-items: flex-end; padding: 18px; border: 1px solid var(--border); background: var(--primary-soft) center / cover no-repeat;
}
.banner::before { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.72) 42%, rgba(255,255,255,0) 100%); }
.banner > * { position: relative; }
.banner .page-head { margin: 0; width: 100%; }
.banner h1 { font-size: 1.45rem; }
.banner .sub { color: #3E5A70; }
.banner.word { background-image: url('/img/gen/word.jpg'); background-position: center 60%; }
.banner.community { background-image: url('/img/gen/community.jpg'); background-position: center 45%; }
.banner.calendar { background-image: url('/img/gen/calendar.jpg'); background-position: center 40%; }
@media (min-width: 720px) { .banner { min-height: 180px; padding: 24px 26px; } .banner h1 { font-size: 1.7rem; } }

.auth-visual { height: 150px; margin: -18px -18px 16px; border-radius: var(--radius) var(--radius) 0 0; background: url('/img/gen/auth.jpg') center 45% / cover no-repeat; position: relative; }
.auth-visual::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(255,255,255,.85), rgba(255,255,255,0) 60%); border-radius: inherit; }

.state-box .state-art { width: 168px; height: 168px; margin: 0 auto 4px; display: block; object-fit: contain; }
.state-box.welcome .state-art { width: 190px; height: 190px; }

.thumb16 { position: relative; width: 112px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; flex: none; background: var(--primary-soft) url('/img/gen/sermon.jpg') center / cover; }
.thumb16 img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb16 .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; }
.thumb16 .play svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.45)); }
@media (min-width: 720px) { .thumb16 { width: 144px; } }
.sermon-cover { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; margin-bottom: 14px; background: url('/img/gen/sermon.jpg') center / cover; display: flex; align-items: flex-end; padding: 18px; border: 1px solid var(--border); }
.sermon-cover::before { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(255,255,255,.9), rgba(255,255,255,0) 65%); }
.sermon-cover > * { position: relative; }
.sermon-cover p { margin: 0; font-weight: 700; color: var(--text); }
.ai-preview { width: 100%; border-radius: 12px; border: 1px solid var(--border); margin: 8px 0; }
