:root {
  color-scheme: dark;
  --bg: #131722;
  --panel: #1a1e2a;
  --panel-2: #20253280;
  --border: #2a2e39;
  --text: #d9dce4;
  --muted: #8b90a0;
  --accent: #4c8dff;
  --accent-text: #0b1020;
  --up: #26a69a;
  --down: #ef5350;
  --wl-bull: #3987e5;
  --wl-bear: #d95926;
  --gym-you: #3987e5;
  --gym-rule: #d55181;
  --gym-strategy: #c98500;
  --gym-mine: #008300;
  --ok: #2bb673;
  --warn: #e0a030;
  --bad: #ef5350;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f4f5f8;
    --panel: #ffffff;
    --panel-2: #f0f2f680;
    --border: #dfe2ea;
    --text: #161a25;
    --muted: #646a7a;
    --accent: #1f5fe0;
    --accent-text: #ffffff;
    --up: #089981;
    --down: #e0393e;
    --wl-bull: #2a78d6;
    --wl-bear: #eb6834;
    --gym-you: #2a78d6;
    --gym-rule: #e87ba4;
    --gym-strategy: #eda100;
    --gym-mine: #008300;
    --ok: #12905a;
    --warn: #a8700c;
    --bad: #d0282d;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f8;
  --panel: #ffffff;
  --panel-2: #f0f2f680;
  --border: #dfe2ea;
  --text: #161a25;
  --muted: #646a7a;
  --accent: #1f5fe0;
  --accent-text: #ffffff;
  --up: #089981;
  --down: #e0393e;
  --wl-bull: #2a78d6;
  --wl-bear: #eb6834;
  --gym-you: #2a78d6;
  --gym-rule: #e87ba4;
  --gym-strategy: #eda100;
  --gym-mine: #008300;
  --ok: #12905a;
  --warn: #a8700c;
  --bad: #d0282d;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Niente zoom della pagina: due dita sul grafico allargano il grafico, non tutto il sito. */
  touch-action: pan-x pan-y;
  /* Niente "tira per ricaricare" né rimbalzo mentre si trascina sul grafico. */
  overscroll-behavior: none;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 var(--font);
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.mono {
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------------ pulsanti e campi */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  padding: 7px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--muted);
}

.btn:focus-visible,
input:focus-visible,
select:focus-visible,
.tab:focus-visible,
.chart-head:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.btn.ghost {
  background: transparent;
}

.btn[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

input,
select {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.pill {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
}

.pill.ok {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
}

.pill.warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 45%, transparent);
}

/* ------------------------------------------------------------------ accesso */
.login {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 16px;
}

.login-card {
  width: min(360px, 100%);
  display: grid;
  gap: 10px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.login-card h1 {
  font-size: 22px;
}

.login-card input {
  padding: 10px;
}

.login-card .btn {
  padding: 10px;
  margin-top: 6px;
}

.error {
  margin: 0;
  color: var(--bad);
}

.login {
  gap: 16px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Elenchi delle impostazioni: passkey ed email consentite */
.rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.rows li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rows li.muted {
  border-style: dashed;
}

.rows .grow {
  flex: 1 1 220px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.rows .btn {
  padding: 4px 9px;
  font-size: 13px;
}

.fold summary {
  cursor: pointer;
  color: var(--accent);
}

.fold[open] summary {
  margin-bottom: 8px;
}

.sheet-body input[type="email"],
.sheet-body input[type="password"],
.note input[type="text"] {
  flex: 1 1 200px;
  min-width: 0;
}

.note p {
  margin: 0 0 8px;
}

/* ------------------------------------------------------------------ struttura */
.app {
  height: 100%;
  /* L'altezza davvero visibile, che sul telefono cambia quando compaiono le barre del browser. */
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* L'interfaccia non si seleziona come testo: un tocco lungo sul grafico mostra il mirino, non un menu. */
.topbar,
.tabs,
.newsbar,
.chart,
.btn,
.copy,
.alerts-head {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  white-space: nowrap;
}

.brand svg {
  width: 20px;
  height: 20px;
  fill: var(--wl-bull);
  stroke: var(--wl-bull);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.status {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-right: auto;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
}

#feedText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

#countdown {
  flex: none;
}

.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.dot.ok {
  background: var(--ok);
}

.dot.warn {
  background: var(--warn);
}

.dot.bad {
  background: var(--bad);
}

.actions {
  display: flex;
  gap: 6px;
}

.tabs {
  display: none;
  gap: 4px;
  padding: 6px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.app.focus .tabs {
  display: flex;
}

.tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.tab[aria-current="true"] {
  color: var(--text);
  border-color: var(--border);
  background: var(--bg);
}

.tab .mark {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 5px;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: middle;
}

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
}

.charts {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  gap: 1px;
  background: var(--border);
  overflow: hidden;
}

.chart {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.app.focus .charts {
  grid-template-columns: minmax(0, 1fr);
}

.app.focus .chart:not(.current) {
  display: none;
}

.chart-head {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
  padding: 6px 10px 2px;
  cursor: pointer;
}

.chart-head .sym {
  font-weight: 700;
  font-size: 14px;
}

.chart-head .price {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.chart-head .chg {
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}

.chart-head .chg.up {
  color: var(--up);
}

.chart-head .chg.down {
  color: var(--down);
}

.chart-head .stats {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin: 0 3px 0 8px;
}

.swatch.bull {
  background: var(--wl-bull);
}

.swatch.bear {
  background: var(--wl-bear);
}

.chart-legend {
  min-height: 18px;
  padding: 0 10px;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-legend b {
  color: var(--text);
  font-weight: 500;
}

.chart-legend .tag {
  margin-left: 8px;
  font-weight: 600;
}

.chart-legend .tag.bull {
  color: var(--wl-bull);
}

.chart-legend .tag.bear {
  color: var(--wl-bear);
}

.chart-body {
  flex: 1;
  min-height: 0;
  position: relative;
}

.chart-body .placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  text-align: center;
  color: var(--muted);
}

/* ------------------------------------------------------------------ calcolo dell'ordine */
.main-col {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.main-col .charts {
  flex: 1;
}

.ticket {
  flex: none;
  max-height: 55%;
  overflow-y: auto;
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.app:not(.focus) .ticket {
  display: none;
}

.ticket-start,
.ticket-guide {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.ticket-start .muted {
  flex: 1 1 220px;
  font-size: 13px;
}

/* La Palestra: un foglio grande, con il grafico che prende tutto lo spazio libero. */
.gym-open svg {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  vertical-align: -3px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

/* Due classi: deve valere più di .sheet, che viene dopo nel foglio. */
.sheet.gym-sheet {
  width: min(1100px, 100vw);
  height: min(92vh, 100dvh);
}

.gym-progress {
  margin-right: auto;
  font-size: 13px;
}

.gym-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  padding: 8px 16px 12px;
  overflow-y: auto;
}

/* La pagina iniziale e il report stanno in una colonna al centro del foglio. */
.gym-intro {
  display: grid;
  /* Una colonna larga quanto il foglio: un menu lungo non la allarga oltre lo schermo. */
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
}

.gym-intro p,
.gym-info,
.gym-bar p {
  margin: 0;
}

/* In alto, i dati dell'alert e la scelta del timeframe; sul telefono vanno a capo. */
.gym-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
}

.gym-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gym-report {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.gym-report-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gym-report-head h3 {
  margin: 0;
  font-size: 15px;
}

.gym-report-segs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gym-chart {
  position: relative;
  flex: 1;
  min-height: 220px;
}

/* Mentre si indicano i prezzi il dito mira il prezzo: niente scorrimento né zoom della pagina. */
.gym-chart.placing {
  touch-action: none;
}

.gym-chart.placing * {
  cursor: crosshair !important;
}

.gym-bar {
  display: grid;
  gap: 6px;
}

.gym-msg {
  margin: 0;
  padding: 6px 10px;
  border-radius: var(--radius);
  background: var(--warn);
  color: #000;
  font-weight: 600;
}

/* Le correzioni della strategia e le sue voci, nel seguito di un esercizio. */
.gym-corrections {
  margin: 0;
  padding-left: 18px;
}

.gym-checks summary {
  cursor: pointer;
  color: var(--muted);
}

.gym-checks p {
  margin: 2px 0 0;
  font-size: 13px;
}

.gym-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.gym-quick input {
  width: 4.5em;
}

.gym-stop {
  display: inline-grid;
  align-items: center;
  vertical-align: middle;
}

.gym-pips {
  min-width: 5.5em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.gym-actions {
  flex-wrap: wrap;
}

.gym-order .buy {
  color: var(--up);
}

.gym-order .sell {
  color: var(--down);
}

@media (max-width: 820px), (max-height: 520px) {
  .sheet.gym-sheet {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }

  .gym-body {
    padding: 6px 10px max(8px, env(safe-area-inset-bottom));
  }

  .gym-chart {
    min-height: 160px;
  }
}

@media (max-width: 480px) {
  .gym-open span {
    display: none;
  }

  .gym-open svg {
    margin-right: 0;
  }
}

/* Il perché di una scelta contro il video: i motivi, i livelli segnati, la nota. */
.gym-question {
  margin: 0 0 6px;
}

.gym-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.chip {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.gym-marks {
  align-items: center;
  margin-bottom: 8px;
}

.mark-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 2px 1px 8px;
  border: 1px dashed var(--gym-mine);
  border-radius: 6px;
  font-variant-numeric: tabular-nums;
}

#gymBar textarea {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  font: inherit;
}

.gym-why {
  padding-left: 8px;
  border-left: 3px dashed var(--gym-mine);
}

p.gym-mine {
  padding-left: 8px;
  border-left: 3px dashed var(--gym-mine);
}

/* Le tue regole, nella Palestra. */
.rules-head {
  align-items: center;
}

.rules-head h3 {
  flex: 1;
  margin: 0;
}

.rule-card,
.rule-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.rule-card.on {
  border-color: var(--gym-mine);
}

.rule-card p,
.rule-form p,
.rule-form h4 {
  margin: 0;
}

.rule-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 8px;
}

.rule-status {
  color: var(--muted);
  font-size: 12px;
}

.rule-status.trial {
  color: var(--text);
}

.rule-numbers {
  font-size: 13px;
}

.rule-actions {
  align-items: center;
}

.rule-num {
  width: 72px;
}

.rule-card,
.rule-form {
  min-width: 0;
}

.rule-form select,
.rule-form input[type="text"]:not(.rule-num) {
  max-width: 100%;
  min-width: 0;
}

/* Le voci della strategia, nelle impostazioni: due colonne dove c'è posto. */
.strategy-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 12px;
}

/* La regola contro te, nel registro. */
.journal-ledger {
  margin: 10px 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.journal-ledger p {
  margin: 4px 0;
}

.ledger-parts {
  margin: 4px 0;
  padding-left: 18px;
}

/* Il motivo per superare un limite di rischio, nella conferma dell'ordine. */
.order-override {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.order-override textarea {
  width: 100%;
  resize: vertical;
}

input.short {
  width: 5.5em;
}

/* Il testo ha una riga tutta sua e due righe sempre riservate: cambia a ogni passo, ma la guida resta
   alta uguale e il grafico sotto il dito non si sposta. */
.ticket-guide .guide-text {
  flex: 1 1 calc(100% - 34px);
  font-weight: 600;
  min-height: 2lh;
}

@media (max-width: 360px) {
  .ticket-guide .guide-text {
    min-height: 3lh;
  }
}

.step {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Mentre si indicano i prezzi il cursore è un mirino: ogni tocco fissa un prezzo. */
.chart-body.placing * {
  cursor: crosshair !important;
}

.btn.buy {
  border-color: var(--up);
  color: var(--up);
  font-weight: 600;
}

.btn.sell {
  border-color: var(--down);
  color: var(--down);
  font-weight: 600;
}

.ticket-form {
  display: grid;
  gap: 8px;
}

.ticket-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ticket-head {
  flex-wrap: wrap;
}

.ticket-head strong {
  margin-right: auto;
}

.ticket-head strong.buy {
  color: var(--up);
}

.ticket-head strong.sell {
  color: var(--down);
}

.ticket-quick,
.ticket-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ticket-quick .field,
.ticket-fields label {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}

.ticket-quick input,
.ticket-fields input {
  width: 100%;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

/* Lo stop si ritocca un pip alla volta, senza dover prendere la mira sul grafico. */
.stepper {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 4px;
}

.stepper input {
  text-align: center;
}

.btn.nudge {
  min-width: 36px;
  padding: 0 8px;
  font-size: 18px;
  line-height: 1;
}

.ticket-form .fold summary {
  font-size: 13px;
}

.ticket-out {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
}

.copy {
  appearance: none;
  display: grid;
  gap: 1px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: left;
  cursor: pointer;
}

.copy:hover {
  border-color: var(--muted);
}

.copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.copy small {
  font-size: 11px;
  color: var(--muted);
}

.copy b {
  font-size: 16px;
  font-weight: 600;
}

.copy.lots b {
  font-size: 20px;
}

.ticket-sum {
  flex-basis: 100%;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ticket-msgs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.ticket-msgs:empty {
  display: none;
}

.ticket-msgs li {
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 13px;
  background: color-mix(in srgb, var(--bad) 16%, transparent);
}

.ticket-msgs li.warning {
  background: color-mix(in srgb, var(--warn) 18%, transparent);
}

/* Mentre si prepara un ordine il dito sul grafico sposta le linee (o mira un prezzo), non la pagina. */
.chart-body.drafting,
.chart-body.drafting *,
.chart-body.placing,
.chart-body.placing * {
  touch-action: none !important;
}

.chart-body.over-line * {
  cursor: ns-resize !important;
}

/* ------------------------------------------------------------------ notizie ad alto impatto */
.newsbar {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bad) 10%, var(--panel));
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  overflow-x: auto;
  cursor: pointer;
  scrollbar-width: none;
}

.newsbar::-webkit-scrollbar {
  display: none;
}

.newsbar-title {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}

.news-chip {
  flex: none;
  color: var(--muted);
}

.news-chip.hit {
  color: var(--text);
}

.news-chip b {
  font-variant-numeric: tabular-nums;
}

.news-chip.hit b {
  color: var(--bad);
}

.news-chip.out {
  opacity: 0.7;
}

.news-chip + .news-chip {
  padding-left: 8px;
  border-left: 1px solid var(--border);
}

.head-news {
  padding: 0 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bad) 20%, transparent);
  color: var(--bad);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.head-news.out {
  opacity: 0.7;
}

.chart-legend .tag.news {
  color: var(--bad);
}

.news {
  flex: none;
  max-height: 42%;
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
}

.news-list {
  list-style: none;
  margin: 0;
  padding: 0 0 4px;
  overflow-y: auto;
}

.news-day {
  padding: 6px 12px 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.news-item {
  display: grid;
  grid-template-columns: 44px 36px 1fr;
  align-items: baseline;
  gap: 0 6px;
  padding: 3px 12px;
  font-size: 13px;
}

.news-item .time {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.news-item .cur {
  font-weight: 700;
  color: var(--bad);
}

.news-item.holiday .cur {
  color: var(--muted);
}

.news-item .detail {
  grid-column: 3;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.news-item.past {
  opacity: 0.55;
}

.pill.bad {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 45%, transparent);
}

button.pill {
  appearance: none;
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

button.pill:hover {
  border-color: var(--muted);
}

/* ------------------------------------------------------------------ registro alert */
.alerts {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  background: var(--panel);
}

.alerts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.alerts-head h2 {
  font-size: 14px;
}

.alert-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
}

.alert {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 2px 8px;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.alert:hover {
  background: var(--panel-2);
}

.alert.fresh {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.alert .arrow.bull {
  color: var(--wl-bull);
}

.alert .arrow.bear {
  color: var(--wl-bear);
}

.alert .sym {
  font-weight: 700;
}

.alert .time {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.alert .detail {
  grid-column: 2 / 4;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.alert .state {
  font-weight: 600;
}

.alert .state.sent {
  color: var(--ok);
}

.alert .state.revoked {
  color: var(--warn);
}

.alert .outcome.win {
  color: var(--ok);
}

.alert .outcome.loss {
  color: var(--bad);
}

/* ------------------------------------------------------------------ registro degli esiti */
.seg {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.seg button {
  padding: 3px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.seg button + button {
  border-left: 1px solid var(--border);
}

.seg button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--text);
  font-weight: 600;
}

.journal-body {
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.journal-body p {
  margin: 0 0 4px;
}

.journal-body .win {
  color: var(--ok);
}

.journal-body .loss {
  color: var(--bad);
}

.journal-body .rules {
  margin-top: 6px;
  font-size: 11px;
}

.journal-details summary {
  cursor: pointer;
  color: var(--accent);
  margin: 4px 0;
}

.journal-table {
  width: 100%;
  margin: 4px 0 8px;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.journal-table th,
.journal-table td {
  padding: 3px 4px;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.journal-table th:first-child,
.journal-table td:first-child {
  text-align: left;
}

.journal-table th {
  color: var(--muted);
  font-weight: 600;
}

.empty {
  padding: 16px 12px;
  margin: 0;
}

/* ------------------------------------------------------------------ impostazioni */
.sheet {
  width: min(560px, 100vw);
  max-height: min(92vh, 100dvh);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
}

.sheet[open] {
  display: flex;
  flex-direction: column;
}

.sheet::backdrop {
  background: #0009;
}

.sheet-head,
.sheet-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}

.sheet-head {
  border-bottom: 1px solid var(--border);
}

.sheet-head h2 {
  font-size: 16px;
}

.sheet-foot {
  border-top: 1px solid var(--border);
}

.sheet-foot p {
  margin: 0;
}

.sheet-body {
  overflow-y: auto;
  padding: 4px 16px 12px;
}

.sheet-body section {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.sheet-body section:last-child {
  border-bottom: 0;
}

.sheet-body h3 {
  font-size: 14px;
}

.sheet-body p {
  margin: 0;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inline input[type="number"] {
  width: 72px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.windows {
  display: grid;
  gap: 8px;
}

.window {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.days {
  display: flex;
  gap: 3px;
}

.day {
  appearance: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.day[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.window .hours {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.window .remove {
  margin-left: auto;
}

/* La settimana a colpo d'occhio: una riga per giorno, 24 ore da sinistra a destra. */
.week {
  display: grid;
  gap: 3px;
}

.week-row,
.week-axis {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 8px;
}

.week-axis div {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.week-day {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.week-track {
  position: relative;
  height: 10px;
  border-radius: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  overflow: hidden;
}

.week-track i {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--accent);
}

.check.indent {
  margin-left: 24px;
}

.sheet-body input[type="time"] {
  min-width: 96px;
}

.sheet-body .row input[type="number"] {
  width: 64px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  appearance: none;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.chip[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
}

.note {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  overflow-wrap: anywhere;
}

.note a {
  color: var(--accent);
}

.note code {
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(480px, calc(100vw - 32px));
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 6px 24px #0006;
  z-index: 20;
  /* Il messaggio non deve rubare il tocco ai pulsanti che copre. */
  pointer-events: none;
}

/* ------------------------------------------------------------------ schermi a tocco */
@media (pointer: coarse) {
  /* Sotto i 16 pixel l'iPhone ingrandisce la pagina a ogni tocco su un campo, e non torna indietro da solo. */
  input,
  select,
  textarea {
    font-size: 16px;
  }

  input[type="checkbox"] {
    width: 22px;
    height: 22px;
  }

  /* Pulsanti a misura di dito */
  .btn {
    min-height: 44px;
    padding: 8px 14px;
  }

  .tab {
    min-height: 44px;
    padding: 8px 14px;
    font-size: 15px;
  }

  .chip {
    min-height: 40px;
    padding: 8px 14px;
  }

  .day {
    width: 38px;
    height: 38px;
    font-size: 14px;
  }

  .rows .btn {
    min-height: 40px;
    padding: 6px 12px;
    font-size: 14px;
  }

  .check {
    min-height: 40px;
  }

  .pill,
  button.pill {
    padding: 5px 12px;
    font-size: 13px;
  }

  .chart-head {
    min-height: 40px;
    padding: 8px 12px 2px;
    align-items: center;
  }

  .chart-head .sym,
  .chart-head .price {
    font-size: 16px;
  }

  .chart-legend {
    padding: 0 12px;
    font-size: 13px;
  }

  .newsbar {
    min-height: 40px;
    font-size: 14px;
  }

  .alert {
    padding: 12px 14px;
  }

  .alert .time,
  .alert .detail,
  .news-item .detail {
    font-size: 13px;
  }

  .news-item {
    padding: 6px 14px;
    font-size: 14px;
  }

  .copy {
    min-height: 56px;
    padding: 6px 10px;
  }

  .btn.nudge {
    min-width: 44px;
    font-size: 22px;
  }

  .tabs,
  .newsbar {
    scrollbar-width: none;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }
}

/* ------------------------------------------------------------------ schermi stretti */
.only-narrow {
  display: none;
}

@media (max-width: 1100px) {
  .charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Telefono: schermo stretto, oppure basso quando è girato in orizzontale. */
@media (max-width: 820px), (max-height: 520px) {
  .only-narrow {
    display: inline-block;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .alerts {
    display: none;
    border-left: 0;
  }

  .app.show-alerts .alerts {
    display: flex;
  }

  .app.show-alerts .main-col {
    display: none;
  }

  body {
    font-size: 15px;
  }

  /* Ogni riga tolta sopra è una riga in più di grafico. */
  .topbar {
    padding-top: max(4px, env(safe-area-inset-top));
    padding-bottom: 4px;
  }

  .tabs {
    padding: 4px 8px;
  }

  .newsbar {
    min-height: 36px;
    padding: 4px 12px;
  }

  .chart-head {
    flex-wrap: nowrap;
    overflow: hidden;
    white-space: nowrap;
  }

  /* La quota di candele senza ombra serve nel confronto tra grafici, non sul telefono. */
  .chart-head .stats {
    display: none;
  }

  /* Mentre si prepara un ordine si guarda una coppia sola: schede e notizie lasciano il posto al grafico. */
  .app.ordering .tabs,
  .app.ordering .newsbar {
    display: none;
  }

  .ticket-quick {
    grid-template-columns: 1.6fr 1fr 1fr;
  }

  /* Il riquadro dell'ordine resta compatto: prima i numeri da copiare, sotto i ritocchi. */
  .ticket {
    padding: 8px 10px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .ticket-form {
    gap: 6px;
  }

  .ticket-out {
    display: grid;
    grid-template-columns: 0.8fr repeat(3, 1fr);
    gap: 5px;
  }

  .copy {
    min-width: 0;
    padding: 5px 7px;
  }

  .copy b,
  .copy.lots b {
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .ticket-sum {
    grid-column: 1 / -1;
  }

  .ticket-head .btn {
    padding: 6px 10px;
    min-height: 38px;
  }

  .ticket-start .muted {
    flex-basis: 150px;
  }

  .alert-list {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .news {
    max-height: 50%;
  }

  .charts {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 300px;
    overflow-y: auto;
  }

  .app.focus .charts {
    grid-auto-rows: minmax(0, 1fr);
    overflow: hidden;
  }

  .status .muted,
  .status .sep {
    display: none;
  }

  .topbar {
    gap: 8px;
  }

  .btn {
    padding: 7px 9px;
  }
}

@media (max-width: 480px) {
  .brand span {
    display: none;
  }

  #viewToggle {
    display: none;
  }

  .sheet {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    margin: 0;
  }
}

/* Telefono in orizzontale: lo schermo è basso, quindi comandi e schede stanno su una riga sola
   e, mentre si prepara un ordine, il suo riquadro passa di fianco al grafico. */
@media (orientation: landscape) and (max-height: 520px) {
  .app {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .topbar {
    grid-area: 1 / 1;
    border-bottom: 1px solid var(--border);
  }

  .tabs {
    grid-area: 1 / 2;
    align-items: center;
  }

  .app:not(.focus) .topbar,
  .app.ordering .topbar {
    grid-column: 1 / -1;
  }

  .newsbar {
    grid-area: 2 / 1 / 3 / -1;
  }

  .layout {
    grid-area: 3 / 1 / 4 / -1;
  }

  .brand span,
  #viewToggle,
  .chart-legend {
    display: none;
  }

  .app.ordering .main-col {
    flex-direction: row;
  }

  .app.ordering .ticket {
    width: min(48%, 360px);
    max-height: none;
    border-top: 0;
    border-left: 1px solid var(--border);
  }

  .sheet {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    margin: 0;
  }
}

/* Schermi grandi: ritocchi rapidi e prezzi a mano stanno affiancati, sempre in vista. */
@media (min-width: 821px) and (min-height: 521px) {
  .ticket-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 8px;
  }

  .ticket-head,
  .ticket-out,
  .ticket-msgs {
    grid-column: 1 / -1;
  }

  .ticket-form .fold summary {
    display: none;
  }
}

/* App installata sul telefono: la finestra delle impostazioni arriva fino ai bordi dello schermo,
   quindi lascia libere la tacca in alto e la barra in basso. */
@media (max-width: 480px), (orientation: landscape) and (max-height: 520px) {
  .sheet-head {
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .sheet-foot {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  .sheet-head,
  .sheet-body,
  .sheet-foot {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }

  .login {
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
}

/* ---------------------------------------------------------------- MetaTrader sulla VPS */
.trade-accounts {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
}

.trade-account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.trade-account .who {
  flex: 1 1 180px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.trade-account .btn {
  flex: none;
}

#tradeAdmin h4 {
  margin: 18px 0 4px;
  font-size: 14px;
}

.mode-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.mode-tag.live {
  color: #fff;
  background: var(--bad);
  border-color: var(--bad);
}

.ticket-send .bad,
.trade-status .bad {
  color: var(--bad);
}

.trade-row .up {
  color: var(--up);
}

.trade-row .down {
  color: var(--down);
}

.ticket-send {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 8px 0 4px;
}

.trade-orders {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--muted) 30%, transparent);
}

.trade-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  font-size: 14px;
}

.trade-row .btn {
  margin-left: auto;
}

.trade-row > b {
  margin-left: auto;
}

.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.trade-status {
  display: grid;
  gap: 6px;
  margin: 8px 0;
}

.trade-line {
  display: grid;
  grid-template-columns: 9.5em 1fr;
  gap: 8px;
  align-items: baseline;
}

.trade-auto {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.trade-auto p {
  margin: 0;
}

.steps {
  margin: 8px 0;
  padding-left: 1.3em;
  display: grid;
  gap: 4px;
}

.order-sheet {
  max-width: 440px;
}

.order-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  font-size: 18px;
}

.order-top .buy {
  color: var(--up);
}

.order-top .sell {
  color: var(--down);
}

.order-line {
  display: grid;
  grid-template-columns: 7em auto 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--muted) 22%, transparent);
  font-size: 16px;
}

.order-line b {
  font-variant-numeric: tabular-nums;
}

.order-line span:last-child {
  text-align: right;
  font-size: 14px;
}

@media (max-width: 820px), (max-height: 520px) {
  .trade-line {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .ticket-send .btn {
    flex: 1 1 100%;
  }
}

/* ------------------------------------------------------------------ disegni sui grafici */
/* La barra sta in alto a sinistra del grafico aperto; il resto dell'area resta al grafico. */
.draw-ui {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 8px;
  /* Fino sopra la scala del tempo: l'elenco degli strumenti non deve uscire dal grafico. */
  bottom: 30px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  /* Le righe stanno in alto: il resto del riquadro è solo spazio per l'elenco degli strumenti. */
  align-content: flex-start;
  gap: 6px;
  pointer-events: none;
}

.draw-ui > * {
  pointer-events: auto;
}

.app:not(.focus) .draw-ui {
  display: none;
}

.draw-open {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--text);
  cursor: pointer;
}

.draw-open.on {
  border-color: var(--accent);
  color: var(--accent);
}

.draw-open svg,
.draw-icon svg,
.draw-remove svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.draw-palette {
  position: absolute;
  top: 40px;
  left: 0;
  width: min(340px, calc(100vw - 40px));
  max-height: calc(100% - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 8px 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgb(0 0 0 / 35%);
}

.draw-palette h4 {
  margin: 8px 4px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.draw-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
}

.draw-tool {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.draw-tool:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.draw-tool.on {
  border-color: var(--accent);
  color: var(--accent);
}

.draw-icon {
  flex: none;
  display: grid;
}

.draw-opts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 8px;
  padding: 8px 4px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.draw-opts .draw-clear {
  margin-left: auto;
}

/* La guida mentre si disegna e la barra del disegno selezionato. */
.draw-guide,
.draw-sel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-height: 34px;
  padding: 3px 4px 3px 10px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}

.draw-sel {
  padding-left: 6px;
}

.draw-guide-text {
  font-weight: 600;
}

.draw-colors {
  display: flex;
  gap: 6px;
}

.draw-color {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 2px var(--panel);
  cursor: pointer;
}

.draw-color.on {
  border-color: var(--text);
}

.draw-remove {
  display: grid;
  place-items: center;
  padding: 4px 8px;
}

/* Mentre si disegna il cursore è un mirino: ogni clic fissa un punto. */
.chart-body.drawing * {
  cursor: crosshair !important;
}

@media (pointer: coarse) {
  .draw-open {
    width: 40px;
    height: 40px;
  }

  .draw-palette {
    top: 46px;
    max-height: calc(100% - 46px);
  }

  .draw-tool {
    padding: 10px 8px;
  }

  .draw-color {
    width: 28px;
    height: 28px;
  }

  .draw-guide,
  .draw-sel {
    min-height: 40px;
  }
}
