/* 잇담 (화면정의서 10/30) — app.css·demo.css 위에 이번 판에만 필요한 것 */

/* 맨 위 막대: 보호자 폰 / 부모님 폰 바꿔 보기 */
.demobar a { color: #fff; font-weight: 700; text-decoration: none; margin-right: auto; opacity: .8; font-size: 14px; min-height: 32px; display: flex; align-items: center; }

/* 상단: 진행 단계 · 설정 아이콘 */
.appbar .step { margin-left: auto; color: var(--ink-2); font-weight: 700; font-size: 16px; padding-right: 4px; }
.gear { margin-left: auto; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 999px; color: var(--ink); }
.gear svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.gear:active { background: var(--panel); }
.step:not([hidden]) + .gear { margin-left: 0; }

/* 맨 위 배너: 예시예요 · 알림 꺼짐 · 보기만 하는 가족 */
.topbanner { position: fixed; z-index: 19; left: 0; right: 0; top: calc(var(--bar) + var(--demo) + var(--top)); background: var(--accent-soft); color: var(--ink); font-size: 15px; font-weight: 600; padding: 10px var(--gutter); display: flex; align-items: center; gap: 8px; }
.topbanner > span { flex: 1; min-width: 0; }
.topbanner button, .topbanner a { border: 0; background: none; font: inherit; color: var(--accent); font-weight: 700; padding: 6px 4px; text-decoration: none; }
body.has-banner main { padding-top: calc(var(--bar) + var(--demo) + var(--top) + 52px); }

/* 아래에서 올라오는 시트 (R-01-S1 · M-03-S1 · H-01-S1 …) */
.bsheet { border: 0; padding: 0; margin: auto 0 0; width: 100%; max-width: 100%; max-height: 92vh; background: transparent; }
.bsheet::backdrop { background: rgba(23, 32, 29, .45); }
.bs-in { max-width: 560px; margin: 0 auto; background: var(--ground); border-radius: 22px 22px 0 0; padding: 8px var(--gutter) calc(20px + var(--bottom)); max-height: 92vh; overflow-y: auto; }
.bsheet[open] .bs-in { animation: sheet .24s var(--ease); }
.bs-head { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; background: var(--ground); padding: 8px 0; z-index: 1; }
.bs-head h2 { flex: 1; font-size: 21px; font-weight: 700; }
.bs-x { width: 44px; height: 44px; border: 0; background: none; font-size: 20px; color: var(--ink-2); border-radius: 999px; }
.bs-body .btn { width: 100%; }
.bs-body .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }

/* 연도 고르기 (R-01-S1) */
.years { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scroll-snap-type: x mandatory; }
.years label { scroll-snap-align: center; flex: none; position: relative; }
.years input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.years span { display: grid; place-items: center; min-width: 76px; min-height: 52px; border-radius: 14px; box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 700; font-variant-numeric: tabular-nums; }
.years input:checked + span { background: var(--accent); color: #fff; box-shadow: none; }
.years.off { opacity: .35; pointer-events: none; }

/* 3택 줄 (R-01 카테고리) */
.qrow { padding: 14px 0; border-bottom: 1px solid var(--line); }
.qrow .q { display: flex; align-items: center; gap: 12px; }
.qrow .q b { flex: 1; min-width: 0; font-size: 18px; }
.qrow .seg3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 228px; flex: none; }
.seg3 label { position: relative; }
.seg3 input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg3 span { display: grid; place-items: center; min-height: 44px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--line); font-size: 15px; font-weight: 600; color: var(--ink-2); }
.seg3 input:checked + span { background: var(--accent); color: #fff; box-shadow: none; }
.chip.dot span::after { content: ""; width: 7px; height: 7px; border-radius: 99px; background: currentColor; margin-left: 6px; }
@media (max-width: 400px) { .qrow .q { flex-wrap: wrap; } .qrow .seg3 { width: 100%; } }

/* 할 일 카드 · 누락 카드 */
.card-line { display: flex; align-items: center; gap: 10px; min-height: 60px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; font: inherit; text-align: left; padding: 8px 0; cursor: pointer; }
.card-line .txt { flex: 1; min-width: 0; display: grid; }
.card-line .nm { font-weight: 700; }
.card-line .meta { color: var(--ink-2); font-size: 15px; }
.card-line.todo .nm { color: var(--accent); }
.dayrow { display: flex; align-items: baseline; gap: 10px; }
.dayrow b { font-size: 19px; }
.dayrow .st { margin-left: auto; color: var(--ink-2); font-weight: 600; }
.dayrow .st.ok { color: var(--accent); }
.dayrow .st.miss { color: var(--warn); }

/* 사진 미리 보기 (M-02) */
.photo { width: 100%; max-height: 300px; object-fit: contain; border-radius: 14px; background: var(--panel); display: block; margin-top: 8px; }
.tips { margin: 12px 0 0; padding-left: 20px; color: var(--ink-2); }
.tips li { margin-top: 4px; }

/* 기록 줄 (D-03 · S-02 변경 이력) */
.hist-row { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.hist-row .d { color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 600; }

/* 화면 목록 */
.toc h3 { font-size: 15px; color: var(--ink-2); margin: 24px 0 4px; }
.toc a { display: flex; gap: 12px; align-items: center; min-height: 48px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.toc a b { width: 72px; flex: none; color: var(--accent); font-variant-numeric: tabular-nums; }
.toc a .who { margin-left: auto; color: var(--ink-2); font-size: 14px; }

/* 부모님 폰: 탭 없음, 글자 한 단계 크게 */
body.on-parent .tabbar, body.on-parent .gear { display: none; }
.parent .small-links { display: flex; justify-content: center; gap: 20px; margin-top: 40px; }
.parent .small-links a, .parent .small-links button { font-size: 17px; color: var(--ink-2); background: none; border: 0; text-decoration: underline; }
.parent .code { font-size: 34px; font-weight: 800; letter-spacing: .18em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.perm { display: flex; align-items: center; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--line); text-align: left; }
.perm .txt { flex: 1; }
.perm .ok { color: var(--accent); font-weight: 700; }
.perm .btn { min-height: 48px; font-size: 18px; width: auto; margin: 0; padding: 8px 18px; }

.btn.off { opacity: .42; }
.fab { position: fixed; z-index: 21; right: max(var(--gutter), calc(50vw - 264px)); bottom: calc(var(--tabbar) + var(--bottom) + 16px); min-height: 52px; box-shadow: 0 6px 18px rgba(23,32,29,.18); }
/* 하나 고르기: 고르기 전에도 칸이 보이게 테두리 */
.seg { box-shadow: inset 0 0 0 1.5px var(--line); }
button.chip { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; }
.bsheet { overflow: hidden; }
#screen:has(.fab) { padding-bottom: 84px; }
