/* ================================================
   Vinculum
   Typefaces: Cormorant Garamond · Spectral · DM Mono
   Palette: Deep Warm Black + Dusty Rose
   ================================================ */

:root {
  /* Backgrounds */
  --bg-void:    #0b0809;
  --bg-base:    #110d0f;
  --bg-surface: #1c1518;
  --bg-raised:  #231b1f;
  --bg-hover:   #2c2025;

  /* Layout — sticky offsets */
  --header-h: 5rem;

  /* Accent — Dusty Rose */
  --accent:        #a86172;
  --accent-light:  #c27888;
  --accent-dark:   #8a4d5e;
  --accent-muted:  rgba(168, 97, 114, 0.10);
  --accent-border: rgba(168, 97, 114, 0.28);
  --accent-glow:   rgba(168, 97, 114, 0.18);

  /* Text */
  --text-primary:   #ede4dc;
  --text-secondary: #8a7c78;
  --text-tertiary:  #4e4240;
  --text-accent:    var(--accent-light);

  /* Borders */
  --border-subtle:  #1f161a;
  --border-default: #2d2228;
  --border-strong:  #3e2f35;

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body:    'Spectral', Georgia, serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;

  /* Layout */
  --max-width:     1040px;
  --sidebar-width: 250px;

  /* Motion */
  --t-fast: 0.16s ease;
  --t-med:  0.32s ease;

  /* Shape */
  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 10px;
}

/* ================================================
   Reset & Base
   ================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
  background-color: var(--bg-void);
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  padding: 0 1.5rem 3rem;
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: page-reveal 0.5s ease forwards;
}

@keyframes page-reveal {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text-primary);
}

a {
  color: var(--accent-light);
  text-decoration: none;
  transition: color var(--t-fast);
}

a:hover { color: var(--text-primary); }

.container {
  width: 100%;
  max-width: calc(var(--max-width) + 4rem);
  margin: 0 auto;
}

/* ================================================
   Site Header
   ================================================ */

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1.75rem 0 1.25rem;
  margin-bottom: 0;
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-base);
}


.site-header .site-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.15rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--accent-light);
  text-decoration: none;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-header nav a {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--t-fast);
}

.site-header nav a:hover { color: var(--text-primary); }
.site-header nav a:last-child { color: var(--text-tertiary); }

/* ================================================
   Top Nav (secondary section navigation)
   ================================================ */

.top-nav {
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2.5rem;
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: var(--bg-base);
}

.top-nav-inner {
  display: flex;
  gap: 0;
}

/* Desktop tab strip wrapper */
.top-nav-tabs {
  display: flex;
  gap: 0;
  width: 100%;
}

/* Mobile bar: hamburger + active label — hidden on desktop */
.top-nav-mobile-bar {
  display: none;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 0;
  width: 100%;
}

.top-nav-mobile-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.top-nav-item {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  text-decoration: none;
  padding: 0.75rem 1.25rem;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--t-fast), border-color var(--t-fast);
}

.top-nav-item:hover {
  color: var(--text-secondary);
}

.top-nav-active {
  color: var(--text-secondary);
  border-bottom-color: var(--accent);
}

/* ================================================
   Home — tile grid
   ================================================ */

.home-greeting {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text-primary);
  margin-top: 2.5rem;
  margin-bottom: 1.75rem;
  letter-spacing: 0.01em;
}

.home-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.home-tile {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 180px;
  padding: 1.75rem 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: background var(--t-fast), border-color var(--t-fast);
}

.home-tile:hover {
  background: var(--bg-raised);
  border-color: var(--accent-border);
}

.home-tile-category {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.5rem;
}

.home-tile-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.15;
  transition: color var(--t-fast);
}

.home-tile:hover .home-tile-title {
  color: var(--accent-light);
}

/* ================================================
   Panel (replaces glassmorphism card)
   ================================================ */

.glass-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  position: relative;
}

/* HTMX transitions */
.htmx-swapping .glass-card { opacity: 0; transform: translateY(-5px); }
.htmx-settling .glass-card { opacity: 1; transform: translateY(0); }
.glass-card { transition: opacity 0.22s ease, transform 0.22s ease; }

/* ================================================
   Buttons
   ================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.6rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--t-fast);
  text-decoration: none;
  border: 1px solid transparent;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--bg-void);
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  color: var(--bg-void);
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.btn-secondary:hover {
  border-color: var(--accent-border);
  color: var(--text-primary);
}

/* ================================================
   Form Options (radio & checkbox)
   ================================================ */

.radio-pill {
  display: flex;
  position: relative;
  width: 100%;
}

.radio-pill input[type="radio"],
.radio-pill input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-pill span {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1.125rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 300;
  cursor: pointer;
  transition: all var(--t-fast);
  background: transparent;
}

/* Selection indicator circle */
.radio-pill span::before {
  content: '';
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  transition: all var(--t-fast);
}

.radio-pill:hover span {
  border-color: var(--accent-border);
  color: var(--text-primary);
  background: var(--accent-muted);
}

.radio-pill:hover span::before { border-color: var(--accent); }

.radio-pill input:checked + span {
  background: var(--accent-muted);
  border-color: var(--accent-border);
  color: var(--text-primary);
}

.radio-pill input:checked + span::before {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.radio-pill input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Checkbox: square indicator */
.radio-pill.checkbox-option span::before { border-radius: var(--radius-sm); }

/* Disabled state (preview mode) */
.radio-pill input:disabled + span,
.radio-pill input[disabled] + span {
  opacity: 0.42;
  cursor: not-allowed;
  pointer-events: none;
}

/* ================================================
   Text Inputs
   ================================================ */

input[type="text"],
textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.825rem 1rem;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 300;
  transition: all var(--t-fast);
  resize: vertical;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-hover);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

input[type="text"]::placeholder,
textarea::placeholder {
  color: var(--text-tertiary);
  font-style: italic;
}

input[type="text"]:disabled,
textarea:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ================================================
   Login Page
   ================================================ */

.login-layout {
  min-height: calc(100vh - 6rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  text-align: center;
  max-width: 360px;
  width: 100%;
}

.login-card h1 {
  font-family: var(--font-display);
  font-size: 3.25rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text-primary);
  letter-spacing: 0.015em;
  margin-bottom: 0.5rem;
}

.login-meaning {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-style: normal;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  margin-bottom: 1.75rem;
}

.login-card .subtitle {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 2.5rem;
}

.login-card .btn-primary { width: 100%; }

/* ================================================
   Form Sections
   ================================================ */

.section-header {
  margin-bottom: 2.25rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.875rem;
}

.section-badge {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
}

.section-updated {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
}

.section-header h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 300;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 300;
  font-style: italic;
}

/* Questions */
.question { margin-bottom: 2rem; }

.question-text {
  display: block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  letter-spacing: 0.01em;
}

.question-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 300;
  font-style: italic;
  margin-bottom: 0.875rem;
}

.subsection-group { margin: 2.25rem 0; }

.subsection-header {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.375rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

/* Form Navigation */
.form-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

/* Save Indicator */
.save-indicator {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-surface);
  border: 1px solid var(--accent-border);
  color: var(--accent-light);
  padding: 0.55rem 1.125rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.28s ease;
  z-index: 1000;
}

.save-indicator.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ================================================
   Sidebar Layout
   ================================================ */

.sidebar-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 8.5rem;
  max-height: calc(100vh - 10.5rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-default) transparent;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 2px; }

.sidebar-details {
  border: none;
  background: none;
}

.sidebar-details > summary {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.875rem;
}

.sidebar-details > summary::-webkit-details-marker { display: none; }

.sidebar-details > summary::after {
  content: '\2212'; /* − */
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-tertiary);
  line-height: 1;
}

.sidebar-details:not([open]) > summary::after { content: '+'; }

.sidebar-category {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
  padding-left: 0.5rem;
}

.sidebar nav ul { list-style: none; padding: 0; margin: 0; }
.sidebar nav li { margin: 0; }

.sidebar nav a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.5rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: all var(--t-fast);
  line-height: 1.4;
}

.sidebar nav a:hover {
  color: var(--text-primary);
  background: var(--bg-raised);
  border-left-color: var(--border-strong);
}

.sidebar nav a[aria-current="page"] {
  color: var(--accent-light);
  background: var(--accent-muted);
  border-left-color: var(--accent);
  font-weight: 400;
}

.section-started {
  font-size: 0.5rem;
  color: var(--accent);
  flex-shrink: 0;
  line-height: 1;
}

/* Document TOC subnavigation */
.sidebar-details + .sidebar-toc {
  margin-top: 1.5rem;
}

/* Base item styles — .sidebar-toc nav a matches the specificity of .sidebar nav a (0,1,2)
   and wins by source order, overriding font/colour/padding for all TOC links */
.sidebar-toc nav a {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-tertiary);
  line-height: 1.35;
}

/* h2 — top-level sections: heavier, brighter, gap above to separate groups.
   .sidebar-toc .toc-level-2 is (0,2,0) which beats .sidebar nav li (0,1,2) for margin */
.sidebar-toc .toc-level-2 {
  margin-top: 0.5rem;
}

.sidebar-toc .toc-level-2 a {
  padding-left: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-secondary);
}

/* h3 — subsections: indented, recedes behind h2 */
.sidebar-toc .toc-level-3 a {
  padding-left: 1.1rem;
}

/* h4 — deep nesting: further indented, smallest */
.sidebar-toc .toc-level-4 a {
  padding-left: 1.75rem;
  font-size: 0.75rem;
}

/* ================================================
   Mobile Sidebar Drawer
   ================================================ */

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 2.25rem;
  height: 2.25rem;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0.5rem;
  transition: border-color var(--t-fast);
  flex-shrink: 0;
}

.mobile-menu-toggle:hover { border-color: var(--accent-border); }
.mobile-menu-toggle:hover .hamburger-bar { background: var(--text-primary); }

.hamburger-bar {
  display: block;
  width: 1rem;
  height: 1px;
  background: var(--text-secondary);
  transition: background var(--t-fast);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 200;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.mobile-sidebar-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  margin-bottom: 0.875rem;
  border-bottom: 1px solid var(--border-subtle);
}

.mobile-sidebar-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.sidebar-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-tertiary);
  transition: all var(--t-fast);
}

.sidebar-close-btn:hover {
  border-color: var(--accent-border);
  color: var(--accent-light);
}

/* Drawer section nav — top-level section links shown in mobile drawer */
.drawer-section-nav {
  display: none; /* shown on mobile via media query */
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-section-nav nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.drawer-section-link {
  display: block;
  padding: 0.45rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}

.drawer-section-link:hover {
  color: var(--text-secondary);
  background: var(--bg-raised);
  border-left-color: var(--border-strong);
}

.drawer-section-active {
  color: var(--text-secondary);
  border-left-color: var(--accent);
  background: var(--accent-muted);
}

/* Mobile */
@media (max-width: 767px) {
  :root {
    --header-h: 4rem;
  }

  body {
    padding: 0 0 3rem;
  }

  .container {
    padding: 0 1rem;
  }

  /* Header stays baseline-aligned — no hamburger there anymore */
  .site-header {
    align-items: center;
    padding: 0.875rem 0;
  }

  /* Desktop tab strip hidden on mobile */
  .top-nav-tabs {
    display: none;
  }

  /* Mobile nav bar: hamburger + active label */
  .top-nav-mobile-bar {
    display: flex;
  }

  /* Hamburger button visible inside top-nav mobile bar */
  .mobile-menu-toggle {
    display: flex;
  }

  /* Mobile sidebar header visible */
  .mobile-sidebar-header {
    display: flex;
  }

  /* Drawer section nav visible on mobile */
  .drawer-section-nav {
    display: block;
  }

  /* Sidebar becomes a fixed off-canvas drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: min(85vw, 300px);
    z-index: 300;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-default);
    padding: 1.25rem;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    max-height: none;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
    box-shadow: 8px 0 40px rgba(0, 0, 0, 0.7);
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  /* Sidebar layout: content takes full width */
  .sidebar-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* In the drawer, hide the details summary — content is always visible */
  .sidebar-details > summary {
    display: none;
  }

  /* Reset details card styles — drawer handles the container */
  .sidebar-details {
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
  }

  .glass-card {
    padding: 1.25rem;
  }

  .prose table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .top-nav-inner {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .top-nav-inner::-webkit-scrollbar {
    display: none;
  }

  .top-nav-item {
    padding: 0.625rem 0.875rem;
    font-size: 0.6rem;
    white-space: nowrap;
  }

  .home-tiles {
    grid-template-columns: 1fr;
  }

  .home-tile {
    min-height: 130px;
  }
}

/* ================================================
   Preview Banner
   ================================================ */

.preview-banner {
  position: sticky;
  top: calc(var(--header-h) + 2.75rem);
  z-index: 80;
  background: var(--bg-void);
  border-bottom: 1px solid var(--accent-border);
  padding: 0.575rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.preview-banner::before {
  content: '\25c8'; /* ◈ */
  font-size: 0.75rem;
  opacity: 0.75;
}

/* (Home page styles moved to Top Nav / Home tile grid sections above) */

.updated-at {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
}

/* ================================================
   Prose (rendered Markdown)
   ================================================ */

.prose {
  max-width: 72ch;
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.85;
  color: var(--text-primary);
}

.prose h1 {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 300;
  font-style: italic;
  letter-spacing: 0.01em;
  margin-bottom: 0.375rem;
  margin-top: 0;
}

.prose h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 400;
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 400;
  font-style: italic;
  color: var(--accent-light);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.prose h4 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.prose p { margin-bottom: 1.25rem; }

.prose a {
  color: var(--accent-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-border);
  transition: all var(--t-fast);
}

.prose a:hover {
  color: var(--text-primary);
  text-decoration-color: var(--text-secondary);
}

.prose ul, .prose ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.prose li { margin-bottom: 0.4rem; }

.prose blockquote {
  margin: 1.75rem 0;
  padding: 1rem 1.5rem;
  border-left: 2px solid var(--accent);
  background: var(--accent-muted);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.prose blockquote p:last-child { margin-bottom: 0; }

.prose code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  color: var(--accent-light);
}

.prose pre {
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.75rem 0;
  font-size: 0.95rem;
}

.prose th {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.625rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--accent-border);
  font-weight: 400;
}

.prose td {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: top;
  font-weight: 300;
}

.prose tbody tr:hover td { background: var(--bg-raised); }

.prose hr {
  border: none;
  height: 1px;
  background: var(--border-default);
  margin: 2.25rem 0;
}

.prose img {
  max-width: 100%;
  border-radius: var(--radius-md);
}

/* GFM task list */
.prose input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
  margin-right: 0.4rem;
  cursor: default;
  vertical-align: middle;
}

.prose li.task-list-item {
  list-style: none;
  margin-left: -1.5rem;
  padding-left: 1.5rem;
}

.doc-updated {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 2.5rem;
  margin-top: 0.25rem;
}

.doc-raw-link {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.doc-raw-link a {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  letter-spacing: 0.07em;
  color: var(--text-tertiary);
  text-decoration: none;
}

.doc-raw-link a:hover { color: var(--text-secondary); }

/* ================================================
   Admin Dashboard
   ================================================ */

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.admin-header h1 {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 300;
  font-style: italic;
}

.export-links,
.admin-actions {
  display: flex;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 0.875rem;
  margin-bottom: 2.25rem;
}

.admin-stat {
  padding: 1.25rem 1.5rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  transition: border-color var(--t-fast);
}

.admin-stat:hover { border-color: var(--accent-border); }

.admin-stat-value {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 300;
  font-style: italic;
  color: var(--accent-light);
  margin-bottom: 0.2rem;
}

.admin-stat-label {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.admin-table-container { overflow-x: auto; }


.admin-nicknames {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-nickname-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-nickname-email {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  min-width: 14rem;
}

.admin-nickname-input {
  flex: 1;
  min-width: 10rem;
  max-width: 20rem;
  background: var(--bg-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.75rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-style: italic;
  color: var(--text-primary);
  transition: border-color var(--t-fast);
}

.admin-nickname-input:focus {
  outline: none;
  border-color: var(--accent-border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border-default);
  font-weight: 400;
}

.admin-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 300;
}

.admin-table tbody tr { transition: background var(--t-fast); }
.admin-table tbody tr:hover { background: var(--bg-raised); }
.admin-table a { color: var(--text-primary); text-decoration: none; }
.admin-table a:hover { color: var(--accent-light); }

/* ================================================
   Error
   ================================================ */

.error {
  background: rgba(168, 75, 75, 0.10);
  color: #c47878;
  border: 1px solid rgba(168, 75, 75, 0.28);
  padding: 0.825rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  font-weight: 300;
}

/* ================================================
   Response Detail
   ================================================ */

.response-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 0.875rem;
  margin-bottom: 2.25rem;
}

.response-section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
  margin-bottom: 1.5rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-subtle);
}

.response-question { margin-bottom: 1.5rem; }

.response-answer {
  display: inline-block;
  padding: 0.3rem 0.9rem;
  background: var(--accent-muted);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  color: var(--accent-light);
  margin-top: 0.35rem;
  font-size: 0.93rem;
  font-weight: 300;
}

.response-answer-empty {
  color: var(--text-tertiary);
  font-style: italic;
  background: transparent;
  border-color: transparent;
}

/* ================================================
   Print
   ================================================ */

@media print {
  body { background: white !important; color: #1a1a1a !important; }
  .glass-card { background: none !important; border: 1px solid #ccc !important; }
  h1, h2, h3, h4, h5, h6 { color: #1a1a1a !important; }
  .site-header, .form-nav, .save-indicator { display: none !important; }
  .sidebar { display: none !important; }
  .sidebar-layout { grid-template-columns: 1fr !important; }
  .admin-stat { border: 1px solid #ccc !important; background: none !important; }
  .btn { display: none !important; }
}
