/* Book Club with Claude — a quiet reading room. Serif for the book,
   sans for the tools. Warm paper background. */
:root {
  --paper: #faf8f4;
  --card: #ffffff;
  --ink: #2a2723;
  --muted: #8a8377;
  --line: #e7e1d6;
  --accent: #7a5c3e;        /* worn leather */
  --claude: #6a4fb0;        /* Claude's chair */
  --blur-bg: #f0ebe2;
  --radius: 14px;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-read: Georgia, "Iowan Old Style", "Palatino", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
#app { max-width: 720px; margin: 0 auto; padding: 0 16px 96px; }

.topbar {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 18px 4px 12px; position: sticky; top: 0; background: var(--paper);
  z-index: 5; border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--font-read); font-size: 22px; font-weight: 600; }
.pilcrow { color: var(--claude); font-weight: 700; }
.whoami { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.whoami-name { color: var(--ink); font-weight: 600; }
.whoami a { color: var(--accent); cursor: pointer; text-decoration: underline; }

.tabbar { display: flex; gap: 6px; padding: 12px 0 4px; }
.tabbar[hidden] { display: none; }
.tabbar a {
  flex: 1; text-align: center; padding: 9px; border-radius: 10px;
  text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600;
  background: transparent;
}
.tabbar a.active { color: var(--ink); background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

.view { padding-top: 12px; }

/* generic bits */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 10px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
button, .btn {
  font-family: var(--font-ui); font-size: 15px; font-weight: 600;
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 10px 16px; cursor: pointer;
}
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
button:disabled { opacity: .5; cursor: default; }
input, textarea, select {
  font-family: var(--font-ui); font-size: 15px; width: 100%;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink);
}
textarea { min-height: 74px; resize: vertical; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.row { display: flex; gap: 8px; align-items: center; }
.err { color: #b23a2e; font-size: 13px; margin-top: 6px; }

/* login */
.login { max-width: 340px; margin: 12vh auto 0; text-align: center; }
.login .lede { font-family: var(--font-read); font-size: 17px; color: var(--muted); margin-bottom: 20px; }

/* book header */
.book-head h2 { font-family: var(--font-read); font-size: 24px; margin: 0 0 2px; }
.book-head .by { color: var(--muted); font-style: italic; }
.frontier-note { font-size: 13px; color: var(--accent); margin-top: 8px; }

/* the thread */
.msg { display: flex; gap: 10px; margin: 14px 0; }
.avatar {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 15px;
  background: var(--accent);
}
.avatar.claude { background: var(--claude); font-size: 20px; }
.avatar.has-img { background-size: cover; background-position: center; color: transparent; }
.bubble { flex: 1; }
.byline { font-size: 13px; font-weight: 600; }
.byline .tag { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }
.body { font-family: var(--font-read); font-size: 16px; line-height: 1.5; margin-top: 2px; white-space: pre-wrap; }
.body.claude { color: #3d3550; }

/* the blur card — the carrot */
.blurred {
  background: var(--blur-bg); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-top: 2px; color: var(--muted); font-size: 14px;
}
.blurred b { color: var(--ink); }
.confession-badge { font-size: 11px; color: var(--claude); font-weight: 700; letter-spacing: .04em; }

/* composer */
.composer { position: sticky; bottom: 0; background: var(--paper); padding: 12px 0 16px; border-top: 1px solid var(--line); }
.composer .meta { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.composer select { width: auto; flex: 1; }

/* reader control */
.reader-ctl { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.reader-ctl select { width: auto; flex: 1; }

/* table (reader spread) */
.spread li { list-style: none; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.spread .who { font-weight: 600; }
.spread .rel { color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
