/* ---- lot AL1: the price alerts (alerts.js, alert-marks.js, alert-tab.js) ----
   No blue here (the order's key keeps the one blue of the screen), no green nor violet: an alert is a quiet warm mark
   (gold), the side said in words. On the chart: a mark on the price SCALE only, never a line across the candles.
   Hover only where a pointer hovers. */
:root { --al-mark: var(--ind-6); }

/* the marks: inside the right axis, at the alert's level (under the lines' price plates, above the axis' labels) */
.al-marks { position: absolute; top: 0; right: 0; bottom: 0; width: var(--axis, 64px); z-index: 1; pointer-events: none; overflow: hidden; }
.al-mark { position: absolute; right: 0; top: 0; display: flex; align-items: center; gap: 1px; width: 100%; height: 16px; padding: 0 2px;
  transform: translateY(calc(var(--y, 0px) - 50%)); border: 0; border-radius: 2px; background: var(--chart-bg, #000);
  box-shadow: inset 0 0 0 1px var(--al-mark); color: var(--al-mark); font: inherit; font-size: 9.5px; letter-spacing: -0.02em; line-height: 16px;
  pointer-events: auto; cursor: pointer; }
.al-mark .i { flex: none; width: 9px; height: 9px; }
.al-mark span { min-width: 0; overflow: hidden; text-overflow: clip; white-space: nowrap; }
.al-mark[hidden] { display: none; }
.al-mark:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.chartwrap[data-cover] .al-marks, .chartwrap[data-replay="run"] .al-marks { visibility: hidden; }

/* the panel's tab on a computer; a phone's tab row holds five tabs on one line down to 360 px in every language
   (measured: no room for a sixth), so there the list opens from the scale's menu (« Mes alertes ») and from a toast */
.term[data-form="phone"] #bt-alerts { display: none; }

/* the scale's menu: the alert at the price under the pointer, and my alerts */
.al-menu { position: absolute; z-index: 70; min-width: 150px; padding: 4px; border-radius: var(--r-sm); background: var(--surface-3); box-shadow: var(--shadow-pop); }
.al-mi { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 30px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: none;
  color: var(--text); font: inherit; font-size: 12.5px; text-align: start; white-space: nowrap; cursor: pointer; }
.al-mi .i { color: var(--al-mark); }
.al-mi:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.term[data-form="phone"] .al-mi { min-height: 44px; }

/* the toast of a firing: its words and one key (pressable where the toasts' box lets no pointer through) */
.al-toast { pointer-events: auto; align-items: center; }
.al-toast > .i { color: var(--al-mark); }
.al-toast .al-tk { flex: none; min-height: 22px; padding: 0 8px; font-size: 11.5px; }
.term[data-form="phone"] .al-toast .al-tk { min-height: 36px; }

/* the tab */
.al { display: flex; flex-direction: column; min-height: 100%; font-size: var(--fs-s); }
.al-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 6px 14px; border-bottom: 1px solid var(--hair); }
.al-form :is(select, input) { height: 26px; min-width: 0; padding: 0 8px; border: 0; border-radius: var(--r-sm); background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--hair-2); color: var(--text); font: inherit; font-size: 12px; }
.al-sym { width: 104px; }
.al-level { width: 112px; text-align: end; }
.al-note { flex: 1 1 140px; max-width: 280px; }
.al-rep .seg-b { min-height: 24px; padding: 0 8px; font-size: 11.5px; }
.al-form :is(select, input):focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.al-go[aria-busy="true"] { opacity: 0.6; }
.al-hint { flex: 1 0 100%; min-height: 15px; margin: 0; color: var(--dim); font-size: var(--fs-xs); line-height: 15px; }
.al-hint[data-tone="warn"] { color: var(--warn); }
.al-head { display: flex; align-items: center; gap: 10px; padding: 6px 14px 4px; }
.al-head h3, .al-fh { margin: 0; color: var(--dim); font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em; }
.al-fh { padding: 8px 14px 4px; border-top: 1px solid var(--hair); }
.al-count { color: var(--dim); font-size: var(--fs-xs); }
.al-mk { margin-inline-start: auto; min-height: 22px; font-size: 11.5px; }
.al-mk[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--al-mark); color: var(--text); }
.al-list { margin: 0; padding: 0; list-style: none; }
.al-row { display: grid; grid-template-columns: minmax(70px, auto) minmax(70px, auto) auto auto minmax(0, 1fr) auto auto; column-gap: 10px; align-items: center;
  min-height: 30px; padding: 2px 14px; border-top: 1px solid var(--hair); color: var(--mute); }
.al-fr { grid-template-columns: auto minmax(60px, auto) minmax(70px, auto) auto minmax(0, 1fr); }
.al-s { display: inline-flex; align-items: center; gap: 6px; color: var(--text); white-space: nowrap; }
.al-s b { font-weight: 600; }
.al-l { color: var(--text); white-space: nowrap; }
.al-d { white-space: nowrap; }
.al-d::before { content: ""; display: inline-block; width: 0; height: 0; margin-inline-end: 5px; vertical-align: 1px; border: 4px solid transparent; }
.al-d[data-dir="up"]::before { border-bottom-color: var(--al-mark); border-top-width: 0; }
.al-d[data-dir="down"]::before { border-top-color: var(--al-mark); border-bottom-width: 0; }
.al-r, .al-px, .al-t { color: var(--dim); white-space: nowrap; }
.al-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mute); }
.al-st { display: inline-flex; align-items: center; gap: 8px; color: var(--dim); font-size: var(--fs-xs); white-space: nowrap; }
.al-st[data-state="active"] { color: var(--al-mark); }
.al-rearm { min-height: 22px; font-size: 11.5px; }
.al-x { width: 24px; height: 24px; }
.al-fr[data-seen="false"] .al-t { color: var(--text); }
.al-none { margin: 12px auto; }
.al-why { margin: auto 0 0; padding: 8px 14px 10px; border-top: 1px solid var(--hair); color: var(--dim); font-size: var(--fs-xs); line-height: 1.5; }
@media (hover: hover) {
  .al-mark:hover { background: var(--surface-3); color: var(--text); }
  .al-mi:hover { background: var(--surface-4); }
}

/* in Arabic the tab reads right to left (lot R1's way); prices, times and markets stay left to right */
:root[lang="ar"] .al, :root[lang="ar"] .al-menu, :root[lang="ar"] .al-toast { direction: rtl; }
:root[lang="ar"] .al :is(.num, .al-s, .al-t), :root[lang="ar"] .al-mi .num { direction: ltr; unicode-bidi: isolate; }
:root[lang="ar"] .al-level { text-align: start; }

/* a phone: the panel under Positions; the form in two rows, keys a thumb can press */
.term[data-form="phone"] .al-form { padding: 6px 10px; }
.term[data-form="phone"] .al-form :is(select, input) { height: 44px; font-size: 16px; }
.term[data-form="phone"] .al-sym { flex: 1 1 30%; width: auto; }
.term[data-form="phone"] .al-level { flex: 1 1 40%; width: auto; }
.term[data-form="phone"] .al-note { flex: 1 1 100%; max-width: none; }
.term[data-form="phone"] :is(.al-rep .seg-b, .al-go, .al-rearm, .al-mk) { min-height: 44px; }
.term[data-form="phone"] .al-x { width: 44px; height: 44px; }
.term[data-form="phone"] .al-head, .term[data-form="phone"] .al-why, .term[data-form="phone"] .al-fh { padding-inline: 10px; }
.term[data-form="phone"] .al-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; padding: 6px 10px; }
.term[data-form="phone"] .al-row .al-x { margin-inline-start: auto; }
.term[data-form="phone"] .al-row .al-n { flex: 1 1 100%; order: 9; }
.term[data-form="phone"] .al-row .al-n:empty { display: none; }
