/* Price alerts (release 35, js/price-alerts.js): the bell in the top bar and
   its count, the Alerts panel (the page's .tm-overlay / .tm-panel, so a
   dialog on the computer and the whole screen on the phone - css/mobile.css),
   the pop-up when an alert fires (the page's .toast) and, on the chart, the
   "Alert me at R1" chip beside a pivot line and the "Alert me at today's
   pivots" switch. Theme tokens throughout: dark, light and high contrast. */

/* ---------- the bell ---------- */
.topbar-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    flex-shrink: 0;
}
.topbar-bell:hover { background: var(--hover-surface); color: var(--text-bright); }
.topbar-bell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topbar-bell .pa-bell-badge {
    position: absolute;
    top: -2px;
    inset-inline-end: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    margin: 0;
    font-size: 9px;
    pointer-events: none;
}

/* ---------- the panel ---------- */
.pa-panel { width: 480px; }
.pa-body { display: flex; flex-direction: column; gap: 18px; }
.pa-sec { display: flex; flex-direction: column; gap: 8px; }
.pa-h {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}
.pa-hint, .pa-ccy { margin: 0; font-size: 11px; line-height: 1.45; color: var(--text-muted); }
.pa-empty { list-style: none; margin: 0; font-size: 12px; color: var(--text-muted); }
.pa-sym { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.pa-sym-name { font-size: 14px; font-weight: 600; color: var(--text-bright); }
.pa-now { font-size: 12px; color: var(--text-secondary); font-family: 'JetBrains Mono', monospace; }
.pa-new .tm-field { margin-bottom: 0; }
.pa-new .tm-error { margin: 0; }
.pa-done { font-size: 12px; line-height: 1.45; color: var(--green); }
.pa-done[hidden], .pa-error[hidden], .pa-list-error[hidden], .pa-ccy[hidden] { display: none; }

/* Above / Below: two halves of one control. */
.pa-dir { display: flex; border: 1px solid var(--border-secondary); border-radius: 6px; overflow: hidden; }
.pa-dir-btn {
    flex: 1;
    padding: 8px 10px;
    border: 0;
    background: var(--bg-input);
    color: var(--text-secondary);
    font: 500 12px Inter, sans-serif;
    cursor: pointer;
}
.pa-dir-btn + .pa-dir-btn { border-inline-start: 1px solid var(--border-secondary); }
.pa-dir-btn[aria-checked="true"] { background: var(--accent-fill); color: #ffffff; }
.pa-dir-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* A row with a switch (the pivot levels of a symbol, the sound). The look
   of the account menu's high-contrast switch (.ud-switch, style.css). */
.pa-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font: 500 12px Inter, sans-serif;
    text-align: start;
    cursor: pointer;
}
.pa-switch:hover { background: var(--hover-surface); }
.pa-switch:disabled { opacity: 0.6; cursor: default; }
.pa-switch .pa-switch-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pa-watch-list { display: flex; flex-direction: column; gap: 6px; }
.pa-foot { border-top: 1px solid var(--border-primary); padding-top: 12px; }

.pa-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pa-item {
    position: relative;
    padding: 8px 10px;
    padding-inline-end: 40px;
    border: 1px solid var(--border-primary);
    border-radius: 6px;
    background: var(--bg-tertiary);
}
.pa-item-main { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; font-size: 13px; }
.pa-item-sym { font-weight: 600; color: var(--text-bright); }
.pa-item-cond { color: var(--text-primary); }
.pa-item-cond bdi { font-family: 'JetBrains Mono', monospace; }
.pa-item-sub { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 2px; font-size: 11px; color: var(--text-muted); }
.pa-del {
    position: absolute;
    top: 50%;
    inset-inline-end: 6px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 4px;
    background: none;
    color: var(--text-secondary);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.pa-del:hover { color: var(--red); background: var(--hover-surface-strong, var(--hover-surface)); }
.pa-del:disabled { opacity: 0.5; cursor: default; }

/* The history: newest first; a notice not seen before the panel opened is marked. */
.pa-notice {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 8px;
    align-items: baseline;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: var(--text-primary);
}
.pa-notice-text { grid-column: 2; line-height: 1.45; }
.pa-notice-time { grid-column: 2; font-size: 10px; color: var(--text-muted); }
.pa-notice.pa-unseen { background: var(--accent-glow); }
.pa-notice.pa-unseen .pa-notice-text { font-weight: 600; }
.pa-dot { grid-column: 1; grid-row: 1; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.pa-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- the pop-up ---------- */
/* The page's toast with the accent's edge, and a click opens the panel. */
.toast.pa-toast { border-left-color: var(--accent); cursor: pointer; max-width: 340px; line-height: 1.45; }
html[dir="rtl"]:not([data-contrast="high"]) .toast.pa-toast { border-right-color: var(--accent); }

/* ---------- on the chart ---------- */
/* Above the drawings (#drawing-canvas-wrapper: 10, 12 while placing) and the
   indicator legends (11). */
.pa-chip { position: absolute; z-index: 13; }
.pa-chip[hidden], .pa-watch-chip[hidden] { display: none; }
.pa-chip-btn {
    padding: 5px 10px;
    border: 1px solid var(--accent);
    border-radius: 14px;
    background: var(--bg-secondary);
    color: var(--text-bright);
    font: 600 11px Inter, sans-serif;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.pa-chip-btn:hover { background: var(--accent-fill); color: #ffffff; }
.pa-watch-chip {
    position: absolute;
    top: 6px;
    right: 70px;
    z-index: 13;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border: 1px solid var(--border-primary);
    border-radius: 14px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font: 500 11px Inter, sans-serif;
    white-space: nowrap;
    cursor: pointer;
    opacity: 0.92;
}
.pa-watch-chip:hover { color: var(--text-bright); opacity: 1; }
.pa-watch-chip .ud-switch { margin-inline-start: 0; }
.pa-watch-chip:disabled { opacity: 0.6; cursor: default; }

/* ---------- the phone ---------- */
@media (max-width: 767px), (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
    .topbar-bell { width: 40px; height: 40px; }
    .topbar-bell .pa-bell-badge { top: 2px; inset-inline-end: 0; }
    /* css/mobile-2.css lets a toast take no tap, so it never swallows a tap
       meant for what is under it. The alert's pop-up is the way into the
       panel: it takes its tap. */
    #toast-container .toast.pa-toast { pointer-events: auto !important; }
    .pa-switch, .pa-dir-btn { min-height: 44px; }
    .pa-del { width: 44px; height: 44px; }
    .pa-item { padding-inline-end: 52px; }
    .pa-chip-btn { padding: 9px 14px; font-size: 12px; }
    .pa-watch-chip { min-height: 32px; }
}
