:root {
  color-scheme: light;
  --bg: #f3f6f4;
  --surface: #fbfaf6;
  --surface-strong: #ffffff;
  --ink: #14211d;
  --muted: #69736e;
  --muted-strong: #4f5e57;
  --line: #d9ddd7;
  --jpy: #2f8f6b;
  --jpy-dark: #1f684d;
  --jpy-soft: #eaf5ef;
  --usd: #3f78c5;
  --usd-dark: #285a9f;
  --usd-soft: #eaf2fc;
  --cny: #c94e47;
  --cny-dark: #963630;
  --cny-soft: #fbeceb;
  --green: var(--jpy-dark);
  --green-dark: var(--jpy-dark);
  --green-soft: var(--jpy-soft);
  --amber: #c98a2d;
  --amber-soft: #f4e8d3;
  --red: var(--cny);
  --red-soft: var(--cny-soft);
  --blue: var(--usd);
  --purple: #75688f;
  --shadow: 0 18px 50px rgba(26, 42, 35, 0.08);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 12px;
  --page: min(1240px, calc(100vw - 48px));
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 5% 0%, rgba(47, 143, 107, 0.15), transparent 26rem),
    radial-gradient(circle at 54% -8%, rgba(63, 120, 197, 0.13), transparent 31rem),
    radial-gradient(circle at 98% 2%, rgba(201, 78, 71, 0.12), transparent 27rem),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

button,
select {
  font: inherit;
}

button {
  color: inherit;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  color: white;
  background: var(--ink);
}

.skip-link:focus {
  top: 16px;
}

.site-header,
main,
footer {
  width: var(--page);
  margin-inline: auto;
}

.site-header {
  height: 98px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--ink);
  color: #f7f5ee;
  font-weight: 750;
  box-shadow: 0 9px 22px rgba(20, 33, 29, 0.2);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  letter-spacing: 0.03em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.64rem;
  letter-spacing: 0.2em;
}

.header-actions,
.hero-actions,
.card-label-row,
.section-heading,
.positions-heading {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 14px;
}

.public-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
}

.public-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px var(--green-soft);
}

.currency-switcher {
  display: flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.58);
}

.currency-switcher button,
.position-tabs button {
  border: 0;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

.currency-switcher button {
  padding: 7px 10px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.currency-switcher button[aria-pressed="true"] {
  color: white;
}

.currency-switcher button[data-currency="JPY"][aria-pressed="true"] {
  background: var(--jpy-dark);
}

.currency-switcher button[data-currency="USD"][aria-pressed="true"] {
  background: var(--usd-dark);
}

.currency-switcher button[data-currency="CNY"][aria-pressed="true"] {
  background: var(--cny-dark);
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  min-height: 238px;
  padding: 54px 0 42px;
  border-top: 1px solid rgba(20, 33, 29, 0.12);
}

.hero-copy {
  max-width: 770px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.2em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(2.5rem, 5.2vw, 5rem);
  font-weight: 680;
  letter-spacing: -0.058em;
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: 1.45rem;
  letter-spacing: -0.025em;
}

.hero-description {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.75;
}

.hero-actions {
  flex-shrink: 0;
  gap: 10px;
  padding-bottom: 4px;
}

.button {
  min-height: 44px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:focus-visible,
.currency-switcher button:focus-visible,
.position-tabs button:focus-visible,
.dialog-close:focus-visible {
  outline: 3px solid rgba(28, 121, 100, 0.3);
  outline-offset: 2px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.button-primary {
  color: white;
  background: var(--green);
  box-shadow: 0 10px 22px rgba(28, 121, 100, 0.2);
}

.button-primary:hover:not(:disabled) {
  background: var(--green-dark);
}

.button-secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.button-ghost {
  border-color: var(--line);
  background: transparent;
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(340px, 0.8fr);
  gap: 18px;
}

.total-card,
.allocation-card,
.account-card,
.table-shell,
.data-note {
  border: 1px solid rgba(20, 33, 29, 0.1);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.total-card,
.allocation-card {
  min-height: 322px;
  border-radius: var(--radius-lg);
}

.total-card {
  padding: 30px 32px 26px;
  color: white;
  background:
    radial-gradient(circle at 6% 16%, rgba(47, 143, 107, 0.27), transparent 18rem),
    radial-gradient(circle at 62% -30%, rgba(63, 120, 197, 0.24), transparent 23rem),
    radial-gradient(circle at 108% 100%, rgba(201, 78, 71, 0.22), transparent 22rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 46%),
    var(--ink);
  overflow: hidden;
  position: relative;
}

.total-card::after {
  content: "";
  position: absolute;
  width: 340px;
  height: 340px;
  right: -170px;
  top: -190px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  box-shadow: 0 0 0 54px rgba(255, 255, 255, 0.03), 0 0 0 112px rgba(255, 255, 255, 0.02);
}

.card-label-row {
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.card-label-row p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.88rem;
}

.mode-chip {
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.67rem;
  font-weight: 700;
}

.total-value-row {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  margin: 18px 0 25px;
  position: relative;
  z-index: 1;
}

.total-value {
  flex: 1 1 auto;
  min-height: 73px;
  margin: 0;
  font-size: clamp(2.65rem, 5.2vw, 4.7rem);
  font-variant-numeric: tabular-nums;
  font-weight: 620;
  letter-spacing: -0.055em;
  line-height: 1;
}

.total-return {
  min-width: 186px;
  margin-bottom: 5px;
  padding: 11px 13px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(8px);
  font-variant-numeric: tabular-nums;
}

.total-return .return-arrow {
  font-size: 1.55rem;
  font-weight: 850;
  line-height: 1;
}

.total-return strong,
.total-return small {
  display: block;
}

.total-return strong {
  font-size: 0.95rem;
}

.total-return small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.63rem;
}

.total-return small b {
  margin-right: 3px;
  color: currentColor;
  font-size: 0.74rem;
}

.total-return.positive {
  border-color: rgba(91, 210, 170, 0.32);
  background: rgba(47, 143, 107, 0.16);
  color: #6ce1b8 !important;
}

.total-return.positive small b {
  color: #6ce1b8;
}

.total-return.negative {
  border-color: rgba(255, 141, 134, 0.34);
  background: rgba(201, 78, 71, 0.17);
  color: #ff928b !important;
}

.total-return.negative small b {
  color: #ff928b;
}

.total-return.neutral {
  color: rgba(255, 255, 255, 0.78);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  position: relative;
  z-index: 1;
}

.metric-row > div {
  padding-right: 18px;
}

.metric-row > div + div {
  padding-left: 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.metric-row span,
.metric-row strong {
  display: block;
}

.metric-row span {
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.72rem;
}

.metric-row strong {
  font-size: 1.02rem;
  font-variant-numeric: tabular-nums;
}

.time-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 27px;
  padding-top: 18px;
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.7rem;
}

.time-strip strong {
  color: rgba(255, 255, 255, 0.86);
  font-weight: 600;
}

.dot {
  width: 6px;
  height: 6px;
  margin-right: 6px;
  display: inline-block;
  border-radius: 50%;
}

.dot-green {
  background: #5bd2aa;
}

.dot-amber {
  background: #e6b967;
}

.allocation-card {
  padding: 27px 28px;
  background:
    linear-gradient(135deg, rgba(47, 143, 107, 0.07), rgba(63, 120, 197, 0.055) 52%, rgba(201, 78, 71, 0.065)),
    var(--surface);
}

.section-heading {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-heading > p,
.section-heading > span {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.section-heading.compact {
  margin-bottom: 22px;
}

.allocation-layout {
  display: grid;
  grid-template-columns: 148px 1fr;
  align-items: center;
  gap: 22px;
}

.donut {
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--jpy) 0 33%, var(--usd) 33% 66%, var(--cny) 66% 100%);
  box-shadow: inset 0 0 0 1px rgba(20, 33, 29, 0.06);
}

.donut > div {
  width: 94px;
  height: 94px;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 4px 18px rgba(20, 33, 29, 0.08);
}

.donut span,
.donut strong {
  display: block;
}

.donut span {
  color: var(--muted);
  font-size: 0.68rem;
}

.donut strong {
  margin-top: 2px;
  font-size: 1.45rem;
}

.allocation-legend {
  display: grid;
  gap: 13px;
}

.legend-row {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 0.76rem;
}

.legend-row[data-currency="JPY"] {
  border-color: rgba(47, 143, 107, 0.14);
  background: var(--jpy-soft);
}

.legend-row[data-currency="USD"] {
  border-color: rgba(63, 120, 197, 0.14);
  background: var(--usd-soft);
}

.legend-row[data-currency="CNY"] {
  border-color: rgba(201, 78, 71, 0.14);
  background: var(--cny-soft);
}

.legend-row i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-row span {
  color: var(--muted-strong);
}

.legend-row strong {
  font-variant-numeric: tabular-nums;
}

.section-block {
  margin-top: 52px;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.account-card {
  min-height: 296px;
  padding: 23px;
  border-radius: var(--radius-md);
}

.account-card[data-currency="JPY"] {
  border-color: rgba(47, 143, 107, 0.22);
  background: linear-gradient(145deg, var(--jpy-soft), rgba(255, 255, 255, 0.96) 72%);
  box-shadow: 0 18px 45px rgba(47, 143, 107, 0.09);
}

.account-card[data-currency="USD"] {
  border-color: rgba(63, 120, 197, 0.22);
  background: linear-gradient(145deg, var(--usd-soft), rgba(255, 255, 255, 0.96) 72%);
  box-shadow: 0 18px 45px rgba(63, 120, 197, 0.09);
}

.account-card[data-currency="CNY"] {
  border-color: rgba(201, 78, 71, 0.22);
  background: linear-gradient(145deg, var(--cny-soft), rgba(255, 255, 255, 0.96) 72%);
  box-shadow: 0 18px 45px rgba(201, 78, 71, 0.09);
}

.account-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.currency-orb {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 800;
}

.account-card[data-currency="JPY"] .currency-orb {
  background: rgba(47, 143, 107, 0.14);
  color: var(--jpy-dark);
}

.account-card[data-currency="USD"] .currency-orb {
  background: rgba(63, 120, 197, 0.14);
  color: var(--usd-dark);
}

.account-card[data-currency="CNY"] .currency-orb {
  background: rgba(201, 78, 71, 0.14);
  color: var(--cny-dark);
}

.account-identity h3 {
  margin: 0 0 3px;
  font-size: 1rem;
}

.account-identity p,
.account-freshness {
  margin: 0;
  color: var(--muted-strong);
  font-size: 0.68rem;
}

.account-freshness {
  padding: 5px 8px;
  border-radius: 999px;
  background: #ebece8;
  text-align: right;
  white-space: nowrap;
}

.account-total {
  margin: 29px 0 23px;
}

.account-total span,
.account-total strong {
  display: block;
}

.account-total span {
  margin-bottom: 7px;
  color: var(--muted-strong);
  font-size: 0.72rem;
}

.account-total strong {
  font-size: clamp(1.65rem, 2.6vw, 2.25rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
}

.account-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.account-stats > div {
  min-width: 0;
}

.account-stats span,
.account-stats strong {
  display: block;
}

.account-stats span {
  margin-bottom: 4px;
  color: var(--muted-strong);
  font-size: 0.64rem;
}

.account-stats strong {
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.account-pnl-percent {
  margin-top: 4px;
  display: block;
  font-size: 0.66rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.account-balance-note {
  margin: 15px 0 0;
  padding-top: 12px;
  border-top: 1px dashed rgba(20, 33, 29, 0.13);
  color: var(--muted-strong);
  font-size: 0.62rem;
  line-height: 1.5;
}

.positive {
  color: var(--green) !important;
}

.negative {
  color: var(--red) !important;
}

.positions-section {
  margin-bottom: 44px;
}

.positions-heading {
  align-items: flex-end;
}

.position-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.position-tabs button {
  padding: 8px 13px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.position-tabs button[aria-selected="true"] {
  background: var(--ink);
  color: white;
}

.position-tabs button[data-account="jpy-account"][aria-selected="true"] {
  background: var(--jpy-dark);
}

.position-tabs button[data-account="usd-account"][aria-selected="true"] {
  background: var(--usd-dark);
}

.position-tabs button[data-account="cny-account"][aria-selected="true"] {
  background: var(--cny-dark);
}

.table-shell {
  border-radius: var(--radius-md);
  overflow: auto;
}

table {
  width: 100%;
  min-width: 1080px;
  border-collapse: collapse;
  font-size: 0.79rem;
}

th,
td {
  padding: 15px 17px;
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #f7f6f1;
  font-size: 0.66rem;
  font-weight: 700;
}

td {
  border-bottom: 1px solid rgba(217, 221, 215, 0.74);
  font-variant-numeric: tabular-nums;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: rgba(28, 121, 100, 0.035);
}

tbody tr[data-currency="JPY"] td:first-child {
  box-shadow: inset 3px 0 0 rgba(47, 143, 107, 0.72);
}

tbody tr[data-currency="USD"] td:first-child {
  box-shadow: inset 3px 0 0 rgba(63, 120, 197, 0.72);
}

tbody tr[data-currency="CNY"] td:first-child {
  box-shadow: inset 3px 0 0 rgba(201, 78, 71, 0.72);
}

.asset-cell {
  display: flex;
  align-items: center;
  gap: 11px;
}

.asset-monogram {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: #e8ebe7;
  color: #40514a;
  font-size: 0.64rem;
  font-weight: 800;
}

tbody tr[data-currency="JPY"] .asset-monogram {
  background: var(--jpy-soft);
  color: var(--jpy-dark);
}

tbody tr[data-currency="USD"] .asset-monogram {
  background: var(--usd-soft);
  color: var(--usd-dark);
}

tbody tr[data-currency="CNY"] .asset-monogram {
  background: var(--cny-soft);
  color: var(--cny-dark);
}

.holding-share-pill {
  min-width: 62px;
  padding: 6px 9px;
  display: inline-flex;
  justify-content: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.holding-share-pill[data-currency="JPY"] {
  background: var(--jpy-soft);
  color: var(--jpy-dark);
}

.holding-share-pill[data-currency="USD"] {
  background: var(--usd-soft);
  color: var(--usd-dark);
}

.holding-share-pill[data-currency="CNY"] {
  background: var(--cny-soft);
  color: var(--cny-dark);
}

.asset-cell strong,
.asset-cell span {
  display: block;
}

.asset-cell strong {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.asset-cell span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.65rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #805510;
  font-size: 0.65rem;
  font-weight: 700;
}

.status-pill.live {
  background: var(--green-soft);
  color: var(--green-dark);
}

.status-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.empty-state {
  padding: 46px;
  color: var(--muted);
  text-align: center !important;
}

.data-note {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 18px;
  margin: 0 0 32px;
  padding: 24px 26px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(110deg, rgba(47, 143, 107, 0.08), rgba(63, 120, 197, 0.055), rgba(201, 78, 71, 0.06)),
    #eef2ef;
  box-shadow: none;
}

.data-note-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(20, 33, 29, 0.16);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 700;
}

.data-note h2 {
  margin: 1px 0 8px;
  font-size: 1rem;
}

.data-note p,
.data-note li {
  color: #53615b;
  font-size: 0.76rem;
  line-height: 1.7;
}

.data-note p {
  margin-bottom: 8px;
  font-weight: 650;
}

.data-note ul {
  margin: 0;
  padding-left: 18px;
}

.page-status {
  min-height: 24px;
  margin: -14px 0 18px;
  color: var(--muted);
  font-size: 0.73rem;
  text-align: right;
}

footer {
  min-height: 100px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  border-top: 1px solid rgba(20, 33, 29, 0.12);
  color: var(--muted);
  font-size: 0.7rem;
}

footer span {
  color: var(--ink);
  font-weight: 750;
}

footer p {
  margin: 0;
}

.sync-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 32px;
  border: 0;
  border-radius: 24px;
  background: var(--surface-strong);
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(20, 33, 29, 0.28);
}

.sync-dialog::backdrop {
  background: rgba(12, 24, 20, 0.6);
  backdrop-filter: blur(5px);
}

.dialog-close {
  position: absolute;
  right: 18px;
  top: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #eef0ec;
  cursor: pointer;
  font-size: 1.35rem;
}

.sync-dialog h2 {
  margin-bottom: 11px;
  font-size: 1.8rem;
}

.dialog-lead,
.dialog-footnote {
  color: var(--muted);
  line-height: 1.65;
}

.dialog-lead {
  margin-bottom: 20px;
  font-size: 0.87rem;
}

.sync-flow {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sync-step {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fffefa;
}

.sync-step-heading {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.sync-step-heading > span {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 850;
}

.sync-step-heading strong {
  display: block;
  font-size: 0.86rem;
}

.sync-step-heading p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
}

.broker-login-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 13px;
}

.broker-login-link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 11px;
  border: 1px solid #dce1dc;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.broker-login-link:hover {
  border-color: var(--green);
  background: var(--green-soft);
  transform: translateY(-1px);
}

.broker-login-link > span:nth-child(2) {
  min-width: 0;
}

.broker-login-link strong,
.broker-login-link small {
  display: block;
}

.broker-login-link strong {
  font-size: 0.74rem;
}

.broker-login-link small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.58rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.broker-login-link i {
  color: var(--green);
  font-style: normal;
}

.broker-currency {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
  background: #e9ece8;
  color: var(--green-dark);
  font-size: 0.58rem;
  font-weight: 850;
}

.broker-safety-note {
  margin: 10px 0 0;
  color: #775319;
  font-size: 0.64rem;
}

.chatgpt-command {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px 13px;
  border-radius: 12px;
  background: #14211d;
}

.chatgpt-command code {
  flex: 0 0 auto;
  color: #fff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 800;
}

.chatgpt-command span {
  color: rgba(255, 255, 255, 0.67);
  font-size: 0.64rem;
  line-height: 1.45;
}

.connector-details {
  margin-top: 14px;
  padding: 0 14px;
  border-radius: 14px;
  background: #eef0ec;
}

.connector-details summary {
  padding: 13px 0;
  cursor: pointer;
  color: var(--green-dark);
  font-size: 0.72rem;
  font-weight: 750;
}

.connector-details .connector-status {
  padding: 13px 0;
  border-top: 1px solid #d8ddd8;
  border-radius: 0;
}

.connector-sync-button {
  width: 100%;
  margin: 12px 0 14px;
}

.connector-status {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 15px;
  background: #eef0ec;
}

.connector-status strong,
.connector-status p {
  display: block;
}

.connector-help {
  margin: 11px 2px 0;
  color: var(--muted);
  font-size: 0.7rem;
}

.connector-help a {
  color: var(--green-dark);
  font-weight: 700;
  text-underline-offset: 3px;
}

.connector-status strong {
  margin-bottom: 4px;
  font-size: 0.84rem;
}

.connector-status p {
  margin: 0;
  color: var(--muted);
  font-size: 0.73rem;
}

.connector-spinner {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 2px solid #cbd2cd;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.connector-status.ready {
  background: var(--green-soft);
}

.connector-status.missing {
  background: var(--amber-soft);
}

.connector-status.ready .connector-spinner,
.connector-status.missing .connector-spinner {
  display: grid;
  place-items: center;
  border: 0;
  animation: none;
}

.connector-status.ready .connector-spinner::after {
  content: "✓";
  color: var(--green);
  font-weight: 900;
}

.connector-status.missing .connector-spinner::after {
  content: "!";
  color: #8a5b10;
  font-weight: 900;
}

.dialog-actions {
  display: flex;
  gap: 9px;
  margin-top: 20px;
}

.dialog-actions > .button {
  text-decoration: none;
}

.dialog-actions form {
  display: inline-flex;
}

.dialog-footnote {
  margin: 18px 0 0;
  font-size: 0.68rem;
}

.sync-results {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.76rem;
  line-height: 1.65;
}

.loading-card,
.skeleton-line {
  position: relative;
  overflow: hidden;
}

.loading-card::after,
.skeleton-line:empty::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 25%, rgba(255, 255, 255, 0.7) 45%, transparent 65%);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

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

@media (max-width: 980px) {
  :root {
    --page: min(100% - 32px, 780px);
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .allocation-card {
    min-height: auto;
  }

  .allocation-layout {
    grid-template-columns: 160px 1fr;
  }

  .account-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  :root {
    --page: calc(100% - 24px);
  }

  .site-header {
    height: auto;
    min-height: 86px;
    align-items: flex-start;
    padding: 17px 0;
  }

  .header-actions {
    align-items: flex-end;
    flex-direction: column;
    gap: 8px;
  }

  .public-badge {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 38px 0 30px;
  }

  h1 {
    font-size: clamp(2.45rem, 13vw, 3.5rem);
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .button {
    flex: 1;
  }

  .total-card,
  .allocation-card {
    border-radius: 22px;
  }

  .total-card {
    min-height: 420px;
    padding: 24px 21px;
  }

  .total-value-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
    margin-top: 28px;
  }

  .total-value {
    font-size: clamp(2.4rem, 12vw, 3.5rem);
  }

  .total-return {
    min-width: min(100%, 220px);
    margin-bottom: 0;
  }

  .metric-row {
    grid-template-columns: 1fr 1fr;
    row-gap: 19px;
  }

  .metric-row > div:nth-child(3) {
    grid-column: 1 / -1;
    padding: 15px 0 0;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .metric-row > div:nth-child(2) {
    padding-left: 16px;
  }

  .time-strip {
    display: grid;
    gap: 7px;
  }

  .allocation-layout {
    grid-template-columns: 126px 1fr;
    gap: 16px;
  }

  .donut {
    width: 126px;
    height: 126px;
  }

  .donut > div {
    width: 80px;
    height: 80px;
  }

  .section-block {
    margin-top: 40px;
  }

  .positions-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .data-note {
    grid-template-columns: 1fr;
  }

  footer {
    grid-template-columns: 1fr auto;
    padding: 22px 0;
  }

  footer p {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .sync-dialog {
    padding: 28px 22px;
  }

  .broker-login-grid {
    grid-template-columns: 1fr;
  }

  .chatgpt-command {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
