/* 설교자의 서재 앱 — 휴대폰 먼저. site.css 의 색·단추를 쓰고 앱 틀(아래 탭·책 그리드·읽기)만 더한다. 이모지·그라데이션 없이 */
body.app { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
body.app .topbar .wrap { height: 54px; }
body.app main.wrap { padding-top: 14px; padding-bottom: 24px; min-height: calc(100vh - 140px); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); background: rgba(255, 251, 245, .97); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(8px); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 60px; text-decoration: none; color: #8B7B6C; font-size: 12px; font-weight: 700; }
.tabbar a svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--accent); }
@media (min-width: 900px) { .tabbar { left: 50%; transform: translateX(-50%); width: 560px; bottom: 14px; border: 1px solid var(--line); border-radius: 18px; padding-bottom: 0; box-shadow: 0 8px 24px rgba(60, 40, 20, .12); } }

.sec { margin: 18px 0 8px; display: flex; align-items: baseline; gap: 8px; }
.sec h2 { margin: 0; font-size: 18px; }
.sec .more { margin-left: auto; font-size: 14px; color: var(--accent); text-decoration: none; font-weight: 700; }
.hello { background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; gap: 14px; align-items: center; }
.hello b { font-size: 19px; }
.hello .grow { flex: 1; min-width: 0; }
.empty { text-align: center; padding: 34px 16px; color: var(--sub); background: var(--paper); border: 1px dashed var(--line); border-radius: 16px; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 6px; }

/* 책 그리드 */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
/* 아이패드·PC: 폭에 맞춰 한 줄에 여러 권 (표지가 너무 커지지 않게) */
@media (min-width: 560px) { .grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 18px 14px; } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); } }
.row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(104px, 120px); gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.bk { display: block; text-decoration: none; color: inherit; min-width: 0; }
.cover { position: relative; aspect-ratio: 2 / 3; border-radius: 8px; overflow: hidden; background: #E9DCCB; border: 1px solid var(--line); box-shadow: 0 2px 6px rgba(60, 40, 20, .08); }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover .ph { position: absolute; inset: 0; padding: 10px 9px; display: flex; flex-direction: column; justify-content: space-between; font-weight: 800; font-size: 13px; line-height: 1.35; color: #3A281C; word-break: keep-all; overflow: hidden; }
.cover .ph small { font-weight: 600; font-size: 11px; color: #6E523C; }
.cover .tag { position: absolute; left: 6px; bottom: 6px; background: rgba(58, 40, 28, .82); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.bk .t { margin-top: 6px; font-size: 13px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; }
.bk .a { font-size: 12px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 줄 목록 */
.list .it { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; align-items: flex-start; }
.list .it .cover { width: 56px; flex: none; }
.list .it .grow { flex: 1; min-width: 0; }
.list .it b { display: block; font-size: 15px; }
.list .it .q { font-size: 14px; color: #4A3628; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.list .it .q mark { background: #F7E3D8; color: inherit; padding: 0 2px; border-radius: 3px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.chips button { flex: none; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font: inherit; font-size: 14px; font-weight: 700; color: var(--sub); cursor: pointer; }
.chips button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.searchbar { display: flex; gap: 8px; margin-bottom: 10px; }
.searchbar input { flex: 1; min-width: 0; }

/* 책 화면 */
.book-head { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: start; }
@media (min-width: 640px) { .book-head { grid-template-columns: 160px 1fr; } }
.book-head h1 { margin: 0 0 4px; font-size: 21px; line-height: 1.35; }
.book-head .sub { color: var(--sub); font-size: 14px; }
.book-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.prose p { margin: 0 0 10px; color: #4A3628; }
.prose ul { margin: 0 0 10px; padding-left: 20px; color: #4A3628; }
.toc { list-style: none; margin: 0; padding: 0; }
.toc li a { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); text-decoration: none; color: inherit; font-size: 15px; }
.toc li a span { margin-left: auto; color: var(--sub); font-size: 13px; }
.toc li.l2 a { padding-left: 14px; font-size: 14px; }
.toc li.l3 a { padding-left: 28px; font-size: 14px; color: var(--sub); }

/* 읽기 */
body.reading .tabbar { display: none; }
body.reading { padding-bottom: 0; }
.reader-bar { position: sticky; top: 54px; z-index: 6; display: flex; align-items: center; gap: 6px; background: rgba(246, 239, 229, .96); padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.reader-bar .ttl { flex: 1 1 140px; min-width: 0; font-weight: 800; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reader-bar input { width: 64px; text-align: center; padding: 7px 6px; }
.seg2 { display: inline-grid; grid-auto-flow: column; background: #EFE6DA; border-radius: 10px; padding: 3px; gap: 3px; }
.seg2 button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--sub); padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.seg2 button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
.reader { display: grid; gap: 12px; margin-top: 12px; }
.reader.both { grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 899px) { .reader.both { grid-template-columns: 1fr; } }
.pdfbox { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; min-height: 200px; display: flex; justify-content: center; touch-action: pan-y pinch-zoom; }
.pdfbox canvas { display: block; max-width: 100%; height: auto; }
.txtbox { background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 18px; font-size: var(--fs, 17px); line-height: 1.85; color: #2E2018; word-break: keep-all; }
.txtbox p { margin: 0 0 .9em; }
.pager { display: flex; gap: 8px; justify-content: center; margin: 14px 0 6px; }
.note-working { background: #FFF6F0; border: 1px solid #F0D2C0; color: var(--accent); border-radius: 12px; padding: 12px 14px; font-weight: 700; margin: 10px 0; }

/* 올리기 */
.drop { display: block; border: 2px dashed #D9C3AE; border-radius: 16px; background: var(--paper); padding: 28px 16px; text-align: center; cursor: pointer; }
.drop b { display: block; font-size: 17px; margin-bottom: 4px; }
.drop input { display: none; }
.drop .drop-n { display: block; margin: 2px 0 6px; font-size: 14px; font-weight: 700; color: #8A5A3B; }
.drop.over { border-color: #B8643F; background: #FBEFE4; }
.prog { height: 8px; border-radius: 999px; background: #EFE6DA; overflow: hidden; margin-top: 10px; }
.prog div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* 설치 안내 띠 */
.install-bar { display: flex; gap: 10px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.install-bar img { width: 38px; height: 38px; border-radius: 10px; }
.install-bar .grow { flex: 1; min-width: 0; font-size: 14px; }
.spin { text-align: center; color: var(--sub); padding: 40px 0; }
.err { background: var(--bad-bg); color: var(--bad); border-radius: 12px; padding: 14px; font-weight: 600; }

/* 전체 화면 읽기 */
body.immersive .topbar, body.immersive .reader-bar, body.immersive .pager, body.immersive .note-working { display: none !important; }
body.immersive { background: #2b2521; }
body.immersive main.wrap { max-width: none; padding: 4px 4px 0; }
body.immersive .reader { margin-top: 0; gap: 6px; }
body.immersive .pdfbox { border: 0; border-radius: 0; background: #2b2521; }
body.immersive .txtbox { border: 0; border-radius: 0; min-height: 100vh; }
.imm-bar { display: none; }
body.immersive .imm-bar { display: flex; align-items: center; gap: 8px; position: fixed; top: calc(8px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); z-index: 40; opacity: .75; }
body.immersive .imm-bar .imm-page { color: #fff; background: rgba(20, 16, 13, .7); border-radius: 999px; padding: 6px 11px; font-size: 13px; font-weight: 700; }
body.immersive .imm-bar button { border: 0; border-radius: 999px; padding: 8px 15px; font: inherit; font-size: 14px; font-weight: 800; color: #fff; background: rgba(20, 16, 13, .78); cursor: pointer; }

/* 홈 대시보드 (프로그램 홈처럼) */
body.app main.wrap { max-width: 1240px; }
.dash-hero { position: relative; width: 100%; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: #F5D6B4 url(/hero.jpg) left center / cover no-repeat; min-height: 250px; aspect-ratio: 3 / 1; max-height: 340px; display: flex; align-items: center; margin-bottom: 14px; }
.dash-hero-text { margin-left: 44%; margin-right: 5%; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dash-hero h1 { margin: 4px 0 0; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.25; letter-spacing: -.02em; }
.dash-hero p { margin: 0; color: #5E4B3E; font-size: 15px; }
.dash-hero .dash-read { font-size: 14px; opacity: .9; }
.dash-hero .chips { padding: 0; }
.chip { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 11px; border-radius: 999px; background: rgba(255, 255, 255, .75); color: #5E4B3E; }
.dash-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.st { border-radius: 18px; padding: 16px 18px; border: 1px solid var(--line); }
.st.mint { background: #DDEFE7; } .st.peach { background: #F9E0D3; } .st.sun { background: #FBF0D2; } .st.sky { background: #DCE8F3; }
.st-l { font-size: 13px; font-weight: 700; color: #5E4B3E; }
.st-v { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0; }
.st-s { font-size: 12px; color: #6E523C; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: start; }
.dash-main, .dash-side { display: grid; gap: 14px; min-width: 0; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; min-width: 0; }
.panel-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.panel-h h2 { margin: 0; font-size: 17px; }
.panel-h .more { margin-left: auto; font-size: 14px; color: var(--accent); text-decoration: none; font-weight: 700; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding: 6px 0 0; border-bottom: 1px solid var(--line); }
.chart i { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; opacity: .85; min-width: 3px; }
.chart i.z { background: #E6D8C6; opacity: 1; }
.today { display: grid; grid-template-columns: 76px 1fr; gap: 12px; text-decoration: none; color: inherit; align-items: start; }
.today b { display: block; font-size: 15px; line-height: 1.35; }
.today p { margin: 6px 0 0; font-size: 13px; color: #4A3628; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.kdc { display: grid; gap: 7px; }
.kdc-r { display: grid; grid-template-columns: 62px 1fr 52px; gap: 8px; align-items: center; text-decoration: none; color: inherit; font-size: 13px; }
.kdc-bar { height: 8px; border-radius: 999px; background: #EFE6DA; overflow: hidden; }
.kdc-bar i { display: block; height: 100%; border-radius: 999px; }
.kdc-c { text-align: right; color: var(--sub); }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } .dash-side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 760px) { .dash-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .st-v { font-size: 22px; } }
/* 휴대폰: 그림은 위, 글은 그 아래 온 폭 (한 글자씩 세로로 쌓이지 않게) */
@media (max-width: 640px) {
  .dash-hero { display: block; aspect-ratio: auto; max-height: none; min-height: 0; padding-top: 170px; background-size: auto 172px; background-position: left top; }
  .dash-hero-text { margin: 0; padding: 14px 16px 16px; background: rgba(255, 251, 245, .97); border-top: 1px solid var(--line); }
  .dash-hero h1 { font-size: 21px; }
}

/* 뒤로 단추 (홈 화면 앱에는 브라우저 뒤로가 없다) */
.backbtn { flex: none; border: 1px solid var(--line); background: var(--paper); border-radius: 10px; font: inherit; font-size: 14px; font-weight: 800; color: var(--accent); padding: 6px 10px; cursor: pointer; }
.backbtn[hidden] { display: none; }

/* 서재 성장: 나무 단계 · 처음 할 일 · 둘러보기 · 함께 성장하기 */
.grow-card { margin: 14px 0; }
.grow-top { display: flex; align-items: center; gap: 12px; }
.grow-top .grow { flex: 1; min-width: 0; }
.grow-n b { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.grow-n span { margin-left: 4px; color: var(--sub); font-weight: 700; }
.badge.grow-b { font-size: 14px; padding: 4px 12px; }
.lv-seed { background: #F1E6D8; border-color: #DCC7AE; color: #7A5634; }
.lv-sprout { background: #E9F4DD; border-color: #C9E2B0; color: #4E7A2C; }
.lv-branch { background: #EEF0DA; border-color: #D5DAA8; color: #66702A; }
.lv-tree { background: #DDEFE3; border-color: #B5D9C1; color: #2F6B4F; }
.lv-forest { background: #D3E8DA; border-color: #9CC8AC; color: #23573E; }
.lv-eden { background: #E6EFD4; border-color: #BFD49A; color: #3F5E1E; }
.lv-growing { background: #2F6B4F; border-color: #2F6B4F; color: #fff; }
.lv-track { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.lv-track li { text-align: center; font-size: 12px; color: var(--sub); }
.lv-track li i { display: block; height: 6px; border-radius: 99px; background: #EFE6DA; margin-bottom: 6px; }
.lv-track li.past i { background: #B5D9C1; }
.lv-track li.now i { background: var(--ok); }
.lv-track li b { display: block; font-size: 13px; color: var(--ink); }
.lv-track li.now b { color: var(--ok); }
.lv-track li span { display: block; white-space: nowrap; }
.grow-3d { margin: 12px 0 0; font-size: 14px; color: var(--sub); background: #F6EFE5; border-radius: 10px; padding: 8px 12px; }
.grow-3d.on { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.steps { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.steps ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.steps li a { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 15px; }
.steps li a::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; box-sizing: border-box; }
.steps li.ok a { color: var(--sub); text-decoration: line-through; }
.steps li.ok a::before { background: var(--ok); border-color: var(--ok); }
.dlg.tour h3 { margin: 4px 0 8px; font-size: 20px; }
.dlg.tour p { color: var(--sub); line-height: 1.6; margin: 0; }
.tour-dots { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.tour-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tour-dots i.on { background: var(--accent); }
.dlg .fld { display: block; margin-top: 10px; }
.dlg .fld span { display: block; font-size: 14px; font-weight: 700; margin-bottom: 4px; }
@media (max-width: 520px) { .lv-track li span { font-size: 10px; } .grow-n b { font-size: 26px; } }
.grow-bs { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* 그림 띠: 성장 단계별 거실 통창 풍경 — 풍경이 가려지지 않게 그림은 위, 글은 아래 */
.dash-hero.stage { display: block; aspect-ratio: auto; max-height: none; min-height: 0; padding-top: 33.333%; background-color: #F5D6B4; background-size: 100% auto; background-position: center top; }
.dash-hero.stage .dash-hero-text { margin: 0; max-width: none; padding: 16px 22px 18px; background: var(--paper); border-top: 1px solid var(--line); }
.grow-pic { width: 120px; height: 80px; border-radius: 12px; overflow: hidden; flex: none; border: 1px solid var(--line); background: #EFE6DA; }
.grow-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.water { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: #EEF5F9; border: 1px solid #D3E4EE; border-radius: 12px; padding: 10px 12px; }
.water-t { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 2px; }
.water-t b { color: #2F5F7A; font-size: 15px; }
.water-w { display: flex; gap: 6px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--sub); }
.wd i { width: 16px; height: 20px; display: block; background: #D7E3EA; clip-path: path('M8 0 C8 0 16 9 16 13.5 A8 8 0 0 1 0 13.5 C0 9 8 0 8 0 Z'); }
.wd.on i { background: #4E8DB5; }
.wd.today b { color: #2F5F7A; font-weight: 800; }
@media (max-width: 640px) {
  .dash-hero.stage { padding-top: 46%; background-size: auto 46vw; background-position: 48% top; }
  .dash-hero.stage .dash-hero-text { padding: 14px 16px 16px; }
  .grow-pic { width: 84px; height: 56px; }
}

/* 저장 공간 · 저장소 늘리기 */
.storage-h { display: flex; align-items: baseline; gap: 10px; }
.storage-h b { font-size: 16px; }
.storage-n { margin-left: auto; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.gauge { height: 14px; border-radius: 999px; background: #EFE6DA; overflow: hidden; margin-top: 8px; border: 1px solid #E6D8C6; }
.gauge div { height: 100%; background: #4E8A6A; border-radius: 999px; transition: width .4s; }
.gauge.warn div { background: #D89A3A; }
.gauge.full div { background: #B5462F; }
.storage-f { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.storage-f .hint { flex: 1; min-width: 160px; }
.storage.compact { margin: 10px 0; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.storage.compact .storage-f button { display: none; }
.dlg.buy { max-width: 520px; }
.dlg.buy .notice { margin: 0 0 6px; padding: 10px 12px; background: #FFF6E8; border: 1px solid #EED9B6; border-radius: 10px; color: #6B4A1E; font-size: 14px; line-height: 1.55; }
.grow-note { margin: 8px 0 4px; padding: 10px 12px; border: 1px solid #C9DDD0; background: #F1F7F3; border-radius: 10px; }
.grow-note p { margin: 0 0 6px; }
.grow-note p:first-child { font-weight: 700; color: var(--ok); }
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 8px; }
.plan { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; cursor: pointer; color: var(--ink); }
.plan.on { border-color: var(--accent); background: #FFF4EE; }
.plan-gb { font-size: 20px; font-weight: 800; }
.plan span { font-size: 13px; }
.buy-sum { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.buy-sum b { font-size: 22px; color: var(--accent); }
.pay { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; margin-top: 8px; }
.pay-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 15px; }
.pay-row span { color: var(--sub); }
.pay-amt { font-size: 20px; color: var(--accent); }
.code-box { margin-top: 14px; font-size: 14px; }
.code-box summary { cursor: pointer; color: var(--sub); }
.orders { margin-top: 12px; display: grid; gap: 6px; }
.orders-h { font-size: 14px; }
.orders .it { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 520px) { .plans { grid-template-columns: repeat(2, 1fr); gap: 6px; } .plan-gb { font-size: 17px; } }

/* 살아 있는 창 */
.dash-hero.live { display: block; aspect-ratio: auto; max-height: none; min-height: 0; padding: 0; background: #EFE6DA; }
.dash-hero.live .dash-hero-text { margin: 0; max-width: none; padding: 16px 22px 18px; background: var(--paper); border-top: 1px solid var(--line); }
.scene-wrap { position: relative; width: 100%; aspect-ratio: 30 / 13; background: #EFE6DA center / cover no-repeat; overflow: hidden; }   /* 세로 30% 더 (사용자 지시 2026-10-16) — scene.json view 1420×615 와 같은 비율 */
.scene-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.char-pick { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 8px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; cursor: pointer; color: var(--ink); }
.char-pick img { width: 84px; height: 84px; object-fit: contain; }
.char-pick.on { border-color: var(--accent); background: #FFF4EE; }
.grow-pic { background: #CFE3F2; }
@media (max-width: 640px) { .scene-wrap { aspect-ratio: 20 / 13; } .scene-wrap canvas { width: 150%; left: -12%; } }

/* 내 정원 */
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 10px 0; }
.g-slot { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 6px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: var(--ink); cursor: pointer; text-align: center; }
.g-slot.on { border-color: var(--accent); background: #FFF4EE; }
.g-slot small { color: var(--mute, #8a7a6c); font-size: 11px; line-height: 1.35; min-height: 2.7em; }
.g-img { width: 100%; height: 92px; display: flex; align-items: flex-end; justify-content: center; background: linear-gradient(#EAF3F6, #F5F1E8 72%, #D9E6C4 72%); border-radius: 9px; overflow: hidden; }
.g-img img { max-height: 88px; max-width: 96%; object-fit: contain; }
.g-plus { font-size: 30px; color: #b9a99a; align-self: center; }
.g-soilpatch { align-self: center; font-size: 12px; color: #8a7a6c; }
.g-soil { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.g-pick-h { display: flex; justify-content: space-between; align-items: center; margin: 10px 0 6px; }
.g-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; max-height: 520px; overflow: auto; padding: 2px; }
.g-sp { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: start; padding: 8px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.g-sp.on { border-color: var(--accent); background: #FFF4EE; }
.g-sp .g-img { height: 96px; }
.g-sp p { margin: 4px 0 0; font-size: 12px; line-height: 1.5; color: var(--mute, #7a6b5e); }
.g-now { display: block; font-size: 11.5px; color: var(--accent); margin-top: 2px; }

/* 불러오는 중: 책장이 넘어간다 (누르면 한 장 더) */
.ld { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 36px 0 28px; color: var(--mute, #8a7a6c); }
.dash-hero-text .ld { align-items: flex-start; padding: 6px 0 0; }
.ld-book { position: relative; width: 64px; height: 44px; perspective: 260px; border: 0; background: none; padding: 0; cursor: pointer; }
.ld-cover { position: absolute; top: 2px; width: 32px; height: 40px; background: #B8643F; border-radius: 3px; }
.ld-cover.l { left: 0; border-radius: 4px 1px 1px 4px; }
.ld-cover.r { right: 0; border-radius: 1px 4px 4px 1px; }
.ld-page { position: absolute; top: 4px; left: 32px; width: 29px; height: 36px; background: #FFFBF4; border: 1px solid #E8DCCB; border-radius: 1px 3px 3px 1px; transform-origin: left center; animation: ld-flip 2.4s cubic-bezier(.5,.1,.4,1) infinite; }
.ld-page.p2 { animation-delay: .8s; }
.ld-page.p3 { animation-delay: 1.6s; }
.ld-page.extra { animation: ld-flip .9s cubic-bezier(.5,.1,.4,1) 1 forwards; background: #FFF4E6; }
.ld-book::before { content: ''; position: absolute; top: 4px; left: 3px; width: 29px; height: 36px; background: #FFFBF4; border: 1px solid #E8DCCB; border-radius: 3px 1px 1px 3px; }
.ld-book::after { content: ''; position: absolute; top: 4px; left: 32px; width: 29px; height: 36px; background: #FFFBF4; border: 1px solid #E8DCCB; border-radius: 1px 3px 3px 1px; }
.ld-book > * { z-index: 1; }
.ld-cover { z-index: 0 !important; }
@keyframes ld-flip { 0% { transform: rotateY(0deg); } 45%, 100% { transform: rotateY(-178deg); } }
.ld-line { font-size: 14px; letter-spacing: .02em; }
.ld-line.in { animation: ld-in .5s ease; }
@keyframes ld-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* 자리 표시: 단색 상자가 은은하게 깜박인다 */
.sk { background: #EFE6D9; border-radius: 12px; animation: sk-pulse 1.6s ease-in-out infinite; }
.sk.st { height: 92px; }
.sk.line { height: 16px; margin: 4px 0 12px; }
.sk.w30 { width: 30%; }
.sk.bk { flex: 0 0 104px; height: 150px; }
@keyframes sk-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .ld-page, .sk { animation: none; } }

/* 책을 펴는 동안: 표지를 크게 */
.pdf-wait { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 0; }
.pdf-wait img { max-width: min(420px, 80%); max-height: 70vh; border-radius: 4px; box-shadow: 0 10px 28px rgba(58, 40, 28, .18); }

/* 읽기: PC 프로그램(나의 서재) 읽기 화면과 같게 */
body.reading main.wrap { max-width: none; padding: 0 12px; }
body.reading .reader-bar { top: 54px; padding: 8px 2px; gap: 6px; }
.reader-wrap { display: flex; gap: 12px; align-items: stretch; margin-top: 8px; }
.reader-stage { position: relative; flex: 1 1 auto; min-width: 0; }
.pdfbox { position: relative; height: calc(100vh - 128px); min-height: 320px; overflow: auto; background: #ECE7E0; border: 1px solid var(--line); border-radius: 10px; display: flex; justify-content: center; align-items: flex-start; touch-action: pan-y pinch-zoom; }
.pdfbox.scroll { display: block; }
.pdfbox.ink canvas { filter: contrast(1.45) saturate(1.1); }
.pg-row { display: flex; gap: 4px; justify-content: center; align-items: flex-start; padding: 12px; margin: 0 auto; }
.pg-row canvas, .pg-col canvas { display: block; max-width: none; height: auto; background: #fff; box-shadow: 0 3px 14px rgba(58, 40, 28, .14); }
.pg-col { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0; }
.pg-hold { background: #fff; max-width: 100%; box-shadow: 0 3px 14px rgba(58, 40, 28, .08); }
.pg-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 76px; border: 1px solid rgba(220, 205, 190, .9); border-radius: 14px; background: rgba(255, 252, 247, .78); color: #8B7B6C; font-size: 30px; line-height: 1; cursor: pointer; z-index: 3; }
.pg-arrow:hover { background: #FFF8EF; border-color: #E2A07A; color: #B8643F; }
.pg-arrow.l { left: 10px; }
.pg-arrow.r { right: 10px; }
.pg-arrow[hidden] { display: none; }
.pdf-wait { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 0; margin: auto; }
.pdf-wait img { max-width: min(420px, 80%); max-height: 64vh; border-radius: 4px; box-shadow: 0 10px 28px rgba(58, 40, 28, .18); }
.rside { flex: 0 0 380px; height: calc(100vh - 128px); overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; }
.rside[hidden] { display: none; }
.rside-tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: 2px; padding: 8px 8px 0; background: var(--paper); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rside-tabs button { border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--sub, #8a7a6c); padding: 8px 10px; border-radius: 10px 10px 0 0; cursor: pointer; }
.rside-tabs button.on { background: #F1E8DC; color: var(--ink); }
.rside-tabs .x { margin-left: auto; }
.rside-body { padding: 14px 16px 20px; font-size: 14px; line-height: 1.7; }
.rs-head { display: grid; grid-template-columns: 96px 1fr; gap: 12px; margin-bottom: 10px; }
.rs-head .cover { width: 96px; }
.rs-title { font-size: 15.5px; display: block; margin-bottom: 2px; }
.rs-kdc { display: inline-block; margin-top: 6px; padding: 3px 10px; border-radius: 999px; background: #FBE3D8; color: #B8643F; font-size: 12px; font-weight: 800; }
.rs-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.rs-tags span { padding: 3px 10px; border-radius: 999px; background: #F1E8DC; font-size: 12px; color: #6F5E50; }
.rs-h { font-size: 15px; margin: 14px 0 8px; }
.rs-one { background: #FBF3E8; border-left: 4px solid #B8643F; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
.rs-one small { color: #8a7a6c; font-weight: 700; }
.rs-one p { margin: 4px 0 0; font-weight: 800; font-size: 15px; }
.rs-sec { margin: 14px 0; }
.rs-sec h3 { font-size: 14.5px; margin: 0 0 6px; padding-left: 8px; border-left: 3px solid #B8643F; }
.rs-sec.green h3 { border-color: #5E8F5A; } .rs-sec.navy h3 { border-color: #3E5B86; } .rs-sec.mustard h3 { border-color: #C9962E; } .rs-sec.brick h3 { border-color: #B4452F; }
.rs-sec ol { padding-left: 20px; margin: 0; }
.rs-sec li { margin-bottom: 6px; }
.rs-ch-h { display: flex; gap: 8px; align-items: baseline; }
.rs-ch-h a { font-size: 12px; font-weight: 700; }
.rs-sec dl dt { font-weight: 800; margin-top: 6px; }
.rs-sec dl dd { margin: 0 0 4px; }
.rs-text p { font-size: var(--fs, 16px); line-height: 1.85; margin: 0 0 .9em; word-break: keep-all; }
.rs-rev { padding: 10px 12px; margin-bottom: 8px; }
.rs-rev-t { white-space: pre-wrap; line-height: 1.6; }
.rside textarea { width: 100%; box-sizing: border-box; }
@media (max-width: 1099px) { .rside { flex-basis: 320px; } }
@media (max-width: 759px) {
  body.reading main.wrap { padding: 0 6px; }
  .pdfbox { height: calc(100vh - 170px); }
  .pg-arrow { width: 38px; height: 60px; font-size: 24px; background: rgba(255, 252, 247, .6); }
  .rside { position: fixed; left: 6px; right: 6px; bottom: 8px; top: auto; height: 64vh; z-index: 30; box-shadow: 0 -6px 26px rgba(40, 28, 20, .22); }
}
body.immersive .rside, body.immersive .pg-arrow { display: none; }
body.immersive .pdfbox { height: 100vh; border: 0; border-radius: 0; background: #2b2521; }
@media (max-width: 759px) {
  .reader-bar .rb-wide { display: none; }
  body.reading .reader-bar { gap: 5px; padding: 6px 0; }
  .reader-bar .ttl { flex-basis: 100px; font-size: 13.5px; }
  .reader-bar input { width: 54px; }
}

/* 설정 */
.set-nav { position: sticky; top: 54px; z-index: 4; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; margin-bottom: 4px; background: rgba(246, 239, 229, .96); scrollbar-width: none; }
.set-nav::-webkit-scrollbar { display: none; }
.set-nav a { flex: 0 0 auto; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font-size: 13.5px; font-weight: 700; text-decoration: none; }
.set-nav a:hover { border-color: #E2A07A; color: #B8643F; }
.set-sec { scroll-margin-top: 110px; }
.sec .hint { margin-left: auto; }
.topbar .brand .brand-ver { margin-left: 6px; font-size: 11.5px; font-weight: 600; color: var(--sub, #8a7a6c); }
@media (max-width: 420px) { .topbar .brand .brand-ver { display: none; } }
.pc-steps { margin: 10px 0 4px; padding-left: 20px; line-height: 1.8; }

/* 설정: 왼쪽 메뉴 · 오른쪽에 고른 칸 하나 */
.set-wrap { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 6px; }
.set-side { position: sticky; top: 70px; display: flex; flex-direction: column; gap: 2px; padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.set-side a { padding: 10px 12px; border-radius: 10px; color: var(--ink); font-size: 14.5px; font-weight: 700; text-decoration: none; }
.set-side a:hover { background: #F6EEE3; }
.set-side a.on { background: #F1E8DC; color: #B8643F; }
.set-pane > .card, .set-pane > .panel, .set-pane > div > .card:first-child { margin-top: 0 !important; }
.plan-list { display: grid; gap: 6px; margin-top: 4px; }
.plan-row { display: grid; grid-template-columns: 90px 1fr 1fr; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 14px; }
@media (max-width: 759px) {
  .set-wrap { grid-template-columns: 1fr; gap: 10px; }
  .set-side { top: 54px; z-index: 4; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 6px; border-radius: 12px; }
  .set-side::-webkit-scrollbar { display: none; }
  .set-side a { flex: 0 0 auto; padding: 8px 12px; font-size: 13.5px; }
}

/* 읽기: 메모 */
.rs-notes { display: grid; gap: 10px; }
.rs-note { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.rs-note.on { border-color: #E2A07A; box-shadow: 0 0 0 3px rgba(226, 160, 122, .18); }
.rs-note .row { gap: 8px; align-items: center; margin-bottom: 6px; }
.rs-note-p { font-weight: 800; font-size: 13px; color: #B8643F; }
.rs-note-q { margin: 0 0 6px; padding: 6px 10px; border-left: 3px solid #E9C46A; background: #FFF8E6; font-size: 13px; color: #6F5E50; }
.rs-note textarea { width: 100%; box-sizing: border-box; font-size: 14px; line-height: 1.6; }
.rs-tags.tt small { color: #8a7a6c; font-weight: 700; margin-right: 2px; align-self: center; }

/* 정원 물: 실제 비 · 물 게이지 */
.water.dry { background: #FBF1DE; border-color: #EBD3A8; }
.water.wet { background: #EAF3F8; }
.wg { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.wg-l { font-size: 13px; font-weight: 700; color: #4F6F86; }
.wg-bar { flex: 1 1 160px; height: 10px; border-radius: 999px; background: rgba(79, 111, 134, .15); overflow: hidden; }
.wg-bar > div { height: 100%; border-radius: 999px; background: #5B8DB0; transition: width .6s ease; }
.wg-n { font-size: 13px; color: #4F6F86; min-width: 64px; text-align: right; }
.wg-how { margin: 8px 0 0; font-size: 12.5px; }
.water[data-water] { display: block; padding: 12px 14px; }
.water[data-water] .water-t { min-width: 0; }
.water.dry .water-t b { color: #8A5A1E; }

/* 읽기 전 요약 문서 — 프로그램(나의 서재) sumdoc.css 와 같게 */
/* 읽기 전 요약 문서 — 앱(오른쪽 패널·크게 보기)과 PDF 저장에 함께 쓰는 스타일.
   섹션마다 앱 아이콘의 책 색(나무·초록·남색·겨자·벽돌)을 하나씩 준다. 플랫 색, 그라데이션·이모지 없음. */
.sumdoc {
  --sd-ink: #2b2620; --sd-sub: #5f574c; --sd-dim: #9a9083; --sd-line: #e8e1d4; --sd-paper: #ffffff;
  --sd-wood: #8a5a2b;    --sd-wood-bg: #f8f0e3;
  --sd-green: #3e7b50;   --sd-green-bg: #ecf5ef;
  --sd-navy: #2e4a6e;    --sd-navy-bg: #eaf0f7;
  --sd-mustard: #a96f12; --sd-mustard-bg: #fcf4e3;
  --sd-brick: #b5462f;   --sd-brick-bg: #faece8;
  --sd-mark: #fbe2a2;
  color: var(--sd-ink); font-size: 13.5px; line-height: 1.75;
  word-break: keep-all; overflow-wrap: anywhere;
}
.sumdoc * { box-sizing: border-box; }
.sumdoc p { margin: 0 0 .65em; }
.sumdoc p:last-child { margin-bottom: 0; }

/* 핵심 용어 형광펜, AI 가 굵게 표시한 구절 */
.sumdoc mark.kw { background: none; color: inherit; box-shadow: inset 0 -.42em 0 var(--sd-mark); padding: 0 1px; border-radius: 1px; }
.sumdoc strong.em { font-weight: 700; color: var(--sd-ink); box-shadow: inset 0 -.42em 0 var(--sd-mark); }

/* 바로가기 칩 */
.sd-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.sd-nav button { font: inherit; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--sd-line); background: var(--sd-paper); color: var(--sd-sub); cursor: pointer; }
.sd-nav button:hover { border-color: currentColor; }
.sd-nav button i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* 한 줄 요약 */
.sd-oneline { background: var(--sd-wood-bg); border-left: 5px solid var(--sd-wood); border-radius: 4px 10px 10px 4px; padding: 14px 16px 15px; margin-bottom: 24px; break-inside: avoid; }
.sd-oneline .sd-label { font-size: 11.5px; font-weight: 800; color: var(--sd-wood); letter-spacing: .4px; margin-bottom: 4px; }
.sd-oneline p { font-size: 15.5px; font-weight: 700; line-height: 1.6; color: var(--sd-ink); }

/* 섹션 */
.sd-sec { margin-bottom: 26px; }
.sd-h { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 800; margin: 0 0 12px; padding-bottom: 7px; border-bottom: 1px solid var(--sd-line); letter-spacing: -.2px; break-after: avoid; }
.sd-h i { width: 5px; height: 17px; border-radius: 2px; background: var(--c); flex: none; }
.sd-h .cnt { margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--c); background: var(--cbg); padding: 1px 8px; border-radius: 999px; }
.sd-sec[data-c="wood"]    { --c: var(--sd-wood);    --cbg: var(--sd-wood-bg); }
.sd-sec[data-c="green"]   { --c: var(--sd-green);   --cbg: var(--sd-green-bg); }
.sd-sec[data-c="navy"]    { --c: var(--sd-navy);    --cbg: var(--sd-navy-bg); }
.sd-sec[data-c="mustard"] { --c: var(--sd-mustard); --cbg: var(--sd-mustard-bg); }
.sd-sec[data-c="brick"]   { --c: var(--sd-brick);   --cbg: var(--sd-brick-bg); }

/* 개요 */
.sd-lead { font-size: 14.5px; font-weight: 600; color: var(--sd-ink); line-height: 1.7; }
.sd-body { color: var(--sd-sub); }

/* 핵심 논점 */
.sd-points { list-style: none; margin: 0; padding: 0; counter-reset: p; }
.sd-points li { display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px dashed var(--sd-line); break-inside: avoid; }
.sd-points li:last-child { border-bottom: 0; }
.sd-points .n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; margin-top: 1px; font-variant-numeric: tabular-nums; }
.sd-points .t b { color: var(--sd-ink); }

/* 장별 요약 — 세로 줄로 잇는 흐름 */
.sd-chapters { list-style: none; margin: 0; padding: 0; position: relative; }
.sd-chapters li { position: relative; padding: 0 0 16px 38px; break-inside: avoid; }
.sd-chapters li::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--cbg); }
.sd-chapters li:last-child::before { display: none; }
.sd-chapters .n { position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 8px; background: var(--c); color: #fff;
  font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.sd-ch-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; min-height: 28px; padding-top: 3px; }
.sd-ch-head b { font-size: 14px; color: var(--c); font-weight: 800; line-height: 1.4; }
.sd-ch-head .pg { margin-left: auto; flex: none; font-size: 11.5px; font-weight: 700; color: var(--c); background: var(--cbg); padding: 1px 8px; border-radius: 999px; text-decoration: none; cursor: pointer; }
.sd-ch-head .pg:hover { background: var(--c); color: #fff; }
.sd-chapters .first { color: var(--sd-ink); font-weight: 600; }
.sd-chapters .rest { color: var(--sd-sub); }

/* 핵심 개념 — 용어집 */
.sd-concepts { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 0; }
.sd-concepts > div { background: var(--cbg); border-radius: 10px; padding: 10px 13px; break-inside: avoid; }
.sd-concepts dt { font-weight: 800; color: var(--c); font-size: 13.5px; margin-bottom: 2px; }
.sd-concepts dd { margin: 0; color: var(--sd-ink); font-size: 13px; line-height: 1.65; }

/* 누구에게 / 비판 */
.sd-callouts { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 26px; }
.sd-callout { border-radius: 10px; padding: 12px 15px; border: 1px solid; break-inside: avoid; }
.sd-callout h3 { font-size: 13px; font-weight: 800; margin: 0 0 5px; }
.sd-callout.green { background: var(--sd-green-bg); border-color: #cfe3d5; } .sd-callout.green h3 { color: var(--sd-green); }
.sd-callout.brick { background: var(--sd-brick-bg); border-color: #efd3cb; } .sd-callout.brick h3 { color: var(--sd-brick); }

/* 질문 */
.sd-questions { list-style: none; margin: 0; padding: 0; }
.sd-questions li { display: flex; gap: 10px; align-items: flex-start; background: var(--cbg); border-radius: 10px; padding: 10px 13px; margin-bottom: 8px; break-inside: avoid; }
.sd-questions .q { flex: none; font-size: 11.5px; font-weight: 800; color: #fff; background: var(--c); border-radius: 6px; padding: 1px 7px; margin-top: 2px; }

/* 태그 */
.sd-tags span { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--sd-line); color: var(--sd-sub); margin: 0 6px 6px 0; background: var(--sd-paper); }
.sd-foot { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--sd-line); font-size: 11.5px; color: var(--sd-dim); display: flex; justify-content: space-between; gap: 10px; }

.rside .sumdoc { font-size: 13.5px; }

/* 종이책처럼 넘기기 — 프로그램(나의 서재)과 같게 */
.flip-stage { position: fixed; pointer-events: none; z-index: 40; perspective: 2600px; perspective-origin: 50% 50%; }
.flip-stage .flip-under { position: absolute; top: 0; height: 100%; overflow: hidden; background: #fff; }
.flip-stage .flip-under canvas, .flip-stage .flip-face canvas { position: absolute; left: 0; top: 0; width: 100% !important; height: 100% !important; box-shadow: none !important; }
.flip-stage .flip-leaf { position: absolute; top: 0; height: 100%; transform-style: preserve-3d; will-change: transform; }
.flip-stage .flip-face { position: absolute; inset: 0; overflow: hidden; background: #f7f4ee; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-stage .flip-face.back { transform: rotateY(180deg); }
.flip-stage .flip-shade { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.flip-stage .flip-leaf.next .flip-shade { background: linear-gradient(to right, rgba(0,0,0,.42), rgba(0,0,0,.08) 40%, rgba(0,0,0,0) 70%); }
.flip-stage .flip-leaf.prev .flip-shade { background: linear-gradient(to left, rgba(0,0,0,.42), rgba(0,0,0,.08) 40%, rgba(0,0,0,0) 70%); }
.flip-stage .flip-ground { position: absolute; top: 0; height: 100%; pointer-events: none; opacity: 0; }
.flip-stage .flip-ground.next { background: linear-gradient(to right, rgba(0,0,0,.28), rgba(0,0,0,0) 55%); }
.flip-stage .flip-ground.prev { background: linear-gradient(to left, rgba(0,0,0,.28), rgba(0,0,0,0) 55%); }
.pg-row.turn-next canvas { animation: turn-next .22s ease-out; }
.pg-row.turn-prev canvas { animation: turn-prev .22s ease-out; }
@keyframes turn-next { from { opacity: .3; transform: translateX(32px); } to { opacity: 1; transform: none; } }
@keyframes turn-prev { from { opacity: .3; transform: translateX(-32px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pg-row.turn-next canvas, .pg-row.turn-prev canvas { animation: none; } }

/* 정원 가꾸기 (3D) */
.scene-wrap.can-garden { cursor: pointer; }
body.g3d-open { overflow: hidden; }
.g3d { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; background: #F6EFE5; }
.g3d-top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--paper); }
.g3d-top b { font-size: 16px; }
.g3d-sub { font-size: 13px; color: var(--sub, #8a7a6c); }
.g3d-msg { font-size: 13px; font-weight: 700; }
.g3d-msg.ok { color: #3e7b50; } .g3d-msg.bad { color: #b5462f; }
.g3d-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 320px; min-height: 0; }
.g3d-stage { position: relative; min-height: 0; background: #cfe0ea; }
.g3d-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.g3d-load { position: absolute; inset: 0; display: grid; place-items: center; color: #4F6F86; font-weight: 700; }
.g3d-wx { position: absolute; left: 12px; top: 12px; padding: 5px 11px; border-radius: 999px; background: rgba(255, 252, 247, .86); font-size: 12.5px; font-weight: 700; color: #4A3B31; }
.g3d-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: rgba(40, 30, 22, .55); color: #fff; font-size: 12.5px; white-space: nowrap; pointer-events: none; }
.g3d-side { border-left: 1px solid var(--line); background: var(--paper); display: flex; flex-direction: column; min-height: 0; }
.g3d-tabs { display: flex; gap: 4px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); }
.g3d-tabs button { border: 0; background: none; font: inherit; font-weight: 700; font-size: 14px; color: var(--sub, #8a7a6c); padding: 9px 12px; border-radius: 10px 10px 0 0; cursor: pointer; }
.g3d-tabs button.on { background: #F1E8DC; color: var(--ink); }
.g3d-pane { flex: 1; overflow: auto; padding: 12px; }
.g3d-plant { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.g3d-plant.on { border-color: #E2A07A; box-shadow: 0 0 0 3px rgba(226, 160, 122, .2); }
.g3d-plant img { width: 46px; height: 56px; object-fit: contain; flex: none; }
.g3d-plant b { display: block; font-size: 14px; }
.g3d-plant small { display: block; font-size: 12px; color: var(--sub, #8a7a6c); line-height: 1.45; }
.g3d-lays { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.g3d-lay { display: flex; flex-direction: column; gap: 3px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.g3d-lay img { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 8px; background: #DCE8EF; }
.g3d-lay b { font-size: 13.5px; }
.g3d-lay small { font-size: 11.5px; color: var(--sub, #8a7a6c); line-height: 1.4; }
.g3d-lay.on { border-color: #E2A07A; box-shadow: 0 0 0 3px rgba(226, 160, 122, .2); }
.g3d-lay.locked img { filter: grayscale(.85) brightness(.9); }
.g3d-lay.locked b::after { content: ' · 잠김'; color: #b5462f; font-size: 12px; }
.g3d-note { margin: 0 0 10px; padding: 8px 11px; border-radius: 10px; background: #FBF1DE; color: #8A5A1E; font-size: 13px; font-weight: 700; }
@media (max-width: 759px) {
  .g3d-body { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 42%; }
  .g3d-side { border-left: 0; border-top: 1px solid var(--line); }
  .g3d-hint { font-size: 11.5px; bottom: 8px; }
}

/* 내려받기: 모두·골라서 · 진행 */
.dl-head { align-items: center; gap: 8px; margin: 4px 0 10px; flex-wrap: wrap; }
.dl-head .hint { margin: 0; }
.dl-bar { display: flex; gap: 6px; flex-wrap: wrap; }
.bk { position: relative; }
.bk .pick-mark { display: none; position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: rgba(40, 30, 22, .35); box-shadow: 0 1px 4px rgba(0, 0, 0, .25); z-index: 2; }
.grid.picking .bk { cursor: pointer; }
.grid.picking .bk .pick-mark { display: block; }
.grid.picking .bk.picked .pick-mark { background: #B8643F; border-color: #fff; }
.grid.picking .bk.picked .pick-mark::after { content: ''; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.grid.picking .bk.picked .cover { outline: 3px solid #E2A07A; outline-offset: 2px; }
.dl-toast { position: fixed; right: 16px; bottom: 92px; z-index: 70; width: min(380px, calc(100vw - 32px)); padding: 12px 14px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(40, 28, 20, .18); }
.dl-line { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 8px; }
.dl-sub { font-size: 12px; }

/* 설정 › 저장 공간: 저장소 기간 */
.st-exp { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.st-exp-h { display: block; font-size: 14px; margin-bottom: 6px; }
.st-exp-l { list-style: none; margin: 0; padding: 0; }
.st-exp-l li { display: flex; gap: 10px; align-items: baseline; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.st-exp-l li:last-child { border-bottom: 0; }
.st-exp-l li b { font-size: 13px; color: #3E7B50; }
.st-exp-l li.soon b { color: #A96F12; }

/* 매월 자동 결제 (2026-10-16) */
.dlg.buy .auto-pay { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; padding: 12px 14px; border: 1px solid var(--line, #e6d9c8); border-radius: 12px; background: var(--card, #fffaf3); line-height: 1.55; cursor: pointer; }
.dlg.buy p.auto-pay { cursor: default; }
.dlg.buy .auto-pay input { width: 18px; height: 18px; margin-top: 2px; accent-color: #B8643F; flex: none; }
.dlg.buy .auto-pay .hint { display: inline; }
.st-sub:not(:empty) { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line, #e6d9c8); }
.st-sub-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 14px; }

/* 포트원(KG이니시스) 결제: 휴대폰 번호 칸 (2026-10-16) */
.dlg .fld span.hint { font-weight: 400; font-size: 13px; margin: 4px 0 0; }
.dlg .pay-phone { margin-top: 12px; }
