/* 서가 — Organic Shape / Soft UI theme */
:root {
  --bg: #e9edf2;
  --surface: #eef1f5;
  --card: #f2f4f8;
  --ink: #26334d;
  --ink-2: #56627a;
  --ink-3: #8f98ab;
  --line: #d6dce5;
  --hi: #ffffff;
  --lo: #c5ccd8;
  --pink: #ef5d92;
  --orange: #f6a53a;
  --teal: #22b69a;
  --blue: #3c9ae4;
  --accent: #2aa5c4;
  --accent-ink: #ffffff;
  --grad: linear-gradient(135deg, #22b69a 0%, #3c9ae4 100%);
  --grad-warm: linear-gradient(135deg, #ef5d92 0%, #f6a53a 100%);
  --like: #ef5d92;
  --raise: 9px 9px 20px var(--lo), -9px -9px 20px var(--hi);
  --raise-sm: 5px 5px 12px var(--lo), -5px -5px 12px var(--hi);
  --inset: inset 4px 4px 9px var(--lo), inset -4px -4px 9px var(--hi);
  --radius: 22px;
  --sans: "Poppins", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --serif: var(--sans);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #23272f; --surface: #262b33; --card: #282d36; --ink: #e6eaf2; --ink-2: #aab3c4; --ink-3: #7c8596;
  --line: #353b46; --hi: #2f3540; --lo: #191c22; --accent: #48bcd8;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #23272f; --surface: #262b33; --card: #282d36; --ink: #e6eaf2; --ink-2: #aab3c4; --ink-3: #7c8596;
    --line: #353b46; --hi: #2f3540; --lo: #191c22; --accent: #48bcd8;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--sans); word-break: keep-all; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* signature: three dots + light/bold headings */
.dots { display: inline-flex; gap: 6px; }
.dots i { width: 9px; height: 9px; border-radius: 3px; background: var(--pink); }
.dots i:nth-child(2) { background: var(--orange); }
.dots i:nth-child(3) { background: var(--teal); }
.dots.sm i { width: 5px; height: 5px; border-radius: 50%; }
h1, h2, h3 { font-weight: 300; letter-spacing: -.01em; }
h1 b, h2 b, h3 b { font-weight: 700; }
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3); }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px); }
.top-inner { max-width: 1280px; margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 46% 54% 42% 58% / 55% 45% 55% 45%; background: var(--grad); color: #fff; font-weight: 700; font-size: 17px; box-shadow: 0 8px 18px -6px rgba(34,182,154,.6); }
.brand-name { font-size: 21px; font-weight: 300; }
.brand-name b { font-weight: 700; }
.search { flex: 1; max-width: 440px; display: flex; align-items: center; gap: 8px; padding: 0 16px; height: 44px; border-radius: 999px; background: var(--bg); box-shadow: var(--inset); color: var(--ink-3); }
.search input { flex: 1; border: 0; background: none; outline: none; color: var(--ink); min-width: 0; }
.tabs { display: flex; gap: 4px; margin-left: auto; padding: 5px; border-radius: 999px; background: var(--bg); box-shadow: var(--inset); }
.tab { white-space: nowrap; border: 0; background: none; padding: 7px 16px; border-radius: 999px; color: var(--ink-2); font-weight: 500; font-size: 14px; transition: background .2s, box-shadow .2s; }
.tab.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--raise-sm); font-weight: 600; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--bg); box-shadow: var(--raise-sm); color: var(--ink-2); transition: box-shadow .2s; }
.icon-btn:active { box-shadow: var(--inset); }
.icon-btn[aria-pressed="true"] { color: var(--like); }
.icon-btn[aria-pressed="true"] svg { fill: currentColor; }
/* 관리자 모드 */
.admin-btn .shackle { transition: transform .25s; transform-origin: 16px 11px; }
.admin-btn.on { color: var(--accent); }
.admin-btn.on .shackle { transform: translateX(4px) rotate(18deg); }
.sheet.admin-dlg { width: min(440px, calc(100vw - 32px)); }
.admin-msg { margin: 0; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.admin-err { margin: 0; font-size: 13px; color: var(--like); }
#adminLoginRow { display: grid; gap: 12px; }
#adminLoginRow[hidden], #adminOnRow[hidden] { display: none; }
body.locked .card { cursor: zoom-in; }
body.locked .card .cover::after { content: ''; position: absolute; right: 10px; bottom: 10px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(20,28,45,.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E") center/14px no-repeat; }

main { max-width: 1280px; margin: 0 auto; padding: 0 28px 48px; }

/* hero */
.hero { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center; padding: 36px 0 28px; }
.hero h1 { margin: 14px 0 0; font-size: clamp(30px, 4.4vw, 50px); line-height: 1.18; color: var(--ink); }
.hero-sub { margin: 14px 0 0; color: var(--ink-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.hero-art { position: relative; height: 320px; }
.blob { position: absolute; inset: 0 4% 0 14%; border-radius: 58% 42% 46% 54% / 48% 56% 44% 52%; background: var(--surface); box-shadow: var(--raise); overflow: hidden; animation: morph 14s ease-in-out infinite alternate; }
@keyframes morph { to { border-radius: 44% 56% 58% 42% / 56% 44% 56% 44%; } }
.hero-books { position: absolute; inset: 0 0 0 10%; display: flex; align-items: center; justify-content: center; gap: 14px; transform: rotate(-6deg); }
.hero-books .cover { width: 108px; aspect-ratio: 3/4; border-radius: 10px; box-shadow: 0 16px 30px -12px rgba(30,40,70,.45); }
.hero-books .cover:nth-child(2) { transform: translateY(-22px); width: 124px; }
.count-badge { position: absolute; right: -4px; top: 10px; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; text-align: center; background: var(--bg); box-shadow: var(--raise); }
.count-badge::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; box-shadow: var(--inset); }
.count-badge strong { position: relative; display: block; font-size: 26px; font-weight: 700; line-height: 1; }
.count-badge span { position: relative; display: block; font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.continue { grid-column: 1 / -1; padding: 18px 22px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--raise-sm); }
.continue-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.continue-head h3 { margin: 0; font-size: 16px; }
.continue-list { display: flex; gap: 16px; overflow-x: auto; padding: 4px 2px 6px; }
.mini { flex: none; width: 84px; border: 0; padding: 0; background: none; text-align: left; }
.mini .cover { width: 84px; aspect-ratio: 3/4; border-radius: 10px; box-shadow: var(--raise-sm); }
.mini span { display: block; margin-top: 6px; font-size: 12px; line-height: 1.3; color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mini .pbar { margin-top: 4px; }

/* controls */
.controls { padding: 10px 0 8px; display: grid; gap: 16px; }
.chips, .mine-tabs, .shelf-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chips-row { display: flex; align-items: flex-start; gap: 12px; }
.chips-row .chips { flex: 1; min-width: 0; }
.drive-sync { flex: none; gap: 6px; }
.drive-sync svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.drive-sync.spin svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 640px) { .chips-row { flex-direction: column; } }
.chip { border: 0; background: var(--bg); box-shadow: var(--raise-sm); color: var(--ink-2); padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; transition: box-shadow .2s, color .2s; }
.chip:hover { color: var(--ink); }
.chip b { font-weight: 500; color: var(--ink-3); margin-left: 5px; font-size: 12px; }
.chip.is-on { box-shadow: var(--inset); color: var(--accent); font-weight: 600; }
.chip.is-on b { color: inherit; opacity: .75; }
.chip.add { color: var(--teal); }
.control-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.select { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); }
.select select { height: 40px; padding: 0 30px 0 14px; border: 0; border-radius: 14px; background: var(--bg); box-shadow: var(--inset); color: var(--ink); max-width: 220px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--bg); box-shadow: var(--inset); position: relative; cursor: pointer; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 2px 2px 5px var(--lo); transition: transform .2s; }
.switch input:checked { background: var(--teal); }
.switch input:checked::after { transform: translateX(18px); background: #fff; }
.count { margin: 0 0 0 auto; font-size: 13px; color: var(--ink-3); }

/* grid & cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 28px 24px; padding-top: 18px; }
.card { position: relative; display: flex; flex-direction: column; text-align: left; border: 0; padding: 14px 14px 16px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--raise-sm); color: inherit; cursor: pointer; transition: transform .25s ease, box-shadow .25s ease; }
.card:hover, .card:focus-visible { transform: translateY(-4px); box-shadow: var(--raise); }
.card .cover { width: 100%; aspect-ratio: 3/4; border-radius: 14px; box-shadow: 0 10px 22px -12px rgba(30,40,70,.45); }
.card-title { margin: 12px 0 2px; font-size: 15px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title small { font-weight: 500; font-size: 12px; color: var(--ink-3); margin-left: 4px; }
.card-author { margin: 0; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-ainfo { margin: 2px 0 0; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.card-meta .liked { color: var(--like); }
.card-meta svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 2px; }
.card-meta .liked svg { fill: currentColor; }
.card .fav { position: absolute; top: 22px; right: 22px; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255,255,255,.92); color: #8a93a6; opacity: 0; transition: opacity .2s; z-index: 2; }
.card:hover .fav, .card .fav[aria-pressed="true"], .card .fav:focus-visible { opacity: 1; }
.card .fav[aria-pressed="true"] { color: var(--like); }
.card .fav[aria-pressed="true"] svg { fill: currentColor; }
@media (hover: none) { .card .fav { opacity: 1; } }
.badge-vol { position: absolute; left: 22px; top: 22px; z-index: 2; padding: 3px 10px; border-radius: 999px; background: var(--grad-warm); color: #fff; font-size: 11px; font-weight: 600; box-shadow: 0 6px 14px -6px rgba(239,93,146,.7); }
.status-tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #fff; background: var(--blue); }
.status-tag.done { background: var(--teal); }
.status-tag.wish { background: var(--orange); }
.pbar { height: 6px; border-radius: 999px; background: var(--bg); box-shadow: var(--inset); overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.card .pbar { margin-top: 8px; }

/* cover */
.cover { position: relative; overflow: hidden; background: var(--bg); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s; }
.cover img.ok { opacity: 1; }
.cover .gen { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 14% 12%; color: #fff; background: var(--c1); }
.cover .gen::before { content: ""; position: absolute; right: -30%; bottom: -18%; width: 90%; aspect-ratio: 1; border-radius: 58% 42% 46% 54% / 48% 56% 44% 52%; background: var(--c2); opacity: .55; }
.cover .gen::after { content: ""; position: absolute; left: -20%; top: -16%; width: 60%; aspect-ratio: 1; border-radius: 46% 54% 42% 58%; background: rgba(255,255,255,.18); }
.cover .gen strong { position: relative; z-index: 1; font-weight: 700; font-size: clamp(12px, 1.25vw, 16px); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.cover .gen span { position: relative; z-index: 1; font-size: 11px; opacity: .92; }
.cover .spine { display: none; }

.sentinel { height: 1px; }
.empty { text-align: center; color: var(--ink-3); padding: 60px 0; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 44px; padding: 0 20px; border: 0; border-radius: 16px; background: var(--bg); box-shadow: var(--raise-sm); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; transition: box-shadow .2s, transform .1s; }
.btn:active { box-shadow: var(--inset); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 10px 22px -8px rgba(34,160,190,.7); }
.btn.warm { background: var(--grad-warm); color: #fff; box-shadow: 0 10px 22px -8px rgba(239,93,146,.6); }
.btn.ghost { box-shadow: none; background: transparent; color: var(--ink-2); }
.btn.small { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 12px; }
.btn[aria-pressed="true"] { color: var(--like); box-shadow: var(--inset); }
.btn[aria-pressed="true"] svg { fill: currentColor; }
.btn.danger { color: #d0476b; }
.btn.danger.restore { color: var(--teal); }
.link-btn { border: 0; background: none; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13px; }
.card.is-hidden .cover { filter: grayscale(.9) opacity(.6); }

/* dialogs */
.sheet { width: min(940px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 30px; background: var(--bg); color: var(--ink); box-shadow: 0 40px 90px -30px rgba(20,30,60,.55); }
.sheet::backdrop { background: rgba(40, 50, 75, .35); backdrop-filter: blur(6px); }
.close { position: absolute; top: 16px; right: 18px; z-index: 3; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--bg); box-shadow: var(--raise-sm); color: var(--ink-2); font-size: 22px; line-height: 1; }
.detail { display: grid; grid-template-columns: 270px 1fr; gap: 32px; padding: 34px; }
.detail-cover { align-self: start; }
.detail-cover .frame { position: relative; padding: 22px; border-radius: 52% 48% 44% 56% / 46% 52% 48% 54%; background: var(--surface); box-shadow: var(--raise); }
.detail-cover .cover { width: 100%; aspect-ratio: 3/4; border-radius: 16px; box-shadow: 0 18px 30px -14px rgba(30,40,70,.5); }
.ring-wrap { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.ring { position: relative; width: 72px; height: 72px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--bg); box-shadow: var(--raise-sm); }
.ring svg { position: absolute; inset: 6px; width: 60px; height: 60px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring .track { stroke: var(--line); }
.ring .val { stroke: var(--teal); stroke-linecap: round; transition: stroke-dashoffset .5s; }
.ring b { position: relative; font-size: 15px; }
.ring-wrap p { margin: 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.detail-body h2 { margin: 6px 0 0; font-size: 30px; line-height: 1.25; padding-right: 44px; font-weight: 700; }
.d-author { margin: 8px 0 16px; color: var(--ink-2); font-size: 16px; }
.d-author button { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; }
.d-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 16px; padding: 14px 18px; border-radius: 18px; box-shadow: var(--inset); font-size: 13px; }
.d-meta dt { color: var(--ink-3); }
.d-meta dd { margin: 0; }
.rating { display: flex; gap: 2px; margin-bottom: 18px; align-items: center; }
.rating button { border: 0; background: none; padding: 2px; color: var(--line); }
.rating button svg { width: 22px; height: 22px; }
.rating button.on { color: var(--orange); }
.rating button.on svg { fill: currentColor; }
.d-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.panel { margin-top: 22px; padding: 18px 20px; border-radius: 22px; background: var(--surface); box-shadow: var(--raise-sm); }
.panel > h3 { margin: 0 0 12px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; box-shadow: var(--inset); }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.seg button.on { background: var(--surface); box-shadow: var(--raise-sm); color: var(--ink); font-weight: 600; }
.prog-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.prog-form input, .meta-form input, .note-form input, .note-form textarea, .cmt-form input, .cmt-form textarea, .set-form input, .chat-form textarea {
  border: 0; border-radius: 12px; background: var(--bg); box-shadow: var(--inset); padding: 9px 12px; color: var(--ink); outline: none; }
.prog-form input { width: 80px; text-align: center; }
/* AI e-Book 만들기 */
.ebook-maker { grid-column: 1 / -1; padding: 18px 22px 20px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--raise-sm); display: grid; gap: 12px; min-width: 0; }
.ebook-maker .continue-head { flex-wrap: wrap; margin-bottom: 0; }
.eb-sub { color: var(--ink-3); font-size: 12px; }
.eb-modes { display: inline-flex; gap: 4px; padding: 5px; border-radius: 999px; box-shadow: var(--inset); justify-self: start; }
.eb-modes .tab.is-on { background: var(--bg); box-shadow: var(--raise-sm); color: var(--ink); }
.eb-pane { display: grid; gap: 8px; min-width: 0; }
.eb-pane[hidden] { display: none; }
.eb-pane input[type=search], .eb-opts input:not([type=checkbox]), .eb-opts select { width: 100%; min-width: 0; border: 0; border-radius: 12px; background: var(--bg); box-shadow: var(--inset); padding: 10px 14px; color: var(--ink); font: inherit; font-size: 14px; outline: none; }
.eb-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-content: start; gap: 0 6px; max-height: 360px; overflow: auto; padding: 4px; border-radius: 14px; box-shadow: var(--inset); }
.eb-item { display: flex; gap: 8px; align-items: flex-start; padding: 3px 8px; border-radius: 8px; cursor: pointer; min-width: 0; line-height: 1.35; }
.eb-item:hover { background: var(--bg); }
.eb-item input { margin-top: 3px; accent-color: var(--accent); flex: none; }
.eb-item span { display: grid; min-width: 0; }
.eb-item b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eb-item small { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eb-empty { margin: 8px; color: var(--ink-3); font-size: 13px; }
.eb-bar { grid-column: 1 / -1; position: sticky; top: -4px; z-index: 1; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 6px 8px; border-radius: 10px; background: var(--surface); font-size: 12.5px; color: var(--ink-2); }
.eb-bar small { margin-left: auto; color: var(--accent); font-weight: 600; }
.eb-more { font-size: 12.5px; color: var(--ink-3); }
.eb-picked { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--ink-2); }
.eb-picked .chip { font-size: 12.5px; padding: 5px 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eb-count { margin-right: 4px; }
.eb-opts { display: grid; grid-template-columns: 2fr 1fr; gap: 10px 14px; align-items: end; }
.eb-opts label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); min-width: 0; }
.eb-opts .eb-check { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.eb-check input { accent-color: var(--accent); }
.eb-check small { color: var(--ink-3); }
.eb-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.eb-status { font-size: 13px; color: var(--ink-2); }
.eb-frame { border-radius: 18px; overflow: hidden; box-shadow: var(--inset); background: var(--bg); }
.eb-frame[hidden] { display: none; }
.eb-frame-bar { display: flex; gap: 10px; align-items: center; padding: 8px 12px; font-size: 13px; color: var(--ink-2); }
.eb-frame-bar span { flex: 1; color: var(--ink-3); font-size: 12px; }
.eb-frame iframe { display: block; width: 100%; height: min(86vh, 980px); border: 0; background: #fff; }
@media (max-width: 900px) { .eb-results { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .eb-opts { grid-template-columns: 1fr; } .eb-results { grid-template-columns: 1fr; } }
/* ebook 탭 */
.shelf-ebooks { padding: 8px 0 40px; }
.shelf-ebooks[hidden] { display: none; }
.shelf-head h2 { margin: 0 0 6px; font-size: 26px; }
.shelf-head p { margin: 0 0 22px; color: var(--ink-2); font-size: 14px; }
.eb-card { position: relative; }
.eb-card .cover { aspect-ratio: 3/4; }
.eb-card .cover.has-img .gen { visibility: hidden; }
.eb-card .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.eb-tools2 { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: -8px 0 20px; }
.eb-tools2 .eb-q { flex: 1 1 240px; min-width: 0; height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--surface); box-shadow: var(--inset); color: var(--ink); font: inherit; font-size: 14px; }
.eb-tools2 .eb-sort { width: auto; }
.eb-tools2 .eb-cnt { color: var(--ink-3); font-size: 13px; }
.sl-card .cover { aspect-ratio: 16/10; }
.short-card .cover { aspect-ratio: 9/14; } .podcast-card .cover { aspect-ratio: 1/1; }
.short-card .eb-badge { background: #ff3b5c; } .podcast-card .eb-badge { background: #7c5cff; }
.timeline-card .cover { aspect-ratio: 16/10; } .timeline-card .eb-badge { background: #e0812b; }
.eb-play { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: rgba(15,20,36,.6); box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.eb-play::before { content: ""; position: absolute; left: 18px; top: 14px; border-left: 14px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.mini.eb-mini .cover { position: relative; }
.mini.eb-mini .cover.has-img .gen { visibility: hidden; }
.mini.eb-mini .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mini .eb-badge { left: 5px; top: 5px; padding: 1px 6px; font-size: 9px; }
.eb-badge { position: absolute; left: 10px; top: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(20,28,45,.6); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.eb-del { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(20,28,45,.55); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .2s; }
.eb-card:hover .eb-del, .eb-card:focus-within .eb-del { opacity: 1; }
.eb-share { position: absolute; right: 46px; top: 10px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(20,28,45,.55); color: #fff; cursor: pointer; opacity: 0; transition: opacity .2s; }
.eb-share svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.eb-card:hover .eb-share, .eb-card:focus-within .eb-share { opacity: 1; }
@media (hover: none) { .eb-share, .eb-del { opacity: 1; } }
.eb-empty.big { padding: 40px 0; font-size: 15px; text-align: center; }
.ebv-frame { flex: 1; width: 100%; border: 0; background: #fff; }
#ebViewer:not([hidden]) { display: flex; flex-direction: column; }
#ebViewer .viewer-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ebv-tools { flex: none; overflow-x: auto; max-width: 70vw; scrollbar-width: none; }
.ebv-tools .an-tool.ready { color: #fff; box-shadow: inset 0 0 0 1px #5b6578; }
.ebv-tools .an-tool:not(.ready)[data-ebv-cmd="hl"], .ebv-tools .an-tool:not(.ready)[data-ebv-cmd="ul"], .ebv-tools .an-tool:not(.ready)[data-ebv-cmd="memo"] { opacity: .7; }
#ebvBm.is-on { background: #e8576b; color: #fff; }
@media (max-width: 760px) { #ebViewer .viewer-bar { flex-wrap: wrap; } .ebv-tools { order: 3; max-width: 100%; width: 100%; } }

/* 인용·참고문헌·수업 가이드 */
#citeAllBtn { margin-left: 4px; }
.cite-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.cite-row select, .set-form select { border: 0; border-radius: 12px; background: var(--bg); box-shadow: var(--raise-sm); padding: 8px 12px; color: var(--ink); font: inherit; font-size: 13px; }
.cite-text { margin: 0 0 8px; padding: 12px 14px; border-radius: 14px; box-shadow: var(--inset); font-size: 14px; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; user-select: all; }
.guide h4 { margin: 16px 0 8px; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.guide-terms { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 14px; line-height: 1.65; }
.guide-terms dt { font-weight: 700; color: var(--ink); }
.guide-terms dd { margin: 0; color: var(--ink-2); }
.guide-list { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; font-size: 14px; line-height: 1.65; color: var(--ink-2); }
.guide-tip { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
@media (max-width: 560px) { .guide-terms { grid-template-columns: 1fr; } .guide-terms dd { margin-bottom: 6px; } }

/* 도서 정보 편집 (상세 상단) */
.d-edit-btn { margin: -4px 0 14px; }
.d-meta .d-genre { width: auto; min-width: 140px; height: 32px; padding: 0 30px 0 12px; font-size: 13px; }
.d-ocr { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -4px 0 14px; padding: 8px 12px; border-radius: 12px; box-shadow: var(--inset); font-size: 13px; color: var(--ink-2); }
.d-ocr[hidden] { display: none; }
.d-ocr b { color: var(--ink); }
.d-ocr .bad { color: #d6455d; }
.d-ocr .btn { padding: 4px 12px; }
/* OCR 진행: 펼친 책 위로 스캔 빛이 오르내리고, 오른쪽 쪽의 줄이 차례로 읽힌다 */
.ocr-scan { display: inline-flex; align-items: center; }
.ocr-book { position: relative; display: inline-flex; width: 44px; height: 30px; perspective: 80px; }
.ocr-pg { position: relative; flex: 1; border: 1.5px solid var(--teal); background: var(--surface); overflow: hidden; }
.ocr-pg.l { border-radius: 4px 1px 1px 4px; border-right-width: .75px; }
.ocr-pg.r { border-radius: 1px 4px 4px 1px; border-left-width: .75px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 3px; transform-origin: left center; animation: ocrFlip 2.4s ease-in-out infinite; }
.ocr-pg.l::before { content: ""; position: absolute; left: 3px; right: 3px; top: 5px; height: 1.5px; background: var(--ink-3); box-shadow: 0 4px 0 var(--ink-3), 0 8px 0 var(--ink-3), 0 12px 0 var(--ink-3); opacity: .5; }
.ocr-pg.r b { display: block; height: 1.5px; background: var(--ink-3); opacity: .35; animation: ocrLine 1.2s linear infinite; }
.ocr-pg.r b:nth-child(2) { animation-delay: .2s; } .ocr-pg.r b:nth-child(3) { animation-delay: .4s; } .ocr-pg.r b:nth-child(4) { animation-delay: .6s; } .ocr-pg.r b:nth-child(5) { animation-delay: .8s; width: 60%; }
.ocr-beam { position: absolute; left: -3px; right: -3px; top: 0; height: 3px; border-radius: 2px; background: linear-gradient(90deg, transparent, var(--teal), transparent); box-shadow: 0 0 8px 2px rgba(34,182,154,.55); animation: ocrBeam 1.2s ease-in-out infinite alternate; }
@keyframes ocrBeam { from { top: -1px; } to { top: calc(100% - 2px); } }
@keyframes ocrLine { 0%, 100% { opacity: .3; } 40% { opacity: 1; background: var(--teal); } }
@keyframes ocrFlip { 0%, 80%, 100% { transform: rotateY(0); } 90% { transform: rotateY(-70deg); } }
.ocr-bar { display: inline-block; width: 90px; height: 6px; border-radius: 999px; background: rgba(120,130,150,.18); overflow: hidden; vertical-align: middle; }
.ocr-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--teal), #4f9df0); transition: width .6s ease; }
@media (prefers-reduced-motion: reduce) { .ocr-beam, .ocr-pg.r, .ocr-pg.r b { animation: none; } .ocr-beam { top: 45%; } }
.ocr-sum { font-size: 12px; color: var(--ink-2); line-height: 1.6; }
.d-edit-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.d-edit { display: grid; gap: 12px; margin-bottom: 18px; padding: 16px 18px; border-radius: 20px; box-shadow: var(--inset); }
.d-edit[hidden], .d-view[hidden] { display: none; }
.d-edit .eyebrow small { font-weight: 500; letter-spacing: 0; }
.d-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.d-edit-grid label { display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); min-width: 0; }
.d-edit-grid .span2 { grid-column: 1 / -1; }
.d-edit-grid input { width: 100%; min-width: 0; border: 0; border-radius: 12px; background: var(--bg); box-shadow: var(--raise-sm); padding: 9px 12px; color: var(--ink); font: inherit; font-size: 14px; outline: none; }
.d-edit-grid input:focus { box-shadow: 0 0 0 2px var(--accent); }
.d-edit .row { display: flex; gap: 8px; }
@media (max-width: 560px) { .d-edit-grid { grid-template-columns: 1fr; } }
.meta-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-top: 10px; }
.meta-form label { display: grid; gap: 4px; }
.meta-form .wide { flex-basis: 100%; }
.meta-form .wide input { width: 100%; }
.meta-form input { width: 170px; }
.shelf-picks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.shelf-picks label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--bg); box-shadow: var(--raise-sm); cursor: pointer; }
.shelf-picks input { accent-color: var(--teal); }
.vol-row, .similar-row { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 8px; }
.vol-row .mini, .similar-row .mini { width: 78px; }
.vol-row .mini .cover, .similar-row .mini .cover { width: 78px; }
.mini.current .cover { outline: 3px solid var(--teal); outline-offset: 2px; }

/* notes */
.note-form { display: grid; grid-template-columns: 100px 1fr; gap: 8px; }
.note-form textarea { grid-column: 1 / -1; resize: vertical; }
.note-form .row { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.note-form select { border: 0; border-radius: 12px; background: var(--bg); box-shadow: var(--inset); padding: 7px 10px; }
.note-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.note { padding: 12px 14px; border-radius: 16px; background: var(--bg); box-shadow: var(--inset); }
.note.quote p { font-style: italic; border-left: 3px solid var(--pink); padding-left: 10px; }
.note header { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--ink-3); }
.note header button { margin-left: auto; border: 0; background: none; color: var(--ink-3); font-size: 12px; }
.note p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }

/* comments */
.comments h3 span { color: var(--ink-3); font-size: 14px; font-weight: 500; }
.cmt-form { display: grid; grid-template-columns: 170px 1fr; gap: 8px; }
.cmt-form textarea { grid-column: 1 / -1; resize: vertical; }
.cmt-form button { grid-column: 2; justify-self: end; }
.cmt-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.cmt { padding: 12px 14px; border-radius: 16px; background: var(--bg); box-shadow: var(--inset); }
.cmt header { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.cmt header strong { font-weight: 600; }
.cmt header time { color: var(--ink-3); font-size: 12px; }
.cmt header .shared { font-size: 11px; color: var(--teal); }
.cmt header button { margin-left: auto; border: 0; background: none; color: var(--ink-3); font-size: 12px; }
.cmt p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.cmt-empty { color: var(--ink-3); font-size: 14px; }

/* AI insight */
.conf { font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 999px; color: #fff; background: var(--blue); }
.conf.hi { background: var(--teal); }
.conf.lo { background: var(--orange); }
.ins-sum { margin: 0 0 10px; color: var(--ink-2); font-size: 14px; }
.ins { margin: 0; display: grid; gap: 4px 0; font-size: 14px; line-height: 1.75; }
.ins dt { font-weight: 700; font-size: 12px; margin-top: 6px; color: var(--teal); }
.ins dd { margin: 0; }
.ins-kw { margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ins-kw span { font-size: 12px; color: var(--ink-2); background: var(--bg); box-shadow: var(--raise-sm); padding: 3px 10px; border-radius: 999px; }
.ins-note { margin: 10px 0 0; font-size: 11px; color: var(--ink-3); }

/* authors */
.author-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; padding-top: 18px; }
.a-card { display: flex; gap: 14px; align-items: center; text-align: left; padding: 16px; border: 0; border-radius: var(--radius); background: var(--surface); box-shadow: var(--raise-sm); color: inherit; transition: transform .2s, box-shadow .2s; }
.a-card:hover { transform: translateY(-3px); box-shadow: var(--raise); }
.a-card strong { display: block; font-weight: 600; font-size: 16px; line-height: 1.3; }
.a-card span { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.a-card .badge { margin-left: auto; flex: none; font-size: 12px; color: var(--ink-2); box-shadow: var(--inset); border-radius: 999px; padding: 3px 10px; }
.a-avatar { flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 46% 54% 42% 58% / 55% 45% 55% 45%; background: var(--c1, var(--accent)); color: #fff; font-weight: 700; font-size: 19px; box-shadow: 0 8px 16px -8px rgba(30,40,70,.5); }
.author-page { padding: 34px; }
.a-head { display: flex; gap: 20px; align-items: center; padding-right: 44px; }
.a-head .a-avatar { width: 84px; height: 84px; font-size: 32px; }
.a-head h2 { margin: 0; font-size: 32px; font-weight: 700; }
.a-orig { margin: 2px 0 0; color: var(--ink-2); }
.a-bio { margin: 20px 0 14px; font-size: 15px; line-height: 1.8; max-width: 70ch; }
.a-bio.muted { color: var(--ink-3); }
/* 저자 정보: 상세 상자·저자 페이지 */
.author-box .ab-head { display: flex; align-items: center; gap: 14px; margin: 4px 0 12px; }
.author-box .ab-head .a-avatar { width: 44px; height: 44px; font-size: 17px; }
.author-box .ab-head strong { display: block; font-size: 16px; }
.author-box .ab-short { display: block; font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.author-box .ab-head small { display: block; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.author-box .ab-bio { margin: 0 0 12px; font-size: 14px; line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.author-box h4, .a-block h4 { margin: 14px 0 8px; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.author-box .btn { margin-top: 12px; }
.works, .awards { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.works li { display: flex; gap: 10px; align-items: baseline; min-width: 0; }
.works time { flex: none; width: 3.2em; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.awards li::before { content: '· '; color: var(--ink-3); }
.a-more { display: grid; gap: 4px; max-width: 70ch; margin-bottom: 20px; }
.a-more:empty { display: none; }
.a-block p { margin: 0; font-size: 14.5px; line-height: 1.75; color: var(--ink-2); }
.a-links { margin: -6px 0 14px; font-size: 12.5px; color: var(--ink-3); }
.a-links a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.a-links a:hover { color: var(--ink); }
.a-actions { display: flex; gap: 8px; }
.a-sub { margin: 28px 0 14px; font-size: 18px; }
.timeline { list-style: none; margin: 0; padding: 20px 18px; position: relative; border-radius: 22px; background: var(--surface); box-shadow: var(--raise-sm); }
.timeline::before { content: ""; position: absolute; left: 84px; top: 28px; bottom: 28px; width: 3px; border-radius: 3px; background: var(--grad); opacity: .35; }
.timeline li { position: relative; display: grid; grid-template-columns: 56px 1fr; gap: 30px; padding: 7px 0; }
.timeline li::before { content: ""; position: absolute; left: 59px; top: 13px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg); box-shadow: var(--raise-sm); }
.timeline li.book::before { background: var(--pink); box-shadow: 0 4px 10px -3px rgba(239,93,146,.8); }
.timeline li.life-edge::before { background: var(--teal); box-shadow: 0 4px 10px -3px rgba(34,182,154,.8); }
.timeline time { font-weight: 700; font-size: 14px; color: var(--ink-2); text-align: right; }
.timeline .ev { font-size: 14px; line-height: 1.6; }
.timeline .ev small { color: var(--ink-3); margin-left: 6px; }
.tl-book { border: 0; background: none; padding: 0; color: var(--pink); font-weight: 600; text-align: left; }
.undated { margin-top: 20px; }
.undated h4 { margin: 0 0 10px; font-size: 13px; color: var(--ink-3); font-weight: 600; }
.undated-list { display: flex; flex-wrap: wrap; gap: 8px; }
.undated-list .chip { font-size: 13px; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; padding-top: 18px; }
.stat { padding: 20px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--raise-sm); min-width: 0; }
.stat.kpi { display: flex; align-items: center; gap: 14px; }
.stat .ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: 0 8px 16px -6px rgba(0,0,0,.25); }
.stat .ico svg { width: 22px; height: 22px; }
.stat .num { font-size: 28px; font-weight: 700; line-height: 1; }
.stat .lbl { font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.stat.wide { grid-column: span 2; }
.stat.full { grid-column: 1 / -1; }
.stat h3 { margin: 0 0 14px; font-size: 17px; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding: 0 4px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { width: 100%; max-width: 30px; border-radius: 10px 10px 4px 4px; background: var(--grad); min-height: 3px; }
.bars .b span { font-size: 11px; color: var(--ink-3); }
.bars .b em { font-style: normal; font-size: 11px; color: var(--ink-2); font-weight: 600; }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: 110px 1fr 36px; gap: 10px; align-items: center; font-size: 13px; }
.hbar .t { box-shadow: var(--inset); border-radius: 999px; height: 12px; overflow: hidden; }
.hbar .t i { display: block; height: 100%; border-radius: inherit; }
.hbar span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar span:last-child { text-align: right; color: var(--ink-3); }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; border-radius: 50%; position: relative; box-shadow: var(--raise-sm); flex: none; }
.donut::after { content: attr(data-label); position: absolute; inset: 28px; border-radius: 50%; background: var(--surface); box-shadow: var(--inset); display: grid; place-items: center; font-weight: 700; font-size: 20px; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.stat-note { font-size: 12px; color: var(--ink-3); margin: 10px 0 0; }

/* viewer */
.viewer { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: #1f232a; }
.viewer-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #262b33; color: #e6eaf2; }
.viewer-bar .icon-btn { background: #2b313b; box-shadow: none; color: #e6eaf2; width: 40px; height: 40px; }
.viewer-bar .icon-btn[aria-pressed="true"] { color: var(--pink); }
.viewer-bar .btn { color: #e6eaf2; }
.viewer-bar .pg { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #aab3c4; }
.viewer-bar .pg input { width: 64px; height: 32px; border: 0; border-radius: 10px; background: #1c2027; color: #fff; text-align: center; }
.viewer-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; white-space: nowrap; overflow: hidden; }
.viewer-title strong { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
.viewer-title span { font-size: 13px; color: #8f98ab; overflow: hidden; text-overflow: ellipsis; }
.viewer-stage { position: relative; flex: 1; }
.viewer-stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #2a2f38; }
.viewer-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; color: #aab3c4; text-align: center; z-index: 1; pointer-events: none; transition: opacity .3s; }
.viewer-loading.done { opacity: 0; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #353b46; border-top-color: var(--teal); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* chat */
.chat { display: flex; flex-direction: column; height: min(660px, calc(100vh - 80px)); padding: 30px; }
.chat h2 { margin: 0 0 4px; font-size: 24px; padding-right: 44px; }
.chat-sub { margin: 0; color: var(--ink-3); font-size: 13px; }
.chat-log { flex: 1; overflow-y: auto; margin: 16px 0; padding: 16px; border-radius: 20px; box-shadow: var(--inset); display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.user { align-self: flex-end; background: var(--grad); color: #fff; border-bottom-right-radius: 6px; }
.msg.ai { align-self: flex-start; background: var(--surface); box-shadow: var(--raise-sm); border-bottom-left-radius: 6px; }
.msg.sys { align-self: center; font-size: 12px; color: var(--ink-3); text-align: center; max-width: 100%; }
.chat-sugs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chat-sugs .chip { font-size: 12px; padding: 5px 12px; }
.chat-form { display: flex; gap: 10px; align-items: flex-end; }
.chat-form textarea { flex: 1; resize: none; min-height: 46px; max-height: 140px; }

/* settings */
.settings { padding: 30px; }
.settings h2 { margin: 0 0 6px; font-size: 26px; }
.set-form { display: grid; gap: 16px; margin-top: 18px; }
.set-form fieldset { border: 0; margin: 0; padding: 16px 18px; border-radius: 20px; background: var(--surface); box-shadow: var(--raise-sm); display: grid; gap: 10px; }
.set-form legend { font-weight: 700; padding: 0; margin-bottom: 6px; float: left; width: 100%; }
.set-form label { display: grid; gap: 4px; font-size: 13px; color: var(--ink-2); }
.set-form small { color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.set-form textarea { width: 100%; box-sizing: border-box; border: 0; border-radius: 12px; background: var(--bg); box-shadow: var(--inset); padding: 9px 12px; color: var(--ink); font: inherit; font-size: 13px; resize: vertical; }
.set-form .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.set-status { font-size: 12px; color: var(--teal); }

.foot { max-width: 1280px; margin: 0 auto; padding: 26px 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink-3); }
.foot p { margin: 0; }
.foot-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--bg); padding: 11px 20px; border-radius: 999px; font-size: 14px; box-shadow: 0 16px 30px -12px rgba(0,0,0,.5); }

@media (max-width: 960px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat.wide { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .top-inner { padding: 12px 16px; gap: 10px; flex-wrap: wrap; }
  .search { order: 3; max-width: none; flex-basis: 100%; }
  .tabs { order: 4; flex-basis: 100%; margin-left: 0; justify-content: space-between; }
  .tab { flex: 1; padding: 6px 8px; font-size: 13px; }
  .brand { margin-right: auto; }
  .icon-btn { width: 40px; height: 40px; }
  main { padding: 0 16px 32px; }
  .hero { grid-template-columns: 1fr; padding-top: 22px; }
  .hero-art { height: 220px; }
  .hero-books .cover { width: 80px; }
  .hero-books .cover:nth-child(2) { width: 92px; }
  .count-badge { width: 84px; height: 84px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 14px; }
  .card { padding: 10px 10px 12px; border-radius: 18px; }
  .card .fav { top: 16px; right: 16px; }
  .detail { grid-template-columns: 1fr; padding: 22px 16px; }
  .detail-cover { width: 220px; }
  .count { margin-left: 0; flex-basis: 100%; }
  .cmt-form { grid-template-columns: 1fr; }
  .cmt-form button { grid-column: 1; }
  .viewer-title span, .viewer-bar .pg span { display: none; }
  .sheet { max-height: calc(100vh - 16px); width: calc(100vw - 16px); border-radius: 24px; }
  .stats { grid-template-columns: 1fr; }
  .stat.wide { grid-column: auto; }
  .author-page, .chat, .settings { padding: 22px 16px; }
  .timeline::before { left: 66px; }
  .timeline li { grid-template-columns: 42px 1fr; gap: 26px; }
  .timeline li::before { left: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* pdf.js viewer (large files) */
.pdfjs { position: absolute; inset: 0; overflow: auto; background: #2a2f38; outline: none; }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 12px 60px; }
.pdf-page { position: relative; background: #fff; box-shadow: 0 10px 30px -12px rgba(0,0,0,.6); border-radius: 4px; overflow: hidden; }
.pdf-page canvas { display: block; width: 100%; height: 100%; }
/* 읽기 도구 */
.an-bar { display: flex; align-items: center; gap: 10px; padding: 6px 14px; background: #262b33; color: #c9d1de; font-size: 13px; overflow-x: auto; }
.an-tools { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.an-tools[hidden], .an-hint[hidden] { display: none; }
.an-tool { border: 0; background: transparent; color: #c9d1de; padding: 6px 10px; border-radius: 10px; font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer; }
.an-tool:hover { background: #333a45; }
.an-tool.is-on { background: #3d4654; color: #fff; box-shadow: inset 0 0 0 1px #5b6578; }
.an-tool b { color: #ffd54a; font-weight: 700; }
.an-colors { display: inline-flex; gap: 6px; margin: 0 4px; }
.an-color { width: 20px; height: 20px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; }
.an-color.is-on { border-color: #fff; box-shadow: 0 0 0 2px #262b33; }
.an-hint { margin: 0; color: #9aa4b5; white-space: nowrap; }
.an-hint .link-btn { color: #ffd54a; text-decoration: underline; background: none; border: 0; cursor: pointer; font: inherit; padding: 0; }
.an-layer { position: absolute; inset: 0; z-index: 2; }
.pdfjs.an-drawing .an-layer { cursor: crosshair; touch-action: none; }
.pdfjs.an-drawing .pdf-page { user-select: none; }
.an { position: absolute; cursor: pointer; }
.an-hl { background: var(--c); opacity: .38; mix-blend-mode: multiply; border-radius: 2px; }
.an-hl:hover { opacity: .55; }
.an-ul { height: 0 !important; border-bottom: 3px solid var(--c); margin-top: -2px; padding-top: 6px; transform: translateY(-6px); }
.an-draft.an-ul { height: auto !important; border-bottom: 3px solid var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); padding: 0; transform: none; margin: 0; }
.an-memo { width: 0; height: 0; }
.an-pin { position: absolute; transform: translate(-50%, -100%); font-size: 20px; line-height: 1; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.an-hl .an-pin, .an-ul .an-pin { right: -6px; top: -4px; transform: none; font-size: 14px; opacity: 1; }
.pdf-page.has-bm::after { content: ''; position: absolute; right: 22px; top: 0; z-index: 3; width: 18px; height: 34px; background: #e8576b; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%); box-shadow: 0 2px 4px rgba(0,0,0,.3); }
.an-pop { position: absolute; z-index: 20; width: 280px; padding: 12px; border-radius: 14px; background: #fff; color: #26334d; box-shadow: 0 18px 40px -12px rgba(0,0,0,.55); display: grid; gap: 8px; }
.an-pop-h { margin: 0; font-size: 12.5px; color: #5b6475; }
.an-pop textarea { width: 100%; border: 1px solid #dfe4ec; border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 13.5px; resize: vertical; outline: none; }
.an-pop textarea:focus { border-color: #22b69a; }
.an-pop-row { display: flex; align-items: center; gap: 6px; }
.an-pop-row .sp { flex: 1; }
.an-pop .an-color.is-on { border-color: #26334d; box-shadow: none; }
.an-panel { position: absolute; right: 0; top: 0; bottom: 0; z-index: 15; width: min(320px, 86vw); overflow: auto; padding: 12px 14px 20px; background: #1f232a; color: #d6dce6; box-shadow: -10px 0 30px -12px rgba(0,0,0,.6); }
.an-ph { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 15px; }
.an-ph .icon-btn { width: 32px; height: 32px; background: #2a2f38; color: #d6dce6; box-shadow: none; font-size: 18px; }
.an-panel h4 { margin: 16px 0 6px; font-size: 12px; color: #8f98ab; font-weight: 600; }
.an-panel h4 small { margin-left: 4px; color: #ffd54a; }
.an-row { display: flex; align-items: flex-start; gap: 4px; width: 100%; }
.an-row > button:first-child, button.an-row { flex: 1; min-width: 0; text-align: left; border: 0; background: transparent; color: inherit; padding: 6px 8px; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; display: block; }
.an-row > button:first-child:hover, button.an-row:hover { background: #2a2f38; }
button.an-row span { margin-left: 8px; color: #8f98ab; font-size: 12px; }
.an-note { display: block; margin-top: 2px; color: #aab3c4; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--c); margin-right: 6px; }
.an-x { border: 0; background: transparent; color: #8f98ab; font-size: 16px; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.an-x:hover { background: #2a2f38; color: #fff; }
.an-none { margin: 4px 8px; color: #8f98ab; font-size: 12.5px; line-height: 1.6; }
.an-foot { margin: 18px 8px 0; color: #6f7889; font-size: 11.5px; line-height: 1.6; }
@media (max-width: 640px) { .an-tool { padding: 6px 8px; } }
.pdf-page .pn { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: #8f98ab; background: rgba(255,255,255,.8); padding: 0 6px; border-radius: 6px; }
.viewer-bar .zoom { display: inline-flex; gap: 6px; }
.viewer-bar #vMode { color: #9fe0d1; }
.viewer-err { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: #c9d1de; text-align: center; padding: 20px; z-index: 2; }

/* Claude API key + insight actions */
.key-state { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 12px; border-radius: 12px; box-shadow: var(--inset); }
.key-state::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex: none; }
.key-state.on::before { background: var(--teal); box-shadow: 0 0 0 3px rgba(34,182,154,.2); }
.key-state.off::before { background: var(--orange); }
.key-state code { font-size: 12px; }
.set-status.err, .set-status.bad { color: #d0476b; }
.ins-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.ins-actions small { color: var(--ink-3); font-size: 12px; }
.ins-empty { margin: 0; color: var(--ink-2); font-size: 14px; }
.spin-sm { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .8s linear infinite; vertical-align: -2px; }

/* detail actions: never overflow the dialog */
.detail > *, .detail-body { min-width: 0; }
.sheet { overflow-x: hidden; }
.d-actions { flex-wrap: wrap; row-gap: 10px; }
.d-actions .btn { flex: 0 1 auto; }
.d-actions .btn.ghost { padding: 0 12px; }
@media (max-width: 1100px) {
  .detail { grid-template-columns: 220px 1fr; gap: 24px; }
  .d-actions .btn { height: 40px; padding: 0 14px; font-size: 13px; }
}
@media (max-width: 760px) {
  .detail { grid-template-columns: 1fr; }
}

/* version under brand + footer credit */
.brand-text { display: flex; flex-direction: column; line-height: 1; gap: 3px; }
.brand-ver { font-size: 10px; font-weight: 600; letter-spacing: .04em; color: var(--ink-3); }
.foot-credit { flex-basis: 100%; margin-top: 6px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 6px; text-align: center; }
.foot-credit p { margin: 0; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.foot-links a { color: var(--accent); text-decoration: none; font-weight: 500; }
.foot-links a:hover { text-decoration: underline; }

/* 설정: YouTube 리디렉션 URI 줄 */
#ytField label .row { display: flex; gap: 8px; width: 100%; }
#ytRedirect { flex: 1; min-width: 0; }

/* AI 만들기: 가로 탭 */
.ai-makers { grid-column: 1 / -1; padding: 16px 22px 20px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--raise-sm); min-width: 0; }
.aim-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.aim-head h3 { margin: 0; font-size: 17px; font-weight: 500; }
.aim-tabs { display: flex; gap: 4px; margin-left: auto; padding: 5px; border-radius: 999px; background: var(--bg); box-shadow: var(--inset); overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.aim-tab { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border: 0; background: none; padding: 8px 18px; border-radius: 999px; color: var(--ink-2); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; transition: background .2s, box-shadow .2s, color .2s; }
.aim-tab:hover { color: var(--ink); }
.aim-tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--raise-sm); font-weight: 700; }
.aim-ic { font-size: 13px; line-height: 1; }
.ai-makers .aim-panel { padding: 0; background: none; box-shadow: none; border-radius: 0; }
.ai-makers .aim-panel[hidden] { display: none; }
.ai-makers .aim-panel .continue-head h3, .ai-makers .aim-panel .continue-head .dots { display: none; }
.ai-makers .aim-panel .eb-sub { font-size: 13px; }
@media (max-width: 640px) { .aim-tabs { margin-left: 0; width: 100%; } .aim-tab { flex: 1; justify-content: center; padding: 7px 10px; font-size: 13px; } .aim-ic { display: none; } }

/* YouTube · Podcast 카드 안 재생 */
.eb-card.playing .gen, .eb-card.playing .eb-play { visibility: hidden; }
.eb-embed { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: #000; border-radius: inherit; overflow: hidden; }
.eb-embed video, .eb-embed iframe { width: 100%; height: 100%; border: 0; background: #000; object-fit: contain; }
.podcast-card .eb-embed { background: linear-gradient(160deg, #2a1f5c, #0f1424); }
.podcast-card .eb-embed::before { content: ""; width: 46%; aspect-ratio: 1; border-radius: 50%; background: conic-gradient(#7c5cff, #2bd4c5, #ff7aa8, #7c5cff); animation: ebspin 8s linear infinite; margin-bottom: 40px; }
.eb-embed audio { position: absolute; left: 8px; right: 8px; bottom: 10px; width: calc(100% - 16px); height: 36px; }
.eb-embed-x, .eb-embed-win { position: absolute; top: 8px; z-index: 3; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; text-decoration: none; }
.eb-embed-x { right: 8px; } .eb-embed-win { right: 42px; font-size: 13px; }
@keyframes ebspin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .podcast-card .eb-embed::before { animation: none; } }

/* 카드 공유: 늘 보이는 단추 + 주소 창 */
.eb-sharebtn { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; padding: 5px 12px; border: 0; border-radius: 999px; background: var(--bg); box-shadow: var(--raise-sm); color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.eb-sharebtn:hover { color: var(--teal); }
.eb-sharebtn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.eb-sharepop { position: absolute; left: 8px; right: 8px; bottom: 8px; z-index: 5; display: grid; gap: 6px; padding: 12px; border-radius: 14px; background: var(--surface); box-shadow: 0 12px 30px rgba(20,30,50,.22); cursor: default; }
.eb-sharepop b { font-size: 13px; } .eb-sharepop small { color: var(--ink-3); font-size: 11px; }
.eb-sharepop input { width: 100%; min-width: 0; padding: 7px 10px; border: 0; border-radius: 10px; background: var(--bg); box-shadow: var(--inset); color: var(--ink); font: 12px/1.3 ui-monospace, Menlo, Consolas, monospace; }
.eb-sharepop .sp-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.eb-sharepop .sp-row button, .eb-sharepop .sp-row a { padding: 5px 10px; border: 0; border-radius: 999px; background: var(--bg); box-shadow: var(--raise-sm); color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; text-decoration: none; cursor: pointer; }
.eb-sharepop .sp-row [data-sp="copy"] { background: var(--teal); color: #fff; }
.eb-sharepop .sp-row [data-sp="yt"] { background: #ff3b5c; color: #fff; }
.eb-sharepop .sp-row [data-sp="close"] { margin-left: auto; width: 26px; padding: 4px 0; text-align: center; }

/* 공유 창: QR · 조회 수 · 공개 */
.eb-sharepop .sp-main { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: start; }
.eb-sharepop .sp-qr { width: 92px; height: 92px; padding: 0; border: 0; border-radius: 10px; background: #fff; box-shadow: var(--raise-sm); cursor: pointer; display: grid; place-items: center; overflow: hidden; }
.eb-sharepop .sp-qr svg { width: 100%; height: 100%; display: block; }
.eb-sharepop .sp-qr i { font-size: 11px; color: var(--ink-3); font-style: normal; }
.eb-sharepop .sp-side { display: grid; gap: 6px; min-width: 0; }
.eb-sharepop .sp-views { font-size: 11.5px; color: var(--ink-2); }
.eb-sharepop .sp-pub { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; cursor: pointer; }
.eb-sharepop .sp-row .sp-rot { color: var(--ink-3); }
.eb-stat { display: flex; gap: 8px; align-items: center; margin: 4px 0 0; font-size: 12px; color: var(--ink-3); }
.eb-pubmark { padding: 1px 8px; border-radius: 999px; background: var(--teal); color: #fff; font-size: 11px; font-weight: 700; }
.eb-pubtools { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.eb-pubtools small { opacity: .7; }
/* 책별 묶음 */
.eb-bundles { margin: 0 0 18px; padding: 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--raise-sm); }
.eb-bundles .bd-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.eb-bundles .bd-head small { color: var(--ink-3); }
.eb-bundles .bd-head .sp { flex: 1; }
.eb-bundles .bd-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.eb-bundles .bd-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.eb-bundles .bd-list li b { flex: 1 1 200px; }
.eb-bundles .bd-list li small { color: var(--ink-3); }
.eb-bundles .bd-pub { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; }
.eb-bundles .bd-edit { display: grid; gap: 10px; }
.eb-bundles .bd-edit label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; }
.eb-bundles .bd-edit input[type=text], .eb-bundles .bd-edit textarea, .eb-bundles #bdQ { padding: 8px 10px; border: 0; border-radius: 10px; background: var(--bg); box-shadow: var(--inset); font: inherit; color: var(--ink); }
.eb-bundles .bd-pick-h { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.eb-bundles .bd-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; max-height: 320px; overflow: auto; padding: 2px; }
.eb-bundles .bd-pick label { display: flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 10px; background: var(--bg); font-weight: 500; cursor: pointer; flex-direction: row; }
.eb-bundles .bd-pick label.on { box-shadow: inset 0 0 0 2px var(--teal); }
.eb-bundles .bd-pick label small { color: var(--ink-3); margin-left: auto; white-space: nowrap; }
.eb-bundles .bd-pick .eb-badge { position: static; flex: none; }
/* OCR 여러 권 */
.ocr-batch { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--bg); display: grid; gap: 6px; }
.ocr-batch small { color: var(--ink-3); }
.ocr-batch .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* 공유 창은 카드 폭에 끼지 않게 화면 가운데에 */
.eb-sharepop { position: fixed; left: 50%; top: 50%; right: auto; bottom: auto; transform: translate(-50%, -50%); width: min(400px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; z-index: 1000; padding: 16px; box-shadow: 0 24px 60px rgba(20,30,50,.35); }
.eb-sharepop .sp-main { grid-template-columns: 120px minmax(0, 1fr); }
.eb-sharepop .sp-qr { width: 120px; height: 120px; }
.eb-sharepop .sp-qr svg path, .eb-sharepop .sp-qr svg rect { stroke: none; }
.eb-sharepop .sp-pub input, .eb-bundles input[type=checkbox], .eb-bundles .bd-pub input { width: auto; flex: none; margin: 0; box-shadow: none; padding: 0; }

/* 백업 · 제작비 · 예약 */
.set-form .chk { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; }
.set-form .chk input { width: auto; margin: 0; box-shadow: none; padding: 0; }
.bk-log { margin: 0; padding: 0 0 0 16px; font-size: 12px; color: var(--ink-3); display: grid; gap: 2px; }
.bk-log li.bad { color: #d9534f; }
.cost-total { font-size: 16px; }
.cost-bars { display: flex; align-items: flex-end; gap: 2px; height: 44px; }
.cost-bars i { flex: 1; max-width: 14px; background: var(--teal); border-radius: 3px 3px 0 0; opacity: .8; }
.cost-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cost-table th, .cost-table td { text-align: left; padding: 5px 6px; border-bottom: 1px solid rgba(127,127,127,.18); }
.cost-table td:last-child, .cost-table th:last-child { text-align: right; font-weight: 700; }
.cost-grid, .sch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin: 8px 0; }
.cost-grid label, .sch-grid label { display: grid; gap: 3px; font-size: 12px; }
.cost-prices summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.sched-run { position: fixed; right: 16px; bottom: 16px; z-index: 2000; width: min(420px, calc(100vw - 32px)); height: min(720px, calc(100vh - 32px)); display: grid; grid-template-rows: auto 1fr;
  border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: 0 24px 60px rgba(20,30,50,.35); }
.sched-bar { padding: 10px 14px; display: grid; gap: 2px; font-size: 12px; background: var(--teal); color: #fff; }
.sched-bar b { font-size: 14px; }
.sched-run iframe { width: 100%; height: 100%; border: 0; background: #fff; }
