/* The stock page made in pieces (stock-page.js, docs/stock-page-speed.md): places held for what has not come, the line under the head, saved-data chips. */

/* A place held for a number or a card: the colour of a quiet panel, pulsing slowly (not at all for a person who asked for less motion). */
.sf-bar { display: inline-block; border-radius: 6px; background: var(--panel-2); color: transparent; user-select: none; animation: sf-pulse 1.4s ease-in-out infinite; }
@keyframes sf-pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .sf-bar { animation: none; } }
.sym-head .quote .px.sf-bar { min-width: 3.4em; }
.sym-head .quote .chg.sf-bar { min-width: 5.5em; }
.sf-bar.sf-kv { min-width: 4.6em; height: 1em; vertical-align: middle; }
.sf-bar.sf-v { min-width: 3.4em; height: 0.9em; }

/* A skeleton card: bars, as tall as the finished card will be. The heights are what the finished cards measure on a phone and on a desktop. */
.sf-skel { display: grid; align-content: start; gap: 12px; }
.sf-skel .sf-bar { display: block; height: 12px; }
.sf-skel .sf-title { width: 34%; height: 16px; }
.sf-card { min-height: 150px; }
.sf-line { min-height: 20px; padding: 0; border: 0; background: none; }
.sf-chart { min-height: var(--sf-chart-h, 640px); }
.sf-keys { min-height: var(--sf-keys-h, 467px); }
.sf-rules { min-height: var(--sf-rules-h, 408px); }
@media (min-width: 900px) {
  .sf-chart { min-height: var(--sf-chart-h-wide, 738px); }
  .sf-keys { min-height: var(--sf-keys-h-wide, 248px); }
  .sf-rules { min-height: var(--sf-rules-h-wide, 280px); }
}

/* A place with nothing to say takes no room. A heavy section below the fold is not laid out or painted until it is near. */
.sf-slot.sf-empty { display: none; }
.sf-slot.sf-heavy { content-visibility: auto; contain-intrinsic-size: auto 260px; }
.sf-slot { min-width: 0; }
.sf-fail { display: grid; gap: 8px; justify-items: start; }
.sf-fail p { margin: 0; }
.sf-notes[hidden] { display: none; }

/* The line under the head: always one line tall, and it scrolls sideways when it is wider than the screen. */
.sf-glance { display: flex; align-items: center; gap: 16px; min-height: 34px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; font-size: 13px; color: var(--muted); margin: 0 -16px; padding: 0 16px; }
.sf-glance::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .sf-glance { margin: 0; padding: 0; } }
/* When it is wider than the screen a fade at its end says so (concept v2: nothing scrolls without a visible fade); the side it fades on is a token the right-to-left rule flips. */
/* The cue that there is more to the side is a button at the line's end (it stays at the edge while the line scrolls and goes when the end is reached), over a fade of the page's own colour. */
.sf-glance-more { position: sticky; inset-inline-end: -16px; flex: none; align-self: center; min-width: 44px; min-height: 44px; margin-block: -6px; margin-inline-start: auto; margin-inline-end: -16px; padding: 0 12px; border: 0; background: linear-gradient(to var(--fade-to, right), transparent, var(--bg) 45%); color: var(--text); font-size: 26px; font-weight: 600; line-height: 1; cursor: pointer; }
.sf-glance-more::before { content: "›"; }
html[dir="rtl"] .sf-glance-more::before { content: "‹"; }
.sf-glance-more[hidden] { display: none; }
@media (min-width: 900px) { .sf-glance-more { inset-inline-end: 0; margin-inline-end: 0; } }
@media (max-width: 899px) { .sf-glance { --fade-to: right; margin-top: -4px; } .sf-fresh { margin-top: -6px; } }
@media (max-width: 380px) { .sf-pos-why, .sf-pos-alerts { font-size: 12.5px; } .sf-pos-acts { gap: 0 8px; } .sf-pos-k { letter-spacing: 0.02em; } }
html[dir="rtl"] .sf-glance { --fade-to: left; }
.sf-grules .rc-chip { padding-block: 10px; margin-block: -10px; }
.sf-glance [hidden] { display: none; }
/* How old the numbers are, under the line at a glance: its place is held, a line on a wide screen and the chips' 44 px on a phone (app.css `.fresh-chip`), so the answer does not move the tabs when it comes. */
.sf-fresh { min-width: 0; min-height: 24px; }
@media (max-width: 699px) { .sf-fresh { min-height: 44px; } }
.sf-g { flex: none; display: inline-flex; align-items: baseline; gap: 6px; }
.sf-k { color: var(--muted); }
.sf-val { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.sf-status { flex: none; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); color: var(--text); font-size: 12.5px; }
.sf-status[data-state="updating"]::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-inline-end: 6px; background: var(--accent); vertical-align: middle; animation: sf-pulse 1.4s ease-in-out infinite; }
.sf-status[data-state="failed"], .sf-status[data-state="offline"] { background: var(--watch-bg, var(--panel-2)); color: var(--watch); }
@media (prefers-reduced-motion: reduce) { .sf-status[data-state="updating"]::before { animation: none; } }
.sf-grules .rc-chip { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }

/* The place for the price, held two lines tall on a phone (the badge beside it wraps under it there), so that the badge arriving does not push the page. */
.sym-head .quote { align-content: flex-start; }
@media (max-width: 899px) { .sym-head .quote { min-height: 85px; } }

/* ── One home for each card, the position row, the toast, the two sheets of the head (docs/stock-page-layout.md) ─────────────────────── */

/* A row where a card used to be, that says where it lives now: the whole row is the link. */
.sf-link-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); font-size: 14px; text-decoration: none; }
.sf-link-row::after { content: "›"; flex: none; color: var(--muted); font-size: 20px; line-height: 1; }
html[dir="rtl"] .sf-link-row::after { content: "‹"; }
.sf-link-row:hover, .sf-link-row:focus-visible { background: var(--panel-2); }

/* "Your position": a few lines under the head of a held stock, as a band and not a card (the chart is the next thing on the screen). Its two buttons are 44 px tall by padding that does not take room. */
.sf-pos { display: grid; gap: 0; padding: 4px 12px; border-radius: var(--radius); background: var(--panel-2); }
.sf-pos[hidden] { display: none; }
.sf-pos-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 16px; min-width: 0; font-size: 14px; line-height: 21px; }
.sf-pos-top { justify-content: space-between; align-items: center; }
.sf-pos-k { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
html[dir="rtl"] .sf-pos-k { letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.sf-pos-acts { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0 14px; }
.sf-pos-why, .sf-pos-alerts { display: inline-flex; align-items: center; gap: 4px; padding: 12px 2px; margin-block: -12px; font: inherit; font-size: 13.5px; line-height: 21px; }
.sf-pos-alerts { border: 0; background: none; color: var(--accent); cursor: pointer; }
.sf-pos-fig { color: var(--text); font-variant-numeric: tabular-nums; }
.sf-pos-pl { font-variant-numeric: tabular-nums; gap: 0 18px; }
.sf-pos-pl b { font-weight: 600; }
.sf-pos-more { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.sf-pos-more[hidden] { display: none; }
.sf-pos-list { margin: 0 0 6px; padding: 0; list-style: none; }
.sf-pos-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 0; font-size: 14px; }
.sf-pos-list .linkish, .sf-pos-more .linkish { min-height: 44px; }

/* A message at the foot of the screen with Undo and Edit (above the phone's tab bar: the sign-in toast's own place). */
.sf-toast { flex-wrap: wrap; z-index: 70; }
.sf-toast-acts { display: inline-flex; gap: 8px; margin-inline-start: auto; }
.sf-toast .btn { min-height: 44px; }

/* The sheets of the head. */
.sf-sheet .sf-sheet-body { display: grid; gap: 12px; padding-block: 12px 16px; padding-inline: 28px; }
@media (max-width: 899px) { .sf-sheet .sf-sheet-body { padding-inline: 18px; } }
.sf-sheet .in { min-height: 44px; }
.sf-cmp-chips, .sf-alert-levels { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-cmp-chip { display: inline-flex; align-items: center; gap: 2px; min-height: 32px; }
.sf-cmp-x { min-width: 44px; min-height: 44px; margin-block: -12px; margin-inline: 0 -10px; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.sf-cmp-list { display: grid; }
.sf-cmp-hit { display: flex; align-items: baseline; gap: 10px; min-height: 44px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.sf-cmp-hit .tk { flex: none; font-weight: 600; }
.sf-cmp-hit .nm { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.sf-cmp-hit .kind { flex: none; white-space: nowrap; font-size: 12px; color: var(--faint); }
.sf-alert-level { min-height: 44px; min-width: 44px; padding-inline: 14px; cursor: pointer; }
.sf-alert-form { align-items: stretch; gap: 8px; }
.sf-alert-form .btn { min-height: 44px; }
.sf-alert-mine ul { margin: 6px 0 0; padding: 0; list-style: none; }
.sf-alert-mine li { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.sf-alert-mine .linkish { min-height: 44px; }

/* The chat's row of what else to do with the stock it is about. */
.chat-acts { display: grid; gap: 8px; margin-bottom: 8px; }
.chat-acts .row { flex-wrap: wrap; gap: 8px; }
.chat-acts .btn { min-height: 44px; }
.chat-acts-more { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 4px; font-size: 14px; }
