:root {
  --bg: #f6f4ec;
  --card: #fffef9;
  --soft: #eeefe5;
  --ink: #273d33;
  --muted: #677369;
  --line: #dce1d3;
  --green: #315c46;
  --green-soft: #e1ebdd;
  --gold: #b39855;
  --red: #a35745;
  --blue: #658a8b;
  --sidebar: #244e40;
  --shadow: 0 7px 28px #263f2d08;
  --radius: 20px;
  --chart-1: #567d5a;
  --chart-2: #bda369;
  --chart-3: #8baca3;
  --chart-4: #c6856c;
  --chart-5: #6b879b;
  --chart-6: #a5ad7d;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #202a24;
  --card: #29372e;
  --soft: #334137;
  --ink: #edf0e3;
  --muted: #b4c0b2;
  --line: #48574a;
  --green: #b4c99b;
  --green-soft: #3e503e;
  --gold: #d2b77d;
  --red: #e0a28a;
  --blue: #9ebdbc;
  --sidebar: #1c3026;
  --shadow: none;
  --chart-1: #adc792;
  --chart-2: #d0b479;
  --chart-3: #91b6ab;
  --chart-4: #dea38b;
  --chart-5: #9bb8cc;
  --chart-6: #c5cca6;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: wait;
  opacity: 0.55;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}
a {
  color: var(--green);
}
.skip {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 1000;
  background: var(--card);
  padding: 12px;
}
.skip:focus {
  top: 10px;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 238px;
  background: var(--sidebar);
  color: #f3f3e7;
  display: flex;
  flex-direction: column;
  padding: 30px 18px 18px;
  z-index: 20;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 28px;
}
.brand img {
  width: 48px;
  height: 48px;
}
.brand b {
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 500;
  letter-spacing: 0.12em;
}
.brand small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.08em;
  opacity: 0.7;
}
.nav-group {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #b2c8b7;
  padding: 20px 15px 8px;
}
.nav-item {
  border: 0;
  background: transparent;
  color: #dbe7dc;
  text-align: left;
  width: 100%;
  padding: 12px 14px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 46px;
  margin: 3px 0;
  font-weight: 500;
}
.nav-item svg {
  width: 20px;
  height: 20px;
  flex: none;
  stroke-width: 1.6;
}
.nav-item:hover {
  background: #ffffff0b;
}
.nav-item.active {
  background: #e2eadb;
  color: #254c3a;
}
.sidebar-foot {
  margin-top: auto;
  padding: 22px 12px 0;
  color: #bdd0bf;
  font-size: 11px;
}
.sidebar-foot .dot {
  background: #b5cb9b;
  width: 6px;
  height: 6px;
  display: inline-block;
  border-radius: 50%;
  margin-right: 6px;
}
.workspace {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  height: 82px;
  border-bottom: 1px solid var(--line);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.breadcrumb {
  font-size: 13px;
  color: var(--muted);
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}
.icon-btn,
.lang-btn {
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 39px;
  height: 39px;
  display: inline-grid;
  place-items: center;
  background: var(--card);
  color: var(--ink);
}
.lang-btn {
  border-radius: 12px;
  width: 47px;
  font-weight: 700;
  font-size: 12px;
}
.icon-btn svg {
  width: 19px;
  height: 19px;
}
.mobile-brand {
  display: none;
}
.main {
  padding: 34px 40px 54px;
  max-width: 1740px;
  margin: auto;
  min-width: 0;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  margin-bottom: 6px;
}
h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.03em;
  font-size: 36px;
  line-height: 1.2;
  margin: 0 0 9px;
}
h2 {
  font-size: 17px;
  line-height: 1.4;
  margin: 0;
  font-weight: 650;
}
h3 {
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 12px;
  font-weight: 650;
}
p {
  margin: 8px 0;
}
.subtitle,
.muted {
  color: var(--muted);
}
.subtitle {
  max-width: 700px;
  font-size: 13px;
}
.btn {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
  color: var(--ink);
  padding: 10px 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 12px;
  min-height: 40px;
  text-decoration: none;
  white-space: normal;
}
.btn:hover {
  background: var(--soft);
}
.btn.primary {
  background: var(--green);
  border-color: var(--green);
  color: var(--card);
}
:root[data-theme="dark"] .btn.primary {
  color: #223b2d;
}
.btn.danger {
  color: var(--red);
  background: transparent;
}
.btn.small {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}
.btn svg {
  width: 16px;
  height: 16px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 23px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 19px;
}
.card-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 14px;
}
.section {
  margin-top: 22px;
}
.grid {
  display: grid;
  gap: 18px;
}
.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid.wide {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin-bottom: 23px;
}
.metric {
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  min-width: 0;
}
.metric-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
  display: flex;
  gap: 8px;
  align-items: center;
}
.metric-value {
  font-size: 26px;
  letter-spacing: -0.04em;
  font-weight: 600;
  margin-top: 9px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.metric-note {
  font-size: 10px;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.5;
}
.metric.highlight {
  background: var(--green-soft);
  border-color: #c1d2b8;
}
.positive {
  color: var(--green);
}
.negative {
  color: var(--red);
}
.badge {
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 7px;
  color: var(--green);
  background: var(--green-soft);
  white-space: nowrap;
}
.badge.amber {
  color: #8c703c;
  background: #eee5d3;
}
.badge.red {
  color: var(--red);
  background: #f5e8e1;
}
:root[data-theme="dark"] .badge.red {
  background: #503d33;
}
:root[data-theme="dark"] .badge.amber {
  background: #514a34;
  color: #edcf93;
}
.hero {
  background: linear-gradient(115deg, var(--green-soft), var(--card));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  padding: 28px;
  border-radius: 20px;
  border: 1px solid var(--line);
  margin-bottom: 23px;
}
.hero h2 {
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 500;
}
.hero p {
  color: var(--muted);
  max-width: 650px;
  font-size: 13px;
}
.hero-logo {
  width: 70px;
  height: 70px;
  flex: none;
}
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-width: 100%;
  padding: 4px 0 16px;
}
.tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 9px 14px;
  border-radius: 10px;
  white-space: nowrap;
  min-height: 38px;
}
.tab.active {
  background: var(--green-soft);
  color: var(--green);
  font-weight: 650;
}
.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  background: var(--card);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  margin: 0 0 20px;
}
.filters label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filters input,
.filters select {
  padding: 8px 10px;
  min-height: 38px;
  font-size: 12px;
}
.filters .filter-wide {
  grid-column: span 2;
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 6px;
  font-weight: 500;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--ink);
  min-height: 42px;
}
input[type="checkbox"] {
  width: 17px;
  height: 17px;
  min-height: 0;
  display: inline-block;
  accent-color: var(--green);
}
input[type="color"] {
  padding: 2px;
}
.required {
  color: var(--red);
  font-weight: 800;
  margin-left: 3px;
}
.field-help {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
  margin: 5px 0 0;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field-row.three {
  grid-template-columns: repeat(3, 1fr);
}
.table-wrap {
  overflow: auto;
  max-height: 560px;
  border-radius: 10px;
  max-width: 100%;
  overscroll-behavior: contain;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
th {
  text-align: left;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  position: sticky;
  top: 0;
  background: var(--soft);
  z-index: 1;
  font-weight: 600;
}
th,
td {
  padding: 12px 11px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
td:first-child {
  min-width: 110px;
}
td.num,
th.num {
  text-align: right;
  white-space: nowrap;
}
td small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
  max-width: 240px;
}
td .actions {
  flex-wrap: nowrap;
}
.empty {
  padding: 35px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.empty strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 6px;
}
.banner {
  border: 1px solid #d7c398;
  background: #f0e8d8;
  color: #705d37;
  padding: 13px 17px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.6;
  margin: 0 0 18px;
}
:root[data-theme="dark"] .banner {
  background: #4a4332;
  color: #eedba8;
  border-color: #7c7053;
}
.chart-box {
  min-height: 260px;
  position: relative;
}
.chart {
  width: 100%;
  height: auto;
  display: block;
  min-width: 0;
  overflow: visible;
}
.chart text {
  font-family: inherit;
  fill: var(--muted);
  font-size: 12px;
}
.chart .axis-label {
  font-size: 11px;
}
.chart .bar:hover,
.chart .slice:hover {
  opacity: 0.8;
  filter: brightness(0.98);
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 10px;
}
.chart-legend i {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 3px;
  margin-right: 5px;
}
.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.chart-controls select {
  font-size: 11px;
  padding: 6px 9px;
  min-height: 32px;
  width: auto;
  max-width: 100%;
}
.chart-tooltip {
  position: fixed;
  z-index: 1200;
  padding: 9px 13px;
  background: var(--ink);
  color: var(--card);
  font-size: 11px;
  border-radius: 9px;
  pointer-events: none;
  max-width: 260px;
  box-shadow: 0 7px 20px #0002;
  white-space: pre-line;
}
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child {
  border-bottom: 0;
}
.list-row .title {
  font-size: 12px;
  font-weight: 600;
}
.list-row small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.progress {
  height: 7px;
  border-radius: 8px;
  background: var(--soft);
  overflow: hidden;
  margin: 12px 0;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: 8px;
}
.amount {
  font-variant-numeric: tabular-nums;
}
.goal-value {
  font-size: 23px;
  font-weight: 600;
  margin-top: 14px;
}
.footer {
  display: flex;
  gap: 15px;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 30px;
  font-size: 10px;
  color: var(--muted);
}
dialog {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 23px;
  padding: 0;
  width: min(810px, calc(100vw - 28px));
  max-height: 90dvh;
  box-shadow: 0 24px 90px #18322530;
}
dialog::backdrop {
  background: #192c25a8;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 27px 14px;
}
.dialog-head h2 {
  font-family: Georgia, serif;
  font-weight: 500;
  font-size: 24px;
}
.dialog-body {
  padding: 0 27px 20px;
}
.dialog-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 18px;
}
.dialog-fields .full {
  grid-column: 1/-1;
}
.dialog-foot {
  position: sticky;
  bottom: 0;
  padding: 16px 27px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--card);
  border-top: 1px solid var(--line);
  z-index: 3;
}
.form-error {
  color: var(--red);
  font-size: 12px;
  padding: 12px 0;
  white-space: pre-line;
}
.help-copy {
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-line;
}
.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.check-grid label {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--soft);
  padding: 11px;
  border-radius: 9px;
  margin: 0;
  font-size: 12px;
}
.pill-note {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  display: inline-block;
}
.mini-select {
  display: flex;
  gap: 5px;
}
.mini-select button {
  padding: 5px 8px;
}
.allocation-input {
  max-width: 110px;
  margin-left: auto;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 12px;
}
.setup-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 140px 40px;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.setup-row small {
  display: block;
  color: var(--muted);
}
.setup-row input {
  min-height: 38px;
  text-align: right;
}
.source-text {
  font-family: ui-monospace, monospace;
  font-size: 10px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 600px;
}
.icon-inline {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: middle;
}
.security-note {
  display: flex;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.mobile-nav {
  display: none;
}
#toasts {
  position: fixed;
  bottom: 20px;
  right: 22px;
  z-index: 1400;
  display: grid;
  gap: 8px;
  max-width: min(420px, calc(100vw - 32px));
}
.toast {
  padding: 13px 17px;
  background: var(--sidebar);
  color: #f4f4e8;
  border-radius: 13px;
  font-size: 12px;
  box-shadow: 0 6px 24px #0002;
  display: flex;
  gap: 15px;
  align-items: center;
}
.toast.error {
  background: #875041;
}
.toast button {
  color: inherit;
  background: none;
  border: 0;
  font-size: 18px;
}
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--green);
  text-decoration: underline;
  font: inherit;
}
.status-list {
  display: grid;
  gap: 10px;
}
.status-item {
  padding: 12px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 12px;
}
.status-item strong {
  display: block;
  font-size: 12px;
  margin-bottom: 3px;
}
.split-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.details-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.details-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.collapse {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 15px;
  margin-top: 15px;
}
.collapse summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.collapse .field-row {
  margin-top: 10px;
}
.trade-look {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.trade-look label {
  font-size: 11px;
}
.trade-look input {
  min-height: 36px;
}
.close-btn {
  border: 0;
  background: var(--soft);
  color: var(--ink);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  font-size: 21px;
}
.tag-input {
  margin-top: 5px;
}
.screen-note {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11px;
}
.goal-card .card-head {
  margin-bottom: 8px;
}
@media (min-width: 1700px) {
  .main {
    padding: 40px 55px;
  }
}
@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 202px minmax(0, 1fr);
  }
  .sidebar {
    width: 202px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .brand {
    gap: 8px;
  }
  .brand b {
    font-size: 22px;
  }
  .brand img {
    width: 40px;
    height: 40px;
  }
  .main {
    padding: 28px;
  }
  .topbar {
    padding: 0 28px;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid.wide {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    display: none;
  }
  .workspace {
    width: 100%;
    min-width: 0;
  }
  .topbar {
    height: 68px;
    padding: 0 18px;
    background: var(--card);
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .breadcrumb {
    display: none;
  }
  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 9px;
  }
  .mobile-brand img {
    width: 34px;
    height: 34px;
  }
  .mobile-brand b {
    font:
      20px Georgia,
      serif;
    letter-spacing: 0.1em;
  }
  .top-actions {
    gap: 7px;
  }
  .top-actions .today-label {
    display: none;
  }
  .lang-btn,
  .icon-btn {
    width: 35px;
    height: 35px;
  }
  .lang-btn {
    font-size: 11px;
  }
  .main {
    padding: 23px 16px calc(104px + env(safe-area-inset-bottom));
  }
  .page-head {
    gap: 12px;
    margin-bottom: 20px;
  }
  .page-head h1 {
    font-size: 29px;
  }
  .page-head .actions {
    justify-content: flex-end;
    max-width: 135px;
  }
  .page-head .actions .btn {
    font-size: 11px;
    padding: 8px 10px;
    min-height: 38px;
  }
  .eyebrow {
    font-size: 9px;
  }
  .subtitle {
    font-size: 12px;
  }
  .metrics {
    gap: 10px;
    margin-bottom: 17px;
  }
  .metric {
    padding: 16px 13px;
    border-radius: 14px;
  }
  .metric-value {
    font-size: 23px;
  }
  .metric-label {
    font-size: 10px;
  }
  .metric-note {
    font-size: 9px;
  }
  .grid,
  .grid.two,
  .grid.three,
  .grid.wide {
    grid-template-columns: minmax(0, 1fr);
    gap: 15px;
  }
  .card {
    padding: 18px;
    border-radius: 17px;
  }
  .card-head {
    margin-bottom: 14px;
  }
  .card h2 {
    font-size: 15px;
  }
  .hero {
    padding: 20px;
    gap: 15px;
    align-items: flex-start;
  }
  .hero h2 {
    font-size: 23px;
  }
  .hero .hero-logo {
    display: none;
  }
  .hero p {
    font-size: 12px;
  }
  .hero .actions {
    margin-top: 12px;
  }
  .hero {
    display: block;
  }
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 13px;
    gap: 8px;
  }
  .filters label {
    font-size: 9px;
    margin-top: 5px;
  }
  .filters input,
  .filters select {
    font-size: 16px;
    padding: 8px;
    min-height: 42px;
  }
  .filters .filter-wide {
    grid-column: span 2;
  }
  .field-row,
  .field-row.three {
    grid-template-columns: 1fr;
  }
  .dialog-fields {
    grid-template-columns: minmax(0, 1fr);
  }
  .dialog-fields .full {
    grid-column: auto;
  }
  .dialog-head {
    padding: 20px 20px 10px;
  }
  .dialog-body {
    padding: 0 20px 18px;
  }
  .dialog-head h2 {
    font-size: 23px;
  }
  .dialog-foot {
    padding: 14px 20px;
  }
  .dialog-foot .btn {
    min-height: 43px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
    min-height: 45px;
  }
  .btn {
    min-height: 43px;
  }
  .btn.small {
    min-height: 35px;
    font-size: 11px;
  }
  .check-grid {
    grid-template-columns: 1fr;
  }
  .table-wrap {
    max-height: 470px;
  }
  th,
  td {
    padding: 11px 9px;
  }
  th {
    font-size: 9px;
  }
  table {
    font-size: 11px;
  }
  .chart-box {
    min-height: 210px;
  }
  .chart-legend {
    gap: 10px;
    font-size: 9px;
  }
  .chart-controls {
    gap: 6px;
  }
  .chart-controls select {
    font-size: 12px;
    min-height: 35px;
  }
  .footer {
    display: block;
    font-size: 10px;
  }
  .footer span {
    display: block;
    margin-top: 5px;
  }
  .mobile-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card);
    border-top: 1px solid var(--line);
    z-index: 40;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -3px 20px #263f2d06;
  }
  .mobile-nav button {
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 9px;
    padding: 6px 2px;
    min-height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    border-radius: 10px;
  }
  .mobile-nav button.active {
    background: var(--green-soft);
    color: var(--green);
  }
  .mobile-nav svg {
    width: 19px;
    height: 19px;
  }
  .setup-row {
    grid-template-columns: minmax(110px, 1fr) 110px 33px;
    gap: 8px;
    font-size: 11px;
  }
  .setup-row input {
    font-size: 16px;
    padding: 7px;
  }
  #toasts {
    bottom: 90px;
    right: 16px;
  }
  .trade-look {
    grid-template-columns: repeat(2, 1fr);
  }
  .tabs {
    padding-bottom: 15px;
  }
  .tab {
    font-size: 12px;
    padding: 8px 11px;
  }
  .help-copy {
    font-size: 12px;
  }
  .chart-tooltip {
    max-width: 230px;
  }
  .allocation-input {
    font-size: 16px;
    min-height: 40px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .card,
  .metric {
    animation: appear 0.2s ease-out;
  }
  @keyframes appear {
    from {
      opacity: 0.75;
      transform: translateY(3px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}
@media print {
  .sidebar,
  .topbar,
  .mobile-nav,
  .actions,
  .filters,
  .tabs,
  #toasts {
    display: none !important;
  }
  .shell {
    display: block;
  }
  .workspace {
    display: block;
  }
  .main {
    padding: 0;
  }
  .card {
    box-shadow: none;
    break-inside: avoid;
  }
  .table-wrap {
    max-height: none;
    overflow: visible;
  }
  body {
    background: white;
  }
  .footer {
    display: none;
  }
  th {
    position: static;
  }
  .metrics {
    grid-template-columns: repeat(4, 1fr);
  }
}
/* Personal Finance Hub identity and legal notice */
.brand {
  gap: 10px;
  padding-left: 2px;
  padding-right: 2px;
}
.brand img {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
.brand b {
  display: block;
  font-family: Georgia, serif;
  font-size: 20px;
  line-height: 1.14;
  letter-spacing: -0.025em;
  font-weight: 500;
}
.brand small {
  font-size: 7.5px;
  letter-spacing: 0.09em;
  margin-top: 7px;
  line-height: 1.6;
}
.brand-tm {
  font-family: Arial, sans-serif;
  font-size: 9px;
  vertical-align: super;
  letter-spacing: 0;
  margin-left: 2px;
}
.legal-link {
  border: 0;
  background: none;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
.legal-link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}
.legal-card {
  max-width: 1050px;
}
.legal-card p {
  font-size: 14px;
  line-height: 1.85;
  color: var(--muted);
  margin: 15px 0;
}
.legal-card h3 {
  margin-top: 28px;
}
.legal-card li {
  margin: 12px 0;
  line-height: 1.65;
}
.legal-card a {
  color: var(--green);
  text-underline-offset: 3px;
}
@media (max-width: 1180px) and (min-width: 761px) {
  .brand b {
    font-size: 17px;
  }
  .brand img {
    width: 43px;
    height: 43px;
  }
  .brand small {
    font-size: 6px;
  }
}
@media (max-width: 760px) {
  .mobile-brand {
    min-width: 0;
    gap: 7px;
  }
  .mobile-brand img {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }
  .mobile-brand b {
    font-size: 15px;
    line-height: 1.15;
    letter-spacing: -0.03em;
    max-width: 145px;
  }
  .brand-tm {
    font-size: 7px;
  }
  .top-actions {
    gap: 5px;
  }
  .legal-card p {
    font-size: 13px;
  }
  .footer {
    gap: 12px;
  }
}
.legal-card .card-head {
  flex-wrap: wrap;
}
.legal-card .badge {
  max-width: 100%;
  white-space: normal;
}
/* Personal Finance Hub 5.0 — interface rhythm, readability and interaction. */
:root {
  --muted: #5d695f;
  --gold: #987b3f;
  --control-line: #879580;
  --chart-2: #9b7d3e;
  --chart-3: #60867b;
  --chart-4: #b57860;
  --chart-6: #7b8756;
}
:root[data-theme="dark"] {
  --muted: #b4c0b2;
  --gold: #d2b77d;
  --control-line: #82927d;
  --chart-2: #d0b479;
  --chart-3: #91b6ab;
  --chart-4: #dea38b;
  --chart-6: #c5cca6;
}
[hidden] {
  display: none !important;
}
.sidebar {
  overflow-y: auto;
  scrollbar-width: thin;
}
.sidebar > * {
  flex-shrink: 0;
}
.ledger-scopes {
  margin: 0 0 22px;
  padding: 2px 0;
  gap: 10px;
}
.main > .card + .card:not(.section),
.main > .grid + .card:not(.section),
.main > .card + .grid:not(.section),
.main > .grid + .grid:not(.section) {
  margin-top: 24px;
}
.main > .page-head + .actions {
  margin-top: 0;
}
.page-head > :first-child {
  min-width: 0;
  flex: 1;
}
.page-head > .actions {
  flex-shrink: 0;
  max-width: 42%;
}
.card-head {
  flex-wrap: wrap;
}
.card-head > * {
  min-width: 0;
  max-width: 100%;
}
.card-head > .actions {
  margin-left: auto;
}
.card-note,
.field-help {
  font-size: 12px;
  line-height: 1.7;
}
.metric-label {
  font-size: 12px;
  line-height: 1.5;
}
.metric-note,
td small,
.list-row small {
  font-size: 11px;
  line-height: 1.55;
}
.chart-legend {
  font-size: 11px;
  gap: 10px 16px;
  line-height: 1.6;
}
.chart-legend span {
  display: inline-flex;
  align-items: baseline;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.chart-legend i {
  flex: 0 0 8px;
}
.chart-box {
  min-height: 0;
}
.chart {
  overflow: visible;
}
.chart-tooltip {
  max-width: min(320px, calc(100vw - 24px));
}
.btn,
.icon-btn,
.lang-btn,
.tab {
  transition:
    background-color 0.12s,
    border-color 0.12s,
    box-shadow 0.12s;
}
.btn.primary:hover:not(:disabled) {
  filter: brightness(0.96);
}
.btn:focus-visible,
.tab:focus-visible,
.icon-btn:focus-visible,
.lang-btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.badge.amber {
  color: #725a30;
}
:root[data-theme="dark"] .badge.amber {
  color: #edcf93;
}
input,
select,
textarea {
  border-color: var(--control-line);
}
input[readonly],
textarea[readonly] {
  background: var(--soft);
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
.table-wrap {
  overscroll-behavior-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--control-line) var(--soft);
  max-height: min(560px, 70dvh);
}
.table-wrap:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
.table-scroll-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
  padding: 2px 0 10px;
}
.numeric-cell {
  text-align: right;
  white-space: nowrap;
}
th {
  line-height: 1.55;
}
th,
td {
  min-width: 110px;
  overflow-wrap: normal;
}
td .actions .btn {
  white-space: nowrap;
}
.tabs {
  scrollbar-width: thin;
  scroll-padding-inline: 6px;
}
.tab {
  flex-shrink: 0;
}
body:has(dialog[open]) {
  overflow: hidden;
}
dialog[open] {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100dvh - 32px);
}
.dialog-head {
  flex: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
.dialog-head h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.close-btn {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
}
#editorForm {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.dialog-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  flex: 1 1 auto;
  padding-top: 8px;
}
.dialog-head + .dialog-body {
  padding-top: 18px;
}
.dialog-foot {
  position: static;
  flex: none;
  flex-wrap: wrap;
}
.form-error:empty {
  display: none;
}
.form-error:not(:empty) {
  border-top: 1px solid var(--line);
  background: var(--soft);
  line-height: 1.6;
}
#editorForm > .form-error:not(:empty) {
  padding: 12px 27px;
  max-height: 24dvh;
  overflow: auto;
  flex: none;
}
.dialog-fields > div {
  min-width: 0;
}
.help-copy {
  overflow-wrap: anywhere;
}
.toast {
  line-height: 1.6;
}
.toast button {
  min-width: 32px;
  min-height: 32px;
  flex-shrink: 0;
}
@media (max-height: 780px) and (min-width: 761px) {
  .sidebar {
    padding-top: 18px;
  }
  .brand {
    padding-bottom: 14px;
  }
  .nav-group {
    padding-top: 12px;
  }
  .sidebar-foot {
    padding-top: 14px;
  }
}
@media (max-width: 760px) {
  .topbar {
    padding-inline: 14px;
    gap: 8px;
  }
  .top-actions {
    gap: 5px;
    flex-shrink: 0;
  }
  .icon-btn,
  .lang-btn {
    width: 40px;
    height: 40px;
  }
  .mobile-brand {
    flex: 1;
    min-width: 0;
  }
  .mobile-brand b {
    max-width: 145px;
  }
  .page-head {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .page-head > .actions {
    max-width: 100%;
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }
  .page-head > .actions .btn {
    min-height: 44px;
    font-size: 12px;
    padding: 10px 13px;
  }
  .page-head h1 {
    font-size: 30px;
    line-height: 1.15;
  }
  .subtitle {
    font-size: 13px;
    line-height: 1.65;
  }
  .ledger-scopes {
    margin-bottom: 20px;
    gap: 8px;
  }
  .ledger-scopes .btn {
    flex: 0 1 auto;
  }
  .btn.small {
    min-height: 42px;
    font-size: 12px;
  }
  .tab {
    min-height: 44px;
  }
  .chart-controls select,
  .mini-select button {
    min-height: 44px;
    font-size: 13px;
  }
  .card-note,
  .field-help {
    font-size: 12px;
  }
  .metric-label {
    font-size: 11px;
  }
  .metric-note {
    font-size: 11px;
  }
  .metric-value {
    font-size: clamp(20px, 5.6vw, 23px);
  }
  .chart-legend {
    font-size: 11px;
    gap: 9px 14px;
  }
  .filters {
    gap: 10px;
  }
  .filters label {
    font-size: 10px;
  }
  .table-wrap {
    max-height: min(470px, 65dvh);
  }
  table {
    font-size: 12px;
  }
  th {
    font-size: 10px;
  }
  td small {
    font-size: 11px;
  }
  td .actions .btn {
    min-height: 42px;
  }
  dialog {
    width: calc(100vw - 24px);
    border-radius: 18px;
  }
  dialog[open] {
    max-height: calc(100dvh - 24px);
  }
  .dialog-head {
    padding: 18px 18px 14px;
    gap: 12px;
  }
  .dialog-head h2 {
    font-size: 22px;
    line-height: 1.3;
  }
  .close-btn {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
  }
  .dialog-body {
    padding: 6px 18px 18px;
  }
  .dialog-head + .dialog-body {
    padding-top: 16px;
  }
  .dialog-foot {
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  }
  .dialog-foot .btn {
    min-height: 44px;
  }
  #editorForm > .form-error:not(:empty) {
    padding: 10px 18px;
  }
  .help-copy {
    font-size: 13px;
    line-height: 1.8;
  }
  .footer {
    font-size: 11px;
    line-height: 1.7;
  }
  .mobile-nav button {
    font-size: 10px;
    min-height: 48px;
  }
  #toasts {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }
  .toast button {
    min-width: 40px;
    min-height: 40px;
  }
}
@media (max-width: 360px) {
  .topbar {
    padding-inline: 12px;
  }
  .mobile-brand img {
    width: 32px;
    height: 32px;
  }
  .mobile-brand b {
    font-size: 14px;
    max-width: 110px;
  }
  .icon-btn,
  .lang-btn {
    width: 36px;
    height: 40px;
  }
  .page-head h1 {
    font-size: 27px;
  }
  .metrics {
    grid-template-columns: minmax(0, 1fr);
  }
  .metric-value {
    font-size: 25px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media print {
  .table-scroll-hint {
    display: none !important;
  }
  dialog[open] {
    display: none;
  }
}
.control-inline-label {
  margin: 0;
  font-size: 12px;
}
/* Version 6: contextual financial definitions and aggregate portfolio panels. */
.metric-label {display:flex;align-items:flex-start;justify-content:space-between;gap:8px;}
.metric-label > span {min-width:0;}
.info-dot {display:inline-flex;align-items:center;justify-content:center;flex:0 0 26px;width:26px;height:26px;min-width:26px;padding:0;margin:0 0 0 5px;border:1px solid var(--control-line);border-radius:50%;background:var(--card);color:var(--green);font:italic 600 15px Georgia,serif;line-height:1;vertical-align:middle;text-transform:none;letter-spacing:normal;cursor:pointer;}
.info-dot:hover {background:var(--green-soft);border-color:var(--green);}
.info-dot:focus-visible {outline:2px solid var(--gold);outline-offset:3px;}
.metric-label .info-dot {margin-left:0;}
.field-label-row {display:flex;align-items:center;gap:6px;margin-bottom:7px;}
.field-label-row label {margin:0;min-width:0;}
.chart-information {display:flex;justify-content:flex-end;margin:6px 0 0;}
.chart-information .info-dot {width:26px;height:26px;}
.portfolio-risk > .metrics,.market-benchmark > .metrics {margin:20px 0;}
.market-benchmark .field-row {align-items:end;}
#benchmark-ticker {text-transform:uppercase;}
#metricDialog {max-width:650px;}
#metricDialog .help-copy {line-height:1.8;font-size:14px;}
@media (max-width:700px) {.info-dot {flex-basis:32px;width:32px;height:32px;min-width:32px;} .metric-label {gap:6px;} .market-benchmark .field-row {grid-template-columns:1fr;} .market-benchmark .actions .btn {width:100%;}}
@media print {.info-dot,.chart-information {display:none;}}

/* Income statement only: uniform rows and a shared alignment for period headers and values. */
.income-statement .table-wrap table {
  width: max-content;
  min-width: 100%;
  table-layout: auto;
}
.income-statement .table-wrap th,
.income-statement .table-wrap td {
  box-sizing: border-box;
  height: 52px;
  padding: 8px 14px;
  line-height: 24px;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  vertical-align: middle;
}
.income-statement .table-wrap th:first-child,
.income-statement .table-wrap td:first-child {
  min-width: 350px;
  text-align: left;
}
.income-statement .table-wrap th:not(:first-child),
.income-statement .table-wrap td:not(:first-child) {
  min-width: 132px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.income-statement .table-wrap .info-dot {
  vertical-align: middle;
}
@media (min-width: 1024px) {
  .income-statement .table-wrap th:first-child,
  .income-statement .table-wrap td:first-child {
    position: sticky;
    left: 0;
    background: var(--card);
    box-shadow: 1px 0 0 var(--line);
    z-index: 2;
  }
  .income-statement .table-wrap th:first-child {
    background: var(--soft);
    z-index: 3;
  }
}
@media (max-width: 700px) {
  .income-statement .table-wrap th,
  .income-statement .table-wrap td {
    height: 56px;
  }
}
/* The generated mark shares the rounded silhouette of the installed app icon. */
.brand img,
.mobile-brand img,
.hero-logo {
  border-radius: 24%;
}
.income-statement .table-wrap table {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
/* Device synchronisation is scoped to its Settings tab. */
#syncPanel .sync-setup {padding-left:22px;line-height:1.8;}
#syncPanel .sync-setup li {margin:10px 0;}
#syncPanel .sync-check {display:flex;align-items:flex-start;gap:10px;text-transform:none;letter-spacing:normal;line-height:1.7;margin:14px 0;}
#syncPanel .sync-check input {width:18px;min-width:18px;height:18px;min-height:18px;margin:4px 0 0;flex:none;}
#syncPanel .sync-check span {min-width:0;overflow-wrap:anywhere;}
#syncPanel .sync-conflict {min-width:0;border:1px solid var(--line);border-radius:12px;padding:14px 18px;margin:16px 0;}
#syncPanel .sync-conflict legend {padding:0 7px;font-weight:600;max-width:100%;overflow-wrap:anywhere;}
#syncPanel .sync-reconcile {border-top:1px solid var(--line);padding-top:20px;}
#syncPanel .sync-reconcile .grid>div {min-width:0;}
#syncPanel .sync-reconcile p,#syncPanel code {overflow-wrap:anywhere;}
#syncPanel #sync-generated {font-family:ui-monospace,monospace;}
#syncPanel .form-error {line-height:1.7;}
@media (max-width:700px){#syncPanel .field-row,#syncPanel .grid.two {grid-template-columns:1fr;}#syncPanel .actions .btn {white-space:normal;}#syncPanel .card-head .badge {white-space:normal;}}
