/* 색·모양 값은 tokens/ 폴더(디자인 토큰)를 따릅니다. 카카오 로그인판 성경365와 같은 디자인 */
:root {
  --bg: var(--schemes-surface);
  --ink: var(--schemes-on-surface);
  --ink-2: var(--schemes-on-surface-variant);
  --ink-3: var(--schemes-outline);
  --line: var(--schemes-outline-variant);
  --navy: var(--schemes-primary);
  --navy-soft: var(--schemes-primary-container);
  --radius: var(--md-shape-md);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--schemes-surface);
  color: var(--schemes-on-surface);
  font-family: 'Roboto', 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--schemes-secondary); outline-offset: 2px; }
#app { max-width: 960px; margin: 0 auto; min-height: 100dvh; }
.loading { text-align: center; color: var(--ink-3); padding-top: 40vh; }

/* ---------- 소개 ---------- */
.intro {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(48px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  text-align: center;
}
.intro-body { margin-top: 8vh; }
.intro-year {
  margin: 0; display: inline-block; padding: 6px 14px; border-radius: var(--md-shape-full);
  background: var(--schemes-secondary-container); color: var(--schemes-on-secondary-container);
  font-size: 14px; font-weight: 500; letter-spacing: .1em;
}
.intro-title {
  margin: 20px 0 16px;
  font-size: clamp(52px, 17vw, 88px);
  line-height: 1.05;
  font-weight: 400;
  letter-spacing: -.02em;
  color: var(--schemes-primary);
}
.intro-quote { margin: 0; font-size: 18px; line-height: 26px; font-weight: 400; color: var(--ink-2); }
.intro-actions {
  display: flex; flex-direction: column; align-items: stretch; gap: 12px;
  margin: 36px auto 24px; width: 100%; max-width: 400px;
}
.btn-primary, .btn-line {
  width: 100%;
  height: 56px;
  border-radius: var(--md-shape-full);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.btn-primary { border: 0; background: var(--schemes-primary); color: var(--schemes-on-primary); }
.btn-line { border: 1px solid var(--schemes-outline); background: none; color: var(--schemes-primary); }
.btn-primary:hover::after, .btn-line:hover::after { content: ""; position: absolute; inset: 0; background: currentColor; opacity: .08; }
.btn-primary:active::after, .btn-line:active::after { content: ""; position: absolute; inset: 0; background: currentColor; opacity: .1; }
.btn-primary.sm, .btn-line.sm { height: 48px; font-size: 15px; }
.btn-text {
  border: 0; background: none; color: var(--schemes-primary); font-size: 14px; font-weight: 500;
  height: 40px; padding: 0 12px; border-radius: var(--md-shape-full);
}
.btn-text:hover { background: color-mix(in srgb, var(--schemes-primary) 8%, transparent); }
.intro-links { display: flex; align-items: center; justify-content: center; gap: 4px; }
.intro-links-bar { width: 1px; height: 14px; background: var(--schemes-outline-variant); }
.intro-progress { margin: 0; font-size: 14px; color: var(--ink-2); }
.intro-progress b { color: var(--schemes-primary); }

.guide {
  width: 100%; max-width: 400px; margin: 0 auto 28px; padding: 16px 18px;
  background: var(--schemes-surface-container); border-radius: var(--md-shape-lg); text-align: left;
  display: flex; flex-direction: column; gap: 14px;
}
.guide-row { display: flex; gap: 12px; align-items: flex-start; }
.guide-row p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink); word-break: keep-all; }
.guide-row b { color: var(--schemes-primary); font-weight: 600; }
.guide-sub { font-size: 12.5px; color: var(--ink-2); }
.guide-num {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--schemes-primary); color: var(--schemes-on-primary);
  font-size: 12px; font-weight: 500; display: grid; place-items: center; margin-top: 1px;
}
.ico-share {
  display: inline-block; width: 14px; height: 16px; vertical-align: -2px;
  background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 18' fill='none' stroke='%236750a4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 1v10M3.5 4.5L7 1l3.5 3.5M4.5 7.5H2v9h10v-9H9.5'/%3E%3C/svg%3E");
}
.intro-org { margin: 0 0 24px; font-size: 13px; font-weight: 500; color: var(--ink-2); letter-spacing: .08em; }

/* ---------- 주차표 ---------- */
.cal { padding: 0 12px max(24px, env(safe-area-inset-bottom)); }
.cal-top {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--schemes-surface);
  margin: 0 -12px;
  padding: max(4px, env(safe-area-inset-top)) 16px 8px;
}
.bar { position: relative; display: flex; align-items: center; gap: 8px; height: 56px; }
.brand { flex: 1; font-size: 22px; line-height: 28px; font-weight: 400; color: var(--ink); }
.icon-btn {
  width: 40px; height: 40px; border: 0; background: none; display: grid; place-items: center;
  margin-left: -8px; border-radius: 50%; color: var(--ink-2);
}
.icon-btn.right { margin-left: 0; margin-right: -8px; }
.icon-btn:hover, .nav-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 8%, transparent); }
.icon-btn svg, .nav-btn svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linejoin: round; stroke-linecap: round;
}

.progress { margin: 4px 0 0; padding: 14px 16px; background: var(--schemes-surface-container); border-radius: var(--md-shape-lg); }
.progress-row { display: flex; align-items: baseline; justify-content: space-between; }
.progress-label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.progress-num { font-size: 16px; color: var(--schemes-primary); font-weight: 500; }
.progress-num b { font-size: 32px; line-height: 40px; font-weight: 400; font-variant-numeric: tabular-nums; }
.track { height: 4px; background: var(--schemes-secondary-container); border-radius: var(--md-shape-full); overflow: hidden; margin-top: 4px; }
.fill { height: 100%; background: var(--schemes-primary); border-radius: var(--md-shape-full); transition: width .3s var(--md-motion-standard); }
.progress-sub { margin: 8px 0 0; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; white-space: nowrap; height: 32px; border: 1px solid var(--schemes-outline); background: none;
  color: var(--ink-2); border-radius: var(--md-shape-sm); padding: 0 16px; font-size: 14px; font-weight: 500;
}
.chip:hover { background: color-mix(in srgb, var(--ink-2) 8%, transparent); }
.chip.done { border-color: var(--schemes-primary); color: var(--schemes-primary); }
.chip.done::after { content: ' ✓'; }
.chip.on { background: var(--schemes-secondary-container); border-color: transparent; color: var(--schemes-on-secondary-container); }

.month-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 4px 12px; }
.page-title { text-align: center; }
.page-title h2 { margin: 0; font-size: 28px; line-height: 36px; font-weight: 400; }
.page-title p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.nav-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: none;
  color: var(--ink-2); display: grid; place-items: center; padding: 0;
}
.nav-btn:disabled { opacity: .38; cursor: default; }

.grid { display: grid; grid-template-columns: 26px repeat(5, minmax(0, 1fr)); gap: 4px; }
.wk { text-align: center; font-size: 12px; font-weight: 500; color: var(--ink-2); padding: 6px 0; }

.wk-label {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 10px; color: var(--ink-2); line-height: 1.1;
}
.wk-label b { font-size: 15px; font-weight: 500; color: var(--schemes-primary); font-variant-numeric: tabular-nums; }

.cell {
  position: relative;
  min-height: 84px;
  border: 0;
  border-radius: var(--md-shape-sm);
  background: var(--schemes-surface-container-low);
  padding: 5px 3px 6px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  min-width: 0;
  overflow: hidden;
}
.cell-head { display: flex; align-items: center; min-height: 16px; line-height: 1.2; padding-right: 18px; }
.nth { font-size: 10px; font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nth-unit { display: none; }
.txt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -.03em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  padding-top: 4px;
  color: var(--ink);
}
.txt .unit { display: none; }


.cell.read { transition: background-color .15s var(--md-motion-standard); }
.cell.read:hover { background: var(--schemes-surface-container); }
.cell.read:active { background: var(--schemes-surface-container-high); }
.chk {
  position: absolute; right: 3px; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--schemes-outline); display: grid; place-items: center;
  transition: all .15s var(--md-motion-standard);
}
.chk svg {
  width: 11px; height: 11px; fill: none; stroke: var(--schemes-on-primary); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round; opacity: 0;
}
.cell.read.checked { background: var(--schemes-primary-container); }
.cell.read.checked .chk { background: var(--schemes-primary); border-color: var(--schemes-primary); }
.cell.read.checked .chk svg { opacity: 1; }
.cell.read.checked .txt, .cell.read.checked .nth { color: var(--schemes-on-primary-container); }

.hint { margin: 16px 0 0; text-align: center; font-size: 12px; line-height: 1.5; color: var(--ink-2); }

/* 넓은 화면 */
@media (min-width: 640px) {
  .cal { padding: 0 24px 40px; }
  .cal-top { margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
  .chips { margin: 12px -24px 0; padding: 0 24px 4px; }
  .grid { grid-template-columns: 48px repeat(5, minmax(0, 1fr)); gap: 6px; }
  .wk-label { font-size: 12px; }
  .wk-label b { font-size: 22px; }
  .cell { min-height: 112px; padding: 8px 8px 10px; border-radius: var(--md-shape-md); }
  .nth { font-size: 12px; }
  .nth-unit { display: inline; }
  .txt { font-size: 14px; letter-spacing: -.01em; }
  .txt .unit { display: inline; }
  .chk { width: 20px; height: 20px; right: 8px; top: 8px; }
  .chk svg { width: 13px; height: 13px; }
  .wk { font-size: 13px; padding: 8px 0; }
}

/* ---------- 백업 / 복원 시트 ---------- */
body.sheet-open { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .32); animation: fade .2s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 520px; margin: 0 auto;
  max-height: 92dvh; overflow-y: auto; background: var(--schemes-surface-container-low);
  border-radius: var(--md-shape-xl) var(--md-shape-xl) 0 0; box-shadow: var(--md-elev-1);
  padding: 10px 20px max(20px, env(safe-area-inset-bottom)); animation: up .3s var(--md-motion-emphasized);
}
.sheet-grip { width: 32px; height: 4px; border-radius: 4px; background: var(--schemes-on-surface-variant); opacity: .4; margin: 6px auto 16px; }
.sheet h2 { margin: 0 0 6px; font-size: 22px; line-height: 28px; font-weight: 400; color: var(--ink); }
.sheet h3 { margin: 20px 0 8px; font-size: 14px; font-weight: 500; color: var(--schemes-primary); }
.sheet-desc { word-break: keep-all; margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.sheet-stat { margin: 10px 0 0; font-size: 14px; color: var(--ink); }
.sheet-stat b { color: var(--schemes-primary); }
.sheet-stat span { font-size: 12px; color: var(--ink-2); }
.code {
  width: 100%; resize: none; border: 1px solid var(--schemes-outline); border-radius: var(--md-shape-xs);
  padding: 10px 12px; font: 13px/1.4 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink); background: none; word-break: break-all;
}
.code:focus { outline: 2px solid var(--schemes-primary); outline-offset: -1px; border-color: transparent; }
.code[readonly] { color: var(--schemes-primary); }
.sheet-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.sheet-btns > * { max-width: none; }
.sheet-close { display: block; margin: 14px auto 0; }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

#toast {
  z-index: 30;
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: var(--schemes-inverse-surface); color: var(--schemes-inverse-on-surface);
  font-size: 14px; padding: 14px 16px; border-radius: var(--md-shape-xs); box-shadow: var(--md-elev-3);
  opacity: 0; pointer-events: none; transition: all .2s var(--md-motion-standard); max-width: calc(100vw - 32px);
  text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }


/* 소개 문구 (2027 성경365와 같은 문구) */
.intro-sub{margin:0;font-size:22px;line-height:28px;font-weight:400;color:var(--ink)}
.intro-sub2{margin:8px 0 0;font-size:16px;color:var(--ink-2)}
.guide-link{border:0;background:none;padding:4px 0 0;font:inherit;font-size:14px;font-weight:600;color:var(--schemes-primary);text-decoration:underline;text-underline-offset:3px;cursor:pointer}

/* Netlify 무료 배지 숨김 */
#nl-badge-frame,iframe[id^="nl-badge"]{display:none!important}

/* 토요 가정예배 칸 (토 열) */
.grid { grid-template-columns: 26px repeat(6, minmax(0, 1fr)); }
.wk.sat{color:var(--schemes-on-tertiary-container)}
.cell.sat-cell{background:var(--schemes-tertiary-container);color:var(--schemes-on-tertiary-container);cursor:pointer;font:inherit}
.cell.sat-cell.empty{background:transparent;cursor:default}
.cell.sat-cell .txt{color:var(--schemes-on-tertiary-container)}
.cell.sat-cell:active{transform:scale(.97)}
.sat-tag{font-size:10.5px;font-weight:700;letter-spacing:-.02em;color:var(--schemes-on-tertiary-container)}
.cell.sat-cell .open{position:absolute;right:3px;bottom:4px;width:14px;height:14px;color:var(--schemes-on-tertiary-container);opacity:.7}
.cell.sat-cell .open svg{width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.hint-worship{margin-top:6px;font-size:13px;font-weight:600;color:var(--schemes-on-tertiary-container)}
@media (min-width: 640px){ .grid { grid-template-columns: 48px repeat(6, minmax(0, 1fr)); } .sat-tag{font-size:12px} }

/* 말씀·안내 창 */
.sat-scrim{position:fixed;inset:0;z-index:50;background:rgba(0,0,0,.38);display:flex;align-items:flex-end;justify-content:center;animation:satFade .2s ease}
.sat-sheet{width:100%;max-width:560px;max-height:calc(100% - 64px - env(safe-area-inset-top));display:flex;flex-direction:column;background:var(--schemes-surface-container-low);
  border-radius:28px 28px 0 0;padding:20px 22px calc(18px + env(safe-area-inset-bottom));animation:satUp .25s var(--md-motion-standard,ease)}
.sat-head{display:flex;align-items:flex-start;gap:12px;flex:none;padding-bottom:14px;border-bottom:1px solid var(--line)}
.sat-head>div{flex:1;min-width:0}
.sat-date{margin:0 0 4px;font-size:14px;font-weight:600;color:var(--schemes-on-tertiary-container)}
.sat-head h2{margin:0;font-size:24px;line-height:1.3;font-weight:600;color:var(--schemes-primary);word-break:keep-all}
.sat-close{width:44px;height:44px;flex:none;border:0;border-radius:50%;background:var(--schemes-surface-container-high);color:var(--ink-2);display:grid;place-items:center;margin:-4px -6px 0 0}
.sat-close svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
.sat-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:16px 2px 8px;font-size:17px;line-height:1.85;color:var(--ink);word-break:keep-all}
.sat-body p{margin:0 0 14px}
.sat-verses{padding:14px 14px 2px;border-radius:18px;background:var(--schemes-tertiary-container);margin-bottom:6px}
.sat-verses p{display:flex;gap:10px;margin:0 0 12px}
.sat-verses sup{flex:none;min-width:24px;height:24px;margin-top:4px;padding:0 5px;border-radius:12px;background:var(--schemes-surface);color:var(--schemes-tertiary);font-size:13px;font-weight:700;line-height:24px;text-align:center;vertical-align:baseline}
.sat-body h3{margin:18px 0 10px;font-size:19px;font-weight:700;color:var(--schemes-primary)}
@keyframes satUp{from{transform:translateY(40%);opacity:0}}
@keyframes satFade{from{opacity:0}}
.sat-date span{font-weight:400;color:var(--ink-2)}
/* 홈 화면 추가 안내 */
.ig{display:flex;flex-direction:column;gap:16px}
.ig p{margin:0}
.ig-lead{font-size:17px;line-height:1.6}
.ig-note{font-size:14px;line-height:1.5;color:var(--ink-2)}
.ig-btn{display:flex;align-items:center;justify-content:center;gap:8px}
.ig-btn svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ig-tabs{display:flex;gap:4px;padding:4px;border-radius:14px;background:var(--schemes-surface-container-high)}
.ig-tabs button{flex:1;height:42px;border:0;border-radius:10px;cursor:pointer;background:none;font:inherit;font-size:15px;font-weight:600;color:var(--ink-2)}
.ig-tabs button[aria-selected=true]{background:#fff;color:var(--schemes-primary);box-shadow:0 1px 3px rgba(0,0,0,.14)}
.ig-steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
.ig-steps li{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:16px;background:var(--schemes-surface-container)}
.ig-num{width:26px;height:26px;flex:none;border-radius:50%;display:grid;place-items:center;background:var(--schemes-primary);color:#fff;font-size:14px;font-weight:700}
.ig-ic{width:48px;height:48px;flex:none;border-radius:14px;display:grid;place-items:center;background:#fff;color:var(--schemes-primary);box-shadow:0 1px 2px rgba(0,0,0,.08)}
.ig-ic svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ig-txt{font-size:16px;line-height:1.5;word-break:keep-all}
.ig-txt b,.ig-note b,.ig-done b{color:var(--schemes-primary)}
.ig-done{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:16px;background:var(--schemes-primary-container)}
.ig-done img{width:48px;height:48px;flex:none;border-radius:12px}
.ig-done p{font-size:15px;line-height:1.5;word-break:keep-all}
