@font-face {
    font-family: 'TomeWizard UI';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: local('Segoe UI'), local('system-ui');
}

:root {
    --bg: #09090b;
    --surface: #131316;
    --surface-2: #1c1c21;
    --border: rgba(255, 255, 255, 0.08);
    --text: #fafafa;
    --muted: #a1a1aa;
    --accent: #f0b429;
    --accent-dim: rgba(240, 180, 41, 0.15);
    --cyan: #38bdf8;
    --purple: #a78bfa;
    --danger: #f87171;
    --radius: 12px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --font: 'Outfit', 'TomeWizard UI', system-ui, sans-serif;
    --serif: 'Instrument Serif', Georgia, serif;
}

body.light-mode {
    --bg: #f4f4f5;
    --surface: #ffffff;
    --surface-2: #f4f4f5;
    --border: rgba(0, 0, 0, 0.08);
    --text: #18181b;
    --muted: #71717a;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-shell { max-width: 960px; margin: 0 auto; padding: 12px 14px 48px; }

/* Magical logo header */
.site-header {
    margin-bottom: 18px; border-radius: 18px; overflow: hidden;
    border: 1px solid var(--border); box-shadow: var(--shadow);
    background: var(--surface);
}
.logo-stage {
    position: relative; line-height: 0; background: #0a0612;
    height: auto; overflow: hidden;
}
.logo-hero {
    display: block; width: 100%; height: auto; margin: 0;
}
.logo-stage::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, transparent 82%, var(--surface) 100%);
}
.logo-sparkle {
    position: absolute; inset: 0; pointer-events: none; opacity: 0.25;
    background: radial-gradient(ellipse 90% 60% at 50% 42%, rgba(240, 180, 41, 0.18), transparent 70%);
}
.header-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; padding: 10px 14px; flex-wrap: wrap;
}
.header-bar .user-chip { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.top-actions { display: flex; gap: 8px; flex-shrink: 0; margin-left: auto; }

.auth-logo-wrap { margin-bottom: 16px; border-radius: 12px; overflow: hidden; line-height: 0; }
.auth-logo-wrap img { display: block; width: 100%; height: auto; }

.top-bar { display: none; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.icon-btn {
    padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface); color: var(--muted); font-size: 0.8rem; font-weight: 600;
    cursor: pointer; transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-btn:hover { border-color: var(--accent); color: var(--text); }

.panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 22px 20px; box-shadow: var(--shadow);
}

#auth-modal {
    position: fixed; inset: 0; z-index: 9999; background: var(--bg);
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.auth-card {
    width: 100%; max-width: 380px; background: var(--surface);
    border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px;
    text-align: center;
}
.auth-card .brand { justify-content: center; margin-bottom: 20px; }
.auth-card h2 { font-family: var(--serif); font-size: 1.65rem; font-weight: 400; margin-bottom: 6px; }
.auth-card p { color: var(--muted); font-size: 0.88rem; margin-bottom: 20px; }
.auth-input {
    width: 100%; padding: 12px 14px; margin: 6px 0; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
    font-size: 0.95rem; outline: none;
}
.auth-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.google-btn {
    width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface-2); font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 0.75rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.toggle-auth { margin-top: 14px; font-size: 0.8rem; color: var(--muted); cursor: pointer; }
.toggle-auth:hover { color: var(--accent); }

#main-app { display: none; }

.hero {
    margin-bottom: 22px; padding: 20px 18px; border-radius: 14px;
    background: linear-gradient(135deg, var(--accent-dim) 0%, transparent 55%);
    border: 1px solid var(--border);
}
.hero h1 {
    font-family: var(--serif); font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 400;
    line-height: 1.2; margin-bottom: 8px; letter-spacing: -0.02em;
}
.hero p { color: var(--muted); font-size: 0.92rem; max-width: 54ch; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
    font-size: 0.7rem; font-weight: 600; padding: 5px 10px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}

.tabs {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
    padding: 5px; background: var(--surface-2); border-radius: 12px; margin-bottom: 22px;
}
.tab {
    padding: 11px 8px; border: none; border-radius: 9px; background: transparent;
    color: var(--muted); font-family: inherit; font-size: 0.78rem; font-weight: 600;
    cursor: pointer; transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.tab small { display: block; font-size: 0.62rem; font-weight: 500; margin-top: 2px; opacity: 0.85; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.step-bar {
    display: flex; align-items: center; gap: 6px; margin-bottom: 22px;
}
.step-dot {
    flex: 1; height: 4px; border-radius: 99px; background: var(--surface-2);
    transition: background 0.2s var(--ease);
}
.step-dot.on { background: var(--accent); }
.step-label { font-size: 0.72rem; color: var(--muted); font-weight: 600; white-space: nowrap; margin-left: 8px; }

label.q {
    display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 4px;
}
label.q span { display: block; font-weight: 500; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

.form-block { margin-bottom: 24px; }
.pill-scroll { max-height: 220px; overflow-y: auto; overscroll-behavior: contain; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills input { display: none; position: absolute; opacity: 0; pointer-events: none; }
.pills label,
label.pill {
    padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--muted); font-size: 0.8rem; font-weight: 600;
    cursor: pointer; transition: border-color 0.12s, background 0.12s, color 0.12s;
    user-select: none; display: inline-block;
}
.pills label:hover { color: var(--text); }
.pills input:checked + label,
.pills input[type="radio"]:checked + label.pill {
    border-color: var(--accent); background: var(--accent-dim); color: var(--text);
}

.notes-input {
    width: 100%; min-height: 100px; padding: 12px 14px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
    font-family: inherit; font-size: 0.9rem; resize: vertical; outline: none;
}
.notes-input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15); }

.row-btns { display: flex; gap: 8px; margin-top: 18px; }
.btn {
    flex: 1; padding: 12px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--muted); font-family: inherit;
    font-size: 0.8rem; font-weight: 600; cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.btn:hover { color: var(--text); }
.btn-primary {
    background: var(--accent); color: #1a1406; border-color: transparent;
    font-weight: 700; font-size: 0.9rem;
}
.btn-primary:hover { filter: brightness(1.05); color: #1a1406; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; filter: none; }

#loading { display: none; }

.summon-ritual {
    position: relative; padding: 36px 16px 44px; text-align: center; overflow: hidden;
}
.summon-glow {
    position: absolute; left: 50%; top: 42%; width: 220px; height: 220px;
    transform: translate(-50%, -50%); pointer-events: none;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.35) 0%, rgba(240, 180, 41, 0.12) 45%, transparent 70%);
    animation: summon-pulse 2.4s ease-in-out infinite;
}
@keyframes summon-pulse {
    0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.92); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

.summon-orbit {
    position: relative; width: 132px; height: 132px; margin: 0 auto 18px;
}
.orb-core {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    font-size: 2.6rem; z-index: 2;
    animation: wizard-bob 2.2s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(240, 180, 41, 0.55));
}
@keyframes wizard-bob {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50% { transform: translate(-50%, -50%) translateY(-7px); }
}
.orb-item {
    position: absolute; left: 50%; top: 50%; font-size: 1.15rem;
    margin: -0.5rem 0 0 -0.5rem;
    animation: orbit-spin 7s linear infinite;
    filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.45));
}
.orb-item.o1 { animation-duration: 6s; }
.orb-item.o2 { animation-duration: 7.5s; animation-delay: -1.2s; }
.orb-item.o3 { animation-duration: 8.5s; animation-delay: -2.4s; }
.orb-item.o4 { animation-duration: 9s; animation-delay: -3.6s; }
.orb-item.o5 { animation-duration: 10s; animation-delay: -4.8s; }
@keyframes orbit-spin {
    from { transform: rotate(0deg) translateX(54px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(54px) rotate(-360deg); }
}

.summon-title {
    font-family: var(--serif); font-size: 1.45rem; font-style: italic;
    color: var(--accent); margin: 0 0 8px; position: relative;
}
.summon-msg {
    font-size: 0.86rem; font-weight: 600; color: var(--muted);
    min-height: 1.35em; margin: 0 0 18px; position: relative;
    transition: opacity 0.25s var(--ease);
}
.summon-msg.flicker { opacity: 0.35; }

.summon-track {
    width: 100%; max-width: 300px; height: 5px; margin: 0 auto;
    background: var(--surface-2); border-radius: 99px; overflow: hidden;
    position: relative;
}
.summon-fill {
    height: 100%; width: 45%; border-radius: 99px;
    background: linear-gradient(90deg, var(--purple), var(--accent), var(--cyan));
    animation: summon-bar 1.4s var(--ease) infinite;
}
@keyframes summon-bar {
    0% { transform: translateX(-110%); }
    100% { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
    .summon-fill { animation: none; width: 100%; }
    .orb-item, .orb-core, .summon-glow { animation: none; }
}

/* Result cards */
.pick-card {
    display: grid; grid-template-columns: 120px 1fr; gap: 16px;
    padding: 14px; margin-bottom: 12px; border-radius: 14px;
    background: var(--surface-2); border: 1px solid var(--border);
    contain: layout style;
}
.pick-card.done { opacity: 1; }
.pick-cover-wrap {
    position: relative; border-radius: 10px; overflow: hidden;
    aspect-ratio: 2/3; background: var(--bg);
}
.pick-cover {
    width: 100%; height: 100%; object-fit: cover; display: block;
    background: var(--surface);
}
.pick-cover.square { aspect-ratio: 1; object-fit: cover; }
.pick-actions-top {
    position: absolute; top: 6px; left: 6px; right: 6px;
    display: flex; justify-content: space-between; pointer-events: none;
}
.pick-actions-top button { pointer-events: auto; }
.pick-mini {
    padding: 4px 8px; border-radius: 6px; border: none; font-size: 0.65rem;
    font-weight: 700; cursor: pointer; background: rgba(0,0,0,0.65); color: #fff;
}
.pick-mini.save { background: rgba(167, 139, 250, 0.9); }
.match-badge {
    display: inline-block; font-size: 0.65rem; font-weight: 700; color: var(--cyan);
    margin-bottom: 6px;
}
.pick-card h3 { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 2px; }
.pick-meta { font-size: 0.75rem; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.pick-hook { font-family: var(--serif); font-size: 1.02rem; font-style: italic; margin-bottom: 8px; line-height: 1.4; }
.pick-why { font-size: 0.82rem; color: var(--muted); line-height: 1.45; margin-bottom: 12px; }
.pick-link {
    font-size: 0.72rem; font-weight: 700; color: var(--accent); text-decoration: none;
}
.pick-link:hover { text-decoration: underline; }

/* Library */
.lib-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px;
}
.lib-stat {
    padding: 12px 8px; text-align: center; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
}
.lib-stat b { display: block; font-size: 1.25rem; font-weight: 700; color: var(--accent); }
.lib-stat span { font-size: 0.62rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

.filter-row { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
    flex: 0 0 auto; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border);
    background: transparent; color: var(--muted); font-size: 0.72rem; font-weight: 600;
    cursor: pointer; font-family: inherit;
}
.filter-chip.active { background: var(--accent-dim); border-color: var(--accent); color: var(--text); }

.search-wrap { position: relative; margin-bottom: 16px; }
.search-input {
    width: 100%; padding: 13px 16px; border-radius: 11px; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text); font-size: 0.95rem; outline: none;
}
.search-input:focus { border-color: var(--purple); }
.search-menu {
    position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50;
    background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
    max-height: 300px; overflow-y: auto; display: none; box-shadow: var(--shadow);
}
.search-menu.open { display: block; }
.search-hit {
    display: flex; gap: 12px; align-items: center; padding: 10px 12px;
    cursor: pointer; border-bottom: 1px solid var(--border);
}
.search-hit:hover { background: var(--surface-2); }
.search-hit img { width: 40px; height: 58px; object-fit: cover; border-radius: 6px; background: var(--bg); flex-shrink: 0; }
.search-hit img.square { width: 48px; height: 48px; }
.search-hit strong { display: block; font-size: 0.85rem; }
.search-hit em { font-size: 0.72rem; color: var(--muted); font-style: normal; }

.shelf { margin-bottom: 28px; content-visibility: auto; contain-intrinsic-size: auto 200px; }
.shelf-head {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 10px;
}
.shelf-head h3 { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.shelf-head .count { font-size: 0.72rem; color: var(--muted); }

/* Compact list — scales to hundreds of books */
.lib-grid {
    display: flex; flex-direction: column; gap: 6px;
    min-height: 8px; border-radius: 10px;
}
.lib-grid.drop-target { outline: 2px dashed var(--cyan); outline-offset: 2px; background: rgba(56, 189, 248, 0.04); }

.lib-row {
    display: flex; gap: 8px; align-items: flex-start;
    padding: 8px 10px; border-radius: 10px;
    background: var(--surface-2); border: 1px solid var(--border);
    contain: layout style paint;
    -webkit-user-drag: none;
    user-select: none;
}
.lib-row input, .lib-row button.shelf-btn, .lib-row button.lookup-pages {
    user-select: auto;
}
.lib-row:hover { border-color: rgba(255,255,255,0.14); }
.lib-row.is-done { border-color: rgba(240, 180, 41, 0.35); }
.lib-row.dragging { opacity: 0.45; }

.drag-grip {
    flex-shrink: 0; width: 22px; padding: 4px 0; border: none; background: transparent;
    color: var(--muted); font-size: 1rem; line-height: 1; cursor: grab; touch-action: none;
    align-self: center; border-radius: 4px;
}
.drag-grip:hover { color: var(--text); background: var(--bg); }
.drag-grip:active { cursor: grabbing; }

.lib-thumb {
    width: 44px; height: 66px; flex-shrink: 0; border-radius: 5px;
    object-fit: cover; background: var(--bg); border: 1px solid var(--border);
}
.lib-thumb.square { width: 52px; height: 52px; }

.lib-row-body { flex: 1; min-width: 0; }
.lib-row-top { display: flex; gap: 8px; align-items: flex-start; }
.lib-row-text { flex: 1; min-width: 0; }
.lib-type { font-size: 0.58rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.lib-title { font-size: 0.82rem; font-weight: 700; line-height: 1.25; margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-author { font-size: 0.7rem; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.shelf-btns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.shelf-btn {
    padding: 4px 8px; font-size: 0.62rem; font-weight: 700; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg); color: var(--muted);
    cursor: pointer; font-family: inherit;
}
.shelf-btn:hover { color: var(--text); border-color: var(--cyan); }

.prog-wrap { display: flex; align-items: center; gap: 8px; margin-top: 6px; touch-action: none; }
.prog-wrap input[type="range"] { flex: 1; height: 4px; accent-color: var(--purple); min-width: 0; touch-action: none; cursor: pointer; }
.prog-val { font-size: 0.68rem; font-weight: 700; color: var(--muted); min-width: 2.5rem; text-align: right; }

.page-prog { margin-top: 6px; touch-action: none; }
.page-inputs {
    display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
    font-size: 0.68rem; color: var(--muted); font-weight: 600;
}
.page-inputs input[type="number"] {
    width: 52px; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); font-size: 0.75rem; font-family: inherit;
}
.page-inputs input[type="number"]:focus { border-color: var(--purple); outline: none; }
.page-prog input[type="range"] { width: 100%; height: 4px; accent-color: var(--purple); touch-action: none; cursor: pointer; }
.lookup-pages {
    margin-top: 4px; padding: 0; border: none; background: none;
    color: var(--cyan); font-size: 0.65rem; font-weight: 700; cursor: pointer; font-family: inherit;
}

.card-x {
    width: 24px; height: 24px; flex-shrink: 0;
    border-radius: 6px; border: none; background: transparent; color: var(--muted);
    font-size: 1rem; font-weight: 700; cursor: pointer; line-height: 1;
}
.card-x:hover { color: var(--danger); background: rgba(248, 113, 113, 0.12); }

.empty { grid-column: 1/-1; text-align: center; padding: 24px; color: var(--muted); font-size: 0.82rem; border: 1px dashed var(--border); border-radius: 10px; }

#toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(80px);
    padding: 12px 20px; border-radius: 10px; background: var(--surface);
    border: 1px solid var(--border); font-size: 0.82rem; font-weight: 600;
    box-shadow: var(--shadow); z-index: 10001; opacity: 0; pointer-events: none;
    transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.user-chip { font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.logout { padding: 6px 10px; font-size: 0.72rem; }

.forge-banner {
    text-align: center; padding: 10px; border-radius: 10px; margin-bottom: 20px;
    background: var(--accent-dim); border: 1px solid rgba(240, 180, 41, 0.35);
    color: var(--accent); font-size: 0.78rem; font-weight: 700;
}

.forge-hero h2 {
    font-family: var(--serif); font-size: 1.85rem; font-weight: 400; margin: 0 0 10px;
}
.forge-lead { color: var(--muted); font-size: 0.92rem; line-height: 1.6; margin: 0 0 16px; max-width: 52rem; }
.forge-lead strong { color: var(--text); }
.forge-compare {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
    padding: 12px 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border);
    font-size: 0.8rem; font-weight: 600;
}
.forge-compare-item.muted { color: var(--muted); }
.forge-compare-item.strike { text-decoration: line-through; color: var(--muted); }
.forge-compare-item.accent { color: var(--accent); }
.forge-compare-arrow { color: var(--purple); }

.forge-pick-label {
    font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--muted); margin: 22px 0 10px;
}
.forge-tiers {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
@media (max-width: 720px) {
    .forge-tiers { grid-template-columns: 1fr; }
}
.forge-tier {
    display: flex; flex-direction: column; align-items: flex-start; text-align: left;
    padding: 16px 14px; border-radius: 14px; border: 1px solid var(--border);
    background: var(--surface-2); cursor: pointer; font-family: inherit;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), transform 0.15s var(--ease);
}
.forge-tier:hover { border-color: var(--purple); transform: translateY(-2px); }
.forge-tier.active, .forge-tier-featured.active {
    border-color: var(--accent); box-shadow: 0 0 0 1px rgba(240, 180, 41, 0.35);
    background: rgba(240, 180, 41, 0.06);
}
.forge-tier-featured { border-color: rgba(240, 180, 41, 0.45); }
.forge-tier-tag {
    font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--cyan); margin-bottom: 6px;
}
.forge-tier-name { font-size: 1.1rem; color: var(--text); margin-bottom: 4px; }
.forge-tier-words { font-size: 0.72rem; color: var(--muted); margin-bottom: 10px; }
.forge-tier-price { font-size: 1.65rem; font-weight: 800; color: var(--text); line-height: 1; }
.forge-tier-was { font-size: 0.68rem; color: var(--muted); text-decoration: line-through; margin-top: 4px; }

.forge-detail {
    margin-top: 16px; padding: 18px 20px; border-radius: 14px;
    border: 1px solid var(--border); background: var(--surface-2);
}
.forge-detail h3 {
    font-family: var(--serif); font-size: 1.35rem; font-weight: 400; margin: 0 0 6px;
}
.forge-detail .forge-detail-meta {
    display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px;
    font-size: 0.75rem; font-weight: 600; color: var(--muted);
}
.forge-detail .forge-detail-meta span {
    padding: 4px 10px; border-radius: 99px; background: var(--bg); border: 1px solid var(--border);
}
.forge-detail p { color: var(--muted); font-size: 0.88rem; line-height: 1.6; margin: 0 0 12px; }
.forge-detail ul { margin: 0 0 14px; padding-left: 1.1rem; color: var(--text); font-size: 0.84rem; line-height: 1.55; }
.forge-detail li { margin-bottom: 6px; }
.forge-detail .forge-ideal {
    padding: 12px 14px; border-radius: 10px; background: var(--bg);
    border-left: 3px solid var(--purple); font-size: 0.82rem; color: var(--muted); line-height: 1.5;
}

.forge-process { margin: 28px 0 16px; }
.forge-process h3 { font-size: 0.95rem; margin-bottom: 12px; }
.forge-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.forge-steps li {
    display: flex; gap: 12px; align-items: flex-start; font-size: 0.84rem;
    color: var(--muted); line-height: 1.5;
}
.forge-steps li span {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px;
    background: var(--accent-dim); color: var(--accent); font-weight: 800; font-size: 0.75rem;
    display: flex; align-items: center; justify-content: center;
}
.forge-list { margin: 0; padding-left: 1.1rem; }
.forge-list li { margin-bottom: 6px; }

.forge-cta-row { margin-top: 24px; text-align: center; }
.forge-cta-btn { max-width: 320px; width: 100%; }
.forge-cta-note { font-size: 0.72rem; color: var(--muted); margin-top: 10px; }

.accordion { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.accordion summary { padding: 14px 16px; font-weight: 600; cursor: pointer; list-style: none; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion .body { padding: 0 16px 14px; color: var(--muted); font-size: 0.88rem; line-height: 1.55; }

.footer { text-align: center; margin-top: 36px; font-size: 0.72rem; color: var(--muted); }
.footer a { color: var(--muted); margin: 0 8px; }

#pdf-modal {
    position: fixed; inset: 0; z-index: 10005; background: rgba(0,0,0,0.85);
    display: none; align-items: center; justify-content: center; padding: 16px;
}

@media (max-width: 640px) {
    .pick-card { grid-template-columns: 96px 1fr; gap: 12px; }
    .lib-stats { grid-template-columns: repeat(2, 1fr); }
    .tabs { grid-template-columns: 1fr; }
}
