:root {
  --ink: #292621;
  --muted: #6f685d;
  --paper: #f7f3eb;
  --paper-deep: #ede5d6;
  --gold: #b68a36;
  --gold-bright: #d1a958;
  --line: rgba(84, 67, 39, .18);
  --night: #17130f;
  --white: #fffdf8;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Sarabun", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(182,138,54,.11), transparent 32rem),
    linear-gradient(145deg, var(--paper), #fff 55%, var(--paper-deep));
}
button, input { font: inherit; }
a { color: inherit; }

.sitebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 5vw, 4rem);
  border-bottom: 1px solid var(--line);
  background: rgba(255,253,248,.86);
  backdrop-filter: blur(14px);
}
.brand { font-family: "Prompt", sans-serif; font-weight: 700; text-decoration: none; }
.sitebar nav { display: flex; gap: 1rem; align-items: center; }
.sitebar nav a { color: var(--muted); text-decoration: none; }

.shell { width: min(1080px, calc(100% - 2rem)); margin: 0 auto; padding: 4rem 0; }
.auth-shell { width: min(520px, calc(100% - 2rem)); margin: 0 auto; padding: 8vh 0 3rem; }
.card {
  background: rgba(255,253,248,.94);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(54,42,23,.12);
  padding: clamp(1.5rem, 5vw, 3rem);
}
.eyebrow { color: var(--gold); font-family: "Prompt"; font-weight: 700; letter-spacing: .05em; }
h1, h2 { font-family: "Prompt", sans-serif; line-height: 1.25; }
h1 { font-size: clamp(2rem, 6vw, 3.6rem); margin: .5rem 0 1rem; }
h2 { font-size: clamp(1.35rem, 4vw, 2rem); }
.lede { color: var(--muted); font-size: 1.08rem; line-height: 1.8; }
.field { display: grid; gap: .55rem; margin: 1.5rem 0 1rem; }
.field label { font-weight: 700; }
.field input {
  width: 100%; min-height: 52px; padding: .8rem 1rem;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  font-size: 1rem;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 50px; padding: .75rem 1.35rem; border: 0; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  color: #19140c; font-family: "Prompt"; font-weight: 700; text-decoration: none;
  cursor: pointer; box-shadow: 0 10px 28px rgba(182,138,54,.25);
}
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn:disabled { opacity: .55; cursor: wait; }
.status { min-height: 1.5rem; color: var(--muted); margin-top: 1rem; }
.status.error { color: #a33232; }
.status.success { color: #286343; }

.book-card { display: grid; grid-template-columns: minmax(180px, 270px) 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.book-cover { width: 100%; border-radius: 8px; box-shadow: 0 24px 55px rgba(33,25,14,.24); }
.book-meta { color: var(--muted); }
.access-badge { display: inline-flex; padding: .4rem .75rem; border-radius: 999px; background: rgba(42,117,76,.1); color: #276246; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }

@media (max-width: 700px) {
  .sitebar nav a:first-child { display: none; }
  .shell { padding-top: 2rem; }
  .book-card { grid-template-columns: 1fr; }
  .book-cover { max-width: 230px; margin: 0 auto; }
}


/* Keep all protected/loading states hidden until selected by the app. */
[hidden] { display: none !important; }
