/* ========================================
   ANACITY Asset Owner Portal
   Design System — Warm Newsletter Serif
   ======================================== */

/* --- Tokens --- */
:root {
  --paper:       #F6F1E7;
  --paper-2:     #EFE7D6;
  --paper-3:     #E7DCC5;
  --ink:         #1B1A17;
  --ink-2:       #3A362F;
  --ink-3:       #6B6455;
  --ink-4:       #9A927F;
  --rule:        #D9CFB8;
  --rule-2:      #C8BC9E;
  --accent:      #B4472B;
  --accent-soft: #E9C7B6;
  --accent-ink:  #7A2F1B;
  --good:        #5A6E3A;
  --good-bg:     rgba(90,110,58,.1);
  --warn:        #B4472B;
  --warn-bg:     rgba(180,71,43,.1);
  --amber:       #C4860B;
  --amber-bg:    rgba(196,134,11,.1);
  --card:        #FBF7ED;
  --card-2:      #F1E9D4;
  --shadow:      0 1px 0 rgba(27,26,23,.04), 0 8px 24px -18px rgba(27,26,23,.25);
  --serif:       'Fraunces', 'Times New Roman', serif;
  --sans:        'Inter', system-ui, sans-serif;
  --mono:        'JetBrains Mono', ui-monospace, monospace;
  --ease:        cubic-bezier(.4,0,.2,1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #EAE1CC; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--sans); cursor: pointer; }
input, textarea, select { font-family: var(--sans); }

/* --- Shell --- */
#app {
  width: 1440px;
  margin: 0 auto;
  background: var(--paper);
  min-height: 100vh;
  position: relative;
}

/* --- Top Navigation --- */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}
.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 64px;
}
.top-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600; font-size: 18px;
  letter-spacing: .5px; font-style: italic;
}
.brand-name {
  font-family: var(--serif); font-weight: 600; font-size: 18px; letter-spacing: .2px;
}
.brand-sub {
  font-family: var(--serif); font-style: italic; font-size: 11px;
  color: var(--ink-3); letter-spacing: .3px;
}
.top-nav-links {
  display: flex; gap: 4px; align-items: center;
}
.top-nav-link {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 8px;
  font-size: 14px; color: var(--ink-2);
  position: relative;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.top-nav-link:hover {
  background: rgba(180,71,43,.06); color: var(--ink);
}
.top-nav-link.active {
  color: var(--accent);
}
.top-nav-link.active::after {
  content: '';
  position: absolute; bottom: -1px; left: 16px; right: 16px;
  height: 2px; background: var(--accent); border-radius: 2px;
  animation: fadeSlideUp .25s var(--ease);
}
.top-nav-link .ico { color: var(--ink-3); transition: color .25s var(--ease); }
.top-nav-link.active .ico { color: var(--accent); }

/* User dropdown */
.top-nav-user { position: relative; }
.nav-user-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 8px; cursor: pointer;
  transition: background .2s;
}
.nav-user-btn:hover { background: rgba(180,71,43,.06); }
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-ink));
  color: #fff; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600; font-size: 12px;
}
.nav-user-name {
  font-size: 13px; font-weight: 500; color: var(--ink);
}
.nav-user-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  width: 260px; background: var(--card);
  border: 1px solid var(--rule); border-radius: 12px;
  box-shadow: var(--shadow); padding: 16px;
  opacity: 0; visibility: hidden;
  transform: translateY(-8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.nav-user-dropdown.open {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-user-fullname {
  font-family: var(--serif); font-weight: 500; font-size: 16px;
}
.nav-user-role {
  font-family: var(--serif); font-style: italic; font-size: 12.5px;
  color: var(--ink-3); margin-top: 4px;
}
.nav-user-scope {
  font-family: var(--mono); font-size: 11px; color: var(--ink-4);
  background: var(--paper-3); padding: 2px 8px; border-radius: 99px;
  display: inline-block; margin-top: 8px;
}
.nav-user-divider {
  height: 1px; background: var(--rule); margin: 14px 0;
}
.nav-user-action {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px; border-radius: 6px; font-size: 13px;
  color: var(--ink-2); transition: background .2s;
}
.nav-user-action:hover {
  background: rgba(180,71,43,.06); color: var(--accent);
}

/* --- Content Layout --- */
.main-content {
  padding: 0;
  animation: fadeIn .3s var(--ease);
}
.content-col {
  max-width: 960px;
  margin: 0 auto;
  padding: 36px 40px 60px;
}
.content-wide {
  padding: 36px 40px 60px;
}

/* --- Typography --- */
.headline {
  font-family: var(--serif); font-weight: 500;
  font-size: 42px; line-height: 1.1; letter-spacing: -.02em;
  margin: 0; color: var(--ink);
}
.headline em { font-style: italic; color: var(--accent); font-weight: 500; }
.deck {
  font-family: var(--serif); font-size: 17px; line-height: 1.55;
  color: var(--ink-2); max-width: 720px; font-weight: 300; margin-top: 12px;
}
.section-title {
  font-family: var(--serif); font-weight: 500; font-size: 24px;
  letter-spacing: -.01em; margin: 0;
  display: flex; align-items: baseline; gap: 10px;
}
.section-title em { font-style: italic; color: var(--accent); font-weight: 500; }
.section-sub {
  font-family: var(--serif); font-style: italic; font-size: 13px;
  color: var(--ink-3); margin-top: 4px;
}
.eyebrow {
  font-family: var(--serif); font-style: italic; font-size: 12.5px;
  color: var(--ink-3); letter-spacing: .3px;
  display: flex; align-items: center; gap: 8px;
}
.eyebrow .dot { width: 5px; height: 5px; background: var(--accent); border-radius: 50%; }

/* --- KPI Cards --- */
.kpi-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
.kpi-card {
  background: var(--card); border: 1px solid var(--rule); border-radius: 14px;
  padding: 22px; position: relative; overflow: hidden;
  box-shadow: var(--shadow);
  transition: opacity .3s var(--ease);
}
.kpi-card:hover { opacity: .92; }
.kpi-card.dark {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.kpi-card.dark .eyebrow { color: #C9BFA4; }
.kpi-card.dark .kpi-caption { color: #B8AE93; }
.kpi-value {
  font-family: var(--serif); font-weight: 400; font-size: 40px;
  line-height: 1; letter-spacing: -.02em; margin: 12px 0 6px;
}
.kpi-value .cur {
  font-size: 20px; color: var(--ink-4); font-style: italic;
  margin-right: 2px; vertical-align: top; position: relative; top: 6px;
}
.kpi-card.dark .kpi-value .cur { color: #C9BFA4; }
.kpi-value .unit {
  font-size: 18px; color: var(--ink-4); font-style: italic;
  font-family: var(--serif);
}
.kpi-card.dark .kpi-value .unit { color: #C9BFA4; }
.kpi-caption {
  font-size: 13px; color: var(--ink-3); font-family: var(--serif); line-height: 1.5;
}
.kpi-delta {
  display: inline-flex; align-items: baseline; gap: 5px;
  font-family: var(--mono); font-size: 12px;
  padding: 3px 9px; border-radius: 99px; margin-top: 10px;
}
.kpi-delta.up { color: var(--good); background: var(--good-bg); }
.kpi-delta.down { color: var(--accent); background: var(--warn-bg); }

/* --- Data Table --- */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th {
  font-family: var(--serif); font-style: italic; font-size: 12.5px;
  color: var(--ink-3); letter-spacing: .3px;
  padding: 12px 16px; border-bottom: 1px solid var(--rule-2);
  text-align: left; white-space: nowrap;
}
.data-table thead th.sortable {
  cursor: pointer; user-select: none;
}
.data-table thead th.sortable:hover { color: var(--ink); }
.data-table thead th .sort-indicator {
  display: inline-block; margin-left: 4px; font-style: normal;
  opacity: .4; transition: opacity .2s;
}
.data-table thead th.sorted .sort-indicator { opacity: 1; color: var(--accent); }
.data-table tbody td {
  padding: 16px; border-bottom: 1px solid var(--rule);
  font-size: 14px; vertical-align: middle;
}
.data-table tbody tr {
  transition: background .2s var(--ease);
}
.data-table tbody tr:hover { background: rgba(180,71,43,.03); }
.data-table tbody tr.clickable { cursor: pointer; }
.data-table tbody tr:last-child td { border-bottom: none; }
.table-card {
  background: var(--card); border: 1px solid var(--rule); border-radius: 14px;
  overflow: hidden; box-shadow: var(--shadow);
}

/* --- Status Chips --- */
.status-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.status-chip.on_track, .status-chip.approved { color: var(--good); background: var(--good-bg); }
.status-chip.behind { color: var(--amber); background: var(--amber-bg); }
.status-chip.critical, .status-chip.rejected { color: var(--accent); background: var(--warn-bg); }
.status-chip.pending { color: var(--ink-3); background: var(--paper-3); }

/* Type badges */
.type-badge {
  display: inline-block; padding: 3px 10px; border-radius: 6px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .5px;
}
.type-badge.po { color: var(--ink-2); background: var(--paper-3); }
.type-badge.invoice { color: var(--accent-ink); background: var(--accent-soft); }
.type-badge.refund { color: var(--amber); background: var(--amber-bg); }
.type-badge.write_off { color: var(--ink-4); background: var(--paper-2); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  padding: 9px 18px; border-radius: 99px;
  border: 1px solid var(--rule);
  background: var(--card-2); color: var(--ink-2);
  cursor: pointer; transition: all .2s var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--paper-3); }
.btn.primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.btn.primary:hover { background: var(--accent-ink); }
.btn.outline {
  background: transparent; border-color: var(--rule-2); color: var(--ink-2);
}
.btn.outline:hover { border-color: var(--ink-3); background: var(--paper-3); }
.btn.danger {
  background: transparent; border-color: var(--accent); color: var(--accent);
}
.btn.danger:hover { background: var(--warn-bg); }

/* --- Filter / Dropdown --- */
.filter-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 16px 0; margin-bottom: 8px;
}
.dropdown-wrap { position: relative; }
.dropdown-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 99px;
  border: 1px solid var(--rule); background: var(--card);
  font-size: 13px; color: var(--ink-2); cursor: pointer;
  font-family: var(--sans); transition: border-color .2s;
}
.dropdown-trigger:hover { border-color: var(--ink-4); }
.dropdown-trigger.active {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 200px; background: var(--card);
  border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: var(--shadow); z-index: 50;
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.dropdown-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
  padding: 10px 16px; font-size: 13px; cursor: pointer;
  color: var(--ink-2); transition: background .15s;
}
.dropdown-item:first-child { border-radius: 10px 10px 0 0; }
.dropdown-item:last-child { border-radius: 0 0 10px 10px; }
.dropdown-item:hover { background: rgba(180,71,43,.06); }
.dropdown-item.selected { color: var(--accent); font-weight: 500; }

/* --- Toast --- */
.toast-container {
  position: fixed; top: 80px; right: 40px; z-index: 999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 14px 22px; border-radius: 10px;
  background: var(--ink); color: var(--paper);
  font-size: 14px; font-family: var(--serif);
  box-shadow: 0 8px 24px rgba(27,26,23,.3);
  opacity: 0; transform: translateX(20px);
  transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.visible { opacity: 1; transform: translateX(0); }

/* --- Approval Action Bar --- */
.approval-actions {
  background: var(--card); border: 1px solid var(--rule); border-radius: 14px;
  padding: 24px; margin-top: 20px; box-shadow: var(--shadow);
}
.rationale-area {
  width: 100%; min-height: 80px; padding: 12px 16px;
  border: 1px solid var(--rule); border-radius: 10px;
  background: var(--paper); font-size: 14px;
  font-family: var(--serif); line-height: 1.6; color: var(--ink);
  resize: vertical; outline: none;
  transition: border-color .2s;
}
.rationale-area:focus { border-color: var(--accent); }
.rationale-area.error { border-color: var(--accent); }
.error-msg {
  color: var(--accent); font-size: 12px; font-style: italic;
  font-family: var(--serif); margin-top: 6px;
}

/* --- Budget Utilisation Bar --- */
.util-bar-wrap { margin-top: 4px; }
.util-bar {
  width: 100%; height: 6px; background: var(--paper-3);
  border-radius: 99px; overflow: hidden;
}
.util-bar-fill {
  height: 100%; border-radius: 99px;
  transition: width .4s var(--ease);
}
.util-bar-fill.green { background: var(--good); }
.util-bar-fill.amber { background: var(--amber); }
.util-bar-fill.red { background: var(--accent); }
.util-label {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  margin-top: 4px; display: flex; justify-content: space-between;
}

/* --- Approver Chain --- */
.approver-chain { display: flex; flex-direction: column; gap: 0; }
.approver-step {
  display: flex; align-items: center; gap: 12px; padding: 10px 0;
  position: relative;
}
.approver-step:not(:last-child)::after {
  content: ''; position: absolute; left: 13px; top: 36px;
  width: 1px; height: calc(100% - 16px); background: var(--rule);
}
.approver-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
}
.approver-icon.approved { background: var(--good-bg); color: var(--good); }
.approver-icon.pending { background: var(--paper-3); color: var(--ink-4); }
.approver-icon.rejected { background: var(--warn-bg); color: var(--accent); }
.approver-name { font-size: 14px; font-weight: 500; }
.approver-role { font-family: var(--serif); font-style: italic; font-size: 12px; color: var(--ink-3); }

/* --- Audit Trail --- */
.audit-list { margin-top: 16px; }
.audit-entry {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.audit-entry:last-child { border-bottom: none; }
.audit-marker {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rule-2); flex-shrink: 0; margin-top: 6px;
}
.audit-actor { font-weight: 500; font-size: 13px; }
.audit-action {
  font-family: var(--serif); font-style: italic; font-size: 12.5px;
  color: var(--ink-3); margin: 2px 0;
}
.audit-rationale {
  font-size: 13px; color: var(--ink-2); line-height: 1.5; margin-top: 4px;
}

/* --- Charts (pure SVG/CSS) --- */
.chart-card {
  background: var(--card); border: 1px solid var(--rule); border-radius: 14px;
  padding: 24px; box-shadow: var(--shadow);
}
.chart-legend {
  display: flex; gap: 20px; font-family: var(--serif);
  font-style: italic; font-size: 12px; color: var(--ink-3); margin-bottom: 12px;
}
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i {
  width: 10px; height: 10px; border-radius: 2px; display: inline-block;
}
.donut-chart { display: flex; align-items: center; gap: 24px; margin-top: 16px; }
.donut-legend {
  display: flex; flex-direction: column; gap: 8px; flex: 1;
}
.donut-legend-item {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
}
.donut-legend-swatch {
  width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0;
}

/* --- Stale Data Warning --- */
.stale-badge {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--amber); font-size: 12px; font-weight: 500;
}
.stale-badge .ico { color: var(--amber); }
.stale-tooltip {
  position: relative; cursor: help;
}
.stale-tooltip::after {
  content: 'Data may be stale'; position: absolute;
  bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper);
  font-size: 11px; padding: 4px 10px; border-radius: 6px;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.stale-tooltip:hover::after { opacity: 1; }

/* --- Sync Pill --- */
.sync-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--sans); font-size: 11.5px; font-weight: 500;
  padding: 4px 10px; border-radius: 99px;
}
.sync-pill.fresh { color: var(--good); background: var(--good-bg); }
.sync-pill .live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--good);
}

/* --- CTA Link --- */
.cta-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--serif); font-style: italic; font-size: 14px;
  color: var(--accent); border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 2px; cursor: pointer;
  transition: border-color .2s;
}
.cta-link:hover { border-color: var(--accent); }

/* --- Breadcrumbs --- */
.breadcrumbs {
  font-family: var(--serif); font-style: italic; font-size: 13px;
  color: var(--ink-3); padding: 16px 0;
}
.breadcrumbs a { color: var(--ink-3); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 8px; color: var(--ink-4); }
.breadcrumbs .current { font-style: normal; font-weight: 500; color: var(--ink-2); }

/* --- Currency Display --- */
.currency-dual {
  display: flex; flex-direction: column;
}
.currency-primary {
  font-family: var(--serif); font-size: 15px; font-weight: 500;
}
.currency-secondary {
  font-family: var(--serif); font-style: italic; font-size: 12px;
  color: var(--ink-4); margin-top: 1px;
}

/* --- Property Row (editorial list) --- */
.prop-list {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow);
}
.prop-row {
  display: grid; grid-template-columns: 44px 1fr auto;
  gap: 14px; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--rule);
  cursor: pointer; transition: background .2s var(--ease);
}
.prop-row:last-child { border-bottom: none; }
.prop-row:hover { background: rgba(180,71,43,.03); }
.prop-num {
  font-family: var(--serif); font-style: italic; font-size: 20px;
  color: var(--ink-4); width: 36px; text-align: center;
}
.prop-name {
  font-family: var(--serif); font-size: 16px; font-weight: 500;
  letter-spacing: -.01em;
}
.prop-meta {
  font-family: var(--serif); font-style: italic; font-size: 12.5px;
  color: var(--ink-3); margin-top: 3px;
}
.prop-meta .sep { color: var(--ink-4); margin: 0 6px; }
.prop-metric { text-align: right; }
.prop-metric .val {
  font-family: var(--serif); font-size: 17px; font-weight: 500;
}
.prop-metric .lbl {
  font-family: var(--serif); font-style: italic; font-size: 11.5px;
  color: var(--ink-3); margin-top: 1px;
}
.occ-bar {
  height: 5px; background: var(--paper-3); border-radius: 99px;
  overflow: hidden; margin-top: 6px;
}
.occ-bar-fill {
  display: block; height: 100%; border-radius: 99px;
  transition: width .4s var(--ease);
}
.occ-bar-fill.good { background: var(--ink); }
.occ-bar-fill.warn { background: var(--accent); }

/* --- Drill-down Expansion --- */
.drill-down {
  padding: 20px 24px;
  background: var(--paper-2); border-bottom: 1px solid var(--rule);
  animation: fadeSlideDown .3s var(--ease);
}

/* --- Detail View --- */
.detail-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 20px; border-bottom: 1px solid var(--rule); margin-bottom: 24px;
}
.detail-amount {
  font-family: var(--serif); font-size: 36px; font-weight: 500;
  letter-spacing: -.02em;
}
.detail-amount .cur {
  font-size: 18px; color: var(--ink-4); font-style: italic;
  margin-right: 2px;
}
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}
.detail-section { margin-bottom: 24px; }
.detail-label {
  font-family: var(--serif); font-style: italic; font-size: 12.5px;
  color: var(--ink-3); letter-spacing: .3px; margin-bottom: 8px;
}
.detail-value { font-size: 14px; font-weight: 500; }

/* --- Dual Approval Badge --- */
.dual-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 500;
  color: var(--accent); background: var(--warn-bg);
  border: 1px solid var(--accent-soft);
}

/* --- Attachment List --- */
.attachment-list { display: flex; flex-direction: column; gap: 8px; }
.attachment-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 8px;
  background: var(--paper-2); cursor: pointer;
  transition: background .2s;
}
.attachment-item:hover { background: var(--paper-3); }
.attachment-name { font-size: 13px; font-weight: 500; flex: 1; }
.attachment-size { font-family: var(--mono); font-size: 11px; color: var(--ink-4); }

/* --- Login Screen --- */
.login-screen {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 40px;
}
.login-card {
  background: var(--card); border: 1px solid var(--rule);
  border-radius: 16px; padding: 48px; max-width: 480px;
  width: 100%; box-shadow: var(--shadow); text-align: center;
}
.login-brand {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-bottom: 32px;
}
.login-title {
  font-family: var(--serif); font-weight: 500; font-size: 26px;
  margin-bottom: 6px;
}
.login-subtitle {
  font-family: var(--serif); font-style: italic; font-size: 14px;
  color: var(--ink-3); margin-bottom: 32px;
}
.user-cards { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.user-card {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border-radius: 12px;
  border: 2px solid var(--rule); background: var(--paper);
  cursor: pointer; text-align: left;
  transition: border-color .2s, background .2s;
}
.user-card:hover { border-color: var(--accent-soft); background: var(--card); }
.user-card.selected { border-color: var(--accent); background: var(--card); }
.user-card-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-ink));
  color: #fff; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600; font-size: 16px;
  flex-shrink: 0;
}
.user-card-name {
  font-family: var(--serif); font-weight: 500; font-size: 16px;
}
.user-card-role {
  font-size: 12px; color: var(--ink-3); margin-top: 2px;
}
.user-card-scope {
  font-family: var(--mono); font-size: 11px; color: var(--ink-4);
  background: var(--paper-3); padding: 2px 8px; border-radius: 99px;
  display: inline-block; margin-top: 6px;
}
.login-btn {
  width: 100%; padding: 14px; border-radius: 99px;
  background: var(--accent); color: #fff; border: none;
  font-size: 15px; font-weight: 500; font-family: var(--sans);
  cursor: pointer; transition: background .2s;
}
.login-btn:hover { background: var(--accent-ink); }
.login-btn:disabled { background: var(--paper-3); color: var(--ink-4); cursor: default; }

/* --- Empty State --- */
.empty-state {
  text-align: center; padding: 60px 40px;
}
.empty-state-title {
  font-family: var(--serif); font-size: 20px; font-weight: 500; margin-bottom: 8px;
}
.empty-state-desc {
  font-family: var(--serif); font-style: italic; font-size: 14px;
  color: var(--ink-3); max-width: 400px; margin: 0 auto;
}

/* --- Masthead --- */
.masthead {
  padding: 40px 40px 28px; border-bottom: 1px solid var(--rule);
  background: var(--paper); max-width: 960px; margin: 0 auto;
}
.issue-line {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--serif); font-style: italic; font-size: 13px;
  color: var(--ink-3); letter-spacing: .4px;
}
.issue-line .rule-line {
  height: 1px; background: var(--rule-2); flex: 1; max-width: 80px;
}
.byline {
  margin-top: 18px; display: flex; gap: 16px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-3);
  font-family: var(--serif); font-style: italic; align-items: center;
}
.byline .sep-dot { width: 4px; height: 4px; background: var(--ink-4); border-radius: 50%; }

/* --- Notes / Footnotes --- */
.notes-section {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
  padding-top: 28px; border-top: 1px solid var(--rule); margin-top: 40px;
}
.note-title {
  font-family: var(--serif); font-weight: 500; font-size: 14px;
  margin-bottom: 6px; display: flex; align-items: center; gap: 8px;
}
.note-title .n {
  font-family: var(--serif); font-style: italic; color: var(--accent); font-size: 13px;
}
.note-body {
  font-family: var(--serif); font-size: 13px; line-height: 1.6; color: var(--ink-2);
}
.note-body em { color: var(--accent); font-style: italic; }

/* --- Creator Info --- */
.creator-info {
  display: flex; align-items: center; gap: 10px;
}
.creator-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 11px; font-weight: 600;
}
.creator-avatar.a1 { background: var(--paper-3); color: var(--ink-2); }
.creator-avatar.a2 { background: #D9C5B5; color: #7A2F1B; }
.creator-avatar.a3 { background: #C8D0B0; color: #3A4626; }
.creator-avatar.a4 { background: #C8BC9E; color: #3A362F; }
.creator-name { font-size: 13px; font-weight: 500; }
.creator-role {
  font-family: var(--serif); font-style: italic; font-size: 11.5px;
  color: var(--ink-3);
}

/* --- Skeleton Loading --- */
.skeleton {
  background: linear-gradient(90deg, var(--paper-2) 25%, var(--paper-3) 50%, var(--paper-2) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Section Dividers --- */
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 20px; border-bottom: 1px solid var(--rule); padding-bottom: 14px;
}

/* --- Flex Utilities --- */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mt-40 { margin-top: 40px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.text-right { text-align: right; }

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Footer --- */
.page-footer {
  padding: 30px 40px; border-top: 1px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--serif); font-style: italic; font-size: 12.5px;
  color: var(--ink-3); max-width: 960px; margin: 0 auto;
}
.page-footer .colophon { max-width: 520px; line-height: 1.5; }
.page-footer strong { color: var(--ink-2); font-style: normal; font-weight: 500; }

/* --- Back button --- */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-3); cursor: pointer;
  font-family: var(--serif); font-style: italic;
  margin-bottom: 16px; transition: color .2s;
}
.back-link:hover { color: var(--accent); }

/* --- Pagination row --- */
.pagination {
  display: flex; justify-content: center; gap: 4px;
  padding: 16px; border-top: 1px solid var(--rule);
}
.page-btn {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--rule); background: var(--card);
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 12px;
  color: var(--ink-2); cursor: pointer; transition: all .2s;
}
.page-btn:hover { border-color: var(--accent); }
.page-btn.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
