:root {
  --chart-card: #f7f7f8;
  --chart-control: #e5e5ea;
  --chart-control-active: #fff;
  --chart-grid: #dedee2;
  --chart-spy: #666a70;
  --chart-fixed: #a87612;
  --chart-fixed3: #a84e59;
  --chart-dynamic: #16746d;
}

[data-theme="dark"] {
  --chart-card: #1c1c1e;
  --chart-control: #343438;
  --chart-control-active: #55555c;
  --chart-grid: #343438;
  --chart-spy: #a6abb2;
  --chart-fixed: #d1a33e;
  --chart-fixed3: #d47a84;
  --chart-dynamic: #61b2aa;
}

.portfolio-link { color: inherit; text-underline-offset: 0.2em; }
.portfolio-link::after { display: inline-block; margin-left: 3px; font-size: 0.65em; line-height: 0; vertical-align: super; text-decoration: none; content: "\2197"; }
.formula { font-family: Georgia, serif; text-transform: none; }
.formula__math { max-width: 100%; overflow-x: auto; padding: 6px 0; }
.formula__math math { width: max-content; margin: 0 auto; font-size: 16px; }
.chart-message { align-items: flex-end; margin-top: 16px; margin-bottom: 22px; }
.chart-attachment { flex: 1 1 auto; min-width: 0; max-width: 336px; margin: 0; padding: 13px 10px 10px; overflow: hidden; border: 1px solid var(--rule); border-radius: 8px; background: var(--chart-card); }
.chart-attachment__head { display: block; margin: 0 2px 10px; font-size: 11px; line-height: 1.35; }
.chart-attachment__title { display: block; color: var(--text); font-size: 13px; font-weight: 400; }
.chart-attachment__head span { color: var(--muted); }
.chart-canvas { position: relative; width: 100%; }
.chart-canvas--curve { height: 188px; }
.chart-canvas--history { height: 224px; }
.chart-canvas--results { height: 218px; }
.chart-error { display: grid; place-items: center; height: 100%; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.4; text-align: center; }
.chart-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; width: 100%; margin-top: 10px; padding: 2px; border-radius: 7px; background: var(--chart-control); }
.chart-mode { min-width: 0; min-height: 28px; padding: 4px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 11px; font-weight: 600; letter-spacing: 0; }
.chart-mode.is-active { background: var(--chart-control-active); color: var(--text); }
.chart-mode:focus-visible { outline: 2px solid var(--outgoing); outline-offset: 1px; }
.chart-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 10px; margin: 8px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.2; }
.chart-legend span { display: flex; align-items: center; min-width: 0; white-space: nowrap; }
.chart-legend i { flex: 0 0 auto; width: 14px; height: 2px; margin-right: 5px; border-radius: 1px; background: var(--muted); }
.chart-legend i[data-chart-color="spy"] { background: var(--chart-spy); }
.chart-legend i[data-chart-color="fixed"] { background: var(--chart-fixed); }
.chart-legend i[data-chart-color="fixed3"] { background: var(--chart-fixed3); }
.chart-legend i[data-chart-color="dynamic"] { background: var(--chart-dynamic); }
.final-exchange { padding-bottom: 0; }
