/* The dashboard's own rules (views/index.ejs). Shared pieces — the figure tile
   (.kpi.kpi-filter), its trend line (.kpi .spark), .card, .thumb, the Overview grid
   (.grid.widgets / .dash-widget, app.css) — are app.css.

   The Overview row: its name, the ONE period switch every time-based widget follows
   (owner, 2026-10-22: "move the seg to the top where the Create Tray button is"),
   Create Tray, Add and Edit — one line, the switch's pills at the button's height. */
.dash-head { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.dash-head > h2 { margin: 0; font-size: var(--fs-16, 16px); font-weight: 600; }
.dash-head > .seg { flex: none; }
.grid.widgets { margin-bottom: 24px; }
/* Weekly goals: THE progress bar (app.css .ql-bar — blue while it runs, green when met);
   it fills from empty as the page opens (/js/pages/index-2.js writes the width). */
.goal-bar-fill { width: 0; transition: width var(--dur-count) var(--ease); }

/* The sales picture (the new layout, step 10 — owner, 2026-10-21, the mock's N12; its
   parts are widgets since 2026-10-22): four figures, the big chart, orders by channel
   and the top items, filled by /js/dashboard-overview.js. A card of it fills its widget
   box (the Overview grid's sizes) and keeps its own .card-head / .pad insets. While a new
   period loads, what is on screen dims a little and stays put. */
.dash-widget-card.dash-ov-card { padding: 0; gap: 0; }
.dash-ov-card.is-updating, .dash-fig.is-updating, .dash-kpi.is-updating { opacity: .62; transition: opacity var(--dur) var(--ease); }
.dash-ov-card, .dash-fig, .dash-kpi { transition: opacity var(--dur-slow) var(--ease); }
/* in Edit a widget is dragged, not used */
.grid.widgets.editing :is(.dash-ov-card, .dash-fig) { pointer-events: none; }
/* EVERY Overview tile's trend line is the tile's LAST ROW, as in the mock (.kspark): its
   own 40px band under the words, the tile's full width — never under the text. In the
   bottom-right corner (app.css .kpi .spark) a long note ("vs the same time last week")
   ran into it and was struck through, a flat line at 0 crossing out "last week" (owner's
   dashboard on Today, 2026-10-23; kpi-note-over-spark.browser.test.js). Every tile with a
   line keeps the same band, so a row's tiles stay level; the figure in the big chart
   draws its line in the accent. */
.grid.widgets .kpi:has(> :is(.spark, .dash-ov-spark)) { padding-bottom: 50px; }
/* width:100%, not left+right: a builtin tile's line IS the <svg>, and a positioned svg keeps
   its own width under width:auto (it drew a third of the band). */
.grid.widgets .kpi > :is(.spark, .dash-ov-spark) { left: 0; right: auto; bottom: 6px; width: 100%; height: 40px; }
:is(.dash-fig, .dash-kpi) .dash-ov-spark { position: absolute; right: 0; bottom: 0; width: 60%; height: 46px; opacity: .9; pointer-events: none; z-index: 0; color: var(--spark); }
:is(.dash-fig, .dash-kpi) .dash-ov-spark svg { display: block; width: 100%; height: 100%; overflow: visible; transition: opacity var(--dur) var(--ease); }
/* A trend that doesn't move draws nothing (2026-11-08: at the band's foot it read as a stray
   border under the tile). The line stays in place, hidden, so a new period morphs from it and
   fades it in. */
.grid.widgets :is(.spark.is-flat, .dash-ov-spark.is-flat svg) { opacity: 0; }
.dash-fig.is-active .dash-ov-spark { color: var(--accent); }
/* "vs the 30 days before" on the change's second line (the tile's note line), muted —
   a figure's change has no icon to indent under */
.dash-fig .delta .delta-note { padding-left: 0; font-weight: 500; color: var(--text-muted); }
/* a delta, a caption or a title that changed with the period fades in where it is
   (opacity only; two names take turns so it runs again every time) */
.ov-swap-a { animation: ov-swap-a var(--dur-slow) var(--ease) backwards; }
.ov-swap-b { animation: ov-swap-b var(--dur-slow) var(--ease) backwards; }
@keyframes ov-swap-a { from { opacity: 0; } }
@keyframes ov-swap-b { from { opacity: 0; } }

/* The big chart — the approved mock's: one SVG stretched to the card (viewBox 1000×260,
   preserveAspectRatio none), this period as a line over a fading area in the figure's
   colour (--ov-line = var(--chart-N), so a theme switch repaints it by itself), the
   period before as a dashed grey line, three guide lines with their values, the ticks
   under it, and a guide + dot + value under the pointer. The first draw wipes in from
   the left; a new period or figure morphs the lines (the script). */
.dash-trend .card-head { flex-wrap: wrap; row-gap: 4px; }
.dash-trend .card-head h3 { flex: 1 1 auto; min-width: 0; }
.dash-trend-plot { position: relative; flex: 1 1 auto; min-height: 200px; margin: 14px 16px 6px; }
.dash-trend-plot > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dash-trend-plot .tr-line { fill: none; stroke: var(--ov-line, var(--chart-3)); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round;
  vector-effect: non-scaling-stroke; transition: stroke var(--dur-slow) var(--ease); }
.dash-trend-plot .tr-prev { fill: none; stroke: var(--text-muted); stroke-opacity: .55; stroke-width: 1.5; stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; }
.dash-trend-plot .tr-g0 { stop-color: var(--ov-line, var(--chart-3)); stop-opacity: .28; transition: stop-color var(--dur-slow) var(--ease); }
.dash-trend-plot .tr-g1 { stop-color: var(--ov-line, var(--chart-3)); stop-opacity: 0; transition: stop-color var(--dur-slow) var(--ease); }
.dash-trend-plot .tr-wipe { animation: tr-wipe 1000ms cubic-bezier(.6, 0, .2, 1) 180ms backwards; }
@keyframes tr-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.dash-trend-plot .tr-gl { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--border); pointer-events: none; }
.dash-trend-plot .tr-gl span { position: absolute; left: 0; top: -17px; font: 500 var(--fs-11, 11px) var(--font-mono); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.dash-trend-x { display: flex; justify-content: space-between; gap: 8px; padding: 0 16px 14px; font: 500 var(--fs-11, 11px) var(--font-mono); color: var(--text-muted); }
.dash-trend-plot .tr-hit { position: absolute; inset: 0; z-index: 2; cursor: crosshair; }
.dash-trend-plot .tr-guide { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ov-line, var(--chart-3)); opacity: .45; pointer-events: none;
  transition: left var(--dur-fast) var(--ease), opacity var(--dur) var(--ease); }
.dash-trend-plot .tr-dot { position: absolute; width: 10px; height: 10px; box-sizing: border-box; border-radius: 50%; background: var(--surface);
  border: 3px solid var(--ov-line, var(--chart-3)); translate: -50% -50%; pointer-events: none;
  transition: left var(--dur-fast) var(--ease), top var(--dur-fast) var(--ease), opacity var(--dur) var(--ease); }
.dash-trend-plot .tr-tip { position: absolute; z-index: 3; translate: -50% calc(-100% - 14px); background: var(--text); color: var(--bg);
  padding: 7px 10px; border-radius: var(--r-8, 9px); font: 600 var(--fs-12, 12px)/1.35 var(--font-mono); white-space: nowrap; text-align: center; pointer-events: none;
  transition: left var(--dur-fast) var(--ease), top var(--dur-fast) var(--ease), opacity var(--dur) var(--ease); }
.dash-trend-plot .tr-tip small { display: block; font-weight: 500; opacity: .75; }
.dash-trend-plot .off { opacity: 0; }
.dash-trend-plot > [data-skel-overlay] { position: absolute; inset: 0; }
.dash-ov-legend { display: flex; gap: 14px; margin-left: auto; font-size: var(--fs-12, 12px); color: var(--text-muted); }
.dash-ov-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dash-ov-legend .now::before { content: ""; width: 14px; height: 3px; border-radius: var(--r-4, 2px); background: var(--ov-line, var(--chart-3)); transition: background-color var(--dur-slow) var(--ease); }
.dash-ov-legend .before::before { content: ""; width: 14px; border-top: 2px dashed var(--text-faint); }
/* A caption beside a time-based chart widget's name says the period it shows */
:is(.dash-widget-card, .kpi) .lbl .cap { flex: none; font: 500 var(--fs-12, 11.5px) var(--font-mono); color: var(--text-muted); }
:is(.dash-widget-card, .kpi) .lbl .cap:empty { display: none; }
.dash-widget.is-updating .dash-widget-chart { opacity: .55; transition: opacity var(--dur) var(--ease); }

/* A KPI tile that follows the period (Trays in progress, Items listed, Reply time,
   Customer requests — /js/dashboard-kpis.js; .dash-kpi): a .kpi tile whose label also
   says the period, whose "opens a report" arrow shows once its fetch set a link, and
   whose lines stay ONE line each (a long topic or "vs the same time last week" ends in
   "…"), so a tile is as tall loading as loaded, whatever it says. Its trend line is the
   figures' (.dash-ov-spark above). */
.dash-kpi .lbl { min-width: 0; }
.dash-kpi .lbl > svg, .dash-kpi .lbl > i[data-lucide] { flex: none; }
.dash-kpi .lbl .lbl-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-kpi .lbl .widget-link-arrow { margin-left: auto; color: var(--muted); visibility: hidden; }
.dash-widget[data-widget-href] > .dash-kpi .lbl .widget-link-arrow { visibility: visible; }
.dash-kpi .delta > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the headline keeps to row 1 beside its 13px icon (a wrapping row would push a long one
   onto a row of its own, a third line) */
.dash-kpi .delta > span:not(.delta-note) { max-width: calc(100% - 16px); }

/* Orders by channel: one row per channel — name, sales, share, and a bar in the
   channel's own colour (entity colours, chart-factory.js). */
.dash-ch { display: grid; grid-template-columns: minmax(0, 1fr) auto 40px; align-items: baseline; column-gap: 10px; row-gap: 6px;
  padding: 9px 0; border-top: 1px solid var(--border-light); color: var(--text); text-decoration: none; }
.dash-ch:first-child { border-top: 0; padding-top: 2px; }
.dash-ch-name { min-width: 0; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.dash-ch-name > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-ch-name small { font-size: inherit; font-weight: 400; color: var(--text-muted); }
.dash-ch-val { font-weight: 600; }
.dash-ch-pct { text-align: right; font-size: var(--fs-12, 12px); }
.dash-ch-track { grid-column: 1 / -1; height: 8px; border-radius: var(--r-full, 99px); background: var(--surface-2); overflow: hidden; }
/* a new period glides each bar to its new length (the mock's) */
.dash-ch-fill { display: block; height: 100%; border-radius: inherit; background: var(--bar-fill, var(--chart-1));
  transition: width 700ms var(--ease-glide, var(--ease)); }
a.dash-ch:hover .dash-ch-name { color: var(--accent); }
.dash-ch.skel { display: flex; flex-direction: column; gap: 9px; }

/* Top items: photo, name, SKU · channel · when, a bar against the best seller
   (decoration, so neutral), and the sales. */
.dash-top { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border-light); color: var(--text); text-decoration: none; }
.dash-top:first-child { border-top: 0; padding-top: 2px; }
.dash-top .thumb, .dash-top .skel-thumb { width: 40px; height: 40px; flex: none; }
.dash-top .thumb { position: relative; overflow: hidden; }
.dash-top .thumb img { width: 100%; height: 100%; object-fit: cover; }
.dash-top-main, .dash-top .skel-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.dash-top-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.dash-top-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--fs-12, 12px) var(--font-mono); color: var(--text-muted); }
.dash-top-bar { display: block; height: 4px; margin-top: 2px; border-radius: var(--r-4, 4px); background: var(--surface-2); overflow: hidden; }
.dash-top-bar span { display: block; height: 100%; border-radius: inherit; background: var(--spark); }
.dash-top-rev { font-weight: 600; }
a.dash-top:hover .dash-top-name { color: var(--accent); }
/* a new period: the rows fade in one after another — the row cascade's step, opacity only */
.dash-top.rin-a { animation: ov-swap-a var(--dur-slow) var(--ease) backwards; animation-delay: calc(var(--i, 0) * var(--cascade-step, 35ms)); }
.dash-top.rin-b { animation: ov-swap-b var(--dur-slow) var(--ease) backwards; animation-delay: calc(var(--i, 0) * var(--cascade-step, 35ms)); }
.dash-ov-empty { padding: 24px 0; }

/* Happening now — the dashboard's one live feed (views/partials/dash-happening.ejs,
   /js/dashboard-happening.js; the new layout, owner 2026-10-22). A row is the kind's
   pill, what happened and where (one line each — a SKU in mono) and how long ago.
   Line heights are whole pixels so a loading row (a lone .skel-bar holds one line of
   its slot, app.css) is exactly as tall as a loaded one, mono or not. Decoration is
   neutral: colour is only the pill's (the colour system). */
.dash-feed .card-head h3 { flex: 1 1 auto; min-width: 0; }
/* "Show all" comes with the rows: it must not make the head taller than the loading one */
.dash-feed .card-head > [data-feed-more] { margin-block: -8px; }
.dash-feed-live { flex: none; }
.dash-feed-live .pd { position: relative; }
/* "Live": a slow ring off the dot (scale + opacity, off the page's thread); still
   when paused and under reduced motion */
.dash-feed-live.green .pd::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor;
  animation: dash-feed-ping 1.8s ease-out infinite; }
@keyframes dash-feed-ping { from { opacity: .55; scale: 1; } to { opacity: 0; scale: 2.8; } }
@media (prefers-reduced-motion: reduce) { .dash-feed-live .pd::after { animation: none; } }
.dash-feed-box { padding-top: 6px; }
.dash-feed-since { margin: 0 0 4px; min-height: 18px; font-size: var(--fs-12, 12.5px); line-height: 18px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-feed-list { list-style: none; margin: 0; padding: 0; }
.dash-feed-row { position: relative; border-top: 1px solid var(--border-light); }
.dash-feed-row:first-child { border-top: 0; }
.dash-feed-in { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; color: var(--text); text-decoration: none; }
/* the kind's pill in a column of its own, so every row's words start at the same place */
.dash-feed-kind { flex: none; display: flex; align-items: center; width: 92px; height: 22px; margin-top: 1px; }
.dash-feed-kind > .pill { max-width: 100%; }
.dash-feed-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-feed-t, .dash-feed-m { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-feed-t { font-size: var(--fs-14, 13.5px); font-weight: 600; line-height: 19px; }
.dash-feed-m { font-size: var(--fs-12, 12.5px); line-height: 17px; color: var(--text-muted); }
.dash-feed-m.mono { font-family: var(--font-mono); font-size: var(--fs-12, 12px); }
.dash-feed-ago { flex: none; padding-top: 3px; font: 500 var(--fs-11, 11px)/16px var(--font-mono); color: var(--text-muted); white-space: nowrap; }
.dash-feed-ago > .skel-bar { width: 22px; }
a.dash-feed-in:hover .dash-feed-t { color: var(--accent); }
/* the first row from before your last visit: "Earlier" on its hairline (no height of its own) */
.dash-feed-row.is-earlier::before { content: attr(data-sep); position: absolute; top: 0; left: 0; translate: 0 -50%;
  padding: 0 8px 0 0; background: var(--surface); font-size: var(--fs-11, 11px); line-height: 12px; color: var(--text-muted); }
/* a row that arrived while you watched fades in where it lands (the others glide, App.glide) */
.dash-feed-row.is-arriving { animation: dash-feed-arrive var(--dur-slow) var(--ease) backwards; }
@keyframes dash-feed-arrive { from { opacity: 0; } }
.dash-feed-empty .empty { padding: 28px 12px; }

@media (max-width: 768px) {
  /* the switch takes its own row under the Overview's name and buttons, its pills
     sharing the width */
  .dash-head { flex-wrap: wrap; }
  .dash-head > .seg { order: 3; flex: 1 1 100%; }
  .dash-head > .seg > button { flex: 1 1 0; }
  .dash-ov-legend { display: none; }
  .dash-trend-plot { min-height: 170px; }
}

/* ===================== SALLY ON THE DASHBOARD =====================
   The Overview widget `sally` (the new layout, Step 12 — owner, 2026-10-22;
   views/partials/sally-widget.ejs + /js/sally-widget.js). ONE card, two states
   ([data-state] start | chat). Its height follows its content: the grid's rows are
   content-sized, so it spans one row however tall it is. The conversation reuses
   the chat vocabulary (.chat/.msg/.bubble, app.css) and the panel's approval card;
   only the card's own layout is here. Decoration is neutral (no glow, no tint). */
.dash-widget[data-widget-kind="sally"] { grid-row: span 1; }
.grid.widgets.editing .sally-card { pointer-events: none; }   /* in Edit the card is dragged, not used */
.sally-card { position: relative; flex: 1 1 auto; width: 100%; min-width: 0; box-sizing: border-box;
  display: flex; gap: 0 28px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 14px 20px 22px;
  /* the layout follows the CARD's width, not the window's (Sally's docked panel narrows
     the card on a wide window). A container is a stacking context: lifted one layer, so
     the period menu and the box's Recents list still paint over the next section. */
  container: sally-card / inline-size; z-index: 1; }
/* the start: the main column (the top row, the greeting, the box, the chips) and the
   latest orders down the side. In a chat the main column is the whole card. */
.sally-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* the top row: the period's name (the switch is the Overview row's) and the four
   sales figures, centred over the column.
   Fixed places in a grid (owner, 2026-10-22: "the orders on the right shift when I open
   the sally sidebar" — a wrapping flex row put them on a second line, on the LEFT).
   Narrower, the figures sit closer, then two by two, then on a line of their own. */
.sally-top { display: grid; grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr); align-items: start; gap: 12px 24px; }
.sally-period { grid-column: 1; grid-row: 1; justify-self: start; font-size: var(--fs-13, 13px); font-weight: 500; color: var(--text-muted); }
.sally-figs { grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 36px; }
.sally-fig { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 96px; padding: 2px 6px;
  border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.sally-fig-lbl { font-size: var(--fs-13, 13px); color: var(--text-muted); transition: color var(--dur-fast) var(--ease); }
.sally-fig:hover .sally-fig-lbl { color: var(--accent); }
.sally-fig-val { display: flex; align-items: center; gap: 7px; min-height: 1lh; font: 600 var(--fs-17, 17px)/1.3 var(--font-display); letter-spacing: -.01em; }
.sally-fig-val .spark { display: block; width: 36px; height: 14px; color: var(--spark); }
.sally-fig-chg { min-height: 1lh; font-size: var(--fs-12, 12.5px); font-weight: 600; }
.sally-fig-val .skel-bar { width: 72px; }
.sally-fig-chg .skel-bar { width: 40px; }
.sally-today-n { display: flex; align-items: center; gap: 6px; height: 30px; font-size: var(--fs-14, 13.5px); color: var(--text-muted); }
.sally-today-n strong { color: var(--text); font-weight: 700; }
.sally-today-n .skel-bar { width: 22px; }
/* today's count in the top row's corner — only where the side does not fit */
.sally-today-corner { display: none; grid-column: -2 / -1; grid-row: 1; justify-self: end; }

/* the side: today's count over the latest orders (owner, 2026-10-22: "i thought we list
   some more orders"; the one floating tile was "not in line with the rest of the
   widget"). Its head sits on the period's line; the rows are the quick look's lines. */
.sally-side { flex: 0 0 232px; min-width: 0; display: flex; flex-direction: column; }
.sally-side > .sally-today-n { justify-content: space-between; border-bottom: 1px solid var(--border-light); }
.sally-orders .ql-line { align-items: baseline; padding: 6px 0; }   /* the amount on the order number's line */
.sally-orders .ql-line-title { font-size: var(--fs-12, 12.5px); font-weight: 600; }
.sally-orders .ql-line-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: var(--fs-12, 12px)/1.4 var(--font-body); }
.sally-orders .ql-line-amt { font-weight: 600; }
.sally-orders-none { margin: 8px 0 0; font-size: var(--fs-13, 13px); }

@container sally-card (max-width: 1000px) { .sally-figs { column-gap: 24px; } }
@container sally-card (max-width: 919.98px) {
  .sally-figs { display: grid; grid-template-columns: repeat(2, auto); justify-content: center; gap: 8px 28px; }
}
@container sally-card (max-width: 839.98px) {
  .sally-side { display: none; }
  .sally-today-corner { display: flex; }
}
@container sally-card (max-width: 593.98px) {
  .sally-figs { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 10px 24px; }
}

/* the first message: the top row slides up and the side slides out, lifted out of the
   layout where they stand (/js/sally-widget.js setState), while the chat comes in; the
   card's morph clips them at its edge. Closing the chat brings them back. */
.sally-card[data-state="chat"] :is(.sally-top, .sally-side):not(.is-leaving) { display: none; }
.sally-card :is(.sally-top, .sally-side).is-leaving { position: absolute; margin: 0; pointer-events: none; }
.sally-top.is-leaving { animation: sally-away-up var(--dur) var(--ease-exit) forwards; }
.sally-side.is-leaving { animation: sally-away-side var(--dur) var(--ease-exit) forwards; }
.sally-top.is-returning { animation: sally-away-up var(--dur-slow) var(--ease) reverse backwards; }
.sally-side.is-returning { animation: sally-away-side var(--dur-slow) var(--ease) reverse backwards; }
@keyframes sally-away-up { to { opacity: 0; translate: 0 -24px; } }
@keyframes sally-away-side { to { opacity: 0; translate: 40px 0; } }

/* the start: the greeting */
.sally-start { margin: 30px 0 0; text-align: center; }
.sally-greet { margin: 0; font: 600 var(--fs-30, 32px)/1.2 var(--font-display); letter-spacing: -.02em; color: var(--text); }
.sally-greet > span { display: block; font-weight: 500; color: var(--text-muted); }

/* "Work with Sally": Sally's box (app.css ".composer.sally-compose" — the panel wears the
   same), a size up. At the start it is a FIXED height: a long question scrolls inside it,
   so typing never resizes the card (owner, 2026-10-22: "when we type … the size of the
   widget changes"). */
.sally-composer { width: 100%; max-width: 760px; align-self: center; margin: 22px 0 0; box-sizing: border-box; box-shadow: var(--shadow-lg); }
.sally-composer .composer-input { height: 104px; min-height: 104px; max-height: 104px; padding: 14px 18px 52px; font-size: var(--fs-15, 15px); line-height: 1.5; }
.sally-composer .composer-actions { right: 10px; bottom: 9px; }
.sally-recents .act-menu-pop { width: 340px; }
.sally-rec-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sally-rec-empty { padding: 8px 10px; font-size: var(--fs-13, 13px); }

/* the count chips at the start (the follow-ups' chip look is app.css .sally-chip) */
.sally-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 16px; }
.sally-chips[hidden] { display: none; }
.sally-chips > .sally-chip { min-height: 36px; }
.sally-chips > .sally-chip:not(.skel) { animation: sally-chip-in var(--dur-slow) var(--ease) backwards; animation-delay: calc(var(--i, 0) * var(--cascade-step) * 2); }
.sally-chip:has(.sally-chip-n) { padding-right: 6px; }
.sally-chip-n { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; box-sizing: border-box;
  border-radius: var(--r-full, 999px); background: var(--surface-2); font-size: var(--fs-12, 12.5px); font-weight: 600; color: var(--text); }
.sally-chip.skel { width: 160px; cursor: default; }
.sally-chip.skel .skel-bar { width: 100%; }

/* THE CHAT (owner, 2026-10-22: "the chat width is super narrow"; "when we type or get a
   new message the size of the widget changes"): the card takes ONE height for the whole
   conversation and the conversation the card's whole width. The thread fills what the
   bar, the follow-ups and the box leave — so a longer question or a new answer takes room
   from the thread, never from the page. The switch from the start grows the card once,
   smoothly (/js/sally-widget.js morph()). */
.sally-card[data-state="chat"] { height: clamp(540px, calc(var(--vh) * .78), 860px); }
.sally-card.is-morphing { overflow: hidden; transition: height var(--dur-entrance) var(--ease); }
.sally-chat { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; width: 100%; max-width: 1180px; align-self: center; margin: 14px 0 0; }
.sally-chat[hidden], .sally-start[hidden] { display: none; }
.sally-card[data-state="chat"] .sally-chat { margin-top: 0; }
.sally-chat:not([hidden]), .sally-start:not([hidden]) { animation: sally-fade var(--dur-slow) var(--ease) backwards; }
@keyframes sally-fade { from { opacity: 0; } }
.sally-chatbar { display: flex; align-items: center; gap: 6px; padding: 0 2px 10px; border-bottom: 1px solid var(--border-light); }
.sally-chatbar .sally-tile { --sally-h: 22px; }
.sally-chat-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-14, 14px); font-weight: 600; }
.sally-thread.chat { flex: 1 1 auto; min-height: 0; max-width: none; margin: 0; gap: 18px; box-sizing: border-box;
  padding: 18px 4px 8px; overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; }
.sally-thread .msg .mav.sally-tile { --sally-h: 28px; width: var(--sally-h); height: var(--sally-h); }
.sally-thread .msg.me .bubble { max-width: min(70%, 680px); white-space: pre-wrap; overflow-wrap: anywhere; }
/* an answer hugs its words; a long one (a list, a table) may use the whole width */
.sally-ans-body { flex: 0 1 auto; min-width: 0; max-width: calc(100% - 40px); }
.sally-ans-body > .bubble { width: fit-content; max-width: 100%; overflow-wrap: anywhere; overflow-x: auto; }
.sally-looked { display: flex; align-items: center; gap: 6px; margin: 4px 0 6px; font-size: var(--fs-12, 12.5px); color: var(--text-muted); }
.sally-looked svg, .sally-looked i[data-lucide] { width: 14px; height: 14px; flex: none; }
/* while Sally works: the panel's dots and a word that shimmers */
.sally-thinking-word { margin-left: 4px; font-size: var(--fs-13, 13px); font-weight: 500; color: transparent;
  background: linear-gradient(90deg, var(--text-muted) 30%, var(--text) 50%, var(--text-muted) 70%) 0 0 / 300% 100%;
  -webkit-background-clip: text; background-clip: text; animation: sally-shimmer 1.6s linear infinite; }
@keyframes sally-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sally-chat .sally-follow { flex: none; margin: 4px 0 2px 40px; }
.sally-card[data-state="chat"] .sally-composer { max-width: 1180px; margin-top: 10px; box-shadow: var(--shadow-sm); }
/* in a chat the box starts at one line and grows to five as you write (into the thread) */
.sally-card[data-state="chat"] .sally-composer .composer-input { height: auto; min-height: 52px; max-height: 148px; padding: 14px 128px 14px 18px; }
.sally-card[data-state="chat"] .sally-rec-label { display: none; }   /* one line: Recents is its icon */
@media (prefers-reduced-motion: reduce) { .sally-thread.chat { scroll-behavior: auto; } .sally-thinking-word { animation: none; color: var(--text-muted); } }

@media (max-width: 768px) {
  .sally-card { padding: 12px 12px 16px; }
  /* the period and today's orders share the first line; the figures go two by two under it */
  .sally-top { display: grid; grid-template-columns: auto auto; justify-content: space-between; align-items: center; gap: 10px; }
  .sally-figs { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 8px; margin: 0; }
  .sally-fig { min-width: 0; }
  .sally-start { margin-top: 20px; }
  .sally-greet { font-size: var(--fs-20, 22px); }
  .sally-composer { margin-top: 16px; }
  .sally-chips { gap: 8px; }
  .sally-chip { padding: 6px 12px; }
  .sally-card[data-state="chat"] { height: calc(var(--vh) * .8); }
  .sally-chat .sally-follow { margin-left: 0; }
  .sally-rec-label { display: none; }
  .sally-thread .msg.me .bubble { max-width: 85%; }
}

/* ── Get started (views/index.ejs, src/dashboard/get-started.js) ─────────────────────────
   An admin's first steps while the shop is new: .list-row rows in the card, two side by side
   on a wide screen, one under the other on a narrow one. The mark is neutral (decoration);
   a step that is done says so in its pill. Hiding it fades the card out (/js/pages/index-2.js). */
.get-started { margin-bottom: 24px; }
.get-started.is-leaving { opacity: 0; transition: opacity var(--dur) var(--ease-exit); }
.gs-steps { list-style: none; margin: 0; padding: 0 16px 2px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
.gs-step { gap: 12px; }
.gs-steps > .gs-step:nth-last-child(-n+2) { border-bottom: none; }
.gs-mark { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.gs-mark svg, .gs-mark i[data-lucide] { width: 16px; height: 16px; }
.gs-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gs-body > small { font-size: var(--fs-13, 13px); line-height: 1.4; }
.gs-step.is-done :is(.gs-mark, .t-strong) { color: var(--text-muted); }
/* how far along (round 4 of the design principles, 2026-11-17) — and a step done since the last visit pops green */
.gs-progress { padding: 0 16px 6px; }
.gs-progress .meter > span { background: var(--green); }
@keyframes gs-tick { 0% { scale: .6; } 60% { scale: 1.15; } 100% { scale: 1; } }
.gs-step.is-new .gs-mark { background: var(--green-bg); border-color: transparent; color: var(--green); animation: gs-tick var(--dur-slow) var(--ease) var(--dur) backwards; }
@media (max-width: 900px) {
  .gs-steps { grid-template-columns: minmax(0, 1fr); padding: 0 12px 2px; }
  .gs-progress { padding: 0 12px 6px; }
  .gs-steps > .gs-step:nth-last-child(2) { border-bottom: 1px solid var(--border); }
}

/* ---- eBay seller level (src/dashboard/widgets.js `ebay_level`): one row per eBay store — the
   store's name with the marketplace's mark, its level as THE pill, under it the measures eBay
   scores (each value coloured by eBay's own verdict on it) and where the level is heading. The
   row opens the store's card on its channel page. ---- */
.dash-lvl-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 10px; row-gap: 4px;
  padding: 10px 0; border-top: 1px solid var(--border-light); color: inherit; text-decoration: none; }
.dash-lvl-row:first-child { border-top: 0; padding-top: 2px; }
.dash-lvl-name { min-width: 0; display: flex; align-items: center; gap: 8px; font-weight: 500; }
.dash-lvl-name > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-lvl-line { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--fs-12, 12px); color: var(--text-muted); }
.dash-lvl-line .num { font-weight: 600; color: var(--text); }
.dash-lvl-line .is-amber .num { color: var(--amber); }
.dash-lvl-line .is-red .num { color: var(--red); }
.dash-lvl-next { grid-column: 1 / -1; font-size: var(--fs-12, 12px); color: var(--text-muted); }
a.dash-lvl-row:hover .dash-lvl-name { color: var(--accent); }
.dash-lvl-row.skel { display: flex; flex-wrap: wrap; gap: 8px; }
.dash-lvl-row.skel .skel-bar.sm { flex-basis: 100%; }
