.page.has-sticky-footer .footnote-wrapper {
  position: sticky;
  bottom: 24px;
  margin-top: auto;
  z-index: 4;
}
.section-block {
  display: none;
  margin-bottom: 28px;
}

.section-block.active {
  display: block;
}
.section-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(8, 11, 19, 0.95), rgba(8, 11, 19, 0.85));
  backdrop-filter: blur(6px);
  margin: -16px 0 24px;
  padding: 12px 0;
}

.section-nav-inner {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.section-nav button {
  border: 1px solid var(--border);
  background: var(--panel-dark);
  color: var(--copy);
  border-radius: 12px;
  padding: 8px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.section-nav button.active {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}

.section-date {
  display: none;
  color: var(--muted);
}

.section-date.visible {
  display: inline;
}
:root {
  --bg: #080b13;
  --panel: #101829;
  --panel-dark: #0c1321;
  --copy: #f7f7ff;
  --muted: #a5b4d4;
  --accent: #ff7a18;
  --accent-soft: rgba(255, 122, 24, 0.18);
  --border: rgba(255, 255, 255, 0.08);
  --success: #54e5b5;
  --danger: #ff5f56;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--copy);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

a {
  color: inherit;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 32px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.brand h1 {
  font-size: 28px;
  margin: 0;
  color: var(--accent);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 12px;
  padding: 6px 14px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  border: 1px solid var(--border);
}

.pill::before {
  display: none;
}

.meta {
  font-size: 14px;
  color: var(--muted);
}

.meta-spaced {
  margin-bottom: 6px;
}

.date-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 220px;
}

.date-form label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.date-form select {
  background: var(--panel);
  color: var(--copy);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.insight-card {
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 120px;
  position: relative;
  overflow: hidden;
}

.insight-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 122, 24, 0.22), transparent 55%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.insight-card:hover::after {
  opacity: 1;
}

.insight-card .label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.insight-card h3 {
  margin: 0;
  font-size: 28px;
}

.insight-card span {
  font-size: 13px;
  color: var(--muted);
}

.insight-card.caution {
  border-color: rgba(255, 95, 86, 0.35);
  background: linear-gradient(135deg, rgba(255, 95, 86, 0.08), transparent);
}

.insight-card.next-card {
  grid-column: span 2;
}

.split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.timeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.timeline-column {
  background: var(--panel-dark);
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.timeline-header span {
  background: var(--panel);
  border-radius: 999px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  font-size: 12px;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.timeline-item {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.timeline-item.done {
  border-color: rgba(84, 229, 181, 0.4);
  background: linear-gradient(135deg, rgba(84, 229, 181, 0.15), transparent);
}

.timeline-time {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.timeline-item strong {
  font-size: 15px;
}

.timeline-item small {
  font-size: 12px;
  color: var(--muted);
}

.activity-card .activity-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.activity-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.activity-row:last-child {
  border-bottom: none;
}

.activity-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.card {
  background: var(--panel);
  border-radius: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card h2 {
  margin: 0;
  font-size: 18px;
}

.count {
  font-size: 42px;
  font-weight: 600;
  color: var(--accent);
}

.list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.entry {
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--panel-dark);
  border: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.entry-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.entry-time {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
}

.entry-action {
  font-size: 16px;
  font-weight: 500;
}

.entry-note {
  font-size: 13px;
  color: var(--muted);
}

.entry-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

button {
  font: inherit;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, #ff7a18, #ffb347);
  color: #111;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(255, 122, 24, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--copy);
  border: 1px solid var(--border);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.table-card {
  margin-top: 32px;
}

.table-wrapper {
  overflow: auto;
}

.log-chips {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.log-chips button {
  border: 1px solid var(--border);
  background: var(--panel-dark);
  color: var(--copy);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.log-chips button.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  color: var(--copy);
  font-size: 14px;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: none;
}

.empty {
  color: var(--muted);
}

.editor-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--panel);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.editor-panel.open {
  transform: translateX(0);
}

.editor-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.editor-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.field input,
.field textarea {
  background: var(--panel-dark);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--copy);
  font-size: 14px;
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.editor-footer {
  margin-top: auto;
  padding: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.panel-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: 12px;
  color: var(--copy);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  border-color: var(--danger);
  color: var(--danger);
}

.footnote-wrapper {
  position: static;
  margin-top: 40px;
}

.footnote {
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  backdrop-filter: blur(6px);
}
.footnote a {
  color: var(--accent);
  text-decoration: none;
}

.footnote a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .page {
    padding: 20px 16px 60px;
  }

  .top-bar {
    flex-direction: column;
    gap: 18px;
  }

  .brand h1 {
    font-size: 22px;
  }

  .grid,
  .split-grid,
  .timeline-grid,
  .insights-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card {
    padding: 16px;
  }

  .card-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .count {
    font-size: 32px;
  }

  .entry {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .entry-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .entry-actions .btn {
    flex: 1;
    min-width: calc(50% - 4px);
  }

  .table-card {
    margin-top: 16px;
  }

  table {
    font-size: 12px;
  }

  th,
  td {
    padding: 10px 8px;
  }

  .editor-panel {
    width: 100%;
  }

  .editor-header,
  .editor-body,
  .editor-footer {
    padding: 16px;
  }

  .field textarea {
    min-height: 70px;
  }
}

