:root {
  --bg: #f4f8fb;
  --surface: #ffffff;
  --surface-soft: #edf7f8;
  --surface-warm: #fff7ed;
  --border: #d7e2ec;
  --text: #132238;
  --muted: #66788e;
  --primary: #2656d9;
  --primary-strong: #173a9f;
  --primary-soft: #e3ebff;
  --accent: #0f9f79;
  --accent-soft: #dff9ee;
  --gold: #f0a313;
  --gold-soft: #fff1cb;
  --coral: #e65f51;
  --coral-soft: #ffe5df;
  --plum: #7c3aed;
  --plum-soft: #eee7ff;
  --mint: #26b99a;
  --mint-soft: #dff8f0;
  --paper: #fffaf2;
  --danger: #d92d20;
  --shadow: rgba(19, 34, 56, 0.12);
  --shadow-strong: rgba(19, 34, 56, 0.18);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(255, 241, 203, 0.42) 0%, rgba(223, 248, 240, 0.48) 34%, rgba(238, 231, 255, 0.44) 68%, rgba(255, 229, 223, 0.38) 100%),
    linear-gradient(180deg, #fbfdff 0%, var(--bg) 46%, #f8f5ef 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

.site-frame {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header,
.site-footer,
.content-shell,
.reader-shell,
.form-shell {
  width: min(100% - 32px, 1180px);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(100% - 32px, 1220px);
  padding: 10px 0;
  border-bottom: 0;
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-weight: 850;
  color: var(--text);
  padding: 8px 10px 8px 8px;
  border: 1px solid rgba(215, 226, 236, 0.8);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 28px rgba(19, 34, 56, 0.08);
}

.brand-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(215, 226, 236, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 34px rgba(19, 34, 56, 0.08);
}

.header-nav a,
.site-footer a,
.logout-form button {
  padding: 9px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-weight: 700;
}

.logout-form button {
  border: 0;
  background: transparent;
}

.header-nav a:hover,
.header-nav a[aria-current="page"],
.site-footer a:hover,
.logout-form button:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-cta {
  color: white !important;
  background: linear-gradient(135deg, var(--primary), var(--accent)) !important;
  box-shadow: 0 10px 22px rgba(38, 86, 217, 0.22);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.language-switcher {
  position: relative;
}

.language-menu {
  position: relative;
}

.language-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 122px;
  min-height: 38px;
  padding: 0 10px 0 12px;
  border: 1px solid rgba(124, 58, 237, 0.24);
  border-radius: var(--radius);
  color: #40206f;
  background: linear-gradient(135deg, var(--plum-soft), #ffffff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  cursor: pointer;
  font-weight: 850;
  list-style: none;
}

.language-menu summary::-webkit-details-marker {
  display: none;
}

.language-menu summary svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.language-menu[open] summary {
  border-color: rgba(124, 58, 237, 0.5);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.12);
}

.language-options {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 80;
  display: grid;
  gap: 6px;
  min-width: 164px;
  padding: 8px;
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(19, 34, 56, 0.18);
}

.language-options button {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 11px;
  color: var(--text);
  background: transparent;
  text-align: left;
  font-weight: 850;
}

.language-options button:hover,
.language-options button[aria-current="true"] {
  color: #40206f;
  background: linear-gradient(135deg, var(--plum-soft), var(--gold-soft));
}

.header-menu-button,
.app-bottom-nav {
  display: none;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 0 86px;
  color: var(--muted);
  border-top: 1px solid rgba(215, 226, 236, 0.85);
}

.site-footer div,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
}

.content-shell {
  padding: 34px 0 56px;
}

.content-shell.narrow {
  width: min(100% - 32px, 860px);
}

.list-heading,
.author-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 0 24px;
}

.list-heading h1,
.author-hero h1,
.account-heading h1,
.reader-header h1,
.legal-page h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.list-heading p,
.author-hero p,
.account-heading p,
.reader-header p {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 8px !important;
  color: var(--primary) !important;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.primary-action,
.secondary-action,
.filter-bar button,
.stack-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-action,
.filter-bar button,
.stack-form button {
  background: linear-gradient(135deg, var(--primary), #4377ff);
  color: white;
  box-shadow: 0 12px 24px rgba(38, 86, 217, 0.24);
}

.primary-action:hover,
.secondary-action:hover,
.filter-bar button:hover,
.stack-form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px var(--shadow-strong);
}

.secondary-action {
  background: var(--surface);
  color: var(--primary);
  border-color: var(--border);
}

.primary-action.is-active,
.secondary-action.is-active,
.notice {
  background: var(--accent-soft);
  color: #126a32;
  border-color: #bbf7d0;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  margin: 0 0 26px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.96), rgba(223, 248, 240, 0.9)),
    var(--surface);
  box-shadow: 0 16px 42px var(--shadow);
}

.filter-bar label,
.stack-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.filter-bar label {
  min-width: 0;
}

.filter-bar label span {
  display: block;
}

.filter-bar select,
.stack-form input,
.stack-form select,
.stack-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  padding: 11px 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.filter-bar select:focus,
.stack-form input:focus,
.stack-form select:focus,
.stack-form textarea:focus,
.language-menu summary:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(38, 86, 217, 0.14);
}

.filter-bar select {
  min-height: 44px;
  appearance: none;
  -webkit-appearance: none;
  padding: 9px 42px 9px 14px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text) 50%),
    linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 19px,
    calc(100% - 15px) 19px;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.25;
}

.filter-bar button {
  min-width: 96px;
  white-space: nowrap;
}

.filter-bar a {
  color: var(--primary);
  font-weight: 800;
  padding: 11px 4px;
}

.library-section {
  margin-top: 28px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title-row h2 {
  margin: 0;
  font-size: 1.25rem;
}

.section-title-row span {
  color: var(--muted);
  font-weight: 800;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.compact-grid {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.book-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 34px var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.book-card:hover {
  transform: translateY(-3px);
  border-color: rgba(38, 86, 217, 0.34);
  box-shadow: 0 22px 48px var(--shadow-strong);
}

.book-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.book-cover {
  aspect-ratio: 3 / 4;
  background: linear-gradient(145deg, var(--gold-soft), var(--mint-soft), var(--plum-soft));
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-fallback {
  height: 100%;
  display: grid;
  align-content: space-between;
  padding: 18px;
  color: var(--text);
  background:
    linear-gradient(160deg, rgba(38, 86, 217, 0.18), rgba(15, 159, 121, 0.2), rgba(240, 163, 19, 0.18)),
    #f8fafc;
}

.cover-fallback span {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.cover-fallback strong {
  font-size: 1.45rem;
  line-height: 1.08;
}

.book-card-body {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px 16px 4px;
}

.book-card h3 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.25;
}

.book-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.94rem;
}

.book-meta,
.stats-row,
.tag-row,
.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.book-meta a,
.report-row a {
  position: relative;
  z-index: 2;
  color: var(--primary);
  font-weight: 800;
}

.tag-row a,
.featured-pill {
  position: relative;
  z-index: 2;
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
}

.tag-row a:nth-child(2n) {
  background: var(--accent-soft);
  color: #0c755b;
}

.tag-row a:nth-child(3n),
.featured-pill {
  background: var(--gold-soft);
  color: #8a5a04;
}

.tag-row.large {
  margin: 4px 0 22px;
}

.card-actions {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px 14px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--muted);
  transition: transform 160ms ease, color 160ms ease, background 160ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  color: var(--primary);
  background: var(--primary-soft);
}

.icon-button svg,
.header-menu-button svg,
.app-bottom-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: #bbf7d0;
}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 10px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 237, 0.9)),
    var(--surface);
  box-shadow: 0 14px 34px var(--shadow);
}

.empty-state.compact {
  padding: 18px;
}

.empty-state h2,
.empty-state p {
  margin: 0;
}

.empty-state p {
  color: var(--muted);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  margin-top: 30px;
  color: var(--muted);
}

.pagination a {
  color: var(--primary);
  font-weight: 800;
}

.reader-shell {
  padding: 34px 0 56px;
}

.reader {
  width: min(100%, 820px);
  margin: 0 auto;
}

.back-link {
  color: var(--primary);
  font-weight: 800;
}

.reader-header {
  display: grid;
  gap: 18px;
  margin: 18px 0 22px;
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.book-detail-layout {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 1fr;
  gap: 22px;
  align-items: start;
  margin: 22px 0;
}

.detail-cover {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 30px var(--shadow);
}

.reader-summary {
  display: grid;
  gap: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.reader-summary p {
  margin: 0;
}

.social-row a {
  color: var(--primary);
  font-weight: 800;
}

.note-panel,
.reader-rating-panel,
.legal-page,
.faq-list details,
.dashboard-panel,
.side-panel,
.form-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 250, 242, 0.96), rgba(255, 255, 255, 0.95) 38%, rgba(223, 248, 240, 0.45)),
    var(--surface);
  box-shadow: 0 16px 38px var(--shadow);
}

.note-panel,
.reader-rating-panel {
  padding: 18px;
  margin: 22px 0;
}

.note-panel h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.book-text {
  width: min(100%, 780px);
  margin: 32px auto 0;
  color: #0f172a;
  font-size: 1.08rem;
  line-height: 1.82;
}

.book-text p {
  margin: 0 0 1.25em;
}

.story-font-classic-serif,
.story-font-modern-serif,
.story-font-literary {
  font-family: Georgia, "Times New Roman", serif;
}

.story-font-clean-sans {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.story-font-large-easy-read {
  font-size: 1.2rem;
  line-height: 1.9;
}

.reader-rating-panel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.reader-rating-panel div {
  display: grid;
  gap: 3px;
}

.reader-rating-panel span,
.reader-rating-panel small {
  color: var(--muted);
}

.reader-rating-panel strong {
  font-size: 1.2rem;
}

.star-button {
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font-size: 1.5rem;
  padding: 2px;
}

.star-button.is-selected,
.star-button:hover {
  color: #f59e0b;
}

.report-row {
  margin: 22px 0 0;
}

.form-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
  padding: 34px 0 56px;
}

.auth-shell {
  grid-template-columns: minmax(0, 680px) 360px;
}

.auth-panel {
  position: relative;
  overflow: hidden;
}

.auth-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--gold), var(--coral));
}

.auth-switch {
  margin: 16px 0 0;
  color: var(--muted);
  font-weight: 750;
}

.auth-switch a {
  color: var(--primary);
  font-weight: 900;
}

.auth-aside {
  background:
    linear-gradient(145deg, rgba(227, 235, 255, 0.94), rgba(223, 249, 238, 0.9)),
    #fff;
}

.form-shell.single {
  grid-template-columns: minmax(0, 680px);
  justify-content: center;
}

.form-panel,
.side-panel {
  padding: 24px;
}

.stack-form {
  display: grid;
  gap: 16px;
}

.stack-form > label > span,
.error-banner {
  color: var(--danger);
}

.two-column-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 8px 0 0;
  padding: 20px;
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.96), rgba(238, 231, 255, 0.62)),
    rgba(255, 255, 255, 0.86);
}

.check-grid legend,
.inline-choice legend {
  padding: 0 8px;
  color: var(--text);
  font-weight: 850;
}

.check-grid label,
.inline-choice label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 50px;
  padding: 12px;
  border: 1px solid rgba(215, 226, 236, 0.9);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.84);
  font-weight: 700;
  line-height: 1.2;
}

.check-grid label:nth-of-type(3n + 1),
.inline-choice label:nth-of-type(3n + 1) {
  background: linear-gradient(135deg, #fff, var(--mint-soft));
}

.check-grid label:nth-of-type(3n + 2),
.inline-choice label:nth-of-type(3n + 2) {
  background: linear-gradient(135deg, #fff, var(--gold-soft));
}

.check-grid label:nth-of-type(3n),
.inline-choice label:nth-of-type(3n) {
  background: linear-gradient(135deg, #fff, var(--plum-soft));
}

.check-grid label span,
.inline-choice label span {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.check-grid input,
.inline-choice input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--plum);
}

.inline-choice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 8px 0 0;
  padding: 20px;
  border: 1px solid rgba(15, 159, 121, 0.2);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(223, 248, 240, 0.72), rgba(255, 241, 203, 0.54)),
    rgba(255, 255, 255, 0.86);
}

.notice,
.error-banner {
  padding: 12px 14px;
  border: 1px solid;
  border-radius: var(--radius);
  margin: 0 0 16px;
  font-weight: 800;
}

.error-banner {
  border-color: #fecaca;
  background: var(--coral-soft);
}

.side-panel {
  display: grid;
  gap: 22px;
}

.side-panel h2,
.dashboard-panel h2 {
  margin: 0 0 12px;
  font-size: 1.08rem;
}

.side-panel p,
.dashboard-panel p {
  color: var(--muted);
  line-height: 1.5;
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.plain-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.plain-list a,
.plain-list span {
  color: var(--primary);
  font-weight: 800;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.metric-grid div {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(237, 247, 248, 0.9)),
    var(--surface);
  box-shadow: 0 12px 30px var(--shadow);
}

.metric-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.metric-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.6rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 18px;
  margin-top: 22px;
}

.dashboard-panel {
  padding: 20px;
}

.bar-row {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}

.bar-row span {
  font-weight: 850;
}

.bar-row i {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.bar-row small {
  color: var(--muted);
}

.author-hero {
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.faq-list,
.legal-page {
  display: grid;
  gap: 12px;
}

.faq-list details {
  padding: 18px;
  transition: transform 160ms ease, border-color 160ms ease;
}

.faq-list details:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 159, 121, 0.34);
}

.faq-list summary {
  cursor: pointer;
  font-weight: 850;
}

.faq-list p,
.legal-page div {
  color: var(--muted);
  line-height: 1.7;
}

.legal-page {
  padding: 24px;
}

.pending-card-wrap {
  display: grid;
  gap: 10px;
}

.delete-form button {
  width: 100%;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  background: var(--coral-soft);
  color: var(--danger);
  padding: 10px 12px;
  font-weight: 850;
}

@media (max-width: 860px) {
  .header-menu-button {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
  }

  .header-nav {
    position: fixed;
    top: 74px;
    left: 16px;
    right: 16px;
    z-index: 20;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 20px 50px var(--shadow);
  }

  .language-menu summary,
  .language-options {
    width: 100%;
    min-width: 0;
  }

  body.is-menu-open .header-nav {
    display: flex;
  }

  .app-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
  }

  .app-bottom-nav a {
    display: grid;
    justify-items: center;
    gap: 3px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
  }

  .app-bottom-nav a[aria-current="page"] {
    color: var(--primary);
  }

  .list-heading,
  .author-hero,
  .site-footer,
  .reader-rating-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .book-detail-layout,
  .form-shell,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .two-column-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header,
  .site-footer,
  .content-shell,
  .reader-shell,
  .form-shell {
    width: min(100% - 24px, 1180px);
  }

  .book-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .inline-choice {
    display: grid;
  }

  .site-footer {
    padding-bottom: 96px;
  }
}
