/* ===== Portal 3.0 card styles: shared skeleton for the chat cards, the decisions tray and the Settings picker =====
   Active only when card-style.js has set <html data-card-style>; without it cards.css alone applies.
   Every rule here is :root[data-card-style] + the cards.css selector it restyles, so it beats the
   cards.css light/rose patches by one attribute. Colours come from palettes.css (--cs-*), fonts from the
   active style file (--cs-fd display, --cs-fb body, --cs-fm mono; inherit until it loads).
   Sizes (cardux1111, design 02): cards stop at 600px; buttons are 32px with an invisible 40px hit box on
   desktop and 44px in the phone layout (max-width:1024px),(pointer:coarse); text never under 12px
   (--pb-fs-md). Motion only under prefers-reduced-motion: no-preference. */

/* ---- card shell ---- */
:root[data-card-style] .pc-card{position:relative;padding:12px;border:1px solid var(--cs-line);border-radius:var(--cs-r);
  background:var(--cs-card);color:var(--cs-ink);box-shadow:var(--cs-shadow);font-family:var(--cs-fb,inherit);line-height:1.45;
  /* a grid so the footer packs into one line (note label, note, Not now) without a DOM change; DOM order = focus order */
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;width:600px;max-width:100%;margin:6px 0;
  container:pc-card / inline-size}
:root[data-card-style] .pc-card > *{grid-column:1 / -1;min-width:0}
:root[data-card-style] .msg.card-pending .msg-bubble{border-left-color:var(--cs-acc)}
/* one frame: a message that carries a card loses its bubble chrome; the pending accent moves to the card */
:root[data-card-style] .msg-ai .msg-bubble:has(.pc-card){padding:0;background:none;border:0;border-radius:0}
:root[data-card-style] .msg-ai .msg-bubble:has(.pc-card) > :not(.pc-card):not(.pc-status-host):not(:has(.pc-card)){padding:0 2px 6px}
:root[data-card-style] .msg.card-pending .msg-bubble:has(.pc-card){border-left:0}
:root[data-card-style] .msg.card-pending .pc-card{border-left:3px solid var(--cs-acc)}
:root[data-card-style] .pc-head{gap:4px 8px;margin-bottom:6px}
:root[data-card-style] .pc-chip{display:inline-flex;align-items:center;gap:6px;min-height:20px;padding:0 8px;border-radius:999px;
  font-size:var(--pb-fs-md);font-weight:700;letter-spacing:.03em;text-transform:none;background:var(--cs-chip-bg);color:var(--cs-chip-ink)}
:root[data-card-style] .pc-chip::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor;flex:0 0 auto}
:root[data-card-style] .pc-card[data-state="answered"] .pc-chip,:root[data-card-style] .pc-card[data-state="closed"] .pc-chip,
:root[data-card-style] .pc-card[data-state="superseded"] .pc-chip,:root[data-card-style] .pc-card[data-state="expired"] .pc-chip,
:root[data-card-style] .pc-card[data-state="ready"] .pc-chip,:root[data-card-style] .pc-status-card[data-state="done"] .pc-chip{background:var(--cs-card-2);color:var(--cs-muted)}
:root[data-card-style] .pc-status-card[data-state="failed"] .pc-chip{background:var(--cs-bad);color:var(--cs-on-bad)}
:root[data-card-style] .pc-left{margin-left:auto;font-family:var(--cs-fm,inherit);font-size:var(--pb-fs-md);color:var(--cs-muted)}
:root[data-card-style] .pc-prompt{margin:0 0 2px;font-family:var(--cs-fd,inherit);font-weight:600;font-size:var(--pb-fs-lg);line-height:1.35;overflow-wrap:anywhere}
:root[data-card-style] .pc-card[data-state="expired"]{box-shadow:none;background:var(--cs-card-2)}
:root[data-card-style] .pc-card[data-state="expired"] .pc-prompt{color:var(--cs-muted)}

/* ---- go rows ---- */
:root[data-card-style] .pc-rows{margin-top:6px}
:root[data-card-style] .pc-row{padding:12px 0;border-top:1px solid var(--cs-line)}
:root[data-card-style] .pc-rows > .pc-row{padding:6px 0}
:root[data-card-style] .pc-row:first-child{border-top:0}
:root[data-card-style] .pc-line{gap:8px}
:root[data-card-style] .pc-num{min-width:1.6em;font-family:var(--cs-fm,inherit);font-weight:600;color:var(--cs-muted)}
:root[data-card-style] .pc-label{font-weight:500;line-height:1.4}
:root[data-card-style] .pc-ctl{margin-top:6px;gap:6px}
:root[data-card-style] .pc-status{color:var(--cs-muted);font-size:var(--pb-fs-md)}
/* one row per go item once the card itself is 480px or wider (a docked or narrow chat falls back to two rows) */
@container pc-card (min-width: 480px){
  :root[data-card-style] .pc-rows > .pc-row{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px;align-items:center}
  :root[data-card-style] .pc-rows > .pc-row > .pc-ctl{margin-top:0;flex-wrap:nowrap}
  :root[data-card-style] .pc-rows > .pc-row > .pc-count-note,:root[data-card-style] .pc-rows > .pc-row > .pc-detail{grid-column:1 / -1}
  :root[data-card-style] .pc-rows > .pc-row .pc-status:empty{display:none}
}
/* More box: capped height, scrolls inside, its Ask line stays pinned at its bottom */
:root[data-card-style] .pc-detail{margin:6px 0 2px;padding:8px 10px 0;border:0;border-left:2px solid var(--cs-ls);
  border-radius:0 var(--cs-rs) var(--cs-rs) 0;background:var(--cs-card-2);color:var(--cs-ink);
  max-height:240px;overflow-y:auto;overscroll-behavior:contain;line-height:1.45}
:root[data-card-style] .pc-detail[hidden]{display:none}
:root[data-card-style] .pc-detail-line{margin:0 0 4px}
:root[data-card-style] .pc-ask:not(:empty){position:sticky;bottom:0;margin:6px -10px 0;padding:8px 10px;border-top:1px solid var(--cs-line);background:inherit}
:root[data-card-style] .pc-ask:empty{margin:0;height:8px}
:root[data-card-style] .pc-ask-line{gap:6px}
:root[data-card-style] .pc-ask-btns{gap:6px}
:root[data-card-style] .pc-ask-line .pc-ask-field{height:32px;min-height:32px;padding:0 10px}
:root[data-card-style] .pc-ask-hint{margin-top:8px;color:var(--cs-muted);font-size:var(--pb-fs-md)}
:root[data-card-style] .pc-ask-pending:not(:empty){margin-top:10px;padding:0 0 0 12px;border-left:2px solid var(--cs-acc2);color:var(--cs-ink);font-size:var(--pb-fs-md)}
:root[data-card-style] .pc-count-note{margin-top:6px;padding-left:12px;border-left:2px solid var(--cs-acc2);color:var(--cs-ink);font-size:var(--pb-fs-md)}
:root[data-card-style] .pc-confirm{border:1px solid var(--cs-acc2);border-radius:var(--cs-rs);background:var(--cs-card-2)}
:root[data-card-style] .pc-confirm[hidden]{display:none}
:root[data-card-style] .pc-confirm-title{font-family:var(--cs-fd,inherit)}
:root[data-card-style] .pc-footer,:root[data-card-style] .pc-end,:root[data-card-style] .pc-note-label{color:var(--cs-muted)}
:root[data-card-style] .pc-footer,:root[data-card-style] .pc-end{margin-top:6px;font-size:var(--pb-fs-md)}
:root[data-card-style] .pc-end:empty{display:none}

/* ---- buttons: 32px visible on desktop with an invisible 40px hit box (sizes.css pattern); 44px in the phone layout ---- */
:root[data-card-style] .pc-btn{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:32px;min-width:32px;padding:0 12px;
  border:1px solid var(--cs-ls);border-radius:var(--cs-rb);background:var(--cs-btn);color:var(--cs-ink);font-family:inherit;font-weight:600;
  font-size:var(--pb-fs-base);line-height:1;white-space:nowrap;-webkit-tap-highlight-color:transparent}
:root[data-card-style] .pc-btn::before{content:"";position:absolute;left:0;right:0;top:-4px;bottom:-4px}
:root[data-card-style] .pc-btn:hover:not(:disabled){border-color:var(--cs-acc2)}
:root[data-card-style] .pc-btn[hidden]{display:none}
:root[data-card-style] .pc-wide{display:flex;width:100%;margin-top:12px}
/* card footer: "Go on all remaining" is a quiet trailing button (only Go is filled); note + Not now share one line */
:root[data-card-style] .pc-card > .pc-wide{display:flex;width:auto;justify-self:end;margin-top:8px}
:root[data-card-style] .pc-primary{background:linear-gradient(135deg,var(--cs-go-a),var(--cs-go-b));border-color:transparent;color:var(--cs-on-go);font-weight:700}
:root[data-card-style] .pc-primary:hover:not(:disabled){background:var(--cs-acc-h);border-color:var(--cs-acc-h);color:var(--cs-on-acc)}
:root[data-card-style] .pc-card > .pc-wide.pc-primary{background:transparent;border-color:var(--cs-acc2);color:var(--cs-acc2)}
:root[data-card-style] .pc-card > .pc-wide.pc-primary:hover:not(:disabled){background:var(--cs-acc-soft);color:var(--cs-acc2)}
:root[data-card-style] .pc-more,:root[data-card-style] .pc-link{background:transparent;border-color:transparent;color:var(--cs-acc2);padding:0 10px}
:root[data-card-style] .pc-more:hover:not(:disabled),:root[data-card-style] .pc-link:hover:not(:disabled){border-color:transparent;background:var(--cs-acc-soft)}
:root[data-card-style] .pc-link{text-decoration:underline;text-underline-offset:3px}
:root[data-card-style] .pc-more{padding:0 8px 0 6px;gap:6px}
:root[data-card-style] .pc-more::after{content:"";order:-1;width:6px;height:6px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:rotate(-45deg)}
:root[data-card-style] .pc-more[aria-expanded="true"]::after{transform:translateY(-2px) rotate(45deg)}
:root[data-card-style] .pc-card > .pc-note-label{grid-column:1;margin-top:8px;margin-right:8px;line-height:32px;font-size:var(--pb-fs-md);white-space:nowrap}
:root[data-card-style] .pc-card > .pc-note{grid-column:2;margin-top:8px;margin-left:0;margin-right:0;height:32px;min-height:32px;padding:6px 10px;line-height:1.4;resize:none}
:root[data-card-style] .pc-card > .pc-note:focus{height:72px}
:root[data-card-style] .pc-card > .pc-note + .pc-actions{grid-column:3;margin-top:8px;margin-left:8px}
:root[data-card-style] .pc-actions{margin-top:8px}

/* ---- focus: one visible ring everywhere the cards and tray put focus ---- */
:root[data-card-style] .pc-card :focus-visible,:root[data-card-style] .pc-tray :focus-visible,:root[data-card-style] .pc-tray-strip :focus-visible,
:root[data-card-style] .pc-tray-btn:focus-visible,:root[data-card-style] .pc-btn:focus-visible,:root[data-card-style] .pc-note:focus-visible,
:root[data-card-style] .pc-input:focus-visible,:root[data-card-style] .pc-form .pc-field-input:focus-visible,:root[data-card-style] .pc-tray-head:focus-visible{
  outline:3px solid var(--cs-focus);outline-offset:2px}

/* ---- text fields ---- */
:root[data-card-style] .pc-note,:root[data-card-style] .pc-form .pc-field-input{min-height:44px;border:1px solid var(--cs-ls);border-radius:var(--cs-rs);
  background:var(--cs-field);color:var(--cs-ink)}
:root[data-card-style] .pc-form .pc-field-input{min-height:36px;padding:6px 10px}
:root[data-card-style] .pc-form textarea.pc-field-input{min-height:64px}
:root[data-card-style] .pc-note::placeholder,:root[data-card-style] .pc-form .pc-field-input::placeholder{color:var(--cs-muted);opacity:1}
:root[data-card-style] .pc-note:hover,:root[data-card-style] .pc-form .pc-field-input:hover{border-color:var(--cs-acc2)}

/* ---- choice: each option is a framed 44px+ row; checked takes the soft accent ---- */
:root[data-card-style] .pc-legend{margin-bottom:2px;color:var(--cs-muted);font-size:var(--pb-fs-md)}
:root[data-card-style] .pc-choice .pc-option,:root[data-card-style] .pc-choice .pc-option:first-child{margin-top:4px;padding:0 6px 0 0;min-height:var(--pb-hit);
  border:1px solid var(--cs-line);border-radius:var(--cs-rs);background:var(--cs-card)}
:root[data-card-style] .pc-choice .pc-option:hover{border-color:var(--cs-ls)}
:root[data-card-style] .pc-choice .pc-option:has(.pc-input:checked){border-color:var(--cs-acc2);background:var(--cs-acc-soft)}
:root[data-card-style] .pc-option .pc-input{accent-color:var(--cs-acc2)}
:root[data-card-style] .pc-option .pc-opt-label{min-height:var(--pb-hit);padding:2px 0 2px 10px;gap:8px}
:root[data-card-style] .pc-option .pc-detail{margin:2px 4px 8px 10px}
:root[data-card-style] .pc-option .pc-rec{padding:0 6px;border-radius:999px;border:1px solid var(--cs-acc);background:var(--cs-rec-bg);color:var(--cs-rec-ink);
  font-size:var(--pb-fs-md);line-height:18px;letter-spacing:.04em}
/* six or more options scroll inside; Send and Not now stay outside the scroll */
:root[data-card-style] .pc-choice .pc-fieldset:has(> .pc-option:nth-of-type(6)){max-height:320px;overflow-y:auto}
:root[data-card-style] .pc-other{margin-top:6px}
:root[data-card-style] .pc-other > .pc-wide{display:inline-flex;width:auto}
:root[data-card-style] .pc-option .pc-picked{border:1px solid var(--cs-acc2);background:var(--cs-acc2);color:var(--cs-on-acc2)}

/* ---- form ---- */
:root[data-card-style] .pc-form .pc-field{border-top:1px solid var(--cs-line);padding:8px 0}
:root[data-card-style] .pc-field-label{margin-bottom:4px;font-weight:500}
:root[data-card-style] .pc-form .pc-field:first-of-type{border-top:0}
:root[data-card-style] .pc-optional,:root[data-card-style] .pc-hint{color:var(--cs-muted);font-size:var(--pb-fs-md)}
:root[data-card-style] .pc-yn{min-width:64px}
:root[data-card-style] .pc-yn-set .pc-legend{margin-bottom:4px;font-weight:500}
:root[data-card-style] .pc-form .pc-yn[aria-pressed="true"]{background:var(--cs-acc2);border-color:var(--cs-acc2);color:var(--cs-on-acc2)}
:root[data-card-style] .pc-value{border-left:2px solid var(--cs-acc2);border-radius:0 var(--cs-rs) var(--cs-rs) 0;background:var(--cs-card-2);color:var(--cs-ink)}
:root[data-card-style] .pc-value[hidden]{display:none}
:root[data-card-style] .pc-warn{margin-top:6px;padding:6px 10px;border-radius:var(--cs-rs);background:var(--cs-card-2);color:var(--cs-ink);font-size:var(--pb-fs-md)}

/* ---- result: table, bars, line ---- */
:root[data-card-style] .pc-table th,:root[data-card-style] .pc-table td{padding:4px 8px;border-top-color:var(--cs-line)}
:root[data-card-style] .pc-table td{font-family:var(--cs-fm,inherit)}
:root[data-card-style] .pc-table thead th{color:var(--cs-muted);font-family:var(--cs-fm,inherit);font-size:var(--pb-fs-md)}
:root[data-card-style] .pc-bars{gap:4px;margin-top:6px}
:root[data-card-style] .pc-bar-label{color:var(--cs-muted);font-size:var(--pb-fs-md)}
:root[data-card-style] .pc-bar-value{font-family:var(--cs-fm,inherit);font-size:var(--pb-fs-md)}
:root[data-card-style] .pc-bar-track,:root[data-card-style] .pc-progress{background:var(--cs-track);box-shadow:inset 0 0 0 1px var(--cs-ls);border-radius:999px}
:root[data-card-style] .pc-bar-fill,:root[data-card-style] .pc-progress-fill{background:var(--cs-acc2);border-radius:inherit;transform-origin:left}
:root[data-card-style] .pc-line-path{stroke:var(--cs-acc2)}
:root[data-card-style] .pc-line-chart{height:64px}
:root[data-card-style] .pc-status-card > .pc-head{margin-bottom:0}
:root[data-card-style] .pc-status-text{margin-top:6px}

/* ---- status and file request ---- */
:root[data-card-style] .pc-earlier{border-left-color:var(--cs-line);color:var(--cs-muted);font-size:var(--pb-fs-md)}
:root[data-card-style] .pc-status-stub{color:var(--cs-muted)}
:root[data-card-style] .pc-drop{gap:12px;padding:16px;border:2px dashed var(--cs-ls);border-radius:var(--cs-rs);background:var(--cs-card-2)}
:root[data-card-style] .pc-drop.pc-drop-over{border-color:var(--cs-acc2);background:var(--cs-acc-soft)}
:root[data-card-style] .pc-drop-text,:root[data-card-style] .pc-accept,:root[data-card-style] .pc-say{color:var(--cs-muted)}

/* ---- decisions tray, its chat-header button and the phone strip ---- */
:root[data-card-style] .pc-tray-btn{font-family:var(--cs-fb,inherit)}
:root[data-card-style] .pc-tray-btn[data-state="waiting"]{border-color:var(--cs-acc2);background:var(--cs-card);color:var(--cs-ink)}
:root[data-card-style] .pc-tray-btn[data-state="waiting"]:hover{background:var(--cs-acc-soft)}
:root[data-card-style] .pc-tray-btn[data-state="waiting"] .pc-tray-ic{color:var(--cs-acc2)}
:root[data-card-style] .pc-tray-btn[data-state="checking"] .pc-tray-ic{border-top-color:var(--cs-acc)}
:root[data-card-style] .pc-tray-btn[data-state="error"] .pc-tray-ic{background:var(--cs-bad)}
:root[data-card-style] .pc-tray-n{background:var(--cs-acc);color:var(--cs-on-acc);font-family:var(--cs-fm,inherit)}
:root[data-card-style] .pc-tray{width:320px;max-height:min(60vh,480px);padding:14px;border:1px solid var(--cs-ls);border-radius:var(--cs-r);background:var(--cs-card);color:var(--cs-ink);
  box-shadow:var(--cs-tray-shadow);font-family:var(--cs-fb,inherit);transform-origin:top right}
:root[data-card-style] .pc-tray[hidden],:root[data-card-style] .pc-tray-strip[hidden]{display:none}
:root[data-card-style] .pc-tray-head{font-family:var(--cs-fd,inherit);font-size:var(--pb-fs-lg)}
:root[data-card-style] .pc-tray-top .pc-btn{min-height:28px;min-width:28px;padding:0}
/* compact rows; the Show button's hit box covers the whole row (the row has no other control) */
:root[data-card-style] .pc-tray-row{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;
  grid-template-areas:"kind act" "title act" "meta act" "far far";column-gap:12px;row-gap:1px;align-items:center;
  min-height:var(--pb-hit);padding:8px 12px;border-top-color:var(--cs-line)}
:root[data-card-style] .pc-tray-row:hover{background:var(--cs-acc-soft)}
:root[data-card-style] .pc-tray-kind{grid-area:kind;font-family:var(--cs-fm,inherit);font-weight:600;font-size:var(--pb-fs-md);letter-spacing:.06em;color:var(--cs-acc-t)}
:root[data-card-style] .pc-tray-title{grid-area:title;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
:root[data-card-style] .pc-tray-meta{grid-area:meta;gap:0 8px;font-size:var(--pb-fs-md)}
:root[data-card-style] .pc-tray-actions{grid-area:act;margin-left:0}
:root[data-card-style] .pc-tray-far{grid-area:far;font-size:var(--pb-fs-md)}
:root[data-card-style] .pc-tray-row .pc-btn{position:static;min-height:28px;padding:0 10px}
:root[data-card-style] .pc-tray-row .pc-btn::before{top:0;bottom:0;left:0;right:0}
:root[data-card-style] .pc-tray-empty,:root[data-card-style] .pc-tray-foot{padding:6px 12px;font-size:var(--pb-fs-md)}
:root[data-card-style] .pc-tray-meta,:root[data-card-style] .pc-tray-far,:root[data-card-style] .pc-tray-empty,:root[data-card-style] .pc-tray-foot{color:var(--cs-muted)}
:root[data-card-style] .pc-tray-strip{border:1px solid var(--cs-acc2);border-radius:var(--cs-r);background:var(--cs-card);color:var(--cs-ink);font-family:var(--cs-fb,inherit)}

/* ---- phone layout (portal standard query; replaces the old cards.css 480px card rule) ---- */
@media (max-width:1024px),(pointer:coarse){
  :root[data-card-style] .msg-ai:has(.pc-card){width:100%;max-width:100%}
  :root[data-card-style] .msg-ai:has(.pc-card) > .msg-content{flex:1 1 auto}
  :root[data-card-style] .msg-ai:has(.pc-card) > .msg-avatar{display:none}
  :root[data-card-style] .msg-ai .msg-bubble:has(.pc-card){overflow:visible}
  :root[data-card-style] .msg-content:has(.pc-card){overflow:visible}
  :root[data-card-style] .pc-card{width:100%;max-width:none;padding:10px;grid-template-columns:minmax(0,1fr) auto}
  :root[data-card-style] .pc-prompt{font-size:15px}
  :root[data-card-style] .pc-label{font-size:14px}
  :root[data-card-style] .pc-btn{min-height:var(--pb-tap);padding:0 14px}
  :root[data-card-style] .pc-btn::before{display:none}
  :root[data-card-style] .pc-ctl{gap:8px}
  :root[data-card-style] .pc-status:empty{display:none}
  :root[data-card-style] .pc-detail{max-height:40dvh}
  :root[data-card-style] .pc-ask-line .pc-ask-field{height:44px;min-height:44px}
  :root[data-card-style] .pc-card > .pc-note-label{grid-column:1 / -1;margin-right:0;line-height:1.4}
  :root[data-card-style] .pc-card > .pc-note{grid-column:1;margin-top:4px;height:44px;min-height:44px;padding:10px}
  :root[data-card-style] .pc-card > .pc-note:focus{height:88px}
  :root[data-card-style] .pc-card > .pc-note + .pc-actions{grid-column:2;margin-top:4px}
  :root[data-card-style] .pc-form .pc-field-input{min-height:44px}
  :root[data-card-style] .pc-line-chart{height:56px}
  /* the strip becomes a floating pill over the bottom right of the chat list; it takes no height */
  :root[data-card-style] .pc-tray-strip{position:relative;z-index:5;height:0;min-height:0;margin:0;padding:0 12px;
    border:0;border-radius:0;background:none;box-shadow:none;justify-content:flex-end;align-items:flex-end;gap:0;overflow:visible;pointer-events:none}
  :root[data-card-style] .pc-tray-strip > *{pointer-events:auto;margin-bottom:10px;box-shadow:var(--cs-tray-shadow)}
  :root[data-card-style] .pc-tray-strip-text{flex:0 0 auto;display:inline-flex;align-items:center;height:44px;padding:0 10px 0 16px;
    border-radius:22px 0 0 22px;background:var(--cs-acc);color:var(--cs-on-acc);font-size:var(--pb-fs-base);font-weight:700;cursor:pointer}
  :root[data-card-style] .pc-tray-strip .pc-primary{border-radius:0 22px 22px 0;padding:0 16px 0 10px;border-left:1px solid rgba(4,19,28,.25)}
  :root[data-card-style] .pc-tray-strip .pc-secondary{width:44px;margin-left:8px;padding:0;border-radius:50%;background:var(--cs-card);border-color:var(--cs-ls)}
  :root[data-card-style] .chat-area:has(.pc-tray-strip:not([hidden])) .chat-messages{padding-bottom:64px}
  /* the sheet: 60dvh, above the tab bar and the safe area, with a grabber */
  :root[data-card-style] .pc-tray.pc-tray-sheet{bottom:calc(56px + env(safe-area-inset-bottom, 0px));width:auto;max-width:640px;max-height:60dvh;
    margin-inline:auto;border-radius:16px 16px 0 0}
  :root[data-card-style] .pc-tray.pc-tray-sheet::before{content:"";display:block;width:36px;height:4px;margin:8px auto 6px;border-radius:2px;background:var(--cs-ls)}
  :root[data-card-style] .pc-tray-sheet .pc-tray-title{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  :root[data-card-style] .pc-tray-row{padding:10px 12px}
  :root[data-card-style] .pc-tray-row .pc-btn{min-height:var(--pb-tap)}
  :root[data-card-style] .pc-tray-top .pc-btn{min-height:var(--pb-tap);min-width:var(--pb-tap)}
}

/* ---- Settings > Chat > Card style: picker with a preview swatch per style (no fonts loaded) ---- */
.pc-cs-group{margin:0;padding:0;border:0;min-width:0}
.pc-cs-group legend{padding:0;margin-bottom:8px}
.pc-cs-opts{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px}
.pc-cs-opt{position:relative;display:flex;align-items:center;gap:10px;min-height:56px;padding:8px 12px;border:1px solid var(--pb-border-hover);
  border-radius:10px;background:var(--pb-surface);color:var(--pb-text);cursor:pointer}
.pc-cs-opt:has(input:checked){border-color:var(--pb-blue);box-shadow:inset 0 0 0 1px var(--pb-blue)}
.pc-cs-opt input{flex:0 0 auto;width:20px;height:20px;margin:0;accent-color:var(--pb-blue);cursor:pointer}
.pc-cs-opt input:focus-visible{outline:3px solid var(--pb-blue);outline-offset:2px}
.pc-cs-name{display:block;font-weight:600}
.pc-cs-sub{display:block;font-size:11px;color:var(--pb-text-muted)}
.pc-cs-msg{margin-top:6px;font-size:12px;color:var(--pb-text-muted)}
.pc-cs-msg:empty{display:none}
.pc-cs-swatch{flex:0 0 auto;display:block;width:46px;height:34px;padding:4px;box-sizing:border-box;border-radius:var(--cs-rs);background:var(--cs-card-2);
  border:1px solid var(--cs-ls)}
.pc-cs-sw-card{display:flex;flex-direction:column;gap:3px;height:100%;padding:3px;box-sizing:border-box;border-radius:calc(var(--cs-rs) - 2px);background:var(--cs-card)}
.pc-cs-sw-card i{display:block;height:3px;border-radius:2px;background:var(--cs-ink)}
.pc-cs-sw-card i+i{width:60%;background:var(--cs-muted)}
.pc-cs-sw-card b{display:block;width:16px;height:6px;margin-top:auto;margin-left:auto;border-radius:var(--cs-rb);background:linear-gradient(135deg,var(--cs-go-a),var(--cs-go-b))}
.pc-cs-swatch[data-card-style="ledger"] .pc-cs-sw-card{box-shadow:inset 0 2px 0 var(--cs-ink)}
.pc-cs-swatch[data-card-style="afterburn"] .pc-cs-sw-card{box-shadow:inset 0 0 0 1px var(--cs-edge1,var(--cs-line))}

/* ---- motion: only when allowed ---- */
@media (prefers-reduced-motion: no-preference){
  :root[data-card-style] .pc-btn{transition:transform .12s ease,background-color .16s ease,border-color .16s ease,box-shadow .2s ease,color .16s ease}
  :root[data-card-style] .pc-btn:active:not(:disabled){transform:translateY(1px) scale(.97)}
  :root[data-card-style] .pc-choice .pc-option{transition:border-color .16s,background-color .16s,box-shadow .2s}
  :root[data-card-style] .pc-tray-btn{transition:background-color .16s,transform .12s}
  :root[data-card-style] .pc-tray-btn:active{transform:scale(.97)}
  :root[data-card-style] .pc-detail:not([hidden]){animation:pc-cs-drop .22s ease-out}
  :root[data-card-style] .pc-tray:not([hidden]){animation:pc-cs-pop var(--pb-dur-fast) ease-out}
  :root[data-card-style] .pc-bar-fill{animation:pc-cs-grow .7s cubic-bezier(.2,.8,.2,1) both}
}
@media (prefers-reduced-motion: reduce){
  :root[data-card-style] .pc-card,:root[data-card-style] .pc-card *,:root[data-card-style] .pc-card *::before,:root[data-card-style] .pc-card *::after,
  :root[data-card-style] .pc-tray,:root[data-card-style] .pc-tray *,:root[data-card-style] .pc-tray-btn,:root[data-card-style] .pc-tray-strip,
  :root[data-card-style] .pc-tray-strip *,.pc-cs-opt{transition:none!important;animation:none!important}
}
@keyframes pc-cs-drop{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@keyframes pc-cs-pop{from{opacity:0;transform:scale(.96)}to{opacity:1;transform:none}}
@keyframes pc-cs-grow{from{transform:scale(0,1)}to{transform:none}}
