:root {
  --bg: #ffffff;
  --text: #1c1c1e;
  --muted: #6b6b70;
  --accent: #4a5fc1;
  --border: #e2e2e6;
  --surface: #f6f6f8;
  --comment-bar: #ececef;
  --comment-bar-hover: #a9a9b0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17171a;
    --text: #ececf0;
    --muted: #9a9aa2;
    --accent: #8fa0ff;
    --border: #33333a;
    --surface: #202026;
    --comment-bar: #2c2c33;
    --comment-bar-hover: #55555e;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--accent); }

.site-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.site-name {
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
}
.content {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem;
}
.site-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

.comic-image img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.comic-nav {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin: 1.25rem 0;
  flex-wrap: wrap;
}
.comic-nav span { color: var(--muted); }
.page-meta { color: var(--muted); font-size: 0.9rem; }

.author-notes, .comments {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1.5rem;
}
.comments-placeholder { color: var(--muted); }
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 0.4rem;
}
.signed-in { display: flex; align-items: center; gap: 0.4rem; }

.comment-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
}
.comment .comment-list { padding-left: 1.5rem; }
.comment {
  border-left: 1px solid var(--comment-bar);
  padding: 0.6rem 0 0.2rem 0.85rem;
  margin-top: 0.75rem;
}
.comment-list-root > .comment {
  border-left: none;
  padding-left: 0;
}
/* Darken only the innermost hovered comment's bar, not its ancestors. */
.comment:hover:not(:has(.comment:hover)) {
  border-left-color: var(--comment-bar-hover);
}
.comment-archived {
  opacity: 0.85;
}
.comment-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.comment-meta { color: var(--muted); font-size: 0.8rem; }
.badge {
  background: var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; }
/* Archived comments are HTML: newlines between tags and <br>s between paragraphs aren't spacing. */
.comment-body-html { white-space: normal; }
.comment-body-html p { margin: 0 0 0.6em; }
.comment-body-html p:last-child { margin-bottom: 0; }
.comment-body-html p + br, .comment-body-html p:empty { display: none; }
.reply summary { cursor: pointer; color: var(--accent); font-size: 0.85rem; }
.reply form { margin-top: 0.5rem; }
.comment-form-area { margin-top: 1.25rem; }
.badge-pending { background: #f4d47c; color: #5c4a00; }
.hp-field { position: absolute; left: -9999px; }
.mod-body { max-width: 34rem; }
.mod-actions form { margin-bottom: 0.2rem; }
.form-label { font-size: 0.95rem; }
#notes-editor {
  background: var(--bg);
  min-height: 8rem;
  border-radius: 0 0 6px 6px;
}
.notes-body p { margin: 0.4rem 0; }
.notes-body blockquote {
  border-left: 3px solid var(--border);
  margin-left: 0;
  padding-left: 0.8rem;
  color: var(--muted);
}

.archive-latest { font-size: 1.1rem; }
.jump-form {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  margin: 1rem 0;
}
.jump-form label { display: flex; flex-direction: column; gap: 0.25rem; }
.jump-form select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  min-width: 14rem;
}
.section-jump { padding-left: 1.2rem; }

.page-characters { color: var(--muted); margin-top: 0.75rem; }
.character-list { list-style: none; padding: 0; }
.character-list li { margin: 0.5rem 0; display: flex; align-items: center; gap: 0.6rem; }
.character-list img { width: 48px; height: 48px; object-fit: cover; border-radius: 50%; }
.character-list a { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.character-portrait { max-width: 240px; border-radius: 8px; }
.character-blurb { color: var(--muted); font-size: 0.9rem; }
.character-blurb p { margin: 0; }

/* featured cast: portrait left, name + description right */
.featured-cast { list-style: none; padding: 0; }
.featured-cast li {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 1rem 0;
}
.featured-cast .featured-portrait { flex-shrink: 0; }
.featured-cast .featured-portrait img {
  width: 120px;
  height: auto;
  border-radius: 8px;
  display: block;
}
.featured-cast .featured-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.featured-cast .featured-name { font-weight: 600; text-decoration: none; }
.featured-cast .character-blurb { margin: 0.25rem 0 0; }
.appearance-grid {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.5rem, 1fr));
  gap: 0.35rem;
  max-width: 34rem;
}
.appearance-grid a, .appearance-grid span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
}
.appearance-grid span { color: var(--muted); background: var(--surface); }
.appearance-grid span.gap { border: none; background: none; }
.appearance-grid a {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}
/* site nav */
.site-nav { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.4rem; font-size: 0.95rem; }

/* comic page extras */
.content-warning summary {
  cursor: pointer;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
}
.transcript summary { cursor: pointer; color: var(--accent); }
.transcript .notes-body { white-space: pre-wrap; }
.page-tags { color: var(--muted); font-size: 0.9rem; }
.hd-link { text-align: center; font-size: 0.9rem; }

/* galleries + events */
.gallery-grid, .gallery-index { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.gallery-grid img, .gallery-index img { max-width: 100%; border-radius: 6px; display: block; }
.gallery-index a { text-decoration: none; }
.event-list { list-style: none; padding: 0; }
.event-list li { margin-bottom: 1rem; }
.event-list-past { opacity: 0.75; }
.blog-entry { border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1.5rem; }

.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 480px;
}
.stacked-form label { display: flex; flex-direction: column; gap: 0.25rem; }
.stacked-form input, .stacked-form textarea, .stacked-form select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
button {
  padding: 0.45rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  cursor: pointer;
  align-self: flex-start;
}
.inline-form { display: inline; }
.inline-form button { padding: 0.2rem 0.6rem; font-size: 0.85rem; }

