:is(.spot-view, .spot-preview) {
  --spot-ink: #263a2e;
  --spot-muted: #536657;
  --spot-line: #dce5d7;
  --spot-paper: #fffdf5;
  --spot-shade: #eef3e8;
  --spot-primary: #345a43;
  --spot-up: #216b51;
  --spot-down: #a3423d;
  display: grid;
  gap: 12px;
  min-width: 0;
  color: var(--spot-ink);
}

.spot-view [hidden] { display: none; }
.spot-view :is(h2,h3,p) { margin: 0; }

.spot-view-head,
.spot-quote-head,
.spot-order-head,
.spot-account-head,
.spot-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.spot-view-head > div > span { font-size: 12px; color: var(--spot-muted); }
.spot-mode,
.spot-ranges,
.spot-side,
.spot-account-tabs {
  display: flex;
  align-items: stretch;
  gap: 3px;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--spot-line);
  border-radius: 10px;
  background: var(--spot-shade);
}

.spot-mode > *,
.spot-ranges > button,
.spot-side > button,
.spot-account-tabs > button {
  display: grid;
  place-items: center;
  min-height: 39px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 780;
  color: var(--spot-muted);
  text-align: center;
}

.spot-mode [aria-current],
.spot-view button[aria-pressed="true"]:not([data-spot-asset]) {
  background: var(--spot-paper);
  color: var(--spot-primary);
  box-shadow: 0 1px 3px #344d3324;
}

.spot-assets { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
.spot-assets button {
  min-width: 0;
  min-height: 72px;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 3px 1px 5px;
  border: 1px solid var(--spot-line);
  border-radius: 9px;
  background: #f2f4ea;
}

.spot-assets canvas { display: block; width: 43px; max-width: 100%; height: 35px; object-fit: contain; }
.spot-assets strong { font-size: 12px; }
.spot-assets small { font-size: 10px; font-variant-numeric: tabular-nums; color: var(--spot-muted); }
.spot-assets button[aria-pressed="true"] { background: #e4eedf; border-color: #64876a; box-shadow: inset 0 0 0 1px #64876a; }

.spot-layout { display: grid; grid-template-columns: minmax(0, 1.17fr) minmax(0, .83fr); gap: 9px; align-items: start; }
.spot-card {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--spot-line);
  border-radius: 12px;
  background: var(--spot-paper);
}

.spot-card h3 { font-size: 14px; font-weight: 850; }
.spot-quote-head { align-items: start; }
.spot-price { display: flex; gap: 5px; align-items: baseline; margin-top: 2px; }
.spot-price strong { font-size: clamp(24px, 4vw, 34px); line-height: 1.03; font-variant-numeric: tabular-nums; }
.spot-price small, .spot-order-head > span { color: var(--spot-muted); font-size: 10px; white-space: nowrap; }
.spot-change { align-self: end; padding: 4px 6px; border-radius: 7px; background: var(--spot-shade); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }
.spot-view [data-trend="up"] { color: var(--spot-up); }
.spot-view [data-trend="down"] { color: var(--spot-down); }
.spot-change[data-trend="down"] { background: #f8e9e4; }
.spot-chart-toolbar > span { color: var(--spot-muted); font-size: 11px; font-weight: 700; }
.spot-ranges { padding: 2px; gap: 2px; }
.spot-ranges button { min-height: 32px; padding: 2px 9px; }

.spot-chart { position: relative; display: flex; min-height: 122px; gap: 4px; align-items: stretch; }
.spot-plot { color: var(--spot-primary); min-width: 0; flex: 1; }
.spot-plot svg { width: 100%; height: 107px; }
.spot-chart-grid { stroke: #dbe4d6; stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
.spot-chart-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spot-chart-area { fill: currentColor; opacity: .10; }
.spot-chart-dot { fill: currentColor; }
.spot-plot-axis, .spot-plot-scale { display: flex; justify-content: space-between; color: var(--spot-muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.spot-plot-scale { flex-direction: column; align-items: end; padding: 7px 0 18px; }
.spot-chart-empty { width: 100%; align-content: center; text-align: center; font-size: 11px; color: var(--spot-muted); background: var(--spot-shade); border-radius: 8px; }
.spot-quote-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--spot-muted); font-size: 11px; }
.spot-quote-status:has(span:empty):not(:has(button:not([hidden]))) { display: none; }
.spot-quote-status button { min-height: 34px; padding: 0 7px; border-radius: 7px; background: var(--spot-shade); font-weight: 750; }

.spot-order form { display: grid; gap: 7px; }
.spot-budget { margin: 0; font-size: 11px; line-height: 1.5; color: var(--spot-muted); }
.spot-side button { flex: 1; min-height: 35px; }
.spot-order-size { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px; }
.spot-order-size label { font-size: 11px; font-weight: 700; }
.spot-order-size > button { min-height: 38px; border-radius: 7px; padding: 4px 7px; font-size: 10px; font-weight: 750; color: var(--spot-primary); background: var(--spot-shade); }
.spot-input-wrap {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 5px;
  min-height: 40px;
  padding: 0 8px;
  border: 1px solid var(--spot-line);
  border-radius: 8px;
  background: #fffefb;
  font-size: 11px;
  color: var(--spot-muted);
}

.spot-input-wrap input { flex: 1; min-width: 0; padding: 5px 0; border: 0; background: transparent; color: var(--spot-ink); font-size: 16px; font-weight: 790; }
.spot-total { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; font-size: 11px; color: var(--spot-muted); }
.spot-total strong { color: var(--spot-ink); font-size: 13px; font-variant-numeric: tabular-nums; }
.spot-primary { min-height: 44px; padding: 5px 8px; border-radius: 8px; background: var(--spot-primary); color: #fffefa; font-size: 12px; font-weight: 800; }
.spot-order-guest button { width: 100%; }
.spot-confirm { display: grid; gap: 7px; padding: 8px; border: 1px solid #e6dbbe; border-radius: 8px; background: #fbf0da; font-size: 11px; }
.spot-confirm > span { line-height: 1.45; }
.spot-confirm > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.spot-confirm > div > button { min-height: 44px; font-size: 11px; padding-inline: 2px; }
.spot-feedback:empty { position: absolute; }
.spot-view .spot-feedback, #modal-content .spot-view .spot-feedback { color: var(--spot-primary); font-size: 11px; line-height: 1.45; font-weight: 700; }

.spot-account-tabs > button { min-height: 33px; }
.spot-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.spot-summary > div { display: grid; gap: 3px; min-width: 0; padding: 7px 5px; border-radius: 7px; background: var(--spot-shade); text-align: center; font-variant-numeric: tabular-nums; }
.spot-summary span { font-size: 10px; color: var(--spot-muted); }
.spot-summary strong { font-size: 12px; overflow-wrap: anywhere; }
.spot-account-rows { display: grid; gap: 4px; max-height: 310px; overflow: auto; }
.spot-account-row { display: flex; justify-content: space-between; gap: 5px; padding: 7px 5px; border-bottom: 1px solid var(--spot-line); font-size: 12px; font-variant-numeric: tabular-nums; }
.spot-account-row > div { display: grid; gap: 3px; }
.spot-account-row > div:last-child { text-align: right; }
.spot-account-row span { color: var(--spot-muted); font-size: 10px; }
.spot-view button:focus-visible, .spot-view input:focus-visible { outline-offset: 1px; }

@media (hover: hover) {
  .spot-assets button:hover { border-color: #64876a; }
  .spot-primary:enabled:hover { background: #417155; }
}

@media (max-width: 570px) {
  .spot-view { gap: 8px; }
  .spot-layout { grid-template-columns: 1fr; gap: 7px; }
  .spot-card { padding: 8px; gap: 6px; }
  .spot-assets { gap: 3px; }
  .spot-assets button { min-height: 60px; border-radius: 7px; }
  .spot-assets canvas { width: 34px; height: 28px; }
  .spot-assets strong { font-size: 10px; }
  .spot-chart { min-height: 92px; }
  .spot-plot svg { height: 77px; }
  .spot-order form { grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: end; }
  .spot-side { grid-column: 1 / -1; }
  .spot-order-size { grid-row: span 2; }
  .spot-confirm { grid-column: 1 / -1; }
  .spot-total { min-height: 24px; }
}

.spot-preview {
  max-width: 30rem;
  display: grid;
  justify-items: start;
  gap: 0.75rem;
}

.spot-preview p {
  margin: 0;
}

.spot-preview-level {
  font-weight: 700;
}

.spot-preview .spot-primary {
  margin-top: 0.5rem;
  padding: 0.65rem 1.1rem;
}
