@font-face {
  font-family: 'Reading Room Pixel';
  src: url('/reading-room-pixel.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --paper: #171c30;
  --panel: #232940;
  --panel-light: #2b334c;
  --ink: #f5e8c6;
  --muted: #b5b9cc;
  --line: #49516e;
  --sage: #8cd7ba;
  --sage-light: #263e42;
  --terracotta: #ffab8c;
  --cream: #f5e8c6;
  --amber: #f6cb75;
  --pink: #ee9db4;
  --shadow: #0c1020;
  --serif: 'Reading Room Pixel', 'Courier New', monospace;
  --sans: 'Courier New', Courier, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  background-image: radial-gradient(#65718a33 1px, transparent 1px);
  background-size: 16px 16px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
}
/* Static scanlines recall a CRT without flicker or moving content. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: repeating-linear-gradient(transparent 0 3px, #070b1612 3px 4px);
}
::selection { background: var(--amber); color: var(--shadow); }
button, input, textarea, select { font: inherit; }
button, a, input, textarea { touch-action: manipulation; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 5px;
}
svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter;
  vertical-align: middle;
}
button svg, a svg { flex-shrink: 0; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0; padding: 38px 24px 0;
  position: fixed; inset: 0 auto 0 0;
  border-right: 3px solid var(--line);
  display: flex; flex-direction: column;
  background: #1d2238;
}
.brand {
  display: flex; gap: 12px; align-items: flex-start;
  font: 23px/1.4 var(--serif); color: var(--amber);
  padding: 0 3px; text-shadow: 2px 2px 0 var(--shadow);
}
.brand-icon { margin-top: 4px; color: var(--sage); }
.brand-icon svg { width: 29px; height: 29px; }
.brand-caption {
  display: block; font: 10px/1.6 var(--sans);
  letter-spacing: 1.5px; margin-top: 14px; color: var(--muted);
}
.nav-label {
  font-size: 10px; letter-spacing: 1.5px; color: var(--sage);
  margin: 40px 8px 16px;
}
nav { display: grid; gap: 10px; }
nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 12px 10px; color: var(--muted); font-size: 12px;
  border: 2px solid transparent;
}
nav a.active {
  background: #303c46; color: var(--sage);
  border-color: var(--sage); box-shadow: 3px 3px 0 var(--shadow);
}
nav a:hover { color: var(--ink); background: var(--panel-light); }
.sidebar-account {
  border-top: 2px solid var(--line); padding: 22px 0;
  display: flex; align-items: center; gap: 10px; min-height: 86px;
}
.sidebar-account > div:nth-child(2) { flex: 1; min-width: 0; }
.sidebar-account strong { font-size: 12px; display: block; overflow: hidden; text-overflow: ellipsis; }
.sidebar-account small { font-size: 10px; color: var(--sage); }
.avatar {
  width: 34px; height: 34px; display: inline-flex; align-items: center;
  justify-content: center; flex-shrink: 0; background: var(--amber);
  color: var(--shadow); border: 2px solid var(--shadow);
  box-shadow: 2px 2px 0 #0005; font: 12px var(--serif);
  clip-path: polygon(4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px), 0 4px, 4px 4px);
}
.avatar.c1 { background: var(--sage); }
.avatar.c2 { background: var(--terracotta); }
.avatar.c3 { background: #b9aceb; }
.avatar.c4 { background: var(--amber); }
.avatar.c5 { background: #8dcce2; }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid transparent; background: transparent;
  padding: 8px; min-width: 38px; min-height: 38px; color: var(--muted);
}
.icon-button:hover { background: var(--panel-light); border-color: var(--line); color: var(--amber); }
.icon-button svg { width: 19px; height: 19px; }
.main-shell { margin-left: 250px; width: calc(100% - 250px); }
.topbar {
  min-height: 73px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; padding: 15px 46px;
  border-bottom: 2px solid var(--line); background: #1c2237;
}
.breadcrumb { font-size: 10px; letter-spacing: 1px; color: var(--amber); }
.breadcrumb > span:first-child { margin: 0 12px; color: var(--line); }
.breadcrumb > span:last-child { letter-spacing: 0; font-size: 11px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 9px; font-size: 11px; color: var(--sage); }
.live-dot { display: inline-block; width: 7px; height: 7px; background: var(--sage); box-shadow: 2px 2px 0 var(--shadow); }
.mobile-signin { display: none; }
main { max-width: 1360px; margin: auto; padding: 39px 46px 45px; min-height: calc(100vh - 153px); }
.welcome { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 30px; }
.eyebrow { font-size: 10px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--sage); font-weight: bold; }
.welcome h1, .page-heading h1 {
  font: 30px/1.55 var(--serif); color: var(--amber);
  margin: 9px 0 12px; text-shadow: 3px 3px 0 var(--shadow);
  overflow-wrap: anywhere;
}
.welcome p, .page-heading p { color: var(--muted); font-size: 13px; margin: 0; }
.date-stamp { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.date-stamp svg { width: 16px; height: 16px; color: var(--pink); }
.dashboard-grid, .below-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(275px, 1fr); gap: 24px; }
.current-book, .card, .members-list, .history-card, .calendar-card, .event-details, .stat-card, .notice {
  border: 2px solid var(--line); background: var(--panel); box-shadow: 5px 5px 0 var(--shadow);
}
.current-book { padding: 24px 25px 0; overflow: hidden; border-top: 4px solid var(--sage); }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: #2d4245; color: var(--sage); border: 1px solid #709b8d;
  font-size: 9px; letter-spacing: .5px; padding: 5px 8px; white-space: nowrap;
}
.pill svg { width: 11px; height: 11px; }
.book-display { display: grid; grid-template-columns: 158px minmax(0, 1fr); gap: 25px; padding: 30px 0; align-items: center; }
.book-cover {
  position: relative; width: 158px; aspect-ratio: 2/3;
  background: var(--amber); color: #2a2639;
  box-shadow: 5px 5px 0 var(--shadow); border: 3px solid #fff1c9;
  display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; overflow: hidden; text-align: center;
  padding: 18px 12px 14px; flex-shrink: 0;
}
.book-cover::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 6px; background: #13182e33; }
.book-cover .cover-title { font: 18px/1.5 var(--serif); text-transform: uppercase; z-index: 1; overflow-wrap: anywhere; }
.cover-subtitle { font: 9px var(--sans); margin-top: 9px; letter-spacing: 1px; text-transform: uppercase; }
.cover-circle {
  width: 70px; height: 70px; flex-shrink: 0; margin: 17px 0 13px;
  background: #7b4567;
  clip-path: polygon(20% 0, 80% 0, 80% 10%, 90% 10%, 90% 20%, 100% 20%, 100% 80%, 90% 80%, 90% 90%, 80% 90%, 80% 100%, 20% 100%, 20% 90%, 10% 90%, 10% 80%, 0 80%, 0 20%, 10% 20%, 10% 10%, 20% 10%);
  position: relative;
}
.cover-author { font: 10px/1.5 var(--sans); font-weight: bold; text-transform: uppercase; letter-spacing: 1px; margin-top: auto; }
.book-cover.cover-alt-0 { background: #6780ae; color: #fff0cc; border-color: #99bae1; }
.book-cover.cover-alt-0 .cover-circle { background: #f6cb75; }
.book-cover.cover-alt-1 { background: #8cd7ba; color: #253c42; border-color: #c1efdc; }
.book-cover.cover-alt-1 .cover-circle { background: #40537e; }
.book-cover.cover-alt-2 { background: #e99999; color: #432e49; border-color: #ffd1b3; }
.book-cover.cover-alt-2 .cover-circle { background: #704c76; }
.book-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.book-copy h2 { font: 24px/1.5 var(--serif); color: var(--ink); margin: 0 0 8px; }
.book-author { font-size: 12px; color: var(--pink); margin: 0 0 16px; }
.book-description { font-size: 12px; line-height: 1.9; color: var(--muted); margin-bottom: 18px; }
.book-meta { display: flex; flex-wrap: wrap; gap: 9px 16px; color: var(--sage); font-size: 11px; }
.book-meta > span { display: flex; align-items: center; gap: 5px; }
.book-meta svg { width: 13px; height: 13px; }
.book-footer { border-top: 2px dashed var(--line); padding: 15px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.book-footer p { font-size: 10px; color: var(--muted); margin: 0; }
.avatar-stack { display: flex; align-items: center; padding-left: 5px; }
.avatar-stack .avatar { width: 25px; height: 25px; border: 2px solid var(--panel); font-size: 8px; margin-left: -5px; }
.book-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; max-width: 100%; }
.book-footer-left { display: flex; align-items: center; gap: 9px; }
.text-button { border: 0; padding: 6px 3px; min-height: 34px; background: transparent; color: var(--sage); font-size: 12px; display: inline-flex; align-items: center; gap: 7px; }
.text-button:hover { color: var(--amber); text-decoration: underline; text-underline-offset: 5px; }
.text-button svg { width: 14px; height: 14px; }
.card { padding: 23px; }
.right-column { display: grid; gap: 23px; }
.progress-heading { display: flex; align-items: center; gap: 8px; }
.progress-heading svg { width: 16px; height: 16px; color: var(--sage); }
.progress-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 20px 0 13px; }
.progress-top h3 { font: 16px/1.6 var(--serif); margin: 0 0 8px; color: var(--ink); }
.progress-top p { font-size: 11px; color: var(--muted); margin: 0; }
.progress-top .avatar { width: 38px; height: 38px; }
.progress-label { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; color: var(--muted); margin: 13px 0 8px; }
.progress-label > span:last-child { color: var(--sage); }
.progress-track { height: 12px; background: #101627; border: 2px solid #56617a; overflow: hidden; }
.progress-fill { height: 100%; background: repeating-linear-gradient(90deg, var(--sage) 0 8px, #233941 8px 10px); }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--sage); color: #172b2c;
  border: 2px solid #c3f3da; box-shadow: 3px 3px 0 var(--shadow);
  padding: 13px 16px; font-size: 13px; font-weight: bold; line-height: 1.5;
  position: relative;
}
.button:hover { background: #a6ebce; color: #101d24; }
.button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
.button svg { width: 17px; height: 17px; }
.button.full { width: 100%; margin-top: 20px; }
.button.secondary { background: var(--panel-light); color: var(--ink); border-color: #75809b; }
.button.secondary:hover { border-color: var(--amber); color: var(--amber); }
.button.danger { background: #d48692; color: #201629; border-color: #ffc8d0; }
.meetup-mini { background: #352d40; border-color: #6f5269; border-top: 4px solid var(--pink); padding: 21px 23px; }
.meetup-mini .eyebrow { color: var(--pink); }
.meetup-line { display: flex; gap: 16px; margin: 17px 0; }
.date-tile { border-right: 2px dashed #72546d; padding-right: 16px; min-width: 55px; text-align: center; }
.date-tile span { display: block; font-size: 10px; letter-spacing: 1px; color: var(--pink); text-transform: uppercase; }
.date-tile strong { display: block; font: 30px/1.6 var(--serif); color: var(--amber); }
.meetup-line h3 { font: 15px/1.6 var(--serif); margin: 0 0 8px; }
.meetup-line p { font-size: 11px; color: #d1b4ce; margin: 0; }
.meetup-mini .text-button { color: var(--pink); }
.below-grid { margin-top: 33px; }
.section-title { font: 19px/1.6 var(--serif); color: var(--amber); margin: 0; }
.section-subtitle { color: var(--muted); font-size: 11px; margin: 6px 0 0; }
.members-section > .section-header { margin-bottom: 19px; }
.members-list { padding: 0 19px; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.member-row:last-child { border-bottom: 0; }
.member-name { font-size: 12px; font-weight: bold; min-width: 0; flex: 1; }
.member-name small { display: block; font-size: 10px; color: var(--muted); font-weight: normal; margin-top: 4px; }
.member-meter { width: 100px; }
.member-meter .progress-track { height: 10px; }
.member-progress { font-size: 11px; color: var(--sage); width: 36px; text-align: right; }
.you-tag { font-size: 10px; color: var(--pink); font-weight: normal; margin-left: 6px; }
.section-link-bottom { display: block; text-align: center; color: var(--muted); font-size: 11px; margin-top: 20px; }
.section-link-bottom:hover { color: var(--amber); }
.empty-state { text-align: center; padding: 28px 15px; color: var(--muted); font-size: 12px; }
.empty-state p { margin: 12px 0 20px; }
.empty-state svg { width: 28px; height: 28px; color: var(--sage); }
.loading { padding: 80px 15px; text-align: center; color: var(--sage); font: 17px/1.8 var(--serif); }
footer { border-top: 2px dashed var(--line); margin: 0 46px; padding: 23px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 10px; }
footer > span:first-child { font: 13px/1.5 var(--serif); color: var(--amber); }
.page-heading { margin-bottom: 32px; }
.page-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.history-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.history-card { padding: 21px; border-top: 4px solid var(--amber); }
.history-cover-wrap { background: #171e32; background-image: linear-gradient(#46516d33 1px, transparent 1px), linear-gradient(90deg, #46516d33 1px, transparent 1px); background-size: 16px 16px; min-height: 260px; display: flex; justify-content: center; align-items: center; padding: 25px; }
.history-card .book-cover { width: 135px; }
.history-card .cover-title { font-size: 15px; }
.history-card .cover-circle { width: 60px; height: 60px; margin: 13px 0; }
.history-card h2 { font: 19px/1.6 var(--serif); margin: 18px 0 7px; }
.history-card p { font-size: 12px; color: var(--pink); margin: 4px 0; }
.history-date { border-top: 1px dashed var(--line); margin-top: 18px; padding-top: 13px; display: flex; justify-content: space-between; align-items: center; gap: 7px; font-size: 10px; color: var(--muted); }
.sample-note { font-size: 12px; background: #303044; border-left: 4px solid var(--amber); color: var(--ink); padding: 14px 17px; margin-bottom: 26px; }
.members-page .member-row { padding: 22px 0; }
.members-page .avatar { width: 43px; height: 43px; }
.members-page .member-meter { width: 30%; }
.members-page .member-name { font-size: 14px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.stat-card { padding: 22px; border-top: 3px solid var(--sage); }
.stat-card:nth-child(2) { border-top-color: var(--pink); }
.stat-card:nth-child(3) { border-top-color: var(--amber); }
.stat-card strong { display: block; font: 30px/1.6 var(--serif); color: var(--amber); margin-bottom: 7px; }
.stat-card span { font-size: 12px; color: var(--muted); }
.calendar-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 25px; }
.calendar-card { padding: 27px; border-top: 4px solid var(--sage); }
.calendar-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 23px; }
.calendar-heading h2 { font: 21px/1.5 var(--serif); color: var(--amber); margin: 0; }
.calendar-heading > div { display: flex; gap: 5px; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; text-align: center; }
.calendar-grid .weekday { font-size: 11px; color: var(--sage); padding-bottom: 12px; }
.calendar-day { padding: 9px 0; font-size: 13px; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 2px solid transparent; }
.calendar-day.today { border-color: var(--amber); }
.calendar-day.event { background: var(--sage); color: #132831; box-shadow: 3px 3px 0 var(--shadow); font-weight: bold; }
.calendar-day.blank { color: var(--muted); }
.calendar-key { margin-top: 25px; color: var(--muted); font-size: 11px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.event-details { background: #352d40; border-color: #6f5269; border-top: 4px solid var(--pink); padding: 28px; }
.event-details .eyebrow { color: var(--pink); }
.event-details h2 { font: 24px/1.6 var(--serif); color: var(--ink); margin: 17px 0 24px; }
.event-details > p { font-size: 13px; line-height: 1.9; color: #d2bed1; }
.event-detail { display: flex; align-items: flex-start; gap: 12px; margin: 20px 0; color: var(--ink); font-size: 13px; }
.event-detail svg { width: 17px; height: 17px; flex-shrink: 0; margin-top: 3px; color: var(--pink); }
.calendar-actions { display: flex; gap: 13px; flex-wrap: wrap; margin-top: 28px; }
.event-details > .event-expired { color: var(--amber); font-size: 12px; }
dialog { border: 3px solid #a1afc7; padding: 0; background: var(--panel); color: var(--ink); width: 480px; max-width: calc(100vw - 30px); max-height: 90vh; box-shadow: 8px 8px 0 #080b18, 0 0 0 2px #111728; }
dialog::before { content: ''; display: block; height: 9px; border-bottom: 3px solid #a1afc7; background: repeating-linear-gradient(90deg, var(--sage) 0 24px, var(--amber) 24px 48px, var(--pink) 48px 72px, #8dcce2 72px 96px); }
dialog::backdrop { background: #080c20bf; }
.modal-inner { padding: 28px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.modal-header h2 { font: 24px/1.6 var(--serif); color: var(--amber); margin: 0 0 13px; }
.modal-intro { font-size: 13px; color: var(--muted); margin: 0 0 24px; line-height: 1.8; }
.modal-tabs { display: flex; border-bottom: 2px solid var(--line); margin-bottom: 24px; gap: 24px; }
.modal-tabs button { border: 0; border-bottom: 3px solid transparent; background: none; padding: 14px 3px; font-size: 14px; color: var(--muted); }
.modal-tabs button.active { border-color: var(--sage); color: var(--sage); }
label { font-size: 12px; color: var(--sage); display: block; margin-bottom: 17px; }
input:not([type=range]), textarea { width: 100%; display: block; background: #151b2c; border: 2px solid #65718b; padding: 11px 12px; margin-top: 7px; color: var(--ink); font-size: 14px; min-width: 0; border-radius: 0; }
input::placeholder, textarea::placeholder { color: #959db5; opacity: 1; }
textarea { resize: vertical; min-height: 90px; }
input[type=range] { display: block; width: 100%; accent-color: var(--sage); margin: 25px 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.form-error { color: #ffb0b2; font-size: 12px; margin: 12px 0; }
.form-note { font-size: 11px; color: var(--muted); line-height: 1.8; margin-top: 17px; }
.form-note a { text-decoration: underline; }
.big-progress { font: 48px/1.5 var(--serif); text-align: center; margin: 20px 0 0; color: var(--sage); }
.big-progress small { font: 14px var(--sans); color: var(--muted); margin-left: 10px; }
.progress-controls { display: flex; align-items: center; gap: 15px; justify-content: center; }
.progress-controls input { max-width: 100px; text-align: center; }
.progress-controls span { font-size: 13px; color: var(--muted); }
.modal-actions { display: flex; gap: 12px; margin-top: 25px; }
.modal-actions .button { flex: 1; }
.modal-actions .button.full { margin-top: 0; }
.modal-close { margin: -3px -7px 0 0; }
#toast { position: fixed; bottom: 28px; left: calc(50% + 100px); transform: translate(-50%, 20px); background: var(--sage); color: #152c2c; border: 2px solid #c3f3da; padding: 13px 23px; box-shadow: 5px 5px 0 var(--shadow); font-size: 13px; font-weight: bold; opacity: 0; pointer-events: none; transition: .15s; z-index: 30; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.notice { padding: 24px; color: var(--muted); font-size: 13px; }
.notice h2 { font: 23px/1.5 var(--serif); color: var(--amber); margin: 0 0 12px; }
.notice p { margin: 0 0 15px; }
.host-actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; }
.word-break { overflow-wrap: anywhere; }
.error-page { padding: 50px 20px; text-align: center; }
.error-page h1 { font: 26px/1.7 var(--serif); color: var(--amber); }
.error-page p { color: var(--muted); }

@media (min-width: 1500px) {
  main { padding-top: 50px; }
  .book-display { grid-template-columns: 180px 1fr; gap: 32px; padding: 35px 0; }
  .book-cover { width: 180px; }
  .book-copy h2 { font-size: 28px; }
  .right-column .card { padding: 27px; }
  .welcome { margin-bottom: 36px; }
}
@media (max-width: 1200px) {
  .sidebar { width: 218px; padding-left: 18px; padding-right: 18px; }
  .brand { font-size: 21px; }
  .main-shell { margin-left: 218px; width: calc(100% - 218px); }
  .topbar { padding: 15px 28px; }
  main { padding: 34px 28px; }
  .dashboard-grid, .below-grid { gap: 22px; grid-template-columns: minmax(0, 1.4fr) minmax(260px, 1fr); }
  .book-display { grid-template-columns: 125px 1fr; gap: 20px; }
  .book-cover { width: 125px; padding: 14px 9px; }
  .book-cover .cover-title { font-size: 15px; }
  .cover-circle { width: 55px; height: 55px; margin: 13px 0; }
  .cover-subtitle { font-size: 8px; }
  .cover-author { font-size: 9px; }
  .current-book { padding: 22px 20px 0; }
  .book-copy h2 { font-size: 21px; }
  .book-description { font-size: 12px; }
  .book-meta { gap: 7px 10px; font-size: 10px; }
  .card { padding: 20px; }
  .topbar-right > span:last-of-type { display: none; }
  footer { margin: 0 28px; }
  .member-meter { width: 75px; }
  .history-grid { gap: 20px; }
  .history-card { padding: 16px; }
  .calendar-layout { grid-template-columns: 1fr; }
  .calendar-day { aspect-ratio: auto; min-height: 43px; }
  .welcome h1 { font-size: 27px; }
  .date-stamp { display: none; }
  .section-header { flex-wrap: wrap; }
}
@media (max-width: 980px) {
  .dashboard-grid, .below-grid { grid-template-columns: 1fr; }
  .book-display { grid-template-columns: 158px 1fr; gap: 28px; }
  .current-book .book-cover { width: 158px; }
  .current-book .cover-title { font-size: 18px; }
  .current-book .cover-circle { width: 70px; height: 70px; margin: 17px 0; }
  .book-copy h2 { font-size: 24px; }
  .right-column { grid-template-columns: 1fr 1fr; gap: 22px; }
  .progress-top h3 { font-size: 15px; }
  .progress-top .avatar { display: none; }
  .meetup-line { gap: 12px; }
  .meetup-line h3 { font-size: 14px; }
  .history-grid { grid-template-columns: 1fr 1fr; }
  .stat-row { gap: 15px; }
  .stat-card { padding: 17px; }
  .stat-card strong { font-size: 26px; }
  .calendar-day { aspect-ratio: 1; }
}
@media (max-width: 700px) {
  .sidebar { position: static; width: 100%; padding: 23px 20px 16px; border-right: 0; border-bottom: 3px solid var(--line); display: block; }
  .app-shell { display: block; }
  .brand { font-size: 22px; padding: 0; align-items: center; gap: 12px; }
  .brand br { display: none; }
  .brand-caption { font-size: 10px; margin-top: 8px; letter-spacing: 1.5px; }
  .brand-icon svg { width: 30px; height: 30px; }
  .brand-icon { margin: 0; }
  .sidebar nav { display: flex; gap: 9px; margin-top: 23px; overflow-x: auto; padding-bottom: 5px; }
  .sidebar nav a { padding: 9px 10px; gap: 7px; font-size: 11px; white-space: nowrap; }
  .sidebar nav a svg { width: 15px; height: 15px; }
  .main-shell { margin: 0; width: 100%; }
  .topbar { min-height: 53px; padding: 9px 22px; gap: 10px; }
  .breadcrumb { font-size: 9px; letter-spacing: .3px; }
  .breadcrumb > span:first-child { margin: 0 6px; }
  .breadcrumb > span:last-child { font-size: 10px; }
  .topbar-right .live-dot { display: none; }
  .mobile-signin { display: inline-flex; }
  .welcome { margin-bottom: 26px; }
  .welcome h1, .page-heading h1 { font-size: 26px; line-height: 1.65; }
  .welcome p { font-size: 13px; }
  .eyebrow { font-size: 10px; letter-spacing: 1px; }
  main { padding: 28px 21px 34px; }
  .current-book { padding: 22px 20px 0; }
  .book-display { grid-template-columns: 125px minmax(0, 1fr); gap: 21px; padding: 26px 0; }
  .current-book .book-cover { width: 125px; }
  .current-book .cover-title { font-size: 15px; }
  .current-book .cover-circle { width: 55px; height: 55px; margin: 13px 0; }
  .book-copy h2 { font-size: 21px; }
  .book-description { font-size: 12px; }
  .book-author { font-size: 11px; margin-bottom: 12px; }
  .book-footer { min-height: 55px; }
  .book-footer-left { gap: 6px; }
  .right-column { gap: 18px; }
  .card, .meetup-mini { padding: 19px 16px; }
  .progress-top { margin-top: 15px; }
  .button { font-size: 13px; padding: 12px 14px; }
  .button.full { margin-top: 18px; }
  .meetup-line { gap: 10px; margin: 16px 0; }
  .date-tile { padding-right: 10px; min-width: 42px; }
  .date-tile strong { font-size: 26px; }
  .section-title { font-size: 20px; }
  .below-grid { margin-top: 30px; }
  .member-meter { width: 80px; }
  .history-grid { gap: 19px; }
  .history-card { padding: 13px; }
  .history-cover-wrap { padding: 20px 12px; min-height: 225px; }
  .history-card .book-cover { width: 115px; }
  .history-card .cover-title { font-size: 14px; }
  .history-card h2 { font-size: 18px; }
  .history-card p { font-size: 11px; }
  .history-date { font-size: 10px; }
  .stat-card { padding: 15px 12px; }
  .stat-card strong { font-size: 24px; }
  .stat-card span { font-size: 11px; }
  .members-page .member-meter { width: 24%; }
  .members-page .avatar { width: 35px; height: 35px; }
  .members-page .member-name { font-size: 12px; }
  .calendar-card, .event-details { padding: 22px; }
  .calendar-grid { gap: 3px; }
  .calendar-day { font-size: 12px; }
  .page-heading-row { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
  .page-heading-row .button { margin-bottom: 15px; }
  .calendar-heading h2 { font-size: 20px; }
  .calendar-layout { gap: 22px; }
  footer { margin: 0 21px; font-size: 10px; padding: 22px 0; flex-wrap: wrap; gap: 10px; }
  footer > span:first-child { font-size: 12px; }
  #toast { left: 50%; width: max-content; }
  .modal-inner { padding: 23px; }
  .modal-header h2 { font-size: 22px; }
  .form-row { gap: 12px; }
  .host-actions { gap: 14px; }
}
@media (max-width: 460px) {
  .right-column { grid-template-columns: 1fr; }
  .progress-top .avatar { display: inline-flex; }
  .book-display { grid-template-columns: 100px minmax(0, 1fr); gap: 17px; align-items: start; }
  .current-book .book-cover { width: 100px; padding: 12px 7px; }
  .current-book .cover-title { font-size: 13px; }
  .current-book .cover-circle { width: 40px; height: 40px; margin: 11px 0; }
  .cover-subtitle { font-size: 7px; }
  .cover-author { font-size: 8px; }
  .book-copy h2 { font-size: 19px; }
  .book-meta { font-size: 10px; }
  .book-footer { flex-wrap: wrap; }
  .history-grid { grid-template-columns: 1fr; }
  .history-cover-wrap { min-height: 250px; }
  .history-card .book-cover { width: 135px; }
  .stat-row { gap: 10px; }
  .stat-card { padding: 13px 9px; }
  .stat-card strong { font-size: 21px; }
  .member-row { gap: 8px; }
  .members-list { padding: 0 12px; }
  .member-meter { width: 48px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
@media (prefers-contrast: more) {
  :root { --muted: #e0e4f2; --line: #a8b5cc; }
  body::after { display: none; }
}

@media (max-width: 460px) {
  .brand { font-size: 20px; }
}

.sidebar-account { margin-top: auto; }
.below-grid { grid-template-columns: minmax(0, 1fr); }
.brand { font-size: 17px; line-height: 1.65; }
.brand > span:last-child { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .nav-label, .sidebar-account { display: none; }
  .brand { font-size: 19px; }
  .brand br { display: block; }
}

.book-rating { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 17px; color: var(--amber); font-size: 12px; }
.book-rating svg { width: 18px; height: 18px; fill: currentColor; }
.book-rating > span, .book-rating.unrated { color: var(--muted); font-size: 11px; }
.personal-rating { display: flex; margin-top: 15px; text-align: left; }
.personal-rating svg { color: var(--amber); }
.rating-book-title { font-size: 15px; color: var(--ink); margin: 5px 0 24px; }
.rating-fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.rating-fieldset legend { color: var(--sage); font-size: 12px; margin-bottom: 14px; }
.rating-options { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.rating-option { position: relative; margin: 0; cursor: pointer; }
.rating-option input[type=radio] { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; padding: 0; }
.rating-choice { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 7px; min-height: 70px; border: 2px solid var(--line); background: var(--paper); color: var(--muted); font: 18px var(--serif); }
.rating-choice svg { width: 21px; height: 21px; }
.rating-option:hover .rating-choice { border-color: var(--amber); color: var(--amber); }
.rating-option input:checked + .rating-choice { border-color: var(--amber); background: #403b36; color: var(--amber); box-shadow: 3px 3px 0 var(--shadow); }
.rating-option input:checked + .rating-choice svg { fill: currentColor; }
.rating-option:first-child input:checked + .rating-choice svg { fill: none; }
.rating-option input:focus-visible + .rating-choice { outline: 3px solid var(--sage); outline-offset: 3px; }
@media (max-width: 380px) {
  .rating-options { gap: 5px; }
  .rating-choice { font-size: 16px; min-height: 65px; }
  .rating-choice svg { width: 17px; height: 17px; }
}
