:root {
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --max-width: 1100px;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --book-detail-scrim-opacity: 90%;
  --book-detail-scrim-blur: 6px;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--button-text, #fff);
  padding: var(--space-sm) var(--space-md);
  z-index: 100;
}

.skip-link:focus { left: var(--space-md); }

.site-header {
  --header-logo: var(--text);
  --header-link: var(--link);
  --header-link-active: var(--text);
  --dropdown-bg: var(--surface);
  --dropdown-text: var(--text);
  --dropdown-hover-bg: var(--surface-2);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) 0;
}

.logo {
  font-family: var(--font-display, var(--font-sans));
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--header-logo);
  text-decoration: none;
  text-transform: var(--logo-transform, none);
  letter-spacing: var(--logo-letter-spacing, normal);
}

.site-header .nav > a,
.site-header .nav-bell-link,
.site-header .nav-dropdown-trigger,
.site-header .link-button {
  color: var(--header-link);
}

.site-header .nav > a.nav-link-active,
.site-header .nav-bell-link.nav-link-active,
.site-header .nav-dropdown-trigger.nav-link-active {
  color: var(--header-link-active);
  font-weight: 700;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
}

.nav-link-active {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--header-link, var(--link));
  font: inherit;
  cursor: pointer;
}

.nav-dropdown-trigger:hover,
.nav-dropdown-item:hover {
  text-decoration: underline;
}

.nav-account-trigger:hover,
.nav-account-trigger:focus-visible {
  text-decoration: none;
}

.nav-account-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}

.nav-account-avatar--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display, var(--font-sans));
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}

.site-header .nav-account-trigger.nav-link-active .nav-account-avatar {
  border-color: var(--header-link-active, var(--accent));
}

.nav-dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  min-width: 11rem;
  padding: var(--space-xs);
  background: var(--dropdown-bg, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 20;
}
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
}

.nav-dropdown.open .nav-dropdown-menu {
  display: flex;
  flex-direction: column;
}

.nav-dropdown-item {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: calc(var(--radius) - 2px);
  color: var(--dropdown-text, var(--text));
  text-decoration: none;
  white-space: nowrap;
}

.nav-dropdown-item:hover {
  background: var(--dropdown-hover-bg, var(--surface-2));
  color: var(--dropdown-text, var(--text));
  text-decoration: none;
}

.nav-dropdown-item.active {
  background: var(--dropdown-hover-bg, var(--surface-2));
  color: var(--dropdown-text, var(--text));
  font-weight: 700;
}

.nav-dropdown-form {
  margin: 0;
}

.nav-dropdown-action {
  display: block;
  width: 100%;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.nav-bell-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem;
  text-decoration: none;
  color: var(--header-link, var(--link));
}

.nav-bell-link:hover,
.nav-bell-link:focus-visible,
.nav-bell-link.nav-link-active {
  text-decoration: none;
}

.site-header .nav .nav-bell-link--idle:not(:hover):not(:focus-visible) {
  opacity: 0.55;
}

.site-header .nav-bell-link--idle.nav-link-active:not(:hover):not(:focus-visible) {
  color: var(--header-link, var(--link));
  font-weight: inherit;
}

.nav-bell-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

.nav-bell-link .nav-bell-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.4rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  font-size: 0.65rem;
}

.site-header .nav-dropdown-menu .nav-dropdown-action:hover {
  background: var(--dropdown-hover-bg, var(--surface-2));
  text-decoration: none;
}

.site-header .nav-dropdown-menu .nav-dropdown-item:hover,
.site-header .nav-dropdown-menu .nav-dropdown-item.active {
  text-shadow: none;
  box-shadow: none;
  filter: none;
}

main { flex: 1; padding: var(--space-xl) 0; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-lg) 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero { margin-bottom: var(--space-lg); }
.hero h1 { margin: 0 0 var(--space-xs); }
.subtitle { color: var(--muted); margin: 0; }

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.search-bar input[type="search"] {
  flex: 1 1 220px;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
  min-width: 0;
  max-width: 100%;
}

.button, button.button, .search-bar button {
  display: inline-block;
  padding: 0.65rem 1rem;
  border: var(--border-width, 0) solid var(--button-border, transparent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--button-text, #fff);
  font: inherit;
  font-family: var(--font-button, var(--font-sans));
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--button-shadow, none);
  text-transform: var(--button-transform, none);
  letter-spacing: var(--button-letter-spacing, normal);
}

.button:hover, .search-bar button:hover {
  filter: var(--button-hover-filter, brightness(1.05));
  text-decoration: none;
  transform: var(--button-hover-transform, none);
}
.button.secondary {
  background: var(--surface-2);
  color: var(--text);
  border: var(--border-width, 1px) solid var(--border);
  box-shadow: var(--button-secondary-shadow, none);
}
.button.small { padding: 0.35rem 0.6rem; font-size: 0.85rem; }

.link-button {
  background: none;
  border: none;
  color: var(--link);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.link-button.danger { color: var(--danger); }

.inline-form { display: inline; }

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-lg);
}

.browse-load-more {
  display: flex;
  justify-content: center;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.book-card {
  background: var(--surface);
  border: var(--border-width, 1px) solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background-image: var(--surface-texture, none);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.book-card:hover { transform: translateY(-2px); }

.book-card-cover-link,
.book-title-link {
  color: inherit;
  text-decoration: none;
}

.book-card-cover-link {
  display: block;
}

.book-title-link:hover {
  text-decoration: underline;
}

.book-cover {
  aspect-ratio: 2 / 3;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-placeholder {
  color: var(--muted);
  font-size: 0.85rem;
  padding: var(--space-md);
  text-align: center;
}

.cover-placeholder.large { min-height: 280px; display: flex; align-items: center; justify-content: center; }

.book-info { padding: var(--space-md); }
.book-info h2 { margin: 0 0 var(--space-xs); font-size: 1rem; line-height: 1.3; }

.book-owner {
  margin: var(--space-xs) 0;
  font-size: 0.85rem;
}

.book-subtitle { margin: 0; color: var(--muted); font-size: 0.9rem; }
.book-authors { margin: var(--space-xs) 0; font-size: 0.9rem; }
.book-meta { margin: 0; font-size: 0.8rem; color: var(--muted); display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.qty { font-weight: 600; }

.book-detail {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-xl);
}

.book-detail-cover img,
.book-detail-cover .cover-placeholder {
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.book-detail-info {
  padding: var(--space-lg);
  border-radius: var(--radius);
  border: var(--border-width, 1px) var(--border-style, solid) var(--border);
  background: color-mix(
    in srgb,
    var(--surface) var(--book-detail-scrim-opacity, 90%),
    transparent
  );
  box-shadow: var(--shadow);
  backdrop-filter: blur(var(--book-detail-scrim-blur, 6px));
  -webkit-backdrop-filter: blur(var(--book-detail-scrim-blur, 6px));
}

.book-detail-info h1 { margin-top: 0; }

.detail-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-xs) var(--space-md);
  margin: var(--space-lg) 0;
}

.detail-list dt { font-weight: 600; color: var(--muted); }
.detail-list dd { margin: 0; }
.detail-list.compact { font-size: 0.95rem; }

.description h2 { font-size: 1rem; margin-bottom: var(--space-sm); }

.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 420px;
}

.form label { font-weight: 600; font-size: 0.9rem; }

.form input[type="email"],
.form input[type="tel"],
.form input[type="text"],
.form input[type="password"],
.form input[type="number"],
.form input[type="url"],
.form input[type="file"],
.form select,
.form textarea {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  max-width: 100%;
}

.form select { width: 100%; }

.admin-library-form { max-width: none; }
.admin-add-form { max-width: none; }
.admin-admins-panel { margin-bottom: var(--space-xl); }
.panel-subheading {
  margin: var(--space-lg) 0 var(--space-md);
  font-size: 1rem;
}
.section-heading {
  margin: 0 0 var(--space-sm);
  font-size: 1.25rem;
}
.admin-table-wrap-compact { margin-bottom: var(--space-md); }
.hold-override-list { margin: var(--space-sm) 0 var(--space-md); padding-left: 1.25rem; }

.manual-add-panel { max-width: 640px; }
.manual-form { max-width: none; }
.required { color: var(--danger); }
.field-hint { margin: 0 0 var(--space-sm); font-size: 0.85rem; }

.upload-cover-form {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.upload-cover-form input[type="file"] {
  max-width: 9rem;
  font-size: 0.75rem;
  padding: 0.2rem;
}

.auth-card, .panel {
  background: var(--surface);
  border: var(--border-width, 1px) solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-xl);
  box-shadow: var(--shadow);
  max-width: 640px;
  margin-inline: auto;
  background-image: var(--surface-texture, none);
  background-size: var(--surface-texture-size, auto);
}

.auth-card h1 {
  margin: 0 0 var(--space-xs);
}

.auth-card > .subtitle {
  margin-bottom: var(--space-lg);
}

.auth-card > .alert {
  margin-bottom: var(--space-lg);
}

.legal-page {
  max-width: 42rem;
}

.legal-content h2 {
  font-size: 1.05rem;
  margin: var(--space-lg) 0 var(--space-sm);
}

.legal-content ul {
  margin: 0 0 var(--space-md);
  padding-left: 1.25rem;
}

.legal-content li + li {
  margin-top: 0.35rem;
}

.footer-legal {
  margin-top: var(--space-xs);
  font-size: 0.9rem;
}

.register-card {
  max-width: 560px;
}

.register-form {
  max-width: none;
  gap: 0;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.form-field label {
  margin: 0;
}

.form-field input:not([type="checkbox"]),
.form-field textarea,
.form-field select {
  width: 100%;
}

.checkbox-field {
  gap: 0.25rem;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}

.checkbox-field .field-hint {
  margin: 0;
  padding-left: 1.65rem;
  max-width: 36rem;
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-width: 0;
}

.register-form > .form-section + .form-section {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.form-section-title {
  margin: 0 0 var(--space-xs);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
}

.register-form .field-hint {
  margin: calc(-1 * var(--space-xs)) 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
  width: 100%;
}

.form-row-3 {
  grid-template-columns: 2fr 1fr 1fr;
}

.form-actions {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
}

.register-form .form-actions .button {
  width: 100%;
}

.profile-list {
  margin-top: 0;
}

.admin-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.admin-actions { display: flex; gap: var(--space-sm); }

.admin-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.owner-holds-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.owner-hold-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border);
}

.owner-hold-item:last-child {
  border-bottom: none;
}

.admin-dashboard-table th,
.admin-dashboard-table td {
  vertical-align: top;
}

.admin-dashboard-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.admin-dashboard-table tbody tr:last-child {
  border-bottom: none;
}

.admin-dashboard-table tbody td {
  border-bottom: none;
}

.admin-dashboard-wrap .admin-dashboard-table {
  min-width: 0;
}

.admin-dashboard-table .col-cover {
  width: 3rem;
  vertical-align: top;
}

.admin-dashboard-table .col-qty {
  width: 7rem;
  vertical-align: top;
}

.admin-dashboard-table .col-actions {
  width: 9rem;
  vertical-align: top;
}

.table-cover-placeholder {
  display: inline-block;
  width: 2.5rem;
  text-align: center;
  font-size: 0.85rem;
}

.admin-book-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 10rem;
  max-width: 32rem;
}

.admin-book-title {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1.3;
}

.admin-book-title:hover {
  color: var(--link);
  text-decoration: underline;
}

.admin-book-subtitle,
.admin-book-authors,
.admin-book-isbn {
  display: block;
  line-height: 1.35;
}

.admin-book-authors {
  font-size: 0.9rem;
}

.admin-book-isbn {
  font-size: 0.8rem;
}

.admin-dashboard-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  white-space: normal;
}

.admin-dashboard-actions .inline-form,
.admin-dashboard-actions .upload-cover-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.admin-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.admin-table th,
.admin-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.admin-table th { background: var(--surface-2); font-size: 0.85rem; }
.table-cover { width: 40px; border-radius: 4px; }
.actions-cell { white-space: nowrap; }
.actions-cell form { display: inline; }
.inline-qty-form { display: flex; gap: var(--space-xs); align-items: center; }

.status-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}

.status-pending { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.status-approved { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.status-rejected { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.status-blocked { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.status-overdue { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.status-active { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

.fine-lattes {
  font-weight: 600;
  color: var(--danger);
}

.danger-button {
  background: var(--danger);
  color: #fff;
}

.danger-button:hover { filter: brightness(1.05); }

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.filter-tab {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
}

.filter-tab.active,
.filter-tab:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.filter-tab.active {
  background: var(--surface-2);
}

.notification-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.notification-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.notification-item.is-unread {
  border-color: var(--accent);
  background: var(--surface-2);
}

.notification-title {
  margin: 0 0 var(--space-xs);
  font-weight: 700;
}

.notification-body {
  margin: 0 0 var(--space-xs);
  white-space: pre-line;
}

.notification-meta {
  margin: 0;
  font-size: 0.85rem;
}

.notification-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.library-actions {
  margin: var(--space-lg) 0;
  padding: var(--space-lg) 0;
  border-top: 1px solid var(--border);
}

.library-actions h2 {
  margin: 0 0 var(--space-md);
  font-size: 1.1rem;
}

.library-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.library-action-buttons form { display: inline; }

.qty-input { width: 4rem; }

.add-book-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.scanner-region {
  width: 100%;
  max-width: 360px;
  min-height: 0;
  margin-bottom: var(--space-md);
  border-radius: var(--radius);
  overflow: hidden;
}

.preview-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-md);
}

.preview-description { font-size: 0.9rem; color: var(--muted); }

.alert {
  padding: var(--space-md);
  border-radius: var(--radius);
  margin-bottom: var(--space-md);
}

.alert.error { background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger); }
.alert.success { background: var(--success-bg); color: var(--success); border: 1px solid var(--success); }
.alert.warning { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); }
.alert.info { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

.csrf-banner {
  margin-top: var(--space-md);
  margin-bottom: calc(-1 * var(--space-sm));
}

.empty-state {
  text-align: center;
  padding: var(--space-xl);
  color: var(--muted);
}

.error-page { text-align: center; padding: var(--space-xl) 0; }
.error-page h1 { font-size: 4rem; margin: 0; color: var(--muted); }

.theme-form fieldset {
  border: none;
  padding: 0;
  margin: 0 0 var(--space-md);
}

.theme-form .theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-md);
}

.theme-card {
  display: block;
  cursor: pointer;
}

.theme-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.theme-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: 100%;
  padding: var(--space-md);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-card:hover .theme-card-body,
.theme-card:focus-within .theme-card-body {
  border-color: var(--accent);
}

.theme-card:has(input:checked) .theme-card-body,
.theme-card-selected .theme-card-body {
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}

.theme-swatches {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.25rem;
}

.theme-swatch {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.theme-card-name {
  font-weight: 700;
  color: var(--text);
}

.theme-card-inspiration {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.theme-card-description {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}

.theme-form { max-width: none; }

.radio-card {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.radio-card:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }

.checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: var(--space-md);
}

.checkbox-card:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }

.checkbox-card input { margin-top: 0.15rem; }

.future-panel ul { margin: 0; padding-left: 1.2rem; }
.future-panel li { margin-bottom: var(--space-xs); }

.muted { color: var(--muted); }
.future-note { font-size: 0.9rem; margin-top: var(--space-lg); }

.auth-footer {
  margin-top: var(--space-lg);
  margin-bottom: 0;
  font-size: 0.95rem;
}

.account-card { max-width: 480px; }
.account-section { margin-top: var(--space-lg); }
.account-section h2 {
  margin: 0 0 var(--space-md);
  font-size: 1.1rem;
}

.account-subheading {
  margin: var(--space-md) 0 var(--space-sm);
  font-size: 0.95rem;
}

.user-profile-header {
  margin-bottom: var(--space-lg);
}

.user-profile-identity {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.user-profile-avatar,
.profile-avatar-preview {
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
  background: var(--surface-2);
}

.user-profile-avatar--placeholder,
.profile-avatar-preview--placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display, var(--font-sans));
  font-size: 2rem;
  font-weight: 700;
  color: var(--muted);
}

.profile-avatar-field {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.profile-avatar-upload {
  flex: 1;
  min-width: 0;
}

.user-profile-heading {
  min-width: 0;
}

.user-profile-username {
  display: block;
  font-size: 1rem;
  font-weight: normal;
  margin-top: var(--space-xs);
}

.user-profile-badge {
  margin-top: var(--space-sm);
}

.user-profile-bio,
.user-profile-books {
  margin-bottom: var(--space-lg);
}

.profile-preview {
  margin-bottom: var(--space-md);
}

.profile-book-list {
  margin-bottom: var(--space-lg);
}

.user-profile-link {
  font-weight: inherit;
}

.library-list {
  margin: 0 0 var(--space-md);
  padding-left: 1.2rem;
}

.library-list li { margin-bottom: var(--space-xs); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--surface-2);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  overflow-wrap: anywhere;
}
