@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/poppins-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/poppins-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Poppins';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/poppins-latin-600-normal.woff2') format('woff2');
}

:root {
  --bg: #202734;
  --surface: #36415a;
  --accent: #b7d894;
  --light: #e0f8c7;
  --text: #e0f8c7;
  --muted: rgba(224, 248, 199, 0.62);
  --faint: rgba(224, 248, 199, 0.08);
  --line: rgba(224, 248, 199, 0.1);
  --sunk: rgba(32, 39, 52, 0.55);
  --danger: #f0a39b;
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 600;
}

h2 {
  font-size: 19px;
  font-weight: 600;
}

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

.small {
  font-size: 13px;
}

svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, opacity 0.15s;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn.block {
  width: 100%;
}

.btn.primary {
  background: var(--accent);
  color: var(--bg);
}

.btn.primary:hover {
  background: var(--light);
}

.btn.secondary {
  background: var(--sunk);
  color: var(--text);
}

.btn.secondary:hover {
  background: var(--bg);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
}

.btn.ghost:hover {
  color: var(--text);
  background: var(--faint);
}

.btn.danger {
  background: var(--danger);
  color: var(--bg);
}

.btn:disabled,
.icon-btn:disabled,
.link-btn:disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.icon-btn:hover {
  background: var(--faint);
  color: var(--text);
}

.icon-btn.danger:hover {
  color: var(--danger);
}

.icon-btn.compact {
  width: 36px;
  height: 36px;
}

.icon-btn.compact svg {
  width: 18px;
  height: 18px;
}

.link-btn {
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.link-btn:hover {
  background: var(--faint);
}

/* ---- mark ---- */

.mark {
  width: 48px;
  height: 48px;
  stroke-width: 3.5;
}

.mark rect {
  fill: var(--accent);
  stroke: none;
}

.mark path {
  stroke: var(--bg);
}

.mark.small {
  width: 32px;
  height: 32px;
}

/* ---- sign in ---- */

.login {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px 16px;
}

.login-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(380px, 100%);
  padding: 36px 24px 28px;
  border-radius: 24px;
  background: var(--surface);
  text-align: center;
}

.login-card .mark {
  margin-bottom: 8px;
}

.login-card .muted {
  max-width: 260px;
  font-size: 14px;
}

.code-input {
  width: 100%;
  margin: 12px 0 4px;
  padding: 14px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--bg);
  color: var(--light);
  font: inherit;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-align: center;
  text-indent: 0.35em;
}

.code-input::placeholder {
  color: rgba(224, 248, 199, 0.25);
}

.code-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(183, 216, 148, 0.18);
}

.form-error {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
}

.form-error:empty {
  min-height: 0;
}

/* ---- layout ---- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.content {
  max-width: 1160px;
  margin: 0 auto;
  padding: 4px 16px calc(32px + env(safe-area-inset-bottom));
}

.accounts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 16px;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 72px 24px;
  border-radius: 24px;
  background: var(--surface);
  text-align: center;
}

.empty .muted {
  max-width: 320px;
  margin-bottom: 12px;
}

/* ---- account card ---- */

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: 20px;
  background: var(--surface);
  transition: opacity 0.2s;
}

.card.is-busy {
  opacity: 0.7;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  min-width: 0;
}

.card-login {
  overflow: hidden;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-name-row {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  margin-left: -2px;
}

.card-name-row .icon-btn {
  flex: none;
  width: 32px;
  height: 32px;
}

.card-name-row .icon-btn svg {
  width: 16px;
  height: 16px;
}

.card-server {
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--sunk);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

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

.status.connected {
  color: var(--accent);
}

.status.starting,
.status.preparing,
.status.reconnecting {
  color: var(--light);
}

.status.starting i,
.status.preparing i,
.status.reconnecting i {
  background: var(--accent);
  animation: pulse 1.2s ease-in-out infinite;
}

.status.failed,
.status.noconnection,
.status.error {
  color: var(--danger);
}

@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}

.card-reason {
  margin-top: -6px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(240, 163, 155, 0.1);
  color: var(--danger);
  font-size: 13px;
}

.experts {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.experts li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.expert-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.expert-name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.expert-meta {
  color: var(--muted);
  font-size: 13px;
}

.expert-meta.live {
  color: var(--accent);
}

.expert-actions {
  display: flex;
  align-items: center;
  flex: none;
}

.experts-empty {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-actions .btn {
  flex: 1;
  padding-inline: 12px;
}

/* ---- switches ---- */

.switch,
.switch-ui {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: var(--bg);
  cursor: pointer;
  transition: background-color 0.15s;
}

.switch::after,
.switch-ui::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.15s, background-color 0.15s;
}

.switch[aria-checked='true'],
input:checked + .switch-ui {
  background: var(--accent);
}

.switch[aria-checked='true']::after,
input:checked + .switch-ui::after {
  background: var(--bg);
  transform: translateX(18px);
}

input:focus-visible + .switch-ui {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.algo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: -4px;
}

.algo-title {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

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

/* ---- EA settings ---- */

dialog.wide {
  width: min(560px, calc(100% - 32px));
  overflow: hidden;
  overflow: clip;
}

/* The dialog fits the screen and only the settings list scrolls, without a visible scrollbar. */
dialog.wide .dialog-body {
  max-height: min(88dvh, 820px);
}

.settings-list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 -24px;
  padding: 0 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.settings-list::-webkit-scrollbar {
  display: none;
}

#settings-charts {
  display: flex;
  flex-wrap: wrap;
}

#settings-charts span {
  padding-inline: 12px;
}

.settings-group {
  margin: 18px 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.settings-group:first-child {
  margin-top: 0;
}

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}

.setting-name {
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.setting input:not([type='checkbox']) {
  flex: none;
  width: 150px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  text-align: right;
}

.setting input:not([type='checkbox']):focus {
  outline: none;
  border-color: var(--accent);
}

.setting input[type='checkbox'] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.setting.changed .setting-name {
  color: var(--accent);
}

.settings-empty {
  padding: 24px 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* ---- dialogs ---- */

dialog {
  width: min(440px, calc(100% - 32px));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
}

dialog {
  scrollbar-width: none;
}

dialog::-webkit-scrollbar {
  display: none;
}

dialog::backdrop {
  background: rgba(14, 18, 25, 0.72);
  backdrop-filter: blur(3px);
}

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
}

.dialog-sub {
  margin-top: -10px;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.dialog-actions .start {
  margin-right: auto;
}

.btn.danger-text {
  color: var(--danger);
}

.btn.danger-text:hover {
  background: rgba(240, 163, 155, 0.1);
  color: var(--danger);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.field legend {
  margin-bottom: 6px;
  padding: 0;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
}

.field input::placeholder {
  color: rgba(224, 248, 199, 0.3);
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(183, 216, 148, 0.18);
}

.chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 6px;
}

.chips label {
  position: relative;
}

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

.chips span {
  display: block;
  padding: 9px 0;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.chips input:checked + span {
  background: var(--accent);
  color: var(--bg);
}

.chips input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 32px 16px;
  border: 1.5px dashed rgba(224, 248, 199, 0.25);
  border-radius: 16px;
  background: var(--sunk);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.drop:hover,
.drop.dragging {
  border-color: var(--accent);
}

.drop.has-file {
  border-style: solid;
  border-color: var(--accent);
}

.drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.drop:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.drop svg {
  width: 26px;
  height: 26px;
  margin-bottom: 6px;
  color: var(--accent);
}

.drop-label {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.drop-hint {
  font-size: 13px;
}

/* ---- toast ---- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 10;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--light);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: var(--danger);
}

/* ---- phones ---- */

@media (max-width: 560px) {
  .topbar {
    padding-block: 16px;
  }

  .brand span {
    font-size: 16px;
  }

  .topbar .btn.primary {
    width: 44px;
    padding: 0;
  }

  .topbar .btn.primary span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .card {
    padding: 18px 16px;
  }

  dialog {
    width: 100%;
    max-height: 92dvh;
    margin: auto 0 0;
    border-radius: 22px 22px 0 0;
  }

  .dialog-body {
    padding: 24px 16px calc(20px + env(safe-area-inset-bottom));
  }

  dialog.wide {
    width: 100%;
  }

  dialog.wide .dialog-body {
    max-height: 92dvh;
  }

  .settings-list {
    margin: 0 -16px;
    padding: 0 16px;
  }

  .setting input:not([type='checkbox']) {
    width: 120px;
  }

  .dialog-actions .btn {
    flex: 1;
  }

  .dialog-actions .start {
    flex-basis: 100%;
    order: 1;
  }
}

/* ---- tabs ---- */

.tabs {
  display: flex;
  gap: 4px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px 16px;
}

.tab {
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.tab:hover {
  background: var(--faint);
  color: var(--text);
}

.tab[aria-selected='true'] {
  background: var(--surface);
  color: var(--text);
}

/* ---- overview ---- */

.overview {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.chips.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  background: var(--surface);
}

.chips.segmented span {
  min-width: 48px;
  padding: 7px 12px;
  background: transparent;
}

.chips.segmented span:hover {
  background: var(--faint);
}

.chips.segmented input:checked + span {
  background: var(--accent);
  color: var(--bg);
}

.ov-settings-btn {
  margin-left: auto;
  background: var(--surface);
}

.ov-settings-btn:hover {
  background: var(--surface);
  color: var(--accent);
}

.setting-hint {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

#ov-settings-accounts .setting:last-child {
  border-bottom: 0;
}

.ov-notice {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr));
  gap: 12px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 16px;
  border-radius: 16px;
  background: var(--surface);
}

.tile-value {
  overflow: hidden;
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tile-label {
  font-size: 13px;
  font-weight: 500;
}

.tile-sub {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pos {
  color: var(--accent);
}

.neg {
  color: var(--danger);
}

.panel {
  padding: 20px;
  border-radius: 20px;
  background: var(--surface);
}

.panel-title {
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}

.chart {
  position: relative;
  height: 220px;
  border-radius: 8px;
  outline: none;
  touch-action: pan-y;
}

.chart:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.chart svg {
  display: block;
  width: 100%;
  height: 100%;
  stroke: none;
}

.chart .grid {
  stroke: var(--line);
  stroke-width: 1;
}

.chart .baseline {
  stroke: rgba(224, 248, 199, 0.28);
  stroke-width: 1;
}

.chart .axis-label {
  fill: var(--muted);
  font-family: inherit;
  font-size: 11px;
}

.chart .line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}

.chart .area {
  fill: var(--accent);
  opacity: 0.1;
}

.chart .crosshair {
  stroke: rgba(224, 248, 199, 0.35);
  stroke-width: 1;
}

.chart .hover-dot {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
}

.chart-tip {
  position: absolute;
  z-index: 1;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg);
  box-shadow: 0 6px 20px rgba(14, 18, 25, 0.45);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
  white-space: nowrap;
}

.chart-tip strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.chart-tip span {
  display: block;
  color: var(--muted);
}

.chart-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-size: 14px;
}

.table-wrap {
  margin: 0 -20px;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}

.table-wrap::-webkit-scrollbar {
  display: none;
}

.trades {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.trades th {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.trades td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

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

.trades th:first-child,
.trades td:first-child {
  padding-left: 0;
}

.trades th:last-child,
.trades td:last-child {
  padding-right: 0;
}

.trades .num {
  text-align: right;
}

.trades .strong {
  font-weight: 600;
}

.side {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--sunk);
  font-size: 12px;
  text-transform: capitalize;
}

.m-only {
  display: none;
}

.btn.more {
  width: 100%;
  margin-top: 12px;
}

/* ---- library and files ---- */

.files-card {
  padding: 4px 20px;
  border-radius: 20px;
  background: var(--surface);
}

.file-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.file-list li:last-child {
  border-bottom: 0;
}

.file-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.file-name {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.file-name:hover {
  text-decoration: underline;
}

.file-meta {
  color: var(--muted);
  font-size: 13px;
}

.file-actions {
  display: flex;
  align-items: center;
  flex: none;
  gap: 4px;
}

a.btn {
  text-decoration: none;
}

.files-empty {
  padding: 20px 0;
  font-size: 13px;
}

.pick-list {
  max-height: 52dvh;
  overflow-y: auto;
  scrollbar-width: none;
}

.pick-list::-webkit-scrollbar {
  display: none;
}

.pick-list .btn {
  flex: none;
  min-width: 96px;
}

@media (max-width: 560px) {
  .files-card {
    padding: 4px 16px;
  }

  /* The file name is a download link too, so the button can shrink to its icon. */
  .file-actions .btn {
    padding-inline: 12px;
  }

  .file-actions .btn span {
    display: none;
  }

  .tabs {
    padding-bottom: 12px;
  }

  .tab {
    flex: 1;
    padding-inline: 6px;
  }

  .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .tile {
    padding: 14px;
  }

  .tile-value {
    font-size: 18px;
  }

  .panel {
    padding: 18px 16px;
  }

  .chart {
    height: 180px;
  }
}

/* Below tablet width each trade is two lines (what, then when and at which prices) with the
   result on the right, so the result never ends up off screen. */
@media (max-width: 820px) {
  .table-wrap {
    margin: 0;
    padding: 0;
  }

  .trades thead {
    display: none;
  }

  .trades tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }

  .trades tr:last-child {
    border-bottom: 0;
  }

  .trades td {
    padding: 0 !important;
    border: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .trades .m-hide {
    display: none;
  }

  .trades .c-main {
    grid-row: 1;
    grid-column: 1;
    font-weight: 500;
  }

  .trades .c-meta {
    grid-row: 2;
    grid-column: 1;
    color: var(--muted);
    font-size: 12px;
  }

  .trades .c-res {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
  }

  .m-only {
    display: inline;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
