/* Card actions (card-actions.js): the bar at the bottom of every card on every Viv site, after 501deals'
   card footer. Colours come from the host site's own tokens (hcfhub: --panel/--accent; jobs board:
   --surface/--brand), with fallbacks. Canonical copy: Viv-Resource-Library packages/card-actions/. */
.cact, .cact-dlg, .cact__burst, .cact-follow {
  --cact-panel: var(--panel, var(--surface, #fff)); --cact-bg: var(--bg, #f7f7f5); --cact-ink: var(--ink, #1d2327);
  --cact-muted: var(--muted, #5f6b73); --cact-line: var(--line, #e3e0d8); --cact-accent: var(--brand, var(--accent, #0f6e6a));
  --cact-soft: var(--brand-soft, var(--accent-soft, #e2f1ef)); --cact-on: var(--brand-ink, #fff); --cact-bad: #b42318;
  --cact-hover: color-mix(in srgb, var(--cact-ink) 7%, transparent); --cact-hover-2: color-mix(in srgb, var(--cact-ink) 10%, transparent);
  --cact-raise: light-dark(var(--cact-panel), color-mix(in srgb, var(--cact-panel) 90%, var(--cact-ink)));
  --cact-edge: color-mix(in srgb, var(--cact-accent) 45%, var(--cact-line));
}
.cact { container-type: inline-size; }
.cact-muted { color: var(--cact-muted); }
.cact-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* The bar: vote, comment, (reactions once there are some), then save and ⋮ on the right. Borderless
   icon buttons like daily.dev's card footer, so the bar reads as one quiet row, not eight boxes. */
.cact { position: relative; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; margin-top: auto; padding-top: .55rem; border-top: 1px solid var(--cact-line); }
.cact button { font: inherit; color: var(--cact-muted); background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; height: 36px; min-width: 36px; padding: 0 .45rem; border: 1px solid transparent; border-radius: 10px; font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.cact button:hover { color: var(--cact-ink); background: var(--cact-hover); }
.cact button:focus-visible { outline: 2px solid var(--cact-accent); outline-offset: 2px; position: relative; z-index: 1; }
.cact svg { width: 18px; height: 18px; flex: none; }
.cact__group { display: inline-flex; align-items: center; background: var(--cact-hover); border-radius: 10px; }
.cact__group button { min-width: 34px; }
.cact__group b:empty, .cact__com b:empty { display: none; }
.cact__up[aria-pressed="true"] { background: var(--cact-accent); color: var(--cact-on); }
.cact__up[aria-pressed="true"]:hover { background: var(--cact-accent); color: var(--cact-on); }
.cact__down[aria-pressed="true"] { background: var(--cact-ink); color: var(--cact-panel); }
.cact__down[aria-pressed="true"]:hover { background: var(--cact-ink); color: var(--cact-panel); }
.cact__right { display: inline-flex; gap: .15rem; margin-left: auto; }
.cact__save[aria-pressed="true"] { color: var(--cact-accent); }
.cact__save[aria-pressed="true"] svg { fill: currentColor; }
.cact__more[aria-expanded="true"], .cact__save[aria-expanded="true"] { background: var(--cact-hover); color: var(--cact-ink); }
.cact__note { position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 7; max-width: 280px; background: var(--cact-ink); color: var(--cact-panel); font-size: .82rem; font-weight: 500; line-height: 1.4; padding: .55rem .75rem; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }

/* Pop-ups (⋮ menu, reactions, collection picker) sit on a raised surface: lighter than the card in
   dark mode, with an accent-tinted edge and a real shadow, so they can't melt into the card behind. */
.cact__pop { position: absolute; right: -.4rem; bottom: calc(100% + 8px); z-index: 6; width: max-content; max-width: calc(100% + .8rem); background: var(--cact-panel); background: var(--cact-raise); color: var(--cact-ink); border: 1px solid var(--cact-edge); border-radius: 14px; box-shadow: 0 2px 6px rgba(0, 0, 0, .12), 0 18px 44px rgba(0, 0, 0, .32); padding: .5rem; }
.cact__pop button:hover { background: var(--cact-hover-2); }
/* The menu and the picker take the card's width, up to 320px, so nothing in them is ever cut off. */
.cact__pop:has(.cact__menu, .cact__save-menu) { width: min(320px, calc(100% + .8rem)); }

/* ⋮ menu: reactions on top, then each action in words with a line saying what it does. */
.cact__menu { display: grid; grid-template-columns: minmax(0, 1fr); gap: .1rem; }
.cact__menu hr { border: 0; border-top: 1px solid var(--cact-line); margin: .35rem 0; width: 100%; }
.cact__menu [role^="menuitem"] { justify-content: flex-start; align-items: center; gap: .7rem; width: 100%; height: auto; min-height: 44px; padding: .45rem .6rem; color: var(--cact-ink); font-size: .92rem; font-weight: 600; text-align: left; }
.cact__menu [role^="menuitem"] > span { display: grid; gap: .05rem; }
.cact__menu [role^="menuitem"] small { font-size: .78rem; font-weight: 400; color: var(--cact-muted); }
.cact__menu [role^="menuitem"] svg { color: var(--cact-muted); }
.cact__menu [aria-checked="true"], .cact__menu [aria-checked="true"] svg { color: var(--cact-accent); }

/* Collection picker. */
.cact__save-menu { display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; font-size: .92rem; }
.cact__head { display: flex; align-items: center; justify-content: space-between; padding: .1rem .1rem 0 .35rem; }
.cact__head b { font-size: 1rem; }
.cact__save-menu .cact__x { height: 32px; min-width: 32px; padding: 0; font-size: .9rem; }
.cact__status { display: flex; align-items: center; gap: .45rem; margin: 0; padding: .1rem .35rem; color: var(--cact-muted); font-size: .86rem; line-height: 1.35; }
.cact__status[hidden] { display: none; }
.cact__status--on svg { color: var(--cact-accent); fill: currentColor; width: 16px; height: 16px; }
.cact__colls { display: grid; gap: .15rem; max-height: 220px; overflow-y: auto; }
.cact__colls button { justify-content: flex-start; width: 100%; height: 44px; padding: 0 .5rem; gap: .6rem; color: var(--cact-ink); font-size: .92rem; font-weight: 500; }
.cact__box { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; border: 1.5px solid var(--cact-muted); border-radius: 5px; font-size: .78rem; font-weight: 800; color: var(--cact-on); }
.cact__colls [aria-pressed="true"] .cact__box { background: var(--cact-accent); border-color: var(--cact-accent); }
.cact__cname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cact__colls small { margin-left: auto; color: var(--cact-muted); font-size: .78rem; font-weight: 400; white-space: nowrap; }
.cact__empty { margin: 0; padding: .55rem .6rem; border: 1px dashed var(--cact-line); border-radius: 10px; color: var(--cact-muted); font-size: .84rem; line-height: 1.4; }
.cact__new { display: flex; gap: .4rem; }
.cact__new input { flex: 1; min-width: 0; height: 40px; font: inherit; font-size: 16px; padding: 0 .65rem; border: 1px solid var(--cact-line); border-radius: 10px; background: var(--cact-bg); color: var(--cact-ink); }
.cact__new input:focus { outline: 2px solid var(--cact-accent); outline-offset: 0; border-color: transparent; }
.cact .cact__new button { height: 40px; padding: 0 .85rem; background: var(--cact-accent); color: var(--cact-on); }
.cact .cact__new button:hover { background: var(--cact-accent); filter: brightness(1.08); }
.cact .cact__new button:disabled { background: var(--cact-hover); color: var(--cact-muted); cursor: default; filter: none; }
.cact__foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .35rem .2rem 0 .35rem; border-top: 1px solid var(--cact-line); }
.cact__foot a { color: var(--cact-accent); font-size: .86rem; font-weight: 600; }
.cact .cact__done { color: var(--cact-ink); border-color: var(--cact-line); padding: 0 1rem; }
.cact__burst { position: fixed; z-index: 100; font-size: 1.5rem; pointer-events: none; animation: cact-rise .9s ease-out forwards; }
@keyframes cact-rise { to { transform: translateY(-70px) scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cact__burst { display: none; } }
.cact-dlg { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); border: 1px solid var(--cact-line); border-radius: 14px; background: var(--cact-panel); color: var(--cact-ink); padding: 1.1rem 1.2rem 1.2rem; }
.cact-dlg::backdrop { background: rgba(10, 15, 20, .45); }
.cact-dlg h2 { margin: 0 2rem .1rem 0; font-size: 1.2rem; }
.cact-dlg h3 { margin: .9rem 0 .35rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--cact-muted); }
.cact-dlg__x { position: absolute; top: .7rem; right: .7rem; width: 34px; height: 34px; border: 0; border-radius: 8px; background: none; color: var(--cact-muted); font-size: 1rem; cursor: pointer; }
.cact-dlg__x:hover { background: var(--cact-soft); color: var(--cact-ink); }
.cact-dlg__for { margin: 0 0 .7rem; color: var(--cact-muted); font-size: .88rem; }
.cact-dlg__hint { font-size: .82rem; color: var(--cact-muted); margin: .6rem 0 0; }
.cact-dlg__lead { margin: .35rem 0 0; font-size: .95rem; line-height: 1.5; color: var(--cact-ink); }
.cact-dlg__hint button { font: inherit; font-weight: 700; color: var(--cact-accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.cact-comments { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .6rem; max-height: 40dvh; overflow-y: auto; }
.cact-comments li { border-bottom: 1px solid var(--cact-line); padding-bottom: .5rem; font-size: .9rem; }
.cact-comments time { color: var(--cact-muted); font-size: .78rem; margin-left: .3rem; }
.cact-comments p { margin: .2rem 0 0; }
.cact-comments video, .cact-comments audio { max-width: 100%; margin-top: .3rem; border-radius: 8px; }
.cact-form textarea, .cact-dlg .cact-miss { width: 100%; font: inherit; font-size: 16px; padding: .55rem .7rem; border: 1px solid var(--cact-line); border-radius: 10px; background: var(--cact-bg); color: var(--cact-ink); box-sizing: border-box; }
.cact-form textarea { min-height: 92px; resize: vertical; }
.cact-form__row { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.cact-btn { font: inherit; font-weight: 700; font-size: .9rem; min-height: 40px; padding: 0 1rem; border-radius: 10px; border: 1px solid var(--cact-accent); background: var(--cact-accent); color: var(--cact-on); cursor: pointer; }
.cact-btn:last-child { margin-left: auto; }
.cact-btn--ghost { background: var(--cact-panel); color: var(--cact-ink); border-color: var(--cact-line); }
.cact-btn:disabled { opacity: .6; cursor: wait; }
.cact-rec { margin-top: .5rem; }
.cact-rec video { width: 100%; max-height: 38dvh; border-radius: 10px; background: #000; }
.cact-rec--live { transform: scaleX(-1); }
.cact-rec__state { font-size: .82rem; color: var(--cact-muted); margin: .3rem 0 0; }
.cact-public { display: flex; gap: .5rem; align-items: flex-start; font-size: .85rem; margin-top: .4rem; }
.cact-public[hidden] { display: none; } /* only once there's a recording; display:flex beat [hidden] */
/* Report a problem: one reason, as big tap rows; the Report link on someone else's comment. */
.cact-reasons { border: 0; margin: 0; padding: 0; display: grid; gap: .1rem; min-width: 0; }
.cact-reasons label { display: flex; gap: .6rem; align-items: center; min-height: 42px; padding: .2rem .6rem; border-radius: 8px; font-size: .93rem; line-height: 1.3; cursor: pointer; }
.cact-reasons label:hover { background: var(--cact-soft); }
.cact-reasons input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--cact-accent); }
.cact-form textarea.cact-note { min-height: 64px; margin-top: .6rem; }
.cact-crisis a { color: var(--cact-accent); font-weight: 700; }
.cact-flag { font: inherit; font-size: .78rem; color: var(--cact-muted); background: none; border: 0; padding: .15rem .3rem; margin-left: .2rem; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.cact-flag:hover, .cact-flag:focus-visible { color: var(--cact-ink); }
.cact-checks { display: flex; flex-wrap: wrap; gap: .35rem; }
.cact-check { font: inherit; font-size: .85rem; font-weight: 600; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--cact-line); background: var(--cact-bg); color: var(--cact-ink); cursor: pointer; }
.cact-check::before { content: "? "; color: var(--cact-muted); }
.cact-check[data-ok="true"] { border-color: var(--cact-accent); color: var(--cact-accent); }
.cact-check[data-ok="true"]::before { content: "✓ "; color: var(--cact-accent); }
.cact-check[data-ok="false"] { border-color: var(--cact-bad); color: var(--cact-bad); text-decoration: line-through; }
.cact-check[data-ok="false"]::before { content: "✕ "; color: var(--cact-bad); }
.cact__note button { font: inherit; font-weight: 700; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; height: auto; }
/* The Comment label shows when the bar has room (501deals' "Review"); narrow cards keep the icon only. */
.cact__lbl { font-weight: 600; }
@container (max-width: 340px) { .cact__lbl, .cact__right .lbl { display: none; } }
/* A site's own button in the bar's slot (the jobs board's Save) takes the bar's look. */
.cact__right > :not(.cact__save, .cact__more) { position: static; }
/* The library cards' own feet sit just above the bar. */
.card__foot + .cact, .rx-card__foot + .cact { margin-top: .2rem; }

/* Follow (health-culture.org#365): a pill that can sit anywhere, e.g. a pop-up's side column. */
.cact-follow { flex: none; font: inherit; font-size: .85rem; font-weight: 700; min-height: 34px; padding: 0 1rem; border-radius: 999px; border: 1px solid var(--cact-accent); background: var(--cact-accent); color: var(--cact-on); cursor: pointer; white-space: nowrap; }
.cact-follow:hover { filter: brightness(1.08); }
.cact-follow--on { background: transparent; color: var(--cact-ink); border-color: var(--cact-line); }
.cact-follow--on:hover { filter: none; border-color: var(--cact-muted); }
.cact-follow:focus-visible { outline: 2px solid var(--cact-accent); outline-offset: 2px; }

/* A bar heading a panel (bar(…, { top: true })): no rule above it, and its menus open downward. */
.cact--top { margin-top: 0; padding-top: 0; border-top: 0; }
.cact--top .cact__pop, .cact--top .cact__note { top: calc(100% + 8px); bottom: auto; }

/* A bookmark alone (data-only="save"), e.g. each article under a Today story (health-culture.org#483). */
.cact.cact--save { display: inline-flex; border: 0; padding: 0; margin: 0; background: none; min-height: 0; gap: 0; }
.cact.cact--save .cact__save { padding: 4px; }
