/* AdvocacyAPI stylesheet.
 *
 * Consolidated from the nine per-page <style> blocks that used to be
 * interpolated into heredoc HTML. Three surfaces, chosen by the <body> class
 * that the root layout sets from @page_class:
 *
 *   body.site    public pages (home, postcode, representative, area, decision, meeting)
 *   body.admin   /admin
 *   body.docs    /data — a plain reference page with its own, unrelated look
 *
 * The surfaces disagree about `body`, `table`, `th`, `code` and the reset, so
 * each is scoped rather than merged. The resets use :where() to keep the zero
 * specificity of the bare `*` selector they replace — without it the reset
 * would start beating single-class rules like `.card { padding: … }`.
 *
 * Hand-written: there is no CSS build step. Served by Plug.Static from
 * priv/static/assets.
 */

/* ==========================================================================
   1. Resets — per surface, zero specificity
   ========================================================================== */

:where(body.site) *,
:where(body.site) *::before,
:where(body.site) *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:where(body.admin) *,
:where(body.admin) *::before,
:where(body.admin) *::after {
  box-sizing: border-box;
}

/* body itself is not a descendant of body, so the reset above never reaches it. */
body.site {
  margin: 0;
}

/* ==========================================================================
   2. Sticky nav + spotlight search — shared by body.site and body.admin
   ========================================================================== */

.nav {
  background: #1a1a2e;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-family: 'Source Serif 4', Georgia, serif;
  color: white;
  font-size: 1.25rem;
  text-decoration: none;
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}

.nav-search {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 440px;
}

.nav-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid #3a3a52;
  border-radius: 10px;
  background: #2a2a42;
  color: #e0dfe6;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.nav-search input::placeholder {
  color: #7a7a96;
}

.nav-search input:focus {
  border-color: #6b5b95;
  background: #32324e;
}

.nav-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #7a7a96;
  font-size: 0.9rem;
  pointer-events: none;
}

.nav-search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #3a3a52;
  color: #7a7a96;
  font-size: 0.7rem;
  padding: 3px 7px;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  pointer-events: none;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e0ddd8;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  display: none;
  max-height: 420px;
  overflow-y: auto;
}

.search-dropdown.active {
  display: block;
}

.search-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9a9aae;
  padding: 10px 14px 4px;
}

.search-item {
  padding: 8px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: #1a1a2e;
  text-decoration: none;
  transition: background 0.1s;
}

.search-item:hover,
.search-item.active {
  background: #f4f2ef;
}

.search-item-sub {
  font-size: 0.75rem;
  color: #9a9aae;
}

.search-item-icon {
  width: 20px;
  text-align: center;
  color: #6b5b95;
  font-size: 0.8rem;
}

.search-empty {
  padding: 16px 14px;
  color: #9a9aae;
  font-size: 0.85rem;
  text-align: center;
}

.nav-links {
  display: flex;
  gap: 2px;
  margin-left: auto;
  position: relative;
  z-index: 1;
}

.nav-link {
  color: #b0b0c4;
  text-decoration: none;
  font-size: 0.825rem;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.15s;
  font-weight: 500;
}

.nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.nav-link--logout {
  color: #e8786a;
}

.nav-link--logout:hover {
  color: white;
  background: #c0392b;
}

/* ==========================================================================
   3. Surface: site
   ========================================================================== */

body.site {
  font-family: 'Inter', -apple-system, sans-serif;
  color: #1a1a2e;
  line-height: 1.7;
  background: #faf9f7;
  -webkit-font-smoothing: antialiased;
}

/* The postcode page runs tighter leading than the rest of the site. */
body.site.page-postcode {
  line-height: 1.6;
}

/* -- Page chrome -- */

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

/* The generic show page (representative, ward, not-found) is narrower and has
   a deeper top padding than the decision/meeting pages. */
body.page-show .container {
  max-width: 860px;
  padding: 2.5rem 2rem 4rem;
}

/* Council pages carry four stat cards and a wide table. */
body.page-council .container {
  max-width: 1000px;
}

.page-header {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 2rem 0;
}

.breadcrumb {
  font-size: 0.8rem;
  color: #9a9aae;
  margin-bottom: 0.5rem;
}

.breadcrumb a {
  color: #6b5b95;
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.page-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  color: #1a1a2e;
  margin-bottom: 0.25rem;
}

/* Council and postcode headers sit tighter to their eyebrow. */
.page-title--tight {
  margin-bottom: 0.15rem;
}

/* Decision and meeting pages use a smaller title. */
.page-title--sm {
  font-size: 1.8rem;
}

.page-kind {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6b5b95;
  margin-bottom: 1.5rem;
}

/* On the postcode page the API link sits between the eyebrow and the columns. */
.page-kind--tight {
  margin-bottom: 0.75rem;
}

.meta {
  font-size: 0.85rem;
  color: #6b6b80;
  margin-bottom: 1.5rem;
}

.api-link {
  font-size: 0.85rem;
  margin-top: 1rem;
}

.api-link--above {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.api-link a {
  color: #6b5b95;
  text-decoration: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  background: #f0ede8;
  padding: 0.3em 0.6em;
  border-radius: 4px;
}

.api-link a:hover {
  background: #e8e4dd;
}

/* -- Sections and fields -- */

.section {
  margin-bottom: 2rem;
}

.section-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #e0ddd8;
  padding-bottom: 0.3rem;
}

/* Council pages use a larger, rule-less section heading. */
.section-title--plain {
  font-size: 1.3rem;
  border-bottom: none;
  padding-bottom: 0;
}

.field {
  margin-bottom: 0.75rem;
}

.field-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b5b95;
  margin-bottom: 0.15rem;
}

.field-value {
  font-size: 0.9rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* -- Badges -- */

.badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.15em 0.5em;
  border-radius: 4px;
  font-weight: 500;
}

.badge-green {
  background: #e6f4ea;
  color: #1e7e34;
}

.badge-blue {
  background: #e8f0fe;
  color: #1a56db;
}

.badge-amber {
  background: #fef3cd;
  color: #856404;
}

.badge-red {
  background: #fde8e8;
  color: #c81e1e;
}

.badge-gray {
  background: #f0ede8;
  color: #6b6b80;
}

.badge-purple {
  background: #ede9fe;
  color: #6b5b95;
}

/* -- Buttons and flash -- */

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: none;
  font-family: 'Inter', sans-serif;
}

.btn-primary {
  background: #6b5b95;
  color: white;
}

.btn-primary:hover {
  background: #5a4a84;
}

.btn-disabled {
  background: #e0ddd8;
  color: #9a9aae;
  cursor: default;
}

.flash-info {
  background: #e6f4ea;
  border: 1px solid #a7f3d0;
  color: #1e7e34;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.flash-error {
  background: #fde8e8;
  border: 1px solid #ffc1c0;
  color: #c81e1e;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* ==========================================================================
   4. Home page
   ========================================================================== */

.hero {
  min-height: 52vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4rem 2rem 2rem;
  background: linear-gradient(180deg, #fff 0%, #faf9f7 100%);
}

.hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #6b5b95;
  margin-bottom: 1rem;
}

.hero h1 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  font-weight: 400;
  color: #1a1a2e;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.hero p {
  font-size: 1.1rem;
  color: #4a4a68;
  max-width: 520px;
  line-height: 1.8;
}

.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  max-width: 820px;
  margin: 3rem auto 0;
  padding: 0 2rem;
}

.card {
  background: #fff;
  border: 1px solid #eae8e4;
  border-radius: 12px;
  padding: 1.5rem 1.25rem;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: #d4d0ca;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.card-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f4f0fb;
}

.card-icon svg {
  width: 20px;
  height: 20px;
  color: #6b5b95;
}

.card-number {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.9rem;
  color: #1a1a2e;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.card-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #9a9aae;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-sub {
  font-size: 0.7rem;
  color: #6b5b95;
  margin-top: 0.4rem;
  font-weight: 500;
}

.content {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.content h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  color: #1a1a2e;
  margin-bottom: 0.75rem;
  margin-top: 2.5rem;
}

.content h2:first-child {
  margin-top: 0;
}

.content p {
  color: #4a4a68;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.content ul {
  list-style: none;
  padding: 0;
}

.content ul li {
  padding: 0.45rem 0;
  color: #4a4a68;
  border-bottom: 1px solid #eae8e4;
  font-size: 0.9rem;
}

.content ul li:last-child {
  border-bottom: none;
}

.content ul li::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  background: #6b5b95;
  border-radius: 50%;
  margin-right: 0.7rem;
  vertical-align: middle;
}

.endpoint-card {
  background: #fff;
  border: 1px solid #eae8e4;
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0;
}

.endpoint-card code {
  font-size: 0.85rem;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: #6b5b95;
  background: #f4f2f0;
  padding: 0.2em 0.5em;
  border-radius: 4px;
}

.endpoint-card p {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: #7a7a8e;
}

.footer {
  text-align: center;
  padding: 2rem;
  font-size: 0.78rem;
  color: #a0a0b0;
  border-top: 1px solid #eae8e4;
}

.footer a {
  color: #6b5b95;
  text-decoration: none;
}

/* ==========================================================================
   5. Generic show page — JSON block
   ========================================================================== */

.json-block {
  background: #1a1a2e;
  border-radius: 10px;
  padding: 1.5rem;
  overflow-x: auto;
}

.json-block pre {
  margin: 0;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.82rem;
  line-height: 1.65;
  color: #e0dfe6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ==========================================================================
   6. Postcode page — two columns: collapsible JSON pane + guide
   ========================================================================== */

.two-col {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 2rem;
  align-items: start;
}

.json-pane {
  background: #1a1a2e;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  position: sticky;
  top: 1rem;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #e0dfe6;
}

.json-section {
  margin-bottom: 2px;
}

.json-toggle {
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  border-radius: 4px;
}

.json-toggle:hover {
  background: rgba(255, 255, 255, 0.04);
}

.json-chevron {
  width: 14px;
  flex-shrink: 0;
  text-align: center;
  color: #6b5b95;
  font-size: 0.7rem;
  transition: transform 0.15s;
}

.json-chevron.open {
  transform: rotate(90deg);
}

.json-key {
  color: #9b8ec4;
}

.json-preview {
  color: #6a6a7e;
  font-size: 0.75rem;
  margin-left: 4px;
}

.json-body {
  display: none;
  padding-left: 20px;
  border-left: 1px solid #2e2e48;
  margin-left: 6px;
  margin-top: 2px;
  margin-bottom: 4px;
}

.json-body.open {
  display: block;
}

.json-body pre {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  color: #c8c8d8;
  font-size: 0.78rem;
  line-height: 1.55;
}

.json-scalar {
  padding: 2px 0;
}

.json-scalar .json-key {
  color: #9b8ec4;
}

.json-scalar .json-val {
  color: #c8c8d8;
}

.json-scalar .json-val--str {
  color: #a8d8a8;
}

.json-scalar .json-val--num {
  color: #d4a843;
}

/* -- Guide pane -- */

.guide-section {
  margin-bottom: 0.5rem;
  border: 1px solid #eae8e4;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.guide-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}

.guide-section-toggle:hover {
  background: #faf8f5;
}

.guide-section-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 400;
  color: #1a1a2e;
}

.guide-section-chevron {
  font-size: 0.7rem;
  color: #9a9aae;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.guide-section-chevron.open {
  transform: rotate(180deg);
}

.guide-section-body {
  display: none;
  padding: 0 1rem 0.75rem;
}

.guide-section-body.open {
  display: block;
}

.guide-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0ede8;
  gap: 1rem;
}

.guide-row:last-child {
  border-bottom: none;
}

.guide-key {
  font-size: 0.78rem;
  font-weight: 600;
  color: #6a6a7e;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.guide-val {
  font-size: 0.88rem;
  color: #1a1a2e;
  text-align: right;
}

.guide-desc {
  font-size: 0.75rem;
  color: #9a9aae;
  margin-top: 0.15rem;
}

.guide-full {
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0ede8;
}

.guide-full:last-child {
  border-bottom: none;
}

/* -- Deprivation bars -- */

.imd-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f0ede8;
}

.imd-bar:last-child {
  border-bottom: none;
}

.imd-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #6a6a7e;
  width: 90px;
  flex-shrink: 0;
}

.imd-track {
  flex: 1;
  height: 8px;
  background: #eae8e4;
  border-radius: 4px;
  overflow: hidden;
}

.imd-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}

.imd-fill--high {
  background: #d94f4f;
}

.imd-fill--mid {
  background: #d4a843;
}

.imd-fill--low {
  background: #4a9e6f;
}

.imd-decile {
  font-size: 0.78rem;
  font-weight: 600;
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}

.imd-meaning {
  font-size: 0.72rem;
  color: #9a9aae;
  width: 110px;
  text-align: right;
  flex-shrink: 0;
}

.rep-card {
  background: #faf9f7;
  border: 1px solid #eae8e4;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.rep-name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #1a1a2e;
}

.rep-meta {
  font-size: 0.75rem;
  color: #7a7a8e;
  margin-top: 0.15rem;
}

.rep-meta a {
  color: #6b5b95;
  text-decoration: none;
}

.oac-tier {
  padding: 0.4rem 0;
  border-bottom: 1px solid #f0ede8;
}

.oac-tier:last-child {
  border-bottom: none;
}

.oac-tier-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #9a9aae;
}

.oac-tier-val {
  font-size: 0.88rem;
  color: #1a1a2e;
  margin-top: 0.1rem;
}

/* ==========================================================================
   7. Council page — stat cards, tabs, tables, pagination
   ========================================================================== */

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

body.site .stat-card {
  background: #fff;
  border: 1px solid #eae8e4;
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

body.site .stat-card:hover {
  border-color: #d4d0ca;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.stat-number {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.9rem;
  color: #1a1a2e;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #9a9aae;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e0ddd8;
  margin-bottom: 1.5rem;
}

.tab {
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  color: #6b5b95;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab:hover {
  background: #f0ede8;
}

.tab-active {
  color: #1a1a2e;
  border-bottom-color: #6b5b95;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 2px solid #e0ddd8;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b5b95;
}

.data-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #f0ede8;
}

.data-table tr:hover td {
  background: #f8f7f5;
}

.data-table a {
  color: #6b5b95;
  text-decoration: none;
}

.data-table a:hover {
  text-decoration: underline;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #9a9aae;
  font-size: 0.95rem;
}

.pagination {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.85rem;
}

.pg-link {
  color: #6b5b95;
  text-decoration: none;
  padding: 0.3em 0.6em;
  border-radius: 4px;
}

.pg-link:hover {
  background: #f0ede8;
}

.pg-current {
  padding: 0.3em 0.6em;
  background: #6b5b95;
  color: white;
  border-radius: 4px;
}

.total-count {
  font-size: 0.85rem;
  color: #9a9aae;
  margin-bottom: 1rem;
}

/* ==========================================================================
   8. Decision and meeting pages — AI extraction panel
   ========================================================================== */

.ai-box {
  background: #faf8ff;
  border: 1px solid #d8d0e8;
  border-radius: 12px;
  padding: 1.5rem;
}

.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.ai-meta {
  font-size: 0.75rem;
  color: #9a9aae;
}

.doc-list {
  list-style: none;
}

.doc-list li {
  padding: 0.3rem 0;
}

.doc-list a {
  color: #6b5b95;
  text-decoration: none;
  font-size: 0.85rem;
}

.doc-list a:hover {
  text-decoration: underline;
}

.stakeholder-tag {
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.15em 0.5em;
  border-radius: 4px;
  background: #f0ede8;
  color: #4a4a5e;
  margin: 0.15rem 0.1rem;
}

.agenda-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.agenda-table th {
  text-align: left;
  padding: 0.5rem;
  border-bottom: 2px solid #e0ddd8;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b5b95;
}

.agenda-table td {
  padding: 0.5rem;
  border-bottom: 1px solid #f0ede8;
  vertical-align: top;
}

.attendee-group {
  margin-bottom: 0.75rem;
}

.attendee-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #6b5b95;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2rem;
}

.attendee-list {
  font-size: 0.85rem;
}

/* ==========================================================================
   9. Surface: admin
   ========================================================================== */

body.admin {
  font-family: 'Inter', -apple-system, sans-serif;
  color: #1a1a2e;
  line-height: 1.6;
  margin: 0;
  background: #faf9f7;
  -webkit-font-smoothing: antialiased;
}

body.admin h1,
body.admin h2,
body.admin h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 400;
}

body.admin h1 {
  margin: 0;
}

body.admin h2 {
  border-bottom: 1px solid #e0ddd8;
  padding-bottom: 0.3em;
  color: #1a1a2e;
}

body.admin code {
  background: #f0ede8;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: #6b5b95;
}

body.admin table {
  border-collapse: collapse;
  width: 100%;
}

body.admin th,
body.admin td {
  border: 1px solid #e0ddd8;
  padding: 8px 12px;
  text-align: left;
  font-size: 0.9em;
}

body.admin th {
  background: #f4f2ef;
  font-weight: 600;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6a6a7e;
}

body.admin tr:hover {
  background: #faf8f5;
}

body.admin details {
  background: #f4f2ef;
  padding: 0.5rem;
  border-radius: 6px;
}

.expand-icon {
  font-weight: bold;
  color: #0969da;
  font-size: 1.1em;
}

/* Admin used to build these with `btn_style/1`, `icon_stat_card/4`,
   `coverage_badge/1`, `progress_bar/2` and `flash_html/1` — helpers that
   emitted the same inline style string on every call. */

.admin-layout {
  max-width: 1300px;
  margin: 0 auto;
  padding: 2rem 1rem;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 2rem;
  align-items: start;
}

.admin-main {
  min-width: 0;
}

.admin-aside {
  position: sticky;
  top: 1rem;
}

.admin-narrow {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.admin-login {
  max-width: 400px;
  margin: 100px auto;
}

.admin-field {
  margin: 1rem 0;
}

.admin-input {
  width: 100%;
  padding: 8px;
  box-sizing: border-box;
}

/* -- Buttons -- */

.admin-btn {
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  padding: 8px 16px;
  border: none;
}

.admin-btn--primary {
  background: #6b5b95;
  color: white;
}

.admin-btn--secondary {
  background: #f4f2ef;
  color: #1a1a2e;
  border: 1px solid #e0ddd8;
}

.admin-btn--danger {
  background: #c0392b;
  color: white;
  font-size: 0.85em;
}

.admin-btn--small {
  font-size: 0.85em;
  padding: 6px 12px;
}

/* Sidebar rows: text buttons that only reveal a border on hover. */
.admin-btn--row {
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-size: 0.95em;
  color: #1a1a2e;
  transition: all 0.1s;
  font-family: 'Inter', sans-serif;
}

.admin-btn--row:hover {
  background: #f4f2ef;
  border-color: #e0ddd8;
}

.admin-btn--clear {
  background: none;
  border: 1px solid #e0ddd8;
  border-radius: 6px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 0.8em;
  color: #7a7a8e;
  width: auto;
  font-family: 'Inter', sans-serif;
}

.admin-btn--clear:hover {
  border-color: #cf222e;
  color: #cf222e;
}

/* -- Stat cards -- */

.admin-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 1rem 0;
}

.admin-card {
  background: white;
  border: 1px solid #e0ddd8;
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.admin-card-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.admin-card-icon > div {
  width: 42px;
  height: 42px;
  background: #f4f0fb;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-card-icon svg {
  width: 22px;
  height: 22px;
  color: #6b5b95;
}

.admin-card-number {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.9rem;
  font-weight: 400;
  color: #1a1a2e;
  line-height: 1;
}

.admin-card-label {
  color: #9a9aae;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.35rem;
}

.admin-card-sub {
  color: #6b5b95;
  font-size: 0.7rem;
  font-weight: 500;
  margin-top: 0.3rem;
}

/* -- Coverage pills -- */

.coverage-pill {
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85em;
}

.coverage-pill--good {
  background: #dafbe1;
  color: #1a7f37;
}

.coverage-pill--warn {
  background: #fff8c5;
  color: #7a6d00;
}

.coverage-pill--bad {
  background: #ffebe9;
  color: #cf222e;
}

/* -- Sync status text -- */

.sync-status--success {
  color: #1a7f37;
}

.sync-status--partial {
  color: #bf8700;
}

.sync-status--failed {
  color: #cf222e;
}

.sync-status--running {
  color: #6b5b95;
}

/* -- Flash -- */

.admin-flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-flash-icon {
  font-size: 1.2em;
}

.admin-flash--info {
  background: #dafbe1;
  border: 1px solid #a7f3d0;
  color: #1a7f37;
}

.admin-flash--error {
  background: #ffebe9;
  border: 1px solid #ffc1c0;
  color: #cf222e;
}

/* -- Active syncs -- */

.admin-section-accent {
  color: #6b5b95;
  border-bottom-color: #6b5b95;
}

.sync-card {
  background: white;
  border: 1px solid #e0ddd8;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
}

.sync-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.sync-card-loader {
  font-size: 0.95em;
  font-weight: 600;
}

.sync-card-state {
  color: #6b5b95;
  font-size: 0.85em;
  margin-left: 0.5rem;
}

.sync-card-elapsed {
  font-size: 0.8em;
  color: #7a7a8e;
}

.progress {
  background: #e8e5e0;
  border-radius: 6px;
  height: 22px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  background: linear-gradient(90deg, #6b5b95, #9b8ec4);
  height: 100%;
  border-radius: 6px;
  transition: width 0.5s ease;
}

.progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75em;
  font-weight: 600;
  color: #1a1a2e;
}

/* -- Warnings -- */

.admin-warnings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #d0d7de;
  padding-bottom: 0.3em;
  margin-bottom: 0.75rem;
}

.admin-warnings-head h2 {
  margin: 0;
  border: none;
  padding: 0;
}

.admin-warnings-note {
  font-weight: normal;
  font-size: 0.8em;
  color: #7a7a8e;
}

.warning {
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  font-size: 0.9em;
  border-left: 3px solid;
}

.warning--failed {
  background: #fff0f0;
  border-left-color: #cf222e;
}

.warning--partial {
  background: #fff8e1;
  border-left-color: #bf8700;
}

/* -- Sidebar -- */

.sidebar {
  background: white;
  border: 1px solid #e0ddd8;
  border-radius: 10px;
  padding: 1rem;
  font-size: 0.85em;
}

.sidebar-section {
  margin-bottom: 0.75rem;
}

.sidebar-section-title {
  font-weight: 600;
  font-size: 0.8em;
  text-transform: uppercase;
  color: #7a7a8e;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}

.sidebar-buttons {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-block {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e0ddd8;
}

.sidebar-scrapers {
  margin-top: -0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e0ddd8;
}

.sidebar-summary {
  cursor: pointer;
  color: #6b5b95;
  font-size: 0.9em;
}

.sidebar-select,
.sidebar-text {
  width: 100%;
  padding: 6px;
  border: 1px solid #e0ddd8;
  border-radius: 6px;
  margin-bottom: 0.4rem;
  font-size: 0.9em;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

.sidebar-form {
  margin: 0;
}

.sidebar-form--spaced {
  margin-top: 0.5rem;
}

/* -- Logs table -- */

.log-children-cell {
  padding: 0;
  background: #f4f2ef;
}

.log-children-content {
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  font-size: 0.85em;
}

.log-expand {
  text-align: center;
  width: 30px;
}

.log-no-children {
  color: #d0d7de;
}

.log-child-table {
  width: 100%;
  border-collapse: collapse;
}

/* ==========================================================================
   10. Surface: docs (/data)
   ========================================================================== */

body.docs {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
  color: #1a1a1a;
  line-height: 1.6;
}

body.docs h1 {
  border-bottom: 2px solid #e1e4e8;
  padding-bottom: 0.3em;
}

body.docs h2 {
  border-bottom: 1px solid #e1e4e8;
  padding-bottom: 0.3em;
  margin-top: 2rem;
}

body.docs h3 {
  margin-top: 1.5rem;
}

body.docs table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

body.docs th,
body.docs td {
  border: 1px solid #d0d7de;
  padding: 6px 13px;
  text-align: left;
}

body.docs th {
  background: #f6f8fa;
  font-weight: 600;
}

body.docs tr:nth-child(even) {
  background: #f6f8fa;
}

body.docs code {
  background: #f6f8fa;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}

body.docs pre {
  background: #f6f8fa;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

body.docs pre code {
  background: none;
  padding: 0;
}

body.docs .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

body.docs .stat-card {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  padding: 1rem;
}

body.docs .stat-card .number {
  font-size: 1.8rem;
  font-weight: 700;
  color: #0969da;
}

body.docs .stat-card .label {
  color: #57606a;
  font-size: 0.85rem;
}

body.docs .stat-card .sublabel {
  color: #8b949e;
  font-size: 0.75rem;
}

body.docs .db-unavailable {
  color: #8b949e;
  font-style: italic;
  padding: 1rem;
  background: #f6f8fa;
  border-radius: 6px;
}

/* ==========================================================================
   11. Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }

  .json-pane {
    position: static;
  }
}

@media (max-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   12. Auth — signup, login, and the signed-in dashboard
   ========================================================================== */

.auth {
  max-width: 420px;
  margin: 4rem auto;
  padding: 0 1.5rem 4rem;
}

.auth-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.9rem;
  font-weight: 400;
  color: #1a1a2e;
  margin-bottom: 0.35rem;
}

.auth-sub {
  font-size: 0.9rem;
  color: #7a7a8e;
  margin-bottom: 1.75rem;
}

.auth-card {
  background: #fff;
  border: 1px solid #eae8e4;
  border-radius: 12px;
  padding: 1.75rem;
}

.auth-field {
  margin-bottom: 1.1rem;
}

.auth-field:last-of-type {
  margin-bottom: 1.5rem;
}

.auth-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6a6a7e;
  margin-bottom: 0.35rem;
}

.auth-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e0ddd8;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: 'Inter', -apple-system, sans-serif;
  color: #1a1a2e;
  background: #fff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-input:focus {
  border-color: #6b5b95;
  box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.12);
}

.auth-input--error {
  border-color: #c81e1e;
}

.auth-hint {
  font-size: 0.75rem;
  color: #9a9aae;
  margin-top: 0.3rem;
}

.auth-error {
  font-size: 0.75rem;
  color: #c81e1e;
  margin-top: 0.3rem;
}

.auth-submit {
  width: 100%;
  background: #6b5b95;
  color: #fff;
  border: none;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: 'Inter', -apple-system, sans-serif;
  cursor: pointer;
  transition: background 0.15s;
}

.auth-submit:hover {
  background: #5a4a84;
}

.auth-alt {
  text-align: center;
  font-size: 0.85rem;
  color: #7a7a8e;
  margin-top: 1.25rem;
}

.auth-alt a {
  color: #6b5b95;
  text-decoration: none;
  font-weight: 500;
}

.auth-alt a:hover {
  text-decoration: underline;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #6a6a7e;
  margin-bottom: 1.5rem;
}

/* -- Home page call to action -- */

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2rem;
  background: #6b5b95;
  color: #fff;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.15s, transform 0.15s;
}

.hero-cta:hover {
  background: #5a4a84;
  transform: translateY(-1px);
}

.hero-cta-note {
  margin-top: 0.75rem;
  font-size: 0.78rem;
  color: #9a9aae;
}

/* -- Signed-in dashboard -- */

.account {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 2rem 5rem;
}

.account-rows {
  background: #fff;
  border: 1px solid #eae8e4;
  border-radius: 12px;
  overflow: hidden;
}

.account-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid #f0ede8;
}

.account-row:last-child {
  border-bottom: none;
}

.account-key {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6a6a7e;
}

.account-val {
  font-size: 0.9rem;
  color: #1a1a2e;
  text-align: right;
}

.plan-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2em 0.6em;
  border-radius: 999px;
  background: #ede9fe;
  color: #6b5b95;
}
