/* 레이아웃: 맨 위 '오늘의 말씀 + 내 영혼 표시등'(남색·따뜻한 빛), 아래 오늘 체크리스트(접히는 한 줄 항목) + 작은 달력
   색: 따뜻한 종이색 바탕 + 남색, 빛은 금색으로 아껴서 — 첫 화면(프로필 선택)과 이어지게 */
:root {
  --bg: #f5f0e6;           /* 따뜻한 종이 */
  --card: #fffcf6;
  --ink: #25272d;
  --muted: #6f6b63;
  --rule: #e4ddd0;
  --accent: #2c3d6e;       /* 남색 */
  --accent-soft: #e9e8ee;
  --warm: #b9852f;         /* 빛 (금색) */
  --hero-1: #26345f; --hero-2: #131b35; --hero-ink: #f6f2e7; --hero-muted: #b9bfd2; --hero-glow: rgba(255, 196, 92, .24);
  --done: #3f7d58;
  --done-soft: #e3efe7;
  --danger: #b0413e;
  --h1: #dfe3ee; --h2: #b4bfd9; --h3: #7d8fbe; --h4: #33467a;
  --sig-green: #2f9e5b; --sig-yellow: #e0a422; --sig-red: #d4483f; --sig-off: #c9c6bd; --housing: #2b2f36;
  --sig-green-soft: #e5f0e3; --sig-yellow-soft: #f8eed6; --sig-red-soft: #f6e2dc; --sig-grey-soft: #eee9df;
  --f-head: "Nanum Myeongjo", "AppleMyungjo", serif;
  --f-ui: "IBM Plex Sans KR", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10152a; --card: #171f38; --ink: #ece7da; --muted: #a4a9ba; --rule: #29324f;
    --accent: #aab9e8; --accent-soft: #212b48; --warm: #f0c069;
    --hero-1: #26345f; --hero-2: #0c1124; --hero-ink: #f6f2e7; --hero-muted: #b9bfd2; --hero-glow: rgba(255, 196, 92, .2);
    --done: #7cc196; --done-soft: #1d3127; --danger: #e07a76;
    --h1: #262c3b; --h2: #34416a; --h3: #566aa3; --h4: #9fb2e6;
    --sig-green: #4cc27a; --sig-yellow: #f2bd45; --sig-red: #ef6a60; --sig-off: #3a4258; --housing: #070a14;
    --sig-green-soft: #1b3127; --sig-yellow-soft: #352c17; --sig-red-soft: #3a2224; --sig-grey-soft: #1f2741;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--f-ui); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn { border: 1px solid transparent; border-radius: 10px; padding: .5rem .9rem; background: none; cursor: pointer; font-weight: 500; }
.btn.primary { background: var(--accent); color: var(--card); }
.icon-btn { width: 2.4rem; height: 2.4rem; border: 0; border-radius: 10px; background: none; cursor: pointer; font-size: 1.3rem; color: var(--muted); }
.icon-btn:hover { background: var(--accent-soft); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.link { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: .82rem; padding: 0; text-decoration: underline; }

/* 로그인 */
.login {
  min-height: 100vh; display: grid; place-items: center;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.login { grid-template-columns: minmax(0, 1fr); }
.login-card { width: 100%; max-width: 360px; justify-self: center; display: grid; gap: .8rem; background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 2rem 1.5rem; }
.login-title { margin: 0; font: 800 1.6rem/1.3 var(--f-head); }
.login-sub { margin: 0 0 .3rem; color: var(--muted); font-size: .9rem; }
.login-card input { width: 100%; min-width: 0; padding: .75rem .8rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg); font-size: 16px; }
.login-card .btn { padding: .75rem; font-size: 1rem; }
.error { margin: 0; min-height: 1.2em; color: var(--danger); font-size: .88rem; }

/* 앱 */
.app {
  max-width: 1040px; margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.top { margin-bottom: 1.2rem; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; position: relative; }
.brand-wrap { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.brand { word-break: keep-all; }
.brand-mark { width: 2rem; height: 2rem; flex: none; border-radius: 8px; }
.brand-mark.big { width: 3.4rem; height: 3.4rem; border-radius: 14px; }
.brand { margin: 0; font: 800 1.4rem/1.3 var(--f-head); text-wrap: balance; }
.verse {
  margin: .5rem 0 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: var(--muted);
  display: block; max-width: 60ch;
}
.verse-text { font: 700 1rem/1.6 var(--f-head); color: var(--ink); text-wrap: pretty; }
.verse-ref { display: block; font-size: .8rem; margin-top: .1rem; }
.verse.single { cursor: default; }
.btn.ghost { border-color: var(--rule); }
.btn.ghost:hover { background: var(--accent-soft); }

/* 설정 패널 */
.overlay {
  position: fixed; inset: 0; z-index: 30; background: rgb(0 0 0 / .35); display: grid; place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.panel {
  width: min(560px, 100%); max-height: 100%; overflow-y: auto; background: var(--card); border-radius: 18px; padding: 1.2rem;
  display: grid; gap: .7rem; align-content: start;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -1.2rem; background: var(--card); padding: .4rem 0; z-index: 1; }
.panel-head h2 { margin: 0; font-size: 1.15rem; }
.panel-sub { margin: .6rem 0 0; font-size: .95rem; }
.panel-help { margin: 0; font-size: .82rem; color: var(--muted); }
.verse-list { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--rule); border-radius: 12px; }
.verse-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .7rem; align-items: start; padding: .65rem .8rem; border-top: 1px solid var(--rule); }
.verse-list li:first-child { border-top: 0; }
.verse-list input { width: 1.15rem; height: 1.15rem; margin-top: .2rem; accent-color: var(--accent); }
.verse-list label { cursor: pointer; display: grid; font-size: .92rem; }
.verse-list small { color: var(--muted); font-size: .78rem; }
.verse-list .del { border: 0; background: none; color: var(--danger); font-size: .8rem; cursor: pointer; padding: .1rem .2rem; }
.verse-add { display: grid; gap: .5rem; }
.verse-add textarea, .verse-add input {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg); font-size: 16px;
}
.verse-add-row { display: flex; gap: .5rem; }
.verse-add-row input { flex: 1; min-width: 0; }
.menu {
  position: absolute; right: 0; top: 2.8rem; z-index: 5; min-width: 190px; display: grid; padding: .3rem;
  background: var(--card); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 8px 24px rgb(0 0 0 / .12);
}
.menu button { text-align: left; border: 0; background: none; padding: .65rem .75rem; border-radius: 8px; cursor: pointer; font-size: .9rem; }
.menu button:hover, .menu-file:hover { background: var(--accent-soft); }
.menu-file { text-align: left; padding: .65rem .75rem; border-radius: 8px; cursor: pointer; font-size: .9rem; }

.grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }

/* 오늘 */
.today { background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 1.2rem 1.2rem 1rem; }
.date-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.date-mid { text-align: center; display: grid; justify-items: center; gap: .1rem; }
.date-title { margin: 0; font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.progress { display: flex; align-items: center; gap: .8rem; margin: 1rem 0 .4rem; }
.bar { flex: 1; height: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .3s ease; }
.progress.all .bar span { background: var(--done); }
.progress-text { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.items { list-style: none; margin: 0; padding: 0; display: grid; }
.item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem .9rem; align-items: start; padding: .95rem 0; border-top: 1px solid var(--rule); }
.item:first-child { border-top: 0; }
.mark {
  width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 2px solid var(--rule);
  display: grid; place-items: center; color: transparent; font-size: 1rem; font-weight: 700; background: none; padding: 0;
}
button.mark { cursor: pointer; }
.item.done .mark { background: var(--done); border-color: var(--done); color: var(--card); }
.item-main { min-width: 0; display: grid; gap: .45rem; }
.item-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.item-label { font-weight: 600; font-size: 1.02rem; }
.item.done .item-label { color: var(--done); }
.item-meta { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.item-hint { font-size: .78rem; color: var(--muted); }

.stepper { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.stepper input {
  width: 4.5rem; text-align: center; padding: .4rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--bg);
  font-size: 16px; font-variant-numeric: tabular-nums;
}
.chip {
  border: 1px solid var(--rule); background: none; border-radius: 99px; padding: .3rem .75rem; font-size: .85rem; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.chip:hover { background: var(--accent-soft); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--card); }
.note {
  width: 100%; min-height: 2.6rem; padding: .5rem .7rem; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--bg); font-size: 16px; line-height: 1.5;
}
.status { margin: .6rem 0 0; font-size: .8rem; color: var(--muted); min-height: 1.2em; text-align: right; }
.status.warn { color: var(--danger); }

/* 요약 */
.stats { display: grid; gap: 1rem; }
.streak { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.streak > div { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: .9rem 1rem; display: grid; }
.streak b { font: 800 1.9rem/1.1 var(--f-head); font-variant-numeric: tabular-nums; color: var(--accent); }
.streak span { font-size: .8rem; color: var(--muted); }
.cal { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: .8rem; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-title { font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow span { text-align: center; font-size: .72rem; color: var(--muted); padding: .3rem 0; }
.cal-dow span:first-child { color: var(--danger); }
.day {
  aspect-ratio: 1; border: 0; border-radius: 8px; background: none; cursor: pointer; font-size: .8rem;
  font-variant-numeric: tabular-nums; display: grid; place-items: center; color: var(--ink);
}
.day.out { visibility: hidden; }
.day.future { color: var(--muted); opacity: .5; cursor: default; }
.day.l1 { background: var(--h1); } .day.l2 { background: var(--h2); } .day.l3 { background: var(--h3); color: #fff; } .day.l4 { background: var(--h4); color: var(--card); }
.day.sel { outline: 2px solid var(--ink); outline-offset: -2px; }
.day.today { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: .6rem; font-size: .72rem; color: var(--muted); }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .l1 { background: var(--h1); } .legend .l2 { background: var(--h2); } .legend .l3 { background: var(--h3); } .legend .l4 { background: var(--h4); }
.legend span { padding: 0 .2rem; }

.item-stats { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: .4rem 1rem; }
.is-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .8rem; padding: .6rem 0; border-top: 1px solid var(--rule); font-size: .88rem; }
.is-row:first-child { border-top: 0; }
.is-row .v { color: var(--muted); font-variant-numeric: tabular-nums; }
.is-bar { grid-column: 1 / -1; height: 5px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; }
.is-bar span { display: block; height: 100%; background: var(--accent); }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 20;
  background: var(--ink); color: var(--card); padding: .6rem 1rem; border-radius: 10px; font-size: .88rem; max-width: calc(100% - 32px);
}

/* 첫 화면: 프로필 고르기 — 로고처럼 남색 바탕에 따뜻한 빛, 밝은·어두운 모드 모두 같은 모습 */
.start {
  --st-bg: #172040; --st-bg2: #0b1022; --st-ink: #f6f2e7; --st-muted: #aab1c6; --st-line: rgba(255, 255, 255, .16);
  --st-glow: rgba(255, 196, 92, .2); --st-warm: #ffc45c; --st-err: #ff9d95;
  position: fixed; inset: 0; z-index: 40; overflow-y: auto; color: var(--st-ink); color-scheme: dark;
  background: radial-gradient(70% 42% at 50% 14%, var(--st-glow), transparent 70%), linear-gradient(180deg, var(--st-bg), var(--st-bg2));
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.start-inner {
  min-height: 100%; max-width: 760px; margin: 0 auto; position: relative;
  display: grid; justify-items: center; align-content: center; gap: 1.5rem; text-align: center; padding-block: 2.5rem;
}
.st-back {
  position: absolute; top: 0; left: 0; border: 0; background: none; color: var(--st-muted); font: inherit; font-weight: 600;
  cursor: pointer; padding: .4rem .2rem;
}
.st-back:hover { color: var(--st-ink); }
.st-mark { width: 3.4rem; height: 3.4rem; border-radius: 15px; box-shadow: 0 0 44px rgba(255, 196, 92, .28); }
.st-title { margin: 0; font: 800 clamp(1.35rem, 4.6vw, 2rem)/1.35 var(--f-head); text-wrap: balance; word-break: keep-all; }
.st-pick { display: grid; justify-items: center; gap: 1.6rem; width: 100%; }
.st-grid { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 1.3rem 1.5rem; }
.st-tile {
  display: grid; justify-items: center; gap: .65rem; width: 7.5rem; padding: 0; border: 0; background: none;
  color: var(--st-muted); cursor: pointer; font: inherit;
}
.st-avatar {
  width: 7.5rem; height: 7.5rem; border-radius: 22px; display: grid; place-items: center; position: relative;
  font: 800 3rem/1 var(--f-ui); color: #fff; background: #3a4a7a;
  outline: 3px solid transparent; outline-offset: 4px; transition: transform .15s ease, outline-color .15s ease, box-shadow .15s ease;
}
.st-tile:hover, .st-tile:focus-visible { color: var(--st-ink); outline: none; }
.st-tile:hover .st-avatar, .st-tile:focus-visible .st-avatar { transform: translateY(-3px); outline-color: var(--st-ink); box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.st-name { font-size: 1rem; font-weight: 600; display: inline-flex; align-items: center; gap: .3rem; max-width: 100%; white-space: nowrap; }
.st-lock { width: .95rem; height: .95rem; flex: none; color: var(--st-warm); }
.st-plus { background: transparent; border: 2px dashed var(--st-line); color: var(--st-muted); font-weight: 300; font-size: 3.4rem; }
.st-edit { position: absolute; inset: 0; border-radius: inherit; background: rgba(8, 12, 26, .78); display: grid; place-items: center; }
.st-pen { width: 2.2rem; height: 2.2rem; color: #fff; }
.st-btn {
  border: 1px solid var(--st-line); background: transparent; color: var(--st-muted); padding: .6rem 1.4rem; border-radius: 10px;
  font: inherit; font-weight: 600; letter-spacing: .03em; cursor: pointer;
}
.st-btn:hover, .st-btn:focus-visible { color: var(--st-ink); border-color: var(--st-ink); }
.st-btn.primary { background: var(--st-ink); color: #141c33; border-color: var(--st-ink); }
.st-btn[aria-pressed="true"] { background: var(--st-ink); color: #141c33; }
.st-form { display: grid; justify-items: center; gap: .9rem; width: min(360px, 100%); }
.st-form .st-avatar { width: 5.5rem; height: 5.5rem; font-size: 2.3rem; border-radius: 18px; }
.st-form .st-plus { font-size: 2.6rem; }
.st-label { color: var(--st-muted); }
.st-input {
  width: 100%; padding: .75rem .9rem; border-radius: 12px; border: 1px solid var(--st-line);
  background: rgba(255, 255, 255, .07); color: var(--st-ink); font-size: 16px;
}
.st-input::placeholder { color: rgba(255, 255, 255, .38); }
.st-input:focus-visible { outline: 2px solid var(--st-warm); outline-offset: 1px; }
.st-input.st-pin { width: 12rem; text-align: center; font-size: 1.6rem; letter-spacing: .5em; padding-left: 1.4rem; }
.st-fld { display: grid; gap: .35rem; width: 100%; text-align: left; font-size: .82rem; color: var(--st-muted); }
.st-actions { display: flex; gap: .6rem; }
.st-error { margin: 0; min-height: 1.2em; color: var(--st-err); font-size: .9rem; }
@media (max-width: 760px) {
  .st-grid { gap: 1rem 1.1rem; }
  .st-tile { width: 6.1rem; }
  .st-avatar { width: 6.1rem; height: 6.1rem; font-size: 2.5rem; border-radius: 18px; }
  .st-plus { font-size: 2.8rem; }
}
@media (prefers-reduced-motion: reduce) { .st-avatar { transition: none; } }

/* 프로필 */
.top-actions { display: flex; align-items: center; gap: .3rem; flex: none; }
.pf-chip {
  display: inline-flex; align-items: center; gap: .45rem; padding: .25rem .7rem .25rem .3rem; border: 1px solid var(--rule);
  border-radius: 99px; background: var(--card); cursor: pointer; font: inherit; font-size: .88rem; font-weight: 600; max-width: 10rem;
}
.pf-chip:hover { border-color: var(--accent); }
.pf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-avatar {
  width: 1.7rem; height: 1.7rem; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  color: #fff; font-weight: 700; font-size: .85rem; background: var(--accent);
}
.pf-avatar.big { width: 2.6rem; height: 2.6rem; font-size: 1.1rem; }
.pf-panel { gap: .9rem; }
.pf-list li { display: flex; }
.pf-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .6rem; }
.pf-item {
  width: 100%; height: 100%; display: grid; justify-items: center; gap: .35rem; padding: 1rem .6rem .8rem; border: 1px solid var(--rule);
  border-radius: 14px; background: var(--bg); cursor: pointer; font: inherit; color: var(--ink);
}
.pf-item:hover { border-color: var(--accent); }
.pf-item.cur { border-color: var(--accent); background: var(--accent-soft); }
.pf-item-name { font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-item-tag { font-size: .72rem; color: var(--muted); min-height: 1.4em; line-height: 1.4; }
.pf-item.cur .pf-item-tag { color: var(--accent); font-weight: 600; }
.pf-pin { display: grid; gap: .4rem; padding: .8rem; border-radius: 12px; background: var(--accent-soft); }
.pf-pin-label { font-weight: 600; font-size: .9rem; }
.pf-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.pf-row .field { flex: 1 1 9rem; }
.pf-box { border: 1px solid var(--rule); border-radius: 12px; padding: .6rem .8rem; }
.pf-box summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.pf-form { display: grid; gap: .6rem; padding-top: .7rem; }
.pf-form .btn { justify-self: start; }
.pf-manage { display: grid; gap: .6rem; border-top: 1px solid var(--rule); padding-top: .8rem; }
.pf-manage .panel-sub { margin: 0; }
.pf-manage .panel-help { margin: 0; }
.pf-manage > .link { justify-self: start; }
.pf-del summary { color: var(--danger); }
.pf-del .panel-help { margin: .5rem 0; }

/* 신호등 */
.signals { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: .7rem; margin-top: 1rem; }
.sig {
  display: grid; gap: .2rem; align-content: start; text-align: left; border: 1px solid var(--rule); border-radius: 14px;
  padding: .75rem .85rem; background: var(--sig-grey-soft); color: var(--ink); min-width: 0;
}
.sig[data-color="green"] { background: var(--sig-green-soft); }
.sig[data-color="yellow"] { background: var(--sig-yellow-soft); }
.sig[data-color="red"] { background: var(--sig-red-soft); }
button.sig { cursor: pointer; font: inherit; }
button.sig:hover { border-color: var(--accent); }
.sig-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.sig-name { font-size: .78rem; font-weight: 600; color: var(--muted); }
.sig-val { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.sig-msg { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.sig-trend { font-size: .78rem; font-weight: 600; }
.sig-trend.up { color: var(--sig-green); } .sig-trend.down { color: var(--sig-red); } .sig-trend.flat { color: var(--muted); }
.sig-more { font-size: .76rem; color: var(--accent); margin-top: .1rem; }
.lamp { display: inline-flex; gap: 4px; padding: 4px 6px; border-radius: 99px; background: var(--housing); flex: none; }
.lamp i { width: 11px; height: 11px; border-radius: 50%; background: var(--sig-off); opacity: .55; }
.lamp[data-on="red"] .red { background: var(--sig-red); opacity: 1; box-shadow: 0 0 8px var(--sig-red); }
.lamp[data-on="yellow"] .yellow { background: var(--sig-yellow); opacity: 1; box-shadow: 0 0 8px var(--sig-yellow); }
.lamp[data-on="green"] .green { background: var(--sig-green); opacity: 1; box-shadow: 0 0 8px var(--sig-green); }
.lamp.big { padding: 7px 10px; gap: 7px; }
.lamp.big i { width: 22px; height: 22px; }

.mood-memo { min-height: 8.5rem; line-height: 1.7; }
.mood { display: grid; gap: .45rem; padding: .95rem 0 .2rem; border-top: 1px solid var(--rule); }
.mood .chip[data-mood="peace"][aria-pressed="true"] { background: var(--sig-green); border-color: var(--sig-green); }
.mood .chip[data-mood="normal"][aria-pressed="true"] { background: var(--sig-yellow); border-color: var(--sig-yellow); color: #2b2f36; }
.mood .chip[data-mood="tired"][aria-pressed="true"] { background: var(--sig-red); border-color: var(--sig-red); }

.sd-top { display: flex; align-items: center; gap: 1rem; padding: .9rem; border-radius: 14px; background: var(--sig-grey-soft); }
.sd-top[data-color="green"] { background: var(--sig-green-soft); }
.sd-top[data-color="yellow"] { background: var(--sig-yellow-soft); }
.sd-top[data-color="red"] { background: var(--sig-red-soft); }
.sd-score { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.sd-msg { margin: .2rem 0 0; color: var(--muted); font-size: .88rem; }
.sd-verse { margin: 0; padding: .2rem 0 .2rem .9rem; border-left: 3px solid var(--rule); font: 700 .98rem/1.6 var(--f-head); }
.sd-verse cite { display: block; font: normal .78rem var(--f-ui); color: var(--muted); margin-top: .2rem; }
.sd-weak { margin: 0; font-size: .88rem; }
.sd-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.sd-dot {
  aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-variant-numeric: tabular-nums;
  background: var(--sig-grey-soft); color: var(--muted);
}
.sd-dot[data-color="green"] { background: var(--sig-green); color: #fff; }
.sd-dot[data-color="yellow"] { background: var(--sig-yellow); color: #2b2f36; }
.sd-dot[data-color="red"] { background: var(--sig-red); color: #fff; }
.sd-how { border-top: 1px solid var(--rule); padding-top: .7rem; }
.sd-how summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.sd-how p { margin: .5rem 0 0; }

/* 말씀 묵상 · 기도 제목 입력 */
.field {
  width: 100%; min-width: 0; padding: .5rem .7rem; border: 1px solid var(--rule); border-radius: 10px;
  background: var(--bg); font-size: 16px;
}
.pslot { display: grid; gap: .4rem; padding: .6rem .7rem; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); }
.pslot-label { font-size: .78rem; font-weight: 600; color: var(--muted); }
.pslot .field { background: var(--card); }
.pslot-note { background: var(--card); min-height: 6.5rem; line-height: 1.7; }
.pslot-sub { font-size: .74rem; color: var(--muted); margin-top: .2rem; }
.pslot-add { display: flex; gap: .4rem; }
.pslot-add .field { flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tag {
  display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .35rem .2rem .65rem; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent); font-size: .85rem; font-weight: 500; max-width: 100%; overflow-wrap: anywhere;
}
.tag button { border: 0; background: none; color: inherit; cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .2rem; }
.tag-btn { border: 0; cursor: pointer; padding: .2rem .65rem; font: inherit; font-size: .85rem; }
.tag-btn:hover { background: var(--h2); }
.suggest { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; font-size: .78rem; color: var(--muted); }
.suggest .chip { font-size: .78rem; padding: .2rem .6rem; }

/* 구절 미리보기 (개역한글) */
.verse-preview {
  display: grid; gap: .2rem; padding: .55rem .75rem; border-radius: 10px; background: var(--accent-soft);
  max-height: 14rem; overflow-y: auto;
}
.verse-preview.err { background: var(--sig-grey-soft); color: var(--muted); font-size: .82rem; }
.vp-ref { font-size: .74rem; font-weight: 600; color: var(--accent); }
.vp-text { margin: 0; font: 400 .95rem/1.7 var(--f-head); white-space: pre-wrap; }
.j-verse { margin: 0; padding: .4rem .6rem; border-radius: 8px; background: var(--bg); font: .9rem/1.7 var(--f-head); white-space: pre-wrap; }
.verse-add textarea { min-height: 3.5rem; }

/* 성경 통독 · 찬양 */
.read-add { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.read-add select.field { width: auto; flex: 1 1 8rem; }
.read-add .field.ch { width: 4.2rem; flex: none; text-align: center; font-variant-numeric: tabular-nums; }
.tag-muted { background: var(--sig-grey-soft); color: var(--muted); }
.songs { display: grid; gap: .3rem; }
.song { display: flex; align-items: center; gap: .4rem; padding: .3rem .2rem .3rem .7rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg); }
.song-title { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.song-title.muted { color: var(--muted); font-weight: 400; }
.song-count { min-width: 2.6rem; text-align: center; font-variant-numeric: tabular-nums; font-size: .9rem; }
.song .chip { padding: .2rem .6rem; }

/* 묵상·기도 기록 (달력) */
.journal { display: grid; gap: 1.2rem; }
.j-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.j-cal-card { background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: .9rem; display: grid; gap: .5rem; min-width: 0; }
.j-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.jd {
  min-height: 4.6rem; border: 1px solid transparent; border-radius: 10px; background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; align-items: stretch; gap: .15rem; padding: .3rem .35rem; text-align: left;
  cursor: pointer; font: inherit; min-width: 0; overflow: hidden;
}
.jd.out { background: none; cursor: default; }
.jd.future { opacity: .4; cursor: default; }
.jd.has { background: var(--accent-soft); }
.jd:hover:not(:disabled):not(.out) { border-color: var(--h3); }
.jd.sel { border-color: var(--ink); border-width: 2px; padding: calc(.3rem - 1px) calc(.35rem - 1px); }
.jd.dim { opacity: .3; }
.jd.match { background: var(--h2); }
.jd-top { display: flex; justify-content: space-between; align-items: center; gap: .2rem; }
.jd-num { font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.sigdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--sig-off); flex: none; }
.sigdot[data-color="green"] { background: var(--sig-green); }
.sigdot[data-color="yellow"] { background: var(--sig-yellow); }
.sigdot[data-color="red"] { background: var(--sig-red); }
.sigdot[data-color="progress"] { background: var(--sig-off); }
.badge {
  font-size: .6rem; font-weight: 700; line-height: 1; padding: .15rem .3rem; border-radius: 4px;
  background: var(--accent); color: var(--card); letter-spacing: .02em; white-space: nowrap;
}
.jd.today .jd-num { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.jd-pass { font-size: .68rem; line-height: 1.25; color: var(--accent); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.jd-marks { margin-top: auto; display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.jd-marks small { font-size: .62rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.m-qt, .m-pr { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.m-qt { background: var(--accent); }
.m-pr { background: var(--done); }
.j-legend { display: flex; gap: .4rem 1rem; justify-content: flex-end; flex-wrap: wrap; font-size: .74rem; color: var(--muted); }
.j-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.j-legend .sigdot + .sigdot { margin-left: -2px; }
.j-tools { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; padding-top: .3rem; border-top: 1px solid var(--rule); }
.j-tools .field { flex: 1; min-width: 10rem; }
.seg { display: flex; gap: .3rem; }
.j-filter { margin: 0; font-size: .85rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.j-detail {
  background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 1rem 1.1rem; display: grid; gap: .8rem;
  min-width: 0; position: sticky; top: max(12px, env(safe-area-inset-top));
}
.j-head { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.j-date { margin: 0; font-size: 1.05rem; }
.j-block { display: grid; gap: .3rem; padding-left: .8rem; border-left: 3px solid var(--rule); }
.j-qt { border-left-color: var(--accent); }
.j-pr { border-left-color: var(--done); }
.j-label { font-size: .74rem; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
.j-passage { margin: 0; font: 700 1rem/1.5 var(--f-head); }
.j-note { margin: 0; white-space: pre-wrap; line-height: 1.7; overflow-wrap: anywhere; }
.j-none { margin: 0; color: var(--muted); font-size: .85rem; }
.j-slot { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.j-slotname { font-size: .82rem; font-weight: 600; min-width: 2.4rem; }
.j-mood { margin: 0; font-size: .85rem; color: var(--muted); }
.j-sig { display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; font-weight: 600; padding: .2rem .6rem; border-radius: 99px; background: var(--sig-grey-soft); }
.j-sig[data-color="green"] { background: var(--sig-green-soft); }
.j-sig[data-color="yellow"] { background: var(--sig-yellow-soft); }
.j-sig[data-color="red"] { background: var(--sig-red-soft); }
.j-items { list-style: none; margin: 0; padding: 0; display: grid; }
.j-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .7rem; padding: .6rem 0; border-top: 1px solid var(--rule); }
.j-item:first-child { border-top: 0; padding-top: 0; }
.j-mark {
  width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 2px solid var(--rule); display: grid; place-items: center;
  font-size: .7rem; font-weight: 700; color: var(--card); margin-top: .1rem;
}
.j-item.done .j-mark { background: var(--done); border-color: var(--done); }
.j-item-body { display: grid; gap: .25rem; min-width: 0; }
.j-item-name { font-weight: 600; font-size: .92rem; }
.j-item.done .j-item-name { color: var(--done); }
.j-val { font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.j-meta { font-size: .76rem; font-weight: 400; color: var(--muted); }
.j-sermon { border-left-color: var(--accent); background: var(--accent-soft); padding: .7rem .8rem; border-radius: 0 12px 12px 0; }
.j-sermon .link { justify-self: start; }
.j-sermon-pass { margin: 0; font-size: .88rem; color: var(--accent); font-weight: 600; }
.j-apply b { font-size: .8rem; color: var(--muted); }
.j-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.j-summary { display: grid; gap: .6rem; }
.j-summary .panel-sub { margin: 0; }
.j-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: .6rem; }
.j-stats > div { background: var(--card); border: 1px solid var(--rule); border-radius: 14px; padding: .8rem .9rem; display: grid; }
.j-stats b { font: 800 1.6rem/1.1 var(--f-head); color: var(--accent); font-variant-numeric: tabular-nums; }
.j-stats span { font-size: .78rem; color: var(--muted); }

/* 탭 */
.tabs { display: flex; gap: .3rem; margin-top: 1rem; border-bottom: 1px solid var(--rule); }
.tab {
  padding: .55rem .9rem; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* 설교 노트 */
.sermons { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.s-side { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: .8rem; position: sticky; top: max(12px, env(safe-area-inset-top)); }
.s-side-head { display: flex; gap: .5rem; }
.s-side-head input {
  flex: 1; min-width: 0; padding: .5rem .7rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--card); font-size: 16px;
}
.s-list { list-style: none; margin: 0; padding: 0; display: grid; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; max-height: 70vh; overflow-y: auto; }
.s-list li + li { border-top: 1px solid var(--rule); }
.s-list button { width: 100%; text-align: left; border: 0; background: none; cursor: pointer; padding: .75rem .9rem; display: grid; gap: .15rem; }
.s-list button:hover, .s-list button.sel { background: var(--accent-soft); }
.s-list .s-meta { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.s-list .s-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-list .s-pass { font-size: .82rem; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-list-empty { padding: 1rem; color: var(--muted); font-size: .88rem; }
.s-edit { background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 1rem 1.2rem 1.2rem; min-height: 50vh; }
.s-top { display: flex; align-items: center; min-height: 2.2rem; }
.s-back { display: none; }
.s-top .status { margin: 0 0 0 auto; }
.s-empty { color: var(--muted); padding: 3rem 1rem; text-align: center; }
.s-form { display: grid; gap: .9rem; }
.s-row { display: grid; grid-template-columns: minmax(0, 10rem) minmax(0, 1fr) minmax(0, 1fr); gap: .7rem; }
.fld { display: grid; gap: .3rem; min-width: 0; }
.fld > span { font-size: .78rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.fld input, .fld textarea {
  width: 100%; min-width: 0; padding: .55rem .7rem; border: 1px solid var(--rule); border-radius: 10px; background: var(--bg);
  font-size: 16px; line-height: 1.6;
}
.fld input.s-title { font: 700 1.15rem/1.4 var(--f-head); }
#sBody { min-height: 16rem; }
.s-foot { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; padding-top: .3rem; }
.btn.danger-ghost { color: var(--danger); padding-inline: 0; }
.btn.danger { background: var(--danger); color: var(--card); }
.confirm { display: inline-flex; gap: .4rem; align-items: center; font-size: .85rem; }
.item-link { font-size: .8rem; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; justify-self: start; }

@media (max-width: 760px) {
  .sermons { grid-template-columns: minmax(0, 1fr); }
  .sermons.editing .s-side { display: none; }
  .sermons:not(.editing) .s-edit { display: none; }
  .s-side { position: static; }
  .s-list { max-height: none; }
  .s-back { display: inline-block; }
  .s-edit { padding: .8rem .95rem 1rem; }
  .s-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .s-row .fld:first-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .today { padding: 1rem .95rem .8rem; }
  .signals { grid-template-columns: minmax(0, 1fr); }
  .brand { font-size: 1.15rem; }
  .pf-chip { padding-right: .55rem; font-size: .82rem; max-width: 7.5rem; }
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; padding: .55rem .7rem; }
  .j-stats b { font-size: 1.35rem; }
  .j-grid { grid-template-columns: minmax(0, 1fr); }
  .j-detail { position: static; }
  .j-cal-card { padding: .6rem; }
  .jd { min-height: 3.2rem; padding: .25rem; }
  .jd.sel { padding: calc(.25rem - 1px); }
  .jd-pass { display: none; }
  .jd .badge { font-size: .52rem; padding: .12rem .2rem; letter-spacing: 0; }
  .read-add select.field { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* iPhone 홈 화면 앱: 최신 iOS는 상태 표시줄 아래에 흐림 효과를 넣어서, 그 구역을 비우고 내용을 시작함 */
@media (display-mode: standalone) {
  .app, .start { padding-top: calc(env(safe-area-inset-top, 0px) + 2.5rem); }
  .overlay { padding-top: calc(env(safe-area-inset-top, 0px) + 2rem); }
}
html.standalone .app, html.standalone .start { padding-top: calc(env(safe-area-inset-top, 0px) + 2.5rem); }
html.standalone .overlay { padding-top: calc(env(safe-area-inset-top, 0px) + 2rem); }

/* 휴대폰: 프로필은 로그인할 때만 고르고, 화면에는 프로필 버튼·관리를 두지 않음 */

/* ================= 디자인 개선 ================= */
/* 맨 위: 오늘의 말씀 + 내 영혼 표시등 */
.top { margin-bottom: 1.1rem; }
.hero {
  margin-top: 1rem; border-radius: 22px; padding: 1.4rem 1.5rem; color: var(--hero-ink);
  background: radial-gradient(70% 140% at 12% 0%, var(--hero-glow), transparent 62%), linear-gradient(155deg, var(--hero-1), var(--hero-2));
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1.2rem 1.6rem; align-items: center;
  box-shadow: 0 10px 30px rgba(19, 27, 53, .18);
}
.hero .verse { margin: 0; max-width: none; color: var(--hero-muted); display: grid; gap: .35rem; }
.verse-label { font-size: .72rem; font-weight: 600; letter-spacing: .08em; color: #f0c069; }
.hero .verse-text { color: var(--hero-ink); font: 800 clamp(1.15rem, 2.6vw, 1.5rem)/1.55 var(--f-head); text-wrap: pretty; word-break: keep-all; }
.hero .verse-ref { color: var(--hero-muted); font-size: .82rem; margin: 0; }
.hero-soul:empty { display: none; }
.soul {
  width: 100%; display: grid; gap: .35rem; text-align: left; cursor: pointer; font: inherit; color: var(--hero-ink);
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px; padding: .9rem 1rem;
}
.soul:hover, .soul:focus-visible { background: rgba(255, 255, 255, .1); outline: none; border-color: rgba(255, 255, 255, .28); }
.soul-label { font-size: .72rem; font-weight: 600; letter-spacing: .06em; color: var(--hero-muted); }
.soul-row { display: flex; align-items: center; gap: .6rem; }
.soul-title { font-size: 1.05rem; }
.soul-trend { font-size: .8rem; color: var(--hero-muted); }
.soul-trend.up { color: #8fd8a8; } .soul-trend.down { color: #ffb2a8; }
.soul-more { font-size: .78rem; color: #f0c069; }
.hero .lamp { background: #070a14; }

/* 탭: 알약 모양 */
.tabs { display: inline-flex; gap: .2rem; margin-top: 1.1rem; padding: .25rem; border: 0; border-radius: 14px; background: var(--accent-soft); max-width: 100%; }
.tab { border: 0; margin: 0; padding: .5rem 1rem; border-radius: 11px; color: var(--muted); }
.tab[aria-current="page"] { background: var(--card); color: var(--accent); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }

/* 오늘 카드 */
.today { border-radius: 22px; padding: 1.1rem 1.3rem 1rem; box-shadow: 0 1px 2px rgba(60, 50, 30, .04); }
.date-title { font: 800 1.15rem/1.3 var(--f-head); }
.signals { display: block; margin: .9rem 0 .3rem; }
.sig-today {
  display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; border-radius: 14px; background: var(--sig-grey-soft);
}
.sig-today[data-color="green"] { background: var(--sig-green-soft); }
.sig-today[data-color="yellow"] { background: var(--sig-yellow-soft); }
.sig-today[data-color="red"] { background: var(--sig-red-soft); }
.sig-today-text { display: grid; min-width: 0; }
.sig-today-text b { font-size: .95rem; }
.sig-today-text span { font-size: .8rem; color: var(--muted); }

/* 체크 항목: 한 줄로 접힘 */
.item { padding: .85rem 0; gap: .2rem .85rem; }
.item .mark { margin-top: .05rem; }
.item-head { align-items: center; flex-wrap: nowrap; }
.item-head .item-meta { margin-left: auto; white-space: nowrap; }
.item-head.clickable { cursor: pointer; }
.item-head.clickable:hover .item-label { color: var(--accent); }
.item-toggle {
  flex: none; width: 2rem; height: 2rem; margin: -.3rem -.4rem -.3rem 0; border: 0; border-radius: 10px; background: none; cursor: pointer;
  display: grid; place-items: center; color: var(--muted);
}
.item-toggle::before { content: ""; width: .5rem; height: .5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .15s ease; }
.item.open .item-toggle::before { transform: translateY(2px) rotate(-135deg); }
.item-toggle:hover { background: var(--accent-soft); color: var(--ink); }
.item-sum { font-size: .84rem; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.item.done .item-sum { color: var(--ink); opacity: .75; }
.item-body { display: grid; gap: .5rem; padding-top: .45rem; }
.item.done .item-label { color: var(--done); }

/* 오늘 내 마음 */
.mood { border-top: 1px solid var(--rule); padding-top: 1rem; }

/* 작은 달력: 그날 표시등 점 */
.stats { gap: 0; }
.cal { border-radius: 22px; padding: 1rem; }
.day { position: relative; border-radius: 10px; }
.day[data-color]::after {
  content: ""; position: absolute; left: 50%; bottom: 14%; width: 6px; height: 6px; border-radius: 50%; transform: translateX(-50%); background: var(--sig-off);
}
.day[data-color="green"]::after { background: var(--sig-green); }
.day[data-color="yellow"]::after { background: var(--sig-yellow); }
.day[data-color="red"]::after { background: var(--sig-red); }
.day:hover:not(:disabled) { background: var(--accent-soft); }
.day.sel { outline: 2px solid var(--accent); }
.legend { gap: 4px; }
.legend span { padding-left: .3rem; }

@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding: 1.2rem 1.15rem; border-radius: 20px; }
  .tabs { display: flex; }
  .tab { flex: 1; text-align: center; padding: .5rem .3rem; }
  .today { padding: 1rem 1rem .9rem; }
}
@media (prefers-reduced-motion: reduce) { .item-toggle::before { transition: none; } }

/* 체크리스트 화면: 달력 없이 한 줄, 읽기 좋은 폭 */
.grid { grid-template-columns: minmax(0, 1fr); max-width: 760px; margin-inline: auto; }
.tabs { display: flex; width: fit-content; margin-inline: auto; }
@media (max-width: 760px) { .tabs { width: auto; margin-inline: 0; } }

/* 성경 본문 창(말씀 묵상·설교 노트·구절 추가): 스크롤 없이 말씀 길이만큼 늘어남 */
.verse-preview { max-height: none; overflow: visible; }

/* ================= 돌려주기 (되묻기·되물음·돌봄·기도 돌아보기) ================= */
/* 설교 적용 되묻기 카드 */
.followup {
  display: grid; gap: .45rem; margin: .7rem 0 .2rem; padding: .85rem 1rem; border-radius: 14px;
  background: var(--accent-soft); border-left: 3px solid var(--accent);
}
.fu-label { font-size: .74rem; font-weight: 600; letter-spacing: .02em; color: var(--muted); }
.fu-apply { margin: 0; font: 800 1.02rem/1.55 var(--f-head); white-space: pre-wrap; overflow-wrap: anywhere; }
.fu-q { margin: .1rem 0 0; font-size: .88rem; font-weight: 600; }
.followup .note { background: var(--card); }
.fu-history { margin: 0; padding-left: 1.1rem; font-size: .82rem; color: var(--muted); display: grid; gap: .15rem; }
.fu-open { justify-self: start; font-size: .8rem; }
.s-apply-help { margin: -.4rem 0 0; }
.s-followups { display: grid; gap: .35rem; padding: .7rem .85rem; border-radius: 12px; background: var(--accent-soft); }

/* 묵상 되물음 */
.qt-prompt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .6rem; align-items: baseline; padding: .55rem .75rem; border-radius: 10px; background: var(--sig-yellow-soft); }
.qt-prompt-label { grid-column: 1 / -1; font-size: .72rem; font-weight: 600; color: var(--warm); letter-spacing: .03em; }
.qt-prompt-text { margin: 0; font: 700 .95rem/1.5 var(--f-head); }
.qt-prompt .link { font-size: .78rem; white-space: nowrap; }
.j-prompt { margin: 0; font-size: .82rem; color: var(--warm); font-weight: 600; }

/* 지친 날 돌봄 */
.care { display: grid; gap: .45rem; padding: .9rem 1rem; border-radius: 14px; background: var(--sig-yellow-soft); }
.care-title { margin: 0; font-weight: 700; }
.care-sub { margin: 0; font-size: .84rem; color: var(--muted); }
.care-verse { margin: 0; padding-left: .8rem; border-left: 3px solid var(--warm); font: 700 .98rem/1.7 var(--f-head); white-space: pre-wrap; }
.care-verse cite { display: block; font: normal .78rem var(--f-ui); color: var(--muted); margin-top: .2rem; }
.care-memo { display: grid; gap: .15rem; padding: .55rem .7rem; border-radius: 10px; background: var(--card); }
.care-memo p { margin: 0; font-size: .9rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.care-label { font-size: .74rem; color: var(--muted); }
.soul-care { font-size: .8rem; color: #f0c069; }

/* 기도: 응답 표시, 한 달 전 되짚기, 돌아보기 */
.tag.answered { background: var(--done-soft); color: var(--done); }
.pr-lookback { margin: 0; font-size: .82rem; color: var(--muted); }
.pr-review { display: grid; gap: .5rem; margin-top: .6rem; }
.pr-review .panel-sub { margin: 0; }
.pr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.pr-row { display: grid; gap: .35rem; padding: .75rem .9rem; border-radius: 14px; background: var(--card); border: 1px solid var(--rule); }
.pr-row.answered { background: var(--done-soft); border-color: transparent; }
.pr-top { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.pr-meta { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pr-note { margin: 0; font-size: .88rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.pr-actions { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.pr-actions .field { flex: 1 1 12rem; }
.pr-actions .chip { font-size: .78rem; padding: .25rem .65rem; }
.j-fu { border-left-color: var(--warm); }

/* iPhone Safari: 날짜 입력칸이 자기 고유 너비를 고집해 칸 밖으로 튀어나오는 문제 */
input[type="date"] {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 2.6rem;
}
input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .6; }

/* 글 칸은 스크롤 없이 글 양만큼 늘어남 (app.js autoGrow) */
textarea { overflow: hidden; resize: none; overflow-wrap: anywhere; }

/* ---------- 소개·가입·계정 ---------- */
.lg-inner { gap: 1.2rem; align-content: start; padding-top: 3rem; }
.lg-lead { margin: 0; max-width: 34rem; color: var(--st-muted); line-height: 1.75; word-break: keep-all; }
.g-btn {
  display: inline-flex; align-items: center; gap: .7rem; padding: .8rem 1.4rem; border-radius: 999px; background: #fff; color: #1f1f1f;
  font-weight: 600; text-decoration: none; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); min-height: 48px;
}
.g-btn:focus-visible { outline: 3px solid var(--st-warm); outline-offset: 3px; }
.g-logo { width: 1.3rem; height: 1.3rem; }
.lg-dev { color: var(--st-muted); font-size: .85rem; }
.lg-feats { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .6rem; width: min(560px, 100%); text-align: left; }
.lg-feats li { display: grid; gap: .15rem; padding: .8rem 1rem; border: 1px solid var(--st-line); border-radius: 14px; background: rgba(255, 255, 255, .04); }
.lg-feats b { font-size: .98rem; }
.lg-feats span { color: var(--st-muted); font-size: .88rem; word-break: keep-all; }
.lg-note { margin: 0; color: var(--st-muted); font-size: .85rem; }
.lg-foot { display: flex; gap: .6rem; font-size: .85rem; color: var(--st-muted); }
.lg-foot a { color: var(--st-muted); }
.su-form { display: grid; gap: 1rem; width: min(440px, 100%); text-align: left; }
.su-email { margin: 0; color: var(--st-muted); text-align: center; overflow-wrap: anywhere; }
.su-claim { border: 1px solid var(--st-line); border-radius: 12px; padding: .7rem .9rem; display: grid; gap: .6rem; margin: 0; }
.su-claim legend { padding: 0 .3rem; font-weight: 600; }
.su-opt { display: flex; gap: .5rem; align-items: center; cursor: pointer; }
.su-agree { display: grid; gap: .55rem; padding: .9rem; border: 1px solid var(--st-line); border-radius: 12px; font-size: .92rem; }
.su-agree label { display: flex; gap: .5rem; align-items: flex-start; cursor: pointer; line-height: 1.5; }
.su-agree input { width: 1.15rem; height: 1.15rem; margin-top: .15rem; flex: none; accent-color: var(--st-warm); }
.su-agree a { color: var(--st-ink); }
.su-all { padding-bottom: .55rem; border-bottom: 1px solid var(--st-line); }
.su-help { margin: 0; color: var(--st-muted); font-size: .8rem; line-height: 1.6; word-break: keep-all; }
.signup .st-actions { justify-content: center; flex-wrap: wrap; }
.ad-slot { width: 100%; max-width: 760px; margin: 1.2rem auto 0; min-height: 0; }
.ad-slot .ad-label { display: block; font-size: .7rem; color: var(--muted); margin-bottom: .2rem; }
.landing .ad-slot .ad-label { color: var(--st-muted); }
