/* ==========================================================================
   Paradigm admin shell + the bridge that re-themes the existing Ant pages.

   Loaded by app/Views/header.php after antd-*.css and paradigm.css.

   1. Bridge: the old pages style themselves through --ant-* variables (and
      antd-*.css reads the same ones). Pointing those at the Paradigm tokens
      re-themes every existing page without touching its markup. Pages are
      moved to the p-* components one by one (task-4.x); when the last one is
      done, the bridge and antd-*.css go.
   2. Shell: sidebar, mobile top bar, customer search.

   Theme: light by default; each user can pick dark or the device's under
   Profile → Appearance (UiTheme, data-theme in header.php). The old pages
   still carry inline light colours: section 3 repaints the common inline
   backgrounds in dark, not every one.
   ========================================================================== */

/* Text size (Profile → Appearance → Text size, UiTheme::TEXTS): the root is
   14 px by default (.p-root: 0.875rem of the initial 16); every --p-text-* token
   is rem, so the whole modern UI and the chat follow. Legacy Ant pages size in
   px and stay as they are. */
:root.p-root[data-text="small"] { font-size: 13px; }
:root.p-root[data-text="large"] { font-size: 15px; }
:root.p-root[data-text="larger"] { font-size: 16px; }
/* The chat on a phone is read at arm's length and hit with a thumb (Filip,
   2026-11-06: zoomed in on every message, then out again for Send). Two px up
   from each step, so "Default" is 16 and "Larger" 18. Only /chat: the admin
   pages' tables have no room for it. */
@media (max-width: 767px) {
  :root.p-root:has(body.tc-page) { font-size: 16px; }
  :root.p-root[data-text="small"]:has(body.tc-page) { font-size: 15px; }
  :root.p-root[data-text="large"]:has(body.tc-page) { font-size: 17px; }
  :root.p-root[data-text="larger"]:has(body.tc-page) { font-size: 18px; }
}

/* ---------- 1. Bridge ---------- */
:root.p-root {
  --ant-primary-color: var(--accent);
  --ant-primary-color-hover: var(--accent-hover);
  --ant-primary-color-active: var(--accent-ink);
  --ant-color-primary: var(--accent);
  --ant-color-link: var(--p-accent-text);
  --ant-color-text: var(--p-ink);
  --ant-color-text-secondary: var(--p-muted);
  --ant-color-text-tertiary: var(--p-muted);
  --ant-color-text-quaternary: var(--p-border-strong);
  --ant-color-bg-base: var(--p-bg);
  --ant-color-bg-layout: var(--p-bg);
  --ant-color-bg-container: var(--p-surface);
  --ant-color-bg-elevated: var(--p-surface);
  --ant-color-border: var(--p-border);
  --ant-color-border-secondary: var(--p-border);
  --ant-color-split: var(--p-border);
  --ant-color-fill-quaternary: var(--p-surface-sunken);
  --ant-error-color: var(--p-danger);
  --ant-color-error: var(--p-danger);
  --ant-success-color: var(--p-success);
  --ant-warning-color: var(--p-warning);
  --ant-info-color: var(--p-info);
  --ant-font-family: var(--p-font-ui);
  --ant-border-radius-xs: var(--p-radius-sm);
  --ant-border-radius-sm: var(--p-radius-sm);
  --ant-border-radius: var(--p-radius-lg);
  --ant-border-radius-lg: var(--p-radius-lg);
  --ant-border-radius-xl: var(--p-radius-lg);
  --ant-box-shadow: var(--p-shadow-sm);
  --ant-box-shadow-secondary: var(--p-shadow-md);
  --ant-box-shadow-lg: var(--p-shadow-md);
}

.p-root body {
  font-family: var(--p-font-ui);
  color: var(--p-body);
  background: var(--p-bg);
  font-size: var(--p-text-md);
  line-height: var(--p-leading);
  -webkit-font-smoothing: antialiased;
}

/* paradigm.css zeroes p margins under .p-root; the old pages rely on them. */
.p-legacy p { margin: 0 0 0.75em; }
.p-legacy p:last-child { margin-bottom: 0; }
.p-legacy h1, .p-legacy h2, .p-legacy h3 { margin: 0 0 0.6em; }
.p-legacy h1 { font-family: var(--p-font-display); font-weight: 400; font-size: var(--p-text-2xl); letter-spacing: -0.01em; }
.p-legacy h2 { font-family: var(--p-font-display); font-weight: 400; font-size: var(--p-text-xl); }
.p-legacy h3 { font-size: var(--p-text-lg); font-weight: var(--p-weight-semibold); }

/* Their containers had their own max width and gutters; the shell owns those now. */
.p-legacy .ant-container,
.p-legacy .container,
.p-legacy .container-fluid { max-width: none; padding-left: 0; padding-right: 0; margin: 0; width: auto; }

/* Cards: hairline, no shadow — the Aednan way. */
.p-legacy .ant-card { border: 1px solid var(--p-border); box-shadow: none; border-radius: var(--p-radius-lg); background: var(--p-surface); }
.p-legacy .ant-card-head {
  border-bottom: 1px solid var(--p-border);
  min-height: 52px;
  padding: var(--p-space-3) var(--p-space-5);
  display: flex;
  align-items: center;
}
.p-legacy .ant-card-head > .ant-card-head-wrapper { flex: 1; min-width: 0; }
.p-legacy .ant-card-body { padding: var(--p-space-5); }
/* Cards stacked in a column (customer page, dashboards) had no space between
   them: the old layout relied on a margin the shell's reset removed. */
.p-legacy .ant-card ~ .ant-card { margin-top: var(--p-space-4); } /* ~ not +: each card is preceded by its own <style> */
.p-legacy .ant-col { min-width: 0; }
@media (max-width: 640px) {
  .p-legacy .ant-card-head { padding: var(--p-space-3) var(--p-space-4); }
  .p-legacy .ant-card-body { padding: var(--p-space-4); }
}
.p-legacy .ant-card-head-title { font-size: var(--p-text-lg); font-weight: var(--p-weight-semibold); color: var(--p-ink); }

/* Buttons */
.p-legacy .ant-btn {
  font-family: var(--p-font-ui);
  font-weight: var(--p-weight-medium);
  border-radius: var(--p-radius);
  box-shadow: none;
  transition: background var(--p-duration), border-color var(--p-duration), color var(--p-duration);
}
.p-legacy .ant-btn:not(.ant-btn-primary):not(.ant-btn-dangerous):not(.ant-btn-danger):not(.ant-btn-link):not(.ant-btn-text) {
  border-color: var(--p-border-strong);
  color: var(--p-ink);
  background: var(--p-surface);
}
.p-legacy .ant-btn:not(.ant-btn-primary):not(.ant-btn-dangerous):not(.ant-btn-danger):not(.ant-btn-link):not(.ant-btn-text):hover {
  border-color: var(--p-ink);
  background: var(--p-surface-sunken);
}
.p-legacy .ant-btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.p-legacy .ant-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }

/* Fields */
.p-legacy .ant-input,
.p-legacy .ant-select,
.p-legacy .ant-input-number,
.p-legacy textarea.ant-input,
.p-legacy .form-control,
.p-legacy .form-select {
  border-color: var(--p-border-strong);
  border-radius: var(--p-radius);
  background: var(--p-field-bg);
  color: var(--p-ink);
  font-family: var(--p-font-ui);
}
.p-legacy .ant-input:focus,
.p-legacy .ant-select:focus,
.p-legacy .form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--p-accent-soft, rgba(0, 0, 0, 0.08));
  outline: none;
}

/* Tables */
.p-legacy .ant-table,
.p-legacy table.ant-table { font-variant-numeric: tabular-nums; }
.p-legacy .ant-table thead th,
.p-legacy .ant-table-thead > tr > th {
  background: var(--p-surface-sunken);
  color: var(--p-muted);
  font-size: var(--p-text-xs);
  font-weight: var(--p-weight-semibold);
  letter-spacing: var(--p-tracking-caps);
  text-transform: uppercase;
  border-bottom: 1px solid var(--p-border);
}
/* Tables never clip. antd_table.php sets overflow-x: hidden on its wrapper,
   which cut the last column off (half a "Refund" button) whenever a table was
   wider than its card. Scroll inside the card instead, and let row actions
   wrap onto a second line before it comes to that. */
.p-legacy .ant-table-wrapper { overflow-x: auto !important; } /* beats antd-overrides.css */
.p-legacy .ant-table td > .ant-flex { flex-wrap: wrap; row-gap: 6px; }
.p-legacy .ant-table .ant-btn-sm { white-space: nowrap; }
.p-legacy .ant-table tbody tr:hover > td { background: color-mix(in srgb, var(--p-surface-sunken) 60%, transparent); }

/* Tags and alerts keep their semantic colours but lose the candy look. */
.p-legacy .ant-tag { border-radius: var(--p-radius-pill); font-weight: var(--p-weight-medium); }
.p-legacy .ant-alert { border-radius: var(--p-radius-lg); }

/* ---------- Stat tiles (dashboards) ----------
   One neutral look for key figures: surface, hairline, muted caps label,
   big tabular number. Replaces the pastel Ant tiles (green/blue/purple/
   orange) the old dashboards coloured by hand. */
.p-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--p-space-3); }
.p-root .p-stat {
  background: var(--p-surface-sunken);
  border: 1px solid transparent;
  border-radius: var(--p-radius-lg);
  padding: var(--p-space-4) var(--p-space-5);
  min-width: 0;
}
.p-stat__label { font-size: 11px; font-weight: var(--p-weight-medium); letter-spacing: 0.06em; text-transform: uppercase; color: var(--p-muted); margin-bottom: var(--p-space-1); }
.p-stat__value { font-family: var(--p-font-display); font-size: 2rem; font-weight: var(--p-weight-regular); color: var(--p-ink); line-height: 1.15; font-variant-numeric: lining-nums tabular-nums; letter-spacing: -0.015em; margin-top: var(--p-space-1); }
.p-stat__value--empty { font-size: var(--p-text-md); font-weight: var(--p-weight-regular); color: var(--p-muted); }
.p-stat__sub { font-size: var(--p-text-sm); color: var(--p-muted); margin-top: 2px; }
.p-stat__note { font-size: var(--p-text-xs); color: var(--p-muted); margin-top: var(--p-space-2); line-height: 1.4; }

/* Targets of the Home sub-items in the sidebar: land a little below the top
   (and below the sticky top bar on phones). */
.p-anchor, .p-anchor-target { scroll-margin-top: var(--p-space-5); }
.p-anchor { display: block; height: 0; }
@media (max-width: 960px) { .p-anchor, .p-anchor-target { scroll-margin-top: 68px; } }
html.p-root { scroll-behavior: smooth; }
/* "View as" banner (shell_open.php, StaffImpersonation) */
.p-viewas {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between; gap: var(--p-space-4); flex-wrap: wrap;
  margin: 0 0 var(--p-space-5); padding: var(--p-space-3) var(--p-space-5);
  background: #fff4d6; border: 1px solid #e9c46a; border-radius: var(--p-radius-lg);
  color: #5a4300; font-size: var(--p-text-sm);
}

/* Passkey nudge (shell_open.php) */
.p-passkey-nudge {
  display: flex; align-items: center; gap: var(--p-space-4);
  margin-bottom: var(--p-space-5); padding: var(--p-space-4) var(--p-space-5);
  background: var(--p-surface); border: 1px solid var(--p-border); border-left: 3px solid var(--accent);
  border-radius: var(--p-radius-lg); color: var(--p-ink);
}
.p-passkey-nudge > svg { flex: none; color: var(--accent-ink, var(--accent)); }
.p-passkey-nudge__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: var(--p-text-sm); }
.p-passkey-nudge__text span { color: var(--p-muted); }
.p-passkey-nudge__error:empty { display: none; }
.p-passkey-nudge__error { color: var(--p-danger) !important; }
.p-passkey-nudge__actions { display: flex; gap: var(--p-space-2); flex: none; }
.p-passkey-nudge.is-done { border-left-color: var(--p-success); }
@media (max-width: 640px) {
  .p-passkey-nudge { flex-wrap: wrap; }
  .p-passkey-nudge__actions { width: 100%; }
  .p-passkey-nudge__actions .p-btn { flex: 1; }
}

/* ---------- 5. Subscribers (Campaigns → Subscribers) ---------- */
.p-sub__layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: var(--p-space-5); align-items: start; }
@media (max-width: 1100px) { .p-sub__layout { grid-template-columns: minmax(0, 1fr); } }
.p-sub__dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--p-space-2) var(--p-space-4); margin: 0; font-size: var(--p-text-sm); }
.p-sub__dl dt { color: var(--p-muted); }
.p-sub__dl dd { margin: 0; color: var(--p-ink); overflow-wrap: anywhere; }
.p-root a.p-sub__tag {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border: 1px solid var(--p-border); border-radius: var(--p-radius-pill);
  background: var(--p-surface-sunken); color: var(--p-body);
  font-size: var(--p-text-xs); text-decoration: none;
}
.p-sub__timeline { list-style: none; margin: 0; padding: 0; max-height: 440px; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--p-border); }
.p-sub__event { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: var(--p-space-3); padding: 9px var(--p-space-5); border-bottom: 1px solid var(--p-border); font-size: var(--p-text-sm); color: var(--p-ink); }
.p-sub__event:last-child { border-bottom: 0; }
.p-sub__event time { color: var(--p-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.p-sub__event time span { margin-left: 6px; font-size: var(--p-text-xs); }
.p-sub__event.is-mail, .p-sub__event.is-mail a { color: var(--p-muted); }
.p-sub__what { overflow-wrap: anywhere; }
.p-sub__count { margin-left: 6px; font-size: var(--p-text-xs); color: var(--p-muted); }
@media (max-width: 600px) { .p-sub__event { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 9px var(--p-space-4); } }
.p-tags__layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: var(--p-space-5); align-items: start; }
@media (max-width: 1000px) { .p-tags__layout { grid-template-columns: minmax(0, 1fr); } }
.p-tags__search { padding: var(--p-space-3) var(--p-space-4); border-bottom: 1px solid var(--p-border); }
.p-tags__search .p-input { flex: 1; min-width: 0; max-width: 360px; height: var(--p-control-h-sm); }
.p-tags__emails { min-height: 96px; height: auto; padding: 8px 12px; font-family: inherit; resize: vertical; }
.p-tags__pager { padding: var(--p-space-3) var(--p-space-4); }
.p-contacts__filters { padding: var(--p-space-4); display: flex; flex-direction: column; gap: var(--p-space-3); }
.p-contacts__search { display: flex; gap: var(--p-space-2); }
.p-contacts__search .p-input { flex: 1; min-width: 0; }
.p-contacts__selects { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--p-space-3); }
.p-contacts__select { display: flex; flex-direction: column; gap: 4px; min-width: 150px; font-size: var(--p-text-xs); color: var(--p-muted); }
.p-contacts__select--wide { flex: 1; min-width: 200px; max-width: 360px; }
.p-contacts__select .p-select { width: 100%; }
.p-contacts__clear { margin-left: auto; }
.p-contacts__email { overflow-wrap: anywhere; }
.p-contacts__kinds { gap: 4px; }
.p-sub__kind { display: inline-block; padding: 1px 8px; border-radius: var(--p-radius-pill); background: var(--p-surface-sunken); font-size: var(--p-text-xs); color: var(--p-body); white-space: nowrap; }
.p-root a.p-sub__tag:hover { border-color: var(--accent); color: var(--p-ink); }

@media (prefers-reduced-motion: reduce) { html.p-root { scroll-behavior: auto; } }

/* Dashboard "Worth noting" rows. */
.p-root .p-noting-row { display: flex; align-items: center; gap: var(--p-space-3); padding: var(--p-space-2) var(--p-space-3); background: var(--p-surface); border: 1px solid var(--p-border); border-radius: var(--p-radius); flex-wrap: wrap; }
.p-noting-row .p-badge { margin-right: var(--p-space-1); }

/* Toolbar: filters on the left, secondary actions on the right. */
.p-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--p-space-2) var(--p-space-3); margin-bottom: var(--p-space-5); }
.p-toolbar__actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--p-space-2); }
.p-root .p-toolbar .p-select { width: auto; min-width: 160px; max-width: 260px; height: var(--p-control-h-sm); }

/* ---------- 2. Shell ---------- */
.p-shell {
  --p-sidebar-w: 248px;
  min-height: 100vh;
}

.p-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--p-sidebar-w);
  display: flex;
  flex-direction: column;
  background: var(--p-surface);
  border-right: 1px solid var(--p-border);
  z-index: 200;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.p-sidebar__head {
  display: flex;
  flex-direction: column;
  gap: var(--p-space-3);
  padding: var(--p-space-4) var(--p-space-4) var(--p-space-3);
}

.p-company {
  display: flex;
  align-items: center;
  gap: var(--p-space-3);
  text-decoration: none;
  color: var(--p-ink);
  min-width: 0;
}
.p-root a.p-company { color: var(--p-ink); text-decoration: none; }
.p-company__logo {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: var(--p-radius-lg);
  background: var(--accent);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.p-company__logo img { width: 22px; height: 22px; object-fit: contain; filter: brightness(0) invert(1); }
.p-company__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.p-company__name { font-family: var(--p-font-display); font-size: var(--p-text-lg); color: var(--p-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-company__product { font-size: var(--p-text-xs); letter-spacing: var(--p-tracking-caps); text-transform: uppercase; color: var(--p-muted); }

/* Company switcher: a disclosure, no JS */
.p-switch { position: relative; }
.p-switch__current {
  display: flex; align-items: center; gap: var(--p-space-2);
  height: var(--p-control-h-sm); padding: 0 var(--p-space-3);
  border: 1px solid var(--p-border); border-radius: var(--p-radius);
  background: var(--p-surface); color: var(--p-ink);
  font-size: var(--p-text-sm); font-weight: var(--p-weight-medium);
  cursor: pointer; list-style: none; user-select: none;
  transition: border-color .15s, background .15s;
}
.p-switch__current::-webkit-details-marker { display: none; }
/* The company row is the switcher: no box until you point at it */
.p-switch__current.p-company {
  height: auto; padding: 6px; margin: -6px;
  border-color: transparent; background: none;
  font-size: inherit; font-weight: inherit;
}
.p-switch__current.p-company:hover, .p-switch[open] .p-switch__current.p-company { background: var(--p-surface-sunken); border-color: transparent; }
.p-switch__current.p-company .p-switch__chevron { margin-left: auto; }
.p-switch__current:hover { border-color: var(--p-border-strong); }
.p-switch__current:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--p-accent-soft, rgba(0,0,0,.08)); }
.p-switch__hint { margin-left: auto; font-size: var(--p-text-xs); font-weight: var(--p-weight-regular); color: var(--p-muted); }
.p-switch__chevron { color: var(--p-muted); transition: transform .15s; }
.p-switch[open] .p-switch__chevron { transform: rotate(180deg); }
.p-switch__dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--p-border-strong); }
.p-switch__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-switch__menu {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px);
  display: flex; flex-direction: column; padding: 4px;
  background: var(--p-surface); border: 1px solid var(--p-border);
  border-radius: var(--p-radius-lg); box-shadow: 0 8px 24px rgba(20, 20, 20, .10);
}
.p-switch__option {
  display: flex; align-items: center; gap: var(--p-space-2); width: 100%;
  padding: 7px var(--p-space-3); border: 0; border-radius: var(--p-radius);
  background: none; color: var(--p-ink); font: inherit; font-size: var(--p-text-sm);
  text-align: left; cursor: pointer;
}
button.p-switch__option:hover, button.p-switch__option:focus-visible { background: var(--p-surface-sunken); outline: none; }
.p-switch__option.is-current { font-weight: var(--p-weight-medium); cursor: default; }
.p-switch__option.is-current svg { margin-left: auto; color: var(--accent-ink, var(--accent)); }
.p-switch__option.is-disabled { color: var(--p-muted); cursor: not-allowed; }

/* Customer search */
.p-search { position: relative; }
.p-search__input {
  width: 100%;
  height: var(--p-control-h-sm);
  padding: 0 var(--p-space-3) 0 30px;
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius);
  background: var(--p-bg);
  color: var(--p-ink);
  font: inherit;
  font-size: var(--p-text-sm);
}
.p-search__input::placeholder { color: var(--p-muted); }
.p-search__input:focus { outline: none; border-color: var(--accent); background: var(--p-field-bg); box-shadow: 0 0 0 3px var(--p-accent-soft, rgba(0,0,0,.08)); }
.p-search__icon { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: var(--p-muted); pointer-events: none; }
.p-search__results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: max(100%, 300px);
  max-height: 60vh;
  overflow-y: auto;
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-lg);
  box-shadow: var(--p-shadow-md);
  z-index: 300;
}
.p-search__results[hidden] { display: none; }
.p-search__result {
  display: block;
  padding: var(--p-space-2) var(--p-space-3);
  border-bottom: 1px solid var(--p-border);
  color: var(--p-ink);
  text-decoration: none;
}
.p-root a.p-search__result { color: var(--p-ink); text-decoration: none; }
.p-search__result:last-child { border-bottom: 0; }
.p-search__result:hover,
.p-search__result[aria-selected="true"] { background: var(--p-surface-sunken); }
.p-search__result-name { font-weight: var(--p-weight-medium); display: block; }
.p-search__result-meta { font-size: var(--p-text-xs); color: var(--p-muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-search__empty { padding: var(--p-space-3); font-size: var(--p-text-sm); color: var(--p-muted); }

/* Nav */
.p-nav { flex: 1; padding: var(--p-space-2) var(--p-space-3) var(--p-space-4); display: flex; flex-direction: column; gap: var(--p-space-4); }
.p-nav__group { display: flex; flex-direction: column; gap: 2px; }
.p-nav__label {
  padding: 0 var(--p-space-2) var(--p-space-1);
  font-size: 0.6875rem;
  font-weight: var(--p-weight-semibold);
  letter-spacing: var(--p-tracking-caps);
  text-transform: uppercase;
  color: var(--p-muted);
}
.p-nav__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--p-space-3);
  min-height: 34px;
  padding: 0 var(--p-space-2);
  border-radius: var(--p-radius);
  color: var(--p-body);
  font-size: var(--p-text-md);
  text-decoration: none;
  transition: background var(--p-duration), color var(--p-duration);
}
.p-root a.p-nav__item { color: var(--p-body); text-decoration: none; }
.p-nav__item svg { flex: none; color: var(--p-muted); transition: color var(--p-duration); }
.p-root a.p-nav__item:hover { background: var(--p-surface-sunken); color: var(--p-ink); }
.p-nav__item:hover svg { color: var(--p-ink); }
.p-root a.p-nav__item[aria-current="page"] {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--p-ink);
  font-weight: var(--p-weight-medium);
}
.p-nav__item[aria-current="page"] svg { color: var(--accent-ink); }
.p-nav__item[aria-current="page"]::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 7px;
  bottom: 7px;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: var(--accent);
}

/* Sub-items (Venues under Programs, Event tag pages under Events): indented
   under the parent's label, a hairline guide on the left. */
.p-root a.p-nav__item--child {
  min-height: 30px;
  margin-left: calc(var(--p-space-2) + 18px + var(--p-space-3) - var(--p-space-2));
  padding-left: var(--p-space-3);
  border-left: 1px solid var(--p-border);
  border-radius: 0 var(--p-radius) var(--p-radius) 0;
  font-size: var(--p-text-sm);
  color: var(--p-muted);
}
.p-root a.p-nav__item--child[aria-current="page"] { color: var(--p-ink); border-left-color: var(--accent); }
.p-nav__item--child[aria-current="page"]::before { display: none; }
.p-root a.p-nav__item.is-open:not([aria-current="page"]) { color: var(--p-ink); }
/* A parent with sub-items, closed: a quiet chevron says there is more inside */
.p-nav__more { margin-left: auto; opacity: 0; transition: opacity var(--p-duration); }
.p-nav__item:hover .p-nav__more { opacity: 1; }
.p-nav__item.is-open .p-nav__more { display: none; }

.p-sidebar__foot {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  border-top: 1px solid var(--p-border);
  padding: var(--p-space-2) var(--p-space-3);
  background: inherit; /* the column's own colour, whichever rule paints it */
}
/* The user is a button: Staff & roles, Settings, Profile and Log out open above it */
.p-account { position: relative; }
.p-user { display: flex; align-items: center; gap: var(--p-space-3); padding: var(--p-space-2); min-width: 0; border-radius: var(--p-radius); cursor: pointer; list-style: none; transition: background var(--p-duration); }
.p-user::-webkit-details-marker { display: none; }
.p-user:hover, .p-account[open] .p-user { background: var(--p-surface-sunken); }
.p-user.is-active { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.p-user:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--p-accent-soft, rgba(0,0,0,.08)); }
.p-account__chevron { margin-left: auto; flex: none; color: var(--p-muted); transition: transform .15s; }
.p-account[open] .p-account__chevron { transform: rotate(180deg); }
.p-account__menu {
  position: absolute; z-index: 30; left: 0; right: 0; bottom: calc(100% + 6px);
  display: flex; flex-direction: column; gap: 2px; padding: 4px;
  background: var(--p-surface); border: 1px solid var(--p-border);
  border-radius: var(--p-radius-lg); box-shadow: 0 -8px 24px rgba(20, 20, 20, .12);
}
.p-account__menu .p-nav__item[aria-current="page"]::before { display: none; }
.p-account__rule { margin: 4px 6px; border: 0; border-top: 1px solid var(--p-border); }
.p-user__avatar {
  width: 28px; height: 28px; flex: none;
  border-radius: 50%;
  background: var(--p-surface-sunken);
  border: 1px solid var(--p-border);
  display: grid; place-items: center;
  font-size: var(--p-text-xs); font-weight: var(--p-weight-semibold); color: var(--p-ink);
  text-transform: uppercase;
}
.p-user__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.p-user__name { color: var(--p-ink); font-weight: var(--p-weight-medium); font-size: var(--p-text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-user__role { color: var(--p-muted); font-size: var(--p-text-xs); }

/* Main */
/* `main.p-main` outranks antd-overrides.css's bare `main` rule (a white,
   shadowed, 24px-inset box — the old layout's page frame). */
.p-root main.p-main {
  margin: 0 0 0 var(--p-sidebar-w);
  min-width: 0;
  min-height: 100vh;
  padding: var(--p-space-6) var(--p-space-6) var(--p-space-8);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}
.p-main__inner { max-width: 1280px; margin: 0 auto; }
.p-flash { margin-bottom: var(--p-space-4); }

.p-env {
  margin-top: var(--p-space-8);
  font-size: var(--p-text-xs);
  color: var(--p-muted);
  display: flex;
  gap: var(--p-space-4);
}
.p-env p { margin: 0; }

/* Mobile top bar (hidden on desktop) */
.p-topbar { display: none; }

/* Back, only when Paradigm runs as an installed app (html.p-standalone,
   paradigm-shell.js): the sidebar's head on desktop, the top bar on a phone */
.p-back { display: none; }
.p-back[hidden] { display: none !important; } /* nothing behind the window: stays hidden */
/* The sidebar's top row: the back button, then Business | Communication.
   Without the chat (consultants) the row is only the button, so it shows
   only when the button does. */
.p-sidebar__top { display: flex; align-items: center; gap: 4px; }
.p-sidebar__top > .p-mode { flex: 1; min-width: 0; }
.p-sidebar__top:not(:has(.p-mode)) { display: none; }
.p-standalone .p-sidebar__top:not(:has(.p-mode)):has(.p-back:not([hidden])) { display: flex; }
.p-standalone .p-sidebar__back:not([hidden]) {
  display: grid; place-items: center; flex: none;
  width: 28px; height: 32px; margin-left: -10px;
  border: 0; border-radius: var(--p-radius); background: transparent;
  color: var(--p-muted); cursor: pointer;
  transition: background var(--p-duration), color var(--p-duration);
}
.p-standalone .p-sidebar__back:hover { background: var(--p-surface-sunken); color: var(--p-ink); }

.p-skip {
  position: absolute; left: -9999px; top: 8px; z-index: 400;
  background: var(--p-surface); color: var(--p-ink); padding: var(--p-space-2) var(--p-space-3);
  border: 1px solid var(--p-border-strong); border-radius: var(--p-radius);
}
.p-skip:focus { left: 8px; }

.p-scrim { display: none; }

@media (max-width: 960px) {
  .p-topbar {
    position: sticky;
    top: 0;
    z-index: 150;
    display: flex;
    align-items: center;
    gap: var(--p-space-3);
    height: 52px;
    padding: 0 var(--p-gutter);
    background: var(--p-surface);
    border-bottom: 1px solid var(--p-border);
  }
  .p-topbar__menu {
    display: grid; place-items: center;
    width: 36px; height: 36px; margin-left: -8px;
    border: 0; background: transparent; color: var(--p-ink);
    border-radius: var(--p-radius); cursor: pointer;
  }
  .p-topbar__menu:hover { background: var(--p-surface-sunken); }
  .p-standalone .p-sidebar__back { display: none; }
  .p-standalone .p-topbar__back:not([hidden]) {
    display: grid; place-items: center;
    width: 36px; height: 36px; margin-left: calc(-1 * var(--p-space-3) + 2px);
    border: 0; background: transparent; color: var(--p-ink);
    border-radius: var(--p-radius); cursor: pointer;
  }
  .p-standalone .p-topbar__back:hover { background: var(--p-surface-sunken); }
  .p-topbar .p-company__logo { width: 26px; height: 26px; }
  .p-topbar .p-company__logo img { width: 18px; height: 18px; }

  .p-sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: none;
  }
  .p-shell.is-open .p-sidebar { transform: none; box-shadow: var(--p-shadow-md); }
  .p-shell.is-open .p-scrim {
    display: block;
    position: fixed; inset: 0; z-index: 190;
    background: rgb(17 12 10 / 0.35);
  }
  .p-root main.p-main { margin: 0; min-height: 0; padding: var(--p-space-4) var(--p-gutter) var(--p-space-7); }
  .p-legacy { overflow-x: hidden; }
  .p-legacy .table-responsive,
  .p-legacy .ant-table-wrapper { overflow-x: auto; }
}

/* ---------- 3. Staff login and other Shield pages (auth/layout.php) ---------- */
.p-root body.p-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--p-space-6) var(--p-gutter);
  background:
    radial-gradient(1200px 600px at 50% -10%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%),
    var(--p-bg);
}
.p-auth__frame { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: var(--p-space-5); }
.p-auth__brand { display: flex; align-items: center; gap: var(--p-space-3); justify-content: center; }
.p-auth__card,
.p-auth__main > .container {
  background: var(--p-surface);
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-lg);
  padding: var(--p-space-6);
  box-shadow: var(--p-shadow-sm);
}
.p-auth__card { display: flex; flex-direction: column; gap: var(--p-space-4); }
.p-auth__title { font-family: var(--p-font-display); font-weight: 400; font-size: var(--p-text-2xl); color: var(--p-ink); letter-spacing: -0.01em; }
.p-auth__lead { color: var(--p-muted); margin-top: calc(var(--p-space-3) * -1); }
.p-auth__divider { display: flex; align-items: center; gap: var(--p-space-3); color: var(--p-muted); font-size: var(--p-text-sm); }
.p-auth__divider::before, .p-auth__divider::after { content: ''; flex: 1; height: 1px; background: var(--p-border); }
.p-auth__divider[hidden] { display: none; }
.p-auth__passkey { display: flex; flex-direction: column; gap: var(--p-space-2); }
.p-auth__passkey[hidden] { display: none; }
.p-auth__hint { text-align: center; font-size: var(--p-text-sm); color: var(--p-muted); }
.p-auth__members { text-align: center; font-size: var(--p-text-sm); color: var(--p-muted); }

/* Shield's stock views (magic link etc.) are Bootstrap: frame them the same way. */
.p-auth__main > .container { max-width: none; margin: 0; }
.p-auth__main > .container > .card { border: 0; box-shadow: none !important; width: 100%; max-width: none; flex: 1 1 auto; background: transparent; }
.p-auth__main > .container.p-5 { padding: var(--p-space-6) !important; }
.p-auth__main .card-body { padding: 0; }
.p-auth__main .card-title { font-family: var(--p-font-display); font-weight: 400; font-size: var(--p-text-xl); color: var(--p-ink); margin-bottom: var(--p-space-4) !important; }
.p-auth__main .btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); border-radius: var(--p-radius); }
.p-auth__main .btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.p-auth__main .form-control { border-color: var(--p-border-strong); border-radius: var(--p-radius); }
.p-auth__main .form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--p-accent-soft); }
.p-auth__main a { color: var(--p-accent-text); }

/* ---------- 4. Campaign editor (/cms/campaigns/{id}) ---------- */
.p-campaign__layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: var(--p-space-5); align-items: start; }
.p-campaign__side { position: sticky; top: var(--p-space-5); }
.p-campaign__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--p-space-4); }
.p-campaign__wide { grid-column: 1 / -1; }
.p-campaign__fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--p-space-2); min-width: 0; }
.p-campaign__fieldset[disabled] { opacity: 0.7; }
.p-campaign__checks {
  max-height: 220px; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 6px;
  padding: var(--p-space-2) var(--p-space-3);
  border: 1px solid var(--p-border); border-radius: var(--p-radius); background: var(--p-field-bg);
}
.p-campaign__checks .p-check[hidden] { display: none; }
.p-campaign__filter { height: var(--p-control-h-sm); }
.p-campaign__statuses { display: flex; flex-direction: column; gap: var(--p-space-2); }
.p-campaign__count { font-size: var(--p-text-sm); color: var(--p-muted); white-space: nowrap; }
.p-campaign__count strong { font-size: var(--p-text-xl); color: var(--p-ink); font-variant-numeric: tabular-nums; margin-right: 4px; }
.p-campaign__preview { background: #f4f1ec; padding: var(--p-space-3); display: flex; justify-content: center; }
/* The side column is narrower than a desktop mail, so the frame renders at its
   real width and is scaled down to fit (campaign-editor.js, fitPreview). */
.p-campaign__frame { position: relative; width: 100%; height: 70vh; min-height: 480px; overflow: hidden; }
.p-campaign__frame iframe { position: absolute; top: 0; left: 0; width: 640px; max-width: none; height: 100%; border: 0; background: #f4f1ec; transform-origin: 0 0; }
.p-campaign__problems { margin: 0; padding-left: 1.1em; color: var(--p-warning); font-size: var(--p-text-sm); display: flex; flex-direction: column; gap: 4px; }
.p-campaign__savebar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; justify-content: flex-end; align-items: center; gap: var(--p-space-3);
  padding: var(--p-space-3) 0; background: linear-gradient(to top, var(--p-bg) 70%, transparent);
}
.p-campaign__savebar [hidden] { display: none; }

.p-blocks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--p-space-3); }
.p-blocks__item { border: 1px solid var(--p-border); border-radius: var(--p-radius-lg); background: var(--p-bg); }
.p-blocks__head { display: flex; align-items: center; justify-content: space-between; gap: var(--p-space-2); padding: var(--p-space-1) var(--p-space-2) var(--p-space-1) var(--p-space-4); border-bottom: 1px solid var(--p-border); }
.p-blocks__type { font-size: var(--p-text-xs); font-weight: var(--p-weight-semibold); letter-spacing: var(--p-tracking-caps); text-transform: uppercase; color: var(--p-muted); }
.p-blocks__tools { display: flex; gap: 2px; }
.p-blocks__fields { padding: var(--p-space-4); display: flex; flex-direction: column; gap: var(--p-space-3); }
.p-blocks__image { border: 1px solid var(--p-border); border-radius: var(--p-radius-lg); background: var(--p-surface-sunken); padding: var(--p-space-2); display: flex; justify-content: center; }
.p-blocks__thumb { display: block; max-width: 100%; max-height: 180px; width: auto; height: auto; border-radius: var(--p-radius); }
.p-blocks__thumb[hidden], .p-blocks__thumb-empty[hidden] { display: none; }
.p-blocks__thumb-empty { padding: var(--p-space-5) var(--p-space-3); font-size: var(--p-text-sm); text-align: center; }
/* "+" between blocks (campaign-editor.js insertSlot): add right there. */
.p-blocks__insert { list-style: none; display: flex; flex-direction: column; align-items: center; gap: var(--p-space-2); margin: calc(-1 * var(--p-space-2)) 0; }
.p-blocks__insert-toggle { width: 24px; height: 24px; border-radius: 50%; border: 1px dashed var(--p-border-strong); background: var(--p-surface); color: var(--p-muted); font: inherit; font-size: 15px; line-height: 1; cursor: pointer; opacity: .55; transition: opacity .15s; }
.p-blocks__insert:hover .p-blocks__insert-toggle, .p-blocks__insert-toggle:focus-visible { opacity: 1; color: var(--p-ink); }
.p-blocks__insert-choices { display: flex; flex-wrap: wrap; gap: var(--p-space-1); justify-content: center; }
.p-blocks__insert-choices[hidden] { display: none; }
/* Drag by the head (desktop). */
.p-blocks__head.is-draggable { cursor: grab; }
.p-blocks__item.is-dragging { opacity: .45; }
.p-blocks__item.is-drop-before { box-shadow: 0 -3px 0 var(--accent); }
.p-blocks__item.is-drop-after { box-shadow: 0 3px 0 var(--accent); }
/* Background swatches (CampaignBlocks::withBackground). */
.p-campaign__bg { border: 0; padding: 0; margin: 0; }
.p-campaign__swatch { display: inline-flex; align-items: center; gap: var(--p-space-2); font-size: var(--p-text-sm); cursor: pointer; }
.p-campaign__swatch-chip { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--p-border-strong); }
.p-blocks__advanced > summary { cursor: pointer; font-size: var(--p-text-sm); color: var(--p-muted); }
.p-blocks__advanced[open] > summary { margin-bottom: var(--p-space-2); }
.p-format { display: flex; gap: 2px; margin-bottom: var(--p-space-1); }
.p-format__btn { min-width: 32px; }
.p-blocks__empty { padding: var(--p-space-4); border: 1px dashed var(--p-border-strong); border-radius: var(--p-radius-lg); text-align: center; }

@media (max-width: 1180px) {
  .p-campaign__layout { grid-template-columns: minmax(0, 1fr); }
  .p-campaign__side { position: static; }
  .p-campaign__frame { height: 560px; min-height: 0; }
}
@media (max-width: 640px) {
  .p-campaign__fields { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .p-sidebar, .p-nav__item, .p-legacy .ant-btn { transition: none; }
}

@media print {
  .p-sidebar, .p-topbar, .p-env { display: none !important; }
  .p-root main.p-main { margin: 0; padding: 0; }
}

/* Campaigns → Audiences (click-based) */
.p-aud__list { list-style: none; margin: 0; padding: 0; }
.p-aud__item { padding: var(--p-space-4) var(--p-space-5); border-top: 1px solid var(--p-border); display: grid; gap: var(--p-space-2); }
.p-aud__item:first-child { border-top: 0; }
.p-aud__head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--p-space-3); flex-wrap: wrap; }
.p-aud__desc { margin: var(--p-space-1) 0 0; font-size: var(--p-text-sm); }
.p-aud__keys { display: flex; flex-wrap: wrap; gap: var(--p-space-1); }
.p-aud__key { font-size: var(--p-text-xs); padding: 2px 6px; border-radius: var(--p-radius); background: var(--p-surface-sunken); overflow-wrap: anywhere; }
.p-aud__edit summary, .p-aud__dismissed summary { cursor: pointer; font-size: var(--p-text-sm); color: var(--p-muted); }
.p-aud__edit form { margin-top: var(--p-space-2); max-width: 520px; }

/* A red count in the sidebar (Communication's unread DMs and mentions) */
.p-nav__badge {
  margin-left: auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--p-radius-pill);
  background: var(--p-danger-fill); color: #fff;
  font-size: 11px; font-weight: var(--p-weight-semibold); line-height: 18px; text-align: center;
}
.p-nav__badge[hidden] { display: none; }

/* Paradigm's two modes, at the top of the sidebar (shell_open.php):
   Business = the picked company's admin, Communication = the team chat. */
.p-mode {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px;
  border: 1px solid var(--p-border); border-radius: var(--p-radius-lg); background: var(--p-surface-sunken);
}
.p-root a.p-mode__item {
  display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 30px; padding: 0 8px;
  border-radius: var(--p-radius); color: var(--p-muted); font-size: var(--p-text-sm); font-weight: var(--p-weight-medium);
  text-decoration: none; white-space: nowrap;
}
.p-root a.p-mode__item:hover { color: var(--p-ink); }
.p-root a.p-mode__item[aria-current="page"] { background: var(--p-surface); color: var(--p-ink); box-shadow: 0 0 0 1px var(--p-border); }
.p-mode__item .p-nav__badge { margin-left: 0; }

/* Communication: the chat's channel list is the sidebar (the app renders into #tc-nav) */
.p-nav--chat { padding-top: 0; gap: 0; }

/* The sidebar's own palette (Profile → Appearance → Sidebar; UiTheme::SIDEBARS),
   as in Slack: the window light, the column dark. shell_open.php puts
   data-theme="dark" on the aside, so every token inside it is the dark theme's,
   and data-palette tints them. "Kol" is the dark theme as it is. The column is
   --p-bg (paradigm.css paints a scoped [data-theme] element with it, over the
   .p-sidebar rule above); --p-surface is the raised pill in the mode switch,
   hover is --p-surface-sunken. Pinned by UiSidebarPaletteTest. */
.p-sidebar[data-palette="aubergine"] {
  --p-bg: #350d36; --p-surface: #3f0e40; --p-surface-sunken: #4f1d50; --p-field-bg: #350d36;
  --p-ink: #ffffff; --p-body: #e8dce8; --p-muted: #cdb8cd;
  --p-border: #5a2a5b; --p-border-strong: #a98ca9;
}
.p-sidebar[data-palette="jade"] {
  --p-bg: #112f24; --p-surface: #163d2e; --p-surface-sunken: #1c4636; --p-field-bg: #112f24;
  --p-ink: #f4f9f5; --p-body: #d4e5da; --p-muted: #adc8b7;
  --p-border: #275a46; --p-border-strong: #83a693;
}
.p-sidebar[data-palette="lagoon"] {
  --p-bg: #10303f; --p-surface: #15394a; --p-surface-sunken: #1a4457; --p-field-bg: #10303f;
  --p-ink: #f2f7f9; --p-body: #d1e2ea; --p-muted: #a8c3cf;
  --p-border: #24546b; --p-border-strong: #82a7b8;
}
.p-sidebar[data-palette="indigo"] {
  --p-bg: #232250; --p-surface: #2b2a5e; --p-surface-sunken: #383773; --p-field-bg: #232250;
  --p-ink: #f4f3fa; --p-body: #d8d7ec; --p-muted: #b3b2d6;
  --p-border: #45448a; --p-border-strong: #9493c6;
}

/* Colleagues online, bottom right on every page (paradigm-presence.js):
   one bubble each, a click opens the DM. */
.p-online {
  position: fixed; right: 20px; bottom: 20px; z-index: 180;
  display: flex; flex-direction: column-reverse; align-items: center; gap: 8px;
}
.p-online[hidden] { display: none; }
.p-root .p-online__bubble {
  position: relative; width: 44px; height: 44px; padding: 0;
  display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--p-border); background: var(--p-surface); color: var(--p-ink);
  font: inherit; font-size: var(--p-text-sm); font-weight: var(--p-weight-semibold); text-decoration: none;
  box-shadow: var(--p-shadow-md); cursor: pointer; transition: transform var(--p-duration);
}
.p-root .p-online__bubble:hover { transform: scale(1.06); border-color: var(--p-border-strong); }
.p-online__dot {
  position: absolute; right: 1px; bottom: 1px; width: 11px; height: 11px; border-radius: 50%;
  background: var(--p-success); box-shadow: 0 0 0 2px var(--p-surface);
}
.p-online__dot.is-away { background: var(--p-surface); border: 2px solid var(--p-success); }
.p-root .p-online__more { font-size: var(--p-text-xs); color: var(--p-muted); }
/* In the chat they get a strip of their own on the right, so they never sit
   on a message's buttons (delete, edit…), the thread panel or send */
@media (min-width: 768px) {
  .tc-page .p-online { right: 12px; }
  .tc-page:has(> .p-online:not([hidden])) .tc-root { padding-right: 68px; }
}
@media (max-width: 767px) {
  .p-online { right: 12px; bottom: 12px; gap: 6px; }
  .p-root .p-online__bubble { width: 38px; height: 38px; }
  .tc-page .p-online { display: none; }
}
@media (prefers-reduced-motion: reduce) { .p-root .p-online__bubble { transition: none; } }

/* ---------- Switching Business ↔ Communication: a 3D turn ----------
   A cross-document view transition (Chrome, Edge, Safari 18.2+; elsewhere an
   ordinary page load). paradigm-shell.js lets it run only when the mode
   changes and names the direction (mode-communication / mode-business); every
   other navigation skips it. The sidebar turns over like a card, the page
   sinks back while the new one comes forward. */
/* Only where the sidebar is on screen: below 960 px it's a drawer, and on
   phones the transition froze the page going to Communication (2026-10-20). */
@media (min-width: 961px) {
  @view-transition { navigation: auto; }
  .p-sidebar { view-transition-name: p-sidebar; }
  .p-root main.p-main { view-transition-name: p-main; }
}

::view-transition-group(p-sidebar),
::view-transition-group(p-main) { animation-duration: 0.62s; }
::view-transition-old(p-sidebar),
::view-transition-new(p-sidebar) { backface-visibility: hidden; transform-origin: 50% 50%; }
::view-transition-old(p-main),
::view-transition-new(p-main) { transform-origin: 50% 40%; }

/* To Communication: the menu turns away to the left, the chat list turns in */
html:active-view-transition-type(mode-communication)::view-transition-old(p-sidebar) { animation: p-turn-out-left 0.31s cubic-bezier(0.55, 0, 0.75, 0.2) both; }
html:active-view-transition-type(mode-communication)::view-transition-new(p-sidebar) { animation: p-turn-in-right 0.36s cubic-bezier(0.2, 0.75, 0.3, 1) 0.26s both; }
html:active-view-transition-type(mode-communication)::view-transition-old(p-main) { animation: p-sink 0.34s cubic-bezier(0.55, 0, 0.75, 0.2) both; }
html:active-view-transition-type(mode-communication)::view-transition-new(p-main) { animation: p-rise-left 0.46s cubic-bezier(0.2, 0.8, 0.3, 1) 0.16s both; }

/* Back to Business: the same, the other way round */
html:active-view-transition-type(mode-business)::view-transition-old(p-sidebar) { animation: p-turn-out-right 0.31s cubic-bezier(0.55, 0, 0.75, 0.2) both; }
html:active-view-transition-type(mode-business)::view-transition-new(p-sidebar) { animation: p-turn-in-left 0.36s cubic-bezier(0.2, 0.75, 0.3, 1) 0.26s both; }
html:active-view-transition-type(mode-business)::view-transition-old(p-main) { animation: p-sink 0.34s cubic-bezier(0.55, 0, 0.75, 0.2) both; }
html:active-view-transition-type(mode-business)::view-transition-new(p-main) { animation: p-rise-right 0.46s cubic-bezier(0.2, 0.8, 0.3, 1) 0.16s both; }

@keyframes p-turn-out-left  { to   { transform: perspective(900px) rotateY(-90deg); filter: brightness(0.85); } }
@keyframes p-turn-in-right  { from { transform: perspective(900px) rotateY(90deg);  filter: brightness(0.85); } }
@keyframes p-turn-out-right { to   { transform: perspective(900px) rotateY(90deg);  filter: brightness(0.85); } }
@keyframes p-turn-in-left   { from { transform: perspective(900px) rotateY(-90deg); filter: brightness(0.85); } }
@keyframes p-sink { to { transform: perspective(1600px) translateZ(-260px); opacity: 0; } }
@keyframes p-rise-left  { from { transform: perspective(1600px) translateZ(-260px) rotateY(-14deg); opacity: 0; } }
@keyframes p-rise-right { from { transform: perspective(1600px) translateZ(-260px) rotateY(14deg);  opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* Chat notifications on this device: asked on every page until on (paradigm-push.js) */
.p-push-nudge {
  position: fixed; z-index: 210; left: calc(var(--p-sidebar-w, 248px) + 16px); bottom: 16px; width: min(440px, calc(100vw - var(--p-sidebar-w, 248px) - 32px));
  display: flex; align-items: center; gap: var(--p-space-3); padding: var(--p-space-3) var(--p-space-4);
  background: var(--p-surface); border: 1px solid var(--p-border); border-left: 3px solid var(--accent);
  border-radius: var(--p-radius-lg); box-shadow: var(--p-shadow-md); color: var(--p-ink);
}
.p-push-nudge > svg { flex: none; color: var(--accent-ink, var(--accent)); }
.p-push-nudge__text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; font-size: var(--p-text-sm); }
.p-push-nudge__text span { color: var(--p-muted); }
.p-push-nudge__error:empty { display: none; }
.p-push-nudge__error { color: var(--p-danger) !important; }
.p-push-nudge__actions { display: flex; flex-direction: column; gap: var(--p-space-1); flex: none; }
.p-push-nudge.is-done { border-left-color: var(--p-success); }
@media (max-width: 960px) {
  .p-push-nudge { left: 12px; right: 12px; width: auto; bottom: calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .p-push-nudge__actions { width: 100%; flex-direction: row; }
  .p-push-nudge__actions .p-btn { flex: 1; }
}
/* In the chat the composer is at the bottom: the card sits under the channel header */
.tc-page .p-push-nudge { bottom: auto; top: 64px; }
/* On a phone: at the bottom, clear of the composer, not over the channel list */
@media (max-width: 960px) { .tc-page .p-push-nudge { top: auto; bottom: calc(112px + env(safe-area-inset-bottom)); } }

/* "Add Paradigm to your Home Screen" (paradigm-push.js), iPhone/iPad in a browser tab */
.p-hs { position: fixed; inset: 0; z-index: 400; display: flex; align-items: flex-end; justify-content: center; }
.p-hs__backdrop { position: absolute; inset: 0; background: rgb(17 12 10 / 0.45); }
.p-hs__panel {
  position: relative; width: min(440px, 100%); max-height: calc(100dvh - 24px); overflow-y: auto;
  margin: 12px; padding: var(--p-space-6) var(--p-space-5) var(--p-space-5);
  background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 14px; box-shadow: var(--p-shadow-md);
  text-align: center; color: var(--p-body);
  padding-bottom: calc(var(--p-space-5) + env(safe-area-inset-bottom));
}
.p-hs__icon { width: 64px; height: 64px; border-radius: 14px; box-shadow: 0 0 0 1px var(--p-border); }
.p-hs__panel h2 { margin: var(--p-space-3) 0 var(--p-space-2); font-size: var(--p-text-xl); color: var(--p-ink); }
.p-hs__panel > p { margin: 0 0 var(--p-space-4); font-size: var(--p-text-md); }
.p-hs__steps { list-style: none; margin: 0 0 var(--p-space-5); padding: 0; text-align: left; display: flex; flex-direction: column; gap: var(--p-space-3); }
.p-hs__steps li { display: flex; align-items: flex-start; gap: var(--p-space-3); font-size: var(--p-text-md); color: var(--p-ink); }
.p-hs__steps svg { display: inline-block; vertical-align: -4px; color: var(--accent-ink, var(--accent)); }
.p-hs__num {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--p-accent-soft); color: var(--p-ink); font-size: var(--p-text-sm); font-weight: var(--p-weight-semibold);
}
.p-hs__note { font-size: var(--p-text-sm) !important; color: var(--p-muted); }
.p-hs__done { width: 100%; }
@media (min-width: 768px) { .p-hs { align-items: center; } }


/* ---------- 3. Dark bridge for inline light backgrounds ----------
   Old pages paint boxes with style="background:#fff" etc. In dark that is a
   white box with light text. Repaint the common ones with the theme's
   surfaces and tone tints. `#fff` also matches `#fff7e6`, so the tones come
   after and win. Generated from the colours actually in app/Views
   (2026-10-25); a new one is a line here. */
:root[data-theme="dark"] .p-legacy [style*="background:#fff" i],
:root[data-theme="dark"] .p-legacy [style*="background: #fff" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#fff" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #fff" i],
:root[data-theme="dark"] .p-legacy [style*="background:#ffffff" i],
:root[data-theme="dark"] .p-legacy [style*="background: #ffffff" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#ffffff" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #ffffff" i],
:root[data-theme="dark"] .p-legacy [style*="background:#fdfcfa" i],
:root[data-theme="dark"] .p-legacy [style*="background: #fdfcfa" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#fdfcfa" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #fdfcfa" i],
:root[data-theme="dark"] .p-legacy [style*="background:#f9f9f9" i],
:root[data-theme="dark"] .p-legacy [style*="background: #f9f9f9" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#f9f9f9" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #f9f9f9" i],
:root[data-theme="dark"] .p-legacy [style*="background:#f8f9fa" i],
:root[data-theme="dark"] .p-legacy [style*="background: #f8f9fa" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#f8f9fa" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #f8f9fa" i],
:root[data-theme="dark"] .p-legacy [style*="background:#f8f7f4" i],
:root[data-theme="dark"] .p-legacy [style*="background: #f8f7f4" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#f8f7f4" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #f8f7f4" i] { background: var(--p-surface) !important; }
:root[data-theme="dark"] .p-legacy [style*="background:#fafafa" i],
:root[data-theme="dark"] .p-legacy [style*="background: #fafafa" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#fafafa" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #fafafa" i],
:root[data-theme="dark"] .p-legacy [style*="background:#f5f5f5" i],
:root[data-theme="dark"] .p-legacy [style*="background: #f5f5f5" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#f5f5f5" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #f5f5f5" i],
:root[data-theme="dark"] .p-legacy [style*="background:#f0f0f0" i],
:root[data-theme="dark"] .p-legacy [style*="background: #f0f0f0" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#f0f0f0" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #f0f0f0" i],
:root[data-theme="dark"] .p-legacy [style*="background:#f1f1f1" i],
:root[data-theme="dark"] .p-legacy [style*="background: #f1f1f1" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#f1f1f1" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #f1f1f1" i],
:root[data-theme="dark"] .p-legacy [style*="background:#f4f1ec" i],
:root[data-theme="dark"] .p-legacy [style*="background: #f4f1ec" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#f4f1ec" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #f4f1ec" i],
:root[data-theme="dark"] .p-legacy [style*="background:#faf7f1" i],
:root[data-theme="dark"] .p-legacy [style*="background: #faf7f1" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#faf7f1" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #faf7f1" i],
:root[data-theme="dark"] .p-legacy [style*="background:#f6f3fa" i],
:root[data-theme="dark"] .p-legacy [style*="background: #f6f3fa" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#f6f3fa" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #f6f3fa" i] { background: var(--p-surface-sunken) !important; }
:root[data-theme="dark"] .p-legacy [style*="background:#f6ffed" i],
:root[data-theme="dark"] .p-legacy [style*="background: #f6ffed" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#f6ffed" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #f6ffed" i] { background: var(--p-success-bg) !important; }
:root[data-theme="dark"] .p-legacy [style*="background:#fffbe6" i],
:root[data-theme="dark"] .p-legacy [style*="background: #fffbe6" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#fffbe6" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #fffbe6" i],
:root[data-theme="dark"] .p-legacy [style*="background:#fff7e6" i],
:root[data-theme="dark"] .p-legacy [style*="background: #fff7e6" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#fff7e6" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #fff7e6" i],
:root[data-theme="dark"] .p-legacy [style*="background:#fff2e8" i],
:root[data-theme="dark"] .p-legacy [style*="background: #fff2e8" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#fff2e8" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #fff2e8" i] { background: var(--p-warning-bg) !important; }
:root[data-theme="dark"] .p-legacy [style*="background:#fff1f0" i],
:root[data-theme="dark"] .p-legacy [style*="background: #fff1f0" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#fff1f0" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #fff1f0" i],
:root[data-theme="dark"] .p-legacy [style*="background:#fff2f0" i],
:root[data-theme="dark"] .p-legacy [style*="background: #fff2f0" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#fff2f0" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #fff2f0" i],
:root[data-theme="dark"] .p-legacy [style*="background:#fbeaea" i],
:root[data-theme="dark"] .p-legacy [style*="background: #fbeaea" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#fbeaea" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #fbeaea" i] { background: var(--p-danger-bg) !important; }
:root[data-theme="dark"] .p-legacy [style*="background:#e6f4ff" i],
:root[data-theme="dark"] .p-legacy [style*="background: #e6f4ff" i],
:root[data-theme="dark"] .p-legacy [style*="background-color:#e6f4ff" i],
:root[data-theme="dark"] .p-legacy [style*="background-color: #e6f4ff" i] { background: var(--p-info-bg) !important; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme]) .p-legacy [style*="background:#fff" i],
:root:not([data-theme]) .p-legacy [style*="background: #fff" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#fff" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #fff" i],
:root:not([data-theme]) .p-legacy [style*="background:#ffffff" i],
:root:not([data-theme]) .p-legacy [style*="background: #ffffff" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#ffffff" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #ffffff" i],
:root:not([data-theme]) .p-legacy [style*="background:#fdfcfa" i],
:root:not([data-theme]) .p-legacy [style*="background: #fdfcfa" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#fdfcfa" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #fdfcfa" i],
:root:not([data-theme]) .p-legacy [style*="background:#f9f9f9" i],
:root:not([data-theme]) .p-legacy [style*="background: #f9f9f9" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#f9f9f9" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #f9f9f9" i],
:root:not([data-theme]) .p-legacy [style*="background:#f8f9fa" i],
:root:not([data-theme]) .p-legacy [style*="background: #f8f9fa" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#f8f9fa" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #f8f9fa" i],
:root:not([data-theme]) .p-legacy [style*="background:#f8f7f4" i],
:root:not([data-theme]) .p-legacy [style*="background: #f8f7f4" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#f8f7f4" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #f8f7f4" i] { background: var(--p-surface) !important; }
:root:not([data-theme]) .p-legacy [style*="background:#fafafa" i],
:root:not([data-theme]) .p-legacy [style*="background: #fafafa" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#fafafa" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #fafafa" i],
:root:not([data-theme]) .p-legacy [style*="background:#f5f5f5" i],
:root:not([data-theme]) .p-legacy [style*="background: #f5f5f5" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#f5f5f5" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #f5f5f5" i],
:root:not([data-theme]) .p-legacy [style*="background:#f0f0f0" i],
:root:not([data-theme]) .p-legacy [style*="background: #f0f0f0" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#f0f0f0" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #f0f0f0" i],
:root:not([data-theme]) .p-legacy [style*="background:#f1f1f1" i],
:root:not([data-theme]) .p-legacy [style*="background: #f1f1f1" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#f1f1f1" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #f1f1f1" i],
:root:not([data-theme]) .p-legacy [style*="background:#f4f1ec" i],
:root:not([data-theme]) .p-legacy [style*="background: #f4f1ec" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#f4f1ec" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #f4f1ec" i],
:root:not([data-theme]) .p-legacy [style*="background:#faf7f1" i],
:root:not([data-theme]) .p-legacy [style*="background: #faf7f1" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#faf7f1" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #faf7f1" i],
:root:not([data-theme]) .p-legacy [style*="background:#f6f3fa" i],
:root:not([data-theme]) .p-legacy [style*="background: #f6f3fa" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#f6f3fa" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #f6f3fa" i] { background: var(--p-surface-sunken) !important; }
:root:not([data-theme]) .p-legacy [style*="background:#f6ffed" i],
:root:not([data-theme]) .p-legacy [style*="background: #f6ffed" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#f6ffed" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #f6ffed" i] { background: var(--p-success-bg) !important; }
:root:not([data-theme]) .p-legacy [style*="background:#fffbe6" i],
:root:not([data-theme]) .p-legacy [style*="background: #fffbe6" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#fffbe6" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #fffbe6" i],
:root:not([data-theme]) .p-legacy [style*="background:#fff7e6" i],
:root:not([data-theme]) .p-legacy [style*="background: #fff7e6" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#fff7e6" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #fff7e6" i],
:root:not([data-theme]) .p-legacy [style*="background:#fff2e8" i],
:root:not([data-theme]) .p-legacy [style*="background: #fff2e8" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#fff2e8" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #fff2e8" i] { background: var(--p-warning-bg) !important; }
:root:not([data-theme]) .p-legacy [style*="background:#fff1f0" i],
:root:not([data-theme]) .p-legacy [style*="background: #fff1f0" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#fff1f0" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #fff1f0" i],
:root:not([data-theme]) .p-legacy [style*="background:#fff2f0" i],
:root:not([data-theme]) .p-legacy [style*="background: #fff2f0" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#fff2f0" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #fff2f0" i],
:root:not([data-theme]) .p-legacy [style*="background:#fbeaea" i],
:root:not([data-theme]) .p-legacy [style*="background: #fbeaea" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#fbeaea" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #fbeaea" i] { background: var(--p-danger-bg) !important; }
:root:not([data-theme]) .p-legacy [style*="background:#e6f4ff" i],
:root:not([data-theme]) .p-legacy [style*="background: #e6f4ff" i],
:root:not([data-theme]) .p-legacy [style*="background-color:#e6f4ff" i],
:root:not([data-theme]) .p-legacy [style*="background-color: #e6f4ff" i] { background: var(--p-info-bg) !important; }
}

/* Lists that don't fit: every row a card, "Heading  value" per line. Not a
   breakpoint: paradigm-shell.js (fitTables) measures each table's narrowest
   width without breaking a word and adds .is-cards when its box is narrower
   (a phone, a half-screen window, a list with many columns). The labels come
   from the table's own headings, so every admin table gets this without a
   line of its own. data-stack="off" opts a table out. */
.p-main table.p-rowcards--measure { width: min-content !important; min-width: 0 !important; max-width: none !important; table-layout: auto !important; }
.p-main table.p-rowcards--measure th,
.p-main table.p-rowcards--measure td { overflow-wrap: normal !important; word-wrap: normal !important; word-break: normal !important; }
.p-main table.p-rowcards.is-cards,
.p-main table.p-rowcards.is-cards tbody { display: block; width: 100% !important; min-width: 0 !important; }
.p-main table.p-rowcards.is-cards thead { display: none; }
.p-main table.p-rowcards.is-cards tbody tr {
  display: block;
  padding: 10px 2px;
  border-bottom: 1px solid var(--p-border, #e8e8e8);
  background: none !important;
}
.p-main table.p-rowcards.is-cards tbody tr:last-child { border-bottom: 0; }
.p-main table.p-rowcards.is-cards tbody td {
  display: grid;
  /* The label column never grows past 160px: in a wide box (a laptop
     showing a many-column list as cards) the values sat half a screen away */
  grid-template-columns: minmax(84px, min(34%, 160px)) minmax(0, 1fr);
  gap: 2px 12px; /* the parts of one cell stack tight, the label keeps its distance */
  align-items: baseline;
  justify-items: start; /* a badge keeps its own width */
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  white-space: normal !important;
  padding: 3px 4px !important;
  border: 0 !important;
  background: none !important;
  text-align: left !important;
  font-size: var(--p-text-sm, 14px);
  overflow-wrap: anywhere;
  word-break: normal;
}
.p-main table.p-rowcards.is-cards tbody td::before {
  content: attr(data-label);
  grid-column: 1; grid-row: 1;
  color: var(--p-muted, #8c8c8c);
  font-size: var(--p-text-xs, 12px);
  font-weight: var(--p-weight-medium, 500);
  overflow-wrap: normal;
}
/* A cell with several parts (a badge and a note under it) keeps them all in
   the value column; without this the second part slid under the label */
.p-main table.p-rowcards.is-cards tbody td > * { grid-column: 2; }
/* No heading (actions, a checkbox column): the content gets the whole line */
.p-main table.p-rowcards.is-cards tbody td.p-rowcards__bare,
.p-main table.p-rowcards.is-cards tbody td.p-rowcards__whole { display: block; }
.p-main table.p-rowcards.is-cards tbody td.p-rowcards__bare::before,
.p-main table.p-rowcards.is-cards tbody td.p-rowcards__whole::before { content: none; }
.p-main table.p-rowcards.is-cards tbody td.p-rowcards__bare { padding-top: 8px !important; }
.p-main table.p-rowcards.is-cards tbody td > .ant-flex,
.p-main table.p-rowcards.is-cards tbody td.p-rowcards__bare { flex-wrap: wrap; }
/* An empty cell says nothing: no "Note:" with nothing after it */
.p-main table.p-rowcards.is-cards tbody td[data-label]:empty { display: none; }
.p-main .ant-table-wrapper:has(table.p-rowcards.is-cards),
.p-main .p-table-wrap:has(table.p-rowcards.is-cards) { overflow-x: visible; }
/* The card is the frame now: no table border or inset inside it */
.p-main .ant-table-wrapper:has(table.p-rowcards.is-cards) { padding-left: 0 !important; padding-right: 0 !important; }
.p-main .ant-table:has(table.p-rowcards.is-cards) { border: 0 !important; }
/* Cards hide the sortable headings: a "Sort by" select stands in (paradigm-shell.js) */
.p-main .p-rowsort { margin: 0 0 var(--p-space-3, 12px); font-size: var(--p-text-sm, 13px); color: var(--p-muted); }
.p-main .p-rowsort[hidden] { display: none; }
.p-main .p-rowsort__select { margin-left: 4px; padding: 4px 8px; font: inherit; color: var(--p-ink); background: var(--p-field-bg); border: 1px solid var(--p-border-strong); border-radius: var(--p-radius); }
