/* Cards, after Today AI: roomy white cards with big corners, each in its own colour (set per card as
   --card-accent), soft grey tiles inside, pill buttons. Used on 今天 and for pushed messages in the chat. */

/* 今天 */
:root[data-ui] .page-today .story {
  border: 0; border-radius: 26px; padding: 20px 20px 18px; margin: 0 0 14px; background: var(--surface-2);
  box-shadow: 0 1px 2px rgba(20, 22, 40, 0.04), 0 14px 34px -20px rgba(20, 22, 40, 0.24);
}
:root[data-ui] .page-today .today-main .edition-head + .story, :root[data-ui] .page-today .today-main .edition-lede + .story { border-top: 0; }
:root[data-ui] .page-today .brief-category { gap: 6px; margin-bottom: 10px; }
:root[data-ui] .page-today .brief-cat-icon { color: var(--card-accent, var(--accent)); width: 20px; height: 20px; }
:root[data-ui] .page-today .brief-cat-icon svg { width: 17px; height: 17px; }
:root[data-ui] .page-today .story-cat { color: var(--card-accent, var(--accent)); font-size: 14px; font-weight: 600; }
:root[data-ui] .page-today .brief-headline { font-size: 19px; font-weight: 700; line-height: 1.42; margin: 0 0 8px; }
:root[data-ui] .page-today .brief-summary { font-size: 15px; line-height: 1.62; color: var(--ink-2); }
:root[data-ui] .page-today .brief-block { margin-top: 16px; }
:root[data-ui] .page-today .brief-metrics-grid { gap: 8px; }
:root[data-ui] .page-today .brief-metric, :root[data-ui] .page-today .brief-metric + .brief-metric { padding: 12px 14px; border-radius: 14px; background: rgba(120, 124, 150, 0.08); }
:root[data-ui] .page-today .brief-metric-label { color: var(--ink-3); }
:root[data-ui] .page-today .brief-list-row { padding: 10px 0; }
:root[data-ui] .page-today .brief-actions { margin-top: 18px; gap: 8px; }
:root[data-ui] .page-today .story .brief-actions .primary {
  height: 40px; padding: 0 20px; border-radius: 999px; font-size: 15px; font-weight: 600;
  background: var(--card-accent, var(--accent)); color: #fff; box-shadow: none;
}
:root[data-ui] .page-today .story .brief-actions .primary:hover { background: var(--card-accent, var(--accent)); filter: brightness(0.94); }
:root[data-ui] .page-today .story .brief-actions .secondary { height: 40px; padding: 0 18px; border-radius: 999px; font-size: 15px; background: rgba(120, 124, 150, 0.1); }

/* pushed messages in the chat */
.msg-time { text-align: center; font-size: 12px; color: var(--ink-3); margin: 4px 0 10px; }
.message.push { margin-bottom: 22px; }
.message.push .bubble-column { width: 100%; align-items: stretch; }
.push-card {
  background: var(--surface-2); border-radius: 22px; padding: 14px 18px 12px;
  box-shadow: 0 1px 2px rgba(20, 22, 40, 0.04), 0 12px 30px -20px rgba(20, 22, 40, 0.22);
}
.push-card .bubble { position: relative; }
.push-card.folded .bubble { max-height: 300px; overflow: hidden; }
.push-card.folded .bubble::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 90px; pointer-events: none; background: linear-gradient(180deg, transparent, var(--surface-2)); }
.push-more { display: block; height: auto; min-height: 0; padding: 8px 0 2px; border: 0; background: none; box-shadow: none; color: #2f7de1; font-size: 15px; font-weight: 500; }
.push-card .proactive-extras { margin-top: 10px; }
.message.push .origin-line { align-self: flex-start; display: inline-flex; gap: 6px; margin-top: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(120, 124, 150, 0.1); font-size: 13px; color: var(--ink-2); }
.message.push .origin-line .origin-action { color: var(--ink-3); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .push-card, :root:not([data-theme="light"]) .page-today .story { box-shadow: none; }
}
:root[data-theme="dark"] .push-card, :root[data-theme="dark"] .page-today .story { box-shadow: none; }
/* the source pill stays on one line; a long task name is cut with … */
.message.push .origin-line { flex-wrap: nowrap; max-width: 100%; min-width: 0; }
.message.push .origin-line > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message.push .origin-line .origin-action { flex: none; white-space: nowrap; }
.message.push .origin-line svg { flex: none; }
/* a hairline so white cards hold their edge on a light page */
.push-card, :root[data-ui] .page-today .story { outline: 0.5px solid rgba(20, 22, 40, 0.06); outline-offset: -0.5px; }

/* 今天 sits on a light warm grey, so the white cards stand clear of the date and lines above them */
:root { --today-ground: #f3f1ed; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --today-ground: var(--bg); } }
:root[data-theme="dark"] { --today-ground: var(--bg); }
body:has(.shell.on-today), .shell.on-today, .shell.on-today .main, .shell.on-today .content, .shell.on-today .page-scroll, .shell.on-today .topbar { background: var(--today-ground); }
.page-today { --surface-2: #ffffff; }
:root[data-ui] .page-today .story { outline-color: rgba(60, 40, 20, 0.05); box-shadow: 0 1px 2px rgba(60, 40, 20, 0.04), 0 10px 28px -18px rgba(60, 40, 20, 0.22); }
:root[data-ui] .page-today .brief-metric, :root[data-ui] .page-today .brief-metric + .brief-metric { background: #f5f4f1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .page-today { --surface-2: var(--card-bg, #1c1c1f); }
  :root:not([data-theme="light"]) .page-today .brief-metric { background: rgba(255, 255, 255, 0.06); }
}
/* timeline dots follow the card's own colour (the D+n tags keep their warning colour) */
:root[data-ui] .page-today .story .brief-stop.tone-warn .brief-dot, :root[data-ui] .page-today .story .brief-stop.tone-bad .brief-dot { background: var(--card-accent, var(--accent)); border-color: var(--card-accent, var(--accent)); }

/* 今天, after Today AI: date, then cards; each group gets a small centred time + name above it */
.masthead-corner { display: flex; align-items: center; gap: 10px; }
.masthead-corner .icon-button { width: 34px; height: 34px; border-radius: 50%; background: rgba(120, 124, 150, 0.1); box-shadow: none; color: var(--ink-2); display: grid; place-items: center; }
.masthead-corner .icon-button svg { width: 18px; height: 18px; }
:root[data-ui] .page-today .edition-head.centred { display: flex; flex-direction: column; align-items: center; gap: 1px; margin: 22px 0 10px; padding: 0; border: 0; }
:root[data-ui] .page-today .edition-head.centred .edition-time { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
:root[data-ui] .page-today .edition-head.centred .edition-name { font-size: 15px; font-weight: 600; color: var(--ink-2); }
:root[data-ui] .page-today .masthead { margin-bottom: 4px; }
.edition-pending-line { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 18px 0 12px; font-size: 13px; color: var(--ink-3); }
.edition-pending-line .spinner { width: 12px; height: 12px; }
.edition-pending-go { height: 28px; min-height: 0; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(238, 106, 36, 0.12); color: #e0601c; font-size: 13px; font-weight: 600; box-shadow: none; }

/* morning / evening / other: the whole card carries a faint wash of its colour */
:root[data-ui] .page-today .story.edition-morning, :root[data-ui] .page-today .story.edition-evening, :root[data-ui] .page-today .story.edition-push {
  background: color-mix(in srgb, var(--card-accent) 7%, var(--surface-2));
  outline-color: color-mix(in srgb, var(--card-accent) 16%, transparent);
}
:root[data-ui] .page-today .story.edition-push { background: color-mix(in srgb, var(--card-accent) 5%, var(--surface-2)); }
:root[data-ui] .page-today .story[class*="edition-"] .brief-metric,
:root[data-ui] .page-today .story[class*="edition-"] .brief-metric + .brief-metric { background: color-mix(in srgb, var(--card-accent) 6%, #ffffff); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .page-today .story[class*="edition-"] .brief-metric { background: rgba(255, 255, 255, 0.06); }
}
:root[data-theme="dark"] .page-today .story[class*="edition-"] .brief-metric { background: rgba(255, 255, 255, 0.06); }


/* Dark picked by hand (the blocks above only cover a dark system): same rules. */
:root[data-theme="dark"] .push-card, :root[data-theme="dark"] .page-today .story { box-shadow: none; }
:root[data-theme="dark"] { --today-ground: var(--bg); }
:root[data-theme="dark"] .page-today { --surface-2: var(--card-bg, #1c1c1f); }
  :root[data-theme="dark"] .page-today .brief-metric { background: rgba(255, 255, 255, 0.06); }
:root[data-theme="dark"] .page-today .story[class*="edition-"] .brief-metric { background: rgba(255, 255, 255, 0.06); }
