/* Shared light/dark visual system. Appearance preference lives in theme-ui.js. */
:root {
  color-scheme: light;
  --ac-bg: #f7f5f1;
  --ac-surface: #fffefa;
  --ac-ink: #252b55;
  --ac-muted: #62677d;
  --ac-border: #e4e3e8;
  --ac-soft: #eeedf5;
  --ac-selected: #e9e8f5;
  --ac-action: #252b55;
  --ac-action-text: #fffefa;
  --ac-coral: #ff795b;
  --ac-green: #326248;
  --ac-green-bg: #e8f3eb;
  --ac-amber: #8b591d;
  --ac-amber-bg: #fff1dc;
  --ac-danger: #a13e3e;
  --ac-danger-bg: #fbecec;
  --ac-hover: #f1f0f7;
  --ac-elevated: #fffefa;
  --ac-control-border: #868a9e;
  --ac-link: #4c548b;
  --ac-dot-amber: #b38b36;
  --ac-dot-black: #31343f;
  --ac-violet: #6554a1;
  --ac-violet-bg: #efedf8;
  --ac-queue: #995d3e;
  --ac-queue-bg: #fff0e9;
  --ac-unknown: #746034;
  --ac-unknown-bg: #f3efe5;
  --ac-scrim: #171c2966;
  --ac-shadow: #252b5526;
  --ac-overlay: #f7f5f1f2;
  --ac-space-xs: .25rem;
  --ac-space-sm: .5rem;
  --ac-space-md: .75rem;
  --ac-space-lg: 1rem;
  --ac-space-xl: 1.5rem;
  --ac-space-xxl: 2rem;
  --ac-space-section: 3rem;
  --ac-radius-control: .5rem;
  --ac-radius-selection: .625rem;
  --ac-radius-panel: 1rem;
  --ac-font-interface: 'DM Sans', system-ui, sans-serif;
  --ac-font-editorial: var(--ac-font-interface);
  --ac-font-body-size: 14px;
  --ac-line-body: 1.45;
  --ac-title-size: 28px;
  --ac-title-weight: 600;
  --ac-content-padding: 30px 36px 40px;
}
[data-ac-theme='dark'] {
  color-scheme: dark;
  --ac-bg: #161b27;
  --ac-surface: #202737;
  --ac-ink: #e8eaf6;
  --ac-muted: #a9b1c6;
  --ac-border: #3b465c;
  --ac-soft: #293247;
  --ac-selected: #343f62;
  --ac-action: #b9c3ff;
  --ac-action-text: #202637;
  --ac-green: #9fd6b6;
  --ac-green-bg: #243d33;
  --ac-amber: #eec587;
  --ac-amber-bg: #493b29;
  --ac-danger: #f4a3a3;
  --ac-danger-bg: #442c32;
  --ac-hover: #2b354b;
  --ac-elevated: #283144;
  --ac-control-border: #7986a3;
  --ac-link: #bac5ff;
  --ac-dot-amber: #eec587;
  --ac-dot-black: #0b101b;
  --ac-violet: #c5b7f1;
  --ac-violet-bg: #36314d;
  --ac-queue: #edba9b;
  --ac-queue-bg: #43342e;
  --ac-unknown: #d6c493;
  --ac-unknown-bg: #3b382c;
  --ac-scrim: #080d19b3;
  --ac-shadow: #0000004d;
  --ac-overlay: #161b27f2;
}
.ac-theme {
  font-family: var(--ac-font-interface);
  color: var(--ac-ink);
  background: var(--ac-bg);
  font-size: 1rem;
  line-height: 1.6;
}
.ac-theme *, .ac-theme *::before, .ac-theme *::after { box-sizing: border-box; }
.ac-theme .ac-editorial-title {
  font-family: var(--ac-font-editorial);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -.025em;
}
.ac-theme .ac-work-title { font-size: 1.75rem; line-height: 1.3; font-weight: 600; }
.ac-theme .ac-metadata { color: var(--ac-muted); font-size: .75rem; }
.ac-theme .ac-panel {
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-panel);
  padding: var(--ac-space-xl);
}
.ac-theme .ac-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ac-space-sm);
  padding: .625rem 1rem;
  min-height: 2.375rem;
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-control);
  background: var(--ac-surface);
  color: var(--ac-ink);
  font: 500 .875rem/1.3 var(--ac-font-interface);
}
.ac-theme .ac-button-primary { background: var(--ac-action); color: var(--ac-action-text); border-color: var(--ac-action); }
.ac-theme .ac-button:disabled { opacity: .5; }
.ac-theme .ac-button:focus-visible, .ac-theme input:focus-visible, .ac-theme select:focus-visible {
  outline: 2px solid var(--ac-action);
  outline-offset: 3px;
}
.ac-theme input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), .ac-theme select, .ac-theme textarea {
  font: inherit;
  color: var(--ac-ink);
  background: var(--ac-surface);
  border: 1px solid var(--ac-border);
  border-radius: var(--ac-radius-control);
  padding: .625rem .75rem;
  min-height: 2.375rem;
}
.ac-theme .ac-result-row { padding: 1rem 0; border-bottom: 1px solid var(--ac-border); }
.ac-theme .ac-selected-row { background: var(--ac-selected); border-radius: var(--ac-radius-selection); }
.ac-theme .ac-status { display: inline-flex; align-items: center; padding: .25rem .5rem; font-size: .75rem; border-radius: .3125rem; }
.ac-theme .ac-status-success { background: var(--ac-green-bg); color: var(--ac-green); }
.ac-theme .ac-status-warning { background: var(--ac-amber-bg); color: var(--ac-amber); }
.ac-theme .ac-status-neutral { background: var(--ac-soft); color: var(--ac-muted); }
.ac-theme .ac-status-danger { background: var(--ac-danger-bg); color: var(--ac-danger); }
@media (pointer: coarse) {
  .ac-theme .ac-button, .ac-theme input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), .ac-theme select { min-height: 2.75rem; }
}

/* Shared service shell. Protection is the visual reference for every section. */
.ac-page {
  --bg: var(--ac-bg);
  --paper: var(--ac-surface);
  --surface: var(--ac-surface);
  --panel: var(--ac-surface);
  --ink: var(--ac-ink);
  --muted: var(--ac-muted);
  --line: var(--ac-border);
  --border: var(--ac-border);
  --soft: var(--ac-soft);
  --mint: var(--ac-selected);
  --coral: var(--ac-coral);
  --green: var(--ac-green);
  margin: 0;
  background: var(--ac-bg);
  color: var(--ac-ink);
  font: var(--ac-font-body-size)/var(--ac-line-body) var(--ac-font-interface);
}
.ac-page :is(h1,h2,h3,button,input,select,textarea) { font-family: var(--ac-font-interface); }
.ac-page :is(h1,.simple-heading h1,.reader-greeting h1,.book-copy h1,.author-intro h1,.reading h1,.intro h1) {
  font: var(--ac-title-weight) var(--ac-title-size)/1.15 var(--ac-font-interface);
  letter-spacing: -.7px;
  margin: 0 0 10px;
}
.ac-page h2 { font-size: 18px; line-height: 1.35; font-weight: 600; letter-spacing: -.2px; }
.ac-page h3 { font-size: 15px; line-height: 1.4; font-weight: 600; }
.ac-page .eyebrow { font: 600 11px/1.45 var(--ac-font-interface); letter-spacing: 1.6px; margin: 0 0 10px; color: var(--ac-muted); text-transform: uppercase; }
.ac-page :is(button.primary,button.secondary,.button-link,.trial-button,.all-help,.find-open,.task-links a,.review-link) {
  border-radius: var(--ac-radius-control);
  min-height: 38px;
  padding: 8px 14px;
  font: 500 12px/1.45 var(--ac-font-interface);
}
.ac-page :is(button.primary,.button-link.primary,.trial-button,.all-help[aria-pressed="true"]) {
  background: var(--ac-action);
  border: 1px solid var(--ac-action);
  color: var(--ac-action-text);
}
.ac-page :is(.panel,.review-task,.card,dialog) { border-radius: var(--ac-radius-panel); }
.ac-page dialog { padding: 28px; border: 1px solid var(--ac-border); background: var(--ac-surface); color: var(--ac-ink); }
.ac-page dialog h2 { font: 600 24px/1.25 var(--ac-font-interface); letter-spacing: -.4px; }
.ac-page dialog::backdrop { background: var(--ac-scrim); backdrop-filter: blur(4px); }
.ac-page :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible { outline: 2px solid var(--ac-action); outline-offset: 3px; }
.ac-page button:disabled { opacity: .45; cursor: default; }
.ac-page :is(.avatar,.cover-title) { font-family: var(--ac-font-interface); }
.ac-site-header {
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 14px;
  width: 100%;
  max-width: none;
  height: auto;
  min-height: 80px;
  margin: 0;
  padding: 0 24px;
  background: var(--ac-surface);
  color: var(--ac-ink);
  border-bottom: 1px solid var(--ac-border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.ac-site-header .ac-site-brand { display: flex; align-items: center; padding: 0; margin: 0; width: 155px; height: 68px; flex: 0 0 155px; border: 0; }
.ac-site-header .ac-site-logo { width: 155px; height: 68px; object-fit: contain; flex-shrink: 0; }
.ac-site-header .ac-site-nav { display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; margin: 0; padding: 0; min-width: 0; max-width: 100%; flex: 1; }
.ac-site-header .ac-site-nav :is(a,button) {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 10px 12px;
  min-height: 38px;
  border: 0;
  border-radius: var(--ac-radius-control);
  color: var(--ac-muted);
  background: transparent;
  text-decoration: none;
  font: 600 12px/1.45 var(--ac-font-interface);
}
.ac-site-header .ac-site-nav :is(a,button):hover { color: var(--ac-ink); background: var(--ac-soft); }
.ac-site-header .ac-site-nav :is(a,button)[aria-current="page"] { color: var(--ac-ink); background: var(--ac-selected); }
.ac-header-identity { display: flex; gap: 8px; align-items: center; margin-left: auto; font-size: 12px; }
.ac-header-identity b { font-weight: 500; }
.ac-header-identity small { display: block; color: var(--ac-muted); font-size: 10px; }
.ac-authors-page main { max-width: 1240px; padding: var(--ac-content-padding); min-height: 70vh; }
.ac-account-page main { padding: var(--ac-content-padding); }
.ac-tariffs-page main { padding: 30px 36px 140px; }
.ac-tariffs-page .intro { text-align: left; }
.ac-tariffs-page :is(.intro p,.bottom-info p),.ac-authors-page .intro p:not(.eyebrow) { font-size: 14px; }
.ac-account-page .referral-copy h2,.ac-tariffs-page .bottom-info h3 { font: 600 18px/1.35 var(--ac-font-interface); }
.ac-reviewer-page button { font: 500 12px/1.45 var(--ac-font-interface); min-height: 38px; border-radius: var(--ac-radius-control); }
.ac-reviewer-page main { margin: 0 auto; padding: var(--ac-content-padding); }
.ac-login-page .auth-story h1 { font-size: var(--ac-title-size); line-height: 1.2; letter-spacing: -.7px; }
.ac-login-page .auth-header { justify-content: space-between; }
@media (max-width: 1100px) {
  .ac-header-identity { display: none; }
}
@media (max-width: 960px) {
  .ac-site-header { gap: 0; padding: 0 20px 8px; }
  .ac-site-header .ac-site-brand,.ac-site-header .ac-site-logo { height: 56px; }
  .ac-site-header .ac-site-nav { order: 3; flex: 0 0 100%; width: 100%; overflow-x: auto; scrollbar-width: thin; }
}
@media (max-width: 720px) {
  .ac-page { --ac-title-size: 24px; --ac-content-padding: 24px 20px 32px; }
  .ac-site-header { padding-left: 16px; padding-right: 16px; }
  .ac-site-header .ac-site-nav :is(a,button) { padding: 9px 10px; }
  .ac-tariffs-page main { padding: 24px 20px 150px; }
  .ac-page dialog { padding: 22px; }
}

@media (min-width: 961px) {
  /* Keep room for the protection page's role and notification controls. */
  .topbar .ac-site-nav { flex: 0 0 auto; }
}

/* Unified sidebars and current-user profile. Existing data and commands are retained. */
body.sp-prototype{--sp-sidebar-width:304px;--sp-rail-width:72px;--sp-side-padding:16px}
body.sp-prototype .ac-site-header{flex-wrap:nowrap;gap:16px;padding:0 24px;min-height:80px;flex-shrink:0;overflow:visible;z-index:25}
body.sp-prototype .ac-site-header .ac-site-nav{flex:1 1 auto;gap:3px;min-width:0;align-self:center}
body.sp-prototype .ac-site-header .ac-site-nav :is(a,button){padding:12px 11px;font-size:14px;white-space:nowrap}
body.sp-prototype .ac-site-header>.spacer{display:none}
body.sp-prototype .ac-site-header .ac-site-logo{width:178px;flex:0 0 178px}
body.sp-prototype .ac-site-header .ac-site-brand{width:178px;flex:0 0 178px}
body.sp-prototype .ac-site-header #language-switch{font-size:12px;min-width:52px;width:52px;margin:0}
body.sp-prototype .sp-profile{position:relative;flex-shrink:0;margin-left:auto;align-self:center;color:var(--ac-ink);font-family:inherit}
body.sp-prototype .sp-profile-trigger{display:flex;align-items:center;gap:10px;padding:6px 8px;border-radius:10px;list-style:none;cursor:pointer;min-height:48px;user-select:none}
body.sp-prototype .sp-profile-trigger::-webkit-details-marker{display:none}
body.sp-prototype .sp-profile-trigger:hover,body.sp-prototype .sp-profile[open] .sp-profile-trigger{background:var(--ac-soft)}
body.sp-prototype .sp-profile-avatar{display:flex;flex-shrink:0;width:38px;height:38px;align-items:center;justify-content:center}
body.sp-prototype .sp-profile-avatar :is(.avatar,.avatar-placeholder,.sp-profile-photo){width:38px;height:38px;border-radius:50%;object-fit:cover}
body.sp-prototype .sp-profile-avatar .avatar-image{width:100%;height:100%;object-fit:cover;border-radius:50%}
body.sp-prototype .sp-profile-copy{display:flex;flex-direction:column;gap:3px;max-width:180px}
body.sp-prototype .sp-profile-copy strong{font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
body.sp-prototype .sp-profile-copy small{font-size:11px;color:var(--ac-muted)}
body.sp-prototype .sp-profile-chevron{color:var(--ac-muted);font-size:17px;margin-left:3px}
body.sp-prototype .sp-profile-menu{position:absolute;top:calc(100% + 10px);right:0;width:304px;padding:20px;background:var(--ac-surface);border:1px solid var(--ac-border);border-radius:14px;box-shadow:0 16px 45px var(--ac-shadow);z-index:50}
body.sp-prototype .sp-menu-name{font-size:16px;font-weight:600;line-height:1.4}
body.sp-prototype .sp-menu-role{font-size:12px;color:var(--ac-muted);margin-top:4px}
body.sp-prototype .sp-menu-official{padding:16px 0;flex-wrap:wrap;gap:8px;margin:0}
body.sp-prototype .sp-menu-official a{padding:8px;border-radius:7px}
body.sp-prototype .sp-menu-balance{padding:16px 0;border-top:1px solid var(--ac-border);border-bottom:1px solid var(--ac-border);margin:4px 0 12px}
body.sp-prototype .sp-menu-balance .credit-balance{padding:0;display:flex;align-items:center;justify-content:space-between;margin:0;font-size:13px}
body.sp-prototype .sp-profile-roles{display:flex;width:100%;margin:12px 0;justify-content:center}
body.sp-prototype .sp-profile-roles button{flex:1;font-size:12px;padding:9px 8px;text-align:center}
body.sp-prototype .sp-account-link{display:block;padding:12px 8px;border-radius:8px;font-size:13px;color:var(--ac-ink)}
body.sp-prototype .sp-account-link:hover{background:var(--ac-soft)}
body.sp-prototype.sp-unified-sidebar :is(.shell,.registry-shell){grid-template-columns:var(--sp-sidebar-width) minmax(0,1fr);min-width:0}
body.sp-prototype.sp-unified-sidebar.sp-collapsed :is(.shell,.registry-shell){grid-template-columns:var(--sp-rail-width) minmax(0,1fr)}
body.sp-prototype .sp-sidebar{padding:16px var(--sp-side-padding);background:var(--ac-surface);border-right:1px solid var(--ac-border);min-width:0;scrollbar-width:thin}
body.sp-prototype .sp-sidebar-head{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:44px;margin:0 0 16px;padding:0 6px;flex-shrink:0}
body.sp-prototype .sp-sidebar-head h2{font-size:17px;line-height:1.35;font-weight:600;letter-spacing:-.3px;margin:0}
body.sp-prototype .sp-sidebar-toggle{display:flex;align-items:center;justify-content:center;padding:0;width:36px;height:36px;min-height:36px;flex-shrink:0;background:transparent;border:1px solid transparent;border-radius:8px;color:var(--ac-muted);font-size:26px;font-weight:400;line-height:1}
body.sp-prototype .sp-sidebar-toggle:hover{background:var(--ac-soft);border-color:transparent}
body.sp-prototype .sp-sidebar .catalog{padding-right:2px}
body.sp-prototype .sp-sidebar .monitor-control{margin:0 0 12px;width:100%;padding:10px 12px;min-height:44px;gap:8px;font-size:12px}
body.sp-prototype .sp-sidebar .catalog-overview{padding:0 10px 12px;font-size:12px}
body.sp-prototype .sp-sidebar .all-books{padding:12px 10px;min-height:44px;margin:0 0 10px;border-radius:9px;font-size:13px}
body.sp-prototype .sp-sidebar .series-head{padding:12px 6px;gap:8px;min-height:72px}
body.sp-prototype .sp-sidebar .series-title{font-size:14px;line-height:1.35;overflow-wrap:anywhere}
body.sp-prototype .sp-sidebar .series-kind{font-size:11px}
body.sp-prototype .sp-sidebar .series-info{font-size:11px;gap:8px}
body.sp-prototype .sp-sidebar .book-row{min-height:68px;padding:9px 8px;gap:9px;margin:2px 0}
body.sp-prototype .sp-sidebar .book-title{font-size:13px;line-height:1.4;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
body.sp-prototype .sp-sidebar .cover{width:32px;height:46px;max-width:none}
body.sp-prototype .sp-sidebar .cover-audio{height:32px}
body.sp-prototype .sp-sidebar .availability{font-size:11px}
body.sp-prototype .sp-sidebar .network-list{margin:4px 0 14px;gap:5px}
body.sp-prototype .sp-sidebar .network-row{min-height:48px;padding:11px 10px;border-radius:9px;gap:11px;font-size:13px}
body.sp-prototype .sp-sidebar .network-name{font-size:13px;line-height:1.4;overflow-wrap:anywhere}
body.sp-prototype .sp-sidebar .network-name small{font-size:11px;margin-top:3px}
body.sp-prototype .sp-sidebar>.meta{font-size:12px;line-height:1.6;margin:0 6px 16px}
body.sp-prototype .sp-sidebar>.eyebrow{font-size:10px;padding:0 6px;margin-bottom:5px}
body.sp-prototype .sp-sidebar .network-actions{padding:14px 0 0;margin-top:auto;display:grid;gap:8px}
body.sp-prototype .sp-sidebar .network-actions+.meta{font-size:11px;margin-top:16px}
body.sp-prototype .main,body.sp-prototype .registry{min-width:0}
body.sp-prototype.sp-collapsed .sp-sidebar{padding:16px 10px}
body.sp-prototype.sp-collapsed .sp-sidebar-head{justify-content:center;padding:0}
body.sp-prototype.sp-collapsed .sp-sidebar-head h2,body.sp-prototype.sp-collapsed .sp-sidebar>.eyebrow,body.sp-prototype.sp-collapsed .sp-sidebar>.meta,body.sp-prototype.sp-collapsed .catalog-overview,body.sp-prototype.sp-collapsed .catalog-info,body.sp-prototype.sp-collapsed .catalog-refresh-control{display:none}
body.sp-prototype.sp-collapsed .monitor-control{justify-content:center;padding:10px 0;gap:0}
body.sp-prototype.sp-collapsed .monitor-control :is(.monitor-label,time,.monitor-date){display:none}
body.sp-prototype.sp-collapsed .sp-sidebar .all-books{justify-content:center;padding:12px 0}
body.sp-prototype.sp-collapsed .sp-sidebar .all-books>span{display:none}
body.sp-prototype.sp-collapsed .sp-sidebar .series-head{justify-content:center;gap:0;padding:10px 0;min-height:62px}
body.sp-prototype.sp-collapsed .sp-sidebar .series-head :is(.series-toggle,.series-select){display:none}
body.sp-prototype.sp-collapsed .sp-sidebar .book-row{flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:84px;padding:8px 0}
body.sp-prototype.sp-collapsed .sp-sidebar .book-cover-control{align-self:center;display:flex;align-items:center;justify-content:center;width:36px;height:46px}
body.sp-prototype.sp-collapsed .sp-sidebar .book-row :is(.book-title,.availability){display:none}
body.sp-prototype.sp-collapsed .sp-sidebar .book-format{position:static;display:flex;align-items:center;justify-content:center;width:32px;height:16px;background:transparent;border-radius:0;padding:0;flex-shrink:0}
body.sp-prototype.sp-collapsed .sp-sidebar .network-row{justify-content:center;position:relative;padding:12px 0;min-height:54px}
body.sp-prototype.sp-collapsed .sp-sidebar .network-name{display:none}
body.sp-prototype.sp-collapsed .sp-sidebar .network-row>.count{position:absolute;right:-2px;bottom:1px;font-size:9px;max-width:36px;overflow:hidden}
body.sp-prototype.sp-collapsed .sp-sidebar .network-actions{display:none}
body.sp-prototype.sp-collapsed .sp-sidebar .network-symbol{width:28px}
body.sp-prototype.sp-collapsed .sp-sidebar .network-mascot{width:28px;height:28px}
body.sp-prototype.sp-unified-sidebar.single-page-cabinet{--reader-rail-width:304px}
body.sp-prototype.sp-unified-sidebar.single-page-cabinet.sp-collapsed{--reader-rail-width:72px}
body.sp-prototype .reader-rating{width:var(--reader-rail-width);padding:16px}
body.sp-prototype .reader-rating .rating-rail-top{padding:0 6px;margin-bottom:16px;min-height:44px}
body.sp-prototype .reader-rating .rating-rail-heading{display:flex;flex-direction:column;align-items:flex-start;gap:3px}
body.sp-prototype .reader-rating .rating-rail-heading small{font-size:11px;color:var(--ac-muted)}
body.sp-prototype .reader-rating .rating-list{padding:0;gap:6px}
body.sp-prototype .reader-rating .rating-row{padding:12px;min-height:72px;gap:10px}
body.sp-prototype .reader-rating .rating-name{font-size:13px}
body.sp-prototype .reader-rating .rating-self{background:var(--ac-selected)}
body.sp-prototype .reader-rating .reader-rank{font-size:10px}
body.sp-prototype.sp-collapsed .reader-rating .rating-rail-heading{display:none}
body.sp-prototype.sp-collapsed .reader-rating .rating-rail-top{flex-direction:row;justify-content:center;gap:0}
body.sp-prototype.sp-collapsed .reader-rating .rating-list{padding:0}
body.sp-prototype.sp-collapsed .reader-rating .rating-row{padding:10px 0;min-height:64px}
body.sp-prototype.sp-collapsed .reader-rating .rating-self{background:transparent}
body.sp-prototype .reader-greeting h1{font-size:28px}
body.sp-prototype .reader-level{padding-left:0}
@media(max-width:1250px){body.sp-prototype .ac-site-header{gap:10px;padding:0 18px}body.sp-prototype .ac-site-header .ac-site-nav :is(a,button){padding:11px 9px;font-size:13px}body.sp-prototype .ac-site-header .ac-site-logo,body.sp-prototype .ac-site-header .ac-site-brand{width:155px;flex-basis:155px}body.sp-prototype .sp-profile-copy{max-width:152px}}
@media(max-width:1080px){body.sp-prototype .sp-profile-copy{display:none}body.sp-prototype .ac-site-header .ac-site-nav{flex:1 1 auto}}
@media(max-width:960px){body.sp-prototype .ac-site-header{flex-wrap:wrap;padding-bottom:8px;gap:0 12px}body.sp-prototype .ac-site-header .ac-site-nav{order:5;flex:0 0 100%;width:100%;overflow:auto}body.sp-prototype .ac-site-header .sp-profile{margin-left:auto}body.sp-prototype .ac-site-header #notification-bell{margin-left:auto}body.sp-prototype .sp-profile-copy{display:flex}body.sp-prototype .ac-site-header .ac-site-logo,body.sp-prototype .ac-site-header .ac-site-brand{height:60px}body.sp-prototype .topbar{height:auto;min-width:0}}
@media(max-width:720px){body.sp-prototype .sp-profile-copy{display:none}body.sp-prototype.sp-unified-sidebar :is(.shell,.registry-shell){position:relative;grid-template-columns:72px minmax(0,1fr)}body.sp-prototype.sp-unified-sidebar:not(.sp-collapsed) :is(.shell,.registry-shell)>.sp-sidebar{position:absolute;inset:0 auto 0 0;width:304px;max-width:100%;z-index:15;box-shadow:14px 0 36px var(--ac-shadow)}body.sp-prototype.sp-unified-sidebar:not(.sp-collapsed) :is(.shell,.registry-shell)>main{grid-column:2}body.sp-prototype.sp-unified-sidebar.single-page-cabinet .layout{margin-left:72px}body.sp-prototype.single-page-cabinet .reader-rating:not(.is-collapsed){box-shadow:14px 0 36px var(--ac-shadow);max-width:100%}body.sp-prototype .sp-profile-menu{width:min(304px,calc(100vw - 30px))}body.sp-prototype .ac-site-header{padding-left:14px;padding-right:14px}body.sp-prototype .main,body.sp-prototype .registry{padding:22px 16px}body.sp-prototype .registry-toolbar{min-width:0}body.sp-prototype .search{max-width:100%}}
@media(prefers-reduced-motion:reduce){body.sp-prototype *{scroll-behavior:auto!important}}

/* Local catalog view switch. Counts describe editions, not monitoring status. */
body.sp-prototype .sp-sidebar .sp-catalog-mode .sp-mode-arrows{width:14px;height:14px;flex-shrink:0;color:var(--ac-muted)}
body.sp-prototype .sp-sidebar .sp-series-row{display:flex;align-items:center;gap:12px;width:100%;min-height:76px;padding:12px 8px;margin:2px 0;border:0;border-radius:9px;text-align:left;background:transparent;color:var(--ac-ink)}
body.sp-prototype .sp-sidebar .sp-series-row:hover{background:var(--ac-soft)}
body.sp-prototype .sp-sidebar .sp-series-row.selected{background:var(--ac-selected)}
body.sp-prototype .sp-sidebar .sp-series-cover{display:flex;align-items:center;justify-content:center;width:36px;height:46px;flex-shrink:0}
body.sp-prototype .sp-sidebar .sp-series-copy{display:flex;flex-direction:column;gap:8px;min-width:0}
body.sp-prototype .sp-sidebar .sp-series-counts{display:flex;gap:12px;align-items:center;color:var(--ac-muted);font-size:11px;line-height:16px}
body.sp-prototype .sp-sidebar .sp-series-counts>span{display:inline-flex;gap:4px;align-items:center;white-space:nowrap}
body.sp-prototype .sp-sidebar .sp-series-counts .i{width:13px;height:13px;flex-shrink:0}
body.sp-prototype .sp-sidebar .sp-series-counts strong{font-size:inherit;font-weight:600;font-variant-numeric:tabular-nums}
body.sp-prototype.sp-collapsed .sp-sidebar .sp-catalog-mode{flex-direction:column;gap:4px;padding:8px 0}
body.sp-prototype.sp-collapsed .sp-sidebar .sp-catalog-mode .sp-mode-arrows{width:12px;height:12px}
body.sp-prototype.sp-collapsed .sp-sidebar .sp-series-row{flex-direction:column;gap:6px;min-height:90px;padding:10px 0}
body.sp-prototype.sp-collapsed .sp-sidebar .sp-series-copy{gap:0}
body.sp-prototype.sp-collapsed .sp-sidebar .sp-series-copy>.series-title,body.sp-prototype.sp-collapsed .sp-sidebar .sp-format-label{display:none}
body.sp-prototype.sp-collapsed .sp-sidebar .sp-series-counts{gap:5px;font-size:10px}
body.sp-prototype.sp-collapsed .sp-sidebar .sp-series-counts>span{gap:2px}
body.sp-prototype.sp-collapsed .sp-sidebar .sp-series-counts .i{width:10px;height:10px}
body.sp-prototype .sp-sidebar :is(.sp-series-row,.sp-catalog-mode):focus-visible{outline:2px solid var(--ac-ink);outline-offset:-2px}

/* Separate series only in the flat book list. */
body.sp-prototype .sp-sidebar .sp-series-divider{height:1px;background:var(--ac-border);margin:12px 8px;flex-shrink:0}
body.sp-prototype.sp-collapsed .sp-sidebar .sp-series-divider{width:32px;margin:12px auto}

/* Author ranking uses the same 304 / 72 px sidebar as the reader ranking. */
body.sp-prototype.ac-authors-page{--sp-authors-rail:304px;--sp-authors-header-height:80px}
body.sp-prototype.ac-authors-page.sp-collapsed{--sp-authors-rail:72px}
body.sp-prototype.ac-authors-page .ac-site-header{position:sticky;top:0;max-width:none;margin:0;width:100%;height:auto;min-height:80px;background:var(--ac-surface)}
body.sp-prototype.ac-authors-page main{margin-left:var(--sp-authors-rail);margin-right:0;max-width:none;padding:32px;min-width:0}
body.sp-prototype.ac-authors-page>footer{margin-left:var(--sp-authors-rail);max-width:none;padding:24px 32px}
body.sp-prototype .sp-authors-rating{position:fixed;left:0;top:var(--sp-authors-header-height);bottom:0;width:var(--sp-authors-rail);z-index:20;overflow:auto;display:flex;flex-direction:column}
body.sp-prototype .sp-authors-heading{display:flex;flex-direction:column;gap:3px;min-width:0}
body.sp-prototype .sp-authors-heading small{font-size:11px;color:var(--ac-muted)}
body.sp-prototype .sp-at-rating-source{font-size:11px;color:var(--ac-muted);margin:-4px 6px 18px}
body.sp-prototype .sp-author-rating-list{display:flex;flex-direction:column;gap:6px}
body.sp-prototype .sp-author-rating-row{display:flex;align-items:center;gap:28px;padding:12px;min-height:72px;border-radius:9px;color:var(--ac-ink)}
body.sp-prototype .sp-author-rating-row:hover{background:var(--ac-soft)}
body.sp-prototype .sp-author-rating-row.selected{background:var(--ac-selected)}
body.sp-prototype .sp-rating-avatar{position:relative;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border-radius:50%;background:var(--ac-soft);flex-shrink:0;font-size:13px}
body.sp-prototype .sp-rating-avatar img{width:40px;height:40px;object-fit:cover;border-radius:50%}
body.sp-prototype .sp-author-rating-name{font-size:13px;font-weight:600;line-height:1.4;min-width:0;flex:1}
body.sp-prototype .sp-author-rating-name small{display:block;font-size:11px;font-weight:400;color:var(--ac-muted);margin-top:3px}
body.sp-prototype .sp-author-place-badge{display:inline-flex;align-items:center;justify-content:center;min-width:22px;position:absolute;bottom:-4px;left:calc(100% - 3px);right:auto;background:var(--ac-ink);color:var(--ac-surface);border:1px solid var(--ac-surface);border-radius:5px;padding:2px 4px;font-size:9px;line-height:12px;font-variant-numeric:tabular-nums}
body.sp-prototype .sp-authors-rating-date{padding:18px 6px;font-size:10px;color:var(--ac-muted);line-height:1.6}
body.sp-prototype .sp-profile-photo>img{display:block;width:38px;height:38px;border-radius:50%;object-fit:cover}
body.sp-prototype.sp-collapsed .sp-authors-rating :is(.sp-authors-heading,.sp-at-rating-source,.sp-author-rating-name,.sp-authors-rating-date){display:none}
body.sp-prototype.sp-collapsed .sp-authors-rating .sp-author-rating-row{justify-content:flex-start;gap:0;padding:12px 0;min-height:72px}
body.sp-prototype.sp-collapsed .sp-authors-rating .sp-author-place-badge{font-size:8px;min-width:20px;padding:2px 3px}
@media(max-width:1050px){body.sp-prototype.ac-authors-page .books{grid-template-columns:repeat(2,minmax(0,1fr))}body.sp-prototype.ac-authors-page .authors{grid-template-columns:1fr}body.sp-prototype.ac-authors-page .intro{display:block}body.sp-prototype.ac-authors-page .aside-note{display:none}}
@media(max-width:720px){body.sp-prototype.ac-authors-page main,body.sp-prototype.ac-authors-page>footer{margin-left:72px;padding:24px 20px}body.sp-prototype.ac-authors-page:not(.sp-collapsed) .sp-authors-rating{max-width:100%;box-shadow:14px 0 36px var(--ac-shadow)}body.sp-prototype.ac-authors-page .book-layout{grid-template-columns:1fr}}

/* Keep the balance beneath the user name at every viewport width. */
body.sp-prototype .sp-profile-copy{display:flex}
body.sp-prototype .sp-profile-balance{font-size:11px;line-height:1.4;color:var(--ac-muted);font-variant-numeric:tabular-nums;white-space:nowrap}
@media(max-width:1250px){body.sp-prototype .ac-site-header{flex-wrap:wrap;padding-bottom:8px;gap:0 12px}body.sp-prototype .ac-site-header .ac-site-nav{order:5;flex:0 0 100%;width:100%;overflow:auto}body.sp-prototype .ac-site-header .sp-profile{margin-left:auto}body.sp-prototype .ac-site-header #notification-bell{margin-left:auto}body.sp-prototype .ac-site-header .ac-site-logo,body.sp-prototype .ac-site-header .ac-site-brand{height:60px}}
@media(max-width:600px){body.sp-prototype .ac-site-header{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:0 8px}body.sp-prototype .ac-site-header .ac-site-brand{grid-column:1;grid-row:1;width:96px;min-width:0}body.sp-prototype .ac-site-header .ac-site-logo{width:96px}body.sp-prototype .ac-site-header .sp-profile{grid-column:2 / 4;grid-row:1;margin-left:0}body.sp-prototype .ac-site-header .ac-site-nav{grid-column:1 / -1;grid-row:3}body.sp-prototype .ac-site-header #notification-bell{grid-column:2;grid-row:2;justify-self:end;margin:0}body.sp-prototype .ac-site-header #language-switch{grid-column:3;grid-row:2}body.sp-prototype .sp-profile-trigger{gap:7px;padding:6px 4px}body.sp-prototype .sp-profile-copy{max-width:150px}body.sp-prototype .sp-profile-avatar,body.sp-prototype .sp-profile-avatar :is(.avatar,.avatar-placeholder,.sp-profile-photo){width:32px;height:32px}body.sp-prototype .sp-profile-photo>img{width:32px;height:32px}}

body.sp-prototype .sp-all-books{padding:0;border:0;background:transparent;color:inherit;font:inherit;text-align:left}
body.sp-prototype .sp-all-books:focus-visible{outline:2px solid var(--ac-ink);outline-offset:4px}
body.sp-prototype .sp-profile-menu .balances{display:flex;gap:12px;margin:12px 0;font-size:11px}
body.sp-prototype .sp-sidebar .sp-series-select{display:flex;flex:1;flex-direction:column;min-width:0;border:0;padding:0;background:transparent;text-align:left;color:inherit}

body.sp-prototype .sp-profile-photo{display:flex;align-items:center;justify-content:center;background:var(--ac-soft);font-size:12px}

/* Shared interaction states, including the protection shell without .ac-page. */
.ac-theme body { --surface: var(--ac-surface); --panel: var(--ac-surface); --ink: var(--ac-ink); --muted: var(--ac-muted); --border: var(--ac-border); --line: var(--ac-border); }
.ac-theme { accent-color: var(--ac-action); scrollbar-color: var(--ac-control-border) var(--ac-bg); }
.ac-theme ::selection { background: var(--ac-selected); color: var(--ac-ink); }
.ac-theme :is(button,a,input,select,textarea,summary,[tabindex]):focus-visible { outline: 2px solid var(--ac-action); outline-offset: 3px; }
.ac-theme :is(input,textarea)::placeholder { color: var(--ac-muted); opacity: 1; }
.ac-theme :is(input,select,textarea):not([type="checkbox"]):not([type="radio"]):not([type="range"]) { border-color: var(--ac-control-border); }
.ac-theme :is(.button.primary,button.primary,.primary,.trial-button,.all-help[aria-pressed="true"]) { background: var(--ac-action); color: var(--ac-action-text); border-color: var(--ac-action); }
.ac-theme :is(.button.primary,button.primary,.primary):hover:not(:disabled) { background: var(--ac-action); filter: brightness(.94); }
.ac-theme dialog::backdrop { background: var(--ac-scrim); }
[data-ac-theme='dark'] .ac-site-logo { filter: brightness(0) invert(.94); }
.ac-brand-filter { position: absolute; overflow: hidden; pointer-events: none; }
[data-ac-theme='dark'].ac-brand-filter-ready .ac-site-logo { filter: url('#ac-logo-dark-filter'); }

/* Appearance menu is available before login and in every service section. */
.ac-appearance { position: relative; flex: 0 0 auto; margin: 0 0 0 auto; padding: 0; border: 0; background: transparent; font: 14px/1.45 var(--ac-font-interface); color: var(--ac-ink); }
.ac-site-header:has(.sp-profile) .ac-appearance { margin-left: 0; }
.ac-site-header .ac-appearance-trigger { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; list-style: none; cursor: pointer; border: 1px solid var(--ac-border); border-radius: 8px; background: var(--ac-surface); color: var(--ac-muted); }
.ac-appearance-trigger::-webkit-details-marker { display: none; }
.ac-site-header .ac-appearance-trigger:hover,.ac-appearance[open] .ac-appearance-trigger { background: var(--ac-soft); color: var(--ac-ink); }
.ac-appearance-trigger svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ac-appearance .ac-appearance-moon { display: none; }
[data-ac-theme='dark'] .ac-appearance .ac-appearance-sun { display: none; }
[data-ac-theme='dark'] .ac-appearance .ac-appearance-moon { display: block; }
.ac-appearance-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: 230px; padding: 8px; border: 1px solid var(--ac-border); border-radius: 12px; background: var(--ac-elevated); box-shadow: 0 16px 45px var(--ac-shadow); }
.ac-appearance-title { display: block; padding: 8px 10px; font-size: 11px; font-weight: 600; color: var(--ac-muted); }
.ac-appearance .ac-appearance-option { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 10px; border: 0; border-radius: 7px; font: inherit; text-align: left; color: var(--ac-ink); background: transparent; cursor: pointer; }
.ac-appearance .ac-appearance-option:hover { background: var(--ac-soft); }
.ac-appearance .ac-appearance-option[aria-pressed='true'] { background: var(--ac-selected); font-weight: 600; }
.ac-appearance-option::after { content: ''; width: 18px; }
.ac-appearance-option[aria-pressed='true']::after { content: '✓'; color: var(--ac-action); }
@media(max-width:600px) {
 body.sp-prototype .ac-site-header .ac-appearance { grid-column: 1; grid-row: 2; margin: 0; justify-self: start; }
 body.sp-prototype .ac-appearance-panel { left: 0; right: auto; }
 .ac-appearance-trigger { min-width: 44px; min-height: 44px; }
}
.ac-appearance:not([open]) .ac-appearance-panel { display: none; }
/* Keep dark platform marks legible without recolouring third-party artwork. */
[data-ac-theme='dark'] img:is([src$='/AuthorTodayIcon.png'],[src$='/LitresIcon.png'],[src$='/authors/assets/at.png'],[src$='/authors/assets/litres.png'],[src$='/authors/assets/litnet.png']) { background: #fffefa; border-radius: 3px; padding: 2px; object-fit: contain; }
[data-ac-theme='dark'] .litnet-icon { fill: var(--ac-violet); }
@media(max-width:600px) {
 body.sp-prototype .ac-site-header .ac-site-brand { width: 100%; max-width: 96px; min-width: 0; }
 body.sp-prototype .ac-site-header .ac-site-logo { width: 100%; max-width: 96px; min-width: 0; flex: 0 1 auto; }
}
@media(max-width:360px) { body.sp-prototype .sp-profile-copy { max-width: 120px; } }
@media(max-width:720px) {
 body.sp-prototype.ac-authors-page .authors { grid-template-columns: minmax(0,1fr); }
 .ac-authors-page .author-card { min-width: 0; overflow-wrap: anywhere; gap: 12px; padding: 18px; }
}
