/* ══════════════════════════════════════════════════════════
   책방 공통 틀 — 서점·강의·프로그램·배지가 함께 쓴다

   메뉴마다 따로 짠 화면이 저마다 다른 말과 모양을 썼다. 어떤 곳은 코인 거래소,
   어떤 곳은 관리자 표, 어떤 곳은 주황 버튼이었다. 독서토론·첫 화면에서 다듬은
   모양을 여기 모아, 어느 메뉴에 들어가도 같은 책방으로 느껴지게 한다.

   메뉴마다 다른 것은 강조색 하나뿐이다 — body 에 u-shop / u-edu / u-prog / u-badge.
   틀(머리, 고르기 줄, 카드, 빈 칸, 쓰는 칸, 단추)과 말투는 같다.
   ══════════════════════════════════════════════════════════ */

:root {
    --u-accent: #34d399; --u-accent-rgb: 52,211,153; --u-accent-ink: #04261a;
    --u-sky: #7dd3fc; --u-kids: #fcd34d; --u-grown: #a5b4fc; --u-pink: #f9a8d4; --u-rose: #fca5a5;
}
body.u-shop  { --u-accent: #34d399; --u-accent-rgb: 52,211,153;  --u-accent-ink: #04261a; }
body.u-edu   { --u-accent: #a5b4fc; --u-accent-rgb: 165,180,252; --u-accent-ink: #141a3d; }
body.u-prog  { --u-accent: #fcd34d; --u-accent-rgb: 252,211,77;  --u-accent-ink: #2e2305; }
body.u-badge { --u-accent: #f9a8d4; --u-accent-rgb: 249,168,212; --u-accent-ink: #3a0f24; }
body.u-grown { --u-accent: #a5b4fc; --u-accent-rgb: 165,180,252; --u-accent-ink: #141a3d; }
body.u-club  { --u-accent: #7dd3fc; --u-accent-rgb: 125,211,252; --u-accent-ink: #06222e; }   /* 독서토론 — bookclub.css 의 하늘색 */
body.u-me    { --u-accent: #34d399; --u-accent-rgb: 52,211,153;  --u-accent-ink: #04261a; }   /* 내 책방·포인트 */

/* ── 머리 ──────────────────────────────────────────────── */
.u-hero {
    padding: 84px 0 0;
    background:
        radial-gradient(55% 60% at 88% 8%, rgba(var(--u-accent-rgb), .15), transparent 70%),
        radial-gradient(45% 50% at 8% 0%, rgba(125,211,252,.07), transparent 70%),
        var(--hbc-dark);
    border-bottom: 1px solid var(--hbc-border);
}
.u-hero-in { display: flex; align-items: center; gap: 1rem; padding-bottom: 1rem; }
.u-hero-art { width: 92px; flex: 0 0 auto; }
.u-hero-tx { min-width: 0; flex: 1; }
/* 머리말 딱지. 쓰는 칸의 이름표도 .u-label 이라, 머리 안으로 좁혀야 뒤의 규칙에 덮이지 않는다 */
.u-hero .u-label {
    display: inline-flex; align-items: center; gap: .3rem; margin: 0;
    font-size: .74rem; font-weight: 700; color: var(--u-accent);
}
.u-hero h1 {
    color: #fff; font-weight: 900; letter-spacing: -.03em; margin: .25rem 0 0;
    font-size: clamp(1.4rem, 6.2vw, 2.3rem); line-height: 1.25; word-break: keep-all;
}
.u-hero h1 em { font-style: normal; color: var(--u-accent); }
.u-hero p {
    color: var(--hbc-muted); margin: .55rem 0 0; max-width: 38rem;
    font-size: clamp(.86rem, 3.5vw, 1rem); line-height: 1.75; word-break: keep-all;
}
.u-hero p b { color: var(--hbc-text); }
.u-hero-foot { padding-bottom: 1rem; }

.u-back {
    display: inline-flex; align-items: center; gap: .25rem; min-height: 44px;
    color: var(--hbc-muted); font-size: .84rem; text-decoration: none;
}
.u-back:hover { color: #fff; }

/* ── 찾기 ──────────────────────────────────────────────── */
.u-search { display: flex; gap: .4rem; }
.u-search .u-input { flex: 1; min-width: 0; border-radius: 999px; padding-left: 2.6rem;
                     background: rgba(255,255,255,.06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2398c4ac' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.868-3.834zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z'/%3E%3C/svg%3E") no-repeat 1rem 50%; }
.u-search .u-btn { width: auto; padding: 0 1.2rem; border-radius: 999px; min-height: 46px; }

/* ── 고르기 줄 — 휴대폰에서는 옆으로 넘긴다 ──────────────── */
.u-chips {
    display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: none;
    margin: 0 -16px; padding: 0 16px 1rem;
}
.u-chips::-webkit-scrollbar { display: none; }
.u-chips > a, .u-chips > button {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: .35rem;
    min-height: 44px; padding: 0 1rem; border-radius: 999px; text-decoration: none; cursor: pointer;
    background: rgba(255,255,255,.04); border: 1px solid var(--hbc-border);
    color: var(--hbc-muted); font-size: .86rem; font-weight: 600; white-space: nowrap;
}
.u-chips > a small, .u-chips > button small { font-size: .74rem; opacity: .7; font-weight: 500; }
.u-chips > .active {
    background: rgba(var(--u-accent-rgb), .14); border-color: rgba(var(--u-accent-rgb), .5); color: #fff;
}
.u-chips > .active i { color: var(--u-accent); }

/* 한 화면 안의 구역 — 위에 붙어 따라온다(부모가 body 여야 끝까지 붙는다) */
.u-tabs-bar {
    position: sticky; top: 58px; z-index: 30;
    background: rgba(10,26,20,.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--hbc-border);
}
.u-tabs { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: .5rem 12px; }
.u-tabs::-webkit-scrollbar { display: none; }
.u-tabs a {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: .3rem; min-height: 40px; padding: 0 .85rem;
    border-radius: 999px; text-decoration: none; white-space: nowrap;
    color: var(--hbc-muted); font-size: .84rem; font-weight: 600;
}
.u-tabs a:hover { color: #fff; }
.u-tabs a.active { background: rgba(var(--u-accent-rgb), .16); color: #fff; box-shadow: inset 0 0 0 1px rgba(var(--u-accent-rgb), .45); }
.u-tabs a.active i { color: var(--u-accent); }

/* ── 본문 ──────────────────────────────────────────────── */
.u-main { padding: 1.2rem 0 2.2rem; }
.u-sec { margin-top: 1.8rem; }
.u-sec:first-child { margin-top: 0; }
.u-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: .8rem; margin-bottom: .8rem; }
.u-sec-head h2 { color: #fff; font-size: 1.12rem; font-weight: 800; margin: 0; word-break: keep-all; }
.u-sec-head p { color: var(--hbc-muted); font-size: .8rem; margin: .2rem 0 0; word-break: keep-all; }
.u-sec-head > a { flex: 0 0 auto; color: var(--u-accent); text-decoration: none; font-size: .82rem; font-weight: 700; white-space: nowrap; }
.u-meta-line { display: flex; align-items: center; justify-content: space-between; gap: .6rem;
               font-size: .82rem; color: var(--hbc-muted); margin-bottom: .8rem; }
.u-meta-line b { color: var(--hbc-text); }

.u-card {
    padding: .95rem 1rem; border-radius: 16px; margin-bottom: .7rem;
    background: var(--hbc-dark-2); border: 1px solid var(--hbc-border);
}
.u-card.is-accent { border-color: rgba(var(--u-accent-rgb), .38);
                    background: linear-gradient(165deg, rgba(var(--u-accent-rgb), .10), rgba(var(--u-accent-rgb), .02)); }
.u-card.is-warn { border-color: rgba(252,211,77,.35); background: rgba(252,211,77,.06); }
.u-card-title { display: flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 800;
                color: var(--hbc-muted); margin-bottom: .6rem; }
.u-card-title i { color: var(--u-accent); }
.u-card-title a { margin-left: auto; color: var(--u-accent); font-weight: 700; text-decoration: none; }
.u-text { color: var(--hbc-text); font-size: .92rem; line-height: 1.85; white-space: pre-line; word-break: keep-all; margin: 0; }
.u-muted { color: var(--hbc-muted); font-size: .8rem; line-height: 1.7; word-break: keep-all; }
.u-muted b { color: var(--hbc-text); }

.u-empty {
    text-align: center; padding: 2rem 1rem; border-radius: 16px;
    border: 1px dashed var(--hbc-border); color: var(--hbc-muted); font-size: .88rem; line-height: 1.7;
}
.u-empty img { width: 84px; display: block; margin: 0 auto .6rem; }
.u-empty b { display: block; color: #fff; font-size: 1rem; margin-bottom: .15rem; }
.u-empty a:not(.u-btn) { color: var(--u-accent); font-weight: 700; text-decoration: none; }
.u-empty .u-btn { width: auto; margin-top: .9rem; padding: 0 1.3rem; }

/* 작은 딱지 */
.u-tag {
    display: inline-flex; align-items: center; gap: .25rem; white-space: nowrap;
    padding: .12rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 800;
    background: rgba(255,255,255,.07); color: var(--hbc-muted);
}
.u-tag.is-accent { background: rgba(var(--u-accent-rgb), .15); color: var(--u-accent); }
.u-tag.is-sky    { background: rgba(125,211,252,.15); color: var(--u-sky); }
.u-tag.is-kids   { background: rgba(252,211,77,.15);  color: var(--u-kids); }
.u-tag.is-grown  { background: rgba(165,180,252,.16); color: var(--u-grown); }
.u-tag.is-green  { background: rgba(52,211,153,.15);  color: #6ee7b7; }
.u-tag.is-pink   { background: rgba(249,168,212,.15); color: var(--u-pink); }
.u-tag.is-rose   { background: rgba(248,113,113,.15); color: var(--u-rose); }
.u-tag.is-solid  { background: var(--u-accent); color: var(--u-accent-ink); }

/* ── 표지 — 책·강의·프로그램의 얼굴 ─────────────────────── */
.u-cover {
    position: relative; overflow: hidden; border-radius: 6px 12px 12px 6px;
    aspect-ratio: 3 / 4; background: var(--hbc-dark-3);
    box-shadow: 0 8px 18px rgba(0,0,0,.35), inset 3px 0 0 rgba(0,0,0,.18);
}
.u-cover.is-wide { aspect-ratio: 16 / 10; border-radius: 14px; box-shadow: 0 8px 18px rgba(0,0,0,.3); }
.u-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 사진이 없으면 이름으로 표지를 그린다 — 저마다 색이 다르다 */
.u-cover-fake {
    width: 100%; height: 100%; padding: .7rem .6rem .6rem .8rem;
    display: flex; flex-direction: column; justify-content: space-between; color: #fff;
    background:
        radial-gradient(80% 60% at 70% 20%, hsla(var(--h), 90%, 75%, .55), transparent 70%),
        linear-gradient(160deg, hsl(var(--h), 55%, 42%), hsl(calc(var(--h) + 40), 50%, 26%));
}
.u-cover-fake b {
    font-size: .86rem; line-height: 1.3; font-weight: 800; word-break: keep-all;
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
    text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.u-cover-fake i { font-size: 1.3rem; opacity: .75; align-self: flex-end; }
.u-cover .u-ribbon {
    position: absolute; left: .45rem; top: .45rem; z-index: 1;
    padding: .1rem .45rem; border-radius: 999px; font-size: .66rem; font-weight: 800;
    background: rgba(0,0,0,.6); color: #fff; backdrop-filter: blur(4px);
}
.u-cover .u-ribbon.is-accent { background: var(--u-accent); color: var(--u-accent-ink); }
.u-cover .u-ribbon.is-end { left: auto; right: .45rem; }

/* 표지 격자 — 휴대폰 둘, 점점 늘어난다 */
.u-shelf { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem .8rem; }
.u-item { display: block; text-decoration: none; min-width: 0; }
.u-item .ti {
    color: #fff; font-size: .9rem; font-weight: 700; margin-top: .55rem; line-height: 1.35; word-break: keep-all;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.u-item .sub { color: var(--hbc-muted); font-size: .76rem; margin-top: .15rem;
               overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-item .foot { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin-top: .35rem; font-size: .78rem; }
.u-price { color: var(--u-accent); font-weight: 800; white-space: nowrap; }
.u-price.is-free { color: #6ee7b7; }
.u-star { color: var(--hbc-muted); white-space: nowrap; }
.u-star i { color: var(--u-kids); }
.u-item:hover .ti { color: var(--u-accent); }

/* 가로 표지 카드 격자 — 강의·프로그램. 휴대폰 하나, 점점 늘어난다 */
.u-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: .8rem; }
.u-tile {
    display: flex; flex-direction: column; text-decoration: none; min-width: 0; overflow: hidden;
    border-radius: 18px; background: var(--hbc-dark-2); border: 1px solid var(--hbc-border);
    transition: border-color .15s, transform .15s;
}
.u-tile:hover { border-color: rgba(var(--u-accent-rgb), .4); transform: translateY(-2px); }
.u-tile .u-cover { border-radius: 0; box-shadow: none; aspect-ratio: 16 / 9; }
.u-tile .body { padding: .85rem .95rem 1rem; display: flex; flex-direction: column; flex: 1; }
.u-tile .tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.u-tile .ti { color: #fff; font-size: 1rem; font-weight: 800; line-height: 1.4; margin-top: .45rem; word-break: keep-all;
              display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.u-tile .sub { color: var(--hbc-muted); font-size: .8rem; margin-top: .2rem; }
.u-tile .facts { display: flex; flex-wrap: wrap; gap: .2rem .75rem; margin-top: .5rem; font-size: .76rem; color: var(--hbc-muted); }
.u-tile .facts i { margin-right: .2rem; color: var(--u-accent); }
.u-tile .foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem;
                margin-top: auto; padding-top: .75rem; font-size: .84rem; }
.u-tile .go { color: var(--u-accent); font-weight: 700; font-size: .8rem; }

/* 정사각 그림 카드 — 배지 */
.u-pic {
    position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(70% 70% at 50% 40%, rgba(var(--u-accent-rgb), .16), rgba(255,255,255,.02) 75%);
    border: 1px solid var(--hbc-border);
}
.u-pic img { width: 74%; height: 74%; object-fit: contain; filter: drop-shadow(0 8px 16px rgba(0,0,0,.45)); }
.u-pic > i { font-size: 3rem; color: var(--u-accent); opacity: .8; }
.u-pic .u-ribbon { position: absolute; left: .45rem; top: .45rem; padding: .1rem .45rem; border-radius: 999px;
                   font-size: .66rem; font-weight: 800; background: rgba(0,0,0,.55); color: #fff; }
.u-pic.is-sm { width: 56px; flex: 0 0 auto; border-radius: 12px; }
.u-pic.is-sm img { width: 80%; height: 80%; }
.u-pic.is-sm > i { font-size: 1.5rem; }
.u-card-in { display: flex; flex-direction: column; min-width: 0; }
.u-card-in .u-pic { margin-bottom: .55rem; }
.u-card-in .ti { color: #fff; font-size: .92rem; font-weight: 700; line-height: 1.35; word-break: keep-all;
                 display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.u-card-in .tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-bottom: .35rem; }
.u-card-in .sub { color: var(--hbc-muted); font-size: .76rem; margin-top: .2rem; line-height: 1.5; word-break: keep-all; }
.u-card-in .num { color: var(--hbc-muted); font-size: .64rem; font-family: ui-monospace, monospace; margin-top: .15rem; word-break: break-all; }
.u-card-in .acts { display: grid; gap: .35rem; margin-top: .6rem; }
.u-card-in .acts .u-btn { width: 100%; }

/* 한 줄 카드 — 작은 표지 + 글 + 오른쪽 끝 */
.u-row {
    display: flex; gap: .85rem; align-items: flex-start; text-decoration: none;
    padding: .85rem .9rem; border-radius: 16px; margin-bottom: .6rem;
    background: var(--hbc-dark-2); border: 1px solid var(--hbc-border); transition: border-color .15s;
}
a.u-row:hover { border-color: rgba(var(--u-accent-rgb), .35); }
.u-row .u-cover { flex: 0 0 auto; width: 64px; }
.u-row .u-cover.is-wide { width: 96px; }
.u-row .u-cover-fake { padding: .4rem .35rem .35rem .5rem; }
.u-row .u-cover-fake b { font-size: .62rem; }
.u-row .u-cover-fake i { font-size: .9rem; }
.u-row .main { flex: 1; min-width: 0; }
.u-row .ti { color: #fff; font-size: .95rem; font-weight: 700; line-height: 1.4; word-break: keep-all;
             display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.u-row .sub { color: var(--hbc-muted); font-size: .78rem; margin-top: .15rem; word-break: keep-all; }
.u-row .facts { display: flex; flex-wrap: wrap; gap: .2rem .7rem; margin-top: .4rem; font-size: .76rem; color: var(--hbc-muted); }
.u-row .facts i { margin-right: .2rem; color: var(--u-accent); }
.u-row .tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .35rem; }
.u-row .acts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }
.u-row > .bi-chevron-right { color: var(--hbc-muted); align-self: center; }

/* 숫자 몇 개 */
.u-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.u-stats > * {
    padding: .7rem .75rem; border-radius: 14px; text-decoration: none;
    background: var(--hbc-dark-2); border: 1px solid var(--hbc-border);
}
.u-stats small { display: block; font-size: .72rem; color: var(--hbc-muted); }
.u-stats b { display: block; color: #fff; font-size: 1.25rem; font-weight: 900; margin-top: .1rem; line-height: 1.2; }
.u-stats b span { font-size: .78rem; color: var(--hbc-muted); font-weight: 600; margin-left: .1rem; }

/* 이름 — 값 */
.u-kv div { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0;
            border-bottom: 1px solid var(--hbc-border); font-size: .86rem; }
.u-kv div:last-child { border-bottom: none; }
.u-kv span { color: var(--hbc-muted); flex: 0 0 auto; }
.u-kv b { color: var(--hbc-text); font-weight: 600; text-align: right; word-break: keep-all; }

/* 진행 막대 */
.u-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.u-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--u-accent), #7dd3fc); }

/* ── 단추 ──────────────────────────────────────────────── */
.u-btn {
    width: 100%; min-height: 50px; padding: 0 1.1rem; border-radius: 14px; border: none; cursor: pointer;
    background: var(--u-accent); color: var(--u-accent-ink); font-weight: 800; font-size: .95rem;
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem; text-decoration: none;
    transition: filter .15s;
}
.u-btn:hover { filter: brightness(1.06); color: var(--u-accent-ink); }
.u-btn:disabled, .u-btn.is-disabled { opacity: .45; cursor: not-allowed; filter: none; }
.u-btn.is-soft { background: rgba(var(--u-accent-rgb), .13); color: var(--u-accent); box-shadow: inset 0 0 0 1px rgba(var(--u-accent-rgb), .4); }
.u-btn.is-line { background: transparent; color: var(--hbc-text); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.u-btn.is-line:hover, .u-btn.is-soft:hover { color: #fff; }
.u-btn.is-danger { background: transparent; color: var(--u-rose); box-shadow: inset 0 0 0 1px rgba(248,113,113,.4); }
.u-btn.is-kakao { background: #fee500; color: #191600; }
.u-btn.is-sm { width: auto; min-height: 40px; padding: 0 .95rem; border-radius: 999px; font-size: .82rem; }
.u-btn.is-auto { width: auto; }
.u-btns { display: grid; gap: .5rem; }
.u-btns.is-2 { grid-template-columns: 1fr 1fr; }

/* ── 쓰는 칸 ───────────────────────────────────────────── */
.u-field { margin-bottom: .85rem; }
.u-label { display: block; font-size: .78rem; font-weight: 700; color: var(--hbc-muted); margin: 0 0 .35rem; }
.u-label em { font-style: normal; color: var(--u-rose); }
.u-input {
    width: 100%; min-height: 46px; padding: .6rem .8rem; border-radius: 12px;
    background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
    color: #fff; font-size: 16px;   /* 16px 보다 작으면 아이폰이 칸을 누를 때 화면을 키운다 */
}
textarea.u-input { resize: vertical; line-height: 1.6; }
select.u-input option { background: var(--hbc-dark-2); color: #fff; }
.u-input:focus { outline: none; border-color: rgba(var(--u-accent-rgb), .7); background: rgba(255,255,255,.07); }
.u-input::placeholder { color: rgba(255,255,255,.35); }
.u-input[readonly] { opacity: .8; }
.u-hint { font-size: .76rem; color: var(--hbc-muted); margin-top: .3rem; line-height: 1.6; }
.u-check { display: flex; align-items: center; gap: .5rem; min-height: 44px; font-size: .86rem; color: var(--hbc-text); cursor: pointer; }
.u-check input { width: 18px; height: 18px; accent-color: var(--u-accent); flex: 0 0 auto; }

.u-choices { display: flex; flex-wrap: wrap; gap: .35rem; }
.u-choices label { position: relative; }
.u-choices input { position: absolute; opacity: 0; pointer-events: none; }
.u-choices span {
    display: inline-flex; align-items: center; gap: .3rem; min-height: 40px; padding: 0 .85rem;
    border-radius: 999px; cursor: pointer; font-size: .84rem; font-weight: 600;
    background: rgba(255,255,255,.04); border: 1px solid var(--hbc-border); color: var(--hbc-muted);
}
.u-choices input:checked + span { background: rgba(var(--u-accent-rgb), .14); border-color: rgba(var(--u-accent-rgb), .55); color: #fff; }
.u-choices input:focus-visible + span { outline: 2px solid var(--u-accent); outline-offset: 2px; }

/* 아래에서 올라오는 칸 / 넓은 화면에서는 가운데 */
.u-sheet {
    display: none; position: fixed; inset: 0; z-index: 2000;
    background: rgba(3,8,6,.66); backdrop-filter: blur(3px);
    align-items: flex-end; justify-content: center;
}
.u-sheet.open { display: flex; }
.u-sheet-box {
    width: 100%; max-height: 90vh; overflow-y: auto;
    padding: .5rem 1.05rem calc(1.2rem + env(safe-area-inset-bottom, 0px));
    background: var(--hbc-dark-2); border: 1px solid var(--hbc-border); border-bottom: none;
    border-radius: 20px 20px 0 0; box-shadow: 0 -18px 50px rgba(0,0,0,.5);
}
.u-grip { width: 42px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.22); margin: .35rem auto .7rem; }
.u-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .9rem; }
.u-sheet-head h3 { color: #fff; font-size: 1.02rem; font-weight: 800; margin: 0; display: flex; align-items: center; gap: .4rem; }
.u-sheet-head h3 i { color: var(--u-accent); }
.u-close {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(255,255,255,.06); color: var(--hbc-muted); font-size: 1rem;
}

/* 휴대폰 — 가장 중요한 단추가 늘 손 닿는 곳에. 하단 메뉴 바로 위에 뜬다. */
.u-dock { display: none; }
@media (max-width: 767.98px) {
    .u-dock {
        display: flex; align-items: center; gap: .6rem;
        position: fixed; left: 0; right: 0; z-index: 1041;
        bottom: calc(var(--mobile-bottom-nav-height, 68px) + var(--mobile-safe-bottom, 0px));
        padding: .55rem 16px; background: rgba(10,26,20,.96);
        backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid var(--hbc-border);
    }
    .u-dock .tx { flex: 1; min-width: 0; font-size: .76rem; color: var(--hbc-muted); line-height: 1.35; }
    .u-dock .tx b { display: block; color: #fff; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .u-dock .u-btn, .u-dock form { flex: 0 0 auto; width: auto; margin: 0; }
    .u-dock .u-btn { min-height: 46px; padding: 0 1.2rem; }
    body.u-has-dock { padding-bottom: calc(var(--mobile-bottom-nav-height, 68px) + var(--mobile-safe-bottom, 0px) + 68px); }
    /* 동행 헬리콥터가 참여 단추를 가리지 않게 그 위로 */
    body.u-has-dock .heli-companion-btn { bottom: calc(var(--mobile-bottom-nav-height, 68px) + env(safe-area-inset-bottom, 0px) + 80px); }
}

/* 약관 같은 긴 글 */
.u-doc { color: var(--hbc-text); font-size: .92rem; line-height: 1.85; word-break: keep-all; }
.u-doc h2 { color: #fff; font-size: 1.02rem; font-weight: 800; margin: 1.8rem 0 .5rem; scroll-margin-top: 80px; }
.u-doc h2:first-child { margin-top: 0; }
.u-doc h3 { color: #fff; font-size: .92rem; font-weight: 700; margin: 1rem 0 .3rem; }
.u-doc p { margin: 0 0 .6rem; }
.u-doc ol, .u-doc ul { margin: 0 0 .7rem; padding-left: 1.3rem; }
.u-doc li { margin-bottom: .3rem; }
.u-doc a { color: var(--u-accent); }
.u-doc b { color: #fff; }
.u-doc table { width: 100%; border-collapse: collapse; margin: .4rem 0 .9rem; font-size: .84rem; }
.u-doc th, .u-doc td { border: 1px solid var(--hbc-border); padding: .5rem .6rem; vertical-align: top; text-align: left; }
.u-doc th { color: #fff; background: rgba(255,255,255,.04); font-weight: 700; }
.u-toc { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .82rem; }
.u-toc a { color: var(--hbc-muted); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.u-toc a:hover { color: #fff; }
@media (max-width: 575.98px) {
    /* 좁은 화면의 표 — 칸을 세로로 쌓는다 */
    .u-doc table.is-stack thead { display: none; }
    .u-doc table.is-stack tr { display: block; border: 1px solid var(--hbc-border); border-radius: 12px; margin-bottom: .6rem; padding: .3rem .7rem; }
    .u-doc table.is-stack td { display: block; border: none; padding: .3rem 0; }
    .u-doc table.is-stack td::before { content: attr(data-label); display: block; color: var(--hbc-muted); font-size: .72rem; font-weight: 700; }
}

/* 쪽 넘김 */
.u-pages { display: flex; justify-content: center; margin-top: 1.4rem; }

/* ── 내 책방 — 사람·포인트·바로 가는 칸 ─────────────────── */
/* 사람 동그라미 — 사진이 없으면 이름 첫 글자, 사람마다 색이 다르다 */
.u-ava {
    flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    background: hsl(var(--h, 160), 42%, 34%); color: #fff; font-size: 1.5rem; font-weight: 900;
    box-shadow: 0 0 0 3px rgba(var(--u-accent-rgb), .35);
}
.u-ava img { width: 100%; height: 100%; object-fit: cover; }
.u-hero .u-ava { width: 72px; height: 72px; }

/* 포인트 한눈에 */
.u-wallet .num { display: flex; align-items: baseline; gap: .3rem; color: #fff; font-weight: 900;
                 font-size: 2rem; line-height: 1.1; }
.u-wallet .num i { color: var(--u-accent); font-size: 1.3rem; align-self: center; }
.u-wallet .num span { font-size: .95rem; color: var(--hbc-muted); font-weight: 700; }
.u-wallet .u-btns { margin-top: .9rem; }
.u-wallet .done { display: flex; align-items: center; justify-content: center; gap: .35rem; min-height: 50px;
                  border-radius: 14px; background: rgba(255,255,255,.04); color: var(--hbc-muted); font-size: .88rem; font-weight: 700; }
.u-wallet .done i { color: #6ee7b7; }

/* 내 것들로 바로 가는 칸 — 휴대폰 둘, 넓은 화면 넷 */
.u-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.u-menu a {
    display: flex; align-items: center; gap: .6rem; min-height: 60px; min-width: 0;
    padding: .6rem .7rem; border-radius: 14px; text-decoration: none;
    background: var(--hbc-dark-2); border: 1px solid var(--hbc-border); transition: border-color .15s;
}
.u-menu a:hover { border-color: rgba(var(--u-accent-rgb), .4); }
.u-menu a > i {
    flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px; font-size: 1.05rem;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(var(--mi, var(--u-accent-rgb)), .13); color: rgb(var(--mi, var(--u-accent-rgb)));
}
.u-menu a span { min-width: 0; color: #fff; font-size: .88rem; font-weight: 700; line-height: 1.3; word-break: keep-all; }
.u-menu a small { display: block; color: var(--hbc-muted); font-size: .72rem; font-weight: 500;
                  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 포인트 내역 한 줄 — 무엇으로, 언제, 얼마, 남은 것 */
.u-ledger > div { display: flex; align-items: center; gap: .7rem; padding: .7rem 0; border-bottom: 1px solid var(--hbc-border); }
.u-ledger > div:last-child { border-bottom: none; }
.u-ledger .ic {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; font-size: 1rem;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(248,113,113,.1); color: var(--u-rose);
}
.u-ledger .is-in .ic { background: rgba(52,211,153,.12); color: #6ee7b7; }
.u-ledger .main { flex: 1; min-width: 0; }
.u-ledger .ti { color: #fff; font-size: .88rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-ledger .sub { color: var(--hbc-muted); font-size: .74rem; margin-top: .1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-ledger .amt { flex: 0 0 auto; text-align: right; }
.u-ledger .amt b { display: block; color: var(--u-rose); font-size: .95rem; font-weight: 800; white-space: nowrap; }
.u-ledger .is-in .amt b { color: #6ee7b7; }
.u-ledger .amt small { color: var(--hbc-muted); font-size: .7rem; white-space: nowrap; }

/* 칸 안의 글자 수 · 확인 말 */
.u-input-wrap { position: relative; }
.u-input-wrap .u-input { padding-right: 3.4rem; }
.u-count { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%);
           font-size: .72rem; color: var(--hbc-muted); pointer-events: none; }
.u-hint.is-ok { color: #6ee7b7; }
.u-hint.is-bad { color: var(--u-rose); }
.u-hint.is-warn { color: var(--u-kids); }

/* 한 줄 알림 — 위에 둔다 */
.u-note { display: flex; align-items: flex-start; gap: .7rem; }
.u-note > i { font-size: 1.25rem; color: var(--u-accent); flex: 0 0 auto; margin-top: .1rem; }
.u-card.is-warn .u-note > i { color: var(--u-kids); }
.u-note b { display: block; color: #fff; font-size: .92rem; }
.u-note p { color: var(--hbc-muted); font-size: .8rem; line-height: 1.65; margin: .2rem 0 0; word-break: keep-all; }
.u-note p b { display: inline; font-size: inherit; }
.u-note .u-btn { margin-top: .6rem; }

/* ── 넓은 화면 ─────────────────────────────────────────── */
@media (min-width: 576px) {
    .u-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
    .u-hero-art { width: 140px; }
    .u-chips { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; overflow: visible; }
    .u-tabs-bar { top: 62px; }
    .u-tabs { margin: 0; padding-left: 0; padding-right: 0; }
    .u-shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem 1.1rem; }
    .u-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
    .u-sheet { align-items: center; padding: 1rem; }
    .u-sheet-box { max-width: 560px; border-radius: 18px; border-bottom: 1px solid var(--hbc-border);
                   max-height: 86vh; padding-bottom: 1.3rem; }
    .u-grip { display: none; }
    .u-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
    .u-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 1.6rem; align-items: start; }
    .u-split > .u-aside { position: sticky; top: 90px; }
    .u-stats { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .u-menu { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
    .u-shelf { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .u-shelf.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .u-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
