:root {
  color-scheme: dark;
  --bg: #050505;
  --bg-soft: #0c0d0f;
  --panel: #111316;
  --panel-2: #171a1f;
  --line: #252932;
  --line-soft: #1b1f27;
  --text: #f4f5f7;
  --muted: #8d95a3;
  --muted-2: #626b79;
  --app-bg: #050505;
  --app-bg-glow: rgba(255, 255, 255, 0.035);
  --sidebar-bg: #08090b;
  --brand-mark-color: #ffffff;
  --surface: #111316;
  --surface-elevated: #171a1f;
  --surface-sunken: #0a0b0d;
  --surface-input: #0a0b0d;
  --surface-control: #090a0c;
  --surface-muted: #0d0f12;
  --surface-popover: #1a1b1e;
  --surface-popover-soft: #15171a;
  --surface-hover: rgba(255, 255, 255, 0.08);
  --surface-control-hover: #202328;
  --surface-control-strong: #25272b;
  --surface-control-strong-hover: #303238;
  --surface-card-active: #15181d;
  --surface-selected: #f3f5f7;
  --surface-selected-text: #060708;
  --surface-chart: #08090b;
  --surface-chart-soft: #090a0d;
  --panel-soft: #0a0c0f;
  --text-strong: #f4f5f7;
  --text-table: #dce0e6;
  --line-strong: #252932;
  --line-popover: #343943;
  --line-selected: #f3f5f7;
  --line-disabled: rgba(35, 40, 48, 0.7);
  --text-disabled: rgba(141, 149, 163, 0.34);
  --caret-color: #ffffff;
  --chart-grid: rgba(255, 255, 255, 0.08);
  --focus-ring-soft: rgba(255, 255, 255, 0.08);
  --button-primary-bg: #f3f5f7;
  --button-primary-text: #060708;
  --shadow-elevated: rgba(0, 0, 0, 0.42);
  --scrollbar-track: rgba(255, 255, 255, 0.08);
  --scrollbar-thumb: rgba(148, 163, 184, 0.72);
  --green: #00c076;
  --green-soft: rgba(0, 192, 118, 0.14);
  --green-faint: rgba(0, 192, 118, 0.16);
  --green-muted: rgba(0, 192, 118, 0.18);
  --green-chart-fill: rgba(0, 192, 118, 0.28);
  --green-transparent: rgba(0, 192, 118, 0);
  --yellow: #f4c84a;
  --yellow-soft: rgba(244, 200, 74, 0.14);
  --red: #ff5b5b;
  --red-soft: rgba(255, 91, 91, 0.12);
  --red-faint: rgba(255, 91, 91, 0.16);
  --red-muted: rgba(255, 91, 91, 0.18);
  --red-chart-fill: rgba(255, 91, 91, 0.24);
  --red-transparent: rgba(255, 91, 91, 0);
  --positive: var(--green);
  --positive-soft: var(--green-soft);
  --positive-faint: var(--green-faint);
  --positive-muted: var(--green-muted);
  --positive-chart-fill: var(--green-chart-fill);
  --positive-transparent: var(--green-transparent);
  --negative: var(--red);
  --negative-soft: var(--red-soft);
  --negative-faint: var(--red-faint);
  --negative-muted: var(--red-muted);
  --negative-chart-fill: var(--red-chart-fill);
  --negative-transparent: var(--red-transparent);
  --focus: #ffffff;
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #eef2f6;
  --panel: #ffffff;
  --panel-2: #ffffff;
  --line: #c8d2df;
  --line-soft: #d9e1ec;
  --text: #151b23;
  --muted: #667085;
  --muted-2: #8a94a6;
  --app-bg: #f6f8fb;
  --app-bg-glow: transparent;
  --sidebar-bg: #ffffff;
  --brand-mark-color: #151b23;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-sunken: #ffffff;
  --surface-input: #ffffff;
  --surface-control: #ffffff;
  --surface-muted: #ffffff;
  --surface-popover: #ffffff;
  --surface-popover-soft: #ffffff;
  --surface-hover: rgba(15, 23, 42, 0.06);
  --surface-control-hover: #eef2f6;
  --surface-control-strong: #f1f5f9;
  --surface-control-strong-hover: #e6edf5;
  --surface-card-active: var(--app-bg);
  --surface-selected: #151b23;
  --surface-selected-text: #ffffff;
  --surface-chart: #ffffff;
  --surface-chart-soft: #ffffff;
  --panel-soft: #ffffff;
  --text-strong: #151b23;
  --text-table: #243041;
  --line-strong: #b8c4d3;
  --line-popover: #b8c4d3;
  --line-selected: #151b23;
  --line-disabled: rgba(120, 134, 155, 0.48);
  --text-disabled: rgba(102, 112, 133, 0.45);
  --caret-color: #667085;
  --chart-grid: rgba(15, 23, 42, 0.08);
  --focus-ring-soft: rgba(15, 23, 42, 0.12);
  --button-primary-bg: #151b23;
  --button-primary-text: #ffffff;
  --shadow-elevated: rgba(15, 23, 42, 0.16);
  --scrollbar-track: rgba(15, 23, 42, 0.06);
  --scrollbar-thumb: rgba(100, 116, 139, 0.5);
  --focus: #151b23;
}

body[data-market-color="redUpGreenDown"] {
  --positive: var(--red);
  --positive-soft: var(--red-soft);
  --positive-faint: var(--red-faint);
  --positive-muted: var(--red-muted);
  --positive-chart-fill: var(--red-chart-fill);
  --positive-transparent: var(--red-transparent);
  --negative: var(--green);
  --negative-soft: var(--green-soft);
  --negative-faint: var(--green-faint);
  --negative-muted: var(--green-muted);
  --negative-chart-fill: var(--green-chart-fill);
  --negative-transparent: var(--green-transparent);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, var(--app-bg-glow), transparent 260px),
    var(--app-bg);
  color: var(--text);
}

button,
input,
select {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button {
  color: inherit;
}


body.auth-pending .app-shell,
body.auth-signed-out .app-shell,
body.auth-signed-in .auth-gate {
  display: none;
}

.auth-gate {
  display: grid;
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  place-items: center;
  padding: 32px;
  background: #ffffff;
  color: #122022;
  color-scheme: light;
}

.auth-pond {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-wave {
  position: absolute;
  width: 54vw;
  min-width: 480px;
  height: 190px;
  border: 1px solid rgba(36, 116, 124, 0.11);
  border-color: rgba(36, 116, 124, 0.11) transparent transparent transparent;
  border-radius: 50%;
  transform: rotate(-8deg);
}

.auth-wave-one {
  top: 13%;
  left: -13%;
  --auth-wave-rotate: -8deg;
  animation: authWaveDrift 12s ease-in-out infinite;
}

.auth-wave-two {
  right: -18%;
  bottom: 18%;
  width: 62vw;
  border-color: rgba(18, 83, 104, 0.1) transparent transparent transparent;
  --auth-wave-rotate: 12deg;
  transform: rotate(12deg);
  animation: authWaveDrift 14s ease-in-out infinite reverse;
}

.auth-wave-three {
  left: 12%;
  bottom: -78px;
  width: 46vw;
  border-color: rgba(228, 169, 49, 0.08) transparent transparent transparent;
  --auth-wave-rotate: 4deg;
  transform: rotate(4deg);
  animation: authWaveDrift 16s ease-in-out infinite;
}

.auth-fish {
  position: absolute;
  left: 0;
  top: 0;
  width: 118px;
  height: 42px;
  opacity: 0.2;
  transform-origin: center;
  will-change: transform, opacity;
  transition: opacity 0.34s ease;
}

.auth-fish svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  fill: none;
  stroke: #000000;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-fish circle {
  fill: #000000;
  stroke: none;
}

.auth-fish-one {
  opacity: 0.22;
}

.auth-fish-two {
  opacity: 0.18;
}

.auth-fish-three {
  opacity: 0.13;
}

.auth-fish-extra {
  opacity: 0;
}

.auth-fish-extra.is-active {
  opacity: 0.2;
}

.auth-block {
  display: none;
}

.auth-block-one {
  left: 16%;
  bottom: 30%;
  width: 46px;
  height: 46px;
  background: rgba(19, 150, 133, 0.04);
  animation: authBlockFloat 11s ease-in-out infinite;
}

.auth-block-two {
  right: 21%;
  top: 20%;
  width: 34px;
  height: 34px;
  background: rgba(228, 169, 49, 0.04);
  animation: authBlockFloat 13s ease-in-out infinite reverse;
}

.auth-block-three {
  right: 13%;
  bottom: 25%;
  width: 68px;
  height: 22px;
  background: rgba(69, 160, 199, 0.04);
  animation: authBlockFloat 12s ease-in-out infinite;
}

.auth-gate:hover .auth-wave {
  border-color: rgba(27, 125, 128, 0.16) transparent transparent transparent;
}

.auth-card {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 528px);
  gap: 30px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.auth-card-heading {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.auth-eyebrow {
  margin: 0;
  color: #148f80;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-brand-mark {
  width: 122px;
  height: 44px;
  margin-bottom: 8px;
}

.auth-brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #000000;
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-brand-mark circle {
  fill: #000000;
  stroke: none;
}

.auth-card-heading h1 {
  margin: 0;
  color: #071927;
  font-size: clamp(34px, 6vw, 50px);
  line-height: 1.2;
  letter-spacing: 0;
}

.auth-card-heading p:last-child {
  margin: 0;
  max-width: 420px;
  color: #5f7181;
  font-size: 17px;
  line-height: 1.7;
}

.auth-choice-panel {
  display: grid;
  gap: 18px;
}

.auth-choice-panel[hidden],
.auth-form[hidden] {
  display: none;
}

.auth-method-button {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  width: 100%;
  min-height: 82px;
  border: 1px solid rgba(19, 54, 68, 0.15);
  border-radius: 16px;
  background: #ffffff;
  color: #071927;
  cursor: pointer;
  font-size: 22px;
  font-weight: 720;
  letter-spacing: 0;
  padding: 0 26px;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-method-button:hover,
.auth-method-button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(18, 143, 128, 0.44);
  background: #fbfffd;
  box-shadow: 0 18px 36px rgba(28, 133, 133, 0.08);
  outline: none;
}

.auth-method-icon {
  width: 38px;
  height: 30px;
}

.auth-method-icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #18252c;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-footnote {
  margin: 0;
  color: #6a7c85;
  font-size: 15px;
  line-height: 1.7;
  text-align: center;
}

.auth-form {
  display: grid;
  gap: 18px;
  animation: authFormIn 0.24s ease both;
}

.auth-form-heading {
  display: grid;
  gap: 6px;
  text-align: center;
}

.auth-form-heading strong {
  color: #071927;
  font-size: 22px;
  line-height: 1.35;
}

.auth-form-heading span {
  color: #60727f;
  font-size: 14px;
  line-height: 1.6;
}

.auth-field {
  display: grid;
  gap: 9px;
  color: #647684;
  font-size: 14px;
}

.auth-field[hidden] {
  display: none;
}

.auth-field input {
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(19, 54, 68, 0.16);
  border-radius: 14px;
  background: #ffffff;
  color: #122022;
  padding: 0 20px;
  outline: none;
}

.auth-field input:-webkit-autofill,
.auth-field input:-webkit-autofill:hover,
.auth-field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset;
  -webkit-text-fill-color: #122022;
  caret-color: #122022;
}

.auth-field input[type="password"]::-ms-reveal,
.auth-field input[type="password"]::-ms-clear {
  display: none;
}

.auth-field input:focus,
.auth-password-wrap:focus-within input {
  border-color: rgba(18, 143, 128, 0.62);
  box-shadow: 0 0 0 4px rgba(18, 143, 128, 0.12);
}

.auth-password-wrap {
  position: relative;
  display: block;
}

.auth-password-wrap input {
  padding-right: 58px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 14px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: rgba(18, 32, 34, 0.56);
  cursor: pointer;
  transform: translateY(-50%);
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  background: rgba(18, 143, 128, 0.1);
  color: #128f80;
  outline: none;
}

.auth-password-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-password-toggle .eye-slash {
  display: block;
}

.auth-password-toggle.is-visible .eye-slash {
  display: none;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: #687a86;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.auth-message.error {
  color: #c93b3b;
}

.auth-message.success {
  color: #088f69;
}

.auth-actions {
  display: grid;
  margin-top: 4px;
}

.auth-primary-button,
.auth-secondary-button,
.auth-signout-button,
.auth-back-button,
.auth-switch-button {
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.auth-primary-button,
.auth-secondary-button {
  min-height: 58px;
  border: 1px solid rgba(17, 134, 113, 0.2);
  padding: 0 18px;
  font-weight: 720;
}

.auth-primary-button {
  background: #10be8b;
  color: #ffffff;
  box-shadow: 0 16px 34px rgba(16, 190, 139, 0.25);
}

.auth-secondary-button {
  background: #ffffff;
  color: #122022;
}

.auth-primary-button:hover,
.auth-primary-button:focus-visible,
.auth-secondary-button:hover,
.auth-secondary-button:focus-visible,
.auth-signout-button:hover,
.auth-signout-button:focus-visible,
.auth-back-button:hover,
.auth-back-button:focus-visible,
.auth-switch-button:hover,
.auth-switch-button:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(18, 143, 128, 0.5);
  outline: none;
}

.auth-primary-button:disabled,
.auth-secondary-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.auth-inline-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #6a7c85;
  font-size: 14px;
  line-height: 1.6;
}

.auth-back-button,
.auth-switch-button {
  border: 0;
  background: transparent;
  color: #526776;
  padding: 4px 0;
}

.auth-switch-button {
  color: #0a9b76;
  font-weight: 800;
}

.auth-user-panel[hidden] {
  display: none;
}

.auth-user-panel {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 14px 0 0;
  border-top: 1px solid var(--line-soft);
}

.auth-user-summary {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 8px;
}

.auth-user-avatar {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.auth-user-meta {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.auth-user-name {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-uid-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
}

.auth-user-uid {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-copy-button {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.auth-user-copy-button svg {
  display: block;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-user-copy-button:hover,
.auth-user-copy-button:focus-visible,
.auth-user-copy-button.is-copied {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface);
  outline: none;
}

.auth-user-copy-button:hover,
.auth-user-copy-button:focus-visible {
  transform: translateY(-1px);
}

.auth-user-copy-button:disabled {
  cursor: default;
  opacity: 0;
  pointer-events: none;
}

.auth-settings-button {
  display: grid;
  width: 28px;
  height: 28px;
  justify-self: end;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.auth-settings-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
}

.auth-settings-button:hover,
.auth-settings-button:focus-visible {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface);
  outline: none;
  transform: translateY(-1px);
}

.auth-settings-button:hover svg,
.auth-settings-button:focus-visible svg {
  opacity: 1;
}

.auth-signout-button {
  min-height: 32px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
}

.modal-panel.settings-panel {
  width: min(820px, calc(100vw - 56px));
  max-height: none;
  overflow: hidden;
}

.settings-panel-heading {
  min-height: 64px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 520px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.settings-tabs {
  display: grid;
  align-content: start;
  grid-template-rows: repeat(3, auto) 1fr auto;
  gap: 6px;
  border-right: 1px solid var(--line-soft);
  padding: 16px;
}

.settings-tab {
  min-height: 40px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
  padding: 0 12px;
}

.settings-tab:hover,
.settings-tab:focus-visible {
  color: var(--text);
  outline: none;
}

.settings-tab.active {
  background: var(--surface-selected);
  color: var(--surface-selected-text);
}

.settings-content {
  min-width: 0;
  padding: 24px;
  overflow: visible;
}

.settings-section {
  display: none;
}

.settings-section.active {
  display: grid;
  gap: 18px;
  width: min(100%, 520px);
  justify-self: center;
}

.settings-section-heading {
  display: grid;
  gap: 6px;
}

.settings-section-heading h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.35;
}

.settings-section-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.settings-placeholder-grid,
.settings-action-list {
  display: grid;
  gap: 10px;
}

.profile-settings-heading {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.settings-edit-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 760;
  padding: 0 14px;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.settings-edit-button:hover,
.settings-edit-button:focus-visible {
  border-color: var(--line-strong);
  outline: none;
  transform: translateY(-1px);
}

.settings-profile-form {
  display: grid;
  justify-items: center;
  gap: 16px;
}

.profile-avatar-editor {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  width: min(100%, 520px);
  padding-top: 6px;
}

.profile-avatar-preview {
  display: grid;
  width: 116px;
  height: 116px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 38px;
  font-weight: 840;
}

.profile-avatar-preview.has-image {
  background-position: center;
  background-size: cover;
  color: transparent;
}

.profile-avatar-actions {
  display: grid;
  gap: 8px;
  justify-items: center;
  max-width: 360px;
  min-width: 0;
  text-align: center;
}

.settings-profile-form:not(.is-editing) .profile-avatar-actions p,
.settings-profile-form:not(.is-editing) .profile-avatar-actions strong,
.settings-profile-form:not(.is-editing) .profile-avatar-buttons,
.settings-profile-form:not(.is-editing) .profile-nickname-edit,
.settings-profile-form:not(.is-editing) .profile-edit-actions {
  display: none;
}

.settings-profile-form.is-editing .profile-nickname-view {
  display: none;
}

.profile-avatar-actions strong {
  font-size: 16px;
  line-height: 1.3;
}

.profile-avatar-actions p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.profile-avatar-buttons,
.settings-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.security-password-actions {
  justify-content: center;
}

.security-email-actions {
  justify-content: center;
}

#securityEmailMessage {
  text-align: center;
}

#securityPasswordMessage {
  text-align: center;
}

#securityPasswordForm:has(#securityCurrentPasswordField[hidden]) #securityPasswordMessage.success {
  margin-top: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.settings-form-field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.settings-form-field[hidden] {
  display: none;
}

.settings-form-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-input);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.settings-form-field input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px var(--focus-ring-soft);
}

.settings-readonly-grid {
  display: grid;
  gap: 10px;
}

.profile-info-stack {
  width: min(100%, 520px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-sunken);
}

.settings-profile-form .settings-form-actions {
  width: min(100%, 520px);
}

.profile-edit-actions {
  justify-content: center;
}

.settings-readonly-field {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  padding: 12px 14px;
}

.profile-info-stack .settings-readonly-field,
.profile-info-stack .settings-form-field {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 14px 18px;
}

.profile-info-stack .settings-form-field input {
  background: var(--surface-input);
}

.profile-info-stack .settings-readonly-field + .settings-readonly-field {
  border-top: 1px solid var(--line-soft);
}

.profile-info-stack .profile-nickname-edit + .settings-readonly-field {
  border-top: 1px solid var(--line-soft);
}

.settings-readonly-field span {
  color: var(--muted);
  font-size: 12px;
}

.settings-readonly-field strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.5;
}

.settings-security-stack {
  display: grid;
  gap: 16px;
}

.settings-security-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-sunken);
}

.settings-security-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 0 18px;
}

.settings-security-row + .settings-security-row {
  border-top: 1px solid var(--line-soft);
}

.settings-security-row span {
  color: var(--text);
  font-size: 15px;
  font-weight: 760;
}

.settings-row-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.settings-row-label svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.82;
}

.settings-row-label span {
  color: inherit;
}

.settings-row-label-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.settings-row-label-text > span:first-child {
  color: inherit;
}

.settings-security-row .settings-row-label-text > .settings-row-subvalue {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  opacity: 0.72;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-text-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
  padding: 0 16px;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.settings-text-button:hover,
.settings-text-button:focus-visible,
.settings-text-button.is-active {
  border-color: var(--line-strong);
  background: var(--surface-elevated);
  outline: none;
}

.settings-text-button:hover,
.settings-text-button:focus-visible {
  transform: translateY(-1px);
}

.settings-text-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.settings-preferences-form {
  display: grid;
  gap: 16px;
}

.settings-option-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  padding: 14px;
}

.settings-option-group legend {
  color: var(--text);
  font-size: 16px;
  font-weight: 780;
  padding: 0 6px;
}

.settings-option-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  padding: 16px 18px;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.settings-option-card:hover,
.settings-option-card:focus-within {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.settings-option-card:has(input:checked) {
  border-color: var(--line-strong);
  background: var(--surface-elevated);
}

.settings-option-card input {
  margin: 0;
  accent-color: var(--button-primary-bg);
}

.settings-option-card > span:not(.market-color-preview) {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.settings-option-card strong {
  font-size: 14px;
  line-height: 1.35;
}

.settings-option-card .market-color-preview {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  justify-self: end;
  min-width: 38px;
}

.settings-option-card .market-preview-arrow {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: butt;
  stroke-linejoin: miter;
  overflow: visible;
}

.green-up-red-down .up,
.red-up-green-down .down {
  color: var(--green);
}

.green-up-red-down .down,
.red-up-green-down .up {
  color: var(--red);
}

.settings-card-form,
.settings-danger-zone {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  padding: 14px;
}

.settings-card-form[hidden] {
  display: none;
}

.settings-card-heading {
  display: grid;
  gap: 4px;
}

.settings-card-heading strong,
.settings-danger-zone strong {
  font-size: 16px;
  line-height: 1.35;
}

.settings-card-heading span,
.settings-danger-zone p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.security-password-new-fields {
  display: grid;
  gap: 12px;
}

.security-password-new-fields[hidden] {
  display: none;
}

.settings-form-field input[readonly] {
  cursor: default;
  color: var(--muted);
}

.settings-field-preview,
.settings-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  color: var(--text);
  padding: 0 14px;
}

.settings-field-preview span,
.settings-action-row span {
  color: var(--muted);
}

.settings-field-preview strong {
  overflow: hidden;
  font-size: 14px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-action-row {
  cursor: not-allowed;
  font-weight: 700;
  opacity: 0.72;
}

.settings-action-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.settings-action-row.danger span {
  color: var(--red);
}

.settings-danger-zone {
  display: flex;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 6px 0 0;
}

.settings-danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(255, 95, 95, 0.58);
  border-radius: var(--radius);
  background: rgba(255, 95, 95, 0.08);
  color: var(--red);
  cursor: pointer;
  font-size: 13px;
  font-weight: 780;
  padding: 0 14px;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.settings-danger-button:hover,
.settings-danger-button:focus-visible {
  border-color: var(--red);
  background: rgba(255, 95, 95, 0.14);
  outline: none;
  transform: translateY(-1px);
}

.settings-danger-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.settings-message {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.settings-message.success {
  color: var(--green);
}

.settings-message.error {
  color: var(--red);
}

.settings-primary-button,
.settings-secondary-button,
.settings-ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
  padding: 0 14px;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.settings-primary-button {
  border: 1px solid var(--button-primary-bg);
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
}

.settings-secondary-button,
.settings-ghost-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.settings-ghost-button {
  color: var(--muted);
}

.settings-primary-button:hover,
.settings-primary-button:focus-visible,
.settings-secondary-button:hover,
.settings-secondary-button:focus-visible,
.settings-ghost-button:hover,
.settings-ghost-button:focus-visible {
  border-color: var(--line-strong);
  outline: none;
  transform: translateY(-1px);
}

.settings-primary-button:disabled,
.settings-secondary-button:disabled,
.settings-ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

.settings-signout-button {
  align-self: end;
  width: 100%;
  min-height: 40px;
  margin-top: auto;
  padding: 0 12px;
  text-align: center;
}

@keyframes authWaveDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(var(--auth-wave-rotate, -8deg));
  }
  50% {
    transform: translate3d(18px, -10px, 0) rotate(var(--auth-wave-rotate, -8deg));
  }
}

@keyframes authFishSwim {
  0%,
  100% {
    translate: 0 0;
    rotate: -3deg;
  }
  50% {
    translate: 28px 13px;
    rotate: 5deg;
  }
}

@keyframes authFishSwimSmall {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: -24px -14px;
  }
}

@keyframes authFishSwimTiny {
  0%,
  100% {
    translate: 0 0;
    opacity: 0.48;
  }
  50% {
    translate: 18px -12px;
    opacity: 0.72;
  }
}

@keyframes authBlockFloat {
  0%,
  100% {
    transform: translateY(0) rotate(12deg);
  }
  50% {
    transform: translateY(-14px) rotate(18deg);
  }
}

@keyframes authFormIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  height: 100vh;
  border-right: 1px solid var(--line-soft);
  background: var(--sidebar-bg);
  padding: 22px 14px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 8px;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 18px;
  flex: 0 0 auto;
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--brand-mark-color);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark circle {
  fill: var(--brand-mark-color);
  stroke: none;
}

.nav-list {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  margin-top: 28px;
}

.nav-module {
  display: grid;
  gap: 6px;
}

.nav-module-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 4px;
}

.nav-sublist {
  display: grid;
  gap: 4px;
  max-height: 180px;
  overflow: hidden;
  padding-left: 18px;
  transition:
    max-height 180ms ease,
    opacity 160ms ease,
    transform 180ms ease;
}

.nav-sublist:empty {
  max-height: 0;
  padding-left: 0;
}

.nav-module.is-collapsed .nav-sublist {
  max-height: 0;
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  padding: 0 10px;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.nav-item span {
  display: inline-flex;
  align-items: center;
  transform-origin: left center;
  transition:
    color 160ms ease,
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.nav-item:hover span,
.nav-item:focus-visible span {
  transform: translateX(2px) scale(1.08);
}

.nav-item:hover:not(.active),
.nav-item:focus-visible:not(.active) {
  color: var(--text);
}

.nav-item.active {
  background: var(--surface-selected);
  color: var(--surface-selected-text);
  font-weight: 700;
}

.nav-item.module-active:not(.active) {
  color: var(--text);
}

.nav-module-item {
  font-weight: 720;
}

.nav-module-row .nav-module-item {
  min-width: 0;
}

.nav-sub-item {
  min-height: 36px;
  padding-left: 8px;
  color: var(--muted);
  font-size: 13px;
}

.nav-collapse-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.nav-collapse-button:hover,
.nav-collapse-button:focus-visible {
  background: var(--surface-hover);
  color: var(--text);
  outline: none;
}

.nav-collapse-icon {
  position: relative;
  display: block;
  width: 10px;
  height: 10px;
  overflow: hidden;
  color: transparent;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform 180ms ease;
}

.nav-collapse-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  color: var(--muted);
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translate(-50%, -62%) rotate(45deg);
  transform-origin: 50% 50%;
}

.nav-collapse-button:hover .nav-collapse-icon::before,
.nav-collapse-button:focus-visible .nav-collapse-icon::before {
  color: var(--text);
}

.nav-module.is-collapsed .nav-collapse-icon {
  transform: rotate(-90deg);
}

.nav-icon {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  font-size: 15px;
}

.workspace {
  display: flex;
  flex-direction: column;
  width: min(1240px, 100%);
  min-height: 0;
  margin: 0 auto;
  padding: 24px;
}

body:has(#assetsView.active) .workspace {
  width: min(1680px, 100%);
}

.view-section {
  display: none;
}

.view-section.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

#assetsView.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.placeholder-panel {
  display: grid;
  gap: 12px;
  max-width: 680px;
  padding: 28px;
}

.placeholder-panel h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.35;
  letter-spacing: 0;
}

.placeholder-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}


.hidden {
  display: none !important;
}

.topbar,
.asset-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
}

.asset-hero {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px 20px;
}

.asset-hero > div:first-child {
  flex: 1;
  min-width: 0;
}

#selectedAssetName {
  display: block;
  overflow: hidden;
  min-width: 0;
  font-size: clamp(28px, 4vw, 52px);
  line-height: 1;
  text-overflow: clip;
  white-space: nowrap;
}

.asset-hero .live-price-box {
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 740;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.05;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

.market-chip,
.panel-badge,
.live-price-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.live-price-box {
  display: grid;
  min-width: 164px;
  min-height: 58px;
  justify-items: end;
  border-radius: var(--radius);
  padding: 9px 12px;
}

body[data-theme="light"] .live-price-box {
  background: var(--app-bg);
}

.live-price-box span {
  color: var(--muted-2);
  font-size: 12px;
}

.live-price-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.price-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 16px rgba(0, 192, 118, 0.75);
}

.price-status-dot.is-slow {
  background: #f6a524;
  box-shadow: 0 0 16px rgba(246, 165, 36, 0.68);
}

.price-status-dot.is-stale {
  background: var(--red);
  box-shadow: 0 0 16px rgba(255, 82, 91, 0.68);
}

.live-price-box strong {
  color: var(--text);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.live-price-box strong.positive {
  color: var(--positive);
}

.live-price-box strong.negative {
  color: var(--negative);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 16px rgba(0, 192, 118, 0.75);
}

.ticker-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-top: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.metric {
  min-height: 118px;
  background: var(--surface-muted);
  padding: 22px;
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  flex-wrap: nowrap;
}

.metric-label-row .metric-label {
  min-width: 0;
}

.metric-label-toggle {
  display: inline-block;
  width: fit-content;
  border-bottom: 1px dashed rgba(141, 149, 163, 0.58);
  padding-bottom: 2px;
  cursor: pointer;
}

.metric-label-toggle:hover,
.metric-label-toggle:focus-visible {
  color: var(--muted);
  border-bottom-color: var(--muted);
  outline: 0;
}

.metric-unit-action {
  flex: 0 0 auto;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 18px;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1;
  word-break: break-word;
}

.asset-metrics .metric strong {
  display: block;
  overflow: visible;
  min-width: 0;
  width: 100%;
  font-size: 34px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  word-break: normal;
}

.asset-metrics .metric {
  display: grid;
  grid-template-rows: 24px auto;
  align-content: start;
  min-width: 0;
}

.asset-metrics .metric-label,
.asset-metrics .metric > .metric-label,
.asset-metrics .metric > .metric-label-row {
  display: flex;
  align-items: center;
  min-height: 24px;
  line-height: 1;
}

.asset-metrics .metric-label {
  flex: 0 1 auto;
  overflow: hidden;
  max-width: 100%;
  text-overflow: clip;
  white-space: nowrap;
}

.asset-metrics .metric-label-toggle {
  width: auto;
  max-width: 100%;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.panel-heading > div:first-child {
  min-width: 0;
}

.trade-entry-grid .entry-panel .panel-heading {
  align-items: center;
  flex-direction: row;
  flex-wrap: nowrap;
}

.trade-entry-grid .entry-panel .panel-heading > div:first-child {
  flex: 1;
}

#assetTradeTitle {
  display: block;
  overflow: hidden;
  min-width: 0;
  font-size: 18px;
  line-height: 1.2;
  text-overflow: clip;
  white-space: nowrap;
}

.trade-entry-grid .entry-panel .record-time-control {
  flex: 0 0 auto;
}

.panel-heading.compact {
  min-height: 66px;
}

.panel-heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.trade-form,
.asset-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 20px;
}

.asset-form {
  grid-template-columns: 1fr;
}

.segmented-control {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-control);
  padding: 4px;
}

.asset-trade-form .segmented-control {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.segmented-control label {
  display: grid;
  min-width: 0;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.segmented-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented-control input:checked + span {
  display: grid;
  width: 100%;
  min-height: 32px;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-selected);
  color: var(--surface-selected-text);
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

#assetTradeFeeField {
  position: relative;
}

.trade-fee-tools {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.trade-fee-settings-button {
  display: inline-grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-control);
  color: var(--muted);
  cursor: pointer;
  line-height: 0;
  padding: 0;
}

.trade-fee-settings-button:hover,
.trade-fee-settings-button:focus-visible,
.trade-fee-settings-button[aria-expanded="true"] {
  border-color: var(--line-strong);
  color: var(--text);
  outline: 0;
}

.trade-fee-settings-button svg {
  display: block;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.trade-fee-settings-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 22;
  display: grid;
  width: min(360px, calc(100vw - 40px));
  gap: 12px;
  border: 1px solid var(--line-popover);
  border-radius: 8px;
  background: var(--surface-popover);
  box-shadow: 0 18px 42px var(--shadow-elevated);
  padding: 14px;
}

.trade-fee-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.trade-fee-settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.trade-fee-settings-head strong {
  color: var(--text);
  font-size: 14px;
}

.trade-fee-settings-close {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-control);
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.trade-fee-settings-close:hover,
.trade-fee-settings-close:focus-visible {
  color: var(--text);
  outline: 0;
}

.trade-fee-settings-summary {
  display: grid;
  gap: 10px;
}

.trade-fee-setting-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-control);
  padding: 0 11px;
  color: var(--muted);
  font-size: 12px;
}

.trade-fee-setting-row strong {
  color: var(--text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.trade-fee-setting-row .trade-fee-setting-input {
  display: none;
  width: 122px;
  min-height: 32px;
  border-radius: 7px;
}

.trade-fee-setting-input input {
  font-size: 14px;
}

.trade-fee-settings-popover.is-editing .trade-fee-setting-row strong {
  display: none;
}

.trade-fee-settings-popover.is-editing .trade-fee-setting-row .trade-fee-setting-input {
  display: grid;
}

.trade-fee-auto-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
}

.trade-fee-settings-edit-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trade-fee-settings-actions .ghost-button,
.trade-fee-settings-actions .primary-button {
  min-width: 0;
  min-height: 34px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--radius);
}

.trade-fee-auto-row input {
  width: 15px;
  height: 15px;
  accent-color: var(--focus);
}

.record-time-control {
  position: relative;
  display: grid;
  justify-items: end;
  gap: 4px;
  margin-left: auto;
  color: var(--muted-2);
  font-size: 12px;
}

.record-time-button {
  border: 0;
  border-bottom: 1px dashed rgba(141, 149, 163, 0.68);
  background: transparent;
  color: var(--muted);
  padding: 0 0 2px;
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.record-time-button:hover,
.record-time-button:focus-visible {
  color: var(--text);
  border-bottom-color: var(--muted);
  outline: 0;
}

.record-time-input {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.trade-fee-preview {
  display: inline-block;
  flex: 0 0 auto;
  border-bottom: 1px dashed rgba(141, 149, 163, 0.58);
  padding-bottom: 2px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.trade-mode-toggle {
  display: inline-block;
  width: fit-content;
  border-bottom: 1px dashed rgba(141, 149, 163, 0.58);
  padding-bottom: 2px;
  color: inherit;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

#assetTradePriceLabel,
#assetTradeAmountLabel,
#assetTradeFeeLabel,
#assetTradeTagField > span,
#editAssetTradePriceLabel,
#editAssetTradeAmountLabel,
#editAssetTradeFeeLabel,
#editAssetTradeTagField > span {
  color: var(--text);
}

.trade-mode-toggle:hover,
.trade-mode-toggle:focus-visible {
  border-bottom-color: var(--muted);
  outline: 0;
}

.trade-mode-toggle.is-disabled {
  border-bottom-color: transparent;
  cursor: default;
}

.trade-mode-toggle.is-disabled:hover,
.trade-mode-toggle.is-disabled:focus-visible {
  border-bottom-color: transparent;
}

.input-wrap,
.select-input {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-control);
}

.input-wrap {
  display: grid;
  grid-template-columns: minmax(85px, 1fr) auto;
  align-items: center;
  padding: 0 14px;
}

.input-wrap:focus-within,
.select-input:focus {
  border-color: var(--focus);
}

.input-wrap input,
.select-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
}

.select-input {
  appearance: none;
  padding: 0 14px;
  cursor: pointer;
}

.select-input option {
  background: var(--surface);
  color: var(--text);
}

.income-fields {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 20px;
}

.cash-income-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.income-fields .income-amount-field {
  grid-column: 1 / -1;
}

.income-choice-field {
  position: relative;
  gap: 12px;
  min-width: 0;
}

.income-target-label {
  display: flex;
  align-items: baseline;
  min-width: 0;
  white-space: nowrap;
}

.income-target-label em {
  color: var(--muted-2);
  font-style: normal;
  font-size: 12px;
  font-weight: 520;
}

.income-choice-button {
  justify-self: center;
  width: fit-content;
  max-width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  font: inherit;
  font-size: 18px;
  font-weight: 760;
  line-height: 1.2;
  white-space: nowrap;
}

.income-choice-button span {
  display: inline-block;
  max-width: 100%;
  border-bottom: 1px dashed rgba(141, 149, 163, 0.68);
  padding-bottom: 3px;
  white-space: nowrap;
  overflow: visible;
}

.income-choice-button:hover span,
.income-choice-button:focus-visible span {
  border-bottom-color: var(--muted);
}

.income-choice-button:focus-visible {
  outline: 0;
}

.cash-income-fields .income-choice-button {
  justify-self: center;
  color: var(--text);
  text-align: center;
}

.cash-income-fields .transfer-asset-button {
  justify-self: center;
  min-height: 22px;
  color: var(--text);
  text-align: center;
  font-size: 18px;
  font-weight: 760;
  line-height: 1.2;
}

#investmentTransferAssetButton {
  justify-self: center;
  min-height: 22px;
  color: var(--text);
  text-align: center;
  font-size: 18px;
  font-weight: 760;
  line-height: 1.2;
}

.cash-income-fields .income-choice-button:hover,
.cash-income-fields .income-choice-button:focus-visible,
.cash-income-fields .transfer-asset-button:hover,
.cash-income-fields .transfer-asset-button:focus-visible,
#investmentTransferAssetButton:hover,
#investmentTransferAssetButton:focus-visible {
  color: var(--text);
}

.income-choice-picker {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 28;
  width: min(230px, calc(100vw - 48px));
  border: 1px solid var(--line-popover);
  border-radius: var(--radius);
  background: var(--surface-popover);
  box-shadow: 0 18px 54px var(--shadow-elevated);
  padding: 8px;
}

.income-choice-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.cash-income-source-field .income-choice-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.income-choice-option {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-control-strong);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
}

.income-choice-option:hover,
.income-choice-option[aria-selected="true"] {
  border-color: var(--line-selected);
  background: var(--surface-control-strong-hover);
}

#assetIncomeTypePicker,
#editAssetIncomeTypePicker {
  width: fit-content;
  max-width: min(var(--income-type-picker-max-width, 100vw), calc(100vw - 48px));
  padding: 10px;
}

#assetIncomeTypeOptions,
#editAssetIncomeTypeOptions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: max-content;
  max-width: 100%;
}

#assetIncomeTypeOptions .income-choice-option,
#editAssetIncomeTypeOptions .income-choice-option {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface-control);
  color: var(--muted);
  cursor: pointer;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

#assetIncomeTypeOptions .income-choice-option:hover,
#assetIncomeTypeOptions .income-choice-option[aria-selected="true"],
#editAssetIncomeTypeOptions .income-choice-option:hover,
#editAssetIncomeTypeOptions .income-choice-option[aria-selected="true"] {
  border-color: var(--line-selected);
  background: var(--surface-selected);
  color: var(--surface-selected-text);
}

.trade-tag-field {
  position: relative;
  grid-column: 1 / -1;
  gap: 10px;
  min-width: 0;
}

.trade-tag-button {
  width: fit-content;
  max-width: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
  padding: 0;
}

.trade-tag-button span {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  border-bottom: 0;
  padding-bottom: 0;
}

.trade-tag-button:not(.has-tags) span {
  display: inline-block;
  border-bottom: 1px dashed rgba(141, 149, 163, 0.56);
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
  padding-bottom: 2px;
  white-space: nowrap;
}

.trade-tag-button:hover span,
.trade-tag-button:focus-visible span {
  border-bottom-color: var(--muted);
}

.trade-tag-button:focus-visible {
  outline: 1px solid rgba(244, 245, 247, 0.54);
  outline-offset: 2px;
}

.trade-tag-picker {
  --trade-tag-picker-default-width: 584px;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: min(
    var(--trade-tag-picker-fit-width, var(--trade-tag-picker-default-width)),
    var(--trade-tag-picker-max-width, calc(100vw - 48px)),
    calc(100vw - 48px)
  );
  max-width: min(var(--trade-tag-picker-max-width, 100vw), calc(100vw - 48px));
  border: 1px solid var(--line-popover);
  border-radius: var(--radius);
  background: var(--surface-popover);
  box-shadow: 0 18px 54px var(--shadow-elevated);
  padding: 10px;
}

.trade-tag-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(var(--trade-tag-content-width, max-content), 100%);
  max-width: 100%;
  margin-bottom: 10px;
}

.trade-tag-picker-head strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.trade-tag-picker-head .text-action {
  flex: 0 0 auto;
  font-size: 12px;
}

.trade-tag-picker-head .text-action.active {
  color: var(--text);
}

.trade-tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: max-content;
  max-width: 100%;
}

.trade-tag-option {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface-control);
  color: var(--muted);
  cursor: pointer;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

body[data-theme="light"] .trade-tag-option {
  border-color: #d8e1ee;
  background: #f8fafc;
  box-shadow:
    inset 0 -1px 0 rgba(15, 23, 42, 0.06),
    0 1px 2px rgba(15, 23, 42, 0.04);
  color: #5f6f84;
}

.trade-tag-option:hover,
.trade-tag-option[aria-pressed="true"] {
  border-color: var(--line-selected);
  background: var(--surface-selected);
  color: var(--surface-selected-text);
}

body[data-theme="light"] .trade-tag-option:hover,
body[data-theme="light"] .trade-tag-option[aria-pressed="true"] {
  border-color: #c6d3e4;
  background: #eef3f9;
  box-shadow:
    inset 0 -1px 0 rgba(15, 23, 42, 0.08),
    0 2px 5px rgba(15, 23, 42, 0.06);
  color: #111827;
}

.trade-tag-editor {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  overflow-y: auto;
  max-height: 258px;
  min-width: 0;
}

.trade-tag-editor.hidden {
  display: none;
}

.trade-tag-editor.is-dragging {
  user-select: none;
}

.trade-tag-editor-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface);
  padding: 2px 5px 2px 4px;
  touch-action: none;
  transition:
    border-color 140ms ease,
    opacity 140ms ease,
    transform 140ms ease;
}

body[data-theme="light"] .trade-tag-editor-row {
  border-color: #d8e1ee;
  background: #f8fafc;
  box-shadow:
    inset 0 -1px 0 rgba(15, 23, 42, 0.06),
    0 1px 2px rgba(15, 23, 42, 0.04);
}

.trade-tag-editor-row.dragging {
  border-color: var(--line-selected);
  box-shadow: 0 14px 34px var(--shadow-elevated);
  cursor: grabbing;
  opacity: 0.96;
  pointer-events: none;
  position: fixed;
  transform: scale(1.02);
  z-index: 120;
}

.trade-tag-editor-handle,
.trade-tag-editor-delete {
  flex: 0 0 auto;
  border: 1px solid var(--line-soft);
  background: var(--surface-control);
  color: var(--muted);
  cursor: pointer;
}

body[data-theme="light"] .trade-tag-editor-handle {
  border-color: #d5dfec;
  background: #eef3f9;
  color: #66758a;
}

.trade-tag-editor-handle:hover,
.trade-tag-editor-handle:focus-visible {
  color: var(--text);
}

.trade-tag-editor-row.dragging .trade-tag-editor-handle {
  cursor: grabbing;
}

.trade-tag-editor-placeholder {
  flex: 0 0 auto;
  border: 1px dashed rgba(243, 245, 247, 0.42);
  border-radius: 999px;
  background: var(--surface-hover);
}

.trade-tag-editor-handle {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  border-radius: 7px;
  padding: 0;
  touch-action: none;
}

.trade-tag-editor-handle span {
  width: 11px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.trade-tag-editor-input-wrap {
  position: relative;
  display: inline-flex;
  min-width: 0;
  max-width: min(100%, 300px);
}

.trade-tag-editor-input {
  width: min(var(--tag-input-width, 58px), 290px);
  min-width: 38px;
  max-width: 100%;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--text);
  outline: 0;
  padding: 0 13px 0 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

body[data-theme="light"] .trade-tag-editor-input {
  border-color: #cfd9e8;
  background: #ffffff;
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.05);
}

.trade-tag-editor-input:focus {
  border-color: var(--line-selected);
}

.trade-tag-editor-input-measurer {
  left: -9999px;
  position: fixed;
  top: -9999px;
  visibility: hidden;
  white-space: pre;
}

.trade-tag-editor-delete {
  position: absolute;
  top: -5px;
  right: -5px;
  display: inline-grid;
  width: 15px;
  height: 15px;
  place-items: center;
  border-radius: 999px;
  padding: 0;
  color: rgba(244, 245, 247, 0.78);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

body[data-theme="light"] .trade-tag-editor-delete {
  border-color: #cbd5e1;
  background: #eef3f9;
  color: #334155;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.trade-tag-editor-delete:hover,
.trade-tag-editor-delete:focus-visible {
  border-color: rgba(248, 113, 113, 0.56);
  color: #fca5a5;
}

.trade-tag-editor-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.trade-tag-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: min(var(--trade-tag-content-width, max-content), 100%);
  max-width: 100%;
  margin-top: 8px;
}

#assetTradeTagAddButton:not(.hidden),
#editAssetTradeTagAddButton:not(.hidden) {
  margin-right: auto;
}

.trade-tag-form-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface-control);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 0 12px;
  white-space: nowrap;
}

.trade-side-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.trade-tag-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 150px;
}

.trade-tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border: 1px solid rgba(141, 149, 163, 0.28);
  border-radius: 999px;
  background: rgba(141, 149, 163, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 0 7px;
  white-space: nowrap;
}

.asset-analysis-category-field {
  position: relative;
  grid-column: 1 / -1;
  gap: 10px;
}

.asset-analysis-category-field .income-choice-button {
  justify-self: start;
  font-size: 16px;
}

.asset-analysis-category-picker {
  width: min(360px, calc(100vw - 48px));
  max-height: min(280px, calc(100vh - 160px));
  overflow-y: auto;
}

.asset-analysis-category-options {
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
}

.asset-analysis-category-control {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 650;
}

.asset-analysis-category-trigger {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  padding: 0;
}

.asset-analysis-category-trigger span {
  border-bottom: 1px dashed rgba(141, 149, 163, 0.68);
  padding-bottom: 3px;
}

.asset-analysis-category-trigger:hover span,
.asset-analysis-category-trigger:focus-visible span {
  border-bottom-color: var(--muted);
}

.asset-analysis-category-trigger:focus-visible {
  outline: 0;
}

.asset-analysis-category-control .asset-analysis-category-picker {
  top: calc(100% + 8px);
  left: 0;
}

@media (max-width: 720px) {
  .cash-income-fields {
    grid-template-columns: 1fr;
  }

  .income-fields {
    row-gap: 18px;
  }

  .income-choice-button {
    font-size: 16px;
  }

  .asset-analysis-category-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.input-wrap input::placeholder {
  color: var(--muted-2);
  font-size: 15px;
}

.input-wrap em {
  color: var(--muted-2);
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}

.rate-unit-toggle {
  border: 0;
  border-bottom: 1px dashed rgba(141, 149, 163, 0.58);
  background: transparent;
  padding: 0 0 3px;
  color: var(--muted-2);
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.rate-unit-toggle:hover,
.rate-unit-toggle:focus-visible {
  border-bottom-color: var(--muted);
  color: var(--text);
  outline: 0;
}

.clickable-label {
  border-bottom: 1px dashed rgba(141, 149, 163, 0.58);
  cursor: pointer;
  user-select: none;
  justify-self: start;
}

.clickable-label:hover {
  border-bottom-color: var(--muted);
  color: var(--text);
}

.rate-unit-toggle.plain-unit {
  border-bottom: 0;
  cursor: default;
  color: var(--muted);
}

.rate-unit-toggle.plain-unit:hover,
.rate-unit-toggle.plain-unit:focus-visible {
  border-bottom-color: transparent;
  color: var(--muted);
}

.preview-rate-unit {
  border-bottom: 1px dashed rgba(141, 149, 163, 0.58);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.preview-rate-unit:hover {
  border-bottom-color: var(--muted);
  color: var(--text);
}

.symbol-search-field {
  position: relative;
}

.transfer-asset-field {
  position: relative;
}

.transfer-asset-button {
  justify-self: start;
  min-height: 32px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  font-weight: 740;
}

.transfer-asset-button span {
  border-bottom: 1px dashed rgba(141, 149, 163, 0.58);
  padding-bottom: 3px;
}

.transfer-asset-button:hover span,
.transfer-asset-button:focus-visible span {
  border-bottom-color: var(--muted);
  color: var(--text);
}

.transfer-asset-picker {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 24;
  border: 1px solid var(--line-popover);
  border-radius: var(--radius);
  background: var(--surface-popover);
  box-shadow: 0 18px 54px var(--shadow-elevated);
  padding: 8px;
}

.transfer-asset-search {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-control);
  padding: 0 10px;
  color: var(--text);
  outline: 0;
}

.transfer-asset-options {
  display: grid;
  gap: 2px;
  overflow-y: auto;
  max-height: 260px;
  margin-top: 6px;
}

.transfer-asset-option,
.transfer-asset-empty {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 10px;
  color: var(--text);
  text-align: left;
}

.transfer-asset-option {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  cursor: pointer;
}

.transfer-asset-option:hover,
.transfer-asset-option[aria-selected="true"] {
  background: var(--surface-control-strong);
}

.transfer-asset-option strong {
  font-size: 14px;
}

.transfer-asset-option span,
.transfer-asset-empty {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.symbol-search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 12;
  overflow-y: auto;
  max-height: 338px;
  border: 1px solid var(--line-popover);
  border-radius: var(--radius);
  background: var(--surface-popover);
  box-shadow: 0 18px 54px var(--shadow-elevated);
  padding: 6px;
}

.symbol-search-filter-bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: -6px -6px 6px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--surface-popover);
  padding: 8px 8px 9px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

.symbol-search-filter-bar::-webkit-scrollbar {
  height: 8px;
}

.symbol-search-filter-bar::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

.symbol-search-filter-bar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: var(--scrollbar-thumb);
}

.symbol-search-filter {
  flex: 0 0 auto;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
  cursor: pointer;
}

.symbol-search-filter:hover,
.symbol-search-filter:focus-visible,
.symbol-search-filter[aria-selected="true"] {
  border-color: rgba(96, 165, 250, 0.58);
  background: rgba(37, 99, 235, 0.18);
  color: #dbeafe;
  outline: 0;
}

body[data-theme="light"] .symbol-search-filter:hover,
body[data-theme="light"] .symbol-search-filter:focus-visible {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1e3a8a;
}

body[data-theme="light"] .symbol-search-filter[aria-selected="true"] {
  border-color: #2563eb;
  background: #2563eb;
  color: #ffffff;
}

body[data-theme="light"] .symbol-search-filter[aria-selected="true"]:hover,
body[data-theme="light"] .symbol-search-filter[aria-selected="true"]:focus-visible {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #ffffff;
}

.symbol-result,
.symbol-result-status {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 12px;
  color: var(--text);
  text-align: left;
}

.symbol-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  cursor: pointer;
}

.symbol-result + .symbol-result {
  border-top: 1px solid var(--line-soft);
}

.symbol-result:hover,
.symbol-result:focus-visible {
  background: var(--surface-control-strong);
  outline: 0;
}

.symbol-result-main {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 10px;
}

.symbol-result-symbol {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 16px;
  font-weight: 760;
}

.symbol-result-name {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.symbol-result-meta {
  grid-column: 1 / 2;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.symbol-result-tag {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 4px 8px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.symbol-result-status {
  color: var(--muted);
  font-size: 13px;
}

.symbol-result-status.error {
  color: var(--red);
}

.selected-symbol-meta {
  min-height: 40px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.preview-row {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 0 14px;
  color: var(--muted);
}

.preview-row strong {
  color: var(--positive);
  font-size: 17px;
  white-space: nowrap;
}

.form-actions {
  display: flex;
  grid-column: 1 / -1;
  gap: 10px;
}

.form-actions .primary-button {
  flex: 1;
  min-width: 0;
}

.asset-trade-form .form-actions {
  grid-column: 1 / -1;
}

.form-actions .ghost-button {
  min-height: 48px;
}

.primary-button,
.ghost-button,
.edit-button,
.delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.primary-button {
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
  font-weight: 760;
}

.primary-button:hover,
.ghost-button:hover,
.edit-button:hover,
.delete-button:hover,
.asset-card:hover {
  transform: translateY(-1px);
}

.ghost-button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  padding: 0 14px;
  color: var(--muted);
}

.ghost-button.danger {
  border-color: rgba(255, 91, 91, 0.25);
  color: var(--red);
}

.trade-tag-actions .ghost-button,
.trade-tag-actions .primary-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 34px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1;
}

.trade-tag-actions .primary-button {
  min-width: 52px;
}

.edit-button {
  min-height: 32px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  padding: 0 12px;
  color: var(--muted);
}

.delete-button {
  min-width: 34px;
  min-height: 32px;
  border: 1px solid rgba(255, 91, 91, 0.25);
  background: var(--red-soft);
  color: var(--red);
}

.text-action {
  min-height: 24px;
  border: 0;
  border-bottom: 1px dashed rgba(141, 149, 163, 0.58);
  background: transparent;
  padding: 0 0 2px;
  color: var(--muted-2);
  cursor: pointer;
  font-size: 12px;
}

.text-action:hover {
  color: var(--muted);
  border-bottom-color: var(--muted);
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.form-error {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--red);
  font-size: 13px;
}

.chart-panel {
  min-height: 100%;
}

.position-overview-panel {
  min-height: 0;
  overflow: hidden;
}

.position-share-card {
  display: grid;
  flex: 1;
  place-items: center;
  min-height: 0;
  margin: 12px 18px 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-chart-soft);
}

.position-share-ring {
  display: block;
  width: min(100%, 190px);
  height: auto;
  overflow: visible;
  grid-area: 1 / 1;
}

.position-share-track,
.position-share-arc {
  fill: none;
  stroke-width: 10;
}

.position-share-track {
  stroke: var(--chart-grid);
}

.position-share-arc {
  stroke: var(--positive);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
}

.position-share-copy {
  display: grid;
  place-items: center;
  gap: 4px;
  text-align: center;
  grid-area: 1 / 1;
  pointer-events: none;
}

.position-share-copy strong {
  color: var(--text);
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.position-share-copy span {
  color: var(--muted);
  font-size: 12px;
}

.position-summary-list {
  margin-top: 6px;
}

.asset-summary-menu {
  position: relative;
  display: flex;
  justify-content: center;
}

.asset-summary-toggle {
  font-size: 13px;
}

.position-summary-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 15;
  width: min(360px, calc(100vw - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 54px var(--shadow-elevated);
}

.position-summary-popover.hidden {
  display: none;
}

.position-summary-popover .position-summary-list {
  margin-top: 0;
}

.position-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--line-soft);
}

.position-summary-row:first-child {
  border-top: 0;
}

.position-summary-row > span {
  color: var(--muted);
  font-size: 14px;
}

.position-summary-value-group {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.position-summary-value {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  justify-self: end;
}

.position-summary-value-button {
  display: inline-block;
  min-height: 0;
  border: 0;
  border-bottom: 1px dashed rgba(141, 149, 163, 0.58);
  background: transparent;
  padding: 0 0 3px;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.position-summary-value-button:hover,
.position-summary-value-button:focus-visible {
  border-bottom-color: var(--muted);
  color: var(--text);
  outline: 0;
}

.asset-detail-actions {
  display: flex;
  justify-content: center;
  position: absolute;
  top: calc(100% + 32px);
  left: 0;
  right: 0;
  margin-top: 0;
}

.asset-detail-actions .ghost-button.danger {
  min-width: 160px;
}

.mini-chart {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: 8px;
  height: 176px;
  margin: 20px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 25%,
    var(--surface-chart-soft);
  padding: 18px 16px 0;
}

.mini-chart span {
  min-height: 12px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--positive), var(--positive-muted));
}

.mini-chart span:nth-child(3n),
.trade-chart span:nth-child(2n) {
  background: linear-gradient(180deg, var(--yellow), rgba(244, 200, 74, 0.12));
}

.rate-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 20px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 14px;
}

.rate-line strong {
  color: var(--text);
}

.table-panel {
  margin-top: 16px;
}

#assetTradesTablePanel .table-wrap {
  min-height: 200px;
}

#assetTradesTablePanel table {
  min-width: 1080px;
}

#fundingTablePanel {
  flex: 1;
  display: flex;
  flex-direction: column;
}

#fundingTablePanel .table-wrap {
  flex: 1;
}

.table-wrap {
  position: relative;
  overflow: auto;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

th,
td {
  height: 58px;
  border-bottom: 1px solid var(--line-soft);
  padding: 0 20px;
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
}

td {
  color: var(--text-table);
  font-size: 14px;
}

td.numeric {
  font-variant-numeric: tabular-nums;
}

.holding-row {
  will-change: transform;
  transition: opacity 140ms ease;
}

.holding-row.dragging {
  opacity: 0.46;
  position: relative;
  z-index: 1;
}

.holding-name {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.holding-drag-handle {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-content: center;
  gap: 3px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted-2);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.holding-drag-handle:active {
  cursor: grabbing;
}

.holding-drag-active {
  cursor: grabbing;
  user-select: none;
}

.holding-drag-handle span {
  display: block;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.holding-drag-handle:hover,
.holding-drag-handle:focus-visible {
  color: var(--muted);
  outline: 0;
}

.positive {
  color: var(--positive);
}

.negative {
  color: var(--negative);
}

.side-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 760;
}

.side-pill.buy {
  background: var(--positive-soft);
  color: var(--positive);
}

.side-pill.sell {
  background: var(--negative-soft);
  color: var(--negative);
}

.side-pill.income {
  background: rgba(82, 168, 255, 0.14);
  color: #8fc4ff;
}

td:last-child,
th:last-child {
  width: 128px;
  text-align: right;
}

.action-cell {
  white-space: nowrap;
}

.action-cell .edit-button {
  margin-right: 8px;
}

.empty-state {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--muted-2);
  text-align: center;
}

.empty-state span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 22px;
}

.empty-state p {
  margin: 10px 0 0;
}

.has-records .empty-state {
  display: none;
}

.compact-empty {
  min-height: 72px;
}

.compact-empty p {
  margin: 0;
}

.assets-layout {
  display: grid;
  grid-template-areas:
    "list detail note";
  grid-template-columns: 310px minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px;
  align-items: stretch;
  min-height: calc(100vh - 140px);
  margin-top: 22px;
}

.assets-layout:has(#assetDetailPanel:not(.hidden)) {
  margin-bottom: 84px;
}

.asset-list-panel {
  grid-area: list;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  height: auto;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

.asset-list-panel:has(#assetAnalysisCategoryPicker:not(.hidden)) {
  overflow: visible;
  z-index: 45;
}

.asset-category-tabs {
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding: 12px 14px 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.asset-category-tabs button {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--surface-control);
  color: var(--muted);
  cursor: pointer;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.asset-category-tabs button.active {
  border-color: var(--line-selected);
  background: var(--surface-selected);
  color: var(--surface-selected-text);
}

.asset-list {
  display: grid;
  flex: 1;
  min-height: 0;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding: 12px 14px 14px;
  contain: size;
  overflow-y: auto;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  align-content: start;
}

.asset-card {
  display: flex;
  align-items: flex-start;
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--text);
  cursor: default;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
  will-change: transform;
}

.asset-card.active {
  border-color: var(--line-selected);
  background: var(--surface-card-active);
}

.asset-card.dragging {
  opacity: 0.46;
  position: relative;
  z-index: 1;
}

.asset-drag-active {
  cursor: grabbing;
  user-select: none;
}

.asset-drag-handle {
  display: inline-grid;
  flex: 0 0 auto;
  align-self: stretch;
  place-content: center;
  gap: 3px;
  width: 28px;
  min-height: 48px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted-2);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.asset-drag-handle:active {
  cursor: grabbing;
}

.asset-drag-handle span {
  display: block;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.asset-drag-handle:hover,
.asset-drag-handle:focus-visible {
  color: var(--muted);
  outline: 0;
}

.asset-card-body {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 5px;
  padding: 12px 12px 12px 4px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.asset-card-body strong {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 7px;
  font-size: 16px;
}

.asset-card-body span {
  color: var(--muted);
  font-size: 12px;
}

.asset-card-body .asset-note-mark {
  flex: 0 0 auto;
  border: 1px solid rgba(244, 245, 247, 0.22);
  border-radius: 999px;
  padding: 2px 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  line-height: 1;
}

body[data-theme="light"] .asset-card-body .asset-note-mark {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.82);
  color: #59677a;
}

.asset-card-price {
  display: flex;
  align-items: center;
  padding: 0 14px 0 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--text);
  align-self: stretch;
}

.asset-card-price.positive {
  color: var(--positive);
}

.asset-card-price.negative {
  color: var(--negative);
}

.asset-detail {
  grid-area: detail;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
}

.asset-detail-content {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  min-height: 100%;
  overflow: visible;
}

.empty-asset-panel {
  flex: 1;
  min-height: 420px;
}

.asset-note-panel {
  grid-area: note;
  align-self: start;
  position: sticky;
  top: 24px;
  display: flex;
  min-height: 360px;
  max-height: calc(100vh - 48px);
  flex-direction: column;
  overflow: hidden;
}

.xiaoyu-assistant-panel {
  grid-area: assistant;
  align-self: start;
  position: sticky;
  top: 24px;
  display: flex;
  min-height: 360px;
  max-height: calc(100vh - 48px);
  flex-direction: column;
  overflow: hidden;
}

.asset-note-float-button {
  display: none;
}

.investment-notebook-panel {
  width: min(320px, calc(100vw - 32px));
  min-height: 360px;
  max-height: calc(100vh - 128px);
  box-shadow: var(--shadow-soft);
}

.investment-notebook-panel.hidden {
  display: none !important;
}

.overview-top-actions,
.report-assistant-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.report-top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.overview-top-actions > .notebook-trigger-button,
.overview-top-actions > .assistant-trigger-button,
.report-assistant-actions > .notebook-trigger-button,
.report-assistant-actions > .assistant-trigger-button {
  width: 84px;
  justify-content: center;
}

.notebook-trigger-button {
  display: none;
}

.assistant-trigger-button {
  display: none;
}

.notebook-trigger-button.is-floating,
.assistant-trigger-button.is-floating {
  position: fixed;
  top: 116px;
  right: 6px;
  z-index: 79;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  min-width: 38px;
  height: 116px;
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px 0 0 8px;
  background: var(--button-primary-bg);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.36);
  color: var(--button-primary-text);
  cursor: grab;
  font-size: 13px;
  font-weight: 820;
  letter-spacing: 0;
  line-height: 1.2;
  padding: 12px 0;
  text-align: center;
  touch-action: none;
  user-select: none;
  will-change: transform;
  writing-mode: vertical-rl;
  transform-origin: right center;
  transition:
    opacity 160ms ease,
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.notebook-trigger-button.is-floating:hover:not(.is-dragging),
.notebook-trigger-button.is-floating:focus-visible:not(.is-dragging),
.assistant-trigger-button.is-floating:hover:not(.is-dragging),
.assistant-trigger-button.is-floating:focus-visible:not(.is-dragging) {
  outline: 0;
  transform: translateX(-2px) scale(1.04);
}

.notebook-trigger-button.is-floating.is-dragging,
.assistant-trigger-button.is-floating.is-dragging {
  cursor: grabbing;
  transform: none;
  transition: none;
}

.notebook-trigger-button.is-floating[aria-expanded="true"],
.assistant-trigger-button.is-floating[aria-expanded="true"] {
  opacity: 0;
  pointer-events: none;
}

.investment-notebook-panel.is-floating-open,
.xiaoyu-assistant-panel.is-floating-open {
  position: fixed;
  top: 116px;
  right: 26px;
  z-index: 80;
  width: min(360px, calc(100vw - 52px));
  max-height: calc(100vh - 148px);
  box-shadow: 0 24px 80px var(--shadow-elevated);
}

.xiaoyu-assistant-panel.hidden {
  display: none !important;
}

.xiaoyu-assistant-heading {
  gap: 10px;
}

.xiaoyu-assistant-title-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.xiaoyu-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface-control);
  color: var(--brand-mark-color);
}

.xiaoyu-avatar svg {
  display: block;
  width: 34px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.xiaoyu-avatar circle {
  fill: currentColor;
  stroke: none;
}

.xiaoyu-assistant-messages {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  overflow-y: auto;
}

.xiaoyu-assistant-messages::before {
  content: "暂未调试";
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0;
  opacity: 0.1;
  pointer-events: none;
}

body[data-theme="light"] .xiaoyu-assistant-messages::before {
  color: #0f172a;
  opacity: 0.24;
}

.xiaoyu-message {
  position: relative;
  z-index: 1;
  display: grid;
  max-width: 92%;
  gap: 5px;
}

.xiaoyu-message.assistant {
  align-self: flex-start;
}

.xiaoyu-message.user {
  align-self: flex-end;
  justify-items: end;
}

.xiaoyu-message-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.xiaoyu-message-bubble {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.xiaoyu-message.assistant .xiaoyu-message-bubble {
  border-color: #303846;
  background: #1a202a;
}

body[data-theme="light"] .xiaoyu-message.assistant .xiaoyu-message-bubble {
  border-color: #b9c8dc;
  background: var(--app-bg);
}

.xiaoyu-message.user .xiaoyu-message-bubble {
  border-color: var(--line-selected);
  background: var(--surface-selected);
  color: var(--surface-selected-text);
}

.xiaoyu-message.is-error .xiaoyu-message-bubble {
  border-color: var(--red-muted);
  background: var(--red-soft);
}

.xiaoyu-retry-button {
  justify-self: start;
  font-size: 12px;
}

.xiaoyu-assistant-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  border-top: 1px solid var(--line-soft);
  padding: 12px;
}

.xiaoyu-assistant-input {
  width: 100%;
  min-height: 48px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-input);
  color: var(--text);
  padding: 9px 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
}

.xiaoyu-assistant-input::placeholder {
  color: var(--muted-2);
}

.xiaoyu-assistant-input:focus {
  outline: 0;
  border-color: var(--line-selected);
  box-shadow: 0 0 0 3px var(--focus-ring-soft);
}

.xiaoyu-assistant-input:disabled {
  opacity: 1;
  background: var(--surface-input);
  color: var(--text);
  -webkit-text-fill-color: var(--text);
  cursor: wait;
}

.xiaoyu-assistant-hint {
  margin: 0;
  border-top: 1px solid var(--line-soft);
  padding: 9px 12px 11px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

@media (min-width: 1801px) {
  :root {
    --side-stack-width: 320px;
    --side-stack-right: max(24px, calc((100vw - 232px - 1680px) / 2 + 24px));
  }

  body:has(#investmentView.active) .workspace,
  body:has(#reportsView.active) .workspace {
    display: grid;
    width: min(1680px, 100%);
    padding-right: calc(24px + var(--side-stack-width) + 16px);
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "main";
    align-items: start;
    gap: 16px;
  }

  body:has(#assetsView.active) .workspace {
    padding-right: calc(24px + var(--side-stack-width) + 16px);
  }

  body:has(#assetsView.active) .assets-layout {
    grid-template-areas: "list detail";
    grid-template-columns: 310px minmax(0, 1fr);
  }

  body:has(#investmentView.active) #investmentView.active,
  body:has(#reportsView.active) #reportsView.active {
    grid-area: main;
    min-width: 0;
  }

  body:has(#assetsView.active) .asset-note-panel:not(.investment-notebook-panel),
  .investment-notebook-panel.is-docked {
    grid-area: note;
    position: fixed;
    top: var(--side-stack-top, 24px);
    right: var(--side-stack-right);
    width: var(--side-stack-width);
    min-height: 0;
    max-height: var(--side-stack-max-height, calc(100vh - 24px - var(--side-stack-bottom, 24px)));
    z-index: 12;
    box-shadow: none;
    transform: translate3d(0, var(--side-stack-offset-y, 0px), 0);
    will-change: transform;
  }

  .xiaoyu-assistant-panel.is-docked {
    grid-area: note;
    position: fixed;
    top: var(--side-stack-top, 400px);
    right: var(--side-stack-right);
    width: var(--side-stack-width);
    height: var(--side-stack-height, min(560px, calc(100vh - 24px - var(--side-stack-bottom, 24px))));
    min-height: 0;
    max-height: calc(100vh - 24px - var(--side-stack-bottom, 24px));
    z-index: 12;
    box-shadow: none;
    transform: translate3d(0, var(--side-stack-offset-y, 0px), 0);
    will-change: transform;
  }
}

.asset-note-clear {
  border-bottom: 1px dashed currentColor;
  padding: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
}

.asset-note-clear:disabled {
  color: var(--muted-2);
  cursor: not-allowed;
  opacity: 0.58;
}

.asset-note-body {
  position: relative;
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
}

.asset-note-compose {
  display: grid;
  gap: 10px;
}

.asset-note-input {
  width: 100%;
  min-height: 88px;
  max-height: 180px;
  resize: none;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  outline: 0;
  background: #08090b;
  padding: 13px 14px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
}

body[data-theme="light"] .asset-note-input {
  border-color: #d6e0ec;
  background: #f8fafc;
  color: #111827;
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.05);
}

.asset-note-compose-actions,
.asset-note-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.asset-note-edit-actions {
  align-items: flex-start;
}

.asset-note-compose-actions .primary-button,
.asset-note-edit-actions .primary-button,
.asset-note-edit-actions .ghost-button {
  flex: 0 0 auto;
  min-width: 58px;
  min-height: 32px;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.asset-note-edit-actions .asset-note-color-options {
  flex: 1 1 auto;
  min-width: 0;
}

.asset-note-edit-buttons {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.asset-note-color-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.asset-note-color-button {
  width: 20px;
  height: 20px;
  border: 1px solid;
  border-radius: 999px;
  padding: 0;
  cursor: pointer;
}

.asset-note-color-button[aria-pressed="true"] {
  box-shadow: 0 0 0 2px #f4f5f7;
}

body[data-theme="light"] .asset-note-color-button[aria-pressed="true"] {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px rgba(59, 130, 246, 0.35);
}

.asset-note-input::placeholder {
  color: var(--muted-2);
}

.asset-note-input:focus {
  border-color: rgba(244, 245, 247, 0.54);
  box-shadow: 0 0 0 1px rgba(244, 245, 247, 0.08);
}

body[data-theme="light"] .asset-note-input:focus {
  border-color: #9fb4cf;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.asset-note-input:disabled {
  color: transparent;
  caret-color: transparent;
  cursor: default;
}

.asset-note-panel.is-private .asset-note-compose,
.asset-note-panel.is-private .asset-note-list {
  visibility: hidden;
}

.asset-note-list {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 2px;
}

.asset-note-empty {
  display: grid;
  min-height: 130px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted-2);
  font-size: 13px;
}

.asset-note-card {
  border: 1px solid var(--note-border, var(--line-soft));
  border-radius: 8px;
  background: var(--note-bg, #111318);
  padding: 10px;
  color: var(--text);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  will-change: transform;
}

body[data-theme="light"] .asset-note-card {
  color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.asset-note-card.dragging {
  opacity: 0.52;
  position: relative;
  z-index: 1;
}

.asset-note-drag-active {
  cursor: grabbing;
  user-select: none;
}

.asset-note-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(244, 245, 247, 0.5);
  font-size: 11px;
}

body[data-theme="light"] .asset-note-card-head {
  color: rgba(255, 255, 255, 0.5);
}

.asset-note-drag-handle {
  display: inline-grid;
  flex: 0 0 auto;
  place-content: center;
  gap: 3px;
  width: 24px;
  min-height: 24px;
  border: 0;
  background: transparent;
  padding: 0;
  color: rgba(244, 245, 247, 0.34);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

body[data-theme="light"] .asset-note-drag-handle {
  color: rgba(255, 255, 255, 0.34);
}

.asset-note-drag-handle span {
  display: block;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.asset-note-drag-handle:hover,
.asset-note-drag-handle:focus-visible {
  color: rgba(244, 245, 247, 0.62);
  outline: 0;
}

body[data-theme="light"] .asset-note-drag-handle:hover,
body[data-theme="light"] .asset-note-drag-handle:focus-visible {
  color: rgba(255, 255, 255, 0.72);
}

.asset-note-card-content {
  margin: 9px 0 10px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

body[data-theme="light"] .asset-note-card-content {
  color: rgba(255, 255, 255, 0.92);
}

.asset-note-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.asset-note-card-actions .text-action,
.asset-note-clear {
  font-size: 12px;
}

.asset-note-card-actions .text-action {
  color: rgba(148, 163, 184, 0.58);
}

body[data-theme="light"] .asset-note-card-actions .text-action {
  color: rgba(226, 232, 240, 0.72);
}

.asset-note-card-actions .text-action:hover,
.asset-note-card-actions .text-action:focus-visible {
  color: rgba(226, 232, 240, 0.82);
}

body[data-theme="light"] .asset-note-card-actions .text-action:hover,
body[data-theme="light"] .asset-note-card-actions .text-action:focus-visible {
  color: rgba(255, 255, 255, 0.92);
}

.asset-note-card-actions .danger {
  color: rgba(248, 113, 113, 0.5);
}

body[data-theme="light"] .asset-note-card-actions .danger {
  color: rgba(248, 113, 113, 0.78);
}

.asset-note-card-actions .danger:hover,
.asset-note-card-actions .danger:focus-visible {
  color: rgba(248, 113, 113, 0.86);
}

body[data-theme="light"] .asset-note-card-actions .danger:hover,
body[data-theme="light"] .asset-note-card-actions .danger:focus-visible {
  color: rgba(254, 202, 202, 0.95);
}

.asset-note-edit-input {
  width: 100%;
  min-height: 110px;
  margin: 9px 0 10px;
  resize: vertical;
  border: 1px solid rgba(244, 245, 247, 0.34);
  border-radius: 6px;
  outline: 0;
  background: rgba(5, 6, 8, 0.6);
  padding: 10px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
}

body[data-theme="light"] .asset-note-edit-input {
  border-color: rgba(148, 163, 184, 0.44);
  background: rgba(255, 255, 255, 0.68);
  color: #111827;
}

.asset-note-private {
  position: absolute;
  inset: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #08090b;
  color: #ffffff;
  font-size: 22px;
  font-weight: 780;
  letter-spacing: 0.12em;
  pointer-events: none;
}

.asset-note-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line-soft);
  padding: 10px 14px;
  color: var(--muted-2);
  font-size: 12px;
}

.asset-note-footer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-note-sort-button {
  border-bottom: 1px dashed currentColor;
  padding: 0 0 2px;
  font-size: 12px;
}

.asset-note-sort-button:disabled {
  color: var(--muted-2);
  cursor: default;
  opacity: 0.58;
}

@media (min-width: 1051px) and (max-width: 1800px) {
  body:has(#assetsView.active) .workspace,
  body:has(#investmentView.active) .workspace,
  body:has(#reportsView.active) .workspace {
    width: min(1480px, calc(100% - 72px));
  }

  .assets-layout {
    grid-template-areas: "list detail";
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .asset-note-panel:not(.investment-notebook-panel),
  .investment-notebook-panel.is-floating-open,
  .xiaoyu-assistant-panel.is-floating-open {
    position: fixed;
    top: 116px;
    right: 26px;
    z-index: 80;
    width: min(360px, calc(100vw - 52px));
    max-height: calc(100vh - 148px);
    box-shadow: 0 24px 80px var(--shadow-elevated);
    opacity: 0;
    pointer-events: none;
    transform: translateX(16px) scale(0.98);
    transition:
      opacity 180ms ease,
      transform 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .asset-note-panel:not(.investment-notebook-panel).is-floating-open,
  .investment-notebook-panel.is-floating-open,
  .xiaoyu-assistant-panel.is-floating-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) scale(1);
  }

  .asset-note-panel:not(.investment-notebook-panel):not(.is-floating-open),
  .xiaoyu-assistant-panel:not(.is-floating-open) {
    visibility: hidden;
  }

  body:has(#assetsView.active) .asset-note-float-button:not(.notebook-trigger-button) {
    position: fixed;
    top: 116px;
    right: 6px;
    z-index: 79;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 116px;
    border: 1px solid var(--line);
    border-radius: 8px 0 0 8px;
    background: var(--button-primary-bg);
    color: var(--button-primary-text);
    cursor: grab;
    font-size: 13px;
    font-weight: 820;
    line-height: 1.2;
    user-select: none;
    touch-action: none;
    writing-mode: vertical-rl;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.36);
    transform-origin: right center;
    transition:
      opacity 160ms ease,
      transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .asset-note-float-button:not(.notebook-trigger-button):hover:not(.is-dragging),
  .asset-note-float-button:not(.notebook-trigger-button):focus-visible:not(.is-dragging) {
    transform: translateX(-2px) scale(1.04);
  }

  .asset-note-float-button:not(.notebook-trigger-button).is-dragging {
    cursor: grabbing;
    transform: none;
    transition: none;
  }

  .asset-note-float-button:not(.notebook-trigger-button)[aria-expanded="true"] {
    opacity: 0;
    pointer-events: none;
  }
}

.trade-entry-grid {
  align-items: stretch;
  min-height: 0;
  margin-top: 16px;
}

.asset-price-panel {
  grid-column: 1 / -1;
  overflow: visible;
}

.asset-chart-toolbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  border-bottom: 1px solid var(--line-soft);
  padding: 6px 10px;
}

.asset-chart-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  max-width: 100%;
}

.asset-chart-tabs button {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  padding: 0 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.asset-chart-tabs button:hover,
.asset-chart-tabs button:focus-visible,
.asset-chart-tabs button.active {
  border-color: var(--line-selected);
  background: var(--surface-selected);
  color: var(--surface-selected-text);
  outline: 0;
}

.asset-chart-tabs button:disabled,
.asset-chart-tabs button.is-disabled,
.asset-option-grid button:disabled,
.asset-option-grid button.is-disabled,
.asset-indicator-bar button:disabled,
.asset-indicator-bar button.is-disabled {
  border-color: transparent;
  background: transparent;
  color: var(--text-disabled);
  cursor: not-allowed;
  opacity: 1;
}

.asset-chart-tabs button:disabled:hover,
.asset-chart-tabs button:disabled:focus-visible,
.asset-option-grid button:disabled:hover,
.asset-option-grid button:disabled:focus-visible,
.asset-indicator-bar button:disabled:hover,
.asset-indicator-bar button:disabled:focus-visible {
  border-color: transparent;
  background: transparent;
  color: var(--text-disabled);
  outline: 0;
}

.asset-chart-periods,
.asset-chart-toolbox {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.asset-chart-periods {
  flex: 1;
}

.asset-chart-more,
.asset-chart-toolbox {
  position: relative;
  flex: 0 0 auto;
}

.asset-more-periods-button {
  min-height: 28px;
  font-size: 12px;
}

.chart-icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.chart-icon-button:hover,
.chart-icon-button:focus-visible,
.chart-icon-button[aria-expanded="true"] {
  border-color: var(--line);
  background: var(--panel-soft);
  color: var(--text);
  outline: 0;
}

.chart-icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.chart-icon-button circle {
  fill: var(--panel);
}

.chart-icon-button .settings-center-dot {
  fill: currentColor;
  stroke: none;
}

.asset-chart-popover {
  position: absolute;
  top: calc(100% + 8px);
  z-index: 25;
  width: min(560px, calc(100vw - 48px));
  max-height: min(70vh, 560px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-popover-soft);
  box-shadow: 0 18px 54px var(--shadow-elevated);
  padding: 12px;
}

.asset-period-popover {
  right: 0;
  left: auto;
  width: min(260px, calc(100vw - 28px));
  overflow-x: hidden;
}

.asset-indicator-popover,
.asset-display-popover {
  right: 0;
}

.asset-indicator-popover {
  width: min(360px, calc(100vw - 48px));
  padding: 16px 18px;
}

.asset-chart-popover.hidden {
  display: none;
}

.asset-popover-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 9px;
}

.asset-popover-heading strong,
.indicator-section p,
.asset-display-popover p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
}

.asset-popover-heading span {
  color: var(--muted-2);
  font-size: 11px;
}

.asset-period-edit-button {
  border-bottom: 1px dashed currentColor;
  padding: 0 0 2px;
  color: var(--muted);
  font-size: 12px;
}

.asset-period-edit-button:hover,
.asset-period-edit-button:focus-visible,
.asset-period-edit-button.active {
  color: var(--text);
}

.asset-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
  gap: 6px;
}

.asset-option-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
}

.asset-option-grid button {
  min-height: 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--surface-control-strong);
  color: var(--text);
  cursor: pointer;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.asset-period-popover .asset-option-grid {
  grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
}

.asset-period-popover .asset-option-grid button {
  padding: 0 8px;
}

.asset-period-popover .asset-option-grid button.editing:not(.active) {
  color: var(--muted-2);
}

.asset-period-limit-hint {
  display: block;
  min-height: 16px;
  margin: 8px 0 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.asset-period-limit-hint:empty {
  display: none;
}

.asset-period-edit-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.asset-period-edit-actions.hidden {
  display: none;
}

.asset-period-selection-count {
  margin-right: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.asset-period-edit-actions .primary-button,
.asset-period-edit-actions .ghost-button {
  min-height: 28px;
  border-radius: 999px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 760;
}

.asset-option-grid button:hover,
.asset-option-grid button:focus-visible,
.asset-option-grid button.active {
  border-color: var(--line-selected);
  outline: 0;
}

.asset-option-grid button.selected {
  color: var(--positive);
}

.indicator-section + .indicator-section {
  margin-top: 18px;
}

.indicator-section p {
  margin-bottom: 11px;
  font-size: 14px;
}

.asset-indicator-popover .asset-option-grid.compact {
  grid-template-columns: repeat(auto-fit, 58px);
  gap: 8px 7px;
}

.asset-indicator-popover .asset-option-grid button {
  width: 58px;
  min-width: 0;
  min-height: 26px;
  padding: 0;
  font-size: 11px;
}

.indicator-settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.indicator-settings-grid label,
.asset-display-popover label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.indicator-settings-grid input {
  width: min(160px, 58%);
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-control);
  padding: 0 8px;
  color: var(--text);
}

.asset-display-popover {
  width: min(236px, calc(100vw - 48px));
  padding: 16px 18px;
}

.asset-display-popover p {
  margin-bottom: 10px;
  font-size: 14px;
}

.asset-display-section + .asset-display-section {
  margin-top: 14px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}

.asset-display-popover label {
  justify-content: flex-start;
  min-height: 34px;
  gap: 14px;
  font-size: 13px;
}

.asset-display-popover input {
  accent-color: var(--button-primary-bg);
}

.asset-candle-chart-wrap {
  position: relative;
  min-height: 220px;
  height: clamp(260px, 34vh, 390px);
  background: var(--surface-chart);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.asset-candle-chart-wrap.dragging {
  cursor: grabbing;
}

.asset-candle-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.asset-candle-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--muted-2);
  font-size: 13px;
  pointer-events: none;
}

.asset-candle-empty.hidden {
  display: none;
}

.asset-indicator-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 38px;
  border-top: 1px solid var(--line-soft);
  padding: 0 10px;
  overflow-x: auto;
}

.asset-indicator-bar-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.asset-indicator-bar button {
  min-height: 28px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.asset-indicator-bar button:hover,
.asset-indicator-bar button:focus-visible,
.asset-indicator-bar button.active {
  color: var(--text);
  outline: 0;
}

body[data-theme="light"] .asset-indicator-bar button.active {
  font-weight: 760;
}

.asset-indicator-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
  flex: 0 0 auto;
}

.asset-trade-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.entry-panel,
.position-overview-panel {
  display: flex;
  flex-direction: column;
}

.entry-panel {
  container-type: inline-size;
}

.trade-entry-grid .entry-panel .panel-heading,
.trade-entry-grid .position-overview-panel .panel-heading {
  min-height: 58px;
  padding: 14px 18px;
}

.trade-entry-grid .asset-trade-form {
  gap: 10px 12px;
  padding: 14px 18px 12px;
}

.trade-entry-grid .asset-trade-form .field {
  gap: 6px;
  font-size: 12px;
}

.trade-entry-grid .asset-trade-form .segmented-control {
  min-height: 36px;
  padding: 3px;
}

.trade-entry-grid .asset-trade-form .segmented-control input:checked + span {
  min-height: 28px;
}

.trade-entry-grid .asset-trade-form .input-wrap {
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 46px;
  padding: 0 12px;
}

.trade-entry-grid .asset-trade-form .input-wrap input {
  min-width: 0;
  font-size: 16px;
}

.trade-entry-grid .asset-trade-form .input-wrap em {
  max-width: 64px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@container (max-width: 420px) {
  .entry-panel .asset-trade-form {
    gap: 10px 8px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .entry-panel .asset-trade-form .input-wrap {
    min-height: 44px;
    padding: 0 9px;
  }

  .entry-panel .asset-trade-form .input-wrap input {
    font-size: 15px;
  }

  .entry-panel .asset-trade-form .input-wrap em {
    max-width: 42px;
  }
}

@container (max-width: 320px) {
  .entry-panel .asset-trade-form {
    gap: 10px 6px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .entry-panel .asset-trade-form .field {
    font-size: 11px;
  }

  .entry-panel .asset-trade-form .input-wrap {
    min-height: 42px;
    padding: 0 7px;
  }

  .entry-panel .asset-trade-form .input-wrap input {
    font-size: 14px;
  }

  .entry-panel .asset-trade-form .input-wrap em {
    max-width: 34px;
    font-size: 11px;
  }
}

@container (max-width: 240px) {
  .entry-panel .asset-trade-form {
    grid-template-columns: 1fr;
  }

  .entry-panel .asset-trade-form .segmented-control,
  .entry-panel .asset-trade-form #assetTradeFeeField,
  .entry-panel .asset-trade-form .trade-tag-field,
  .entry-panel .asset-trade-form .income-fields,
  .entry-panel .asset-trade-form .form-actions,
  .entry-panel .asset-trade-form .form-error {
    grid-column: 1;
  }
}

.trade-entry-grid .asset-trade-form .trade-tag-field {
  gap: 6px;
}

.trade-entry-grid .asset-trade-form .trade-tag-button {
  min-height: 0;
  padding: 0;
}

.trade-entry-grid .asset-trade-form .trade-tag-picker {
  --trade-tag-picker-default-width: 390px;
}

.trade-entry-grid .asset-trade-form .primary-button {
  min-height: 42px;
}

.trade-entry-grid .asset-trade-form .trade-fee-settings-actions .ghost-button,
.trade-entry-grid .asset-trade-form .trade-fee-settings-actions .primary-button {
  flex: 0 0 auto;
  width: 76px;
  min-width: 76px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: var(--radius);
}

.trade-entry-grid .asset-trade-form .trade-tag-actions .primary-button {
  min-height: 34px;
  height: 34px;
}

.trade-entry-grid .asset-trade-form .form-error {
  min-height: 14px;
  margin-top: -2px;
}

#assetTradesTablePanel {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  min-height: 0;
}

#assetTradesTablePanel .table-wrap {
  flex: 0 0 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
}

#assetTradesTablePanel:not(.has-records) .table-wrap {
  display: grid;
  place-items: center;
  overflow: hidden;
}

#assetTradesTablePanel:not(.has-records) table {
  display: none;
}

#assetTradesTablePanel:not(.has-records) .empty-state {
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 24px;
  place-items: center;
}

#assetTradesTablePanel:not(.has-records) .empty-state span {
  display: none;
}

#assetTradesTablePanel:not(.has-records) .empty-state p {
  margin: 0;
}

.asset-trade-form #assetTradeFeeField,
.asset-trade-form #editAssetTradeFeeField {
  grid-column: 1 / -1;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.68);
  padding: 18px;
}

.modal-panel {
  width: min(480px, 100%);
  max-height: min(680px, calc(100vh - 36px));
  overflow-y: auto;
  box-shadow: 0 24px 80px var(--shadow-elevated);
}

#confirmModal {
  z-index: 40;
}

.trade-edit-modal-panel {
  width: min(680px, 100%);
}

.exchange-modal-panel {
  width: min(480px, 100%);
}

.exchange-modal-panel .compact-form {
  grid-template-columns: 1fr;
}

.exchange-modal-panel .preview-row,
.exchange-modal-panel .form-actions,
.exchange-modal-panel .form-error {
  grid-column: 1 / -1;
}

.exchange-history-trigger {
  justify-self: end;
  margin-top: -4px;
  font-size: 13px;
}

.exchange-pair-field {
  position: relative;
  z-index: 3;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.exchange-asset-selector {
  position: relative;
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}

.exchange-asset-selector .transfer-asset-button {
  color: var(--text);
  font-size: 20px;
}

.exchange-asset-selector:first-child {
  justify-items: end;
  text-align: right;
}

.exchange-asset-selector:first-child .transfer-asset-button {
  justify-self: end;
}

.exchange-asset-selector:last-child {
  justify-items: start;
  text-align: left;
}

.exchange-asset-selector:last-child .transfer-asset-button {
  justify-self: start;
}

.exchange-arrow {
  justify-self: center;
  color: var(--muted-2);
  font-size: 22px;
  font-weight: 800;
  transform: translateY(11px);
}

.exchange-history-panel {
  width: min(480px, 100%);
}

.exchange-history-body {
  display: grid;
  gap: 14px;
  padding: 0 0 6px;
}

.exchange-history-summary {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel-soft);
}

.exchange-history-summary span,
.exchange-history-summary small,
.exchange-history-row small {
  color: var(--muted);
}

.exchange-history-summary strong {
  color: var(--positive);
  font-size: 24px;
  line-height: 1.2;
}

.exchange-history-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}

.exchange-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 14px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.exchange-history-row:last-child {
  border-bottom: 0;
}

.exchange-history-row strong,
.exchange-history-row span {
  min-width: 0;
}

.exchange-history-row span {
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.exchange-history-row small {
  grid-column: 1 / -1;
}

.confirm-panel {
  width: min(780px, 100%);
  overflow-x: hidden;
}

.confirm-body {
  padding: 24px 28px 8px;
  text-align: center;
}

.confirm-body p {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.45;
  overflow-wrap: normal;
  white-space: nowrap;
}

.confirm-input-field {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.confirm-input-field[hidden] {
  display: none;
}

.confirm-input-field input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-input);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.confirm-input-field input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px var(--focus-ring-soft);
}

.confirm-input-error {
  min-height: 18px;
  margin: 8px 0 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  white-space: normal;
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 16px 28px 24px;
}

.confirm-actions .ghost-button {
  min-width: 88px;
}

@media (max-width: 820px) {
  .confirm-body p {
    overflow-wrap: anywhere;
    white-space: normal;
  }
}

.valuation-panel {
  margin-top: 22px;
  overflow: hidden;
}

.valuation-heading {
  align-items: flex-start;
}

.valuation-heading-main {
  min-width: 0;
}

.overview-return-panel {
  display: grid;
  align-self: stretch;
  align-content: end;
  justify-items: end;
  min-width: 170px;
  padding-top: 6px;
  text-align: right;
}

.overview-unit-inline {
  justify-self: end;
  min-height: 24px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
}

.overview-unit-inline #overviewUnitChip {
  border-bottom: 1px dashed rgba(141, 149, 163, 0.58);
  padding-bottom: 2px;
}

.overview-unit-inline:hover #overviewUnitChip,
.overview-unit-inline:focus-visible #overviewUnitChip {
  border-bottom-color: var(--muted);
  color: var(--text);
}

.currency-picker-control {
  position: relative;
}

.overview-currency-control {
  justify-self: end;
}

.currency-picker-popover {
  right: 0;
  left: auto;
  width: min(270px, calc(100vw - 48px));
  text-align: left;
}

.overview-return-label {
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.overview-return-value {
  margin-top: 8px;
  color: var(--text);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

.overview-return-value.positive {
  color: var(--positive);
}

.overview-return-value.negative {
  color: var(--negative);
}

.valuation-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.overview-valuation-value {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-size: clamp(34px, 5vw, 58px);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.privacy-toggle {
  position: relative;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
}

.privacy-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.privacy-toggle.active::after {
  position: absolute;
  width: 21px;
  height: 1.5px;
  background: currentColor;
  content: "";
  transform: rotate(-38deg);
}

.valuation-body {
  padding: 20px;
}

.valuation-chart {
  position: relative;
  min-height: 240px;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  touch-action: pan-y;
  user-select: none;
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 25%,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 12.5% 100%,
    var(--surface-chart);
}

.valuation-chart svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 240px;
}

body[data-theme="light"] .valuation-chart::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  box-sizing: border-box;
  border: 1px solid rgba(100, 116, 139, 0.46);
  border-radius: inherit;
  pointer-events: none;
}

.valuation-chart #overviewChartLine {
  stroke: var(--positive);
}

.valuation-chart .overview-chart-grid {
  display: none;
  pointer-events: none;
}

body[data-theme="light"] .valuation-chart .overview-chart-grid {
  display: inline;
}

.valuation-chart .overview-chart-grid line {
  stroke: var(--line-soft);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

body[data-theme="light"] .valuation-chart .overview-chart-grid line {
  stroke: rgba(148, 163, 184, 0.34);
}

.valuation-chart #overviewLineFill stop:first-child {
  stop-color: var(--positive-chart-fill);
}

.valuation-chart #overviewLineFill stop:last-child {
  stop-color: var(--positive-transparent);
}

.valuation-chart.is-negative #overviewChartLine {
  stroke: var(--negative);
}

.valuation-chart.is-negative #overviewLineFill stop:first-child {
  stop-color: var(--negative-chart-fill);
}

.valuation-chart.is-negative #overviewLineFill stop:last-child {
  stop-color: var(--negative-transparent);
}

.chart-hover {
  pointer-events: none;
}

.chart-extreme-label {
  pointer-events: none;
}

.chart-extreme-label text {
  fill: #dff9ee;
  font-size: 12px;
  font-weight: 760;
  paint-order: stroke;
  stroke: rgba(5, 5, 5, 0.85);
  stroke-width: 3px;
}

.chart-hover line {
  stroke: rgba(255, 255, 255, 0.38);
  stroke-width: 1;
}

.chart-hover rect {
  fill: rgba(6, 7, 9, 0.92);
  stroke: rgba(255, 255, 255, 0.1);
}

.chart-hover text {
  fill: var(--text);
  font-size: 12px;
  font-weight: 720;
}

.chart-hover circle {
  fill: var(--positive);
  stroke: #07110d;
  stroke-width: 2;
}

.valuation-chart.is-negative .chart-hover circle {
  fill: var(--negative);
}

body[data-theme="light"] .valuation-chart .chart-extreme-label text {
  fill: #000000;
  paint-order: normal;
  stroke: none;
  stroke-width: 0;
}

body[data-theme="light"] .valuation-chart .chart-hover line {
  stroke: rgba(0, 0, 0, 0.3);
}

body[data-theme="light"] .valuation-chart .chart-hover rect {
  fill: #ffffff;
  stroke: #000000;
}

body[data-theme="light"] .valuation-chart .chart-hover text {
  fill: #000000;
}

.overview-range-control {
  position: relative;
}

.chart-range-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(58px, 1fr));
  gap: 4px;
  width: 100%;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-control);
  padding: 4px;
}

.chart-range-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
  transform-origin: center;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.chart-range-tabs button.active {
  background: var(--surface-selected);
  color: var(--surface-selected-text);
}

.chart-range-tabs button:hover,
.chart-range-tabs button:focus-visible {
  color: var(--text);
  transform: translateY(-1px) scale(1.12);
}

.chart-range-tabs button.active:hover,
.chart-range-tabs button.active:focus-visible {
  color: var(--surface-selected-text);
}

.overview-custom-range-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: min(390px, calc(100vw - 48px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-popover-soft);
  box-shadow: 0 18px 54px var(--shadow-elevated);
  padding: 14px;
}

.overview-custom-range-popover.hidden {
  display: none;
}

.overview-custom-range-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.overview-custom-range-fields label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.overview-custom-range-fields input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  outline: none;
  background: var(--surface-control);
  padding: 0 9px;
  color: var(--text);
  color-scheme: inherit;
  font: inherit;
}

.overview-custom-range-fields input:focus {
  border-color: var(--line-strong);
}

.overview-custom-range-error {
  min-height: 16px;
  margin: 8px 0 0;
  color: var(--red);
  font-size: 11px;
}

.overview-custom-range-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.overview-range-secondary-button,
.overview-range-primary-button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
}

.overview-range-secondary-button {
  background: var(--surface-control);
  color: var(--muted);
}

.overview-range-primary-button {
  border-color: var(--button-primary-bg);
  background: var(--button-primary-bg);
  color: var(--button-primary-text);
}

.overview-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.42fr) minmax(0, 0.58fr);
  gap: 16px;
  margin-top: 16px;
}

.overview-bottom-grid {
  display: grid;
  grid-template-columns: minmax(410px, 0.46fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  flex: 1;
  margin-top: 16px;
}

.compact-form {
  grid-template-columns: 1fr;
}

.overview-table-panel {
  display: flex;
  flex-direction: column;
  margin-top: 16px;
}

.overview-bottom-grid .overview-table-panel {
  min-width: 0;
  margin-top: 0;
  height: 100%;
}

.overview-bottom-grid .table-wrap {
  flex: 1;
  overflow-x: hidden;
}

.overview-bottom-grid .table-wrap:has(.bill-filter-popover:not(.hidden)) {
  overflow: visible;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  border-top: 1px solid var(--line-soft);
  padding: 10px 18px 14px;
  color: var(--muted-2);
  font-size: 12px;
}

.table-pagination-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-pagination-page-input {
  width: 44px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-control);
  padding: 0 6px;
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: center;
  outline: 0;
}

.table-pagination-page-input:focus {
  border-color: var(--line-strong);
}

.table-pagination-button {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 12px;
  color: var(--text);
  cursor: pointer;
}

.table-pagination-edge-button {
  min-width: 42px;
  padding: 0 10px;
}

.table-pagination-button:hover,
.table-pagination-button:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-elevated);
  outline: 0;
}

.table-pagination-button:disabled {
  opacity: 0.42;
  cursor: default;
}

#portfolioHoldingsPanel table {
  table-layout: fixed;
  min-width: 0;
}

.overview-table-panel table {
  min-width: 560px;
}

#portfolioHoldingsPanel th,
#portfolioHoldingsPanel td {
  height: 46px;
  overflow: visible;
  padding: 0 6px;
  text-overflow: clip;
  white-space: nowrap;
}

#portfolioHoldingsPanel th:first-child,
#portfolioHoldingsPanel td:first-child {
  width: 32%;
  overflow: hidden;
}

#portfolioHoldingsPanel th:nth-child(2),
#portfolioHoldingsPanel td:nth-child(2) {
  width: 22%;
  white-space: nowrap;
}

#portfolioHoldingsPanel th:nth-child(3),
#portfolioHoldingsPanel td:nth-child(3) {
  width: 24%;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
}

#portfolioHoldingsPanel th:last-child,
#portfolioHoldingsPanel td:last-child {
  width: 22%;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
}

#portfolioHoldingsPanel .panel-heading {
  min-height: 68px;
  padding: 18px 18px;
}

#portfolioHoldingsPanel .holding-name {
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

#portfolioHoldingsPanel .holding-name span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#portfolioHoldingsPanel .holding-drag-handle {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

#portfolioHoldingsPanel .holding-drag-handle span {
  width: 12px;
}

.investment-bills-panel table {
  table-layout: fixed;
  min-width: 0;
}

.investment-bills-panel th,
.investment-bills-panel td {
  height: auto;
  min-height: 52px;
  overflow: visible;
  padding: 12px 10px;
  text-overflow: clip;
  vertical-align: middle;
}

.bill-filter-th {
  position: relative;
  z-index: 2;
  overflow: visible !important;
}

.bill-filter-th:has(.bill-filter-popover:not(.hidden)) {
  z-index: 30;
}

.bill-table-filter-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
}

.bill-table-filter-button:hover,
.bill-table-filter-button:focus-visible,
.bill-table-filter-button.active {
  color: var(--text);
  outline: 0;
}

.bill-table-filter-caret {
  width: 0;
  height: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  border-top: 5px solid var(--caret-color);
  opacity: 0.92;
}

.bill-filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 8px;
  z-index: 26;
  max-width: calc(100vw - 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-popover-soft);
  box-shadow: 0 18px 54px var(--shadow-elevated);
  padding: 10px;
  color: var(--text);
}

.bill-time-filter-popover {
  width: 286px;
}

.bill-type-filter-popover {
  width: 190px;
}

.holding-type-filter-popover {
  width: 190px;
}

.bill-time-filter-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.bill-filter-option {
  min-height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: 0 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}

.bill-filter-option:hover,
.bill-filter-option:focus-visible,
.bill-filter-option.active {
  border-color: var(--line);
  background: var(--surface-control-hover);
  color: var(--text);
  outline: 0;
}

.bill-time-filter-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.bill-time-filter-custom label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.bill-time-filter-custom input {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-control);
  padding: 0 8px;
  color: var(--text);
  color-scheme: inherit;
  font: inherit;
  outline: 0;
}

.bill-time-filter-custom input:focus {
  border-color: var(--line-strong);
}

.bill-time-filter-custom button {
  align-self: end;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--button-primary-bg);
  padding: 0 12px;
  color: var(--button-primary-text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
}

.bill-filter-error {
  min-height: 16px;
  margin: 8px 0 0;
  color: var(--red);
  font-size: 11px;
}

.bill-filter-all-option {
  width: 100%;
  margin-bottom: 6px;
}

.bill-type-filter-table {
  width: 100%;
  border-collapse: collapse;
}

.bill-type-filter-table td {
  height: auto;
  min-height: 0;
  border: 0;
  padding: 0;
}

.bill-type-filter-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  border-radius: 6px;
  padding: 0 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.bill-type-filter-option:hover {
  background: var(--surface-control-hover);
  color: var(--text);
}

.bill-type-filter-option input {
  accent-color: var(--button-primary-bg);
}

.investment-bills-panel td {
  font-size: 13px;
}

.investment-bills-panel th:first-child,
.investment-bills-panel td:first-child {
  width: 15%;
  white-space: nowrap;
}

.investment-bills-panel th:last-child,
.investment-bills-panel td:last-child {
  width: 92px;
  text-align: right;
}

.investment-bills-panel th:nth-child(2),
.investment-bills-panel td:nth-child(2) {
  width: 14%;
  white-space: nowrap;
}

.investment-bills-panel th:nth-child(3),
.investment-bills-panel td:nth-child(3) {
  width: 23%;
}

.investment-bills-panel th:nth-child(4),
.investment-bills-panel td:nth-child(4) {
  width: 34%;
  text-align: left;
}

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

.bill-detail-cell strong {
  color: var(--text);
  overflow: visible;
  font-size: 12.5px;
  line-height: 1.3;
  text-overflow: clip;
  white-space: nowrap;
}

.bill-detail-cell span {
  margin-top: 4px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.35;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

.bill-amount {
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.bill-amount-content {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bill-amount-content span {
  font-variant-numeric: tabular-nums;
}

.bill-action-cell {
  overflow: visible;
  text-align: right;
  text-overflow: clip;
  white-space: nowrap;
}

.bill-action-cell .edit-button,
.bill-action-cell .delete-button {
  min-height: 34px;
}

.bill-action-cell .edit-button {
  margin-right: 6px;
  padding: 0 10px;
}

.bill-action-cell .delete-button {
  width: 34px;
  min-width: 34px;
  padding: 0;
}

.investment-bills-panel .bill-filter-popover table,
#portfolioHoldingsPanel .bill-filter-popover table {
  min-width: 0;
  table-layout: auto;
}

.investment-bills-panel .bill-filter-popover th,
.investment-bills-panel .bill-filter-popover td,
#portfolioHoldingsPanel .bill-filter-popover th,
#portfolioHoldingsPanel .bill-filter-popover td {
  width: auto;
  height: auto;
  min-height: 0;
  overflow: visible;
  padding: 0;
  text-align: left;
  text-overflow: clip;
  white-space: normal;
}

#investmentTransfersPanel table {
  min-width: 620px;
}

@media (max-width: 1500px) {
  .overview-bottom-grid {
    grid-template-columns: minmax(340px, 0.42fr) minmax(0, 1fr);
  }

  #portfolioHoldingsPanel th,
  #portfolioHoldingsPanel td,
  .investment-bills-panel th,
  .investment-bills-panel td {
    overflow: hidden;
    padding-right: 8px;
    padding-left: 8px;
    text-overflow: ellipsis;
  }

  #portfolioHoldingsPanel th:first-child,
  #portfolioHoldingsPanel td:first-child {
    width: 31%;
  }

  #portfolioHoldingsPanel th:nth-child(2),
  #portfolioHoldingsPanel td:nth-child(2) {
    width: 22%;
  }

  #portfolioHoldingsPanel th:nth-child(3),
  #portfolioHoldingsPanel td:nth-child(3) {
    width: 25%;
  }

  #portfolioHoldingsPanel th:last-child,
  #portfolioHoldingsPanel td:last-child {
    width: 22%;
  }

  #portfolioHoldingsPanel .holding-name {
    overflow: hidden;
  }

  #portfolioHoldingsPanel .holding-name span:last-child,
  .bill-detail-cell strong,
  .bill-detail-cell span,
  .bill-amount-content {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .investment-bills-panel th:first-child,
  .investment-bills-panel td:first-child {
    width: 14%;
    overflow: visible;
    text-overflow: clip;
  }

  .investment-bills-panel th:nth-child(2),
  .investment-bills-panel td:nth-child(2) {
    width: 12%;
    overflow: visible;
    text-overflow: clip;
  }

  .investment-bills-panel th:nth-child(3),
  .investment-bills-panel td:nth-child(3) {
    width: 22%;
  }

  .investment-bills-panel th:nth-child(4),
  .investment-bills-panel td:nth-child(4) {
    width: 36%;
  }

  .investment-bills-panel th:last-child,
  .investment-bills-panel td:last-child {
    width: 16%;
    overflow: visible;
    text-overflow: clip;
  }

  .bill-action-cell {
    overflow: visible;
    text-overflow: clip;
  }
}

@media (max-width: 1250px) {
  .investment-bills-panel th,
  .investment-bills-panel td {
    padding-right: 7px;
    padding-left: 7px;
  }

  .investment-bills-panel th:first-child,
  .investment-bills-panel td:first-child {
    width: 15%;
  }

  .investment-bills-panel th:nth-child(2),
  .investment-bills-panel td:nth-child(2) {
    width: 12%;
  }

  .investment-bills-panel th:nth-child(3),
  .investment-bills-panel td:nth-child(3) {
    width: 22%;
  }

  .investment-bills-panel th:nth-child(4),
  .investment-bills-panel td:nth-child(4) {
    width: 35%;
  }

  .investment-bills-panel th:last-child,
  .investment-bills-panel td:last-child {
    width: 16%;
  }
}

@media (max-width: 1050px) {
  .ticker-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assets-layout,
  .overview-bottom-grid,
  .overview-grid,
  .valuation-body {
    grid-template-columns: 1fr;
  }

  .assets-layout {
    grid-template-areas:
      "list"
      "detail"
      "note";
  }

  .asset-note-panel:not(.investment-notebook-panel) {
    position: static;
    min-height: 260px;
    max-height: none;
  }

}

@media (max-width: 760px) {
  #portfolioHoldingsPanel th,
  #portfolioHoldingsPanel td,
  .investment-bills-panel th,
  .investment-bills-panel td {
    padding: 0 8px;
  }

  .investment-bills-panel th,
  .investment-bills-panel td {
    padding-right: 6px;
    padding-left: 6px;
  }

  .investment-bills-panel th:first-child,
  .investment-bills-panel td:first-child {
    width: 16%;
  }

  .investment-bills-panel th:nth-child(2),
  .investment-bills-panel td:nth-child(2) {
    width: 13%;
  }

  .investment-bills-panel th:nth-child(3),
  .investment-bills-panel td:nth-child(3) {
    width: 22%;
  }

  .investment-bills-panel th:nth-child(4),
  .investment-bills-panel td:nth-child(4) {
    width: 33%;
  }

  .investment-bills-panel th:last-child,
  .investment-bills-panel td:last-child {
    width: 16%;
  }

  #portfolioHoldingsPanel td,
  .investment-bills-panel td {
    font-size: 12px;
  }

  .bill-detail-cell strong {
    font-size: 12px;
  }

  .bill-detail-cell span {
    font-size: 11px;
  }

  .bill-amount {
    font-size: 12px;
  }

  .bill-action-cell {
    text-align: right;
  }

  .table-pagination {
    justify-content: center;
    flex-wrap: wrap;
    padding: 10px 12px 12px;
  }

  .table-pagination-info {
    order: -1;
    justify-content: center;
    width: 100%;
    text-align: center;
  }

  .table-pagination-button {
    flex: 1;
  }

  .bill-action-cell .edit-button {
    min-height: 30px;
    padding: 0 8px;
  }

  .bill-action-cell .delete-button {
    width: 30px;
    min-width: 30px;
    min-height: 30px;
  }
}

.reports-view {
  --report-metric-value-font-size: clamp(28px, 2.2vw, 36px);
  gap: 16px;
}

.report-sticky-header {
  position: sticky;
  top: 0;
  z-index: 70;
  display: grid;
  gap: 16px;
  margin-top: -24px;
  padding-top: 24px;
  padding-bottom: 10px;
  background:
    linear-gradient(180deg, var(--app-bg-glow), transparent 260px),
    var(--app-bg);
}

body:has(.modal-backdrop:not(.hidden)) .report-sticky-header {
  z-index: 1;
}

.reports-stack {
  display: grid;
  gap: 16px;
}

.report-range-control {
  display: grid;
  gap: 10px;
}

.report-two-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.report-table-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.report-panel {
  overflow: hidden;
}

.report-panel-heading {
  align-items: flex-start;
  min-height: 66px;
}

.report-panel-body {
  display: grid;
  gap: 16px;
  padding: 18px 20px 20px;
}

.report-base-currency {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 0;
  text-align: right;
}

.report-base-currency-button {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: right;
}

.report-base-currency-button strong {
  display: inline-block;
  border-bottom: 1px dashed rgba(141, 149, 163, 0.58);
  padding-bottom: 2px;
}

.report-base-currency-button:hover strong,
.report-base-currency-button:focus-visible strong {
  border-bottom-color: var(--muted);
}

.report-base-currency-button:focus-visible {
  outline: 0;
}

.report-meta,
.report-calendar-summary,
.report-day-detail-body span,
.report-day-detail-item span,
.report-trend-card .trend-meta,
.report-custom-range label span {
  color: var(--muted);
  font-size: 12px;
}

.report-meta {
  font-size: clamp(13px, 1vw, 15px);
  line-height: 1.4;
  white-space: nowrap;
}

.report-calendar-toolbar strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.report-base-currency-button strong {
  font-size: 18px;
  font-weight: 760;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.report-topbar-meta {
  display: block;
  max-width: min(360px, 42vw);
  color: var(--muted);
  font-size: clamp(14px, 1.05vw, 16px);
  text-align: right;
}

.report-heading-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.report-calendar-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
}

.report-calendar-heading > div:first-child {
  justify-self: start;
}

.report-calendar-heading .report-heading-actions {
  display: contents;
}

.report-calendar-heading .report-small-tabs {
  grid-column: 2;
  justify-self: center;
  width: 260px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.report-calendar-heading .report-dashed-button {
  grid-column: 3;
  justify-self: end;
  align-self: start;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.2;
}

.report-small-tabs,
.report-range-tabs {
  display: grid;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-control);
}

.report-range-tabs {
  grid-template-columns: repeat(6, minmax(58px, 1fr));
}

.report-small-tabs {
  width: 170px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-range-tabs button,
.report-small-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transform-origin: center;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.report-range-tabs button {
  min-height: 30px;
  font-size: 12px;
  font-weight: 760;
}

.report-range-tabs button.active,
.report-small-tabs button.active {
  background: var(--surface-selected);
  color: var(--surface-selected-text);
}

.report-range-tabs button:hover,
.report-range-tabs button:focus-visible,
.report-small-tabs button:hover,
.report-small-tabs button:focus-visible {
  color: var(--text);
  transform: translateY(-1px) scale(1.12);
}

.report-range-tabs button.active:hover,
.report-range-tabs button.active:focus-visible,
.report-small-tabs button.active:hover,
.report-small-tabs button.active:focus-visible {
  color: var(--surface-selected-text);
}

.report-custom-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.report-custom-range label {
  display: grid;
  gap: 6px;
}

.report-custom-range input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--text);
  padding: 0 12px;
}

.report-metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.report-metric-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.report-metric-card {
  display: grid;
  align-content: start;
  min-height: 104px;
  background: var(--surface-muted);
  padding: 16px;
}

.report-metric-card .metric-label {
  color: var(--muted);
  font-size: 12px;
}

.report-metric-card strong {
  display: block;
  margin-top: 14px;
  font-size: var(--report-metric-value-font-size);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.report-adaptive-number {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.report-fx-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.report-fx-metrics .report-metric-card {
  container-type: inline-size;
  min-width: 0;
  min-height: clamp(78px, 9vw, 104px);
  padding: clamp(10px, 1.4vw, 16px);
}

.report-fx-metrics .report-metric-card .metric-label {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(10px, 8cqw, 13px);
  line-height: 1.2;
  text-overflow: clip;
  white-space: nowrap;
}

.report-fx-metrics .report-metric-card strong {
  min-width: 0;
  margin-top: clamp(10px, 6cqw, 14px);
  overflow: hidden;
  font-size: var(--report-metric-value-font-size);
  line-height: 1;
  text-overflow: clip;
  white-space: nowrap;
}

.report-fx-body {
  display: grid;
  gap: 16px;
}

.report-fx-structure-card,
.report-fx-rate-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  overflow: hidden;
  padding: clamp(14px, 1.8vw, 20px);
}

.report-fx-structure-card.is-private,
.report-fx-rate-card.is-private {
  display: grid;
  min-height: 210px;
  grid-template-rows: auto minmax(0, 1fr);
}

.report-fx-structure-card.is-private .report-allocation-locked,
.report-fx-rate-card.is-private .report-allocation-locked {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.report-fx-structure-card h3,
.report-fx-section-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: clamp(18px, 1.8vw, 22px);
  font-weight: 850;
  letter-spacing: 0;
}

.report-fx-section-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.report-fx-structure-layout {
  align-items: center;
  display: grid;
  gap: clamp(16px, 3vw, 34px);
  grid-template-columns: minmax(200px, 0.55fr) minmax(0, 1.45fr);
  margin-top: 16px;
}

.report-fx-donut {
  aspect-ratio: 1;
  justify-self: center;
  max-width: 250px;
  position: relative;
  width: min(100%, 250px);
}

.report-fx-donut svg {
  height: 100%;
  width: 100%;
}

.report-fx-donut-track,
.report-fx-donut-segment {
  fill: none;
  stroke-width: 28;
}

.report-fx-donut-track {
  stroke: var(--chart-grid);
}

.report-fx-donut:not(.is-empty) .report-fx-donut-track {
  stroke: var(--surface-chart);
}

.report-fx-donut-segment {
  stroke-linecap: butt;
}

.report-fx-donut-center {
  align-content: center;
  display: grid;
  gap: 5px;
  inset: 50% auto auto 50%;
  justify-items: center;
  position: absolute;
  text-align: center;
  transform: translate(-50%, -50%);
  width: min(62%, 155px);
}

.report-fx-donut-center span {
  color: var(--muted);
  font-size: 12px;
}

.report-fx-donut-center strong {
  color: var(--text);
  font-size: clamp(13px, 1.65vw, 22px);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  line-height: 1.15;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.report-fx-structure-empty {
  align-items: center;
  border: 1px dashed rgba(141, 149, 163, 0.28);
  border-radius: 8px;
  color: var(--muted);
  display: flex;
  min-height: 120px;
  justify-content: center;
}

.report-fx-structure-table {
  container-type: inline-size;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.report-fx-structure-head,
.report-fx-structure-row {
  align-items: center;
  display: grid;
  gap: clamp(8px, 2cqw, 14px);
  grid-template-columns: minmax(78px, 1fr) minmax(70px, 1.8fr) minmax(88px, 1fr) minmax(48px, 0.62fr);
  min-width: 0;
}

.report-fx-structure-head {
  color: var(--muted);
  font-size: clamp(10px, 2.4cqw, 12px);
  font-weight: 760;
}

.report-fx-structure-head span:nth-child(3),
.report-fx-structure-head span:nth-child(4) {
  text-align: right;
}

.report-fx-structure-row {
  min-height: 40px;
}

.report-fx-currency-name {
  align-items: center;
  display: flex;
  gap: 9px;
  min-width: 0;
}

.report-fx-currency-name > span:last-child {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.report-fx-currency-name strong {
  color: var(--text);
  font-size: clamp(12px, 3.2cqw, 15px);
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-fx-currency-name em {
  color: var(--muted);
  font-size: clamp(10px, 2.5cqw, 12px);
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-fx-swatch {
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  height: 10px;
  width: 10px;
}

.report-fx-progress {
  background: rgba(141, 149, 163, 0.14);
  border: 1px solid rgba(141, 149, 163, 0.16);
  border-radius: 999px;
  display: block;
  height: 10px;
  min-width: 0;
  overflow: hidden;
}

.report-fx-progress span {
  border-radius: inherit;
  display: block;
  height: 100%;
}

.report-fx-structure-row .numeric {
  color: var(--text);
  font-size: clamp(11px, 2.8cqw, 14px);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-fx-rate-heading {
  align-items: flex-start;
}

.report-fx-rate-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.report-fx-rate-chip {
  align-items: center;
  border: 1px solid rgba(141, 149, 163, 0.2);
  border-radius: 999px;
  background: rgba(18, 22, 28, 0.78);
  color: var(--muted);
  display: inline-flex;
  gap: 7px;
  max-width: 100%;
  min-height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}

body[data-theme="light"] .report-fx-rate-chip {
  background: #ffffff;
  border-color: var(--line);
}

.report-fx-rate-chip strong,
.report-fx-rate-chip em,
.report-fx-rate-chip small {
  font-size: 12px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.report-fx-rate-chip strong {
  color: var(--text);
  font-weight: 820;
}

.report-fx-rate-chip em {
  color: var(--text);
}

.report-fx-rate-chip.positive small {
  color: var(--positive);
}

.report-fx-rate-chip.negative small {
  color: var(--negative);
}

.report-fx-rate-svg {
  display: block;
  height: auto;
  min-height: 260px;
  width: 100%;
}

.report-fx-rate-svg text {
  fill: var(--muted);
  font-size: 11px;
}

.report-fx-rate-grid-line {
  stroke: rgba(43, 48, 58, 0.82);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.report-fx-rate-grid-line.vertical {
  stroke: rgba(43, 48, 58, 0.5);
}

body[data-theme="light"] .report-fx-rate-grid-line,
body[data-theme="light"] .report-fx-rate-grid-line.vertical {
  stroke: rgba(89, 99, 116, 0.28);
  stroke-width: 1px;
}

.report-fx-rate-marker line {
  stroke: var(--fx-color);
  stroke-dasharray: 4 4;
  stroke-width: 1.3;
}

.report-fx-rate-marker circle {
  fill: var(--fx-color);
  stroke: #08090b;
  stroke-width: 2;
}

.report-fx-rate-marker text {
  fill: var(--text);
  font-size: 12px;
  font-weight: 760;
  paint-order: stroke;
  stroke: rgba(5, 5, 5, 0.9);
  stroke-width: 3px;
}

body[data-theme="light"] .report-fx-rate-marker text {
  fill: #000000;
  paint-order: normal;
  stroke: none;
  stroke-width: 0;
}

.report-fx-rate-hit-area {
  cursor: crosshair;
  pointer-events: all;
}

.report-fx-rate-hover {
  pointer-events: none;
}

.report-fx-rate-hover > line {
  stroke: rgba(255, 255, 255, 0.82);
  stroke-dasharray: 3 4;
  stroke-width: 1;
}

.report-fx-rate-hover > text {
  fill: var(--text);
  font-size: 11px;
  font-weight: 760;
  paint-order: stroke;
  stroke: rgba(5, 5, 5, 0.9);
  stroke-width: 3px;
}

body[data-theme="light"] .report-fx-rate-hover > line,
body[data-theme="light"] .report-risk-chart-hover > line,
body[data-theme="light"] .report-allocation-ratio-hover > line,
body[data-theme="light"] .report-allocation-chart-hover > line {
  stroke: rgba(0, 0, 0, 0.35);
}

body[data-theme="light"] .report-fx-rate-hover > text,
body[data-theme="light"] .report-risk-chart-hover > text,
body[data-theme="light"] .report-allocation-ratio-hover > text,
body[data-theme="light"] .report-allocation-chart-hover > text {
  fill: #000000;
  paint-order: normal;
  stroke: none;
  stroke-width: 0;
}

.report-fx-rate-hover-value circle {
  fill: var(--fx-hover-color);
  stroke: #08090b;
  stroke-width: 2;
}

.report-fx-rate-hover-value text {
  fill: var(--fx-hover-color);
  font-size: 11px;
  font-weight: 760;
  paint-order: stroke;
  stroke: rgba(5, 5, 5, 0.9);
  stroke-width: 3px;
}

.report-brief-metrics .report-metric-card {
  container-type: inline-size;
  grid-template-columns: 1fr;
  align-content: start;
  align-items: start;
  min-height: 104px;
  padding: 16px;
}

.report-brief-metrics .report-metric-card .metric-label {
  min-width: 0;
  overflow: hidden;
  font-size: clamp(13px, 4.4cqw, 15px);
  line-height: 1.2;
  text-overflow: clip;
  white-space: nowrap;
}

.report-brief-metrics .report-metric-card strong {
  min-width: 0;
  margin-top: 14px;
  overflow: hidden;
  font-size: var(--report-metric-value-font-size);
  line-height: 1;
  text-align: left;
  text-overflow: clip;
  white-space: nowrap;
}

.report-metric-card .metric-subtext {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.report-metric-card.has-floating-subtext {
  position: relative;
  padding-right: 168px;
}

.report-metric-card .metric-subtext.is-floating {
  position: absolute;
  top: 16px;
  right: 16px;
  display: block;
  width: max-content;
  max-width: none;
  margin-top: 0;
  text-align: right;
  line-height: 1.35;
  white-space: nowrap;
}

.report-risk-layout {
  --report-risk-value-font-size: var(--report-metric-value-font-size);
  display: grid;
  gap: 16px;
}

.report-risk-metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.report-risk-metric-row .report-metric-card {
  container-type: inline-size;
  min-height: 96px;
  padding: 15px 16px;
}

.report-risk-top-row .report-metric-card.has-floating-subtext {
  padding-right: 16px;
}

.report-risk-metric-row .report-metric-card strong {
  min-width: 0;
  overflow: hidden;
  font-size: var(--report-risk-value-font-size);
  letter-spacing: 0;
  line-height: 1;
  text-overflow: clip;
  white-space: nowrap;
}

.report-risk-chart-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-chart-soft);
  padding: 14px 16px 8px;
}

.report-risk-chart-private {
  display: grid;
  min-height: 260px;
  place-items: center;
  color: var(--text);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0;
}

.report-risk-chart-loading {
  min-height: 260px;
}

.report-risk-chart-svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 260px;
}

.report-risk-grid-line {
  stroke: rgba(89, 99, 116, 0.28);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.report-risk-axis-label {
  fill: #9fb3d9;
  font-size: 13px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.report-risk-area.positive {
  fill: var(--positive-muted);
}

.report-risk-area.negative {
  fill: var(--negative-muted);
}

.report-risk-line {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.report-risk-line.positive {
  stroke: var(--positive);
}

.report-risk-line.negative {
  stroke: var(--negative);
}

.report-risk-baseline {
  stroke: rgba(242, 246, 252, 0.78);
  stroke-dasharray: 4 5;
  stroke-width: 1.2;
}

.report-risk-drawdown-start {
  stroke: var(--negative);
  stroke-dasharray: 4 5;
  stroke-width: 1.2;
}

.report-risk-drawdown-area {
  fill: var(--negative-muted);
  stroke: var(--negative-faint);
  stroke-dasharray: 4 4;
  stroke-width: 1;
}

.report-risk-drawdown-marker {
  stroke: var(--negative-muted);
  stroke-dasharray: 4 5;
  stroke-width: 1.2;
}

.report-risk-drawdown-label {
  fill: var(--negative);
  font-size: 15px;
  font-weight: 800;
}

.report-risk-point {
  stroke: #090b0d;
  stroke-width: 2;
}

.report-risk-point.is-high {
  fill: var(--positive);
}

.report-risk-point.is-low {
  fill: var(--negative);
}

.report-risk-chart-label rect {
  fill: rgba(8, 10, 12, 0.92);
  stroke-width: 1;
}

.report-risk-chart-label text {
  font-size: 14px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: rgba(5, 7, 10, 0.88);
  stroke-width: 3px;
}

.report-risk-chart-label.is-high rect {
  stroke: var(--positive-muted);
}

.report-risk-chart-label.is-high text {
  fill: var(--positive);
}

.report-risk-chart-label.is-low rect {
  stroke: var(--negative-muted);
}

.report-risk-chart-label.is-low text {
  fill: var(--negative);
}

.report-risk-right-value {
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: rgba(5, 7, 10, 0.9);
  stroke-width: 3px;
}

.report-risk-right-value.latest.positive {
  fill: var(--positive);
}

.report-risk-right-value.latest.negative {
  fill: var(--negative);
}

.report-risk-right-value.baseline {
  fill: var(--text);
}

.report-risk-feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.report-risk-feature-card {
  container-type: inline-size;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(17, 20, 25, 0.96), rgba(10, 12, 15, 0.96));
  padding: clamp(12px, 5cqw, 14px) clamp(12px, 5.8cqw, 16px);
  gap: clamp(8px, 4.2cqw, 12px);
  overflow: hidden;
}

body[data-theme="light"] .report-risk-feature-card {
  background: #ffffff;
}

.report-risk-feature-icon {
  display: grid;
  width: clamp(36px, 17cqw, 44px);
  height: clamp(36px, 17cqw, 44px);
  place-items: center;
  border-radius: 999px;
}

.report-risk-feature-icon svg {
  width: clamp(20px, 9cqw, 24px);
  height: clamp(20px, 9cqw, 24px);
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.report-risk-feature-icon-cash {
  background: rgba(59, 130, 246, 0.18);
  color: #3b82f6;
}

.report-risk-feature-icon-type {
  background: rgba(139, 92, 246, 0.18);
  color: #8b5cf6;
}

.report-risk-feature-icon-asset {
  background: var(--positive-muted);
  color: var(--positive);
}

.report-risk-feature-icon-risk {
  background: rgba(245, 158, 11, 0.18);
  color: #f59e0b;
}

.report-risk-feature-copy {
  display: grid;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  gap: 3px;
}

.report-risk-feature-label {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  text-overflow: clip;
  white-space: nowrap;
}

.report-risk-feature-card strong {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(22px, 1.75vw, 30px);
  letter-spacing: 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-overflow: clip;
  white-space: nowrap;
}

.report-risk-feature-card small {
  color: var(--muted);
  font-size: 12px;
}

.report-risk-count-positive {
  color: var(--positive);
}

.report-risk-count-separator {
  color: var(--text);
}

.report-risk-count-negative {
  color: var(--negative);
}

.report-trade-review-body {
  display: grid;
  gap: 16px;
}

.report-trade-win-loss-value {
  display: inline-flex;
  align-items: baseline;
  gap: 0.08em;
  color: var(--text);
}

.report-trade-win-loss-value .neutral,
.report-trade-win-loss-separator {
  color: var(--text);
}

.report-trade-section {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(15, 18, 23, 0.96), rgba(8, 10, 13, 0.96));
}

body[data-theme="light"] .report-trade-section {
  background: #ffffff;
}

.report-trade-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  border-bottom: 1px solid rgba(35, 40, 48, 0.72);
  padding: 0 16px;
}

body[data-theme="light"] .report-trade-section-heading {
  border-bottom-color: var(--line);
}

.report-trade-section-heading h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
}

.report-trade-empty,
.report-trade-private {
  display: grid;
  min-height: 160px;
  place-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.report-trade-private {
  color: var(--text);
  font-size: 24px;
  letter-spacing: 0;
}

.report-trade-return-chart {
  display: block;
  width: 100%;
  min-height: 240px;
}

.report-trade-bar-grid {
  stroke: rgba(141, 149, 163, 0.24);
  stroke-dasharray: 3 5;
  stroke-width: 1;
}

.report-trade-zero-line {
  stroke: rgba(242, 246, 252, 0.42);
  stroke-width: 1.2;
}

body[data-theme="light"] .report-trade-zero-line {
  stroke: rgba(15, 23, 42, 0.38);
}

.report-trade-axis-label,
.report-trade-tag-label,
.report-trade-bar-value {
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: rgba(5, 7, 10, 0.88);
  stroke-width: 3px;
}

body[data-theme="light"] .report-trade-axis-label,
body[data-theme="light"] .report-trade-tag-label,
body[data-theme="light"] .report-trade-bar-value {
  paint-order: normal;
  stroke: none;
  stroke-width: 0;
}

.report-trade-axis-label {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.report-trade-tag-label {
  fill: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.report-trade-tag-pill-bg {
  fill: rgba(5, 7, 10, 0.72);
  stroke: rgba(141, 149, 163, 0.46);
  stroke-width: 1;
}

body[data-theme="light"] .report-trade-tag-pill-bg {
  fill: #ffffff;
  stroke: var(--line-strong);
}

.report-trade-bar {
  opacity: 0.92;
}

.report-trade-bar.positive {
  fill: var(--positive);
}

.report-trade-bar.negative {
  fill: var(--negative);
}

.report-trade-bar-value {
  font-size: 14px;
  font-weight: 800;
}

.report-trade-bar-value.positive {
  fill: var(--positive);
}

.report-trade-bar-value.negative {
  fill: var(--negative);
}

.report-trade-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.9fr);
  gap: 18px;
  padding: 16px;
}

.report-trade-overview-list,
.report-trade-donut-legend,
.report-trade-conclusion-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.report-trade-overview-list {
  overflow: hidden;
  border: 1px solid rgba(35, 40, 48, 0.76);
  border-radius: 8px;
}

body[data-theme="light"] .report-trade-overview-list {
  border-color: var(--line);
}

.report-trade-overview-row {
  display: grid;
  grid-template-columns: auto minmax(112px, 150px) minmax(120px, 170px) minmax(100px, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  border-bottom: 1px solid rgba(35, 40, 48, 0.72);
  padding: 0 14px;
}

body[data-theme="light"] .report-trade-overview-row {
  border-bottom-color: var(--line);
}

.report-trade-overview-row:last-child {
  border-bottom: 0;
}

.report-trade-overview-row span:not(.report-trade-overview-icon) {
  color: var(--muted);
  font-size: 13px;
}

.report-trade-overview-row strong {
  display: flex;
  width: 100%;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 820;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-trade-tag-pill {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  border: 1px solid rgba(141, 149, 163, 0.46);
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(5, 7, 10, 0.72);
  color: var(--text);
  font-size: 13px;
  font-weight: 820;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

body[data-theme="light"] .report-trade-tag-pill {
  background: #ffffff;
  border-color: var(--line-strong);
}

.report-trade-overview-row span.report-trade-tag-pill {
  color: var(--text) !important;
}

.report-trade-overview-row em {
  font-style: normal;
  font-size: 15px;
  font-weight: 820;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.report-trade-overview-icon,
.report-trade-conclusion-icon {
  display: grid;
  place-items: center;
  border-radius: 8px;
}

.report-trade-overview-icon {
  width: 34px;
  height: 34px;
}

.report-trade-overview-icon svg,
.report-trade-conclusion-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.report-trade-overview-icon.trophy,
.report-trade-conclusion-icon.positive {
  background: var(--positive-faint);
  color: var(--positive);
}

.report-trade-overview-icon.loss,
.report-trade-conclusion-icon.negative {
  background: var(--negative-faint);
  color: var(--negative);
}

.report-trade-overview-icon.trend {
  background: rgba(59, 130, 246, 0.16);
  color: #3b82f6;
}

.report-trade-overview-icon.bar {
  background: rgba(245, 158, 11, 0.16);
  color: #f59e0b;
}

.report-trade-overview-icon.scale,
.report-trade-conclusion-icon.neutral {
  background: rgba(141, 149, 163, 0.14);
  color: var(--muted);
}

.report-trade-donut-wrap {
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 0;
  gap: 10px;
}

.report-trade-donut {
  width: min(220px, 100%);
  max-width: 220px;
}

.report-trade-donut-total {
  fill: var(--text);
  font-size: 26px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.report-trade-donut-caption {
  fill: var(--muted);
  font-size: 12px;
}

.report-trade-donut-legend {
  width: min(320px, 100%);
  gap: 8px;
}

.report-trade-donut-legend li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.report-trade-donut-legend strong {
  color: var(--text);
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.report-trade-donut-dot {
  width: 18px;
  height: 8px;
  border-radius: 999px;
}

.report-trade-donut-wrap.is-private .report-trade-donut-dot,
.report-trade-donut-dot.private {
  background: rgba(8, 10, 13, 0.95);
}

.report-trade-conclusion-list {
  padding: 12px 16px 16px;
}

.report-trade-conclusion-row {
  display: grid;
  grid-template-columns: auto minmax(130px, 0.7fr) minmax(82px, auto) minmax(0, 1.5fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  border-bottom: 1px solid rgba(35, 40, 48, 0.72);
}

body[data-theme="light"] .report-trade-conclusion-row {
  border-bottom-color: var(--line);
}

.report-trade-conclusion-row:last-child {
  border-bottom: 0;
}

.report-trade-conclusion-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
}

.report-trade-conclusion-row strong {
  color: var(--text);
  font-size: 15px;
}

.report-trade-conclusion-status {
  display: inline-flex;
  justify-content: center;
  min-width: 76px;
  border-radius: 999px;
  padding: 5px 12px;
  background: rgba(141, 149, 163, 0.12);
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.report-trade-conclusion-status.positive {
  background: var(--positive-soft);
  color: var(--positive);
}

.report-trade-conclusion-status.negative {
  background: var(--negative-soft);
  color: var(--negative);
}

.report-trade-conclusion-row em {
  overflow: hidden;
  color: var(--muted);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-trade-conclusion-arrow {
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
}

.report-trade-detail-table-wrap {
  min-height: 0;
  border: 0;
  border-radius: 0;
}

.report-trade-detail-table-wrap table {
  min-width: 1080px;
  table-layout: auto;
}

.report-trade-detail-table-wrap th,
.report-trade-detail-table-wrap td {
  padding-right: clamp(8px, 0.9vw, 16px);
  padding-left: clamp(8px, 0.9vw, 16px);
  font-size: clamp(12px, 0.86vw, 14px);
  white-space: nowrap;
}

.report-trade-detail-table-wrap th {
  color: var(--muted);
  font-size: clamp(11px, 0.9vw, 12px);
  font-weight: 700;
}

.report-trade-detail-table-wrap th:nth-child(1),
.report-trade-detail-table-wrap td:nth-child(1) {
  width: 13%;
}

.report-trade-detail-table-wrap th:nth-child(2),
.report-trade-detail-table-wrap td:nth-child(2),
.report-trade-detail-table-wrap th:nth-child(3),
.report-trade-detail-table-wrap td:nth-child(3) {
  width: 10%;
}

.report-trade-detail-table-wrap th:nth-child(4),
.report-trade-detail-table-wrap td:nth-child(4) {
  width: 8%;
}

.report-trade-detail-table-wrap th:nth-child(5),
.report-trade-detail-table-wrap td:nth-child(5),
.report-trade-detail-table-wrap th:nth-child(6),
.report-trade-detail-table-wrap td:nth-child(6),
.report-trade-detail-table-wrap th:nth-child(7),
.report-trade-detail-table-wrap td:nth-child(7),
.report-trade-detail-table-wrap th:nth-child(8),
.report-trade-detail-table-wrap td:nth-child(8) {
  width: 11%;
}

.report-trade-detail-table-wrap th:nth-child(9),
.report-trade-detail-table-wrap td:nth-child(9) {
  width: 12%;
}

.report-trade-performance {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
}

.report-trade-performance-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex: 0 0 auto;
  background: var(--muted);
}

.report-trade-performance-dot.positive {
  background: var(--positive);
}

.report-trade-performance-dot.negative {
  background: var(--negative);
}

.report-trade-detail-table-wrap th:nth-child(4),
.report-trade-detail-table-wrap td:nth-child(4),
.report-trade-detail-table-wrap th:nth-child(5),
.report-trade-detail-table-wrap td:nth-child(5),
.report-trade-detail-table-wrap th:nth-child(6),
.report-trade-detail-table-wrap td:nth-child(6),
.report-trade-detail-table-wrap th:nth-child(7),
.report-trade-detail-table-wrap td:nth-child(7) {
  width: 13%;
}

.report-trade-detail-table-wrap th:nth-child(8),
.report-trade-detail-table-wrap td:nth-child(8) {
  width: 11%;
}

.report-risk-chart-hit-area {
  cursor: default;
  pointer-events: all;
}

.report-risk-chart-hover {
  pointer-events: none;
}

.report-risk-chart-hover > line {
  stroke: rgba(242, 246, 252, 0.78);
  stroke-dasharray: 3 5;
  stroke-width: 1.1;
}

.report-risk-chart-hover text {
  fill: var(--text);
  font-size: 13px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  paint-order: stroke;
  stroke: rgba(5, 7, 10, 0.9);
  stroke-width: 3px;
}

.report-risk-chart-hover circle {
  stroke: #090b0d;
  stroke-width: 2;
}

.report-risk-hover-value text {
  fill: var(--report-risk-hover-color);
}

.report-risk-chart-hover > text {
  fill: var(--text);
}

.report-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.report-arrow-button {
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--surface-control);
}

.report-arrow-button:disabled {
  border-color: var(--line-disabled);
  color: var(--text-disabled);
  cursor: default;
  opacity: 0.58;
}

.report-calendar-title-control {
  position: relative;
  display: grid;
  justify-items: center;
}

.report-calendar-title-button {
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0 0 3px;
  cursor: pointer;
}

.report-calendar-title-button strong {
  border-bottom: 1px dashed rgba(141, 149, 163, 0.68);
  padding-bottom: 3px;
}

.report-calendar-title-button:hover strong,
.report-calendar-title-button:focus-visible strong {
  border-bottom-color: var(--muted);
}

.report-calendar-picker-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 16;
  display: grid;
  width: 190px;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 44px var(--shadow-elevated);
  padding: 12px;
  transform: translateX(-50%);
}

.report-calendar-picker-popover label {
  display: grid;
  gap: 6px;
}

.report-calendar-picker-popover span {
  color: var(--muted);
  font-size: 12px;
}

.report-calendar-picker-popover input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-control);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
}

.report-dashed-button {
  border: 0;
  border-bottom: 1px dashed rgba(141, 149, 163, 0.7);
  background: transparent;
  padding: 0 0 2px;
  color: var(--muted);
  cursor: pointer;
}

.report-calendar-grid {
  display: grid;
  gap: 8px;
}

.report-calendar-weekdays,
.report-calendar-cells {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.report-calendar-cells-months {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.report-calendar-cells-years {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.report-calendar-weekdays {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.report-calendar-cell {
  position: relative;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.report-calendar-cell.empty {
  opacity: 0.22;
  cursor: default;
}

.report-calendar-cell.today {
  border-color: var(--line-selected);
}

.report-calendar-cell .day {
  font-size: 14px;
  font-weight: 700;
}

.report-calendar-cell .value {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.report-calendar-cell-period {
  min-height: 116px;
}

.report-calendar-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.report-summary-chip,
.report-top-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-sunken);
  padding: 6px 10px;
  color: var(--muted);
  font-size: 12px;
}

.report-top-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.report-attribution-chart {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px 0 14px;
}

.report-attribution-visual-wrap {
  position: relative;
  width: 100%;
  min-height: 380px;
}

.report-attribution-visual-controls {
  position: absolute;
  top: -42px;
  right: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.report-attribution-visual-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.2;
  padding: 0 15px;
}

.report-attribution-visual-button span {
  border-bottom: 1px dashed rgba(141, 149, 163, 0.72);
  padding-bottom: 3px;
}

.report-attribution-visual-button:hover,
.report-attribution-visual-button:focus-visible {
  border-color: rgba(141, 149, 163, 0.62);
  color: var(--text);
  outline: 0;
}

.report-attribution-visual-button:hover span,
.report-attribution-visual-button:focus-visible span {
  border-bottom-color: var(--text);
}

.report-attribution-donut-wrap {
  position: relative;
  width: min(100%, 1040px);
  aspect-ratio: 1040 / 390;
  margin: 0 auto;
}

.report-attribution-donut-wrap svg {
  width: 100%;
  height: 100%;
}

.report-attribution-donut-track,
.report-attribution-donut-segment {
  fill: none;
  stroke-width: 40;
}

.report-attribution-donut-track {
  stroke: var(--surface-chart-soft);
}

.report-attribution-donut-segment {
  stroke-linecap: butt;
}

.report-attribution-donut-label path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.report-attribution-donut-label text {
  font-size: 13px;
  font-weight: 700;
}

.report-attribution-label-name {
  fill: var(--text);
}

.report-attribution-label-share {
  fill: var(--text);
  font-weight: 600;
}

.report-attribution-label-value {
  fill: var(--text);
  font-variant-numeric: tabular-nums;
}

.report-attribution-mode-button {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: grid;
  justify-items: center;
  gap: 7px;
  font: inherit;
  line-height: 1.2;
  max-width: min(68%, 190px);
  padding: 0;
  transform: translate(-50%, -50%);
}

.report-attribution-mode-label {
  border-bottom: 1px dashed rgba(141, 149, 163, 0.72);
  color: var(--text);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 800;
  padding-bottom: 5px;
}

.report-attribution-total {
  color: var(--text);
  font-size: clamp(13px, 1.2vw, 15px);
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.report-attribution-total.positive {
  color: var(--positive);
}

.report-attribution-total.negative {
  color: var(--negative);
}

.report-attribution-mode-button:hover .report-attribution-mode-label,
.report-attribution-mode-button:focus-visible .report-attribution-mode-label {
  border-bottom-color: var(--muted);
}

.report-attribution-mode-button:focus-visible {
  outline: 0;
}

.report-attribution-area-wrap {
  width: 100%;
  aspect-ratio: 1200 / 380;
  margin: 0 auto;
}

.report-attribution-area-wrap svg {
  width: 100%;
  height: 100%;
}

.report-attribution-area-node rect,
.report-attribution-area-group > rect {
  stroke: none;
  stroke-width: 0;
}

.report-attribution-area-node rect {
  cursor: default;
}

.report-attribution-area-name,
.report-attribution-area-value,
.report-attribution-area-group-label {
  fill: rgba(245, 247, 251, 0.94);
  font-weight: 760;
  pointer-events: none;
}

.report-attribution-area-value {
  fill: rgba(245, 247, 251, 0.82);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.report-attribution-area-group-label {
  fill: rgba(245, 247, 251, 0.72);
  font-size: 12px;
}

.report-attribution-area-empty {
  fill: rgba(8, 9, 11, 0.62);
  stroke: rgba(32, 39, 50, 0.9);
}

.report-attribution-area-private {
  fill: var(--text);
  font-size: 18px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
}

.report-attribution-visual-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.report-attribution-tables {
  grid-template-columns: minmax(0, 1fr);
}

.report-table-wrap table {
  table-layout: fixed;
}

.report-attribution-table-wrap table {
  min-width: 0;
}

.report-attribution-table-wrap th,
.report-attribution-table-wrap td {
  overflow: hidden;
  padding-right: clamp(8px, 1.1vw, 18px);
  padding-left: clamp(8px, 1.1vw, 18px);
  text-overflow: ellipsis;
}

.report-attribution-table-wrap th {
  font-size: clamp(11px, 0.9vw, 12px);
}

.report-attribution-table-wrap td {
  font-size: clamp(12px, 1.1vw, 14px);
}

#reportAssetAttributionTableWrap th:nth-child(1),
#reportAssetAttributionTableWrap td:nth-child(1) {
  width: 15%;
}

#reportAssetAttributionTableWrap th:nth-child(2),
#reportAssetAttributionTableWrap td:nth-child(2) {
  width: 13%;
}

#reportAssetAttributionTableWrap th:nth-child(3),
#reportAssetAttributionTableWrap td:nth-child(3),
#reportAssetAttributionTableWrap th:nth-child(4),
#reportAssetAttributionTableWrap td:nth-child(4),
#reportAssetAttributionTableWrap th:nth-child(5),
#reportAssetAttributionTableWrap td:nth-child(5),
#reportAssetAttributionTableWrap th:nth-child(8),
#reportAssetAttributionTableWrap td:nth-child(8) {
  width: 12%;
}

#reportAssetAttributionTableWrap th:nth-child(6),
#reportAssetAttributionTableWrap td:nth-child(6) {
  width: 13%;
}

#reportAssetAttributionTableWrap th:nth-child(7),
#reportAssetAttributionTableWrap td:nth-child(7) {
  width: 11%;
}

#reportTypeAttributionTableWrap th:nth-child(1),
#reportTypeAttributionTableWrap td:nth-child(1) {
  width: 15%;
}

#reportTypeAttributionTableWrap th:nth-child(2),
#reportTypeAttributionTableWrap td:nth-child(2) {
  width: 13%;
}

#reportTypeAttributionTableWrap th:nth-child(3),
#reportTypeAttributionTableWrap td:nth-child(3),
#reportTypeAttributionTableWrap th:nth-child(4),
#reportTypeAttributionTableWrap td:nth-child(4),
#reportTypeAttributionTableWrap th:nth-child(5),
#reportTypeAttributionTableWrap td:nth-child(5),
#reportTypeAttributionTableWrap th:nth-child(8),
#reportTypeAttributionTableWrap td:nth-child(8) {
  width: 12%;
}

#reportTypeAttributionTableWrap th:nth-child(6),
#reportTypeAttributionTableWrap td:nth-child(6) {
  width: 13%;
}

#reportTypeAttributionTableWrap th:nth-child(7),
#reportTypeAttributionTableWrap td:nth-child(7) {
  width: 11%;
}

.report-wide-table {
  grid-column: 1 / -1;
}

.report-allocation-bar {
  margin-top: 6px;
  height: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-control);
  overflow: hidden;
}

.report-allocation-bar > span {
  display: block;
  height: 100%;
  background: var(--positive);
}

.report-allocation-bar.is-negative > span {
  background: var(--negative);
}

.report-allocation-visual {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.report-allocation-ratio-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  min-width: 0;
  padding: 16px 18px 14px;
}

.report-allocation-ratio-card.is-loading .report-allocation-loading-state {
  min-height: 190px;
}

.report-allocation-ratio-head {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.report-allocation-ratio-title {
  color: var(--text);
  display: inline-block;
  font-size: 16px;
  font-weight: 760;
  line-height: 1.25;
  padding: 0;
}

.report-allocation-ratio-current {
  color: var(--muted);
  display: grid;
  flex: 0 0 auto;
  font-size: 12px;
  gap: 3px;
  justify-items: end;
  line-height: 1.25;
  text-align: right;
}

.report-allocation-ratio-current button {
  background: transparent;
  border: 0;
  border-bottom: 1px dashed rgba(141, 149, 163, 0.68);
  border-radius: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
  padding: 0 0 3px;
}

.report-allocation-ratio-current > button {
  justify-self: end;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.report-allocation-ratio-current div {
  align-items: baseline;
  display: flex;
  gap: 2px;
}

.report-allocation-ratio-current strong {
  color: var(--positive);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.report-allocation-ratio-card.is-negative .report-allocation-ratio-current strong {
  color: var(--negative);
}

.report-allocation-ratio-card.is-private .report-allocation-ratio-current strong {
  color: var(--text);
}

.report-allocation-ratio-chart {
  margin-top: 12px;
  min-width: 0;
}

.report-allocation-ratio-svg {
  display: block;
  height: auto;
  width: 100%;
}

.report-allocation-ratio-grid-line {
  stroke: rgba(43, 48, 58, 0.72);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.report-allocation-ratio-grid-line.vertical {
  stroke: rgba(43, 48, 58, 0.42);
}

body[data-theme="light"] .report-allocation-ratio-grid-line,
body[data-theme="light"] .report-allocation-ratio-grid-line.vertical {
  stroke: rgba(89, 99, 116, 0.28);
  stroke-width: 1px;
}

.report-allocation-ratio-hit-area {
  cursor: crosshair;
  fill: transparent;
  pointer-events: all;
}

.report-allocation-ratio-svg text {
  fill: var(--muted);
  font-size: 11px;
}

.report-allocation-ratio-hover {
  pointer-events: none;
}

.report-allocation-ratio-hover > line {
  stroke: rgba(255, 255, 255, 0.82);
  stroke-dasharray: 3 4;
  stroke-width: 1;
}

.report-allocation-ratio-hover text {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
  paint-order: stroke;
  stroke: rgba(5, 5, 5, 0.92);
  stroke-width: 3px;
}

.report-allocation-ratio-hover circle {
  stroke: #08090b;
  stroke-width: 2;
}

.report-allocation-ratio-hover-value text {
  fill: var(--allocation-hover-color);
}

.report-allocation-ratio-hover > text {
  fill: var(--text);
}

.report-allocation-position-bar {
  display: grid;
  gap: 6px;
  margin: 10px 1.84% 0 7.9%;
}

.report-allocation-position-labels {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  justify-content: space-between;
}

.report-allocation-position-labels strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
}

.report-allocation-position-labels .holding-label strong {
  color: var(--holding-color, #23c55e);
}

.report-allocation-position-labels .cash-label strong {
  color: var(--cash-color, #3b82f6);
}

.report-allocation-position-track {
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  height: 9px;
  overflow: hidden;
  background: var(--surface-control);
}

.report-allocation-position-track span {
  display: block;
  height: 100%;
}

.report-allocation-position-track .holding {
  background: var(--holding-color, #23c55e);
}

.report-allocation-position-track .cash {
  background: var(--cash-color, #3b82f6);
}

.report-allocation-visual-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  display: grid;
  gap: 8px;
  min-height: 360px;
  padding: 12px 16px;
}

.report-allocation-visual-card.is-loading {
  align-content: center;
}

.report-allocation-combined-card {
  min-height: 370px;
  --allocation-donut-size: clamp(200px, 17vw, 260px);
  --allocation-grid-offset: clamp(18px, 1.4vw, 24px);
}

.report-allocation-combined-card.is-private {
  min-height: auto;
}

.report-allocation-visual-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: flex-start;
}

.report-allocation-visual-head span,
.report-allocation-visual-unit {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.report-allocation-group-button {
  background: transparent;
  border: 0;
  border-bottom: 1px dashed rgba(141, 149, 163, 0.68);
  border-radius: 0;
  color: var(--text);
  cursor: pointer;
  display: block;
  font: inherit;
  font-size: 16px;
  font-weight: 760;
  line-height: 1.25;
  padding: 0 0 5px;
}

.report-allocation-internal-selector {
  align-items: baseline;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  position: relative;
}

.report-allocation-visual-head .report-allocation-internal-label {
  color: var(--text);
  font-size: 16px;
  font-weight: 760;
  line-height: 1.25;
}

.report-allocation-visual-head .report-allocation-internal-type-button {
  background: transparent;
  border: 0;
  border-bottom: 1px dashed rgba(141, 149, 163, 0.68);
  border-radius: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.25;
  padding: 0 0 5px;
}

.report-allocation-type-picker {
  align-items: center;
  background: #1c1e22;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  left: 0;
  max-width: min(520px, calc(100vw - 72px));
  padding: 12px;
  position: absolute;
  top: calc(100% + 8px);
  width: max-content;
  z-index: 12;
}

.report-allocation-type-picker.hidden {
  display: none;
}

.report-allocation-type-picker button {
  background: #090b0e;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 760;
  min-height: 30px;
  padding: 0 14px;
  white-space: nowrap;
}

.report-allocation-type-picker button:hover,
.report-allocation-type-picker button:focus-visible,
.report-allocation-type-picker button.active {
  background: var(--text);
  border-color: rgba(244, 245, 247, 0.72);
  color: #050607;
  outline: 0;
}

.report-allocation-metric-button {
  background: transparent;
  border: 0;
  border-bottom: 1px dashed rgba(141, 149, 163, 0.68);
  border-radius: 0;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  padding: 0 0 3px;
  position: absolute;
  right: 12px;
  top: -12px;
  z-index: 1;
}

.report-allocation-donut-legend-item .swatch {
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  height: 9px;
  width: 9px;
}

.report-allocation-line-svg {
  align-self: stretch;
  display: block;
  height: auto;
  min-height: 0;
  width: 100%;
}

.report-allocation-chart-wrap {
  min-width: 0;
  position: relative;
}

.report-allocation-chart-hit-area {
  cursor: crosshair;
  fill: transparent;
  pointer-events: all;
}

.report-allocation-line-svg .report-allocation-grid-line {
  stroke: rgba(43, 48, 58, 0.82);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.report-allocation-line-svg .report-allocation-grid-line.vertical {
  stroke: rgba(43, 48, 58, 0.5);
}

body[data-theme="light"] .report-allocation-line-svg .report-allocation-grid-line,
body[data-theme="light"] .report-allocation-line-svg .report-allocation-grid-line.vertical {
  stroke: rgba(89, 99, 116, 0.28);
  stroke-width: 1px;
}

.report-allocation-line-svg text {
  fill: var(--muted);
  font-size: 12px;
}

.report-allocation-combined-layout {
  align-items: start;
  display: grid;
  gap: clamp(12px, 1.4vw, 24px);
  grid-template-columns: minmax(140px, 0.65fr) minmax(0, var(--allocation-donut-size, 250px)) minmax(360px, 2.5fr);
}

.report-allocation-donut-wrap {
  aspect-ratio: 1;
  align-self: start;
  justify-self: center;
  margin-top: var(--allocation-grid-offset);
  max-width: var(--allocation-donut-size, clamp(200px, 17vw, 260px));
  position: relative;
  width: 100%;
}

.report-allocation-donut-wrap svg {
  height: 100%;
  width: 100%;
}

.report-allocation-donut-track,
.report-allocation-donut-segment {
  fill: none;
  stroke-width: 48;
}

.report-allocation-donut-track {
  stroke: #090a0c;
}

.report-allocation-donut-wrap:not(.is-empty) .report-allocation-donut-track {
  stroke: var(--surface-chart);
}

.report-allocation-donut-wrap.is-empty .report-allocation-donut-track {
  stroke: rgba(255, 255, 255, 0.08);
}

.report-allocation-donut-segment {
  stroke-linecap: butt;
}

.report-allocation-donut-center {
  align-content: center;
  display: grid;
  gap: 4px;
  inset: 50% auto auto 50%;
  justify-items: center;
  position: absolute;
  text-align: center;
  transform: translate(-50%, -50%);
  width: min(60%, 148px);
}

.report-allocation-donut-center span {
  color: var(--muted);
  font-size: 12px;
}

.report-allocation-donut-center strong {
  color: var(--text);
  font-size: clamp(12px, 1.25vw, 16px);
  font-variant-numeric: tabular-nums;
  font-weight: 760;
  line-height: 1.2;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.report-allocation-donut-legend {
  align-content: start;
  align-self: start;
  display: grid;
  gap: clamp(3px, calc(28px / var(--allocation-item-count, 1)), 9px);
  margin-top: var(--allocation-grid-offset);
  min-width: 0;
  padding-left: clamp(10px, 1.8vw, 26px);
}

.report-allocation-donut-legend-item {
  align-items: center;
  color: var(--muted);
  display: grid;
  column-gap: 7px;
  font-size: clamp(8px, calc(190px / var(--allocation-item-count, 1)), 12px);
  grid-template-columns: 9px minmax(0, 1fr);
  line-height: 1.2;
  min-width: 0;
}

.report-allocation-donut-legend-item strong {
  color: var(--text);
  font-size: 1em;
  font-weight: 760;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-allocation-donut-legend-item .swatch {
  grid-row: 1 / span 2;
}

.report-allocation-donut-legend-item .meta {
  color: var(--muted);
  font-size: 0.9em;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-allocation-chart-hover {
  pointer-events: none;
}

.report-allocation-chart-hover > line {
  stroke: rgba(255, 255, 255, 0.82);
  stroke-dasharray: 3 4;
  stroke-width: 1;
}

.report-allocation-chart-hover text {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  font-weight: 720;
  paint-order: stroke;
  stroke: rgba(5, 5, 5, 0.92);
  stroke-width: 3px;
}

.report-allocation-chart-hover circle {
  stroke: #08090b;
  stroke-width: 2;
}

.report-allocation-hover-value text {
  fill: var(--allocation-hover-color);
}

.report-allocation-chart-hover > text {
  fill: var(--text);
}

.report-allocation-locked {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 30px;
  font-weight: 800;
  justify-content: center;
  min-height: 250px;
}

.report-allocation-locked.compact {
  font-size: 24px;
  min-height: 150px;
}

.report-trend-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.report-trend-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  padding: 12px;
}

.report-trend-card strong {
  font-size: 14px;
}

.report-trend-card svg {
  width: 100%;
  height: 72px;
}

.report-day-detail-body {
  display: grid;
  gap: 8px;
  padding: 14px 16px 16px;
}

.report-day-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.report-day-detail-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-sunken);
  padding: 10px 12px;
}

.report-day-detail-item strong {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  font-size: clamp(16px, 2vw, 20px);
  font-variant-numeric: tabular-nums;
  line-height: 1.08;
  text-overflow: clip;
  white-space: nowrap;
}

.report-day-modal-panel {
  width: min(880px, calc(100vw - 32px));
}

.report-day-modal-panel .panel-heading {
  min-height: 64px;
  padding: 14px 16px;
}

@media (max-width: 1180px) {
  .report-brief-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-calendar-cells-months {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .report-allocation-combined-layout {
    grid-template-columns: minmax(120px, 0.85fr) minmax(0, var(--allocation-donut-size, 240px));
  }

  .report-allocation-chart-wrap {
    grid-column: 1 / -1;
  }

  .report-fx-structure-layout {
    grid-template-columns: 1fr;
  }

  .report-fx-donut {
    max-width: 220px;
  }
}

@media (max-width: 900px) {
  html,
  body {
    height: auto;
    min-height: 100%;
    overflow: auto;
  }

  .app-shell {
    height: auto;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
    gap: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 12px 16px;
    height: auto;
    overflow: visible;
  }

  .nav-list {
    display: flex;
    flex: 0 1 auto;
    flex-direction: row;
    gap: 8px;
    margin-top: 0;
    overflow-x: auto;
    max-width: 100%;
  }

  .nav-module {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
  }

  .nav-module-row {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
  }

  .nav-sublist {
    display: flex;
    flex: 0 0 auto;
    gap: 6px;
    max-height: none;
    padding-left: 0;
  }

  .nav-module.is-collapsed .nav-sublist {
    display: none;
  }

  .nav-item {
    min-height: 36px;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .nav-sub-item {
    padding-left: 10px;
  }

  .modal-panel.settings-panel {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .settings-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .settings-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    padding: 12px;
  }

  .settings-tab,
  .settings-signout-button {
    flex: 0 0 auto;
    min-height: 36px;
    white-space: nowrap;
  }

  .settings-signout-button {
    width: auto;
    margin-top: 0;
    text-align: center;
  }

  .settings-content {
    max-height: calc(100vh - 210px);
    overflow-y: auto;
    padding: 16px;
  }

  .settings-profile-form,
  .settings-security-stack,
  .settings-preferences-form {
    grid-template-columns: 1fr;
  }

  .settings-profile-form .settings-form-actions,
  .settings-profile-form .settings-message {
    grid-column: auto;
  }

  .settings-danger-zone {
    grid-template-columns: 1fr;
  }

  .profile-settings-heading {
    grid-template-columns: 1fr;
  }

  .settings-edit-button {
    justify-self: start;
  }

  .profile-avatar-editor,
  .profile-avatar-actions {
    justify-items: center;
    text-align: center;
  }

  .settings-danger-zone {
    grid-template-columns: 1fr;
  }

  .workspace {
    height: auto;
    padding: 18px 14px;
    overflow: visible;
  }

  .report-sticky-header {
    margin-top: -18px;
    padding-top: 18px;
  }

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

  .investment-notebook-panel.is-floating-open,
  .xiaoyu-assistant-panel.is-floating-open {
    top: 76px;
    right: 14px;
    width: min(360px, calc(100vw - 28px));
    max-height: calc(100vh - 96px);
  }

  .content-grid,
  .overview-grid,
  .trade-form,
  .compact-form,
  .asset-trade-form,
  .report-two-column,
  .report-table-grid,
  .report-trend-grid,
  .report-custom-range {
    grid-template-columns: 1fr;
  }

  .report-range-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .report-attribution-chart {
    padding-top: 0;
  }

  .report-metric-grid,
  .report-metric-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-fx-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .report-risk-metric-row {
    grid-template-columns: 1fr;
  }

  .report-risk-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .report-trade-conclusion-row {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 12px;
    padding: 12px 0;
  }

  .report-trade-conclusion-status,
  .report-trade-conclusion-row em,
  .report-trade-conclusion-arrow {
    grid-column: 2;
  }

  .report-calendar-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 12px;
  }

  .report-calendar-heading .report-small-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
    width: min(100%, 260px);
  }

  .report-calendar-heading .report-dashed-button {
    grid-column: 2;
    grid-row: 1;
  }

  .report-calendar-cells-months {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .report-day-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-fx-section-heading,
  .report-fx-rate-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .report-fx-rate-legend {
    justify-content: flex-start;
  }

}

@media (max-width: 620px) {
  .report-risk-feature-grid {
    grid-template-columns: 1fr;
  }

  .chart-range-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .overview-custom-range-popover {
    right: 0;
    left: 0;
    width: 100%;
  }

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

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

  .report-base-currency {
    justify-items: start;
    text-align: left;
  }

  .report-topbar-meta {
    max-width: 100%;
    text-align: left;
  }

  .report-base-currency .currency-picker-popover {
    right: auto;
    left: 0;
  }

  .report-fx-structure-head,
  .report-fx-structure-row {
    gap: 8px;
    grid-template-columns: minmax(72px, 0.9fr) minmax(64px, 1fr) minmax(96px, 1fr) minmax(52px, 0.7fr);
  }

  .report-fx-currency-name {
    gap: 6px;
  }

  .report-fx-currency-name strong,
  .report-fx-structure-row .numeric {
    font-size: 12px;
  }

  .report-fx-currency-name em {
    display: none;
  }

  .report-fx-rate-svg {
    min-height: 220px;
  }

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

  .overview-return-panel {
    width: 100%;
    justify-items: end;
    min-width: 0;
    text-align: right;
  }

  .ticker-strip {
    grid-template-columns: 1fr;
  }

  .metric {
    min-height: 102px;
    padding: 18px;
  }

  .asset-metrics .metric strong {
    font-size: 28px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
    min-height: auto;
  }

  .report-panel-heading {
    align-items: flex-start;
  }

  .report-heading-actions {
    width: 100%;
    justify-content: space-between;
  }

  .report-small-tabs {
    width: 100%;
  }

  .report-calendar-heading .report-small-tabs {
    width: 100%;
  }

  .report-brief-metrics {
    grid-template-columns: 1fr;
  }

  .report-calendar-cells-months {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-calendar-weekdays,
  .report-calendar-cells {
    gap: 6px;
  }

  .report-calendar-cell {
    min-height: 72px;
    padding: 8px;
  }

  .report-day-detail-grid {
    grid-template-columns: 1fr;
  }

  .report-allocation-combined-layout {
    grid-template-columns: minmax(96px, 1fr) minmax(0, var(--allocation-donut-size, 190px));
    gap: 12px;
  }

  .report-allocation-combined-card {
    --allocation-donut-size: clamp(150px, 38vw, 190px);
  }

  .report-allocation-ratio-head {
    align-items: start;
    flex-direction: column;
  }

  .report-allocation-ratio-current {
    justify-items: start;
    text-align: left;
  }

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

  .report-allocation-line-svg {
    min-height: 0;
  }

  .trade-entry-grid .entry-panel .panel-heading {
    align-items: center;
    flex-direction: row;
  }

  .preview-row {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 14px;
  }

  .preview-row strong {
    white-space: normal;
  }

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