body {
  background: var(--bg-app);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  transition: background var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
}
h1 { font-size: var(--fs-4xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-md); }

p { color: var(--text-secondary); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-400);
}

.container {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
  padding-inline: var(--space-5);
}

/* --- Site header / nav --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(10, 12, 22, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}
[data-theme='light'] .site-header { background: rgba(246, 241, 230, 0.85); }

.navbar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-primary);
}
.brand-mark {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  background: radial-gradient(circle at 35% 30%, var(--gold-400), var(--violet-600) 75%);
  box-shadow: var(--shadow-glow-gold);
  font-size: 14px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  list-style: none;
}
.nav-links a {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  padding: var(--space-2) 0;
  border-bottom: 2px solid transparent;
  transition: color var(--duration-fast), border-color var(--duration-fast);
}
.nav-links a:hover, .nav-links a[aria-current='page'] {
  color: var(--gold-400);
  border-bottom-color: var(--gold-400);
}

.nav-actions { display: flex; align-items: center; gap: var(--space-3); }

.nav-toggle { display: none; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-sm);
  padding: 0.7rem 1.3rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast), background var(--duration-fast), border-color var(--duration-fast);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: var(--navy-950);
  box-shadow: var(--shadow-glow-gold);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 0 0 1px rgba(212,169,79,0.4), 0 10px 34px rgba(212,169,79,0.24); }

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover:not(:disabled) { background: rgba(212, 169, 79, 0.08); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) { color: var(--text-primary); }

.btn-danger {
  background: rgba(217, 117, 106, 0.14);
  color: var(--danger);
  border-color: rgba(217, 117, 106, 0.4);
}

.btn-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.05rem;
}
.btn-icon:hover { border-color: var(--border-strong); }

.btn-lg { padding: 0.95rem 1.8rem; font-size: var(--fs-base); }
.btn-sm { padding: 0.45rem 0.9rem; font-size: var(--fs-xs); }
.btn-block { width: 100%; }

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

/* --- Form elements --- */
.field { display: flex; flex-direction: column; gap: var(--space-2); margin-bottom: var(--space-4); }
.field label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-primary); }
.field .hint { font-size: var(--fs-xs); color: var(--text-faint); }
.field .error-msg { font-size: var(--fs-xs); color: var(--danger); display: none; }
.field.has-error .error-msg { display: block; }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--danger); }

.input, textarea.input, select.input {
  width: 100%;
  background: rgba(10, 12, 22, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}
[data-theme='light'] .input { background: rgba(255,255,255,0.7); }
.input::placeholder { color: var(--text-faint); }
.input:focus {
  border-color: var(--gold-400);
  box-shadow: 0 0 0 3px rgba(212, 169, 79, 0.15);
}

.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 2.75rem; }
.input-group .icon-btn {
  position: absolute; right: 0.5rem;
  background: none; border: none; color: var(--text-faint);
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
}
.input-group .icon-btn:hover { color: var(--gold-400); }

.checkbox-row { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); color: var(--text-secondary); }
.checkbox-row input { accent-color: var(--gold-500); width: 18px; height: 18px; }

/* --- Badges / pills --- */
.badge {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--fs-xs); font-weight: 600;
  padding: 0.25rem 0.65rem; border-radius: var(--radius-full);
  background: rgba(195, 179, 230, 0.14); color: var(--lavender-300);
  border: 1px solid rgba(195, 179, 230, 0.25);
}
.badge-status-unread { color: var(--ink-muted); background: rgba(168,159,196,0.12); border-color: rgba(168,159,196,0.25); }
.badge-status-currently_reading { color: var(--gold-400); background: rgba(212,169,79,0.14); border-color: rgba(212,169,79,0.3); }
.badge-status-completed { color: var(--success); background: rgba(111,191,139,0.14); border-color: rgba(111,191,139,0.3); }
.badge-status-on_hold { color: var(--teal-400); background: rgba(95,179,172,0.14); border-color: rgba(95,179,172,0.3); }
.badge-status-abandoned { color: var(--danger); background: rgba(217,117,106,0.14); border-color: rgba(217,117,106,0.3); }

/* --- Skeletons --- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(212,169,79,0.08) 37%, var(--bg-card) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* --- Toasts --- */
.toast-region {
  position: fixed; bottom: var(--space-5); right: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-2);
  z-index: 1000; max-width: 360px;
}
.toast {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-soft);
  font-size: var(--fs-sm);
  display: flex; align-items: flex-start; gap: var(--space-2);
  animation: toast-in var(--duration-base) var(--ease-out);
}
.toast-success { border-color: rgba(111,191,139,0.4); }
.toast-error { border-color: rgba(217,117,106,0.4); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* --- Empty / error states --- */
.state-panel {
  text-align: center;
  padding: var(--space-8) var(--space-5);
  color: var(--text-secondary);
}
.state-panel .state-icon { font-size: 2.5rem; margin-bottom: var(--space-3); }
.state-panel h3 { color: var(--text-primary); margin-bottom: var(--space-2); }

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-7) 0 var(--space-5);
  color: var(--text-faint);
  font-size: var(--fs-sm);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}
.footer-grid h4 { color: var(--text-primary); margin-bottom: var(--space-3); font-size: var(--fs-sm); }
.footer-grid a { display: block; color: var(--text-faint); margin-bottom: var(--space-2); }
.footer-grid a:hover { color: var(--gold-400); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: var(--space-5); border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap; gap: var(--space-3);
}
.attribution-note { font-size: var(--fs-xs); color: var(--text-faint); }

/* --- Utility --- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}
.text-center { text-align: center; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
