.mar {
  --mar-ink: #17191e;
  --mar-muted: #8a8f97;
  --mar-line: #f0f0f1;
  --mar-fill: #f5f5f6;
  --mar-yellow: #fcd535;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  position: relative;
  background: #fff;
  color: var(--mar-ink);
}
.mar button, .mar input, .mar select { font: inherit; color: inherit; }
.mar h1, .mar h2, .mar p, .mar dl { margin: 0; }
.mar-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.mar-top { display: flex; align-items: center; justify-content: space-between; min-height: 47px; gap: 6px; padding: 0 8px; border-bottom: 1px solid #f7f7f7; }
.mar-top h1 { flex: 1; min-width: 0; text-align: center; font-size: 16px; font-weight: 670; line-height: 1.2; }
.mar-top > .mar-segments { width: min(155px, 55%); margin: 0 auto; }
.mar .mar-icon { flex: 0 0 36px; width: 36px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; background: none; }
.mar-top:not(:has(.mar-icon:nth-of-type(2))) { padding-right: 44px; }
.mar-content { padding: 0 15px 16px; }
.mar-fill { flex: 1; display: flex; flex-direction: column; }
.mar-bottom { margin-top: auto; padding: 15px 15px 23px; }
.mar-segments { display: flex; gap: 2px; align-items: center; background: #f6f6f6; border-radius: 6px; padding: 3px; }
.mar-segments button { flex: 1; padding: 5px 8px; min-height: 29px; min-width: 0; border-radius: 5px; border: 0; background: none; color: #757a80; font-size: 12px; white-space: nowrap; }
.mar-segments button[aria-pressed="true"] { background: #fff; color: #111; font-weight: 650; }
.mar-underlines { background: none; justify-content: start; padding: 0; gap: 14px; border-bottom: 1px solid #f5f5f5; border-radius: 0; margin-bottom: 15px; }
.mar-underlines button { flex: 0 1 auto; position: relative; padding: 0; min-height: 38px; font-size: 13px; }
.mar-underlines button[aria-pressed="true"]::after { content: ""; position: absolute; bottom: 1px; left: calc(50% - 7px); width: 14px; height: 3px; background: var(--mar-yellow); border-radius: 4px; }
.mar-pair { display: grid; gap: 5px; margin: 8px 0 12px; color: var(--mar-muted); font-size: 11px; min-width: 0; }
.mar-pair select { border: 0; border-radius: 6px; width: 100%; min-width: 0; background: var(--mar-fill); color: var(--mar-ink); padding: 8px; min-height: 37px; font-size: 13px; font-weight: 650; }
.mar-empty { display: grid; place-items: center; gap: 13px; padding: 60px 15px 22px; text-align: center; color: #989da5; }
.mar-empty p { max-width: 260px; font-size: 13px; line-height: 1.42; }
.mar .mar-primary, .mar .mar-secondary { width: 100%; min-height: 43px; border: 0; border-radius: 6px; text-align: center; padding: 8px 10px; font-size: 14px; font-weight: 650; }
.mar .mar-primary { color: #141416; background: var(--mar-yellow); }
.mar .mar-primary:disabled { color: #94999d; background: #fbf1cc; }
.mar .mar-secondary { background: #f4f5f6; margin-top: 8px; }
.mar-empty .mar-primary { width: min(155px, 100%); min-height: 39px; }
.mar-content > .mar-secondary { margin-top: 10px; }
.mar-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: auto; padding: 12px 12px 23px; }
.mar-tools button { border: 0; border-radius: 5px; background: #f5f5f6; min-height: 31px; padding: 5px 9px; font-size: 12px; }
.mar-notice { background: #f6f6f6; border-radius: 6px; line-height: 1.4; padding: 11px; font-size: 12px; color: #666d75; }
.mar-content > .mar-notice { margin: 12px 0; }
.mar-metrics { padding: 12px 0; }
.mar-metrics div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; line-height: 1.45; padding: 5px 0; font-size: 13px; }
.mar-metrics dt { color: var(--mar-muted); }
.mar-metrics dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.mar-input { display: flex; align-items: center; gap: 6px; min-height: 45px; margin-bottom: 8px; padding: 0 10px; background: var(--mar-fill); border-radius: 5px; font-size: 12px; }
.mar-input span:last-child { color: #626972; }
.mar-input input { flex: 1; min-width: 0; width: 100%; padding: 4px 1px; background: none; border: 0; font-variant-numeric: tabular-nums; }
.mar-max-input { position: relative; }
.mar-max-input .mar-input { padding-right: 49px; }
.mar .mar-max { position: absolute; right: 7px; top: 7px; min-height: 31px; padding: 0 5px; border: 0; background: none; color: #a48313; font-size: 12px; }
.mar-message { margin: 7px 0 9px !important; color: #1a8a6e; font-size: 12px; line-height: 1.45; }
.mar-message.mar-error { color: #b13548; }
.mar-calc-options { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; align-items: end; margin-bottom: 9px; }
.mar-calc-options .mar-pair { margin: 0; }
.mar-calc-options .mar-segments, .mar-sides { margin-bottom: 0; }
.mar-calc-options .mar-segments button[aria-pressed="true"] { background: var(--mar-yellow); }
.mar .mar-sides { margin: 0 0 13px; }
.mar .mar-sides button[aria-pressed="true"] { color: #fff; background: #2aaf81; }
.mar .mar-sides button[data-mar-value="Margin Sell"][aria-pressed="true"] { background: #e64c63; }
.mar .mar-help { color: var(--mar-muted); font-size: 12px; line-height: 1.42; margin: 9px 0 12px; }
.mar-calc h2 { font-size: 15px; margin-top: 12px; }
.mar-calc .mar-metrics { padding-top: 4px; }
.mar-switch-row { width: 100%; min-height: 48px; border: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; background: none; padding: 0; font-size: 14px; font-weight: 550; }
.mar-switch { flex: 0 0 34px; height: 20px; border-radius: 19px; position: relative; background: #c6c9ce; }
.mar-switch::after { content: ""; position: absolute; top: 3px; left: 3px; border-radius: 50%; width: 14px; height: 14px; background: #fff; }
.mar-switch-row[aria-checked="true"] .mar-switch { background: var(--mar-yellow); }
.mar-switch-row[aria-checked="true"] .mar-switch::after { left: 17px; }
.mar-periods { background: none; border-radius: 0; }
.mar-periods button { border: 1px solid #f0f0f1; padding-inline: 3px; }
.mar-periods button[aria-pressed="true"] { border-color: #111; }
.mar-overlay { position: absolute; z-index: 2; inset: 0; display: grid; place-items: center; background: #0008; padding: 16px; }
.mar-dialog { width: min(310px, 100%); padding: 15px; border-radius: 13px; background: #fff; }
.mar-dialog > span { display: grid; place-items: center; width: 37px; height: 37px; margin: 0 auto 14px; border-radius: 50%; background: #fff0aa; color: #a37a00; font-weight: 750; }
.mar-dialog p { font-size: 13px; line-height: 1.5; margin-bottom: 12px; }
