/* Book-page prototype: uses the existing Prescillium palette and fonts. */
.book-page-body { background: radial-gradient(ellipse at 52% 7%, rgba(39,65,84,.23), transparent 35rem),linear-gradient(180deg,#07111c,#050a11 54%,#03070c); }
.book-masthead { position: relative; background:#03070c; border-bottom:1px solid rgba(214,172,97,.27); }
.book-masthead-art { height:118px; background:url('/static/prescillium-library-hero.webp') center 31%/cover no-repeat; opacity:.67; mask-image:linear-gradient(to bottom,#000 40%,transparent); }
.book-masthead-bar { width:min(1170px,calc(100% - 36px)); margin:-7px auto 0; padding:0 0 20px; display:flex; justify-content:space-between; align-items:center; gap:18px; position:relative; }
.book-wordmark { color:var(--cream); font-size:clamp(1.25rem,2.8vw,1.85rem); text-decoration:none; letter-spacing:.02em; }
.book-wordmark span { color:var(--gold); font-size:.68em; vertical-align:middle; }
.book-return,.book-breadcrumb a { color:var(--gold-bright); text-decoration:none; font-family:Arial,Helvetica,sans-serif; font-size:.81rem; }
.book-return:hover,.book-return:focus-visible,.book-breadcrumb a:hover,.book-breadcrumb a:focus-visible { text-decoration:underline; text-underline-offset:4px; }
.book-page-shell { width:min(1120px,calc(100% - 36px)); margin:0 auto; }
.book-breadcrumb { display:flex; gap:13px; align-items:center; padding:23px 0 27px; color:var(--muted); font: .82rem Arial,Helvetica,sans-serif; }
.book-breadcrumb a { font-size:inherit; }
.book-breadcrumb > span:last-child { overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.book-feature { display:grid; grid-template-columns:224px minmax(0,1fr); gap:clamp(25px,4vw,65px); padding:8px 10px 55px; }
.book-feature-cover { width:100%; align-self:start; padding:6px; border:1px solid var(--line); border-radius:11px; background:linear-gradient(145deg,#112132,#070d16); box-shadow:0 24px 55px rgba(0,0,0,.42); }
.book-feature-cover img { display:block;width:100%;aspect-ratio:2/3;object-fit:contain; border-radius:5px; color:var(--muted); font-family:Arial,Helvetica,sans-serif; font-size:.8rem; }
.book-feature-content { min-width:0; padding-top:9px; }
.book-eyebrow,.book-section-kicker { color:var(--gold);text-transform:uppercase;font:600 .7rem Arial,Helvetica,sans-serif;letter-spacing:.16em; }
.book-feature h1 { font-size:clamp(2.4rem,5vw,4.3rem);font-weight:normal;line-height:1.1;letter-spacing:-.02em;margin:14px 0 7px; }
.book-byline { font-size:1.31rem;color:var(--cream-soft);margin:0; }
.book-series { display:inline-block; border:1px solid var(--line); border-radius:50px; color:var(--gold-bright); font: .8rem Arial,Helvetica,sans-serif; padding:7px 12px; margin-top:16px; }
.book-description-block { max-width:710px; margin-top:31px; }
.book-description-block p { color:var(--cream-soft); line-height:1.82; margin:0; font-size:1.09rem; }
.book-traits { display:flex;flex-wrap:wrap;gap:9px;margin-top:24px; }
.book-trait { border-radius:30px; border:1px solid rgba(214,172,97,.24);background:rgba(214,172,97,.08);color:var(--gold-bright); padding:7px 11px; font: .8rem Arial,Helvetica,sans-serif; }
.book-analysis,.book-discovery { padding-top:50px; }
.book-section-heading { display:flex;justify-content:space-between;align-items:end;flex-wrap:wrap;gap:22px; margin-bottom:25px; }
.book-section-heading h2 { font-size:clamp(1.75rem,2.5vw,2.4rem);font-weight:normal;margin:10px 0 7px; }
.book-section-heading p { font: .91rem/1.5 Arial,Helvetica,sans-serif;color:var(--muted);margin:0; }
.book-analysis-tabs { display:flex;gap:4px;padding:4px;border:1px solid var(--line);border-radius:100px;background:rgba(4,9,16,.55);max-width:100%; }
.book-analysis-tab { border:0;border-radius:100px;cursor:pointer;color:var(--cream-soft);background:transparent;padding:12px 18px;font:.83rem Arial,Helvetica,sans-serif;white-space:nowrap;transition:background .15s,color .15s; }
.book-analysis-tab[aria-selected='true'] { background:linear-gradient(145deg,#eac883,#be934d);color:#131820;box-shadow:0 3px 14px rgba(0,0,0,.3); }
.book-analysis-tab:hover:not([aria-selected='true']) { background:rgba(214,172,97,.12); }
.book-analysis-tab:focus-visible { outline:2px solid var(--gold-bright);outline-offset:2px; }
.book-analysis-grid { display:grid;grid-template-columns:minmax(0,1.52fr) minmax(280px,1fr);gap:22px; }
.book-chart-panel,.book-comparison-panel { background:radial-gradient(circle at 50% 0%,rgba(38,60,83,.24),transparent 75%),linear-gradient(155deg,#0d1928,#07101b);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);min-width:0; }
.book-chart-panel { padding:27px 28px 26px; }
.book-chart-panel [hidden] {display:none !important;}
.book-chart-panel h3,.book-comparison-panel h3 { font-size:1.33rem;font-weight:normal;margin:0 0 9px; }
.book-panel-intro {margin:0;color:var(--muted);font:.85rem/1.5 Arial,Helvetica,sans-serif;}
.book-plot-placeholder { min-height:320px;display:flex; flex-direction:column;justify-content:center;align-items:center;gap:9px;text-align:center;padding:20px 12px; }
.book-plot-placeholder strong { font-size:1.13rem;font-weight:normal; }
.book-plot-placeholder small { color:var(--muted);font:.82rem/1.45 Arial,Helvetica,sans-serif; }
.book-plot-decor { width:165px;height:165px;opacity:.68; margin:12px 0 10px; position:relative; background:repeating-radial-gradient(circle,transparent 0 24px,rgba(214,172,97,.15) 25px 26px,transparent 27px 36px);border:1px solid rgba(214,172,97,.17);border-radius:50%; }
.book-plot-decor::after { content:'✦';color:var(--gold);font-size:2.1rem;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%); }
.book-plot-decor::before {content:'';position:absolute;inset:15%;border-left:1px solid rgba(214,172,97,.2);border-right:1px solid rgba(214,172,97,.2);transform:rotate(45deg); }
.book-plot-decor--themes::after {content:'✧';}
.book-coming-soon {display:inline-block;color:var(--gold);border:1px solid rgba(214,172,97,.3);border-radius:40px;font: .7rem Arial,Helvetica,sans-serif;letter-spacing:.035em;padding:6px 10px; }
.book-compare-ornament {color:var(--gold);font-size:1.5rem;line-height:1;margin-bottom:22px;}
.book-comparison-panel {display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:28px 26px; }
.book-comparison-panel p {color:var(--cream-soft);font:.88rem/1.65 Arial,Helvetica,sans-serif;max-width:275px; margin:3px 0 0;}
.book-compare-visual {width:130px;height:100px;position:relative;margin:26px auto;}
.book-circle {position:absolute;border:2px solid var(--gold);background:rgba(214,172,97,.10);border-radius:50%;width:86px;height:86px;top:7px;left:5px;}
.book-circle--second {border-color:#72a9be;background:rgba(114,169,190,.12);left:43px;}
.book-pending-action {border:1px solid var(--line);border-radius:50px;color:var(--gold-bright);padding:12px 17px;font:.8rem Arial,Helvetica,sans-serif; }
.book-comparison-panel .book-small-note {font-size:.76rem;color:var(--muted);margin-top:14px;}
.book-discovery {padding-bottom:25px;}
.book-carousel-placeholder {display:grid;grid-template-columns:minmax(190px,1fr) minmax(0,1.3fr) auto;gap:25px;align-items:center;border-top:1px solid var(--line-soft);padding:24px 0;}
.book-carousel-placeholder h3 {font-size:1.35rem;font-weight:normal;margin:0 0 9px;}
.book-carousel-placeholder p {color:var(--muted);font:.83rem/1.5 Arial,Helvetica,sans-serif;margin:0;max-width:280px;}
.book-placeholder-covers {display:flex;justify-content:center;gap:13px;}
.book-placeholder-covers span {display:block;width:58px;height:83px;background:linear-gradient(130deg,rgba(40,58,76,.60),rgba(9,16,26,.3));border:1px dashed rgba(214,172,97,.25);border-radius:5px; }
@media(max-width:840px){
 .book-feature{grid-template-columns:195px minmax(0,1fr);gap:30px;}
 .book-analysis-grid{grid-template-columns:1fr;}
 .book-comparison-panel{min-height:270px;}
 .book-carousel-placeholder{grid-template-columns:1fr auto;}
 .book-placeholder-covers{grid-column:1/-1;grid-row:2;justify-content:flex-start;}
}
@media(max-width:600px){
 .book-masthead-art{height:84px;}
 .book-masthead-bar{padding-bottom:17px;}
 .book-return{font-size:.74rem;}
 .book-breadcrumb{padding:17px 0 20px;}
 .book-feature{grid-template-columns:118px minmax(0,1fr);gap:18px;padding:0 0 30px;}
 .book-feature h1{font-size:clamp(1.8rem,8vw,2.55rem);margin-top:8px;}
 .book-byline{font-size:1rem;}
 .book-feature-cover{padding:4px;}
 .book-feature-content{padding-top:2px;}
 .book-eyebrow{font-size:.61rem;}
 .book-description-block{margin-top:22px;}
  .book-description-block p{font-size:.94rem;line-height:1.7;}
 .book-traits{margin-top:17px;}
 .book-analysis,.book-discovery{padding-top:34px;}
 .book-analysis-tabs{width:100%;justify-content:stretch;}
 .book-analysis-tab{flex:1;padding:11px 9px;}
 .book-chart-panel{padding:22px 18px;}
 .book-plot-placeholder{min-height:275px;}
 .book-carousel-placeholder{grid-template-columns:1fr auto;gap:14px;}
 .book-carousel-placeholder h3{font-size:1.14rem;}
 .book-placeholder-covers span{width:46px;height:68px;}
}

/* Live curated Reading Experience radar and book comparisons. */
.book-experience-visual { margin-top: 12px; }
.book-radar-chart { width: 100%; max-width: 580px; margin: 0 auto; }
.book-radar-svg { display: block; width: 100%; height: auto; overflow: visible; }
.book-radar-axis { font: 15px Arial,Helvetica,sans-serif; fill: var(--cream-soft); }
.book-radar-zero { font: 12px Arial,Helvetica,sans-serif; fill: var(--muted); }
.book-profile-key { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin: -1px auto 17px; }
.book-profile-key-item { display: inline-flex; align-items: center; gap: 7px; color: var(--cream-soft); font: .79rem Arial,Helvetica,sans-serif; }
.book-profile-key-item i { width: 10px; height: 10px; border-radius: 3px; }
.book-profile-explainer { font: .79rem/1.65 Arial,Helvetica,sans-serif; color: var(--muted); margin: 0 0 20px; text-align: center; }
.book-compare-label { display: block; align-self: stretch; text-align: left; font: .77rem Arial,Helvetica,sans-serif; margin: 25px 0 8px; color: var(--gold-bright); }
.book-compare-search { align-self: stretch; width: 100%; position: relative; }
.book-compare-search input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 12px 13px; background: #070e18; color: var(--cream); font: .9rem Arial,Helvetica,sans-serif; }
.book-compare-search input:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.book-compare-results { display: flex; flex-direction: column; max-height: 250px; overflow: auto; width: 100%; }
.book-compare-results p { color: var(--muted); text-align: left; max-width: none; font: .79rem/1.5 Arial,Helvetica,sans-serif; padding: 10px; }
.book-compare-result { color: var(--cream); background: rgba(214,172,97,.07); border: 1px solid var(--line-soft); cursor: pointer; padding: 11px; text-align: left; font: .82rem Arial,Helvetica,sans-serif; }
.book-compare-result:hover,.book-compare-result:focus-visible { background: rgba(214,172,97,.2); outline-color: var(--gold); }
.book-compare-current { display: flex; align-items: center; gap: 10px; align-self: stretch; margin-top: 18px; padding: 11px; border: 1px solid rgba(141,196,223,.32); border-radius: 9px; font: .82rem Arial,Helvetica,sans-serif; color: var(--cream); text-align: left; }
.book-compare-current[hidden],.book-compare-go[hidden] { display:none; }
.book-compare-current span:nth-child(2) { flex:1; }
.book-compare-swatch { width: 10px; height: 10px; flex: none; border-radius: 3px; background: #8dc4df; }
.book-compare-current button { border: 0; background: transparent; color: var(--cream); cursor: pointer; font-size: 1.4rem; }
.book-compare-go { display: block; align-self: stretch; margin: 16px 0 0; border-radius: 9px; border: 1px solid var(--line); padding: 12px; color: var(--gold-bright); font: .83rem Arial,Helvetica,sans-serif; text-decoration: none; }
.book-compare-go:hover { background: rgba(214,172,97,.12); }

/* Experimental Find a variation: same palette/components as the main archive. */
.book-analysis [hidden] { display: none !important; }
.book-mode-tabs { display: flex; gap: 4px; width: fit-content; max-width: 100%; padding: 4px; margin: 15px 0 12px;
    border: 1px solid var(--line); border-radius: 40px; background: rgba(2,7,12,.52); }
.book-mode-button { border: 0; border-radius: 40px; background: transparent; color: var(--cream-soft);
    padding: 10px 16px; font: .79rem Arial,Helvetica,sans-serif; cursor: pointer; }
.book-mode-button[aria-pressed='true'] { background: rgba(221,175,100,.18); color: var(--gold-bright);
    box-shadow: inset 0 0 0 1px rgba(214,172,97,.36); }
.book-mode-button:focus-visible,.book-tune-handle:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 3px; }
.book-tune-handle { cursor: grab; touch-action: none; filter: drop-shadow(0 0 4px rgba(228,185,111,.55)); }
.book-tune-handle:active { cursor: grabbing; }
.book-tune-actions { border-top: 1px solid var(--line-soft); margin-top: 16px; padding-top: 18px; }
.book-tune-changes { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; min-height: 22px;
    font: .78rem/1.4 Arial,Helvetica,sans-serif; color: var(--muted); margin-bottom: 15px; }
.book-tune-chip { padding: 5px 8px; color: var(--gold-bright); border: 1px solid rgba(214,172,97,.28);
    background: rgba(214,172,97,.08); border-radius: 18px; }
.book-tune-action-row { display: flex; flex-wrap: wrap; gap: 11px; justify-content: space-between; }
.book-tune-generate { padding: 12px 18px; border: 0; border-radius: 9px; color: #111820;
    background: linear-gradient(135deg,#edc981,#cda35b); font: 600 .85rem Arial,Helvetica,sans-serif;
    cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.book-tune-generate:hover:not(:disabled) { filter: brightness(1.1); }
.book-tune-generate:disabled { opacity: .65; cursor: wait; }
.book-tune-reset { padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px;
    background: rgba(12,23,36,.8); color: var(--cream-soft); font: .81rem Arial,Helvetica,sans-serif; cursor: pointer; }
.book-tune-reset:hover { border-color: var(--gold); color: var(--gold-bright); }
.book-tune-controls { width: 100%; text-align: left; align-self: stretch; }
.book-tune-controls h3 { text-align: left; }
.book-comparison-panel.is-tune { justify-content: flex-start; align-items: stretch; text-align: left; }
.book-comparison-panel.is-tune p { max-width: none; }
.book-tune-example { margin: 21px 0; padding: 15px; border-left: 2px solid var(--gold);
    background: rgba(214,172,97,.055); color: var(--cream-soft); font: .84rem/1.7 Arial,Helvetica,sans-serif; }
.book-tune-results { margin-top: 20px; padding: 24px 22px 22px;
    border: 1px solid var(--line); border-radius: 18px;
    background: linear-gradient(145deg,rgba(17,29,43,.95),rgba(5,11,19,.95)); }
.book-tune-results-heading { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 17px; }
.book-tune-results-heading h3 { margin: 0 0 5px; font-size: 1.3rem; font-weight: 400; }
.book-tune-results-heading p { margin:0; color:var(--muted); font: .78rem/1.5 Arial,Helvetica,sans-serif; }
.book-tune-carousel-controls { display: flex; gap: 7px; }
.book-tune-carousel-controls button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%;
    background: rgba(214,172,97,.08); color: var(--gold-bright); font: 1.2rem Arial,Helvetica,sans-serif; cursor: pointer; }
.book-tune-carousel-controls button:hover { background: rgba(214,172,97,.19); }
.book-tune-carousel { display: flex; gap: 13px; overflow-x: auto; scroll-snap-type: x mandatory;
    scroll-padding: 6px; padding: 6px 3px 14px; scrollbar-color: rgba(214,172,97,.48) transparent; }
.book-tune-card { flex: 0 0 clamp(123px, 17%, 166px); text-align: left; padding: 0; scroll-snap-align: start;
    color: inherit; font-family: inherit; }
.book-tune-card[aria-pressed='true'] { border-color: #80c5ad; box-shadow: 0 0 0 1px rgba(128,197,173,.55),0 12px 28px rgba(0,0,0,.35); }
.book-tune-card .book-info { padding: 10px 11px 12px; min-height: 74px; }
.book-tune-card .book-title { font-size: .88rem; }
.book-tune-card .author { font-size: .73rem; }
.book-tune-card .rank-badge { width: 26px; height: 26px; min-width: 26px; top: 7px; left: 7px; font-size: .67rem; }
.book-tune-preview { margin-top: 18px; padding: 20px; border:1px solid rgba(128,197,173,.25);
    border-radius: 12px; background: radial-gradient(circle at 0 0,rgba(50,86,86,.20),transparent 60%),rgba(4,11,17,.45);
    display: grid; grid-template-columns: 122px minmax(0,1fr); gap: 24px; }
.book-tune-preview-cover { width: 100%; aspect-ratio: 2/3; object-fit: contain; border-radius: 6px;
    border: 1px solid var(--line); background: #091320; }
.book-tune-preview-info h4 { margin: 0 0 4px; color: var(--cream); font-size: 1.3rem; font-weight: 400; }
.book-tune-preview-author,.book-tune-preview-series { color: var(--gold); margin: 0 0 7px;
    font: .85rem/1.4 Arial,Helvetica,sans-serif; }
.book-tune-preview-series { color: var(--muted); }
.book-tune-preview-description { margin: 0; color: var(--cream-soft); font: .86rem/1.7 Arial,Helvetica,sans-serif; }
.book-tune-preview-tags { display:flex; flex-wrap:wrap; gap:6px; margin: 13px 0; }
.book-tune-preview-tags span { border:1px solid rgba(214,172,97,.24); border-radius: 20px; padding:5px 9px;
    background:rgba(214,172,97,.08); color:var(--gold-bright); font: .72rem Arial,Helvetica,sans-serif; }
.book-tune-preview-info .book-compare-go { display: inline-block; padding: 9px 12px; }
button:focus-visible,.book-tune-carousel-controls button:focus-visible { outline:2px solid var(--gold-bright); outline-offset:2px; }
@media(max-width:600px) {
    .book-mode-tabs { width: 100%; }
    .book-mode-button { flex: 1; padding: 9px 7px; font-size: .73rem; }
    .book-tune-action-row { align-items: stretch; }
    .book-tune-generate { flex: 1; padding: 12px 10px; }
    .book-tune-results { padding: 17px 12px; }
    .book-tune-card { flex-basis: 140px; }
    .book-tune-preview { grid-template-columns: 80px minmax(0,1fr); gap: 13px; padding: 13px; }
    .book-tune-preview-info h4 { font-size: 1.06rem; }
}

/* Preserve the full-width search layout after nesting controls for the two modes. */
#book-compare-controls { width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; }

/* The theme data is a separate optional runtime export. Be transparent if absent. */
.book-theme-unavailable {
    padding: 30px 24px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(10, 20, 31, .55);
}
.book-theme-unavailable h3 { font-size: 1.3rem; margin: 0 0 12px; }
.book-theme-unavailable p { color: var(--muted); font: .89rem/1.7 Arial, Helvetica, sans-serif; margin: 0; }
.book-theme-unavailable code { color: var(--gold-bright); overflow-wrap: anywhere; }

/* Two finished discovery carousels. Keep familiar Prescillium card styling. */
.book-discovery { padding-top: 50px; padding-bottom: 20px; }
.book-discovery-section { padding: 23px 0 27px; border-top:1px solid var(--line-soft); }
.book-discovery-section-heading { display:flex; justify-content:space-between; gap:14px; align-items:center; margin-bottom:13px; }
.book-discovery-section-heading h2 { font-size:1.42rem; font-weight:normal; margin:0 0 6px; }
.book-discovery-section-heading p { font: .85rem/1.5 Arial,Helvetica,sans-serif; color:var(--muted); margin:0; }
.book-discovery-track { gap:14px; padding:7px 3px 12px; }
.book-discovery-card { flex:0 0 clamp(132px, 16.3%, 172px); display:flex; text-decoration:none; padding:0; text-align:left; color:inherit; font-family:inherit; scroll-snap-align:start; }
.book-discovery-card .book-info { min-height:120px; padding:11px 12px 13px; }
.book-discovery-card .book-title { font-size:.9rem; }
.book-discovery-card .author { font-size:.75rem; }
.book-discovery-card .rank-badge { height:27px; min-width:27px; top:8px; left:8px; font-size:.68rem; }
.book-discovery-signals { display:flex; flex-direction:column; gap:4px; margin-top:auto; padding-top:14px; color:var(--cream-soft); font: .71rem/1.35 Arial,Helvetica,sans-serif; }
.book-discovery-signals span:last-child { color:#98d0bf; }
.book-discovery-inline-preview { border:1px solid var(--line); border-radius:12px; margin:13px 0; padding:18px; background:rgba(15,26,40,.85); }
.book-discovery-inline-preview[hidden] { display:none; }
.book-discovery-inline-preview h4 { font:1.15rem Georgia,serif; margin:0 0 5px; }
.book-discovery-inline-preview p { color:var(--cream-soft); font:.86rem/1.6 Arial,Helvetica,sans-serif; margin:5px 0; }
.book-discovery-preview-author { color:var(--gold) !important; }
@media(max-width:600px) {
 .book-discovery {padding-top:32px;}
 .book-discovery-section-heading h2 {font-size:1.24rem;}
 .book-discovery-section-heading p {font-size:.78rem;}
 .book-discovery-card {flex-basis:145px;}
 .book-discovery-section-heading .book-tune-carousel-controls button {width:32px;height:32px;}
}


/* Subtle axis guide: accessible modal shared by Reading Experience and Themes. */
.book-chart-title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.book-chart-title-row h3 { margin: 0 0 9px; }
.book-axis-help-open {
    flex: none; display: inline-grid; place-items: center; width: 31px; height: 31px;
    margin: 0 0 9px; padding: 0; border-radius: 50%;
    border: 1px solid var(--line); background: rgba(214,172,97,.075);
    color: var(--gold-bright); cursor: pointer; font: 600 .94rem Arial,Helvetica,sans-serif;
}
.book-axis-help-open:hover { background: rgba(214,172,97,.18); border-color: var(--gold); }
.book-axis-help-open:focus-visible,.book-axis-help-close:focus-visible {
    outline: 2px solid var(--gold-bright); outline-offset: 3px;
}
.book-axis-help-dialog {
    position: fixed; inset: 0; width: min(610px, calc(100vw - 28px));
    max-height: min(85vh, 760px); max-height: min(85dvh, 760px);
    margin: auto; padding: 0; overflow-y: auto; box-sizing: border-box;
    border: 1px solid var(--line); border-radius: 16px;
    background: linear-gradient(155deg, #132337, #08111c 80%); color: var(--cream);
    box-shadow: 0 25px 85px rgba(0,0,0,.75);
}
.book-axis-help-dialog::backdrop { background: rgba(2,6,11,.77); backdrop-filter: blur(3px); }
.book-axis-help-inner { padding: 25px 29px 27px; }
.book-axis-help-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.book-axis-help-header h2 { margin: 0; font: normal 1.48rem/1.2 Georgia,serif; }
.book-axis-help-close { width: 34px; height: 34px; flex: none; border: 1px solid var(--line);
    background: rgba(214,172,97,.08); color: var(--cream); border-radius: 50%;
    cursor: pointer; font: 1.45rem/1 Arial,Helvetica,sans-serif; }
.book-axis-help-close:hover { border-color: var(--gold); color: var(--gold-bright); }
.book-axis-help-intro { color: var(--muted); margin: 9px 0 20px; font: .86rem/1.6 Arial,Helvetica,sans-serif; }
.book-axis-help-list { margin: 0; }
.book-axis-help-list dt { margin: 15px 0 4px; color: var(--gold-bright); font: 600 .88rem/1.4 Arial,Helvetica,sans-serif; }
.book-axis-help-list dd { margin: 0; color: var(--cream-soft); font: .85rem/1.65 Arial,Helvetica,sans-serif; }
.book-axis-help-footnote { border-top: 1px solid var(--line-soft); padding-top: 15px; margin: 21px 0 0;
    color: var(--muted); font: .77rem/1.55 Arial,Helvetica,sans-serif; }
@media(max-width:600px) {
    .book-axis-help-inner { padding: 21px 19px 23px; }
    .book-axis-help-header h2 { font-size: 1.27rem; }
}

/* Book-page navigation search: unobtrusive desktop toolbar, accessible mobile wrap. */
.book-masthead { z-index: 15; }
.book-masthead-bar { z-index: 16; }
.book-masthead-actions { display:flex; align-items:center; justify-content:flex-end; gap:25px; margin-left:auto; min-width:0; }
.book-return { white-space:nowrap; }
.book-header-search { position:relative; flex:0 1 282px; width:282px; min-width:195px; margin:0; }
.book-header-search input {
    display:block; box-sizing:border-box; width:100%; min-width:0; height:37px; padding:8px 36px 8px 13px;
    border:1px solid rgba(214,172,97,.34); border-radius:22px;
    background:rgba(9,19,31,.87); color:var(--cream);
    font:.81rem Arial,Helvetica,sans-serif;
}
.book-header-search input::placeholder {color:var(--muted); opacity:1;}
.book-header-search input:focus-visible {outline:2px solid var(--gold-bright);outline-offset:2px;}
.book-header-search-icon {position:absolute;right:13px;top:6px;font:1.42rem/1 Arial,Helvetica,sans-serif;color:var(--gold);pointer-events:none;}
.book-header-search-results {
    position:absolute; z-index:30; top:calc(100% + 7px); right:0; width:min(370px, calc(100vw - 36px));
    max-height:min(340px, 65vh); overflow:auto;
    border:1px solid var(--line); border-radius:12px; padding:5px;
    background:#0c1827; box-shadow:0 17px 38px rgba(0,0,0,.58);
}
.book-header-search-results[hidden] {display:none;}
.book-header-result {display:flex; flex-direction:column;gap:3px;padding:10px 12px;border-radius:7px;text-decoration:none;}
.book-header-result + .book-header-result {border-top:1px solid rgba(214,172,97,.11);}
.book-header-result:hover,.book-header-result:focus-visible {background:rgba(214,172,97,.14);outline:1px solid rgba(214,172,97,.5);}
.book-header-result-title {font: .86rem/1.3 Georgia,serif;color:var(--cream);}
.book-header-result-author {font:.74rem/1.3 Arial,Helvetica,sans-serif;color:var(--gold-bright);}
.book-header-search-empty {padding:12px;color:var(--muted);font:.78rem/1.5 Arial,Helvetica,sans-serif;}
@media(max-width:690px) {
    .book-masthead-bar {flex-wrap:wrap; gap:12px;}
    .book-wordmark {width:100%;}
    .book-masthead-actions {width:100%;justify-content:space-between; gap:14px; margin-left:0;}
    .book-header-search {width:auto;flex:1 1 auto;min-width:0;max-width:400px;}
    .book-header-search input {height:35px;font-size:.78rem;}
    .book-return {font-size:.72rem;}
}
/* Hide the "Make it your own" panel on mobile in variation mode */
@media (max-width: 840px) {
    .book-comparison-panel.is-tune {
        display: none;
    }
}


/* A large invisible pointer-capture area surrounds each visible gold handle.
   Everywhere else on the radar retains the phone's ordinary page scrolling. */
.book-tune-touch-target { cursor: grab; touch-action: none; }
.book-tune-touch-target:active { cursor: grabbing; }
.book-tune-touch-target:focus-visible { stroke: var(--gold-bright); stroke-width: 1.5; }
.book-tune-handle.is-dragging {
    stroke-width: 3; filter: drop-shadow(0 0 9px rgba(245,207,132,.95));
}

/* Comparison search belongs to the radar on narrow screens, not a second card. */
@media (max-width: 840px) {
    .book-analysis-grid .book-comparison-panel { display: none; }
    .book-chart-panel > #book-compare-controls {
        margin-top: 18px; padding-top: 19px;
        border-top: 1px solid var(--line-soft);
        text-align: left; align-items: stretch;
    }
    .book-chart-panel > #book-compare-controls .book-compare-ornament,
    .book-chart-panel > #book-compare-controls #book-compare-heading,
    .book-chart-panel > #book-compare-controls #book-compare-explainer { display: none; }
    .book-chart-panel > #book-compare-controls .book-compare-label {
        margin: 0 0 10px; font-size: .82rem;
    }
    .book-chart-panel > #book-compare-controls .book-compare-results p { max-width: none; }
}

/* On touchscreens the editable radar itself owns gestures, ensuring the
   browser doesn't steal an active drag for page scrolling. Compare mode
   and the surrounding page retain normal scrolling. */
@media (pointer: coarse) {
    .book-radar-svg--editable { touch-action: none; }
}

/* Mobile book-page reading flow: keep the cover beside the title, but let
   descriptions and characteristic tags use the full width below them. */
@media (max-width: 600px) {
    .book-feature {
        column-gap: 16px;
        row-gap: 0;
        align-items: start;
    }
    .book-feature-content {
        display: contents;
    }
    .book-feature-heading {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        align-self: start;
        padding-top: 2px;
    }
    .book-feature-cover {
        grid-column: 1;
        grid-row: 1;
    }
    .book-feature-details {
        grid-column: 1 / -1;
        min-width: 0;
    }
    .book-feature-details .book-description-block {
        max-width: none;
        margin-top: 22px;
    }
    .book-feature-details .book-traits {
        margin-top: 18px;
    }

    /* Selected variation: likewise, the cover and heading form the first
       row; synopsis, traits and link occupy the whole card below. */
    .book-tune-preview {
        grid-template-columns: 98px minmax(0, 1fr);
        column-gap: 15px;
        row-gap: 0;
        align-items: start;
        padding: 15px;
    }
    .book-tune-preview-cover {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
    }
    .book-tune-preview-info {
        display: contents;
    }
    .book-tune-preview-heading {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        align-self: start;
    }
    .book-tune-preview-details {
        grid-column: 1 / -1;
        min-width: 0;
        padding-top: 16px;
    }
    .book-tune-preview-info h4 {
        font-size: 1.12rem;
        line-height: 1.22;
    }
    .book-tune-preview-description {
        font-size: .88rem;
        line-height: 1.65;
    }
}

/* Account entry shares the book-page top bar without squashing mobile search. */
.book-masthead-actions .prescillium-account{flex:0 0 auto}
@media(max-width:690px){
 .book-masthead-actions{flex-wrap:wrap;gap:10px}
 .book-masthead-actions .book-header-search{order:3;flex:1 1 100%;width:100%;max-width:none}
 .book-masthead-actions .prescillium-account{order:2;margin-left:auto}
}
/* Save to My Books from the featured book, top recommendations and variations. */
.book-feature-save{margin-top:18px}
.book-discovery-card-shell{position:relative;flex:0 0 clamp(132px,16.3%,172px);min-width:0;display:flex;scroll-snap-align:start}
.book-discovery-card-shell .book-discovery-card{width:100%;flex:1 1 auto;min-width:0}
.book-discovery-save{position:absolute;z-index:5;right:8px;top:8px;box-shadow:0 2px 10px #0009}
.book-tune-preview-details .book-save-button,.book-discovery-inline-preview .book-save-button{margin-top:12px}
.book-masthead-actions .my-books-nav{font-size:12px}
@media(max-width:690px){.book-masthead-actions .my-books-nav{font-size:11px}.book-masthead-actions .book-header-search{order:4}.book-masthead-actions .prescillium-account{margin-left:0;order:3}}
@media(max-width:600px){.book-feature-save{margin-top:12px}.book-feature-save .book-save-text{font-size:11px}.book-discovery-card-shell{flex-basis:145px}}

/* Variation preview uses the same rounded Explore/Save controls as book popups. */
.book-tune-preview-details .book-action-row{margin-top:16px}
.book-tune-preview-details .book-action-row .book-save-button{margin:0}
