/* S89-SEO G+: Modern Colorful Knowledge Map (Cloudflare Pages static compatible, zero external CDNs). */
:root {
    --g-blue: #2563eb;
    --g-green: #16a34a;
    --g-purple: #7c3aed;
    --g-orange: #ea580c;
    --g-amber: #d97706;
    --g-pink: #db2777;
    --g-teal: #0d9488;
    --g-ink: #1e293b;
    --g-muted: #475569;
    --g-soft: #64748b;
    --g-border: #e2e8f0;
    --g-surface: #ffffff;
    --g-bg: #f8fafc;
}

html, body { min-height: 100%; }
body {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at 8% 0%, #eff6ff 0%, #f8fafc 38%, #fdf4ff 100%);
    color: var(--g-ink);
    font-family: "Be Vietnam Pro", "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    line-height: 1.55;
}
main[role="main"] { flex: 1 0 auto; width: 100%; min-width: 0; }
.shell { width: min(1840px, calc(100% - 40px)); margin-inline: auto; }
.lucide-icon { width: 15px; height: 15px; flex: 0 0 auto; display: inline-block; vertical-align: -0.15em; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid #e2e8f0cc; background: #fffffff0; backdrop-filter: blur(12px); }
.site-nav { padding: 6px 0; }
.site-nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.navbar-brand { display: inline-flex; align-items: center; gap: 9px; font-size: .88rem; font-weight: 800; letter-spacing: .03em; color: var(--g-ink); text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(135deg, var(--g-blue), var(--g-purple)); color: #fff; font-weight: 800; font-size: .82rem; box-shadow: 0 4px 10px #2563eb33; }
.brand-title { color: var(--g-ink); }
.brand-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: #eff6ff; color: var(--g-blue); border: 1px solid #bfdbfe; font-size: .68rem; font-weight: 700; letter-spacing: 0; }
.brand-pill .lucide-icon { width: 13px; height: 13px; }
.navbar-nav { gap: 6px; }
.nav-pill-link { padding: 6px 11px !important; border-radius: 999px; font-size: .78rem; font-weight: 600; color: var(--g-muted) !important; transition: background .15s ease, color .15s ease; }
.nav-pill-link:hover { background: #f1f5f9; color: var(--g-blue) !important; }
.nav-cta-link { display: inline-flex; align-items: center; gap: 5px; padding: 6px 13px !important; border-radius: 999px; background: linear-gradient(135deg, var(--g-teal), var(--g-blue)); color: #fff !important; font-size: .76rem; font-weight: 700; box-shadow: 0 4px 12px #0d948829; transition: transform .15s ease, box-shadow .15s ease; }
.nav-cta-link:hover { transform: translateY(-1px); box-shadow: 0 6px 16px #0d948840; color: #fff !important; }

h1, h2, h3 { font-family: "Be Vietnam Pro", "DM Sans", Arial, sans-serif; letter-spacing: -.025em; color: var(--g-ink); }
h1 { font-size: clamp(1.55rem, 2.4vw, 2.2rem); line-height: 1.18; margin: 0 0 .3em; font-weight: 800; }
h2 { font-size: clamp(1.15rem, 1.7vw, 1.45rem); line-height: 1.25; margin: 0 0 .35em; font-weight: 750; }
h3 { font-size: 1rem; line-height: 1.35; font-weight: 700; }
.eyebrow, .card-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: .65rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: var(--g-purple); margin: 0 0 4px; }

/* Literary-Magazine Author Hero + CMS Stat Cards */
.author-overview { width: calc(100% - 28px); max-width: 1860px; margin: 12px auto; padding: 14px 18px; border: 1px solid #e2e8f0; border-radius: 18px; background: linear-gradient(125deg, #ffffff 0%, #f8faff 55%, #f0fdfa 100%); box-shadow: 0 10px 28px #0f172a0a; }
.author-hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr); gap: 16px; align-items: center; }
.author-overview-copy h1 { margin: 2px 0 6px; background: linear-gradient(120deg, #0f172a 0%, #1d4ed8 55%, #7c3aed 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.author-summary { margin: 0; color: var(--g-muted); font-size: .86rem; line-height: 1.55; max-width: 78ch; }
.author-meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.author-meta-pill { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px; border-radius: 999px; background: #f1f5f9; color: var(--g-muted); font-size: .72rem; border: 1px solid #e2e8f0; }
.author-meta-pill.is-verified { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.author-career, .author-sources { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52ch; }

.author-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat-card { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 14px; background: #fff; border: 1px solid #e2e8f0; box-shadow: 0 4px 14px #0f172a08; transition: transform .16s ease, box-shadow .16s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px #0f172a12; }
.stat-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: #fff; flex: 0 0 auto; }
.stat-icon .lucide-icon { width: 18px; height: 18px; }
.stat-blue .stat-icon { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.stat-blue { border-left: 3px solid var(--g-blue); }
.stat-teal .stat-icon { background: linear-gradient(135deg, #0d9488, #14b8a6); }
.stat-teal { border-left: 3px solid var(--g-teal); }
.stat-purple .stat-icon { background: linear-gradient(135deg, #7c3aed, #8b5cf6); }
.stat-purple { border-left: 3px solid var(--g-purple); }
.stat-orange .stat-icon { background: linear-gradient(135deg, #ea580c, #f97316); }
.stat-orange { border-left: 3px solid var(--g-orange); }
.stat-copy { display: grid; line-height: 1.2; }
.stat-copy strong { font-size: 1.08rem; font-weight: 800; color: var(--g-ink); }
.stat-copy span { font-size: .7rem; font-weight: 600; color: var(--g-soft); }

/* Book-first & subpage compatibility */
.page-hero { padding-top: 22px; padding-bottom: 12px; }
.page-hero.compact { padding-top: 20px; padding-bottom: 8px; }
.page-hero .lede { font-size: .92rem; line-height: 1.6; }
.section-block { padding-top: 16px; padding-bottom: 32px; }
.section-heading { margin-bottom: 16px; align-items: center; }
.work-card-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.work-card { --work-accent: var(--g-purple); position: relative; display: grid; grid-template-columns: 100px minmax(0, 1fr); min-height: 150px; overflow: hidden; border: 1px solid var(--g-border); border-radius: 16px; background: #fff; box-shadow: 0 8px 24px #0f172a0a; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.work-card.no-cover { grid-template-columns: minmax(0, 1fr); min-height: 88px; align-self: start; }
.work-card:hover { transform: translateY(-2px); border-color: var(--work-accent); box-shadow: 0 12px 25px #0f172a15; }
.work-card:before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--work-accent); }
.work-card-cover { display: grid; place-items: center; min-width: 0; min-height: 150px; padding: 8px; background: #f8fafc; }
.work-card-cover img { width: 100%; height: 100%; max-height: 174px; object-fit: contain; border-radius: 7px; }
.work-card-copy { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 0; padding: 12px 12px 11px 10px; }
.work-card-copy h3 { margin: 3px 0 auto; }
.work-card-copy h3 a { color: var(--g-ink); }
.category-label { font-size: .64rem; color: var(--work-accent); font-weight: 700; }
.buy-row { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; margin-top: 10px; padding-top: 8px; font-size: .7rem; }
.mapping-warning { display: inline-flex; align-items: center; color: var(--g-amber); font-size: .7rem; }
.research-list { padding: 0; margin: 0; list-style: none; border-top: 1px solid var(--g-border); }
.research-list li { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 12px 4px; border-bottom: 1px solid #f1f5f9; }
.research-list li span { display: grid; gap: 2px; }
.research-list li b { font-size: .88rem; }
.research-list li small, .research-list li>a { color: var(--g-soft); font-size: .74rem; }
.book-source-line { font-size: .75rem; color: var(--g-soft); }
.book-back-nav { margin-bottom: 10px; }

/* Knowledge Map Workspace */
.map-workspace { display: grid; grid-template-columns: minmax(210px, 260px) minmax(0, 1fr); gap: 14px; width: calc(100% - 28px); max-width: 1860px; min-height: calc(100dvh - 180px); margin: 0 auto 14px; align-items: stretch; }
.map-workspace.details-open { grid-template-columns: minmax(200px, 245px) minmax(0, 1fr) minmax(280px, 340px); }
.map-workspace.list-collapsed { grid-template-columns: minmax(0, 1fr); }
.map-workspace.list-collapsed.details-open { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); }
.map-workspace.list-collapsed .map-books { display: none; }
.map-workspace.list-collapsed .map-list-toggle { display: inline-flex; }

.map-books, .map-details { max-height: calc(100dvh - 140px); min-height: 0; overflow: auto; border: 1px solid var(--g-border); border-radius: 16px; background: var(--g-surface); box-shadow: 0 8px 24px #0f172a0a; padding: 12px; }
.map-panel-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.map-panel-title h2 { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .96rem; }
.count-pill { padding: 1px 7px; border-radius: 999px; background: #eff6ff; color: var(--g-blue); font-size: .7rem; font-weight: 700; }

.map-search-wrap { position: relative; margin-bottom: 8px; }
.map-search-wrap .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--g-soft); pointer-events: none; width: 14px; height: 14px; }
.map-books input { width: 100%; padding: 8px 10px 8px 30px; border: 1px solid var(--g-border); border-radius: 10px; background: #f8fafc; font-size: .78rem; color: var(--g-ink); transition: border-color .15s ease, background .15s ease; }
.map-books input:focus { outline: none; border-color: var(--g-blue); background: #fff; box-shadow: 0 0 0 3px #2563eb1a; }

.map-book-row { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 9px; width: 100%; padding: 7px 6px; border: 1px solid transparent; border-radius: 10px; background: transparent; text-align: left; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.map-book-row:hover { background: #f8fafc; border-color: #e2e8f0; }
.map-book-row.active { background: #eff6ff; border-color: #93c5fd; }
.map-book-row.no-cover { grid-template-columns: minmax(0, 1fr); }
.map-book-cover { display: grid; place-items: center; width: 36px; height: 48px; border-radius: 6px; overflow: hidden; background: #f1f5f9; }
.map-book-cover img { width: 100%; height: 100%; object-fit: cover; }
.map-book-meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.map-book-row b { font-size: .74rem; font-weight: 650; color: var(--g-ink); line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.stock-badge { display: inline-flex; align-items: center; flex: 0 0 auto; }
.stock-badge.is-in { color: var(--g-green); }
.stock-badge.is-out { color: var(--g-pink); }

.map-main { min-width: 0; display: flex; flex-direction: column; }
.graph-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.graph-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.legend-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px; background: #fff; border: 1px solid var(--g-border); font-size: .7rem; font-weight: 650; color: var(--g-muted); }
.legend-chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend-teal i { background: var(--g-teal); }
.legend-purple i { background: var(--g-purple); }
.legend-orange i { background: var(--g-orange); }
.legend-blue i { background: var(--g-blue); }

.map-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.map-controls button, .icon-button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--g-border); background: #fff; border-radius: 9px; padding: 6px 10px; color: var(--g-muted); font-size: .74rem; font-weight: 600; cursor: pointer; transition: all .15s ease; }
.map-controls button:hover, .icon-button:hover { background: #eff6ff; color: var(--g-blue); border-color: #93c5fd; }
.map-list-toggle { display: none; }

.graph-frame { position: relative; height: calc(100dvh - 220px); min-height: 540px; border: 1px solid var(--g-border); border-radius: 18px; background: radial-gradient(circle at 20% 20%, #f8faff 0%, #ffffff 55%, #f0fdfa 100%); box-shadow: inset 0 1px 0 #fff, 0 8px 24px #0f172a08; overflow: hidden; }
.graph-frame #knowledge-graph { width: 100%; height: 100%; }
.map-node-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.map-node-card {
    position: absolute;
    transform: translate(-50%, -50%) scale(var(--node-scale, 1));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    width: 184px;
    height: 174px;
    padding: 8px 8px 9px;
    border: 2.5px solid var(--node-accent, var(--g-blue));
    border-top-width: 6px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 24px #0f172a18;
    color: var(--g-ink);
    text-align: center;
    pointer-events: auto;
    cursor: pointer;
    transform-origin: center;
    transition: box-shadow .18s ease, border-color .18s ease;
}
.map-node-card:hover, .map-node-card:focus-visible { z-index: 4; box-shadow: 0 14px 32px #2563eb2e; outline: 3px solid #f59e0b; outline-offset: 2px; }
.map-node-card img { display: block; width: 100%; height: 116px; object-fit: contain; border-radius: 8px; background: #f8fafc; }
.map-node-card span { display: -webkit-box; overflow: hidden; width: 100%; font-size: .73rem; font-weight: 750; line-height: 1.28; text-overflow: ellipsis; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.map-node-card.is-unmapped { border-style: dashed; }
.map-node-card.no-cover { justify-content: center; }

/* Details Panel */
.map-details[hidden] { display: none !important; }
.detail-close { position: sticky; top: 0; float: right; z-index: 2; width: 32px; height: 32px; border: 1px solid var(--g-border); border-radius: 50%; background: #fff; color: var(--g-muted); font-size: 1.2rem; line-height: 1; cursor: pointer; }
.detail-close:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.map-details h2 { clear: both; padding-top: 6px; font-size: 1.15rem; font-weight: 800; }
.map-detail-cover { display: block; width: 100%; height: 220px; object-fit: contain; border-radius: 12px; background: #f8fafc; padding: 6px; }
.variant-label { display: grid; gap: 6px; margin: 12px 0; color: var(--g-muted); font-size: .74rem; font-weight: 600; }
.variant-select { width: 100%; padding: 9px 10px; border: 1px solid var(--g-border); border-radius: 10px; background: #fff; color: var(--g-ink); font-size: .8rem; }

.map-commerce-box { margin: 12px 0 14px; padding: 12px 14px; border: 1px solid #bfdbfe; border-radius: 14px; background: linear-gradient(135deg, #eff6ff 0%, #f0fdfa 100%); }
.map-stock { margin: 0; font-size: .78rem; font-weight: 700; color: var(--g-green); }
.map-stock.out-of-stock { color: var(--g-pink); }
.map-price { display: block; margin: 4px 0 10px; color: #0f172a; font-size: 1.28rem; font-weight: 800; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; font-weight: 700; border: 0; cursor: pointer; }
.button-primary { background: linear-gradient(135deg, var(--g-blue), var(--g-teal)); color: #fff; box-shadow: 0 6px 16px #2563eb2e; transition: transform .15s ease, box-shadow .15s ease; }
.button-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 20px #2563eb40; color: #fff; }
.map-buy { width: 100%; padding: 11px 14px; border-radius: 11px; font-size: .84rem; }
.mapping-warning-box { margin: 0; padding: 9px 11px; border-radius: 10px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: .76rem; font-weight: 650; }
.map-description { font-size: .79rem; line-height: 1.6; color: var(--g-muted); }

.detail-facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.fact-chip { padding: 4px 10px; border-radius: 999px; background: #f3e8ff; color: #6d28d9; font-size: .7rem; font-weight: 650; }
.detail-relations { margin-top: 16px; border-top: 1px solid var(--g-border); padding-top: 10px; }
.detail-relations h3 { font-size: .9rem; margin-bottom: 8px; }
.detail-relation-item { display: grid; gap: 3px; padding: 8px 10px; margin: 0 0 8px; border-radius: 10px; background: #f8fafc; border-left: 3px solid var(--rel-color, var(--g-blue)); font-size: .75rem; }
.relation-suggestion-label { color: var(--rel-color, var(--g-amber)); font-weight: 750; }
.relation-reason { display: block; color: var(--g-soft); font-size: .71rem; line-height: 1.4; }
.detail-profile-link { display: inline-block; margin-top: 12px; font-weight: 700; font-size: .82rem; color: var(--g-blue); }

.map-main:fullscreen { padding: 14px; background: var(--g-bg); overflow: auto; }
.map-main:fullscreen .graph-frame { height: calc(100dvh - 88px); }

/* Unified Reading Paths & Timeline */
.unified-section { width: calc(100% - 28px); max-width: 1860px; margin: 16px auto 22px; padding: 18px 20px; border: 1px solid var(--g-border); border-radius: 18px; background: var(--g-surface); box-shadow: 0 10px 28px #0f172a08; }
.unified-section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 14px; }
.unified-section-head h2 { margin: 2px 0 0; font-size: 1.24rem; }
.section-info-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: #f8fafc; border: 1px solid var(--g-border); color: var(--g-muted); font-size: .73rem; font-weight: 600; }

.reading-paths-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.path-card { --path-accent: var(--g-blue); margin: 0; padding: 16px; border: 1px solid var(--g-border); border-top: 4px solid var(--path-accent); border-radius: 16px; background: #fff; box-shadow: 0 6px 20px #0f172a08; transition: transform .16s ease, box-shadow .16s ease; }
.path-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px #0f172a12; }
.path-card.accent-blue { --path-accent: var(--g-blue); }
.path-card.accent-teal { --path-accent: var(--g-teal); }
.path-card.accent-purple { --path-accent: var(--g-purple); }
.path-card.accent-orange { --path-accent: var(--g-orange); }
.path-heading .path-proposal { display: inline-block; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--path-accent) 12%, #fff); color: var(--path-accent); font-size: .68rem; font-weight: 750; }
.path-heading h3 { margin: 8px 0 4px; font-size: 1.04rem; }
.path-heading p { margin: 0; color: var(--g-soft); font-size: .76rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.path-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.path-step { position: relative; min-width: 0; }
.path-step-btn { display: flex; align-items: center; gap: 9px; width: 100%; height: 100%; padding: 9px 11px; border: 1px solid var(--g-border); border-radius: 12px; background: #f8fafc; text-align: left; color: var(--g-ink); cursor: pointer; transition: all .15s ease; }
.path-step-btn:hover { border-color: var(--path-accent); background: #fff; box-shadow: 0 4px 12px #0f172a0d; }
.step-badge { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--path-accent); color: #fff; font-size: .72rem; font-weight: 800; flex: 0 0 auto; }
.path-step-btn strong { font-size: .82rem; line-height: 1.3; }

/* Timeline */
.timeline-list { display: flex; align-items: stretch; gap: 12px; margin: 12px 0 0; padding: 4px 2px 12px; overflow-x: auto; scroll-snap-type: x proximity; }
.timeline-item { flex: 0 0 215px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; padding: 12px; border: 1px solid var(--g-border); border-top: 4px solid var(--g-teal); border-radius: 14px; background: #fff; box-shadow: 0 6px 18px #0f172a08; color: var(--g-ink); text-align: left; cursor: pointer; scroll-snap-align: start; transition: transform .15s ease, border-color .15s ease; }
.timeline-item:hover { transform: translateY(-2px); border-color: var(--g-blue); }
.timeline-year { display: inline-block; align-self: flex-start; padding: 2px 8px; border-radius: 999px; background: #ccfbf1; color: #0f766e; font-size: .72rem; font-weight: 800; }
.timeline-copy { display: flex; flex-direction: column; gap: 3px; }
.timeline-copy strong { font-size: .83rem; line-height: 1.35; }
.timeline-copy small { color: var(--g-soft); font-size: .68rem; }
.timeline-unverified-group { margin-top: 16px; }
.timeline-group-label { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: .78rem; font-weight: 700; color: var(--g-amber); }
.timeline-item.is-unverified-year { border-top-color: var(--g-amber); }
.timeline-item.is-unverified-year .timeline-year { background: #fef3c7; color: #92400e; }

/* No-JS SSR fallback */
.ssr-book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.ssr-book-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--g-border); border-radius: 12px; background: #fff; }
.ssr-book-card img { width: 100%; height: 180px; object-fit: contain; background: #f8fafc; border-radius: 8px; }

/* Footer */
.footer { position: static !important; bottom: auto !important; width: 100%; white-space: normal; line-height: 1.55; margin-top: auto; padding: 12px 0; background: #ffffffcc; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; font-size: .74rem; }

@media (max-width: 1300px) { .work-card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 980px) {
    .author-hero-grid { grid-template-columns: 1fr; }
    .author-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .work-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .map-workspace, .map-workspace.details-open { grid-template-columns: minmax(190px, 230px) minmax(0, 1fr); }
    .map-details { grid-column: 2; max-height: none; }
    .details-open .map-main { grid-column: 2; }
    .graph-frame { height: 640px; }
}
@media (max-width: 700px) {
    .shell { width: calc(100% - 20px); }
    .brand-pill { display: none; }
    .author-overview { width: calc(100% - 16px); margin: 8px auto 10px; padding: 12px; }
    .author-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .author-career, .author-sources { max-width: 30ch; }
    .work-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .map-workspace, .map-workspace.details-open { grid-template-columns: minmax(0, 1fr); width: calc(100% - 12px); gap: 8px; min-height: 0; }
    .map-books { max-height: 260px; }
    .graph-toolbar { gap: 6px; }
    .graph-legend { order: 3; width: 100%; }
    .map-controls button { padding: 6px 8px; font-size: .68rem; }
    .graph-frame { height: 64dvh; min-height: 440px; border-radius: 14px; }
    .map-node-card { width: 154px; height: 126px; padding: 6px; border-width: 2px; border-top-width: 5px; }
    .map-node-card img { height: 78px; }
    .map-node-card span { font-size: .66rem; }
    .map-details, .map-workspace.details-open .map-details { grid-column: 1; max-height: 52dvh; }
    .map-workspace.details-open .map-main { grid-column: 1; }
    .map-detail-cover { height: 180px; }
    .unified-section { width: calc(100% - 16px); padding: 14px 12px; }
    .reading-paths-grid { grid-template-columns: 1fr; }
    .path-steps { grid-template-columns: 1fr; gap: 8px; }
    .path-step { width: 100%; }
    .timeline-list { display: flex; flex-direction: column; gap: 10px; overflow: visible; padding: 0; }
    .timeline-item { flex: initial; width: 100%; }
    .footer-inner { align-items: flex-start; }
}
@media (max-width: 390px) {
    .work-card-grid { grid-template-columns: 1fr; }
    .map-controls button { padding: 5px 7px; font-size: .65rem; }
}


/* Author Portrait, Roles, Socials & Isolated Other Books */
.author-overview-copy.has-portrait { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 16px; align-items: start; }
.author-portrait { width: 112px; height: 112px; border-radius: 16px; overflow: hidden; border: 2px solid #bfdbfe; box-shadow: 0 8px 20px #0f172a14; background: #f8fafc; }
.author-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.author-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.author-realname { font-size: .82rem; font-weight: 600; color: var(--g-soft); }
.author-roles { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.author-role-badge { padding: 2px 9px; border-radius: 999px; background: #eff6ff; border: 1px solid #bfdbfe; color: var(--g-blue); font-size: .7rem; font-weight: 700; }
.author-socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.social-link-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--g-border); background: #fff; color: var(--g-ink); font-size: .72rem; font-weight: 650; text-decoration: none; }
.social-link-btn:hover { border-color: var(--g-blue); color: var(--g-blue); background: #eff6ff; }

.map-node-card.is-dimmed { opacity: 0.28; filter: grayscale(0.35); }
.map-node-card.is-highlighted { opacity: 1; z-index: 5; box-shadow: 0 14px 30px #2563eb2b; }

.other-books-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.other-book-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 12px; border: 1px solid var(--g-border); border-left: 4px solid var(--node-accent, var(--g-blue)); border-radius: 14px; background: #fff; box-shadow: 0 6px 18px #0f172a08; align-items: center; }
.other-book-cover { width: 76px; height: 104px; border-radius: 8px; overflow: hidden; background: #f8fafc; display: grid; place-items: center; }
.other-book-cover img { width: 100%; height: 100%; object-fit: contain; }
.other-book-body { display: grid; gap: 6px; min-width: 0; }
.other-book-title-btn { padding: 0; border: 0; background: transparent; text-align: left; font-size: .86rem; font-weight: 750; color: var(--g-ink); cursor: pointer; line-height: 1.3; }
.other-book-title-btn:hover { color: var(--g-blue); }
.other-book-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.other-book-price { font-size: .84rem; color: var(--g-ink); font-weight: 800; }
.other-book-stock { font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.other-book-stock.is-in { background: #dcfce7; color: #15803d; }
.other-book-stock.is-out { background: #fce7f3; color: #be185d; }
.other-book-buy { padding: 6px 10px; border-radius: 9px; font-size: .74rem; width: fit-content; }
@media (max-width: 700px) {
    .author-overview-copy.has-portrait { grid-template-columns: 1fr; }
    .other-books-grid { grid-template-columns: 1fr; }
}
