/* ============================================================
   Pesty Sites Hub — application styles
   Built on the Pesty Marketing design tokens (tokens.css).
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

/* Tooltip anchor. A `data-tooltip` host needs a positioning context for its bubble
   (see the [data-tooltip]::after/::before rules further down). Declared HERE, before
   any component rules, so that any element which sets its OWN position: absolute/fixed
   later (drag handles, the resizable tasks column, floating tabs) keeps it — a blanket
   `position: relative` placed after the components would clobber those and drop them
   into normal flow. Elements with no position of their own fall back to relative. */
[data-tooltip] { position: relative; }

/* Full-viewport panel. The Hub is a full-screen app, but it renders through the
   [pesty_sites_hub] shortcode inside a WordPress theme whose body margin / content
   wrapper padding leaves white bands above and below. app.css is enqueued ONLY on
   the singular page that contains the shortcode (see Assets::post_has_shortcode),
   so these page-level resets are safe and don't leak to the rest of the site.
   #psh-root is pinned to the viewport to cover the theme chrome; the WP admin bar
   stays visible/usable for logged-in users via the offset below. */
html, body { margin: 0; padding: 0; background: var(--n-50); }
body { overflow: hidden; } /* the panel owns the scroll; hides the theme behind it */
/* --psh-h is the scroll container's real height (viewport minus the WP admin bar).
   Viewport-height math (sticky header/sidebar, min-heights) must use it, not 100vh,
   or the admin-bar offset shifts the sticky sidebar behind the header at scroll end. */
#psh-root { position: fixed; inset: 0; margin: 0; padding: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; z-index: 90000; background: var(--n-50); --psh-h: 100vh; }
body.admin-bar #psh-root { top: 32px; --psh-h: calc(100vh - 32px); }
@media screen and (max-width: 782px) { body.admin-bar #psh-root { top: 46px; --psh-h: calc(100vh - 46px); } }
/* :where() keeps these resets at zero/low specificity so component classes
   like .psh-btn--primary always win (an #psh-root prefix would override them). */
:where(#psh-root) button { font-family: inherit; cursor: pointer; border: none; background: none; }
:where(#psh-root) :focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }

/* ---------------- App shell ---------------- */
.psh-app { min-height: var(--psh-h, 100vh); display: flex; flex-direction: column; background: var(--n-50); font-family: var(--font-body); color: var(--text-body); -webkit-font-smoothing: antialiased; }

/* ---------------- Top bar ---------------- */
.psh-top { position: sticky; top: 0; z-index: 40; background: var(--ink-900); color: #fff; }
/* The bar packs five regions into one row: brand · nav · search · bell · user.
   The nav is the only one that grows and the only one that may overflow, so a
   new Hub section takes free space from the row instead of crushing the search
   or wrapping its own label — the failure the Licenses section first exposed.
   How tightly the row packs is a pure function of the viewport (the knobs
   below), so adding a section needs no new layout code: the bar just packs
   tighter. Once even the tightest packing is not enough the nav scrolls
   horizontally, the same strip the ≤760px layout uses. */
.psh-top__inner {
  /* Each knob scales linearly with the viewport between the two ends of the
     range below, so the bar tightens gradually instead of jumping at a
     breakpoint: full density on a wide monitor, compact on a small laptop. */
  --psh-top-gap: clamp(11px, 1.196vw - 0.72px, 22px);     /* between regions   */
  --psh-top-pad: clamp(14px, 1.522vw - 0.91px, 28px);     /* bar side padding  */
  --psh-nav-ml: clamp(4px, 1.087vw - 6.65px, 14px);       /* nav from brand    */
  --psh-nav-gap: clamp(2px, 0.217vw - 0.13px, 4px);       /* between nav items */
  --psh-nav-padx: clamp(8px, 0.652vw + 1.61px, 14px);     /* nav item padding  */
  --psh-nav-icongap: clamp(5px, 0.326vw + 1.8px, 8px);    /* icon -> label     */
  --psh-nav-font: clamp(12.5px, 0.163vw + 10.9px, 14px);  /* nav item label    */
  --psh-search-w: clamp(150px, 14.13vw + 11.52px, 280px); /* global search     */
  display: flex; align-items: center; gap: var(--psh-top-gap); height: 64px; padding: 0 var(--psh-top-pad);
}
.psh-brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.psh-brand__mark { width: 34px; height: 34px; border-radius: 9px; background: var(--brand); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(217,4,41,.4); }
.psh-brand__mark img { width: 20px; height: 20px; }
.psh-brand__name { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: #fff; letter-spacing: -0.01em; line-height: 1; white-space: nowrap; }
.psh-brand__name span { color: var(--red-300); font-weight: 600; }
.psh-nav { display: flex; gap: var(--psh-nav-gap); margin-left: var(--psh-nav-ml); flex: 1 1 auto; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.psh-nav::-webkit-scrollbar { display: none; }
.psh-nav__item { display: inline-flex; align-items: center; gap: var(--psh-nav-icongap); padding: 8px var(--psh-nav-padx); border-radius: var(--radius-pill); font-family: var(--font-display); font-weight: 500; font-size: var(--psh-nav-font); color: rgba(255,255,255,.66); flex: 0 0 auto; white-space: nowrap; transition: background var(--dur-base) var(--ease-standard), color var(--dur-base) var(--ease-standard); }
.psh-nav__item:hover { color: #fff; background: rgba(255,255,255,.08); }
.psh-nav__item.is-active { color: #fff; background: rgba(255,255,255,.12); }
.psh-top__search { margin-left: auto; position: relative; width: 280px; }
.psh-top__search input { width: 100%; height: 40px; border-radius: var(--radius-pill); border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07); color: #fff; padding: 0 14px 0 40px; font-size: 14px; transition: background var(--dur-base), border-color var(--dur-base); }
.psh-top__search input::placeholder { color: rgba(255,255,255,.5); }
.psh-top__search input:focus { outline: none; background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); }
.psh-top__search .psh-top__searchicon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.55); }
.psh-iconbtn { width: 40px; height: 40px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center; color: rgba(255,255,255,.78); position: relative; transition: background var(--dur-base), color var(--dur-base); }
.psh-iconbtn:hover { background: rgba(255,255,255,.1); color: #fff; }
.psh-iconbtn__dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 99px; background: var(--brand); border: 2px solid var(--ink-900); }
.psh-iconbtn__count { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--brand); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 10.5px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--ink-900); }

/* ---- Notifications dropdown ---- */
.psh-notif { position: relative; flex: 0 0 auto; }
.psh-notif__panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 200; width: 360px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); overflow: hidden; animation: popIn var(--dur-base) var(--ease-out); }
.psh-notif__head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--divider); }
.psh-notif__title { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--ink-900); }
.psh-notif__markall { font-family: var(--font-body); font-weight: 600; font-size: 12px; color: var(--brand); padding: 3px 6px; border-radius: var(--radius-xs); }
.psh-notif__markall:hover { background: var(--brand-subtle); }
.psh-notif__list { max-height: 400px; overflow-y: auto; padding: 6px; }
.psh-notif__card { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 10px; border-radius: var(--radius-md); background: transparent; border: 1px solid transparent; transition: background var(--dur-fast), border-color var(--dur-fast); }
.psh-notif__card:hover { background: var(--n-50); border-color: var(--border); }
.psh-notif__card:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.psh-notif__card > svg { color: var(--text-faint); flex-shrink: 0; }
.psh-notif__ico { width: 34px; height: 34px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.psh-notif__cbody { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.psh-notif__name { font-size: 13px; font-weight: 600; color: var(--ink-900); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.psh-notif__meta { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-muted); min-width: 0; }
.psh-notif__meta svg { color: var(--text-faint); flex-shrink: 0; }
.psh-notif__target { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-mono); }
.psh-notif__due { flex-shrink: 0; font-weight: 600; }
.psh-notif__due--overdue { color: var(--danger); }
.psh-notif__due--today { color: var(--warning-600, var(--amber-600)); }
.psh-notif__empty { padding: 30px 20px; text-align: center; }
.psh-notif__emptyico { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: var(--radius-pill); background: var(--n-100); color: var(--text-faint); margin-bottom: 10px; }
.psh-notif__emptytitle { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--ink-900); }
.psh-notif__emptysub { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }

/* ---- Avatar image variant ---- */
.psh-avatar--img { position: relative; overflow: hidden; padding: 0; background: var(--n-200); }
.psh-avatar--img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.psh-avatar__fallback { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: #fff; font-weight: 700; }
.psh-avatar--img.is-broken img { display: none; }
.psh-avatar--img.is-broken .psh-avatar__fallback { display: flex; }

/* ---- User menu (account dropdown) ---- */
.psh-usermenu { position: relative; flex: 0 0 auto; }
.psh-usermenu__panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 200; width: 288px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); overflow: hidden; padding: 6px; animation: popIn var(--dur-base) var(--ease-out); }
.psh-usermenu__id { display: flex; align-items: center; gap: 12px; padding: 10px; }
.psh-usermenu__idmeta { min-width: 0; }
.psh-usermenu__idname { font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psh-usermenu__idemail { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psh-usermenu__rolebadge { display: inline-block; margin-top: 5px; font-family: var(--font-body); font-weight: 600; font-size: 10.5px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--brand); background: var(--brand-subtle); border-radius: var(--radius-pill); padding: 2px 9px; }
.psh-usermenu__sep { height: 1px; background: var(--divider); margin: 6px 4px; }
.psh-usermenu__item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 10px; border-radius: var(--radius-md); font-size: 13.5px; font-weight: 500; color: var(--text-body); background: transparent; border: 0; text-decoration: none; transition: background var(--dur-fast), color var(--dur-fast); }
.psh-usermenu__item svg { color: var(--text-muted); flex-shrink: 0; }
.psh-usermenu__item:hover { background: var(--n-50); color: var(--ink-900); }
.psh-usermenu__item:hover svg { color: var(--ink-900); }
.psh-usermenu__item--danger { color: var(--brand); }
.psh-usermenu__item--danger svg { color: var(--brand); }
.psh-usermenu__item--danger:hover { background: var(--brand-subtle); color: var(--brand-press); }

/* ---- Profile modal ---- */
.psh-profile__preview { display: flex; align-items: center; gap: 16px; }
.psh-profile__id { min-width: 0; }
.psh-profile__name { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink-900); }
.psh-profile__email { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.psh-avopts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.psh-avopt { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px; border: 1.5px solid var(--border); border-radius: var(--radius-md); background: #fff; cursor: pointer; transition: border-color var(--dur-fast), background var(--dur-fast); }
.psh-avopt:hover { border-color: var(--border-strong); background: var(--n-25); }
.psh-avopt.is-selected { border-color: var(--brand); background: var(--brand-subtle); }
.psh-avopt__label { font-family: var(--font-display); font-weight: 600; font-size: 12.5px; color: var(--ink-900); }
.psh-avopt__check { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 99px; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.psh-profile__upload { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.psh-profile__wp { margin: 18px 0 0; font-size: 12.5px; }
.psh-profile__wp a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); text-decoration: none; }
.psh-profile__wp a:hover { color: var(--brand); }
.psh-userchip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: var(--radius-pill); transition: background var(--dur-base); }
.psh-userchip:hover { background: rgba(255,255,255,.1); }
.psh-avatar { border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-family: var(--font-display); font-weight: 600; flex-shrink: 0; }
/* Name over role, stacked with clear separation; name is the prominent element. */
.psh-userchip__meta { display: flex; flex-direction: column; justify-content: center; text-align: left; line-height: 1.15; gap: 3px; min-width: 0; max-width: 150px; }
.psh-userchip__name { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psh-userchip__role { font-family: var(--font-body); font-weight: 500; font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(255,255,255,.55); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- Page body ---------------- */
/* min-height keeps the sticky sidebar's containing block at least as tall as the
   sidebar itself — otherwise, with little content, the taller sidebar is anchored
   above the sticky offset and slides behind the header. */
.psh-body { flex: 1; display: grid; grid-template-columns: 1fr var(--psh-tasks-w, 392px); align-items: start; width: 100%; min-height: calc(var(--psh-h, 100vh) - 64px); }
.psh-main { padding: 30px 28px 60px; min-width: 0; }

/* ---------------- Toolbar ---------------- */
.psh-toolbar { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.psh-toolbar__title h1 { font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: -0.02em; color: var(--ink-900); margin: 0; line-height: 1; }
.psh-toolbar__sub { font-size: 13.5px; color: var(--text-muted); margin-top: 7px; }
.psh-toolbar__spacer { flex: 1; }
.psh-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* search (light) */
.psh-search { position: relative; }
.psh-search input { height: 42px; width: 230px; border-radius: var(--radius-md); border: 1.5px solid var(--border-strong); background: #fff; padding: 0 12px 0 38px; font-size: 14px; color: var(--text-strong); transition: border-color var(--dur-base), box-shadow var(--dur-base); }
.psh-search input::placeholder { color: var(--text-faint); }
.psh-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus-ring); }
.psh-search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); }

/* segmented control */
.psh-seg { display: inline-flex; background: var(--n-100); border-radius: var(--radius-md); padding: 3px; gap: 2px; }
.psh-seg__btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 8px; font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--text-muted); transition: color var(--dur-base), background var(--dur-base), box-shadow var(--dur-base); white-space: nowrap; }
.psh-seg__btn:hover { color: var(--ink-900); }
.psh-seg__btn.is-active { background: #fff; color: var(--ink-900); box-shadow: var(--shadow-sm); }
.psh-seg__count { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.psh-seg__btn.is-active .psh-seg__count { color: var(--text-muted); }
/* Favorites tab: a subtle gold star accent so it reads as "favorites" at a glance. */
.psh-seg__btn--fav > svg { color: var(--amber-500); }

/* select (client filter) */
.psh-select { position: relative; }
.psh-select select { height: 42px; border-radius: var(--radius-md); border: 1.5px solid var(--border-strong); background: #fff; padding: 0 38px 0 14px; font-size: 14px; font-family: var(--font-body); color: var(--text-strong); appearance: none; cursor: pointer; }
.psh-select select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus-ring); }
.psh-select__icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }

/* plain field (modal forms) */
.psh-fld { width: 100%; height: 42px; border-radius: var(--radius-md); border: 1.5px solid var(--border-strong); background: #fff; padding: 0 14px; font-size: 14px; font-family: var(--font-body); color: var(--text-strong); }
.psh-fld::placeholder { color: var(--text-faint); }
.psh-fld:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus-ring); }
/* Multi-line variant: .psh-fld pins a 42px height for single-line inputs, which
   collapses a <textarea> to one row. */
.psh-fld--area { height: auto; min-height: 62px; padding: 10px 14px; line-height: 1.5; resize: vertical; }

/* Switch — a deliberate, single act of confirmation, as opposed to .psh-check which
   is for ordinary multi-option choices. Built on a real <input type=checkbox> so the
   label, keyboard and screen-reader semantics are the native ones; only the visuals
   are ours. */
.psh-switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.psh-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; }
.psh-switch__track { position: relative; flex-shrink: 0; width: 46px; height: 27px; margin-top: 1px; border-radius: 999px; background: var(--n-200); border: 1.5px solid var(--border-strong); transition: background var(--dur-fast), border-color var(--dur-fast); }
.psh-switch__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--dur-fast) var(--ease-out); }
.psh-switch input:checked + .psh-switch__track { background: var(--brand); border-color: var(--brand); }
.psh-switch input:checked + .psh-switch__track::after { transform: translateX(19px); }
.psh-switch input:focus-visible + .psh-switch__track { box-shadow: 0 0 0 3px var(--focus-ring); }
.psh-switch input:disabled + .psh-switch__track { opacity: .55; }
.psh-switch:has(input:disabled) { cursor: not-allowed; }
.psh-switch__text { font-size: 14px; line-height: 1.55; color: var(--text-body); }
.psh-switch__text strong { color: var(--ink-900); font-weight: 700; }

/* buttons */
.psh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: var(--radius-pill); font-family: var(--font-display); font-weight: 600; font-size: 14px; letter-spacing: -0.01em; transition: background var(--dur-base) var(--ease-standard), box-shadow var(--dur-base), transform var(--dur-fast), border-color var(--dur-base), color var(--dur-base); white-space: nowrap; }
.psh-btn:active { transform: translateY(1px); }
.psh-btn--primary { background: var(--brand); color: #fff; }
.psh-btn--primary:hover { background: var(--brand-hover); box-shadow: var(--shadow-brand); }
.psh-btn--ghost { background: transparent; color: var(--ink-900); border: 1.5px solid var(--border-strong); }
.psh-btn--ghost:hover { background: var(--n-50); border-color: var(--ink-900); }
.psh-btn--quiet { background: transparent; color: var(--text-muted); padding: 0 12px; }
.psh-btn--quiet:hover { color: var(--ink-900); background: var(--n-100); }
.psh-btn--sm { height: 36px; padding: 0 14px; font-size: 13px; }

/* Split "Sync" button: main action (sync sites) + caret → menu (sync everything). */
.psh-split { position: relative; display: inline-flex; }
.psh-split__main { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.psh-split__caret { border-top-left-radius: 0; border-bottom-left-radius: 0; padding: 0 11px; }
.psh-split__menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 200; min-width: 264px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); padding: 5px; animation: popIn var(--dur-base) var(--ease-out); }
.psh-split__item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 11px; background: transparent; border: 0; border-radius: 9px; cursor: pointer; color: var(--ink-900); }
.psh-split__item:hover { background: var(--brand-subtle); color: var(--brand); }
.psh-split__itemtext { display: flex; flex-direction: column; line-height: 1.25; }
.psh-split__itemtext b { font-family: var(--font-display); font-weight: 600; font-size: 13.5px; }
.psh-split__itemtext span { font-size: 11.5px; color: var(--text-muted); }
.psh-split__item:hover .psh-split__itemtext span { color: var(--brand); }
.psh-btn[disabled] { opacity: .5; cursor: not-allowed; }
.psh-btn[disabled]:hover { background: var(--brand); box-shadow: none; }
.psh-btn--primary[disabled]:hover { background: var(--brand); }
.psh-btn--ghost[disabled]:hover { background: transparent; border-color: var(--border-strong); color: var(--ink-900); }
/* inline button spinner (one-click login) */
.psh-btnspin { width: 15px; height: 15px; border-radius: 99px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .7s linear infinite; display: inline-block; flex-shrink: 0; }
.psh-btn--ghost .psh-btnspin, .psh-btn--quiet .psh-btnspin { border-color: rgba(0,35,48,.25); border-top-color: var(--brand); }

/* ---------------- Environment badge (the protagonist) ---------------- */
.env { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase; padding: 4px 10px 4px 9px; border-radius: var(--radius-pill); white-space: nowrap; line-height: 1; flex-shrink: 0; }
.env__dot { width: 7px; height: 7px; border-radius: 99px; background: currentColor; }
.env--production { background: var(--ink-900); color: #fff; }
.env--staging   { background: var(--amber-500); color: #3a2a04; }
.env--dev       { background: var(--n-200); color: var(--n-700); }
.env--sm { font-size: 10px; padding: 3px 8px 3px 7px; }
.env--sm .env__dot { width: 6px; height: 6px; }

/* Badge cluster on a site card (connected marker + env). In list view the head
   is display:contents, so this wrapper is the single flex item that replaces the
   bare env badge — keep it from shrinking. */
.site__badges { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

/* "Connected" badge — marks a manually-added, non-Pressable site so it's easy to
   tell apart from synced Pressable sites. */
.psh-connbadge { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-display); font-weight: 700; font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 8px 3px 7px; border-radius: var(--radius-pill); white-space: nowrap; line-height: 1; background: var(--brand); color: #fff; }
.psh-connbadge--sm { font-size: 9.5px; padding: 2px 7px 2px 6px; }
.sd__head-top .psh-connbadge { font-size: 11px; }

/* ---------------- Site grid ---------------- */
.psh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(322px, 1fr)); gap: 18px; }
.site { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 16px; transition: box-shadow var(--dur-base) var(--ease-standard), border-color var(--dur-base), transform var(--dur-base); scroll-margin-top: 90px; }
.site:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.site.is-selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus-ring), var(--shadow-md); }
.site.is-related { border-color: var(--ink-700); }
@keyframes sitePulse { 0% { box-shadow: 0 0 0 0 rgba(217,4,41,.45); } 100% { box-shadow: 0 0 0 14px rgba(217,4,41,0); } }
.site.is-pulsing { animation: sitePulse 0.9s var(--ease-out); }
.site--down { border-color: var(--red-200); background: linear-gradient(0deg, var(--red-50), var(--red-50)) padding-box, #fff; }

.site__head { display: flex; align-items: flex-start; gap: 13px; flex-wrap: wrap; }
/* Grid cards: badges wrap to their own line under the title (aligned with the text,
   not the avatar) instead of stealing the title's width. A connected site carries
   TWO badges (CONNECTED + PRODUCTION) which otherwise squeezed the title to nothing.
   Scoped away from list view, whose head uses display:contents. Scales to N badges. */
.site:not(.site--list) .site__badges { flex-basis: 100%; margin-left: 57px; margin-top: 4px; justify-content: flex-start; }
.site__fav { width: 44px; height: 44px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 18px; flex-shrink: 0; }
.site__id { min-width: 0; flex: 1; }
/* Reserve a right gutter on grid cards so the title/domain never run under the
   hover controls (favorite star + drag grip) parked in the top-right corner.
   Without it the 2-line title extended beneath the star, overlapping it and
   making the star hard to click. Scoped away from list view, whose head uses
   display:contents and lays the grip out inline. */
.site:not(.site--list) .site__id { padding-right: 44px; }
.site__client { font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink-900); line-height: 1.2; letter-spacing: -0.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; word-break: break-word; }
.site__domain { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; font-size: 13px; color: var(--text-muted); margin-top: 3px; font-family: var(--font-mono); text-decoration: none; }
.site__domain svg { flex-shrink: 0; }
/* Domain is a link to the live site (opens in a new tab). Keep the muted look at
   rest; brighten to brand on hover and underline just the host text. The trailing
   svg is the external-link glyph — dimmed until hover so it reads as an affordance
   without shouting on every card. */
.site__domain svg:last-child { color: var(--text-faint); }
.site__domain:hover { color: var(--brand-press); }
.site__domain:hover svg:last-child { color: var(--brand-press); }
.site__domain:hover .site__domain__txt { text-decoration: underline; }
.site__domain__txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Staging ↔ production relationship chip */
.site__rel { display: inline-flex; align-items: center; gap: 5px; margin-top: 5px; max-width: 100%; font-size: 12px; color: var(--text-muted); }
.site__rel svg { flex-shrink: 0; color: var(--text-faint); }
.site__rel__txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site__rel__txt b { font-weight: 600; color: var(--text-body); }
.site__rel__auto { flex-shrink: 0; font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); background: var(--n-100); border-radius: var(--radius-pill); padding: 1px 6px; }
.site__rel--parent .site__rel__txt { color: var(--text-muted); font-weight: 600; }
.site__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.site__health { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-muted); }
.dot { width: 9px; height: 9px; border-radius: 99px; flex-shrink: 0; }
.dot--ok { background: var(--green-500); box-shadow: 0 0 0 3px rgba(31,138,91,.16); }
.dot--down { background: var(--brand); box-shadow: 0 0 0 3px rgba(217,4,41,.16); animation: healthPulse 1.6s ease-in-out infinite; }
@keyframes healthPulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

.site__tasks { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; color: var(--text-body); background: var(--n-50); border: 1px solid var(--border); padding: 5px 11px 5px 9px; border-radius: var(--radius-pill); transition: background var(--dur-base), border-color var(--dur-base), color var(--dur-base); }
.site__tasks:hover { background: var(--brand-subtle); border-color: var(--red-200); color: var(--brand-press); }
.site__tasks b { font-weight: 700; font-variant-numeric: tabular-nums; }
.site__tasks--zero { color: var(--text-faint); }
.site__tasks--zero:hover { background: var(--n-50); border-color: var(--border); color: var(--text-faint); cursor: default; }

/* Core Web Vitals pill — a compact per-site health read (production sites only),
   mirroring the detail modal's bands. Colour comes from the measured status. */
.site__cwv { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); background: var(--n-50); border: 1px solid var(--border); padding: 4px 10px 4px 8px; border-radius: var(--radius-pill); line-height: 1; white-space: nowrap; }
.site__cwv__dot { width: 8px; height: 8px; border-radius: 99px; background: var(--cwv-c, var(--text-faint)); flex-shrink: 0; }
.site__cwv__score { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--cwv-c, var(--text-body)); }
.site__cwv__label { color: var(--text-faint); font-weight: 600; }
.site__cwv--good { --cwv-c: var(--green-600); }
.site__cwv--ni   { --cwv-c: var(--warning); }
.site__cwv--poor { --cwv-c: var(--danger); }

.site__foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 4px; }
.site__error { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; line-height: 1.45; color: var(--red-700); background: #fff; border: 1px solid var(--red-200); border-radius: var(--radius-md); padding: 10px 12px; }
.site__error svg { flex-shrink: 0; margin-top: 1px; }

/* ---------------- Tasks panel (Asana) ---------------- */
.psh-tasks { position: sticky; top: 64px; height: calc(var(--psh-h, 100vh) - 64px); display: flex; flex-direction: column; background: #fff; border-left: 1px solid var(--border); }
.psh-tasks__head { padding: 22px 22px 0; }
.psh-tasks__titlerow { display: flex; align-items: center; gap: 10px; }
.psh-tasks__title { font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--ink-900); letter-spacing: -0.01em; }
.psh-tasks__count { font-size: 12px; font-weight: 700; color: var(--brand); background: var(--brand-subtle); border-radius: 99px; padding: 2px 9px; font-variant-numeric: tabular-nums; }
.psh-tasks__user { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); }

.psh-asana { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding: 9px 12px; background: var(--n-50); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 12.5px; color: var(--text-muted); }
.psh-asana__logo { width: 18px; height: 18px; flex-shrink: 0; }
.psh-asana__status { color: var(--text-body); }
.psh-asana__status b { color: var(--ink-900); font-weight: 600; }
.psh-asana__sync { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 600; font-size: 12.5px; color: var(--brand); padding: 4px 8px; border-radius: 8px; transition: background var(--dur-base); }
.psh-asana__sync:hover { background: var(--brand-subtle); }
.psh-asana__sync.is-syncing { color: var(--text-muted); pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.is-syncing svg { animation: spin .8s linear infinite; }

/* ---- Skeleton loaders (async panels: My tasks, Users, Design, site detail) ---- */
@keyframes psh-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.psh-skel { display: block; border-radius: var(--radius-md); background: linear-gradient(90deg, var(--n-100) 25%, var(--n-50) 37%, var(--n-100) 63%); background-size: 200% 100%; animation: psh-shimmer 1.4s ease-in-out infinite; }
.psh-skel--line { height: 12px; }
.psh-skel--circle { border-radius: var(--radius-pill); }
.psh-skel--chip { height: 20px; width: 72px; border-radius: var(--radius-pill); }
.psh-skel-row { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--divider); }
.psh-skel-row__body { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
@media (prefers-reduced-motion: reduce) { .psh-skel { animation: none; } }

.psh-tasks__filters { display: flex; gap: 6px; padding: 14px 22px 12px; border-bottom: 1px solid var(--divider); }
.psh-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-pill); font-family: var(--font-display); font-weight: 600; font-size: 12.5px; color: var(--text-muted); background: var(--n-100); transition: background var(--dur-base), color var(--dur-base); }
.psh-chip:hover { color: var(--ink-900); }
.psh-chip.is-active { background: var(--ink-900); color: #fff; }
.psh-chip__n { font-variant-numeric: tabular-nums; opacity: .75; }

/* Sort + priority controls, one compact row under the status chips. */
.psh-tasks__sortbar { display: flex; gap: 8px; padding: 0 22px 12px; border-bottom: 1px solid var(--divider); }
.psh-tasks__ctl { position: relative; display: inline-flex; align-items: center; gap: 6px; flex: 1; min-width: 0; padding: 0 10px; height: 34px; border-radius: var(--radius-md); background: var(--n-100); color: var(--text-muted); }
.psh-tasks__ctl > svg { flex-shrink: 0; }
.psh-tasks__ctl select { flex: 1; min-width: 0; appearance: none; -webkit-appearance: none; border: 0; background: transparent; font-family: var(--font-display); font-weight: 600; font-size: 12.5px; color: var(--ink-900); cursor: pointer; padding-right: 4px; }
.psh-tasks__ctl select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--radius-xs); }

/* Priority badge on a task row. */
.task__prio { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px 1px 5px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; letter-spacing: .01em; text-transform: capitalize; }
.task__prio--urgent { color: var(--red-700); background: var(--red-100); }
.task__prio--high { color: var(--red-600); background: var(--red-50); }
.task__prio--medium { color: var(--amber-600); background: var(--amber-100); }
.task__prio--low { color: var(--n-600); background: var(--n-100); }

.psh-tasks__scroll { flex: 1; overflow-y: auto; padding: 8px 14px 24px; }

/* ---------------- Tasks column: collapse + resize (desktop) ----------------
   Mobile (≤820px) keeps the drawer behavior below; all of this is desktop-only. */
.psh-tasks__collapse { display: none; width: 30px; height: 30px; border-radius: 8px; align-items: center; justify-content: center; color: var(--text-muted); transition: background var(--dur-base), color var(--dur-base); flex-shrink: 0; }
.psh-tasks__collapse:hover { background: var(--n-100); color: var(--ink-900); }
.psh-tasks__resizer { display: none; }
.psh-tasks-reopen { display: none; }

@media (min-width: 821px) {
  /* Smoothly grow/shrink the tasks track; the panel keeps its own width and
     slides out to the right when collapsed, so its content never reflows. */
  .psh-body { transition: grid-template-columns var(--dur-slow, .32s) var(--ease-out); }
  .psh-body.is-tcollapsed { grid-template-columns: 1fr 0px; }

  .psh-tasks { width: var(--psh-tasks-w, 392px); transition: transform var(--dur-slow, .32s) var(--ease-out), opacity var(--dur-slow, .32s) var(--ease-out); will-change: transform; }
  .psh-body.is-tcollapsed .psh-tasks { transform: translateX(100%); opacity: 0; pointer-events: none; }

  .psh-tasks__collapse { display: inline-flex; }

  /* Resize handle on the panel's inner (left) edge. */
  .psh-tasks__resizer { display: block; position: absolute; top: 0; left: -4px; width: 9px; height: 100%; cursor: col-resize; z-index: 6; }
  .psh-tasks__resizer::before { content: ''; position: absolute; left: 3px; top: 0; width: 2px; height: 100%; background: transparent; transition: background var(--dur-base); }
  .psh-tasks__resizer:hover::before { background: var(--brand); }
  .psh-body.is-tcollapsed .psh-tasks__resizer { display: none; }

  /* While dragging: kill transitions so the panel tracks the cursor 1:1. */
  .psh-resizing { cursor: col-resize; }
  .psh-resizing, .psh-resizing * { user-select: none; }
  .psh-resizing .psh-body, .psh-resizing .psh-tasks { transition: none; }

  /* Floating re-open tab, pinned to the right edge when collapsed. */
  .psh-tasks-reopen { display: inline-flex; align-items: center; gap: 7px; position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 60; padding: 12px 12px 12px 14px; background: #fff; border: 1px solid var(--border); border-right: none; border-radius: 14px 0 0 14px; box-shadow: var(--shadow-md); color: var(--ink-900); animation: reopenIn var(--dur-slow, .32s) var(--ease-out); }
  .psh-tasks-reopen:hover { background: var(--n-50); padding-left: 18px; }
  .psh-tasks-reopen__n { font-size: 11px; font-weight: 700; color: var(--brand); background: var(--brand-subtle); border-radius: 99px; padding: 1px 7px; font-variant-numeric: tabular-nums; }
}
@keyframes reopenIn { from { transform: translate(100%, -50%); opacity: 0; } to { transform: translate(0, -50%); opacity: 1; } }

/* site filter banner */
.psh-sitefilter { display: flex; align-items: center; gap: 9px; margin: 8px 8px 4px; padding: 9px 12px; background: var(--brand-subtle); border: 1px solid var(--red-200); border-radius: var(--radius-md); font-size: 12.5px; color: var(--brand-press); }
.psh-sitefilter b { font-weight: 700; }
.psh-sitefilter__x { margin-left: auto; display: inline-flex; color: var(--brand-press); padding: 3px; border-radius: 6px; }
.psh-sitefilter__x:hover { background: rgba(217,4,41,.12); }

/* task item */
.task { display: flex; gap: 11px; padding: 13px 10px; border-radius: var(--radius-md); transition: background var(--dur-base); position: relative; }
.task:hover { background: var(--n-50); }
.task.is-related { background: var(--brand-subtle); }
.task__check { margin-top: 1px; width: 21px; height: 21px; border-radius: 6px; border: 1.5px solid var(--border-strong); background: #fff; display: inline-flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; transition: background var(--dur-fast), border-color var(--dur-fast); }
.task__check:hover { border-color: var(--green-500); }
.task__check svg { opacity: 0; transform: scale(.5); transition: all var(--dur-fast); }
.task.is-done .task__check { background: var(--green-500); border-color: var(--green-500); }
.task.is-done .task__check svg { opacity: 1; transform: scale(1); }
.task__body { min-width: 0; flex: 1; }
.task__name { font-size: 14px; font-weight: 500; color: var(--ink-900); line-height: 1.35; padding-right: 26px; }
.task.is-done .task__name { text-decoration: line-through; color: var(--text-faint); }
.task__metarow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.task__due { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.task__due--overdue { color: var(--brand); }
.task__due--today { color: var(--amber-600); }
.task__due--soon, .task__due--future { color: var(--text-muted); }
.prio { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; padding: 2px 7px; border-radius: var(--radius-pill); }
.prio--Urgent { background: var(--red-50); color: var(--brand-press); }
.prio--High   { background: #FCEFCE; color: var(--amber-600); }
.prio--Medium { background: var(--teal-100); color: var(--ink-700); }
.prio--Low    { background: var(--n-100); color: var(--n-600); }

.task__sitechip { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 5px 9px 5px 7px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-pill); transition: border-color var(--dur-base), background var(--dur-base); max-width: 100%; }
.task__sitechip:hover { border-color: var(--ink-700); background: var(--n-50); }
.task__sitechip__name { min-width: 0; font-size: 12px; font-weight: 600; color: var(--text-body); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task.is-clickable { cursor: pointer; }
.task.is-clickable:hover { background: var(--brand-subtle); }
.task__sitechip--link { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 5px 11px 5px 9px; background: var(--brand-subtle); border: 1px solid transparent; border-radius: var(--radius-pill); font-size: 12px; font-weight: 700; color: var(--brand); transition: background var(--dur-base), border-color var(--dur-base); }
.task__sitechip--link:hover { background: #fff; border-color: var(--brand); }
/* linked chip + its reassign affordance sit on one row */
/* Chip + reassign share a row; if the chip is long it ellipsizes, and when there
   isn't room the reassign wraps to the next line — never overflowing horizontally. */
.task__chipwrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 10px; max-width: 100%; }
.task__chipwrap .task__sitechip { margin-top: 0; min-width: 0; }
.task__reassign { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; padding: 3px 8px; border-radius: var(--radius-pill); border: 1px solid transparent; background: transparent; color: var(--text-faint); opacity: 0.75; transition: opacity var(--dur-base), background var(--dur-base), color var(--dur-base); }
.task__reassign__label { font-size: 11px; font-style: italic; font-weight: 500; }
.task:hover .task__reassign, .sd-task:hover .task__reassign { opacity: 1; }
.task__reassign:hover { background: var(--brand-subtle); color: var(--brand); }
.task__reassign:focus-visible { opacity: 1; outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.task__asana { position: absolute; top: 12px; right: 10px; opacity: 0; color: var(--text-faint); padding: 4px; border-radius: 6px; transition: opacity var(--dur-base), color var(--dur-base), background var(--dur-base); }
.task:hover .task__asana { opacity: 1; }
.task__asana:hover { color: var(--ink-900); background: var(--n-100); }

.task-empty { text-align: center; padding: 42px 24px; color: var(--text-muted); }
.task-empty__icon { width: 52px; height: 52px; border-radius: var(--radius-pill); background: var(--n-100); color: var(--text-faint); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.task-empty__title { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink-900); }
.task-empty__sub { font-size: 13px; margin-top: 5px; line-height: 1.5; }

/* ---------------- Modal ---------------- */
/* z-index 1000: the modal overlay must sit ABOVE the transient layers behind it —
   dropdown panels (200) and especially the tooltip host-lift (300, see the
   [data-tooltip] lift rule). A card's "Log in to WP" button keeps focus after the
   click that opens this modal, so :focus-within lifts it to 300; because the card
   (.site) is position:relative WITHOUT a z-index it is NOT a stacking context, so
   that 300 competes directly here in #psh-root and would paint the button on top of
   the overlay unless the overlay out-layers it. Tooltips INSIDE the modal still work:
   the overlay is its own stacking context, so their lift is scoped within it. */
.psh-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,22,30,.55); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fadeIn var(--dur-base) var(--ease-standard); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.psh-modal { width: 100%; max-width: 480px; background: #fff; border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-xl); animation: popIn var(--dur-slow) var(--ease-out); }
.psh-modal--danger { border-top: 5px solid var(--brand); }
.psh-modal__head { display: flex; gap: 14px; padding: 24px 26px 0; align-items: flex-start; }
.psh-modal__icon { width: 46px; height: 46px; border-radius: var(--radius-pill); background: var(--brand-subtle); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.psh-modal__title { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--ink-900); letter-spacing: -0.01em; line-height: 1.2; }
.psh-modal__body { padding: 14px 26px 8px; }
.psh-modal__text { font-size: 14.5px; line-height: 1.6; color: var(--text-body); }
.psh-modal__text strong { color: var(--ink-900); font-weight: 700; }
.psh-modal__callout { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 14px; background: var(--n-50); border: 1px solid var(--border); border-radius: var(--radius-md); font-size: 13px; color: var(--text-body); }
.psh-modal__callout svg { color: var(--text-muted); flex-shrink: 0; }
.psh-modal__foot { display: flex; gap: 10px; justify-content: flex-end; padding: 18px 26px 24px; }
.psh-modal__envrow { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.psh-modal__domain { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }

/* site picker (link-task modal) */
.psh-picker { max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--n-50); }
.psh-picker__row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 12px; background: transparent; border: none; border-bottom: 1px solid var(--border); text-align: left; cursor: pointer; transition: background var(--dur-fast); }
.psh-picker__row:last-child { border-bottom: none; }
.psh-picker__row:hover { background: #fff; }
.psh-picker__row.is-selected { background: var(--brand-subtle); }
.psh-picker__row.is-selected svg { color: var(--brand); margin-left: auto; }
.psh-picker__fav { width: 30px; height: 30px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.psh-picker__body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.psh-picker__name { font-size: 13.5px; font-weight: 600; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psh-picker__domain { font-size: 12px; font-family: var(--font-mono); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psh-picker__empty { padding: 22px 14px; text-align: center; font-size: 13px; color: var(--text-muted); }
/* Compact variant (task reassign): keep the dialog from eating the viewport. */
.psh-modal--compact .psh-modal__body { padding-top: 12px; padding-bottom: 4px; }
.psh-modal--compact .psh-picker { max-height: 184px; }
.psh-modal--compact .psh-modal__callout { margin-top: 10px; padding: 8px 12px; font-size: 12px; }
.psh-modal--compact .psh-modal__callout svg { width: 15px; height: 15px; }
/* Tall variant: the dialog's own body scrolls, so a dialog whose length is
   operator-configurable (the maintenance sign-off checklist) can never push its
   confirm button off-screen. */
.psh-modal--tall { display: flex; flex-direction: column; max-height: calc(100vh - 48px); }
.psh-modal--tall .psh-modal__head,
.psh-modal--tall .psh-modal__foot { flex-shrink: 0; }
.psh-modal--tall .psh-modal__body { overflow-y: auto; }

.psh-modal__note { margin: 10px 2px 0; font-size: 11.5px; line-height: 1.4; color: var(--text-faint); text-align: center; }
/* In-modal error notice (the app doesn't load admin-settings.css, so .psh-notice
   isn't available here — this is the styled equivalent for modal-scoped errors). */
.psh-modal__error { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; background: var(--red-50); border: 1px solid var(--red-200); border-radius: var(--radius-md); font-size: 13px; line-height: 1.5; color: var(--red-800); }
.psh-modal__error svg { color: var(--red-500); flex-shrink: 0; margin-top: 1px; }

/* ---------------- Toast ---------------- */
.psh-toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 1100; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.psh-toast { display: flex; align-items: center; gap: 12px; background: var(--ink-900); color: #fff; padding: 13px 16px; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); font-size: 13.5px; min-width: 300px; animation: toastIn var(--dur-slow) var(--ease-out); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.psh-toast__icon { width: 26px; height: 26px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.psh-toast__icon--ok { background: rgba(31,138,91,.25); color: #6ee7b0; }
.psh-toast__icon--brand { background: rgba(217,4,41,.3); color: #ffb3bd; }
.psh-toast__icon--bad { background: rgba(185,28,28,.28); color: #fca5a5; }
.psh-toast__icon--warn { background: rgba(245,158,11,.25); color: #fcd34d; }
.psh-toast__msg b { font-weight: 700; }
.psh-toast__action { margin-left: auto; font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--red-300); padding: 4px 8px; border-radius: 7px; }
.psh-toast__action:hover { background: rgba(255,255,255,.1); }

/* ---------------- Login ---------------- */
.psh-login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; font-family: var(--font-body); color: var(--text-body); -webkit-font-smoothing: antialiased; }
.psh-login__panel { background: var(--ink-900); position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start; padding: 48px; color: #fff; }
.psh-login__halfcircle { position: absolute; border-radius: 50%; background: var(--red-800); }
.psh-login__hc1 { width: 520px; height: 520px; right: -230px; top: -120px; background: var(--red-700); opacity: .55; }
.psh-login__hc2 { width: 360px; height: 360px; left: -160px; bottom: -120px; background: var(--red-900); opacity: .6; }
.psh-login__brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.psh-login__pitch { position: relative; z-index: 1; max-width: 440px; margin: auto 0; }
.psh-login__pitch h1 { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1.08; letter-spacing: -0.025em; color: #fff; }
.psh-login__pitch h1 span { color: var(--red-400); }
.psh-login__pitch p { font-size: 16px; line-height: 1.6; color: rgba(255,255,255,.72); margin-top: 16px; }
.psh-login__stats { position: relative; z-index: 1; display: flex; gap: 30px; }
.psh-login__stat b { display: block; font-family: var(--font-display); font-weight: 800; font-size: 26px; color: #fff; letter-spacing: -0.02em; }
.psh-login__stat span { font-size: 12.5px; color: rgba(255,255,255,.6); }
.psh-login__form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px; background: var(--n-50); }
.psh-login__card { width: 100%; max-width: 380px; }
.psh-login__card h2 { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--ink-900); letter-spacing: -0.02em; }
.psh-login__card > p { font-size: 14.5px; color: var(--text-muted); margin-top: 8px; line-height: 1.55; }
.psh-google { display: flex; align-items: center; justify-content: center; gap: 11px; width: 100%; height: 52px; margin-top: 28px; border-radius: var(--radius-pill); background: #fff; border: 1.5px solid var(--border-strong); font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--ink-900); transition: border-color var(--dur-base), box-shadow var(--dur-base), transform var(--dur-fast); }
.psh-google:hover { border-color: var(--ink-700); box-shadow: var(--shadow-md); }
.psh-google:active { transform: translateY(1px); }
.psh-login__note { display: flex; gap: 9px; align-items: flex-start; margin-top: 22px; font-size: 12.5px; line-height: 1.55; color: var(--text-muted); }
.psh-login__note svg { flex-shrink: 0; margin-top: 1px; color: var(--green-600); }

/* ---------------- Top bar density ---------------- */
/* The knobs on .psh-top__inner shrink the gaps, the label size and the search
   continuously. What cannot be interpolated is secondary text that reads better
   dropped than shrunk, so it steps out here, widest viewport first. Each of
   these is still shown in full elsewhere — the name and role in the account
   dropdown, the Hub's name beside its mark — so nothing becomes unreachable.
   Below ~960px even this is not enough and the nav strip scrolls horizontally;
   it still never wraps and never squeezes a neighbour. */
@media (max-width: 1340px) { .psh-userchip__meta { display: none; } }
@media (max-width: 1180px) { .psh-brand__name { display: none; } }
/* Narrow enough that the strip scrolls: fade its trailing edge so a half-shown
   item reads as "there is more here", not as a clipped label. */
@media (max-width: 960px) {
  .psh-nav { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
}

/* ---------------- Tablet drawer ---------------- */
.psh-tasks-toggle { display: none; }
.psh-tasks__close { display: none; }

@media (max-width: 820px) {
  .psh-body { grid-template-columns: 1fr; }
  .psh-tasks { position: fixed; top: 0; right: 0; height: 100vh; width: 392px; max-width: 92vw; z-index: 70; box-shadow: var(--shadow-xl); transform: translateX(100%); transition: transform var(--dur-slow) var(--ease-out); }
  .psh-tasks.is-open { transform: none; }
  .psh-tasks__close { display: inline-flex; }
  .psh-tasks-toggle { display: inline-flex; }
}
@media (max-width: 760px) {
  /* Mobile header stacks into tidy rows: row 1 = brand + bell + user menu;
     row 2 = the global search (full width); row 3 = the nav, a horizontally-
     scrollable strip so Sites / Asana / Users / Design / Audit stay tappable.
     `order` drives the rows so the bell + user stay up on row 1 next to the
     brand (a bare `.psh-gs` at width:100% used to wrap them onto their own row). */
  .psh-top__search { display: none; }
  .psh-top__inner { flex-wrap: wrap; height: auto; min-height: 64px; padding: 10px 16px; gap: 8px 12px; }
  .psh-notif { margin-left: auto; order: 1; }
  .psh-usermenu { order: 2; }
  .psh-gs { order: 5; }
  .psh-gs .psh-top__search { display: block; }
  /* Row 1 is only brand + bell + avatar here, so the wordmark fits again. */
  .psh-brand__name { display: inline; }
  /* Full-width row of its own; it already scrolls and hides its bar up top. */
  .psh-nav { order: 10; width: 100%; margin-left: 0; padding-bottom: 2px; }
  .psh-login { grid-template-columns: 1fr; }
  .psh-login__panel { display: none; }
  /* The dropdown is right-anchored to the bell, so on a narrow viewport it
     overflows off the left edge. Pin it to the viewport as a full-width sheet
     below the 64px top bar instead. Fixed = viewport-relative, so the WP admin
     bar (46px at this width) must be added to the top offset when present. */
  .psh-notif__panel { position: fixed; top: 72px; left: 12px; right: 12px; width: auto; max-width: none; }
  body.admin-bar .psh-notif__panel { top: 118px; }
  .psh-notif__list { max-height: calc(var(--psh-h, 100vh) - 140px); }
}
/* Phones: tighten the sites page and let the controls use the full width. */
@media (max-width: 560px) {
  .psh-main { padding: 20px 14px 48px; }
  .psh-toolbar { gap: 14px; margin-bottom: 18px; }
  .psh-toolbar__title h1 { font-size: 26px; }
  .psh-controls { width: 100%; gap: 10px; }
  .psh-controls > .psh-btn { flex: 1 1 auto; justify-content: center; } /* Sync / New folder / Add site share the row evenly */
  .psh-seg { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .psh-seg__btn { flex: 1 0 auto; justify-content: center; }
  .psh-select { flex: 1 1 auto; }
  .psh-select select { width: 100%; }
}

/* ---------------- Card integration icons ---------------- */
.site__apps { display: flex; align-items: center; gap: 6px; padding-top: 2px; border-top: 1px solid var(--divider); margin-top: -2px; }
.site__apps__label { font-size: 11px; font-weight: 600; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 4px; }
.appicon { width: 30px; height: 30px; border-radius: 9px; background: var(--n-50); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; cursor: pointer; transition: transform var(--dur-fast) var(--ease-standard), box-shadow var(--dur-base), border-color var(--dur-base); }
.appicon:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.appicon:active { transform: translateY(0); }

/* ---------------- Tooltip (design system) ----------------
   Styled replacement for the native `title`. Any element carrying a
   `data-tooltip` attribute gets a token-driven bubble + arrow on hover and
   keyboard focus. Text is the attribute value, e.g. "CallRail — Corky's Pest
   Control" or "Figma — Corky's - Website". Reusable across the app.
   NOTE: `[data-tooltip] { position: relative }` lives near the TOP of this file
   (before the component rules) on purpose — see the comment there. */
/* `display: none` (not just opacity/visibility) is load-bearing: an absolutely
   positioned pseudo-element still contributes to its scroll container's SCROLLABLE
   OVERFLOW while it is merely transparent, so a tooltip on a control near the right
   edge gives the container a phantom horizontal scrollbar even though nothing is
   visible. `visibility: hidden` does NOT help (measured) — only taking the box out of
   layout does. `transition-behavior: allow-discrete` + `@starting-style` below keep the
   fade-in; where those are unsupported the bubble simply appears without the fade. */
[data-tooltip]::after,
[data-tooltip]::before {
  display: none;
  position: absolute;
  left: 50%;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out), display var(--dur-fast) allow-discrete;
}
/* While a tooltip is showing, lift its host above neighbouring cards/rows so the
   bubble is never painted under a sibling. Every [data-tooltip] is position:relative
   (see the anchor rule near the top of this file), so z-index takes effect.
   NOTE: this lift is NOT reliably scoped — hosts sit inside cards (.site) that are
   position:relative WITHOUT a z-index, so they are not stacking contexts and this 300
   competes in #psh-root. The modal overlay (z-index 1000) and toasts (1100) are layered
   above 300 on purpose so this lift can never paint over them; keep them above this. */
[data-tooltip]:hover,
[data-tooltip]:focus-visible,
[data-tooltip]:focus-within { z-index: 300; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  bottom: calc(100% + 9px);
  width: max-content;
  max-width: 260px;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  background: var(--ink-900);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--fw-medium);
  line-height: 1.35;
  letter-spacing: -0.005em;
  text-align: center;
  white-space: pre-line;
  box-shadow: var(--shadow-md);
}
[data-tooltip]::before {
  content: "";
  bottom: calc(100% + 4px);
  border: 5px solid transparent;
  border-top-color: var(--ink-900);
}
[data-tooltip]:hover::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::after,
[data-tooltip]:focus-visible::before {
  display: block;
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: 260ms;
}
@media (prefers-reduced-motion: reduce) {
  [data-tooltip]::after,
  [data-tooltip]::before { transform: translateX(-50%); transition: opacity var(--dur-fast) linear; }
  [data-tooltip]:hover::after,
  [data-tooltip]:hover::before,
  [data-tooltip]:focus-visible::after,
  [data-tooltip]:focus-visible::before { transform: translateX(-50%); }
}

/* Downward variant. A control near the TOP of a scrolling panel would otherwise open
   its bubble upward and paint it over the panel's own chrome (the site modal's tab
   bar), covering navigation. `data-tooltip-side="bottom"` opens below the host instead,
   so nothing is overlapped and nothing has to be hidden behind anything. */
[data-tooltip][data-tooltip-side="bottom"]::after {
  bottom: auto;
  top: calc(100% + 9px);
}
[data-tooltip][data-tooltip-side="bottom"]::before {
  bottom: auto;
  top: calc(100% + 4px);
  border-top-color: transparent;
  border-bottom-color: var(--ink-900);
}

/* Right-aligned variant for a host that sits flush with its container's right edge:
   the default centred bubble would grow past it and (while shown) give the scroll
   container a horizontal scrollbar. `data-tooltip-align="end"` makes the bubble grow
   LEFTWARDS instead. The arrow stays centred on the host — it is 6px wide and never
   overflows. Reusable anywhere a tooltip anchors to the last control in a row. */
[data-tooltip][data-tooltip-align="end"]::after {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}
[data-tooltip][data-tooltip-align="end"]:hover::after,
[data-tooltip][data-tooltip-align="end"]:focus-visible::after {
  transform: translate(0, 0);
}
@media (prefers-reduced-motion: reduce) {
  [data-tooltip][data-tooltip-align="end"]::after,
  [data-tooltip][data-tooltip-align="end"]:hover::after,
  [data-tooltip][data-tooltip-align="end"]:focus-visible::after { transform: none; }
}
@starting-style {
  [data-tooltip][data-tooltip-align="end"]:hover::after,
  [data-tooltip][data-tooltip-align="end"]:focus-visible::after {
    opacity: 0;
    transform: translate(0, 4px);
  }
}

/* Entry animation from `display: none`. Ignored by engines without @starting-style,
   which then show the bubble immediately — acceptable, and still no phantom scrollbar. */
@starting-style {
  [data-tooltip]:hover::after,
  [data-tooltip]:hover::before,
  [data-tooltip]:focus-visible::after,
  [data-tooltip]:focus-visible::before {
    opacity: 0;
    transform: translate(-50%, 4px);
  }
}
/* Nested tooltips: a [data-tooltip] host (e.g. a clickable .task row) often wraps
   children that carry their own tooltip (the site chip, reassign, assignee, Asana
   link). CSS :hover matches the host AND its ancestors, so hovering a child would
   otherwise reveal BOTH bubbles at once (the chip's "Jump to this site's card" showed
   twice). Suppress the ancestor's bubble whenever a descendant tooltip is the target,
   leaving only the innermost, most specific one. Higher specificity than the reveal
   rules above, so it wins without !important. */
[data-tooltip]:has([data-tooltip]:hover)::after,
[data-tooltip]:has([data-tooltip]:hover)::before,
[data-tooltip]:has([data-tooltip]:focus-visible)::after,
[data-tooltip]:has([data-tooltip]:focus-visible)::before {
  opacity: 0;
  transition-delay: 0s;
}

/* Directional variants. The default bubble points UP (sits above the element),
   which clips for elements near the top of the viewport (the header) or the right
   edge (table action icons). `data-tooltip-pos` flips the bubble + arrow so those
   places get a tooltip that stays on-screen. */
[data-tooltip-pos="bottom"]::after { bottom: auto; top: calc(100% + 9px); }
[data-tooltip-pos="bottom"]::before { bottom: auto; top: calc(100% + 4px); border-top-color: transparent; border-bottom-color: var(--ink-900); }
[data-tooltip-pos="bottom"]::after,
[data-tooltip-pos="bottom"]::before { transform: translate(-50%, -4px); }
[data-tooltip-pos="bottom"]:hover::after,
[data-tooltip-pos="bottom"]:hover::before,
[data-tooltip-pos="bottom"]:focus-visible::after,
[data-tooltip-pos="bottom"]:focus-visible::before { transform: translate(-50%, 0); }

[data-tooltip-pos="left"]::after { bottom: auto; top: 50%; left: auto; right: calc(100% + 9px); transform: translate(4px, -50%); }
[data-tooltip-pos="left"]::before { bottom: auto; top: 50%; left: auto; right: calc(100% + 4px); border-top-color: transparent; border-left-color: var(--ink-900); transform: translate(4px, -50%); }
[data-tooltip-pos="left"]:hover::after,
[data-tooltip-pos="left"]:hover::before,
[data-tooltip-pos="left"]:focus-visible::after,
[data-tooltip-pos="left"]:focus-visible::before { transform: translate(0, -50%); }

/* ---------------- Task assignee ---------------- */
.task__assignee { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--text-muted); }

/* ---------------- Site detail overlay ---------------- */
.sd { width: 100%; max-width: 1040px; max-height: 90vh; background: var(--n-50); border-radius: var(--radius-xl); overflow: hidden; box-shadow: var(--shadow-xl); display: flex; flex-direction: column; animation: popIn var(--dur-slow) var(--ease-out); }
/* position+z-index: the modal's own chrome must outrank the [data-tooltip] hover lift
   (z-index 300), so a bubble raised inside the scrolling body can never paint over the
   header actions or the tab bar. Keep these below the overlay (1000) and toasts (1100). */
.sd__head { display: flex; align-items: center; gap: 16px; padding: 22px 24px; background: #fff; border-bottom: 1px solid var(--border); flex-shrink: 0; position: relative; z-index: 400; }
.sd__head-id { min-width: 0; flex: 1; }
.sd__head-top { display: flex; align-items: center; gap: 12px; }
.sd__head-top h2 { font-family: var(--font-display); font-weight: 800; font-size: 22px; color: var(--ink-900); letter-spacing: -0.02em; margin: 0; }
.sd__head-domain { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); margin-top: 5px; overflow-wrap: anywhere; }
.sd__head-health { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; font-family: var(--font-body); font-weight: 500; }
/* Domain in the modal header is a link to the live site (opens in a new tab). */
.sd__head-link { display: inline-flex; align-items: center; gap: 7px; color: inherit; text-decoration: none; }
.sd__head-link svg { flex-shrink: 0; }
.sd__head-link svg:last-child { color: var(--text-faint); }
.sd__head-link:hover { color: var(--brand-press); text-decoration: underline; }
.sd__head-link:hover svg:last-child { color: var(--brand-press); }
.sd__head-actions { display: flex; align-items: center; gap: 8px; }
.sd__close { background: var(--n-100) !important; }
.sd__close:hover { background: var(--n-200) !important; }

.sd__tabs { display: flex; gap: 2px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--border); flex-shrink: 0; position: relative; z-index: 400; }
.sd__tab { display: inline-flex; align-items: center; gap: 8px; padding: 13px 16px; font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--text-muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; transition: color var(--dur-base), border-color var(--dur-base); }
.sd__tab:hover { color: var(--ink-900); }
.sd__tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }
.sd__tab-n { font-size: 11px; font-weight: 700; background: var(--brand-subtle); color: var(--brand); border-radius: 99px; padding: 1px 7px; }

.sd__body { padding: 22px 24px; overflow-y: auto; flex: 1 1 auto; min-height: 0; -webkit-overflow-scrolling: touch; }
.sd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
/* Single full-width column (Credentials tab): cards stack and use the whole width. */
.sd-stack { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.sd-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.sd-card__title { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink-900); margin: 0 0 16px; }
.sd-card__hint { margin-left: auto; font-family: var(--font-body); font-weight: 500; font-size: 11.5px; color: var(--text-faint); text-transform: none; letter-spacing: 0; }

.sd-facts { display: flex; flex-direction: column; }
.sd-fact { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--divider); }
.sd-fact:last-child { border-bottom: 0; }
.sd-fact__k { font-size: 13px; color: var(--text-muted); flex-shrink: 0; }
.sd-fact__v { font-size: 13px; font-weight: 600; color: var(--ink-900); text-align: right; min-width: 0; overflow-wrap: anywhere; }

.sd-links { display: flex; flex-direction: column; gap: 8px; }
.sd-link { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 12px; border-radius: var(--radius-md); border: 1px solid var(--border); background: #fff; transition: border-color var(--dur-base), background var(--dur-base); }
.sd-link:hover { border-color: var(--ink-700); background: var(--n-25); }
.sd-link__icon { width: 34px; height: 34px; border-radius: 9px; background: var(--n-50); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sd-link__text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.sd-link__label { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink-900); }
.sd-link__detail { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-link__copy { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-display); font-weight: 600; font-size: 12px; color: var(--text-muted); opacity: 0; transition: opacity var(--dur-base); white-space: nowrap; }
.sd-link:hover .sd-link__copy { opacity: 1; }
.sd-link__open { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; }
.sd-link__open:hover { background: var(--n-100); color: var(--ink-900); }

/* Staging ↔ production relationship (detail drawer) */
.sd-srcbadge { margin-left: auto; font-family: var(--font-body); font-weight: 600; font-size: 10.5px; letter-spacing: 0.03em; text-transform: uppercase; padding: 2px 8px; border-radius: var(--radius-pill); }
.sd-srcbadge--auto { color: var(--text-muted); background: var(--n-100); }
.sd-srcbadge--manual { color: var(--brand); background: var(--brand-subtle); }
.sd-envlinks { display: flex; flex-direction: column; gap: 8px; }
.sd-envlink { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--radius-md); border: 1px solid var(--border); background: #fff; transition: border-color var(--dur-base), background var(--dur-base); }
.sd-envlink:hover { border-color: var(--ink-700); background: var(--n-25); }
.sd-envlink__fav { width: 34px; height: 34px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 14px; flex-shrink: 0; }
.sd-envlink__text { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.sd-envlink__name { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-envlink__domain { font-size: 12px; font-family: var(--font-mono); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-envlink__badge { flex-shrink: 0; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--brand); background: var(--brand-subtle); border-radius: var(--radius-pill); padding: 2px 7px; }
.sd-prodlink__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.sd-prodpicker { width: 100%; }

.sd-tasks { display: flex; flex-direction: column; gap: 4px; }
.sd-task { display: flex; align-items: center; gap: 12px; padding: 13px 12px; border-radius: var(--radius-md); transition: background var(--dur-base); }
.sd-task:hover { background: #fff; }
.sd-task__main { min-width: 0; flex: 1; }
.sd-task__name { font-size: 14px; font-weight: 500; color: var(--ink-900); }
.sd-task.is-done .sd-task__name { text-decoration: line-through; color: var(--text-faint); }
.sd-task__assignee { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.sd-task__who { line-height: 1.25; }
.sd-task__who b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--ink-900); }
.sd-task__who span { font-size: 11.5px; color: var(--text-muted); }

.sd-cred { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--divider); }
.sd-cred__k { font-size: 13px; color: var(--text-muted); }
.sd-cred__v { font-family: var(--font-mono); font-size: 14px; color: var(--ink-900); letter-spacing: 0.04em; }
.sd-confirm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 16px; padding: 13px 14px; background: var(--brand-subtle); border: 1px solid var(--red-200); border-radius: var(--radius-md); font-size: 13px; color: var(--brand-press); }
.sd-confirm__btns { display: flex; gap: 8px; margin-left: auto; }
.sd-revealed { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; font-weight: 500; color: var(--green-600); }

.sd-activity { display: flex; flex-direction: column; }
.sd-act { display: flex; align-items: center; gap: 12px; padding: 13px 4px; border-bottom: 1px solid var(--divider); }
.sd-act:last-child { border-bottom: 0; }
.sd-act__text { flex: 1; font-size: 13.5px; color: var(--text-body); }
.sd-act__text b { font-weight: 600; color: var(--ink-900); }
.sd-act__ts { font-family: var(--font-mono); font-size: 12px; color: var(--text-faint); white-space: nowrap; }

/* Detail modal — responsive. The two-column overview collapses to one on tablets;
   on phones the modal becomes a full-height sheet so long facts (domains, client
   names) wrap instead of forcing horizontal scroll, and the header stacks. */
@media (max-width: 720px) { .sd-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .psh-overlay { padding: 0; align-items: stretch; }
  .sd { max-width: none; max-height: 100%; height: 100%; border-radius: 0; }
  .sd__head { flex-wrap: wrap; align-items: flex-start; gap: 12px 14px; padding: 16px; }
  .sd__head-top h2 { font-size: 19px; }
  .sd__head-actions { order: 3; width: 100%; }
  .sd__head-actions .psh-btn--primary { flex: 1; justify-content: center; }
  .sd__tabs { padding: 0 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .sd__tabs::-webkit-scrollbar { display: none; }
  .sd__tab { padding: 13px 12px; white-space: nowrap; }
  .sd__body { padding: 16px 14px 28px; }
  .sd-card { padding: 16px; }
}

/* ============================================================
   WordPress embed: gate, loading & error states
   ============================================================ */
.psh-gate { max-width: 520px; margin: 40px auto; padding: 22px 24px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); font-family: var(--font-body); color: var(--text-body); text-align: center; }
.psh-gate a { font-weight: 600; color: var(--brand); }
.psh-boot { min-height: 60vh; display: flex; align-items: center; justify-content: center; padding: 48px 24px; font-family: var(--font-body); }
.psh-boot__inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.psh-boot__spinner { width: 34px; height: 34px; border-radius: 99px; border: 3px solid var(--n-200); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.psh-boot__title { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--ink-900); }
.psh-boot__sub { font-size: 13.5px; color: var(--text-muted); max-width: 440px; line-height: 1.5; }
.psh-boot__link { font-size: 13px; color: var(--text-muted); text-decoration: underline; }

/* ---------------- Local organization: folders + drag & drop ---------------- */
.site { position: relative; }
.site__grip { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; color: var(--n-400); cursor: grab; border-radius: 7px; opacity: 0; transition: opacity var(--dur-base), background var(--dur-base), color var(--dur-base); }
.site:hover .site__grip { opacity: 1; }
.site__grip:hover { background: var(--n-100); color: var(--ink-700); }
.site__grip:active { cursor: grabbing; }
/* Favorite star — mirrors the grip: reveals on card hover, but stays visible (gold)
   once the site is starred. Sits just left of the grip in the top-right corner. */
.site__star { position: absolute; top: 8px; right: 36px; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; color: var(--n-400); cursor: pointer; border: none; background: transparent; border-radius: 7px; opacity: 0; transition: opacity var(--dur-base), background var(--dur-base), color var(--dur-base); }
.site:hover .site__star { opacity: 1; }
.site__star:hover { background: var(--n-100); color: var(--amber-600); }
.site__star.is-active { opacity: 1; color: var(--amber-500); }
.site__star.is-active:hover { color: var(--amber-600); }
.site--dragging { opacity: 0.4; }
.site--dropbefore { box-shadow: -4px 0 0 0 var(--brand), var(--shadow-sm); }
.site__rename { width: 100%; font-family: var(--font-display); font-weight: 700; font-size: 16px; color: var(--ink-900); border: 1px solid var(--brand); border-radius: 8px; padding: 2px 7px; outline: none; background: #fff; }

.folders { display: flex; flex-direction: column; gap: 18px; }
.folder { border-radius: var(--radius-lg); transition: box-shadow var(--dur-base), background var(--dur-base); scroll-margin-top: 90px; }
.folder.is-pulsing { animation: sitePulse 0.9s var(--ease-out); } /* jump-to-folder attention pulse (reuses the site card keyframes) */
.folder--dragging { opacity: 0.5; }
.folder--dropinto { background: var(--red-50); box-shadow: 0 0 0 2px var(--brand) inset; }
.folder--dropbefore { box-shadow: 0 -3px 0 0 var(--brand); }
.folder__head { display: flex; align-items: center; gap: 9px; padding: 6px 4px 10px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.folder__grip { display: inline-flex; align-items: center; color: var(--n-400); cursor: grab; }
.folder__grip:active { cursor: grabbing; }
.folder__toggle { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 6px; color: var(--ink-700); background: transparent; }
.folder__toggle:hover { background: var(--n-100); }
.folder__icon { display: inline-flex; align-items: center; color: var(--ink-700); }
.folder__name { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink-900); letter-spacing: -0.01em; cursor: text; }
.folder__rename { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink-900); border: 1px solid var(--brand); border-radius: 7px; padding: 2px 8px; outline: none; min-width: 180px; }
.folder__count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: var(--radius-pill); background: var(--n-100); color: var(--text-muted); font-size: 12px; font-weight: 700; }
/* Folder favorite star — reveals on header hover, stays gold once starred. Sits
   inline right after the count, before the (hover-only) rename/delete actions. */
.folder__star { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: none; background: transparent; border-radius: 7px; color: var(--n-400); cursor: pointer; opacity: 0; transition: opacity var(--dur-base), background var(--dur-base), color var(--dur-base); }
.folder__head:hover .folder__star { opacity: 1; }
.folder__star:hover { background: var(--n-100); color: var(--amber-600); }
.folder__star.is-active { opacity: 1; color: var(--amber-500); }
.folder__star.is-active:hover { color: var(--amber-600); }
/* Right-hand cluster: hover-revealed rename/delete + (when collapsed) quick logins. */
.folder__tail { margin-left: auto; display: flex; align-items: center; gap: 9px; }
.folder__actions { display: flex; gap: 4px; opacity: 0; transition: opacity var(--dur-base); }
.folder__head:hover .folder__actions { opacity: 1; }
.folder__act { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; color: var(--text-muted); background: transparent; }
.folder__act:hover { background: var(--n-100); color: var(--ink-900); }
.folder__act--danger:hover { background: var(--red-50); color: var(--brand); }
.folder__body { min-height: 24px; }
.folder__empty { display: flex; align-items: center; justify-content: center; padding: 22px; border: 1.5px dashed var(--border); border-radius: var(--radius-lg); color: var(--text-muted); font-size: 13px; }
/* Collapsed-folder quick logins: one compact pill per site, labelled PRD/STG/DEV
   (the dot reuses the env badge palette). Last item of .folder__tail, so it sits
   at the header's right edge, in line with the cards' login column.
   No text-transform here: the [data-tooltip] bubble is the button's ::after and
   inherits it (the bubble resets letter-spacing, not text-transform), which would
   uppercase the domain in the tooltip. The env codes are already uppercase. */
.folder__quick { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.folder__login { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 9px; border-radius: var(--radius-pill); border: 1.5px solid var(--border-strong); background: #fff; color: var(--ink-900); font-family: var(--font-display); font-weight: 700; font-size: 11.5px; letter-spacing: 0.07em; white-space: nowrap; cursor: pointer; transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast); }
.folder__login svg { color: var(--brand); }
.folder__login:hover { border-color: var(--brand); background: var(--brand-subtle); color: var(--brand); }
.folder__login[disabled] { opacity: .5; cursor: not-allowed; }
.folder__login[disabled]:hover { border-color: var(--border-strong); background: #fff; color: var(--ink-900); }
.folder__login[disabled] svg { color: var(--text-muted); }
.folder__login .psh-btnspin { width: 13px; height: 13px; border-color: rgba(0,35,48,.25); border-top-color: var(--brand); }
.folder__login__dot { width: 7px; height: 7px; border-radius: 99px; flex-shrink: 0; background: var(--n-400); }
.folder__login--production .folder__login__dot { background: var(--ink-900); }
.folder__login--staging .folder__login__dot { background: var(--amber-500); }
.folder__login--more { gap: 3px; padding: 0 8px 0 11px; letter-spacing: 0; }
.folder__login--more svg { color: currentColor; }
.folder__quickmore { position: relative; display: inline-flex; }
.folder__quickmenu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 200; min-width: 260px; max-width: calc(100vw - 24px); max-height: 320px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); padding: 5px; animation: popIn var(--dur-base) var(--ease-out); }
.folder__quickitem { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; background: transparent; border: 0; border-radius: 9px; cursor: pointer; color: var(--ink-900); font-size: 13px; }
.folder__quickitem svg { color: var(--brand); flex-shrink: 0; }
.folder__quickitem:hover { background: var(--brand-subtle); color: var(--brand); }
.folder__quickitem[disabled] { opacity: .5; cursor: not-allowed; }
.folder__quickitem[disabled]:hover { background: transparent; color: var(--ink-900); }
.folder__quickitem[disabled] svg { color: var(--text-muted); }
.folder__quickitem .psh-btnspin { width: 13px; height: 13px; border-color: rgba(0,35,48,.25); border-top-color: var(--brand); }
.folder__quickitem__domain { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Narrow screens: a header WITH quick logins wraps, and its tail takes a full second
   row — logins left, rename/delete right — so the pills never squeeze the folder
   name. Scoped to --quick so expanded folders keep today's single-row header.
   The quick group is flex-basis 0 so it and the (invisible-until-hover) actions
   always share ONE line; otherwise the actions could wrap onto a phantom row of
   their own. Pills wrap inside the group, and the "+N" menu spans the group's
   width instead of anchoring to a button that may sit anywhere in the row. */
@media (max-width: 760px) {
  .folder__head--quick { flex-wrap: wrap; row-gap: 8px; }
  .folder__head--quick .folder__tail { flex-basis: 100%; margin-left: 0; }
  .folder__head--quick .folder__quick { order: -1; flex: 1 1 0; min-width: 0; flex-wrap: wrap; row-gap: 6px; position: relative; }
  .folder__head--quick .folder__quickmore { position: static; }
  .folder__head--quick .folder__quickmenu { left: 0; right: 0; min-width: 0; }
}

.psh-newfolder { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); color: var(--ink-700); }
.psh-newfolder__input { flex: 1; min-width: 0; border: none; outline: none; font-size: 14px; color: var(--ink-900); background: transparent; }

/* Suggested placements banner (site → folder auto-assignment inbox) */
.psh-suggest { margin-bottom: 16px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); overflow: hidden; }
.psh-suggest__head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--brand-subtle); }
.psh-suggest__title { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--brand-press); }
.psh-suggest__count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--brand); color: #fff; font-size: 11px; line-height: 20px; text-align: center; }
.psh-suggest__hide { font-family: var(--font-body); font-weight: 600; font-size: 12px; color: var(--ink-600); padding: 3px 8px; border-radius: var(--radius-xs); }
.psh-suggest__hide:hover { background: rgba(0,0,0,.06); color: var(--ink-900); }
.psh-suggest__list { display: flex; flex-direction: column; }
.psh-suggest__row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--n-50); }
.psh-suggest__row:first-child { border-top: none; }
.psh-suggest__info { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }
.psh-suggest__site { font-weight: 600; font-size: 13.5px; color: var(--ink-900); }
.psh-suggest__env { margin-left: 6px; font-family: var(--font-body); font-weight: 600; font-size: 10px; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-600); background: var(--n-50); border-radius: var(--radius-pill); padding: 1px 7px; }
.psh-suggest__folder { font-weight: 600; font-size: 13.5px; color: var(--brand-press); }
.psh-suggest__conf { font-family: var(--font-body); font-weight: 600; font-size: 11px; color: var(--ink-600); }
.psh-suggest__actions { display: inline-flex; gap: 8px; flex-shrink: 0; }

/* View toggle (grid / list) */
.psh-viewtoggle { display: inline-flex; background: var(--n-100); border-radius: 10px; padding: 3px; gap: 2px; }
.psh-viewbtn { display: inline-flex; align-items: center; justify-content: center; width: 33px; height: 30px; border-radius: 7px; color: var(--text-muted); background: transparent; transition: background var(--dur-base), color var(--dur-base); }
.psh-viewbtn:hover { color: var(--ink-900); }
.psh-viewbtn.is-active { background: #fff; color: var(--ink-900); box-shadow: var(--shadow-sm); }

/* List view: each site as a compact single row (Google-Drive style) */
.psh-list { display: flex; flex-direction: column; gap: 8px; }
.site--list { flex-direction: row; align-items: center; gap: 14px; padding: 11px 16px; }
.site--list:hover { transform: none; } /* no lift for dense rows */
.site--list .site__grip { position: static; opacity: 1; width: 20px; height: 24px; flex-shrink: 0; }
/* List view: the favorite star leaves its absolute corner (where it floated over
   the chevron action) and joins the row inline right after the grip, forming a
   compact controls cluster at the row start. Always visible here, like the grip;
   is-active still turns it gold via the shared rule. */
.site--list .site__star { position: static; opacity: 1; flex-shrink: 0; }
.site--list .site__head { display: contents; }
.site--list .site__fav { width: 36px; height: 36px; font-size: 15px; }
.site--list .site__id { flex: 1 1 0; min-width: 0; } /* min-width:0 lets long names truncate instead of pushing actions off-row */
.site--list .site__client { -webkit-line-clamp: 1; font-size: 14.5px; }
.site--list .site__domain { margin-top: 1px; font-size: 12px; }
.site--list .site__rel { margin-top: 2px; }
.site--list .site__apps,
.site--list .site__error { display: none; }
.site--list .env { flex-shrink: 0; }
.site--list .site__meta { margin: 0; flex-shrink: 0; flex-wrap: nowrap; gap: 14px; }
.site--list .site__foot { margin: 0; flex-shrink: 0; padding-top: 0; gap: 8px; }
.psh-btn__label { display: inline; }

/* --- List view responsive: progressively shed the least-critical columns --- */
/* Tablet: drop the secondary meta (health + task count) to protect name + action. */
@media (max-width: 860px) {
  .site--list .site__meta { display: none; }
  .site--list .site__rel { display: none; }
}
/* Small: collapse the login button to an icon; env badge to its compact form. */
@media (max-width: 560px) {
  .site--list .site__foot .psh-btn--primary .psh-btn__label { display: none; }
  .site--list .site__foot .psh-btn--primary { flex: 0 0 auto; padding: 0 12px; height: 40px; }
  .site--list { gap: 10px; padding: 10px 12px; }
  .site--list .env { font-size: 10px; padding: 3px 8px 3px 7px; }
  .site--list .env__dot { width: 6px; height: 6px; }
  /* Collapse the connected badge to its plug icon to protect the row. */
  .site--list .psh-connbadge { font-size: 0; gap: 0; padding: 4px; }
}
/* Very small (phones): hide the env label text, keeping just the color dot. */
@media (max-width: 400px) {
  .site--list .site__grip { display: none; }
  .site--list .env { gap: 0; padding: 5px; font-size: 0; } /* font-size:0 hides the label text node; the fixed-size dot stays */
  .site--list .env__dot { width: 8px; height: 8px; }
}

/* ============================================================
   Phase 3/4/5 additions — Asana tasks, Users screen, login form
   ============================================================ */

/* --- branded login: password form + divider + error --- */
.psh-login__fields { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.psh-login__label { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--text-strong); }
.psh-login__submit { width: 100%; height: 48px; justify-content: center; margin-top: 4px; }
.psh-login__or { display: flex; align-items: center; gap: 12px; margin: 22px 0 0; color: var(--text-faint); font-size: 12px; }
.psh-login__or::before, .psh-login__or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.psh-login__form .psh-google { margin-top: 14px; }
.psh-login__error { display: flex; align-items: center; gap: 9px; margin-top: 18px; padding: 11px 13px; border-radius: var(--radius-md); background: var(--red-50); border: 1px solid var(--red-200); color: var(--red-800); font-size: 13px; }
.psh-login__error svg { flex-shrink: 0; }

/* --- site card overdue pill --- */
.site__overdue { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--red-50); color: var(--red-700); font-family: var(--font-display); font-weight: 700; font-size: 11.5px; border: 1px solid var(--red-200); }

/* --- tasks panel: target chips, by-user filter, small select --- */
.task__sitechip--none, .task__sitechip--folder { display: inline-flex; align-items: center; gap: 5px; color: var(--text-muted); font-size: 12px; }
.task__sitechip--none { color: var(--text-faint); font-style: italic; }
.task__asana--disabled { opacity: .35; cursor: default; }
.psh-tasks__userfilter { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--text-muted); }
/* The sidebar panel is narrow, so the shared TaskUserFilter (styled .psh-asana-userf)
   stretches full width and its menu spans the panel instead of anchoring right. */
.psh-tasks__userfilter .psh-asana-userf { flex: 1; min-width: 0; }
.psh-tasks__userfilter .psh-asana-userf__btn { width: 100%; height: 38px; justify-content: flex-start; }
.psh-tasks__userfilter .psh-asana-userf__btn .psh-asana-userf__label { flex: 1; max-width: none; text-align: left; }
.psh-tasks__userfilter .psh-asana-userf__menu { left: 0; right: 0; width: auto; min-width: 0; }
/* Live search over the loaded task feed (filters client-side, no round-trip). */
.psh-tasks__search { position: relative; display: flex; align-items: center; margin-top: 12px; }
.psh-tasks__search .psh-search__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-faint); display: inline-flex; pointer-events: none; }
.psh-tasks__search input { width: 100%; height: 38px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--n-50); padding: 0 34px 0 34px; font-size: 13.5px; color: var(--text-strong); transition: background var(--dur-base), border-color var(--dur-base); }
.psh-tasks__search input:focus { outline: none; background: #fff; border-color: var(--border-strong); }
.psh-tasks__search input::placeholder { color: var(--text-faint); }
.psh-tasks__searchx { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; cursor: pointer; color: var(--text-muted); display: inline-flex; align-items: center; padding: 4px; border-radius: 50%; }
.psh-tasks__searchx:hover { color: var(--ink-900); background: var(--n-100); }
.psh-select--sm select { height: 34px; font-size: 13px; padding: 0 30px 0 11px; }
/* The user filter puts .psh-select in a flex:1 row; without an explicit full
   width the native <select> only spans its content, leaving the absolutely
   positioned chevron stranded at the container's right edge. */
.psh-select--sm select { width: 100%; }
.psh-select--sm .psh-select__icon { right: 9px; }
.sd-task__inherited { display: inline-flex; align-items: center; gap: 4px; color: var(--text-faint); font-size: 11.5px; }

/* --- Users screen --- */
.psh-body--full { display: block; }
.psh-users { padding: 0 0 40px; }
.psh-users__bar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.psh-users__count { color: var(--text-muted); font-size: 13px; }
.psh-top__search--light { background: #fff; border: 1.5px solid var(--border-strong); border-radius: var(--radius-md); }
.psh-top__search--light input { color: var(--text-strong); }
/* The base .psh-top__search paints its placeholder + icon white for the dark header;
   on the white --light variant that made them invisible. Repaint them for light bg. */
.psh-top__search--light input::placeholder { color: var(--text-faint); }
.psh-top__search--light .psh-top__searchicon { color: var(--text-faint); }
.psh-table-wrap { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.psh-table { width: 100%; border-collapse: collapse; }
/* Keep the task columns legible on narrow screens: the wrap scrolls horizontally
   rather than crushing the assignee/due/linked cells into the task title. */
.psh-asana-table { min-width: 720px; }
.psh-table th { text-align: left; font-family: var(--font-display); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 13px 16px; background: var(--n-25); border-bottom: 1px solid var(--border); }
.psh-table td { padding: 11px 16px; border-bottom: 1px solid var(--divider); font-size: 14px; color: var(--text-body); vertical-align: middle; }
.psh-table tr:last-child td { border-bottom: none; }
.psh-table tr.is-disabled td { opacity: .55; }
.psh-table__user { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; color: var(--ink-900); }
.psh-table__email { color: var(--text-muted); font-size: 13px; }
.psh-table__actions { text-align: right; white-space: nowrap; }
.psh-table__actions .psh-iconbtn { display: inline-flex; }
.psh-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.psh-status .dot { width: 8px; height: 8px; border-radius: 50%; }
.psh-status--on { color: var(--green-600); } .psh-status--on .dot { background: var(--green-500); }
.psh-status--off { color: var(--text-muted); } .psh-status--off .dot { background: var(--n-400); }
.role { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-pill); font-family: var(--font-display); font-weight: 600; font-size: 12px; background: var(--n-100); color: var(--n-700); border: 1px solid var(--border); }
.role--administrator { background: var(--brand-subtle); color: var(--brand); border-color: var(--red-200); }
.role--psh_admin { background: var(--teal-100); color: var(--ink-900); }
.role--psh_project_manager { background: var(--amber-500); color: #fff; border-color: transparent; }
.psh-iconbtn--sm { width: 32px; height: 32px; border-radius: var(--radius-md); color: var(--text-muted); }
.psh-iconbtn--sm:hover { background: var(--n-100); color: var(--ink-900); }
.psh-iconbtn--danger:hover { background: var(--red-50); color: var(--red-700); }

/* --- Asana mapping panel --- */
.psh-asana-map { display: grid; gap: 18px; }
.psh-idlist { display: flex; flex-direction: column; }
.psh-idlist__empty { color: var(--text-muted); font-size: 13.5px; padding: 14px 4px; }
.psh-idrow { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--divider); }
.psh-idrow:last-child { border-bottom: none; }
.psh-idrow__id { flex: 1; min-width: 0; }
.psh-idrow__name { font-family: var(--font-display); font-weight: 600; color: var(--ink-900); font-size: 14px; }
.psh-idrow__email { color: var(--text-muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psh-idrow__linked { display: inline-flex; align-items: center; gap: 5px; color: var(--green-600); font-weight: 600; font-size: 13px; }
.psh-suggest { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--divider); }
.psh-suggest:last-child { border-bottom: none; }
.psh-suggest__main { flex: 1; min-width: 0; }
.psh-suggest__task { display: flex; align-items: center; gap: 7px; font-weight: 600; color: var(--ink-900); font-size: 14px; min-width: 0; }
.psh-suggest__taskname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psh-suggest__ext { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: var(--radius-sm); color: var(--text-faint); flex-shrink: 0; transition: background var(--dur-base), color var(--dur-base); }
.psh-suggest__ext:hover { background: var(--brand-subtle); color: var(--brand-press); }
.psh-suggest__hint { color: var(--text-muted); font-size: 12.5px; }

/* --- Asana mapping: identity filter --- */
.psh-idfilter { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.psh-idfilter .psh-top__search { min-width: 200px; }
.psh-idlist__hint { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; padding: 8px 11px; border-radius: var(--radius-md); background: var(--amber-500); color: #fff; font-size: 12.5px; }
.psh-idlist__hint svg { flex-shrink: 0; }

/* AI task matching — comments drawer (lazy) + picker search field */
.sd-comments { margin-top: 8px; padding: 8px 10px; border-radius: var(--radius-md); background: var(--surface-2, #f6f6f4); display: grid; gap: 8px; }
.sd-comments--muted { color: var(--text-muted); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.sd-comment__head { font-size: 12.5px; }
.sd-comment__ts { color: var(--text-muted); margin-left: 6px; font-size: 11.5px; }
.sd-comment__body { font-size: 13px; white-space: pre-wrap; margin-top: 2px; }
.psh-fld--sm { padding: 5px 9px; font-size: 13px; }

/* ---- Design (Figma) management screen + per-site card ---- */
.psh-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.psh-field { margin-bottom: 14px; }
.psh-field__label { display: block; font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--ink-900); margin-bottom: 6px; }
.psh-field input[type="text"], .sd-figma-add input, .psh-figma-actions input {
  width: 100%; padding: 8px 11px; border: 1px solid var(--border); border-radius: var(--radius-md);
  font: inherit; font-size: 13.5px; color: var(--ink-900); background: #fff;
}
.psh-field input:focus, .sd-figma-add input:focus { outline: none; border-color: var(--brand); }
.psh-muted { color: var(--text-muted); }
.psh-tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; background: var(--n-100); color: var(--text-muted); vertical-align: middle; }
.psh-tag--manual { background: var(--brand-subtle); color: var(--brand); }
.psh-figma-name { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; color: var(--ink-900); text-decoration: none; }
.psh-figma-name:hover { color: var(--brand); }
.psh-figma-name__ico { display: inline-flex; }
.psh-figma-assigns { display: flex; flex-wrap: wrap; gap: 6px; }
.psh-figma-assigns .psh-chip { padding: 4px 10px; }
.psh-chip__x { border: 0; background: transparent; cursor: pointer; color: var(--text-muted); display: inline-flex; align-items: center; padding: 0; margin-left: 2px; }
.psh-chip__x:hover { color: var(--brand); }
.psh-figma-actions .psh-inline { justify-content: flex-end; }
.psh-btn--danger { color: var(--brand); }
.psh-btn--danger:hover { background: var(--brand-subtle); }
.psh-table tr.is-ignored td { opacity: .5; }
.psh-figma-target { display: flex; gap: 8px; flex-wrap: wrap; }
.psh-figma-target .psh-select { flex: 1 1 160px; }
.psh-figma-target .psh-select select { width: 100%; }
.folder__apps { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; }
.folder__apps .appicon { width: 26px; height: 26px; border-radius: 7px; }
.folder__apps__more { font-family: var(--font-display); font-weight: 700; font-size: 11.5px; color: var(--text-muted); padding: 0 4px; }
.sd-figma-add { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.sd-figma-add input { font-size: 13px; }

/* ---------------- Asana task browser screen ---------------- */
.psh-tag--ok { background: var(--brand-subtle); color: var(--brand); }
.psh-subhead { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .02em; text-transform: uppercase; color: var(--text-muted); }

/* Status filter row sits directly under the toolbar (no side panel border). */
.psh-asana-filters { padding: 4px 0 16px; border-bottom: 0; flex-wrap: wrap; }

/* "By user" filter (custom dropdown so we can show Asana photos). */
.psh-asana-userf { position: relative; }
.psh-asana-userf__btn { gap: 8px; }
.psh-asana-userf__label { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psh-asana-userf__menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; min-width: 240px; max-width: calc(100vw - 24px); max-height: 340px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); padding: 6px; animation: popIn var(--dur-base) var(--ease-out); }
/* On phones the filter button sits at the left of a full-width controls row, so a
   right-anchored menu would run off the left edge — anchor it left instead. */
@media (max-width: 560px) { .psh-asana-userf { width: 100%; } .psh-asana-userf__btn { width: 100%; } .psh-asana-userf__label { flex: 1; text-align: left; } .psh-asana-userf__menu { left: 0; right: auto; width: 100%; } }
.psh-asana-userf__row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; padding: 7px 8px; border-radius: var(--radius-md); font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--ink-900); }
.psh-asana-userf__row:hover { background: var(--n-100); }
.psh-asana-userf__row.is-selected { background: var(--brand-subtle); color: var(--brand); }
.psh-asana-userf__row .psh-asana-userf__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psh-asana-userf__all { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--n-100); color: var(--text-muted); }
/* Multi-select mode: overlapped avatars on the trigger, an in-menu people search
   (long rosters) and a footer that reports the count + clears the whole set. */
.psh-asana-userf__stack { display: inline-flex; align-items: center; }
.psh-asana-userf__stack .psh-avatar { box-shadow: 0 0 0 2px #fff; }
.psh-asana-userf__stack .psh-avatar + .psh-avatar { margin-left: -8px; }
.psh-asana-userf__search { display: flex; align-items: center; gap: 7px; padding: 6px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border); color: var(--text-muted); position: sticky; top: -6px; background: #fff; z-index: 1; }
.psh-asana-userf__search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--ink-900); }
.psh-asana-userf__empty { padding: 10px 8px; font-size: 12.5px; color: var(--text-muted); }
.psh-asana-userf__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; padding: 7px 8px 3px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); }
.psh-asana-userf__clear { border: 0; background: transparent; cursor: pointer; padding: 2px 4px; border-radius: var(--radius-sm); font-family: var(--font-display); font-weight: 700; font-size: 12.5px; color: var(--brand); }
.psh-asana-userf__clear:hover { background: var(--brand-subtle); }

/* Task table. */
.psh-asana-table th:first-child, .psh-asana-row__check { width: 40px; }
.psh-asana-table th:last-child, .psh-asana-row__ext { width: 44px; text-align: right; }
.psh-asana-row { cursor: pointer; transition: background var(--dur-fast); }
.psh-asana-row:hover { background: var(--n-050, var(--n-100)); }
.psh-asana-row.is-done .psh-asana-row__title { text-decoration: line-through; color: var(--text-muted); }
.psh-asana-row__title { font-family: var(--font-display); font-weight: 600; color: var(--ink-900); }
.psh-asana-row__target { display: inline-flex; align-items: center; gap: 6px; }
.psh-asana-table .task__assignee { font-size: 12.5px; color: var(--text-body); }
.psh-asana-table .task__check { flex: none; }

/* Pagination. */
.psh-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px 0 4px; }
.psh-pager__label { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Detail drawer — fixed-height flex column: header + footer stay, body scrolls. */
.psh-asana-detail { max-width: 640px; max-height: 85vh; display: flex; flex-direction: column; }
.psh-asana-detail__head { flex: 0 0 auto; padding: 20px 24px 14px; border-bottom: 1px solid var(--divider); }
.psh-asana-detail__headtop { display: flex; align-items: flex-start; gap: 14px; }
.psh-asana-detail__heads { min-width: 0; flex: 1; }
.psh-asana-detail__head .psh-modal__title { font-size: 18px; overflow-wrap: anywhere; }
.psh-asana-detail__head .psh-modal__domain { max-width: none; white-space: normal; margin-top: 3px; }
.psh-asana-detail__close { flex: none; color: var(--text-muted); }
.psh-asana-detail__close:hover { color: var(--ink-900); }
.psh-asana-detail__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; }
.psh-asana-detail__linked { display: inline-flex; }
.psh-asana-detail__asana { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-display); font-weight: 600; font-size: 12.5px; color: var(--brand); text-decoration: none; margin-left: auto; }
.psh-asana-detail__asana:hover { text-decoration: underline; }

.psh-asana-detail__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 24px; -webkit-overflow-scrolling: touch; }
.psh-asana-sec { margin-bottom: 22px; }
.psh-asana-sec:last-child { margin-bottom: 0; }
.psh-asana-sec .psh-subhead { margin-bottom: 10px; }
.psh-asana-detail__notes { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; line-height: 1.6; color: var(--text-body); }
.psh-asana-detail__rel { display: flex; flex-direction: column; gap: 8px; }
.psh-asana-detail__relrow { display: flex; align-items: center; gap: 12px; }
.psh-asana-detail__k { font-family: var(--font-display); font-weight: 700; font-size: 12px; color: var(--text-muted); min-width: 84px; flex: none; }
.psh-asana-detail__v { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--text-body); }
.psh-asana-detail__extlink { display: inline-flex; align-items: center; gap: 5px; color: var(--brand); text-decoration: none; }
.psh-asana-detail__extlink:hover { text-decoration: underline; }

.psh-asana-detail__foot { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--divider); background: #fff; }

.psh-asana-comments { display: flex; flex-direction: column; gap: 12px; }
.psh-asana-comment { padding: 10px 12px; background: var(--n-100); border-radius: var(--radius-md); }
.psh-asana-comment__head { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; margin-bottom: 4px; }
.psh-asana-comment__head .psh-muted { font-size: 11.5px; }
.psh-asana-comment__body { font-size: 13px; line-height: 1.5; color: var(--text-body); word-break: break-word; }
.psh-asana-comment__body p { margin: 0 0 6px; }
.psh-asana-comment__body a { color: var(--brand); }

/* Phone: full-height sheet so long threads use every available pixel. */
@media (max-width: 640px) {
  .psh-asana-detail { max-width: none; max-height: 100%; height: 100%; border-radius: 0; }
  .psh-asana-detail__asana { margin-left: 0; }
}

/* ============================ Global header search ============================ */
.psh-gs { position: relative; margin-left: auto; flex: 0 0 auto; width: var(--psh-search-w, 280px); }
.psh-gs .psh-top__search { margin-left: 0; width: 100%; }
.psh-gs__panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 200; width: 440px; max-width: calc(100vw - 24px); max-height: min(70vh, 560px); overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl); animation: popIn var(--dur-base) var(--ease-out); }
.psh-gs__empty { padding: 22px 16px; color: var(--text-muted); font-size: 13.5px; text-align: center; }
.psh-gs__group { padding: 3px 0; border-top: 1px solid var(--border); }
.psh-gs__group:first-child { border-top: 0; }
.psh-gs__grouphead { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px 4px; font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); }
.psh-gs__more { font-weight: 600; text-transform: none; letter-spacing: 0; background: transparent; border: 0; cursor: pointer; color: var(--brand); padding: 0; font-size: 11.5px; }
.psh-gs__more:hover { text-decoration: underline; }
.psh-gs__footer { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; padding: 11px 14px; background: var(--n-50, #f7f7f8); border: 0; border-top: 1px solid var(--border); cursor: pointer; font-family: var(--font-display); font-weight: 700; font-size: 12.5px; color: var(--brand); position: sticky; bottom: 0; }
.psh-gs__footer:hover { background: var(--brand-subtle); }
.psh-gs__row { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; padding: 8px 14px; background: transparent; border: 0; cursor: pointer; }
.psh-gs__row.is-active, .psh-gs__row:hover { background: var(--brand-subtle); }
.psh-gs__icon { flex: none; width: 28px; height: 28px; border-radius: 7px; background: var(--n-100); display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); }
.psh-gs__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.psh-gs__title { font-family: var(--font-display); font-weight: 600; font-size: 14px; color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psh-gs__sub { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psh-gs__act { flex: none; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--text-faint); white-space: nowrap; }
.psh-gs__row.is-active .psh-gs__act, .psh-gs__row:hover .psh-gs__act { color: var(--brand); }

/* Sites-board quick filter (moved out of the header, which is now global search). */
.psh-search--board input { height: 40px; width: 200px; }

/* Full search-results screen (#/search). Reuses .psh-seg__btn for the type tabs. */
.psh-sr__tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0 14px; }
.psh-sr__group { border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; margin-bottom: 14px; overflow: hidden; }
.psh-sr__grouphead { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; border-bottom: 1px solid var(--border); font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-faint); background: var(--n-50, #f7f7f8); }
.psh-sr__seeall { background: transparent; border: 0; cursor: pointer; color: var(--brand); font-family: var(--font-display); font-weight: 700; font-size: 11.5px; text-transform: none; letter-spacing: 0; padding: 0; }
.psh-sr__seeall:hover { text-decoration: underline; }
.psh-sr__group .psh-gs__row { padding: 10px 16px; border-top: 1px solid var(--border); }
.psh-sr__group .psh-gs__row:first-of-type { border-top: 0; }
.psh-sr__more { display: block; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--border); background: var(--n-50, #f7f7f8); cursor: pointer; font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--brand); }
.psh-sr__more:hover:not(:disabled) { background: var(--brand-subtle); }
.psh-sr__more:disabled { color: var(--text-faint); cursor: default; }
.psh-sr__count { padding: 12px 16px; border-top: 1px solid var(--border); color: var(--text-faint); font-size: 12.5px; }

/* Row highlight when a global-search user result lands on the Users table. */
tr.is-highlight { animation: rowHighlight 1.6s var(--ease-out); }
@keyframes rowHighlight { 0% { background: var(--brand-subtle); } 100% { background: transparent; } }

@media (max-width: 760px) {
  .psh-gs { width: 100%; margin-left: 0; }
  .psh-gs__panel { width: 100%; }
}

/* ============================ Audit Log (#/audit) — activity feed ========= */
/* Category accent map (bg tint / strong fg), reused by icon, chip and dot. */
.psh-af__ico.is-auth, .psh-af__chip.is-auth { --afc-bg:#eef2ff; --afc-fg:#3730a3; }
.psh-af__ico.is-sso, .psh-af__chip.is-sso { --afc-bg:#ecfeff; --afc-fg:#0e7490; }
.psh-af__ico.is-site, .psh-af__chip.is-site { --afc-bg:#f0fdf4; --afc-fg:#166534; }
.psh-af__ico.is-user, .psh-af__chip.is-user { --afc-bg:#fef3f2; --afc-fg:#b42318; }
.psh-af__ico.is-integration, .psh-af__chip.is-integration { --afc-bg:#fff7ed; --afc-fg:#c2410c; }
.psh-af__ico.is-settings, .psh-af__chip.is-settings { --afc-bg:#f5f3ff; --afc-fg:#6d28d9; }
.psh-af__ico.is-na, .psh-af__chip.is-na { --afc-bg:var(--n-100); --afc-fg:var(--n-700); }
.psh-af__catdot.is-auth { background:#6366f1; } .psh-af__catdot.is-sso { background:#06b6d4; }
.psh-af__catdot.is-site { background:#22c55e; } .psh-af__catdot.is-user { background:#ef4444; }
.psh-af__catdot.is-integration { background:#f97316; } .psh-af__catdot.is-settings { background:#8b5cf6; }

/* Filter chrome */
.psh-af__cats { margin: 0 0 12px; display: inline-flex; flex-wrap: wrap; gap: 4px; }
.psh-af__cats .psh-seg__btn { display: inline-flex; align-items: center; gap: 6px; }
.psh-af__catdot { width: 8px; height: 8px; border-radius: 99px; background: var(--n-400); }
.psh-af__filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 0 0 18px; }
.psh-af__select { height: 38px; border-radius: var(--radius-md); border: 1.5px solid var(--border-strong); background: #fff; padding: 0 30px 0 12px; font-size: 13px; font-family: var(--font-body); color: var(--text-strong); appearance: none; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; max-width: 220px; }
.psh-af__select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus-ring); }
.psh-af__date { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.psh-af__date input { height: 38px; border-radius: var(--radius-md); border: 1.5px solid var(--border-strong); background: #fff; padding: 0 10px; font-size: 13px; font-family: var(--font-body); color: var(--text-strong); }

/* Asana-style user filter */
.psh-af__userf { position: relative; }
.psh-af__userfbtn { height: 38px; display: inline-flex; align-items: center; gap: 8px; }
.psh-af__userflabel { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psh-af__userfmenu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 240px; max-width: calc(100vw - 24px); max-height: 320px; overflow-y: auto; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: 0 12px 32px rgba(0,22,30,.16); padding: 6px; }
.psh-af__userfrow { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; color: var(--text-strong); text-align: left; }
.psh-af__userfrow:hover { background: var(--n-50, #f7f7f8); }
.psh-af__userfrow.is-selected { background: var(--brand-subtle); }
.psh-af__userfname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psh-af__userfall { width: 22px; height: 22px; border-radius: 99px; background: var(--n-100); color: var(--n-600); display: inline-flex; align-items: center; justify-content: center; }

/* Feed */
.psh-af { margin: 0 0 28px; }
.psh-af__group { margin-bottom: 8px; }
.psh-af__day { position: sticky; top: 64px; z-index: 3; padding: 8px 4px; margin-top: 6px; font-family: var(--font-display); font-weight: 700; font-size: 12px; letter-spacing: .03em; text-transform: uppercase; color: var(--text-muted); background: linear-gradient(var(--n-25, #fafafa), var(--n-25, #fafafa) 70%, transparent); backdrop-filter: blur(2px); }
.psh-af__item { display: grid; grid-template-columns: 40px 1fr 20px; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; cursor: pointer; transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast); }
.psh-af__item:hover { border-color: var(--brand); box-shadow: 0 4px 16px rgba(0,22,30,.06); }
.psh-af__item:active { transform: translateY(1px); }
/* Embedded variant: the site-modal Activity tab reuses this feed as a read-only
   list (no click/drawer, no chevron column) inside the modal's own scroll box. */
.psh-af--embedded { margin: 0; }
.psh-af--embedded .psh-af__day { position: static; top: auto; backdrop-filter: none; }
.psh-af__item--static { grid-template-columns: 40px 1fr; cursor: default; }
.psh-af__item--static:hover { border-color: var(--border); box-shadow: none; }
.psh-af__item--static:active { transform: none; }
.psh-af__ico { width: 40px; height: 40px; border-radius: var(--radius-md); display: inline-flex; align-items: center; justify-content: center; background: var(--afc-bg, var(--n-100)); color: var(--afc-fg, var(--n-700)); flex: 0 0 auto; }
.psh-af__main { min-width: 0; }
.psh-af__line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.psh-af__actor { font-weight: 700; color: var(--ink-900); font-size: 13.5px; }
.psh-af__action { color: var(--text-strong); font-size: 13.5px; }
.psh-af__target { color: var(--text-muted); font-size: 13px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psh-af__target::before { content: "· "; color: var(--text-faint); }
.psh-af__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 5px; }
.psh-af__chip { display: inline-block; padding: 2px 9px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; background: var(--afc-bg, var(--n-100)); color: var(--afc-fg, var(--n-700)); }
.psh-af__provider { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.psh-af__pdot { width: 8px; height: 8px; border-radius: 99px; background: var(--n-400); }
.psh-af__pdot.is-pressable { background:#2563eb; } .psh-af__pdot.is-figma { background:#a259ff; }
.psh-af__pdot.is-callrail { background:#00b3a4; } .psh-af__pdot.is-google { background:#ea4335; }
.psh-af__pdot.is-connected { background:#16a34a; } .psh-af__pdot.is-anthropic { background:#d97757; }
.psh-af__result { display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill); font-size: 11px; font-weight: 700; text-transform: capitalize; }
.psh-af__result.is-success { background: rgba(22,163,74,.12); color: var(--green-600, #15803d); }
.psh-af__result.is-failure { background: var(--red-50, #fef2f2); color: var(--red-700, #b91c1c); }
.psh-af__result.is-info { background: var(--n-100); color: var(--n-600); }
.psh-af__badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: var(--radius-sm); font-size: 10.5px; font-weight: 700; letter-spacing: .02em; background: var(--ink-900); color: #fff; }
.psh-af__badge.is-cron { background:#7c3aed; } .psh-af__badge.is-cli { background:#0f766e; } .psh-af__badge.is-system { background: var(--n-600); }
.psh-af__trigger { font-size: 11px; color: var(--text-faint); text-transform: capitalize; }
.psh-af__time { margin-left: auto; font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.psh-af__chev { color: var(--text-faint); display: inline-flex; }
.psh-af__more { display: block; width: 100%; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #fff; cursor: pointer; font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--brand); margin-top: 4px; }
.psh-af__more:hover:not(:disabled) { background: var(--brand-subtle); }
.psh-af__more:disabled { color: var(--text-faint); cursor: default; }
.psh-af__end { text-align: center; padding: 14px; color: var(--text-faint); font-size: 12.5px; }

/* Detail drawer: right slide-over inside the overlay */
.psh-overlay--right { align-items: stretch; justify-content: flex-end; padding: 0; }
.psh-adrawer { width: min(520px, 100%); height: 100%; background: #fff; display: flex; flex-direction: column; box-shadow: -12px 0 40px rgba(0,22,30,.18); animation: slideInRight var(--dur-slow, .32s) var(--ease-out); }
@keyframes slideInRight { from { transform: translateX(24px); opacity: .6; } to { transform: translateX(0); opacity: 1; } }
.psh-adrawer__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.psh-adrawer__title { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--ink-900); }
.psh-iconbtn--dark { color: var(--text-muted); width: 34px; height: 34px; }
.psh-iconbtn--dark:hover { background: var(--n-100); color: var(--ink-900); }
.psh-adrawer__body { padding: 18px 20px; overflow-y: auto; }
.psh-adrawer__detail { margin: 0 0 16px; }
.psh-adrawer__drow { display: grid; grid-template-columns: 120px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--divider, #f0f0f0); font-size: 13px; }
.psh-adrawer__drow dt { color: var(--text-muted); }
.psh-adrawer__drow dd { margin: 0; color: var(--text-strong); word-break: break-word; }
.psh-adrawer__links { display: flex; gap: 8px; margin-bottom: 16px; }
.psh-adrawer__ctx { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.psh-adrawer__ctxhead { padding: 8px 12px; background: var(--n-50, #f7f7f8); font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
.psh-adrawer__ctx pre { margin: 0; padding: 12px; font-family: var(--font-mono); font-size: 12px; line-height: 1.5; color: var(--ink-700); overflow-x: auto; background: #fff; }

@media (max-width: 760px) {
  .psh-af__cats, .psh-af__filters, .psh-af { margin-left: 0; margin-right: 0; }
  .psh-af__select, .psh-af__userf, .psh-af__userfbtn { flex: 1 1 auto; width: 100%; max-width: none; }
  .psh-af__date { flex: 1 1 100%; }
  .psh-af__target { max-width: 200px; }
  .psh-af__day { top: 0; }
  .psh-adrawer { width: 100%; }
}

/* ---------- Audit maintenance category + archives panel ---------- */
.psh-af__catdot.is-audit { background:#0ea5e9; }
.psh-af__ico.is-audit { background: rgba(14,165,233,.12); color:#0284c7; }
.psh-af__chip.is-audit { background: rgba(14,165,233,.12); color:#0369a1; }

.psh-adrawer--wide { width: min(640px, 100%); }

.psh-arch__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.psh-arch__danger { color: var(--danger); border-color: var(--danger); }
.psh-arch__danger:hover { background: var(--red-50, #fef2f2); border-color: var(--danger); }

.psh-arch__job { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 18px; background: var(--n-50, #f7f7f8); }
.psh-arch__job.is-error { border-color: var(--danger); background: var(--red-50, #fef2f2); }
.psh-arch__jobtop { display: flex; justify-content: space-between; font-family: var(--font-display); font-weight: 700; font-size: 12.5px; color: var(--ink-900); margin-bottom: 8px; }
.psh-arch__bar { height: 7px; border-radius: 99px; background: var(--n-200, #e5e5e5); overflow: hidden; }
.psh-arch__bar span { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .4s var(--ease-out, ease); }
.psh-arch__job.is-error .psh-arch__bar span { background: var(--danger); }
.psh-arch__jobmsg { margin-top: 7px; font-size: 12px; color: var(--text-muted); }

.psh-arch__seclabel { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin: 4px 0 10px; }

.psh-arch__sched { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; margin-bottom: 20px; }
.psh-arch__toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink-900); margin-bottom: 12px; cursor: pointer; }
.psh-arch__schedrow { display: flex; flex-direction: column; gap: 10px; }
.psh-arch__schedrow label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-strong); flex-wrap: wrap; }
.psh-arch__schedrow input { width: 74px; padding: 6px 8px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-xs); font: inherit; }
.psh-arch__schedrow input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus-ring); }
.psh-arch__schedfoot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--divider, #f0f0f0); }
.psh-arch__schedmeta { font-size: 12px; color: var(--text-muted); }
.psh-arch__schedbtns { display: flex; gap: 8px; flex-shrink: 0; }

.psh-arch__empty { padding: 22px 4px; font-size: 13px; color: var(--text-muted); text-align: center; }
.psh-arch__list { display: flex; flex-direction: column; gap: 8px; }
.psh-arch__row { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.psh-arch__rmain { flex: 1 1 auto; min-width: 0; }
.psh-arch__rtitle { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 13.5px; color: var(--ink-900); }
.psh-arch__rmeta { margin-top: 3px; font-size: 12px; color: var(--text-muted); }
.psh-arch__ractions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.psh-arch__ractions .psh-iconbtn { color: var(--text-muted); }
.psh-arch__ractions .psh-iconbtn:hover { color: var(--ink-900); background: var(--n-100); }
.psh-arch__ractions .is-disabled { color: var(--danger); cursor: default; }
.psh-arch__origin { font-family: var(--font-body); font-weight: 700; font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: var(--radius-pill); background: var(--n-100); color: var(--n-600); }
.psh-arch__origin.is-auto { background: rgba(14,165,233,.12); color: #0369a1; }
.psh-arch__origin.is-cli { background: rgba(139,92,246,.12); color: #6d28d9; }
.psh-arch__purged { font-family: var(--font-body); font-weight: 700; font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: var(--radius-pill); background: var(--red-50, #fef2f2); color: var(--red-700, #b91c1c); }

@media (max-width: 640px) {
  .psh-adrawer--wide { width: 100%; }
}

/* ---- Licenses screen (plugin keys) ---- */
.psh-license-table { min-width: 980px; } /* narrower screens scroll the wrap sideways */
.psh-license-table td { vertical-align: top; }
.psh-license-name { font-family: var(--font-display); font-weight: 700; color: var(--ink-900); }
.psh-license-slug { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.psh-license-version { font-family: var(--font-mono); font-weight: 600; color: var(--ink-900); text-decoration: none; }
.psh-license-version:hover { color: var(--brand); }
.psh-license-meta { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
.psh-license-error { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--red-700, #b91c1c); }
.psh-license-keyrow { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.psh-license-key { font-family: var(--font-mono); font-size: 12.5px; padding: 4px 8px; border-radius: var(--radius-sm); background: var(--n-50); border: 1px solid var(--border); color: var(--ink-900); white-space: nowrap; user-select: all; }
.psh-license-endpoint .psh-license-key { white-space: normal; overflow-wrap: anywhere; }
.psh-license-copy.is-copied { background: var(--green-600, #16a34a); border-color: var(--green-600, #16a34a); color: #fff; }
.psh-license-endpoint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; padding: 10px 14px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.psh-license-endpoint__label { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.psh-license-sitesbtn { white-space: nowrap; }
.psh-license-table tr.is-expanded td { border-bottom-color: transparent; }
.psh-license-sitesrow > td { background: var(--n-25); padding: 0 16px 14px; }
.psh-license-sites { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.psh-license-sites th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding: 9px 12px; border-bottom: 1px solid var(--border); background: #fff; }
.psh-license-sites td { padding: 9px 12px; font-size: 13px; border-bottom: 1px solid var(--divider); vertical-align: middle; }
.psh-license-sites tr:last-child td { border-bottom: none; }
.psh-license-sites tr.is-inactive td { background: var(--n-25); }
.psh-license-sites__empty { padding: 12px 2px; font-size: 13px; }
.psh-license-site { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-900); text-decoration: none; }
.psh-license-site:hover { color: var(--brand); }
.psh-license-status { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: var(--radius-pill); font-size: 11.5px; font-weight: 700; background: var(--n-100); color: var(--text-muted); }
.psh-license-status__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.psh-license-status--ok { background: var(--success-bg, #dcfce7); color: var(--green-600, #16a34a); }
.psh-license-status--ok .psh-license-status__dot { animation: psh-license-pulse 1.6s ease-in-out infinite; }
.psh-license-status--bad { background: var(--danger-bg, #fee2e2); color: var(--red-700, #b91c1c); }
@keyframes psh-license-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .psh-license-status--ok .psh-license-status__dot { animation: none; } }
.psh-license-siteops { justify-content: flex-end; flex-wrap: nowrap; }
.psh-btn.psh-btn--danger-ghost { background: #fff; color: var(--red-700, #b91c1c); border: 1px solid var(--red-200, #fecaca); }
.psh-btn.psh-btn--danger-ghost:hover:not(:disabled) { background: var(--red-50, #fef2f2); }
.psh-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
