:root {
  --bg: #0f1115;
  --bg-card: #181b22;
  --bg-card-hover: #20242c;
  --border: #262b34;
  --text: #e6e8eb;
  --muted: #8b94a3;
  --accent: #f7931a;
  --accent-2: #3aa17e;
  --pos: #3aa17e;
  --neg: #e0533d;
  --danger: #e0533d;
  --bg-header: #0c0e12;
  --xfer-link: #5b9bff;
}

/* Light theme — overrides the palette; the Bitcoin-orange accent is kept. Applied via
   <html data-theme="light"> rendered server-side from the user's saved preference. */
:root[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-card: #ffffff;
  --bg-card-hover: #eef1f5;
  --border: #d9dee6;
  --text: #1a1d23;
  --muted: #5c6573;
  --accent: #f7931a;
  --accent-2: #2f8d6c;
  --pos: #2f8d6c;
  --neg: #d6442c;
  --danger: #d6442c;
  --bg-header: #ffffff;
  --xfer-link: #2563eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

/* App-like cursors: plain text shows the arrow — an I-beam over labels/figures reads as
   "this is an editable field". Only real text inputs get the caret; controls get a pointer.
   (Text is still selectable/copyable; only the hover hint changes.) */
body { cursor: default; }
input, textarea, [contenteditable="true"] { cursor: text; }
input[type="radio"], input[type="checkbox"], input[type="range"], input[type="file"],
input[type="submit"], input[type="button"], input[type="color"],
select, button, a[href], summary, label { cursor: pointer; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

header { border-bottom: 1px solid var(--border); background: var(--bg-header); }
header .nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.brand {
  display: inline-flex; align-items: center; text-decoration: none; line-height: 0;
}
.brand img { height: 36px; width: auto; display: block; }
.nav-links { display: flex; gap: 18px; flex: 1; margin-left: 24px; align-items: center; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav-links a:hover { color: var(--text); }

/* Hamburger (mobile only) — collapses the primary nav under a toggle. */
.nav-toggle {
  display: none; background: transparent; border: 1px solid var(--border);
  width: 38px; height: 34px; border-radius: 8px; padding: 0;
  align-items: center; justify-content: center;
}
.nav-toggle:hover { background: var(--bg-card-hover); }
.nav-toggle-bars { position: relative; display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; }
.nav-toggle-bars::before, .nav-toggle-bars::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px;
  background: var(--text); border-radius: 2px;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

@media (max-width: 800px) {
  header .nav { position: relative; flex-wrap: wrap; gap: 10px; }
  .brand { margin-right: auto; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none; flex-direction: column; align-items: stretch;
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    margin: 0; padding: 8px; gap: 2px; z-index: 60;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  }
  .nav-links.open { display: flex; }
  .nav-links > a { padding: 10px 12px; border-radius: 6px; font-size: 15px; color: var(--text); }
  .nav-links > a:hover { background: var(--bg-card-hover); }
  /* Admin submenu renders inline inside the sheet rather than as a floating popover. */
  .nav-dropdown { width: 100%; }
  .nav-dropdown-menu {
    position: static; box-shadow: none; border: none;
    min-width: 0; padding: 2px 0 2px 12px;
  }
}

/* Admin dropdown (native <details>, no JS required to open) */
.nav-dropdown { position: relative; }
.nav-dropdown > summary {
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary::after { content: " ▾"; font-size: 10px; }
.nav-dropdown[open] > summary,
.nav-dropdown > summary:hover { color: var(--text); }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.nav-dropdown-menu a {
  padding: 7px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.nav-dropdown-menu a:hover { background: var(--bg-card-hover); }

.currency-form { display: flex; align-items: center; gap: 8px; }
.currency-form label { color: var(--muted); font-size: 13px; }

.year-form { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; }
.year-form label { color: var(--muted); font-size: 13px; }
.tax-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
/* Tax table: the intermediate-calculation columns are hidden until "Show calculation details". */
.col-detail { display: none; }
html.tax-detailed .col-detail { display: table-cell; }
.detail-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; }
.detail-toggle input { width: auto; margin: 0; }
.decl-box { margin: 12px 0; }
.decl-title { font-weight: 600; margin-bottom: 6px; }
.decl-figures { display: flex; gap: 20px; flex-wrap: wrap; align-items: baseline; }
.decl-note { font-size: 12px; margin-top: 6px; }

/* Data-health panel (deterministic coherence checks + trust score). */
.health-card { border-left: 4px solid var(--border); }
.health-good { border-left-color: var(--pos); }
.health-warning { border-left-color: var(--accent); }
.health-critical { border-left-color: var(--neg); }
.health-head { display: flex; align-items: center; gap: 16px; }
.health-score { flex: 0 0 auto; display: flex; align-items: baseline; justify-content: center;
  min-width: 84px; padding: 8px 12px; border-radius: 10px; background: var(--bg-card-hover);
  border: 1px solid var(--border); }
.health-score-num { font-size: 26px; font-weight: 700; line-height: 1; }
.health-score-den { font-size: 12px; color: var(--muted); margin-left: 1px; }
.health-good .health-score-num { color: var(--pos); }
.health-warning .health-score-num { color: var(--accent); }
.health-critical .health-score-num { color: var(--neg); }
.health-headline .decl-title { margin-bottom: 2px; }
.health-headline p { margin: 0; font-size: 13px; }
.health-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.health-item { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.5; }
.health-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--muted); }
.health-sev-critical .health-dot { background: var(--neg); }
.health-sev-warning .health-dot { background: var(--accent); }
.health-msg strong { color: var(--text); }
.health-msg a { margin-left: 6px; white-space: nowrap; }

.tag-help { margin: 8px 0 16px; }
.tag-help summary { cursor: pointer; color: var(--muted); font-size: 14px; padding: 4px 0; }
.tag-help summary:hover { color: var(--text); }
.tag-help dl { margin: 12px 0 0; padding: 12px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; }
.tag-help dt { margin-top: 10px; font-weight: 600; }
.tag-help dt:first-child { margin-top: 0; }
.tag-help dd { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tag-help dd em { color: var(--text); opacity: 0.85; }

/* Collapsible explainer — tucks dense help/legal prose away so pages lead with data. */
.explainer { margin: 10px 0 16px; }
.explainer > summary {
  cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0;
  list-style: none; user-select: none; display: inline-flex; align-items: center; gap: 6px;
}
.explainer > summary::-webkit-details-marker { display: none; }
.explainer > summary::before { content: "▸"; font-size: 10px; }
.explainer[open] > summary::before { content: "▾"; }
.explainer > summary:hover { color: var(--text); }
.explainer-body {
  margin-top: 10px; padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; line-height: 1.6; color: var(--muted);
}
.explainer-body p { margin: 0 0 10px; }
.explainer-body p:last-child { margin-bottom: 0; }
.explainer-body code { background: rgba(127,127,127,0.14); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.explainer-body strong { color: var(--text); }

select, input, button {
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); padding: 8px 10px; border-radius: 6px;
  font-size: 14px; font-family: inherit;
}
input:focus, select:focus { outline: none; border-color: var(--accent); }

/* Keyboard focus ring. Element-specific so it beats `input:focus { outline: none }` on
   keyboard focus, while mouse focus stays clean (browsers only match :focus-visible for
   keyboard / programmatic focus). */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button {
  background: var(--accent); color: #111; border: none; cursor: pointer;
  font-weight: 600;
}
button:hover:not(:disabled) { filter: brightness(1.1); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.danger { background: var(--danger); color: #fff; }
button:not(.danger):not(.btn-sync) {}
.btn-sync { background: var(--accent-2); color: #fff; }

.hero { margin: 24px 0; }
.hero h1 { margin: 8px 0 4px; }
.hero-with-action {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.hero-with-action form { flex: none; }
.muted { color: var(--muted); }

.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 18px; margin: 12px 0;
}
.card h2 { margin-top: 0; }

.grid { display: grid; gap: 12px; margin: 12px 0; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.kpi-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.kpi { font-size: 22px; font-weight: 600; margin-top: 4px; }
.kpi-sub { color: var(--muted); font-size: 13px; margin-left: 6px; font-weight: 400; }
/* Hero KPI — the page's headline figure reads larger / accented vs. the secondary stats. */
.kpi-hero .kpi { font-size: 28px; }
.kpi-hero .kpi-label { color: var(--accent); }
.card.kpi-hero { border-color: rgba(247, 147, 26, 0.4); background: linear-gradient(135deg, rgba(247, 147, 26, 0.07), transparent); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }

.row-between { display: flex; justify-content: space-between; align-items: center; }

.form-inline { display: flex; gap: 8px; flex-wrap: wrap; }
.form-inline input { flex: 1; min-width: 180px; }

table.data { width: 100%; border-collapse: collapse; margin-top: 10px; }
table.data th, table.data td {
  padding: 10px 12px; text-align: left;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
table.data th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; }
table.data tr:hover td { background: var(--bg-card-hover); }
table.data .actions { display: flex; gap: 6px; }
table.data .actions form { display: inline; }
table.data a { color: var(--accent); text-decoration: none; }
table.data a:hover { text-decoration: underline; }

/* Wrap a wide table so it scrolls horizontally inside its card instead of overflowing the
   viewport on narrow screens. */
.table-scroll { overflow-x: auto; }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.tag-form select { padding: 4px 6px; font-size: 12px; }

.fee-form { display: inline-flex; gap: 4px; align-items: center; }
.fee-form input { width: 80px; padding: 4px 6px; font-size: 12px; }
.fee-form button { padding: 4px 8px; font-size: 12px; }

.banner {
  background: rgba(247, 147, 26, 0.12);
  border: 1px solid rgba(247, 147, 26, 0.4);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 8px;
  margin: 12px 0;
  font-size: 14px;
}
.banner strong { color: var(--accent); }
.banner em { font-style: normal; background: rgba(255,255,255,0.06); padding: 1px 6px; border-radius: 4px; font-size: 12px; }

.pill {
  display: inline-block;
  background: rgba(247, 147, 26, 0.18);
  color: var(--accent);
  border: 1px solid rgba(247, 147, 26, 0.4);
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  margin-left: 4px;
}

.banner-review { border-left: 3px solid rgba(247, 147, 26, 0.6); }
.banner-warn { border-left: 3px solid var(--neg, #d65454); }

/* Compact button (e.g. "Fix this" in the negative-balance table). */
.btn-sm { padding: 4px 10px; font-size: 12px; }
/* Draw the eye to the field that still needs input after a prefill. */
.field-highlight input { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(247, 147, 26, 0.2); }

/* --- account avatar menu (native <details>) --- */
.user-menu { position: relative; margin-left: 12px; }
.user-menu > summary {
  list-style: none; cursor: pointer; user-select: none; display: flex; align-items: center;
}
.user-menu > summary::-webkit-details-marker { display: none; }
.avatar-circle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #1a1d23; font-weight: 700; font-size: 14px;
  border: 1px solid transparent;
}
.user-menu[open] > summary .avatar-circle { border-color: var(--text); }
.avatar-circle.avatar-lg { width: 40px; height: 40px; font-size: 17px; }
.user-menu-panel {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 220px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 50;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.user-menu-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.user-menu-email { font-size: 13px; color: var(--text); word-break: break-all; }
.user-menu-panel a,
.user-menu-panel button {
  text-align: left; width: 100%;
  padding: 8px 10px; border-radius: 6px; font-size: 14px;
  color: var(--text); text-decoration: none;
  background: transparent; border: none; cursor: pointer;
}
.user-menu-panel a:hover,
.user-menu-panel button:hover { background: var(--bg-card-hover); }
.lang-toggle-form button { color: var(--muted); }
.theme-switch {
  display: flex !important; align-items: center; justify-content: space-between; gap: 10px;
}
.theme-switch-label { color: var(--text); }
.theme-switch-track {
  position: relative; flex: none; width: 44px; height: 24px; border-radius: 999px;
  background: var(--border); transition: background 0.18s ease;
}
.theme-switch[aria-checked="true"] .theme-switch-track { background: var(--accent); }
.theme-switch-knob {
  position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s ease;
}
.theme-switch[aria-checked="true"] .theme-switch-knob { transform: translateX(20px); }
.user-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }
.user-menu-signout { color: var(--danger) !important; }

/* --- account settings page --- */
.setting-form { display: flex; align-items: center; gap: 10px; }
.setting-form label { color: var(--muted); font-size: 13px; }
.theme-choice { display: flex; gap: 12px; }
.theme-option {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border: 1px solid var(--border); border-radius: 8px;
  cursor: pointer; font-size: 14px; background: var(--bg);
}
.theme-option.is-active { border-color: var(--accent); }
.theme-option input { display: none; }
.theme-swatch { width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--border); }
.theme-swatch-dark { background: #0f1115; }
.theme-swatch-light { background: #f6f7f9; }

/* --- auth UI --- */

.auth-wrap { max-width: 420px; margin: 64px auto; }
.auth-card h1 { margin: 0 0 4px; }
.auth-form { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.auth-form label { font-size: 13px; color: var(--muted); margin-top: 8px; }
.auth-form button { margin-top: 16px; padding: 10px 12px; }

.banner-error {
  background: rgba(224, 83, 61, 0.12);
  border-color: rgba(224, 83, 61, 0.4);
  color: var(--neg);
}
.banner-ok {
  background: rgba(58, 161, 126, 0.12);
  border-color: rgba(58, 161, 126, 0.4);
  color: var(--pos);
}

details.inline-reset { display: inline-block; }
details.inline-reset summary {
  cursor: pointer; color: var(--muted); font-size: 12px;
  padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px;
}
details.inline-reset[open] summary { color: var(--text); }
details.inline-reset .fee-form { margin-top: 6px; }
details.inline-reset .fee-form input { width: 130px; }

.sync-error {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  background: rgba(224, 83, 61, 0.12);
  border: 1px solid rgba(224, 83, 61, 0.4);
  border-radius: 4px;
  color: var(--neg);
  font-size: 11px;
  font-weight: 500;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sync-status.muted {
  background: rgba(139, 148, 163, 0.12);
  border: 1px solid var(--border);
  color: var(--muted);
}
.sync-status.muted::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border: 2px solid var(--muted);
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: sync-spin 0.8s linear infinite;
}
.sync-status.pos {
  background: rgba(58, 161, 126, 0.12);
  border: 1px solid rgba(58, 161, 126, 0.4);
  color: var(--pos);
}
@keyframes sync-spin { to { transform: rotate(360deg); } }

.impersonation-banner {
  background: rgba(247, 147, 26, 0.15);
  border-bottom: 1px solid var(--accent);
  color: var(--text);
  padding: 10px 0;
  font-size: 14px;
}
.impersonation-banner strong { color: var(--accent); }
.impersonation-banner form { display: inline; margin-left: 12px; }
.impersonation-banner button {
  background: var(--accent);
  color: #0c0e12;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}
.impersonation-banner button:hover { filter: brightness(1.1); }

.access-log-table { font-size: 13px; }
.access-log-table .ip { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.access-log-table .path { font-family: ui-monospace, "SF Mono", Menlo, monospace; max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-log-table .ua { color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-log-table .impersonation-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  background: rgba(247, 147, 26, 0.18); color: var(--accent);
  border-radius: 4px; font-size: 11px; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.access-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.access-filters a {
  padding: 4px 10px; border-radius: 4px; background: var(--bg-card);
  border: 1px solid var(--border); color: var(--muted); text-decoration: none; font-size: 13px;
}
.access-filters a.active { background: rgba(247, 147, 26, 0.18); color: var(--accent); border-color: var(--accent); }
.access-filters a:hover { color: var(--text); }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 14px; }
.pager a { color: var(--accent); text-decoration: none; }
.pager a:hover { text-decoration: underline; }

.app-modal {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0;
  min-width: 320px;
  max-width: min(440px, calc(100vw - 32px));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.app-modal::backdrop { background: rgba(8, 10, 14, 0.65); backdrop-filter: blur(2px); }
.app-modal[open] { animation: app-modal-in 120ms ease-out; }
@keyframes app-modal-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.app-modal-body { margin: 0; padding: 20px 22px 18px; }
.app-modal-title { margin: 0 0 6px; font-size: 16px; }
.app-modal-message { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.app-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.app-modal-cancel {
  background: transparent; color: var(--text);
  border: 1px solid var(--border); font-weight: 500;
}
.app-modal-cancel:hover:not(:disabled) { border-color: var(--muted); filter: none; }

/* --- Loading state for buttons (in-flight requests) --- */
button.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
button.is-loading::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  margin: -8px 0 0 -8px;
  width: 16px; height: 16px;
  border: 2px solid #111;
  border-top-color: transparent;
  border-radius: 50%;
  animation: sync-spin 0.7s linear infinite;
}
button.danger.is-loading::after { border-color: #fff; border-top-color: transparent; }

/* --- Add-account modal (chooser + form) --- */
.add-account-modal { width: min(520px, calc(100vw - 32px)); max-width: 520px; }
.add-account-modal .app-modal-body { padding: 20px 24px 22px; }
.add-account-modal .modal-header {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.add-account-modal .modal-header h3 {
  margin: 0; font-size: 16px; font-weight: 600; color: var(--text);
  flex: 1; letter-spacing: -0.01em;
}
.add-account-modal .modal-back {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 4px 10px; font-size: 12px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 4px;
}
/* The `display` above overrides the [hidden] attribute the JS toggles, which would
   otherwise leave Back visible on the chooser (where clicking it is a no-op). */
.add-account-modal .modal-back[hidden] { display: none; }
.add-account-modal .modal-back:hover:not(:disabled) {
  color: var(--text); border-color: var(--muted); background: var(--bg-card-hover); filter: none;
}
.add-account-modal .modal-close {
  background: transparent; color: var(--muted);
  border: none; padding: 0;
  width: 28px; height: 28px; border-radius: 6px;
  font-size: 20px; font-weight: 400; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.add-account-modal .modal-close:hover:not(:disabled) {
  color: var(--text); background: var(--bg-card-hover); filter: none;
}

/* High-specificity selector to beat the global `button { background: var(--accent) }` rule. */
.add-account-modal .modal-tile-list { display: flex; flex-direction: column; gap: 10px; }
.add-account-modal button.modal-tile {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px;
  font-size: 14px; font-weight: 500; font-family: inherit;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}
.add-account-modal button.modal-tile:hover:not(:disabled) {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  filter: none;
  transform: translateY(-1px);
}
.add-account-modal button.modal-tile:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.add-account-modal .modal-tile .tile-icon {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px;
  background: linear-gradient(135deg, rgba(247, 147, 26, 0.18), rgba(247, 147, 26, 0.08));
  color: var(--accent);
  font-size: 18px; font-weight: 700; line-height: 1;
}
.add-account-modal .modal-tile .tile-meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.add-account-modal .modal-tile .tile-title {
  font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.2;
}
.add-account-modal .modal-tile .tile-desc {
  font-size: 12px; color: var(--muted); font-weight: 400; line-height: 1.4;
}
.add-account-modal .modal-tile .tile-chev {
  flex: 0 0 auto;
  color: var(--muted); font-size: 22px; line-height: 1; font-weight: 300;
  transition: color 120ms ease, transform 120ms ease;
}
.add-account-modal button.modal-tile:hover .tile-chev {
  color: var(--accent); transform: translateX(2px);
}

.modal-form { display: flex; flex-direction: column; gap: 10px; }
.modal-form input, .modal-form select, .modal-form textarea {
  width: 100%;
}
.modal-form textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; resize: vertical; min-height: 90px;
}
.modal-form .field-help {
  color: var(--muted); font-size: 12px; margin: -4px 0 4px;
}
.modal-form details { margin-top: 2px; }
.modal-form details summary {
  cursor: pointer; color: var(--muted); font-size: 13px; padding: 4px 0;
}
.modal-form details summary:hover { color: var(--text); }
.modal-form details > div, .modal-form details > p {
  font-size: 13px; color: var(--muted); line-height: 1.5;
  padding: 10px 12px; margin-top: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border); border-radius: 6px;
}
.modal-form details ol { margin: 6px 0 0; padding-left: 18px; }
.modal-form details ol li { margin: 2px 0; }
.modal-form .xpub-preview {
  font-size: 13px; line-height: 1.5; color: var(--muted);
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border); border-radius: 6px;
}
.modal-form .xpub-preview code { word-break: break-all; color: var(--text); }
.modal-form .xpub-preview .xpub-preview-hint { margin-top: 4px; font-size: 12px; }
.modal-form .modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px;
}
.modal-error { margin: 0 0 12px; padding: 10px 12px; font-size: 13px; }

/* --- Hide-emptied-accounts toggle --- */
.accounts-controls { display: flex; justify-content: flex-end; margin: 0 0 12px; }
.toggle-empty {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted); cursor: pointer;
}
.toggle-empty input { cursor: pointer; }
body.hide-empty .account-card[data-empty="1"],
body.hide-empty tr[data-empty="1"] { display: none; }

/* --- Account cards (unified wallet + exchange list) --- */
.account-card { padding: 0; overflow: hidden; }
.account-card .ac-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.account-card .ac-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 6px;
  background: rgba(247, 147, 26, 0.12); color: var(--accent);
  font-size: 15px; font-weight: 700; flex: 0 0 auto;
}
.account-card .ac-title { flex: 1; min-width: 0; }
.account-card .ac-label {
  font-size: 15px; font-weight: 600; color: var(--text);
  display: inline-block; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: middle;
}
.account-card .ac-sub {
  color: var(--muted); font-size: 12px; margin-top: 2px;
}
.account-card .ac-body { padding: 0; overflow-x: auto; }
.account-card .ac-body table.data { margin-top: 0; }
.account-card .ac-body table.data th:first-child,
.account-card .ac-body table.data td:first-child { padding-left: 16px; }
.account-card .ac-body table.data th:last-child,
.account-card .ac-body table.data td:last-child { padding-right: 16px; }
.account-card .ac-empty { padding: 14px 16px; color: var(--muted); font-size: 13px; }

/* Inline rename UI */
.ac-rename-form { display: inline-flex; gap: 6px; align-items: center; }
.ac-rename-form input {
  font-size: 14px; padding: 4px 8px;
  min-width: 200px;
}
.ac-rename-form button { padding: 4px 10px; font-size: 13px; }
.ac-rename-form .ac-rename-cancel {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border); font-weight: 500;
}

/* Overflow menu (rename / disconnect / delete) */
.overflow-menu { position: relative; }
.overflow-menu .ov-trigger {
  background: transparent; color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 10px; font-size: 16px; font-weight: 600;
  line-height: 1;
}
.overflow-menu .ov-trigger:hover { color: var(--text); border-color: var(--muted); }
.overflow-menu .ov-panel {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; min-width: 180px; z-index: 10;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  padding: 4px;
}
.overflow-menu[hidden], .overflow-menu .ov-panel[hidden] { display: none; }
.overflow-menu .ov-item {
  display: block; width: 100%; text-align: left;
  background: transparent; color: var(--text);
  border: none; padding: 8px 12px; font-size: 13px;
  border-radius: 4px; cursor: pointer; font-weight: 500;
}
.overflow-menu .ov-item:hover { background: var(--bg-card-hover); }
.overflow-menu .ov-item.ov-danger { color: var(--danger); }
.overflow-menu .ov-item.ov-danger:hover { background: rgba(224, 83, 61, 0.12); }
.overflow-menu .ov-divider {
  height: 1px; background: var(--border); margin: 4px 0;
}

/* "+ Add account" hero button */
.add-account-card {
  background: linear-gradient(135deg, rgba(247, 147, 26, 0.06), rgba(58, 161, 126, 0.04));
}
.add-account-card .row-between { gap: 12px; flex-wrap: wrap; }
#btn-open-add-account {
  padding: 10px 18px; font-size: 14px;
}

/* TOTP enrollment page */
.mfa-setup {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.mfa-qr {
  flex: 0 0 auto;
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  line-height: 0;
}
.mfa-qr svg { display: block; width: 200px; height: 200px; }
.mfa-instructions { flex: 1 1 280px; min-width: 0; }
.mfa-secret {
  display: inline-block;
  font-size: 14px;
  letter-spacing: 1px;
  padding: 6px 10px;
  background: var(--bg-alt, rgba(255,255,255,0.04));
  border: 1px solid var(--border);
  border-radius: 6px;
  word-break: break-all;
}

/* ---------- Cockpit ---------- */

.cockpit-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cockpit-bar h1 { margin: 0 0 4px; }
.cockpit-actions { display: flex; gap: 8px; align-items: center; }

.btn-primary,
.btn-secondary {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 14px;
}
.btn-primary { background: var(--accent); color: #111; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary {
  background: transparent;
  color: inherit;
  border-color: var(--border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.06); }

/* Cockpit grid — Gridstack drives both the interactive editor and the read-only
   static view. .cockpit-grid is just an app hook on the read-only container. */
.grid-stack, .cockpit-grid { margin-top: 8px; }

/* The grid cell is the card. Gridstack sizes each .grid-stack-item-content to fill its
   item; we give it the card chrome plus a flex column so the body (and any chart) fills
   the remaining height below the title. */
.grid-stack-item-content {
  background: var(--card, rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

/* The widget article is transparent and fills its container — a grid cell or a palette
   preview — so the same live element (chart and all) can move between the two. */
.cockpit-widget {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
}
.cockpit-widget .widget-head h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}
.cockpit-widget .widget-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Charts fill the cell (height is driven by the row span) — paired with
   Chart.defaults.maintainAspectRatio=false set on the cockpit pages. */
.widget-canvas-wrap { position: relative; width: 100%; flex: 1; min-height: 180px; }
.widget-canvas-wrap canvas { width: 100% !important; }

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.kpi-strip .kpi-cell { min-width: 0; }
@media (max-width: 640px) {
  .kpi-strip { grid-template-columns: 1fr 1fr; }
}

.top-movers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 480px) {
  .top-movers { grid-template-columns: 1fr; }
}

/* Tabular widgets (e.g. Holdings & P/L) — scrolls inside its grid cell. */
.widget-table-wrap { width: 100%; flex: 1; min-height: 0; overflow: auto; }
.widget-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.widget-table th, .widget-table td {
  padding: 6px 8px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.widget-table thead th {
  position: sticky; top: 0; background: var(--bg-card);
  color: var(--muted); font-weight: 600; font-size: 12px;
}
.widget-table td.num, .widget-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.widget-table td.sym { font-weight: 600; }
.widget-table tbody tr:hover { background: var(--bg-card-hover); }
/* Dust holdings (value < 1 unit of the display currency): dim the position cells
   but keep the P/L columns readable — the realized P/L can be the whole story. */
.holdings-table tr.dust-row td { opacity: .55; }
.holdings-table tr.dust-row td.pl { opacity: 1; }

/* Calendar heatmap (Activity heatmap widget) — GitHub-style contribution grid. */
.heatmap-wrap { width: 100%; display: flex; flex-direction: column; gap: 8px; overflow-x: auto; }
.heatmap {
  display: grid; grid-auto-flow: column;
  grid-template-rows: repeat(7, 12px); grid-auto-columns: 12px; gap: 3px;
}
.heatmap-cell { width: 12px; height: 12px; border-radius: 2px; display: inline-block; background: var(--border); }
.heatmap-cell.l0 { background: var(--border); }
.heatmap-cell.l1 { background: rgba(58, 161, 126, 0.35); }
.heatmap-cell.l2 { background: rgba(58, 161, 126, 0.6); }
.heatmap-cell.l3 { background: rgba(58, 161, 126, 0.8); }
.heatmap-cell.l4 { background: #3aa17e; }
.heatmap-legend { display: flex; align-items: center; gap: 4px; font-size: 11px; }
.heatmap-legend .heatmap-cell { width: 11px; height: 11px; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
}

/* ---- Async content loading ---- */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 64px 24px;
  text-align: center;
}
.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--accent, #3aa17e);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
#cockpit-content[aria-busy="true"] { min-height: 240px; }
#cockpit-refresh:disabled { opacity: 0.6; cursor: progress; }

/* ---- Performance-period widgets ---- */

.perf-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.perf-preset {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
}
.perf-preset:hover { background: rgba(255, 255, 255, 0.06); }
.perf-preset.active {
  color: var(--text, #fff);
  border-color: var(--accent, #3aa17e);
  background: rgba(58, 161, 126, 0.15);
}
.perf-custom { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }
.perf-custom input {
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 12px;
}
.perf-realized-total { margin-bottom: 8px; color: var(--muted); }
.perf-realized-total .kpi { font-size: 20px; margin-left: 6px; }

/* ---- Cockpit editor ---- */

.editor-section { margin-top: 22px; }
.editor-section > h2 { margin: 0 0 4px; font-size: 18px; }

.grid-stack-editor { min-height: 120px; }
.grid-stack-editor .widget-head { cursor: move; }   /* the drag handle */

.widget-remove {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 5;
  width: 24px;
  height: 24px;
  padding: 0;
  line-height: 22px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card, rgba(0,0,0,0.35));
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}
.widget-remove:hover { color: #fff; border-color: var(--danger, #c0392b); }

.palette-zone {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.palette-card {
  display: flex;
  flex-direction: column;
  background: var(--card, rgba(255,255,255,0.03));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}
.palette-card .cockpit-widget { flex: none; height: 220px; overflow: hidden; }
.palette-add { margin-top: 10px; align-self: flex-start; }

.dnd-empty { padding: 12px; font-style: italic; }

/* ---- Manual / CSV import ---- */
.manual-create-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.manual-upload-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 10px 0; align-items: end; }
.map-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.map-field > span { color: var(--muted); }
.map-field em { color: #c0392b; font-style: normal; }
.map-check { display: inline-flex; gap: 8px; align-items: center; margin: 8px 0; font-size: 13px; }
.type-map-row { display: flex; gap: 10px; align-items: center; padding: 4px 0; }
.type-map-raw { flex: 1; min-width: 0; font-family: monospace; word-break: break-all; }

/* ---------- feedback ---------- */
.feedback-modal { width: min(560px, calc(100vw - 32px)); max-width: 560px; }
.feedback-modal .app-modal-body { padding: 20px 24px 22px; }
.feedback-form { display: flex; flex-direction: column; gap: 6px; }
.feedback-form label { font-size: 13px; color: var(--muted); margin-top: 8px; }
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: inherit;
  font: inherit;
}
.feedback-form textarea { resize: vertical; min-height: 110px; }
.feedback-form .app-modal-actions { margin-top: 14px; display: flex; gap: 8px; justify-content: flex-end; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.badge-bug { background: rgba(224, 83, 61, 0.15); color: #f0907e; border-color: rgba(224, 83, 61, 0.4); }
.badge-feature { background: rgba(58, 161, 126, 0.15); color: #6cc6a3; border-color: rgba(58, 161, 126, 0.4); }
.badge-open { background: rgba(247, 147, 26, 0.15); color: #f7b65a; border-color: rgba(247, 147, 26, 0.4); }
.badge-resolved { background: rgba(139, 148, 163, 0.15); color: var(--muted); }

.feedback-table .feedback-message { max-width: 420px; white-space: pre-wrap; word-break: break-word; }
.feedback-table .row-actions { white-space: nowrap; display: flex; gap: 6px; }

/* ---------- transfers ---------- */
.transfer-cell { white-space: nowrap; }
.xfer-dir { color: var(--muted); font-weight: 600; margin-right: 4px; }
.xfer-note { margin-top: 10px; font-size: 12px; }

/* Self-transfer topology graph (SVG built in transfers.html): circular icon nodes with
   labels below, curved arrows between them. Colors must come from CSS here — var(--…)
   does not resolve in SVG presentation attributes, only through the cascade.
   Node color by kind: orange = exchange, green = self-custody wallet. */
.xfer-graph { max-width: 100%; overflow-x: auto; }
.xfer-svg { display: block; margin: 4px auto 0; }
/* Nodes */
.xfer-svg .xfer-ring { fill: var(--bg-card); stroke-width: 2.5; transition: fill .12s ease; }
.xfer-svg .xfer-icon { fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.xfer-svg .xfer-ex .xfer-ring, .xfer-svg .xfer-ex .xfer-icon { stroke: var(--accent); }
.xfer-svg .xfer-wl .xfer-ring, .xfer-svg .xfer-wl .xfer-icon { stroke: var(--pos); }
.xfer-svg .xfer-node:hover .xfer-ring { fill: var(--bg-card-hover); }
.xfer-svg .xfer-label { fill: var(--xfer-link); font-size: 14px; font-weight: 600; }
.xfer-svg a { text-decoration: none; }
.xfer-svg a:hover .xfer-label { text-decoration: underline; }
/* Edges */
.xfer-svg .xfer-edge { fill: none; stroke: var(--pos); stroke-opacity: 0.8; cursor: default; transition: stroke-opacity .15s ease; }
.xfer-svg .xfer-edge:hover { stroke-opacity: 1; }
.xfer-svg .xfer-edge-mut { stroke: var(--muted); stroke-dasharray: 5 4; }
.xfer-svg .xfer-ah { fill: var(--pos); }
.xfer-svg .xfer-ah-mut { fill: var(--muted); }
.xfer-svg .xfer-elabel { fill: var(--pos); font-size: 12.5px; font-style: italic; }
.xfer-svg .xfer-elabel-mut { fill: var(--muted); font-size: 12.5px; font-style: italic; }

/* ---------- staking widget ---------- */
.staking-legend { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }

/* ---------- toasts (transient inline-save notifications) ---------- */
.toast-container {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 8px; padding: 10px 14px; font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  min-width: 160px; max-width: 320px;
  animation: toast-in 160ms ease-out;
}
.toast-ok { border-left-color: var(--pos); }
.toast-error { border-left-color: var(--danger); }
.toast.toast-out { animation: toast-out 200ms ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- pricing page ---------- */
.pricing-card { display: flex; flex-direction: column; }
.pricing-featured { border-color: rgba(247, 147, 26, 0.5); }
.pricing-price { font-size: 30px; font-weight: 700; margin: 4px 0 12px; }
.pricing-per { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.pricing-features { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); }
.pricing-features li::before { content: "\2713  "; color: var(--pos); font-weight: 700; }
.pricing-cta { margin-top: auto; text-align: center; }
.pricing-note { font-size: 13px; margin-top: 12px; }
/* Tax-disclaimer acknowledgment above each paid CTA. */
.ack-check {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 12px; color: var(--muted); line-height: 1.4; margin: 0 0 10px;
  text-align: left; cursor: pointer;
}
.ack-check input { margin-top: 2px; flex: none; }
/* Persistent disclaimer footer on the tax page. */
.tax-disclaimer {
  font-size: 13px; margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* upgrade nav link + locked-source banner */
.nav-links a.nav-upgrade { color: var(--accent); font-weight: 600; }
.locked-list { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.locked-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
