:root {
  --bg: #faf9f7;
  --fg: #1a1714;
  --muted: #6b6560;
  --line: #e8e4de;
  --accent: #8b7355;
  --accent-soft: rgba(139, 115, 85, 0.12);
  --error-bg: #f8f0ee;
  --error-fg: #6b3a32;
  --ok-bg: #eef5f0;
  --ok-fg: #2d4a3a;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
}

.dev-auth-banner {
  margin: 0;
  padding: 0.45rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--fg);
  background: #fff3cd;
  border-bottom: 1px solid #e8d9a8;
}

body {
  font-family: "Instrument Sans", system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: var(--fg);
  background: var(--bg);
  background-image: radial-gradient(
      ellipse 120% 80% at 50% -20%,
      rgba(139, 115, 85, 0.08),
      transparent 55%
    ),
    radial-gradient(ellipse 80% 50% at 100% 100%, rgba(26, 23, 20, 0.03), transparent 50%);
}

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem 3rem;
  gap: 3.5rem;
}

.shell--narrow {
  gap: 2.5rem;
}

.shell--welcome {
  gap: 4rem;
}

.brand {
  text-align: center;
}

.brand--small {
  margin-bottom: -1rem;
}

.brand-mark {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.75rem, 8vw, 4rem);
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  margin: 0;
  color: var(--fg);
}

.brand-tagline {
  margin: 1.25rem 0 0;
  font-size: 0.8125rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.panel {
  width: 100%;
  max-width: 22rem;
  padding: 2.75rem 2.25rem 2.5rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  border-radius: 2px;
  box-shadow: 0 24px 80px rgba(26, 23, 20, 0.06);
}

.panel--minimal {
  padding-top: 2.25rem;
}

.panel--welcome {
  text-align: center;
  max-width: 24rem;
  padding: 3rem 2.5rem;
}

.alerts {
  margin-bottom: 1.5rem;
}

.alert {
  margin: 0 0 0.5rem;
  padding: 0.75rem 0.9rem;
  font-size: 0.875rem;
  border-radius: 2px;
}

.alert--error {
  background: var(--error-bg);
  color: var(--error-fg);
}

.alert--success {
  background: var(--ok-bg);
  color: var(--ok-fg);
}

.shell--admin {
  padding-top: 3rem;
  align-items: stretch;
}

.panel--wide,
.panel--enroll {
  max-width: 26rem;
}

.panel--admin {
  max-width: 38rem;
  padding-bottom: 2.25rem;
}

.qr-card {
  display: flex;
  justify-content: center;
  margin: 0 0 1.75rem;
  padding: 1rem;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.4);
}

.qr-img {
  display: block;
  width: 180px;
  height: auto;
}

.welcome-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 2rem 0 0;
}

.nav-pill {
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration: none;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  border-radius: 2px;
}

.nav-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.credential-card {
  margin-bottom: 2rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--accent-soft);
  background: rgba(255, 255, 255, 0.7);
}

.credential-card--reset {
  border-style: dashed;
}

.credential-title {
  margin: 0 0 1rem;
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.credential-line {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
}

.credential-label {
  display: inline-block;
  min-width: 5.5rem;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

.mono-soft {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
}

.admin-section {
  margin-bottom: 2.25rem;
}

.admin-heading {
  margin: 0 0 1rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.inline-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field--inline {
  gap: 0.5rem;
}

.btn-primary--small {
  margin-top: 0;
  align-self: flex-start;
}

.table-wrap {
  overflow-x: auto;
}

.wm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.wm-table th,
.wm-table td {
  padding: 0.75rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.wm-table th {
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--muted);
}

.actions {
  text-align: right;
  white-space: nowrap;
}

.table-form {
  display: inline;
  margin: 0;
}

.btn-table {
  font: inherit;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.4rem 0.55rem;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
}

.btn-table:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.muted-cell {
  color: var(--muted);
  font-size: 0.8125rem;
}

.signin-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field-label {
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  font: inherit;
  padding: 0.85rem 0;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  border-radius: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
  outline: none;
  border-bottom-color: var(--accent);
  box-shadow: 0 1px 0 0 var(--accent);
}

.btn-primary {
  margin-top: 0.5rem;
  padding: 0.95rem 1.25rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff;
  background: var(--fg);
  border: 1px solid var(--fg);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-primary:hover {
  background: #2c2620;
  border-color: #2c2620;
}

.btn-ghost {
  margin-top: 2rem;
  padding: 0.65rem 1rem;
  font: inherit;
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hint-muted {
  margin: 0;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.setup-hint {
  margin: 2rem 0 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.setup-hint a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
}

.setup-hint a:hover {
  border-bottom-color: var(--accent);
}

.welcome-line {
  margin: 0 0 1.75rem;
  font-size: 0.9375rem;
  color: var(--muted);
  text-align: center;
}

.welcome-line strong {
  color: var(--fg);
  font-weight: 500;
}

.back-row {
  margin: 1.75rem 0 0;
  text-align: center;
}

.text-link {
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.text-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-soft);
}

.lede {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.75rem;
  font-weight: 400;
  margin: 0 0 0.75rem;
  letter-spacing: 0.02em;
}

.sublede {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.foot {
  font-size: 0.6875rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

.shell--portfolio {
  padding-top: 2.5rem;
  align-items: stretch;
}

.panel--portfolio {
  max-width: 44rem;
  width: 100%;
}

.shell--home {
  max-width: 56rem;
  margin: 0 auto;
}

.home-layout {
  width: 100%;
}

.bank-search {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 2rem;
}

.bank-search .field {
  flex: 1 1 14rem;
  margin: 0;
}

.bank-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.bank-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.bank-card input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
}

.bank-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  padding: 1.35rem 0.85rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.5);
  border-radius: 2px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bank-tick {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 1.15rem;
  height: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  color: transparent;
  background: rgba(255, 255, 255, 0.75);
}

.bank-card:hover .bank-card-body {
  border-color: var(--muted);
}

.bank-card:focus-within .bank-card-body {
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.bank-card:has(input:checked) .bank-card-body,
.bank-card--chosen .bank-card-body {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.bank-card:has(input:checked) .bank-tick,
.bank-card--chosen .bank-tick {
  color: var(--accent);
  border-color: var(--accent);
}

.bank-logo {
  object-fit: contain;
  filter: grayscale(0.08);
}

.bank-logo--large {
  flex-shrink: 0;
}

.bank-name {
  font-size: 0.75rem;
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--fg);
  line-height: 1.35;
}

.panel--books .bank-books-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.bank-books-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem;
  font-weight: 400;
  margin: 0;
  letter-spacing: 0.04em;
}

.instructions-panel {
  margin-bottom: 2rem;
}

.instructions-label {
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.65rem;
  font-weight: 500;
}

.instructions-blank {
  min-height: 4.5rem;
  padding: 1rem 1.1rem;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

.instructions-placeholder {
  font-size: 0.8125rem;
  color: var(--muted);
  font-style: italic;
}

.upload-section {
  margin-bottom: 2rem;
}

.section-kicker {
  font-size: 0.6875rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 1rem;
}

input[type="file"] {
  font-size: 0.8125rem;
  width: 100%;
}

.upload-list-section {
  margin-bottom: 1.5rem;
}

.upload-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.upload-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.upload-filename {
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
  word-break: break-word;
}

.upload-filename:hover {
  border-bottom: 1px solid var(--accent-soft);
}

.upload-detail {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.btn-table--danger {
  border-color: var(--error-fg);
  color: var(--error-fg);
}

.btn-table--danger:hover {
  background: var(--error-bg);
}

.report-panel {
  text-align: center;
  padding: 3rem 1.5rem;
  margin-bottom: 3rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
}

.report-spinner {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto 1.25rem;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: dolius-spin 0.9s linear infinite;
}

@keyframes dolius-spin {
  to {
    transform: rotate(360deg);
  }
}

.report-status {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
  letter-spacing: 0.06em;
}

.report-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}

.report-panel--quiet {
  text-align: left;
  padding: 2rem 1.5rem;
}

.report-status--plain {
  text-align: left;
  font-size: 1.15rem;
}

.dash-customize {
  width: 100%;
  margin-bottom: 2rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.4);
}

.dash-customize-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

.dash-widget-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  border: 0;
  margin: 0;
  padding: 0;
}

.dash-widget-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  margin: 0;
}

.dash-widget {
  width: 100%;
  margin-bottom: 2.5rem;
}

.dash-widget--split {
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 900px) {
  .dash-widget--split {
    display: inline-block;
    width: calc(50% - 1rem);
    vertical-align: top;
    max-width: none;
    margin: 0 0.5rem 2rem;
  }
}

.dash-chart-wrap {
  position: relative;
  padding: 0.5rem 0;
  max-width: 28rem;
  margin: 0 auto;
}

.dash-chart-wrap--wide {
  max-width: 100%;
}

.dash-chart-wrap canvas {
  max-height: 360px;
}

.dash-income-controls,
.dash-ops-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.field--inline {
  margin: 0;
  min-width: 8.5rem;
}

.field--inline .field-label {
  font-size: 0.65rem;
}

.dash-income-note {
  font-size: 0.75rem;
  margin-top: 0.75rem;
}

.dash-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}

.dash-holdings-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 0.5rem;
}

.dash-holdings-columns {
  border: none;
  margin: 0 0 0.5rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.dash-holdings-columns .field-label {
  margin: 0;
  padding: 0;
}

.dash-holdings-col-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  cursor: pointer;
}

.dash-cashflow-summary {
  margin: 0 0 0.75rem;
}

.dash-chart-note {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
}

.dash-holdings-note {
  margin: 0 0 0.75rem;
  max-width: 42rem;
}

.holdings-loading {
  margin: 1.5rem 0 2rem;
  padding: 2.5rem 1.5rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  text-align: center;
}

.holdings-loading__inner {
  max-width: 28rem;
  margin: 0 auto;
}

.holdings-loading__title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  margin: 0 0 0.5rem;
  letter-spacing: 0.04em;
}

.holdings-loading__hint {
  margin: 0 0 1.25rem;
  line-height: 1.45;
}

.holdings-loading__track {
  width: 100%;
  height: 0.5rem;
  margin: 0 auto 0.75rem;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.holdings-loading__bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.2s ease;
}

.holdings-loading__status {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
}


.dash-holdings-isin {
  display: block;
  font-size: 0.7rem;
  margin-top: 0.15rem;
}

.dash-holdings-table .num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.dash-holding-row {
  cursor: pointer;
}

.dash-holding-row:hover td {
  background: rgba(0, 0, 0, 0.04);
}

.dash-holding-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.dash-holding-link:hover {
  border-bottom-color: currentColor;
}

.dash-holding-back {
  margin: 0 0 0.75rem;
}

.dash-holding-back a {
  color: inherit;
  text-decoration: none;
}

.dash-holding-back a:hover {
  text-decoration: underline;
}

.dash-subheading {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

.dash-holding-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.35);
}

.dash-holding-stat {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 7rem;
}

.dash-holding-stat-label {
  font-size: 0.75rem;
  color: var(--muted, #666);
}

.dash-holding-stat-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.dash-holding-events-table {
  font-size: 0.8125rem;
}

.dash-holding-actions {
  margin: 0.75rem 0 1rem;
}

.dash-holdings-alert-cell {
  width: 5.5rem;
  text-align: right;
  white-space: nowrap;
}

.dash-holdings-alert-btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
}

.alert-create-lede {
  margin-bottom: 1rem;
}

.alert-create-current {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md, 8px);
  background: var(--surface-muted, rgba(0, 0, 0, 0.04));
}

.alert-create-current-label {
  font-size: 0.8125rem;
  color: var(--text-muted, #666);
}

.alert-create-current-value {
  font-size: 1.25rem;
  font-weight: 600;
}

.alert-create-types {
  border: none;
  padding: 0;
  margin: 0 0 1rem;
}

.alert-create-type {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.alert-create-fields {
  margin-bottom: 1rem;
}

.alert-create-range-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .alert-create-range-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.alert-create-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-top: 1.25rem;
}

.home-alerts-note {
  margin: 0 0 0.75rem;
}

.home-alert-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.home-alert-badge--watching {
  background: rgba(34, 139, 34, 0.12);
  color: #1f7a1f;
}

.home-alert-badge--triggered {
  background: rgba(200, 60, 40, 0.12);
  color: #b83220;
}

.home-alert-badge--unknown {
  background: rgba(120, 120, 120, 0.12);
  color: #666;
}

.home-alert-actions {
  text-align: right;
  white-space: nowrap;
}

.home-alert-delete {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

.home-alert-delete:hover {
  text-decoration: underline;
}

.dash-holding-charts {
  margin: 1rem 0 1.5rem;
}

.dash-holding-chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .dash-holding-chart-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.dash-chart-wrap--tall {
  min-height: 280px;
  position: relative;
}

.dash-chart-wrap--tall canvas {
  max-height: 280px;
}

.dash-chart-caption {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  text-align: center;
}

.dash-chart-wrap--fs-ready {
  position: relative;
}

.dash-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  min-height: 1.75rem;
}

.dash-chart-toolbar-title {
  font-size: 0.75rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-fullscreen-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.5);
  color: inherit;
  cursor: pointer;
  flex-shrink: 0;
}

.chart-fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.85);
}

.dash-chart-wrap:fullscreen,
.dash-chart-wrap.is-fullscreen {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 2rem 2rem;
  background: var(--bg, #f8f6f2);
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  overflow: auto;
}

.dash-chart-wrap:fullscreen canvas,
.dash-chart-wrap.is-fullscreen canvas {
  flex: 1 1 auto;
  width: 100% !important;
  max-height: none !important;
  min-height: 60vh;
}

.dash-chart-wrap:fullscreen .dash-chart-toolbar,
.dash-chart-wrap.is-fullscreen .dash-chart-toolbar {
  flex-shrink: 0;
}

.chart-fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
}

.chart-fullscreen-overlay__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 1400px;
  margin: auto;
  background: var(--bg, #f8f6f2);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  max-height: 100%;
}

.chart-fullscreen-overlay__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.chart-fullscreen-overlay__head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.chart-fullscreen-overlay__close {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.chart-fullscreen-overlay__body {
  flex: 1;
  padding: 1rem;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-fullscreen-overlay__body canvas {
  width: 100% !important;
  max-height: calc(100vh - 8rem);
}

body.chart-overlay-open {
  overflow: hidden;
}

.pnl-pos {
  color: #2d5a45;
}

.pnl-neg {
  color: #8b3a3a;
}

.dash-ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.dash-ops-table th,
.dash-ops-table td {
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--line);
}

.dash-ops-table th {
  font-weight: 500;
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
}

.dash-ops-table tbody tr:hover {
  background: var(--accent-soft);
}

.op-amt {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.op-event {
  text-transform: capitalize;
  font-size: 0.75rem;
}

.banks-dash {
  margin-bottom: 2.5rem;
}

.banks-dash-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}

.nav-pill--inline {
  margin: 0;
}

.bank-dash-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bank-dash-card {
  display: flex;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.4);
}

.bank-dash-name {
  margin: 0 0 0.35rem;
  font-weight: 500;
}

.bank-dash-meta {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  color: var(--muted);
}

.home-footer-nav {
  margin-top: 2rem;
}

.inline-action {
  margin: 0 0 0.8rem;
}

.onboarding-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}

.onboarding-footer {
  text-align: center;
}

@media (min-width: 640px) {
  .panel:not(.panel--portfolio):not(.panel--books):not(.panel--admin) {
    max-width: 24rem;
    padding: 3rem 2.75rem 2.75rem;
  }
  .panel--portfolio,
  .panel--books {
    max-width: 44rem;
    padding: 2.75rem 2.5rem;
  }
  .panel--admin {
    max-width: 40rem;
  }
}

/* —— App shell (persistent header, multi-page dashboard) —— */

.shell--app {
  max-width: 72rem;
  width: 100%;
  margin: 0 auto;
  min-height: 100vh;
  justify-content: flex-start;
  align-items: stretch;
  padding: 0 1.25rem 3rem;
  gap: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  padding: 1.5rem 0 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.app-header-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.app-header-logo {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.75rem, 12vw, 4.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--fg);
  margin: 0;
  padding-left: 0.28em;
}

.app-header-user {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

.app-header-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.4rem 0.5rem;
  width: 100%;
  max-width: 48rem;
}

.app-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  color: var(--muted);
  padding: 0.4rem 0.75rem;
  border-radius: 2px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.app-header-btn:hover {
  color: var(--fg);
  border-color: var(--line);
}

.app-header-btn.is-active {
  color: var(--fg);
  border-color: var(--line);
  background: var(--accent-soft);
}

.app-header-logout {
  display: inline-flex;
  margin: 0;
  padding: 0;
}

.app-main {
  width: 100%;
  flex: 1;
}

.dash-page-section {
  width: 100%;
}

.dash-page-lede {
  margin: 0 0 1rem;
  max-width: 40rem;
}

.dash-page-quicklinks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
}

.dash-charts-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  width: 100%;
}

.shell--app .dash-widget--split {
  width: 100%;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

@media (min-width: 900px) {
  .shell--app .dash-widget--split {
    width: calc(50% - 0.5rem);
    display: inline-block;
    vertical-align: top;
    margin-bottom: 2rem;
  }
}

/* —— Dark theme (pure black) —— */

[data-theme="dark"] {
  --bg: #000000;
  --fg: #f2f2f2;
  --muted: #a3a3a3;
  --line: #2a2a2a;
  --accent: #c9a962;
  --accent-soft: rgba(201, 169, 98, 0.15);
  --error-bg: #1a0a0a;
  --error-fg: #f0a8a0;
  --ok-bg: #0a1a10;
  --ok-fg: #8fd4a8;
}

[data-theme="dark"] body {
  background: #000000;
  background-image: none;
}

[data-theme="dark"] .panel,
[data-theme="dark"] .report-panel,
[data-theme="dark"] .dash-customize,
[data-theme="dark"] .dash-table-scroll,
[data-theme="dark"] .dash-widget,
[data-theme="dark"] .bank-dash-card,
[data-theme="dark"] .bank-card-body,
[data-theme="dark"] .wm-table th,
[data-theme="dark"] .wm-table td,
[data-theme="dark"] .dash-ops-table th,
[data-theme="dark"] .dash-ops-table td {
  background: #000000;
}

[data-theme="dark"] .dev-auth-banner {
  background: #1a1500;
  border-bottom-color: #3d3500;
  color: #f2f2f2;
}

[data-theme="dark"] .pnl-pos {
  color: #8fd4a8;
}

[data-theme="dark"] .pnl-neg {
  color: #f0a8a0;
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #000000;
  color: var(--fg);
  border-color: var(--line);
}

[data-theme="dark"] .btn-primary {
  background: var(--accent);
  color: #000000;
}

[data-theme="dark"] .btn-ghost {
  color: var(--fg);
  border-color: var(--line);
}

[data-theme="dark"] .btn-ghost:hover {
  background: #111111;
}

.home-main {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.home-briefing {
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.home-briefing-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.home-briefing-body p {
  margin: 0 0 0.85rem;
  line-height: 1.55;
  max-width: 72ch;
}

.home-briefing-body p:last-child {
  margin-bottom: 0;
}

.home-briefing-meta {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
}

.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.home-charts-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 900px) {
  .home-charts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-chart-widget:first-child:last-child,
  .home-chart-widget[data-home-chart="wealth_chart"],
  .home-chart-widget[data-home-chart="income_chart"] {
    grid-column: 1 / -1;
  }
}

.home-customize-legend {
  grid-column: 1 / -1;
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
}

.home-holdings-table th[data-sort]:hover {
  text-decoration: underline;
}

.home-custodians {
  margin-top: 0.5rem;
}

[data-theme="dark"] .home-briefing {
  background: rgba(255, 255, 255, 0.04);
}

/* Sandbox virtual portfolio */
.shell--sandbox .sandbox-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  padding: 0 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sandbox-subnav__link {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.sandbox-subnav__link:hover,
.sandbox-subnav__link.is-active {
  color: var(--text);
  background: var(--surface-elevated);
}

.sandbox-banner {
  margin: 0 1.25rem 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-elevated);
}

.sandbox-banner__title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.sandbox-banner__stats {
  margin: 0 0 0.25rem;
}

.sandbox-banner__note {
  margin: 0;
  font-size: 0.85rem;
}

.sandbox-search-results {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  max-height: 240px;
  overflow-y: auto;
}

.sandbox-search-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.sandbox-search-item:hover {
  background: var(--surface-elevated);
}

.sandbox-preview__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.sandbox-preview__last {
  font-size: 1.35rem;
  font-weight: 600;
}

.sandbox-change--up {
  color: #3d7a5c;
}

.sandbox-change--down {
  color: #a64b4b;
}

.sandbox-indicators {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 0.5rem 1rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.sandbox-indicators dt {
  font-weight: 600;
  margin: 0;
}

.sandbox-indicators dd {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
}

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

.sandbox-sell-form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.sandbox-sell-qty {
  width: 4.5rem;
  font-size: 0.85rem;
}

.sandbox-reset-form {
  margin-top: 1.5rem;
}
