/* 모두의 책 — 초록·종이 톤 */
:root {
  --g900: #0f2e22; --g800: #1f4d3a; --g700: #2a6247; --g600: #2e7d5b; --g500: #3f9a6e;
  --g300: #9fcdb3; --g200: #cfe6d8; --g100: #e7f3ec; --g50: #f3f9f5;
  --paper: #fbfaf5; --bg: #fbfcfb;
  --ink: #18201c; --ink2: #46514b; --ink3: #7d8a83; --line: #e4ebe6; --line2: #d3ddd6;
  --heart: #e5484d; --accent: #e0a33a; --danger: #c43c3c;
  --serif: 'Noto Serif KR', 'Nanum Myeongjo', 'Batang', serif;
  --sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --nav-w: 72px;
  --logo: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M2.6 7.2c3-1.2 6-.9 9.4 1.3v11.3c-3.4-2.1-6.4-2.4-9.4-1.3z'/%3E%3Cpath fill='%23fff' fill-opacity='.82' d='M21.4 7.2c-3-1.2-6-.9-9.4 1.3v11.3c3.4-2.1 6.4-2.4 9.4-1.3z'/%3E%3Cpath fill='%23a6e3bf' d='M12 8.3c-.2-3 1.4-5.1 4.4-5.7-.1 3-1.7 5-4.4 5.7z'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.5;
  word-break: keep-all; overflow-wrap: anywhere; -webkit-font-smoothing: antialiased;
}
body.noscroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--g500); outline-offset: 2px; }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.fill { fill: currentColor; }
.dim { color: var(--ink3); }

/* ---------- 로고 ---------- */
.logo-mark { display: inline-block; width: 30px; height: 30px; border-radius: 9px; flex: none; background: var(--g800) var(--logo) center / 72% no-repeat; }
.logo-mark.lg { width: 48px; height: 48px; border-radius: 14px; }
.logo-mark.xl { width: 72px; height: 72px; border-radius: 20px; }
.logo-mark.light { background-color: rgba(255,255,255,.16); }
.logo-mark.dim { opacity: .35; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 900; font-size: 20px; color: var(--g900); letter-spacing: -.02em; }

/* ---------- 틀: 휴대폰 ---------- */
.sidenav, .rightcol { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 56px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 0 16px; background: rgba(255,255,255,.93); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.top-actions { display: flex; align-items: center; gap: 2px; }
#view { max-width: 600px; margin: 0 auto; padding-bottom: calc(72px + env(safe-area-inset-bottom)); min-height: 70vh; outline: none; }
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; height: calc(54px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: flex; background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
}
.bottomnav a { flex: 1; display: flex; justify-content: center; align-items: center; height: 54px; color: var(--ink2); }
.bottomnav a.on { color: var(--g900); }
.bottomnav a.on .ic { stroke-width: 2.5; }
.bottomnav a.on .avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--g900); }
.bottomnav .bn-write .ic { width: 38px; height: 30px; padding: 4px 9px; border-radius: 10px; background: var(--g800); color: #fff; stroke-width: 2; }

/* ---------- 틀: 넓은 화면 ---------- */
@media (min-width: 768px) {
  .topbar, .bottomnav { display: none; }
  #app { display: flex; justify-content: center; gap: 40px; padding-left: var(--nav-w); }
  #view { flex: 0 1 600px; min-width: 0; margin: 0; padding: 8px 0 60px; }
  .sidenav {
    display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: var(--nav-w);
    padding: 22px 12px 18px; border-right: 1px solid var(--line); background: #fff; z-index: 20;
  }
  .sidenav .brand { padding: 0 3px; }
  .sidenav .brand-name, .sidenav .lbl { display: none; }
  .side-links { display: flex; flex-direction: column; gap: 4px; margin-top: 30px; }
  .side-links a, .side-foot a, .side-foot .side-link { display: flex; align-items: center; gap: 14px; padding: 11px 12px; border-radius: 10px; font-size: 15.5px; width: 100%; text-align: left; }
  .side-links a:hover, .side-foot a:hover, .side-foot .side-link:hover { background: var(--g50); }
  .side-foot .side-link { color: var(--g700); margin-bottom: 6px; }
  .side-links a.on { font-weight: 800; }
  .side-links a.on .ic { stroke-width: 2.5; }
  .side-foot { margin-top: auto; }
  .side-cta { padding: 0 8px; }
  #toast { bottom: 32px; }
}
@media (min-width: 1100px) {
  :root { --nav-w: 236px; }
  .sidenav { padding: 26px 14px 20px; }
  .sidenav .brand { padding: 0 10px; }
  .sidenav .brand-name, .sidenav .lbl { display: inline; }
}
@media (min-width: 1240px) {
  body[data-view="home"] .rightcol { display: block; flex: 0 0 300px; position: sticky; top: 0; align-self: flex-start; max-height: 100vh; overflow: auto; padding: 30px 2px 24px; }
}

/* ---------- 버튼·입력 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 10px;
  background: var(--g100); color: var(--g900); font-weight: 600; font-size: 14px; border: 1px solid transparent; white-space: nowrap; transition: background .15s;
}
.btn:hover { background: var(--g200); }
.btn.primary { background: var(--g800); color: #fff; }
.btn.primary:hover { background: var(--g700); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 48px; font-size: 16px; padding: 0 22px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.danger { background: #fdecec; color: var(--danger); }
.btn.light { background: #fff; color: var(--g800); }
.btn.ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.btn:disabled { opacity: .55; }
.btn .ic { width: 18px; height: 18px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink); flex: none; }
.icon-btn:hover { background: var(--g50); }
.link-btn { color: var(--g600); text-decoration: underline; text-underline-offset: 2px; font-size: inherit; }
.row-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.row-btns.left { justify-content: flex-start; }
.fld { display: block; margin-bottom: 12px; }
.fld > span { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 5px; }
.fld em { font-style: normal; font-weight: 400; color: var(--ink3); }
.fld input, .fld textarea, .inp {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 10px; font: inherit; font-size: 15px; background: #fff; outline: none; color: var(--ink);
}
.fld textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.fld input:focus, .fld textarea:focus, .inp:focus { border-color: var(--g500); box-shadow: 0 0 0 3px var(--g100); }
.fld input:disabled { background: var(--g50); color: var(--ink3); }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fld-row .fld { margin-bottom: 4px; }
.fld-hint { font-size: 12.5px; color: var(--ink3); margin: 4px 0 12px; }
.agree { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--ink2); line-height: 1.55; margin-bottom: 8px; cursor: pointer; }
.agree input { margin-top: 2px; accent-color: var(--g700); width: 17px; height: 17px; flex: none; }
.agree a { color: var(--g700); text-decoration: underline; }
.form-err { color: var(--danger); font-size: 13.5px; min-height: 1em; margin: 4px 0 10px; }

/* ---------- 아바타 ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; color: #fff;
  font-weight: 700; font-size: 14px; flex: none; box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--g300); font-family: var(--sans);
}
.avatar.xs { width: 26px; height: 26px; font-size: 12px; box-shadow: none; }
.avatar.sm { width: 28px; height: 28px; font-size: 12.5px; box-shadow: none; }
.avatar.md { width: 44px; height: 44px; font-size: 18px; }
.avatar.xl { width: 88px; height: 88px; font-size: 36px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--g300); }

/* ---------- 겉장 ---------- */
.cover { text-align: left; position: relative; aspect-ratio: 4 / 5; container-type: inline-size; overflow: hidden; background: var(--cv, #1f4d3a); color: #fff; font-family: var(--serif); }
.cover .cv-in { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 9cqw 8.5cqw 7cqw; }
.cv-big, .cv-quote { display: none; }
.cv-top { display: flex; flex-direction: column; gap: 3.2cqw; }
.cv-cat { font-family: var(--sans); font-size: 3.4cqw; letter-spacing: .32em; font-weight: 600; opacity: .82; }
.cv-rule { display: block; width: 9cqw; height: .9cqw; background: var(--accent); border-radius: 1px; }
.cv-mid { margin-top: auto; display: flex; flex-direction: column; }
.cv-title { font-family: var(--pf, inherit); font-weight: 700; line-height: 1.3; letter-spacing: -.01em; word-break: keep-all; overflow-wrap: anywhere; }
.cv-title.t-xl { font-size: calc(13cqw * var(--pfs, 1)); }
.cv-title.t-l { font-size: calc(10cqw * var(--pfs, 1)); }
.cv-title.t-m { font-size: calc(8cqw * var(--pfs, 1)); }
.cv-title.t-s { font-size: calc(6.6cqw * var(--pfs, 1)); }
.cv-title.t-xs { font-size: calc(5.4cqw * var(--pfs, 1)); }
.cv-sub { font-size: 4.2cqw; margin-top: 3cqw; opacity: .86; line-height: 1.45; }
.cv-bot { display: flex; justify-content: space-between; align-items: flex-end; gap: 4cqw; margin-top: 7cqw; font-family: var(--sans); }
.cv-author { font-size: 4cqw; font-weight: 600; }
.cover.sm .cv-mark, .cover.xs .cv-mark { display: none; }
.cv-mark { font-size: 2.8cqw; letter-spacing: .22em; opacity: .62; white-space: nowrap; }

.tpl-modern { background: radial-gradient(130% 90% at 100% 0%, color-mix(in srgb, var(--cv) 78%, #fff) 0%, var(--cv) 58%, color-mix(in srgb, var(--cv) 86%, #000) 100%); }

.tpl-classic { background: var(--cv); }
.tpl-classic .cv-in {
  inset: 4.5cqw; padding: 10cqw 8cqw 8cqw; align-items: center; text-align: center;
  box-shadow: inset 0 0 0 .45cqw rgba(255,247,225,.78), inset 0 0 0 1.6cqw var(--cv), inset 0 0 0 2cqw rgba(255,247,225,.5);
}
.tpl-classic .cv-top { align-items: center; }
.tpl-classic .cv-rule { display: none; }
.tpl-classic .cv-mid { margin: auto 0; align-items: center; }
.tpl-classic .cv-mid::before { content: ''; width: 16cqw; height: .4cqw; background: rgba(255,247,225,.7); margin-bottom: 5cqw; }
.tpl-classic .cv-bot { flex-direction: column; align-items: center; gap: 2cqw; margin-top: 0; }

.tpl-paper { background: #f5f0e3; color: #1d241f; }
.tpl-paper::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3.5cqw; background: var(--cv); }
.tpl-paper .cv-cat, .tpl-paper .cv-bot { color: var(--cv); opacity: 1; }
.tpl-paper .cv-rule { background: var(--cv); }
.tpl-paper .cv-mid { margin-top: 12cqw; }
.tpl-paper .cv-sub { color: #4a524c; }
.tpl-paper .cv-mid::after { content: ''; height: .35cqw; background: color-mix(in srgb, var(--cv) 45%, transparent); margin-top: 7cqw; }
.tpl-paper .cv-bot { margin-top: auto; }

.tpl-spine { background: #f3efe6; color: #1d241f; }
.tpl-spine::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 15cqw; background: var(--cv); box-shadow: inset -1.4cqw 0 1.8cqw rgba(0,0,0,.2); }
.tpl-spine .cv-in { left: 15cqw; padding-left: 8cqw; }
.tpl-spine .cv-cat { color: var(--cv); opacity: 1; }
.tpl-spine .cv-rule { background: var(--cv); }
.tpl-spine .cv-mid { margin: auto 0; }
.tpl-spine .cv-sub { color: #4a524c; }
.tpl-spine .cv-bot { color: var(--cv); margin-top: 0; }

.tpl-quote { background: var(--cv); }
.tpl-quote .cv-big { display: block; position: absolute; top: -9cqw; left: 3cqw; font-size: 62cqw; line-height: 1; opacity: .13; font-weight: 900; }
.tpl-quote .cv-mid { margin: auto 0; }
.tpl-quote .cv-quote { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; font-size: 6.2cqw; line-height: 1.62; font-weight: 600; order: 1; }
.tpl-quote .cv-quote:empty { display: none; }
.tpl-quote .cv-quote:not(:empty) ~ .cv-title { font-size: 4.6cqw; margin-top: 6cqw; opacity: .9; order: 2; }
.tpl-quote .cv-quote:not(:empty) ~ .cv-title::before { content: '— '; }
.tpl-quote .cv-sub { display: none; }
.tpl-quote .cv-title { order: 2; }

.tpl-initial { background: color-mix(in srgb, var(--cv) 11%, #fbfaf5); color: #1d241f; }
.tpl-initial .cv-big { display: block; position: absolute; right: -4cqw; top: 8cqw; font-size: 64cqw; line-height: 1; color: var(--cv); opacity: .92; font-weight: 900; }
.tpl-initial .cv-cat { color: var(--cv); opacity: 1; }
.tpl-initial .cv-rule { background: var(--cv); }
.tpl-initial .cv-mid { position: relative; }
.tpl-initial .cv-sub { color: #4a524c; }
.tpl-initial .cv-bot { color: var(--cv); }

.cover-img { background: #e3ebe6; }
.cover-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-img.ov::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,24,17,.82) 0%, rgba(8,24,17,.32) 42%, transparent 68%); }
.cv-ov { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 8cqw; color: #fff; }
.cv-ov .cv-cat { display: block; margin-bottom: 3cqw; }
.cv-ov .cv-author { display: block; margin-top: 4cqw; font-family: var(--sans); }
.cover.book { border-radius: 2px 6px 6px 2px; box-shadow: inset 4px 0 6px -3px rgba(0,0,0,.28), 0 1px 2px rgba(0,0,0,.1), 0 14px 30px -10px rgba(15,46,34,.4); }

/* ---------- 홈 피드 ---------- */
.welcome {
  position: relative; margin: 14px 12px 6px; padding: 24px 22px 22px; border-radius: 18px; color: #fff; overflow: hidden;
  background: radial-gradient(140% 120% at 100% 0%, #2e7d5b 0%, #1f4d3a 55%, #12372a 100%);
}
.welcome h2 { font-family: var(--serif); font-size: 24px; margin: 12px 0 8px; letter-spacing: -.02em; }
.welcome p { margin: 0; opacity: .92; font-size: 14.5px; line-height: 1.7; }
.welcome .row-btns { justify-content: flex-start; }
.welcome .w-x { position: absolute; right: 6px; top: 6px; color: #fff; }
.welcome .w-x:hover { background: rgba(255,255,255,.12); }
.feed-head {
  position: sticky; top: 56px; z-index: 10; padding: 10px 0 8px; background: rgba(251,252,251,.94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
@media (min-width: 768px) { .feed-head { top: 0; } }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 6px 13px; border-radius: 999px; background: #fff; border: 1px solid var(--line2);
  font-size: 14px; color: var(--ink2); white-space: nowrap; transition: background .15s;
}
.chip:hover { background: var(--g50); }
.chip.on { background: var(--g800); border-color: var(--g800); color: #fff; font-weight: 600; }
.feed-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 16px 0; }
.seg { display: inline-flex; background: var(--g100); border-radius: 999px; padding: 3px; }
.seg > * { padding: 5px 12px; border-radius: 999px; font-size: 13px; color: var(--ink2); white-space: nowrap; }
.seg > .on { background: #fff; color: var(--g800); font-weight: 700; box-shadow: 0 1px 3px rgba(15,46,34,.12); }
.seg.sm { margin: 0 16px 6px; }
.len-sel { display: flex; align-items: center; gap: 2px; color: var(--ink2); font-size: 13px; }
.len-sel .ic { width: 17px; height: 17px; color: var(--g600); }
.len-sel select { border: 0; background: transparent; font: inherit; color: inherit; padding: 4px 2px; cursor: pointer; outline: none; }

.card { background: #fff; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
@media (min-width: 600px) { .card { border: 1px solid var(--line); border-radius: 14px; margin: 18px 0; overflow: hidden; } }
.card-h { display: flex; align-items: center; gap: 7px; padding: 10px 6px 10px 14px; font-size: 14px; min-width: 0; }
.card-author { display: flex; align-items: center; gap: 9px; font-weight: 700; min-width: 0; }
.card-author .pen { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-h .dim { white-space: nowrap; font-size: 13px; }
.cat-pill { font-size: 12px; color: var(--g700); background: var(--g100); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.card-h .more { margin-left: auto; }
.card-cover { display: block; position: relative; -webkit-tap-highlight-color: transparent; }
.card-actions { display: flex; align-items: center; padding: 6px 6px 0; }
.card-actions .sp { flex: 1; }
.like.on, .big-like.on { color: var(--heart); }
.like.on .ic { animation: pop .35s; }
.shelf.on { color: var(--g700); }
.card-body { padding: 0 16px; }
.likes { font-size: 14px; margin: 1px 0 7px; }
.card-title { display: block; font-family: var(--serif); font-size: 19px; font-weight: 700; line-height: 1.42; letter-spacing: -.015em; }
.card-sub { color: var(--ink2); font-size: 14.5px; margin-top: 2px; font-family: var(--serif); }
.card-sum { margin: 8px 0 0; font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.68; color: #2b332e; }
.card-sum .pen { font-weight: 700; margin-right: 3px; color: var(--ink); }
.tags { display: flex; flex-wrap: wrap; gap: 4px 9px; margin-top: 8px; font-size: 14px; }
.tags a { color: var(--g600); }
.card-read { display: flex; align-items: center; gap: 7px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--g50); color: var(--ink2); font-size: 13px; }
.card-read:hover { background: var(--g100); }
.card-read .ic { width: 18px; height: 18px; color: var(--g600); }
.card-read b { margin-left: auto; color: var(--g700); white-space: nowrap; }
.card-cmt { display: block; margin-top: 8px; color: var(--ink3); font-size: 14px; }
.burst { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; color: #fff; opacity: 0; z-index: 2; }
.burst .ic { width: 96px; height: 96px; stroke: none; filter: drop-shadow(0 4px 14px rgba(0,0,0,.35)); }
.burst.go { animation: burst .9s ease-out; }
.cta-card { margin: 16px 12px; padding: 24px 20px; text-align: center; border-radius: 16px; background: var(--g50); border: 1px dashed var(--g300); }
.cta-card b { font-family: var(--serif); font-size: 18px; display: block; margin: 10px 0 4px; }
.cta-card p { margin: 0 0 14px; color: var(--ink2); font-size: 14px; }
.cta-ic { display: inline-flex; width: 44px; height: 44px; border-radius: 50%; background: var(--g800); color: #fff; align-items: center; justify-content: center; }
.cta-ic .ic { width: 20px; height: 20px; }
.sentinel { min-height: 1px; }
.feed-end { text-align: center; color: var(--ink3); font-size: 13.5px; padding: 28px 16px 36px; }
.feed-end a { color: var(--g600); font-weight: 600; margin-left: 4px; }
.spin { width: 26px; height: 26px; margin: 28px auto; border: 3px solid var(--g200); border-top-color: var(--g600); border-radius: 50%; animation: spin .8s linear infinite; }
.empty { text-align: center; padding: 72px 24px; }
.empty h2 { font-family: var(--serif); font-size: 20px; margin: 16px 0 6px; }
.empty p { color: var(--ink2); margin: 0; line-height: 1.6; }

/* ---------- 바둑판·목록 ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.grid > .empty, .grid > .spin { grid-column: 1 / -1; }
.grid-item { position: relative; display: block; overflow: hidden; }
.grid-item:hover .cover { filter: brightness(.94); }
.gi-stat { position: absolute; right: 5px; bottom: 5px; display: flex; align-items: center; gap: 3px; font-size: 11.5px; color: #fff; background: rgba(0,0,0,.38); padding: 2px 7px; border-radius: 999px; z-index: 2; }
.gi-stat .ic { width: 12px; height: 12px; stroke: none; }
.gi-badge { position: absolute; left: 5px; top: 5px; font-size: 11px; color: #fff; background: rgba(15,46,34,.75); padding: 2px 7px; border-radius: 999px; z-index: 2; }
.grid.shelf { gap: 26px 16px; padding: 4px 18px 20px; }
.grid.shelf .cover { border-radius: 2px 5px 5px 2px; box-shadow: inset 3px 0 5px -2px rgba(0,0,0,.25), 0 8px 16px -8px rgba(15,46,34,.45); }
.grid.shelf .grid-item { overflow: visible; }
.grid.shelf .grid-item::after { content: ''; position: absolute; left: -10px; right: -10px; bottom: -11px; height: 7px; background: linear-gradient(#d9cfb8, #c2b591); border-radius: 2px; box-shadow: 0 3px 4px -2px rgba(0,0,0,.2); }
.rows { border-top: 1px solid var(--line); }
.row-item { display: flex; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fff; }
.row-item:hover { background: var(--g50); }
.ri-cover { width: 74px; flex: none; }
.ri-text { min-width: 0; }
.ri-text b { font-family: var(--serif); font-size: 16px; display: block; line-height: 1.4; }
.ri-text p { margin: 4px 0 6px; font-size: 13.5px; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.55; }
.ri-text small { color: var(--ink3); font-size: 12.5px; }

/* ---------- 읽기 ---------- */
body[data-view="post"] { background: var(--paper); }
body[data-view="post"] .topbar { display: none; }
body[data-view="post"] #view { flex-basis: 720px; max-width: 720px; padding-top: 0; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50; pointer-events: none; }
.progress i { display: block; height: 100%; background: var(--g600); transform-origin: 0 50%; transform: scaleX(0); }
.reader-bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 2px; height: 52px; padding: 0 6px;
  background: rgba(251,250,245,.94); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid transparent;
}
.reader-bar.show-title { border-bottom-color: var(--line); }
.rb-title { flex: 1; min-width: 0; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transition: opacity .2s; padding: 0 4px; }
.reader-bar.show-title .rb-title { opacity: 1; }
.reader { padding: 6px 22px 40px; }
.reader-skel { padding: 80px 0; }
.r-head { text-align: center; padding: 16px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.r-cover { width: min(230px, 56vw); margin: 0 auto 26px; }
.r-cat { color: var(--g700); font-size: 13px; letter-spacing: .25em; font-weight: 700; }
.reader { --rf: var(--pf, var(--serif)); }
.reader.rf-serif { --rf: var(--serif); --pfs: 1 !important; }
.reader.rf-sans { --rf: var(--sans); --pfs: 1 !important; }
.r-title { font-family: var(--rf); font-size: calc(clamp(26px, 6vw, 36px) * var(--pfs, 1)); line-height: 1.36; margin: 10px 0 0; letter-spacing: -.02em; font-weight: 700; color: var(--ink); }
.r-sub { font-family: var(--rf); color: var(--ink2); font-size: 17px; margin: 10px 0 0; line-height: 1.6; }
.r-author { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; font-size: 14px; flex-wrap: wrap; }
.r-author > a { display: flex; align-items: center; gap: 8px; }
.r-meta { color: var(--ink3); font-size: 13px; margin-top: 10px; display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap; }
.r-meta .ic { width: 16px; height: 16px; }
.r-notice { background: #fff6e0; border: 1px solid #f0d9a0; color: #7a5a14; padding: 10px 14px; border-radius: 10px; font-size: 14px; margin-bottom: 24px; }
.r-figure { margin: 0 0 30px; }
.r-figure img { width: 100%; border-radius: 10px; display: block; }
.r-toc details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 30px; font-size: 14.5px; }
.r-toc summary { cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 7px; list-style: none; color: var(--g800); }
.r-toc summary::-webkit-details-marker { display: none; }
.r-toc summary .ic { width: 18px; height: 18px; }
.r-toc ol { margin: 10px 0 2px; padding: 0; list-style: none; }
.r-toc li { padding: 4px 0; line-height: 1.5; }
.r-toc .toc-h3 { padding-left: 16px; font-size: 13.5px; }
.r-toc a { color: var(--ink2); }
.r-toc a:hover { color: var(--g600); }
.r-body { font-family: var(--rf); font-size: calc(var(--rs, 18px) * var(--pfs, 1)); line-height: 1.95; color: #222a25; }
.reader.rs-s { --rs: 16px; }
.reader.rs-l { --rs: 20px; }
.reader.rs-xl { --rs: 22px; }
.reader.rf-sans .r-body { line-height: 1.85; }
.r-body p { margin: 0 0 1.3em; }
.r-body h1, .r-body h2, .r-body h3, .r-body h4 { font-family: inherit; line-height: 1.42; margin: 2.1em 0 .8em; color: var(--g900); scroll-margin-top: 70px; }
.r-body h1 { font-size: 1.45em; }
.r-body h2 { font-size: 1.28em; padding-bottom: .35em; border-bottom: 1px solid var(--line); }
.r-body h3 { font-size: 1.1em; }
.r-body blockquote { margin: 1.6em 0; padding: .3em 0 .3em 1.2em; border-left: 3px solid var(--g500); color: var(--ink2); }
.r-body blockquote p:last-child { margin-bottom: 0; }
.r-body ul, .r-body ol { padding-left: 1.4em; margin: 0 0 1.3em; }
.r-body li { margin: .25em 0; }
.r-body hr { border: 0; text-align: center; margin: 2.4em 0; height: 1em; }
.r-body hr::before { content: '* * *'; color: var(--ink3); letter-spacing: .5em; }
.r-body table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .84em; margin: 1.4em 0; display: block; overflow-x: auto; line-height: 1.6; }
.r-body th, .r-body td { border: 1px solid var(--line2); padding: 8px 10px; text-align: left; vertical-align: top; }
.r-body th { background: var(--g50); }
.r-body code { font-family: Consolas, 'D2Coding', monospace; background: var(--g100); padding: .1em .35em; border-radius: 4px; font-size: .86em; }
.r-body pre { background: #1e2a24; color: #e8efe9; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 14px; line-height: 1.6; margin: 0 0 1.3em; }
.r-body pre code { background: none; color: inherit; padding: 0; }
.r-body a { color: var(--g600); text-decoration: underline; text-underline-offset: 3px; }
.r-body strong { color: var(--ink); }
.r-refs { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.r-refs h2 { font-size: 15px; margin: 0 0 10px; color: var(--g800); }
.r-refs ol { padding-left: 1.4em; color: var(--ink2); line-height: 1.75; margin: 0; }
.r-refs a { color: var(--g600); word-break: break-all; }
.reader > .tags { margin-top: 24px; }
.r-end { text-align: center; margin: 52px 0 32px; }
.r-end-mark { font-family: var(--serif); color: var(--ink3); font-size: 14px; margin-bottom: 18px; display: flex; align-items: center; gap: 14px; }
.r-end-mark::before, .r-end-mark::after { content: ''; flex: 1; height: 1px; background: var(--line2); }
.r-end-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.big-like, .big-btn { display: inline-flex; align-items: center; gap: 7px; height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line2); background: #fff; font-weight: 600; font-size: 15px; }
.big-like .ic, .big-btn .ic { width: 22px; height: 22px; }
.big-like.on { border-color: #f3c0c2; background: #fff5f5; }
.big-like.on .ic { animation: pop .35s; }
.big-btn.on { color: var(--g700); border-color: var(--g300); background: var(--g50); }
.r-authorbox { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.r-authorbox > div { flex: 1; min-width: 0; }
.r-authorbox p { margin: 2px 0 0; color: var(--ink2); font-size: 14px; }
.r-comments { margin-top: 34px; }
.r-comments h2, .r-more h2 { font-size: 17px; margin: 0 0 8px; }
.r-comments h2 span { color: var(--g600); }
.c-item { display: flex; gap: 10px; padding: 10px 0; }
.c-main { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.6; }
.c-main .pen { font-weight: 700; margin-right: 3px; }
.c-body { white-space: pre-wrap; }
.c-main small { font-size: 12.5px; }
.c-empty { font-size: 14px; padding: 6px 0; }
.c-form { display: flex; align-items: flex-end; gap: 8px; margin-top: 12px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.c-form textarea { flex: 1; border: 0; resize: none; font: inherit; font-size: 15px; outline: none; background: transparent; padding: 4px 0; min-height: 26px; line-height: 1.55; }
.r-more { margin-top: 38px; }
.prefs h3 { margin: 0 0 16px; font-size: 17px; }
.pref-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; font-size: 14px; }
.pref-row .seg button { padding: 6px 14px; border-radius: 999px; color: var(--ink2); }
.pref-row .seg button.on { background: #fff; color: var(--g800); font-weight: 700; box-shadow: 0 1px 3px rgba(15,46,34,.12); }

/* ---------- 작가 ---------- */
.profile { padding-top: 22px; }
.pf-top { display: flex; gap: 24px; padding: 0 18px 22px; align-items: flex-start; }
.pf-info { flex: 1; min-width: 0; }
.pf-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pf-name h1 { font-size: 22px; margin: 0 6px 0 0; font-family: var(--serif); }
.pf-stats { display: flex; gap: 6px 16px; list-style: none; padding: 0; margin: 12px 0 10px; font-size: 14px; flex-wrap: wrap; color: var(--ink2); }
.pf-stats b { font-weight: 700; color: var(--ink); }
.pf-bio { margin: 0 0 6px; font-size: 14.5px; white-space: pre-wrap; line-height: 1.6; }
.pf-info small { font-size: 12.5px; }
.pf-tabs { display: flex; justify-content: center; gap: 44px; border-top: 1px solid var(--line); margin-bottom: 3px; }
.pf-tabs a { display: flex; align-items: center; gap: 6px; padding: 14px 0 12px; font-size: 13px; font-weight: 600; color: var(--ink3); border-top: 1.5px solid transparent; margin-top: -1px; }
.pf-tabs a.on { color: var(--ink); border-top-color: var(--ink); }
.pf-tabs .ic { width: 16px; height: 16px; }
@media (max-width: 480px) {
  .pf-top { gap: 16px; }
  .pf-top .avatar.xl { width: 72px; height: 72px; font-size: 30px; }
  .pf-tabs { gap: 28px; }
}

/* ---------- 검색·서재·설정·안내 ---------- */
.search-page { padding: 14px 0; }
.search-box { display: flex; align-items: center; gap: 8px; margin: 0 16px 12px; padding: 0 14px; height: 46px; border-radius: 12px; background: #fff; border: 1px solid var(--line2); }
.search-box:focus-within { border-color: var(--g500); box-shadow: 0 0 0 3px var(--g100); }
.search-box input { flex: 1; border: 0; background: transparent; font: inherit; font-size: 15.5px; outline: none; height: 100%; min-width: 0; }
.search-box .ic { color: var(--ink3); width: 20px; height: 20px; }
.search-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 8px; }
.search-tag { padding: 0 16px 10px; font-size: 14px; }
.sec-title { font-size: 15px; padding: 14px 16px 10px; margin: 0; }
.page-title { display: flex; align-items: center; gap: 8px; font-family: var(--serif); font-size: 22px; padding: 22px 18px 0; margin: 0; }
.shelf-page > .dim { padding: 4px 18px 18px; margin: 0; font-size: 14px; }
.settings { padding-bottom: 40px; }
.card-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin: 16px; }
.card-box h2 { font-size: 16px; margin: 0 0 14px; }
.kv { display: grid; grid-template-columns: 70px 1fr; gap: 8px; font-size: 14px; margin: 0 0 8px; }
.kv dt { color: var(--ink3); }
.kv dd { margin: 0; }
.danger-box h2 { color: var(--danger); }
.danger-box p { font-size: 14px; }
.doc { padding: 22px 22px 60px; font-size: 15.5px; line-height: 1.8; }
.doc h1 { font-family: var(--serif); font-size: 26px; margin: 0 0 4px; }
.doc h2 { font-family: var(--serif); font-size: 18px; margin: 28px 0 8px; color: var(--g900); }
.doc p, .doc ul { margin: 0 0 12px; color: var(--ink2); }
.doc ul { padding-left: 1.3em; }
.doc b { color: var(--ink); }
.doc-hero { text-align: center; padding: 24px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.doc-hero h1 { font-size: 30px; margin-top: 14px; }
.doc-hero p { font-family: var(--serif); color: var(--g700); font-size: 17px; margin: 4px 0 0; }

/* ---------- 오른쪽 칸 ---------- */
.rc-me { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px 20px; }
.rc-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rc-user > span, .rc-me > div { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.rc-me small { color: var(--ink3); font-size: 12.5px; }
.rc-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
.rc-box h3 { font-size: 13px; color: var(--ink3); margin: 0 0 6px; font-weight: 700; letter-spacing: .04em; }
.rc-top { margin: 0; padding: 0; list-style: none; counter-reset: rc; }
.rc-top li { counter-increment: rc; display: flex; gap: 10px; padding: 7px 0; }
.rc-top li::before { content: counter(rc); font-family: var(--serif); font-weight: 900; color: var(--g600); width: 14px; flex: none; }
.rc-top b { display: block; font-size: 14px; font-family: var(--serif); line-height: 1.45; }
.rc-top small { color: var(--ink3); font-size: 12px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px 10px; font-size: 13.5px; }
.tag-cloud a { color: var(--g700); }
.rc-foot { color: var(--ink3); font-size: 12px; line-height: 1.9; padding: 4px; }

/* ---------- 모달·알림 ---------- */
#modal-root { display: none; }
#modal-root.open { display: block; }
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(12,28,20,.5); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
.modal { position: relative; background: #fff; border-radius: 18px; width: 100%; max-width: 420px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; padding: 28px 24px 24px; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: rise .2s; }
.modal-x { position: absolute; right: 8px; top: 8px; z-index: 3; }
.m-small { max-width: 360px; }
.m-wide { max-width: 640px; }
.m-auth { max-width: 410px; }
.m-full { max-width: 820px; height: calc(100vh - 32px); height: calc(100dvh - 32px); padding: 0; background: var(--paper); }
.m-full .progress { display: none; }
.preview-head { position: sticky; top: 0; z-index: 2; background: rgba(251,250,245,.96); padding: 14px 56px 12px 22px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.preview-body .reader { padding-top: 10px; }
.m-sheet { max-width: 400px; padding: 6px 0; }
.m-sheet .modal-x { display: none; }
@media (max-width: 600px) {
  .modal-bg:has(.m-sheet) { align-items: flex-end; padding: 0; }
  .m-sheet { border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom); }
}
.sheet-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 22px; font-size: 15px; text-align: left; }
.sheet-item:hover { background: var(--g50); }
.sheet-item .ic { width: 20px; height: 20px; }
.sheet-item.danger { color: var(--danger); }
.sheet-item.cancel { justify-content: center; color: var(--ink3); border-top: 1px solid var(--line); margin-top: 4px; }
.confirm p { margin: 4px 0 16px; line-height: 1.65; }
.confirm .row-btns { justify-content: flex-end; }
.confirm .inp { margin-bottom: 4px; }
.auth-brand { text-align: center; }
.auth-brand h2 { font-family: var(--serif); margin: 10px 0 4px; font-size: 22px; }
.auth-brand p { color: var(--ink2); font-size: 14px; margin: 0 0 18px; line-height: 1.55; }
.auth-tabs { display: flex; background: var(--g100); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.auth-tabs button { flex: 1; height: 36px; border-radius: 9px; font-weight: 600; color: var(--ink2); font-size: 14px; }
.auth-tabs .on { background: #fff; color: var(--g800); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
#toast {
  position: fixed; left: 50%; bottom: calc(72px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); background: #17271f; color: #fff;
  padding: 11px 18px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 200;
  max-width: calc(100vw - 32px); width: max-content; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.22); line-height: 1.5;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 글쓰기 ---------- */
body[data-view="write"] { background: #eef3ef; }
body[data-view="write"] .sidenav, body[data-view="write"] .topbar, body[data-view="write"] .bottomnav, body[data-view="write"] .rightcol { display: none !important; }
body[data-view="write"] #app { display: block; padding-left: 0; }
body[data-view="write"] #view { max-width: none; padding: 0; margin: 0; }
.w-loading { text-align: center; padding: 120px 0; color: var(--ink3); }
.w-top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 10px;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.w-state { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.w-state b { font-size: 14px; }
.w-saved { font-size: 12px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-tools { display: flex; align-items: center; gap: 6px; }
.w-panel-btn { display: none; }
.w-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; max-width: 1240px; margin: 0 auto; padding: 24px; align-items: start; }
.w-main { min-width: 0; }
.w-paper { background: #fff; border-radius: 16px; box-shadow: 0 1px 3px rgba(15,46,34,.06), 0 10px 30px -14px rgba(15,46,34,.16); padding: 40px 48px 20px; max-width: 840px; margin: 0 auto; }
.w-title { display: block; width: 100%; border: 0; outline: none; resize: none; font-family: var(--pf, var(--serif)); font-size: calc(32px * var(--pfs, 1)); font-weight: 700; line-height: 1.35; padding: 0; overflow: hidden; color: var(--ink); background: transparent; letter-spacing: -.02em; }
.w-sub { display: block; width: 100%; border: 0; outline: none; font-family: var(--pf, var(--serif)); font-size: calc(18px * var(--pfs, 1)); color: var(--ink2); padding: 10px 0 0; background: transparent; }
.w-title::placeholder, .w-sub::placeholder { color: #b6c0ba; }
.w-cats { display: flex; gap: 12px; align-items: flex-start; padding: 18px 0 16px; border-bottom: 1px solid var(--line); }
.w-label { flex: none; font-size: 13px; font-weight: 700; color: var(--g700); padding-top: 6px; }
.chips.wrap { flex-wrap: wrap; overflow: visible; padding: 0; }
.w-cats .chip { font-size: 13px; padding: 5px 11px; }
.w-cats.need { animation: shake .4s; }
.w-cats.need .w-label { color: var(--danger); }
.w-count { text-align: right; font-size: 12.5px; color: var(--ink3); padding-top: 10px; min-height: 30px; }
.w-tip { max-width: 840px; margin: 12px auto 0; font-size: 12.5px; color: var(--ink3); display: flex; gap: 6px; align-items: flex-start; padding: 0 8px; line-height: 1.6; }
.w-tip .ic { width: 16px; height: 16px; margin-top: 2px; }
.w-note { max-width: 840px; margin: 0 auto 12px; display: flex; align-items: center; gap: 8px; background: var(--g100); color: var(--g900); padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.w-note .ic { width: 18px; height: 18px; color: var(--g600); }
.w-note .link-btn { margin-left: auto; white-space: nowrap; }
.w-note .link-btn + .link-btn { margin-left: 12px; color: var(--ink3); }
.w-meta { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0 12px; }
.dd-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px 0 13px; border: 1px solid var(--line2); border-radius: 999px; background: #fff; font-size: 13.5px; white-space: nowrap; transition: .15s; }
.dd-btn:hover { background: var(--g50); }
.dd-btn .dd-k { color: var(--ink3); }
.dd-btn .dd-v { color: var(--g800); font-weight: 700; font-family: var(--sans); }
.dd-btn .dd-v.empty { color: var(--accent); }
.dd-btn .ic { width: 16px; height: 16px; color: var(--ink3); transition: transform .15s; }
.dd-btn.open { border-color: var(--g500); background: var(--g50); }
.dd-btn.open .ic { transform: rotate(180deg); }
.dd-btn.need { border-color: var(--danger); animation: shake .4s; }
.dd-pop { margin: 0 0 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--g50); animation: rise .15s; }
.dd-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.dd-head b { font-size: 14px; }
.dd-head span { font-size: 12.5px; color: var(--ink3); }
.dd-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.dd-grid .chip { font-size: 13.5px; }
.dd-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.font-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1.5px solid var(--line2); border-radius: 10px; background: #fff; text-align: left; line-height: 1.4; }
.font-opt:hover { border-color: var(--g300); }
.font-opt.on { border-color: var(--g600); box-shadow: 0 0 0 3px var(--g100); }
.font-opt span { color: var(--ink2); }
.dd-pop .st-grid { margin-top: 0; }
.dd-pop .st-card { padding: 12px 14px; }
.install { text-align: center; }
.install h3 { font-family: var(--serif); margin: 12px 0 8px; font-size: 19px; }
.install > p { line-height: 1.75; font-size: 14.5px; color: var(--ink2); margin: 0; }
.install-alt { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 12px; }
.install-alt p { font-size: 13px; margin: 0 0 10px; }
.w-side { position: sticky; top: 80px; background: #fff; border-radius: 16px; box-shadow: 0 1px 3px rgba(15,46,34,.06), 0 10px 30px -14px rgba(15,46,34,.16); max-height: calc(100vh - 100px); overflow: auto; }
.w-side-head { display: none; }
.w-tabs { display: flex; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.w-tabs button { flex: 1; padding: 13px 2px 11px; font-size: 13px; font-weight: 600; color: var(--ink3); border-bottom: 2px solid transparent; white-space: nowrap; }
.w-tabs .on { color: var(--g800); border-bottom-color: var(--g800); }
.w-pane { padding: 18px; }
.cv-preview { width: 176px; margin: 4px auto 0; }
.w-help { font-size: 12.5px; color: var(--ink3); line-height: 1.6; margin: 8px 0 12px; }
.w-help.center { text-align: center; }
.w-block { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.w-block h4 { margin: 0 0 10px; font-size: 14px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.w-block h4 small { font-weight: 400; color: var(--ink3); font-size: 12px; }
.w-block.off .tpl-grid, .w-block.off .swatches, .w-block.off .fld { opacity: .4; }
.img-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 12px; border: 1.5px dashed var(--g300); border-radius: 12px; background: var(--g50); cursor: pointer; text-align: center; color: var(--g800); font-size: 14px; }
.img-drop small { color: var(--ink3); font-size: 12px; line-height: 1.5; }
.img-drop:hover { background: var(--g100); }
.busy { opacity: .5; pointer-events: none; }
.img-has { display: flex; gap: 12px; }
.img-has img { width: 84px; height: 105px; object-fit: cover; border-radius: 6px; flex: none; background: var(--g50); }
.img-opts { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; min-width: 0; }
.img-opts label { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.img-opts label.btn { gap: 0; }
.img-opts .off { opacity: .45; }
.img-opts input { accent-color: var(--g700); }
.img-opts .row-btns { margin-top: 4px; }
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tpl-opt { display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 12px; color: var(--ink2); padding: 4px; border-radius: 8px; border: 2px solid transparent; }
.tpl-opt.on { border-color: var(--g600); color: var(--g800); font-weight: 700; }
.tpl-thumb { width: 100%; display: block; border-radius: 3px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,.14); }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 9px; margin: 14px 2px; }
.sw { aspect-ratio: 1; border-radius: 50%; background: var(--c); }
.sw.on { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c); }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--line2); border-radius: 10px; padding: 6px 8px; min-height: 44px; background: #fff; }
.tag-input:focus-within { border-color: var(--g500); box-shadow: 0 0 0 3px var(--g100); }
.tag-input input { flex: 1; min-width: 120px; border: 0; outline: none; height: 30px; font: inherit; font-size: 14px; padding: 0; box-shadow: none !important; }
.tag-list { display: contents; }
.tag-chip { display: inline-flex; align-items: center; gap: 2px; background: var(--g100); color: var(--g800); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 13px; }
.tag-chip button { width: 20px; height: 20px; border-radius: 50%; font-size: 15px; line-height: 1; color: var(--g700); }
.w-refs { width: 100%; border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 13.5px; line-height: 1.7; resize: vertical; outline: none; }
.w-refs:focus { border-color: var(--g500); box-shadow: 0 0 0 3px var(--g100); }
.stat-hero { text-align: center; padding: 8px 0 16px; }
.stat-hero b { font-family: var(--serif); font-size: 40px; color: var(--g800); display: block; line-height: 1.15; }
.stat-hero span { font-size: 13px; color: var(--ink3); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-grid div { background: var(--g50); border-radius: 10px; padding: 10px 4px; text-align: center; }
.stat-grid b { display: block; font-size: 17px; color: var(--g900); }
.stat-grid span { font-size: 11.5px; color: var(--ink3); }
.milestone { margin: 18px 0 8px; }
.ms-label { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--ink2); margin-bottom: 6px; gap: 8px; }
.ms-bar { height: 8px; background: var(--g100); border-radius: 999px; overflow: hidden; }
.ms-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--g500), var(--g700)); border-radius: 999px; transition: width .3s; }
.starters h2 { font-family: var(--serif); margin: 0 0 4px; font-size: 22px; }
.starters > p { margin: 0; font-size: 14px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 18px; }
.st-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border-radius: 14px; border: 1px solid var(--line2); text-align: left; background: #fff; transition: .15s; }
.st-card:hover { border-color: var(--g500); background: var(--g50); }
.st-card b { font-family: var(--serif); font-size: 16px; }
.st-card span { font-size: 13px; color: var(--ink3); }

/* Toast UI 편집기를 책 원고처럼 */
.w-paper .toastui-editor-defaultUI { border: 0; font-family: var(--sans); }
.w-paper .toastui-editor-defaultUI-toolbar { background: #fff; border-bottom: 1px solid var(--line); padding: 0; position: sticky; top: 56px; z-index: 5; }
.w-paper .toastui-editor-toolbar { position: sticky; top: 56px; z-index: 5; background: #fff; }
.w-paper .toastui-editor-main { background: #fff; }
.w-paper .toastui-editor-ww-container .toastui-editor-contents { padding: 20px 2px; }
.w-paper .toastui-editor-contents { font-family: var(--pf, var(--serif)); font-size: calc(17.5px * var(--pfs, 1)); line-height: 1.9; color: #222a25; }
.w-paper .toastui-editor-contents p { margin: 0 0 .9em; }
.w-paper .toastui-editor-contents h1, .w-paper .toastui-editor-contents h2, .w-paper .toastui-editor-contents h3 { font-family: inherit; border-bottom: 0; color: var(--g900); margin: 1.4em 0 .6em; }
.w-paper .toastui-editor-contents blockquote { border-left-color: var(--g500); }
.w-paper .toastui-editor-contents .placeholder, .w-paper .ProseMirror .placeholder { color: #b6c0ba; }
.w-paper .toastui-editor-md-container .toastui-editor { font-size: 15px; }
.w-paper .toastui-editor-mode-switch { border-top: 1px solid var(--line); background: #fff; }
.w-paper .toastui-editor-mode-switch .tab-item.active { color: var(--g800); border-top-color: transparent; }
.w-paper .toastui-editor-md-tab-container { background: var(--g50); }

body.w-focus { background: var(--paper); }
body.w-focus .w-side, body.w-focus .w-tip, body.w-focus [data-w="preview"], body.w-focus [data-w="draft"], body.w-focus .w-panel-btn { display: none !important; }
body.w-focus .w-grid { grid-template-columns: minmax(0, 1fr); max-width: 900px; }
body.w-focus .w-paper { box-shadow: none; background: transparent; }
body.w-focus .w-paper .toastui-editor-main, body.w-focus .w-paper .toastui-editor-toolbar, body.w-focus .w-paper .toastui-editor-defaultUI-toolbar, body.w-focus .w-paper .toastui-editor-mode-switch { background: var(--paper); }
body.w-focus .w-paper .toastui-editor-toolbar { opacity: .45; transition: opacity .2s; }
body.w-focus .w-paper .toastui-editor-toolbar:hover { opacity: 1; }

@media (max-width: 1000px) {
  .w-grid { grid-template-columns: minmax(0, 1fr); padding: 14px; }
  .w-panel-btn { display: inline-flex; }
  .w-side {
    position: fixed; inset: 0; z-index: 60; border-radius: 0; max-height: none; box-shadow: none;
    transform: translateY(100%); transition: transform .25s, visibility .25s; visibility: hidden;
  }
  body.w-panel-open .w-side { transform: none; visibility: visible; }
  body.w-panel-open { overflow: hidden; }
  .w-side-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 3; }
  .w-tabs { top: 53px; }
  .w-paper { padding: 26px 20px 16px; border-radius: 12px; }
  .w-title { font-size: calc(26px * var(--pfs, 1)); }
}
@media (max-width: 600px) {
  .hide-s { display: none; }
  .w-tools { gap: 4px; }
  .w-tools .btn.sm { padding: 0 9px; }
  .w-panel-btn span { display: none; }
  .w-cats { flex-direction: column; gap: 8px; }
  .w-grid { padding: 0; }
  .w-paper { border-radius: 0; box-shadow: none; padding: 22px 16px 16px; }
  .w-note { margin: 10px 12px 0; }
  .fld-row { grid-template-columns: 1fr; gap: 0; }
}

@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
@keyframes burst { 0% { opacity: 0; transform: scale(.4); } 15% { opacity: 1; transform: scale(1.12); } 30% { transform: scale(.95); } 45% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
