/*
 * PlanWatch client workspace: the lead table customers land on after they
 * subscribe (Business /account and the Demand Radar dashboard).
 *
 * Ben's design-language token lock (~/.claude/skills/design-language):
 * SF Pro via the system stack, regular and medium only, -0.15px tracking,
 * sizes 12 / 13 / 14 / 24, ink #292929 / #5D5D5D / #9E9E9E, radii 8 (controls)
 * / 16 (cards) / pill (CTAs, badges), icons 14 / 20, and its motion tokens.
 * One accent: PlanWatch amber, used sparingly. Pipeline stages are amber tints
 * plus one success green, never a rainbow; the label always carries the meaning.
 */

:root {
  --ws-font: "SF Pro Text", "SF Pro Display", "SF Pro", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ws-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ws-track: -0.15px;
  --ws-xs: 12px;
  --ws-sm: 13px;
  --ws-md: 14px;
  --ws-lg: 24px;

  --ws-ink: #292929;
  --ws-ink-2: #5d5d5d;
  --ws-ink-3: #9e9e9e;
  --ws-surface: #ffffff;
  --ws-bg: #f7f7f7;
  --ws-hover: #f3f3f3;
  --ws-line: #e5e5e5;
  --ws-line-soft: #efefef;
  /* Checkbox edge: the lightest grey with 3:1 against white (WCAG 1.4.11). */
  --ws-control-edge: #8a8a8a;

  --ws-accent: #f59e0b;
  --ws-accent-strong: #d97706;
  --ws-accent-soft: #fef3c7;
  --ws-accent-ink: #92400e;
  --ws-accent-wash: #fffbeb;
  --ws-success: #22c55e;
  --ws-success-ink: #15803d;
  --ws-danger: #dc2626;

  --ws-stage-new: #c9c9c9;
  --ws-stage-chosen: #5d5d5d;
  --ws-stage-letter: #fcd34d;
  --ws-stage-contacted: #f59e0b;
  --ws-stage-quoted: #b45309;
  --ws-stage-won: #22c55e;
  --ws-stage-closed: #e5e5e5;

  --ws-radius-nav: 8px;
  --ws-radius-card: 16px;
  --ws-radius-panel: 24px;
  --ws-radius-pill: 9999px;
  --ws-shadow-soft: 0 8px 30px rgba(0, 0, 0, 0.06);
  --ws-shadow-float: 0 12px 40px rgba(0, 0, 0, 0.08);

  --ws-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ws-ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ws-dur-instant: 150ms;
  --ws-dur-quick: 200ms;
  --ws-dur-enter: 340ms;
  --ws-dur-exit: 260ms;

  --ws-sidebar: 232px;
  --ws-panel: 440px;
}

@media (prefers-reduced-motion: reduce) {
  :root { --ws-dur-instant: 0.01ms; --ws-dur-quick: 0.01ms; --ws-dur-enter: 0.01ms; --ws-dur-exit: 0.01ms; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.ws-body {
  margin: 0;
  font-family: var(--ws-font);
  font-size: var(--ws-md);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: var(--ws-track);
  color: var(--ws-ink);
  background: var(--ws-bg);
  -webkit-font-smoothing: antialiased;
}
:where(.ws-body) a { color: inherit; }
:where(.ws-body) :is(button, input, select, textarea) { font: inherit; color: inherit; letter-spacing: inherit; }
:where(.ws-body) :is(h1, h2, h3, p, ol, ul, dl, dd) { margin: 0; }
:where(.ws-body) b, :where(.ws-body) strong { font-weight: 500; }
.ws-i { flex: none; display: inline-block; vertical-align: -2px; }
.ws-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ws-skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--ws-ink); color: #fff; padding: 8px 14px; border-radius: var(--ws-radius-pill); text-decoration: none; font-size: var(--ws-sm); }
.ws-skip:focus { top: 12px; }
:where(.ws-body) :focus-visible { outline: 2px solid var(--ws-accent-strong); outline-offset: 2px; border-radius: var(--ws-radius-nav); }
.js .ws-nojs { display: none !important; }
/* Hidden until the script runs; with it, each element keeps its own display. */
html:not(.js) .ws-js-only { display: none !important; }
.ws-muted { color: var(--ws-ink-2); }
.ws-nowrap { white-space: nowrap; }
.ws-num { font-variant-numeric: tabular-nums; }
.ws-mono { font-family: var(--ws-mono); font-size: var(--ws-xs); letter-spacing: 0; }
.ws-strong { font-weight: 500; color: var(--ws-ink); margin: 0 0 2px; }
.ws-strong-lg { font-size: var(--ws-lg); font-weight: 500; color: var(--ws-ink); line-height: 1.2; margin-top: 2px; }
.ws-strong-inline { font-weight: 500; color: var(--ws-ink); }
.ws-link { color: var(--ws-ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--ws-line); text-underline-offset: 3px; }

/* ---------- shell: sidebar on soft grey, content in one white panel ---------- */
.ws-app { display: grid; grid-template-columns: var(--ws-sidebar) minmax(0, 1fr); min-height: 100vh; }
.ws-sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 16px 10px 16px 12px; display: flex; flex-direction: column; gap: 16px;
}
.ws-brand { display: flex; align-items: center; gap: 8px; padding: 4px 8px; text-decoration: none; font-size: var(--ws-md); font-weight: 500; }
.ws-brand svg { flex: none; width: 22px; height: 22px; }
.ws-brand-name { color: var(--ws-ink); }
.ws-workspace { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--ws-radius-card); background: var(--ws-surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.ws-avatar { flex: none; width: 28px; height: 28px; border-radius: var(--ws-radius-nav); display: grid; place-items: center; background: var(--ws-ink); color: #fff; font-size: var(--ws-xs); font-weight: 500; }
.ws-workspace-name { color: var(--ws-ink); font-size: var(--ws-sm); font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-workspace-plan { color: var(--ws-ink-3); font-size: var(--ws-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-nav-group { display: flex; flex-direction: column; gap: 2px; }
.ws-nav-label { color: var(--ws-ink-3); font-size: var(--ws-xs); padding: 4px 10px; }
.ws-nav-link {
  display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 6px 10px;
  border-radius: var(--ws-radius-nav); color: var(--ws-ink-2); text-decoration: none; font-size: var(--ws-sm);
  transition: background var(--ws-dur-instant) var(--ws-ease-out), color var(--ws-dur-instant) var(--ws-ease-out);
}
.ws-nav-link .ws-i { color: var(--ws-ink-3); }
.ws-nav-link:hover { background: rgba(0, 0, 0, 0.035); color: var(--ws-ink); }
.ws-nav-link[aria-current="page"], .ws-nav-link.is-active { background: var(--ws-surface); color: var(--ws-ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.ws-nav-link[aria-current="page"] .ws-i, .ws-nav-link.is-active .ws-i { color: var(--ws-ink); }
.ws-nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-nav-count { color: var(--ws-ink-3); font-size: var(--ws-xs); font-variant-numeric: tabular-nums; }
.ws-nav-badge { color: var(--ws-accent-ink); background: var(--ws-accent-soft); border-radius: var(--ws-radius-pill); padding: 1px 8px; font-size: var(--ws-xs); font-weight: 500; }
.ws-nav-sub { padding-left: 14px; }
.ws-nav-row { display: flex; align-items: center; }
.ws-nav-row .ws-nav-link { flex: 1; min-width: 0; }
.ws-nav-del { opacity: 0; border: 0; background: none; padding: 6px; border-radius: var(--ws-radius-nav); color: var(--ws-ink-3); cursor: pointer; display: inline-grid; place-items: center; transition: opacity var(--ws-dur-instant) var(--ws-ease-out); }
.ws-nav-row:hover .ws-nav-del, .ws-nav-del:focus-visible { opacity: 1; }
.ws-nav-del:hover { color: var(--ws-danger); }
@media (hover: none) { .ws-nav-del { opacity: .6; } }
.ws-sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.ws-sidebar-foot form { margin: 0; }
.ws-sidebar-foot button.ws-nav-link { width: 100%; border: 0; background: none; font: inherit; letter-spacing: inherit; text-align: left; cursor: pointer; }

.ws-main {
  min-width: 0; display: flex; flex-direction: column;
  margin: 8px 8px 8px 0; background: var(--ws-surface); border-radius: var(--ws-radius-panel);
  box-shadow: var(--ws-shadow-soft); min-height: calc(100vh - 16px);
}
.ws-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 8px 28px; background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--ws-line-soft); border-radius: var(--ws-radius-panel) var(--ws-radius-panel) 0 0;
}
/* Without backdrop blur the translucent white lets rows read through: go solid. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ws-topbar { background: var(--ws-surface); }
}
.ws-crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ws-ink-3); font-size: var(--ws-sm); }
.ws-crumbs strong { color: var(--ws-ink); font-weight: 500; }
.ws-crumbs span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
/* "Viewing as" switcher: admin-password sessions only. */
.ws-viewas { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ws-ink-2); font-size: var(--ws-xs); }
.ws-viewas label { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ws-viewas .ws-select { width: auto; max-width: 220px; min-height: 28px; padding-top: 3px; padding-bottom: 3px; font-size: var(--ws-xs); text-overflow: ellipsis; }
@media (max-width: 640px) { .ws-viewas label .ws-btn-text { display: none; } .ws-viewas .ws-select { max-width: 130px; } }
.ws-content { padding: 28px 32px 64px; max-width: 1440px; width: 100%; }
/* #hash targets land below the pinned top bar, not under it. */
.ws-page, .ws-page [id] { scroll-margin-top: 68px; }

/* ---------- controls ---------- */
.ws-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 6px 14px; border-radius: var(--ws-radius-pill);
  border: 1px solid var(--ws-line); background: var(--ws-surface); color: var(--ws-ink);
  font-size: var(--ws-sm); font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--ws-dur-instant) var(--ws-ease-out), border-color var(--ws-dur-instant) var(--ws-ease-out), opacity var(--ws-dur-instant) var(--ws-ease-out);
}
.ws-btn:hover { background: var(--ws-hover); }
.ws-btn-dark { background: var(--ws-ink); border-color: var(--ws-ink); color: #fff; }
.ws-btn-dark:hover { background: #3a3a3a; }
.ws-btn-amber { background: var(--ws-accent); border-color: var(--ws-accent); color: var(--ws-ink); }
.ws-btn-amber:hover { background: #fbbf24; }
.ws-btn-ghost { border-color: transparent; background: transparent; color: var(--ws-ink-2); }
.ws-btn-ghost:hover { background: var(--ws-hover); color: var(--ws-ink); }
.ws-btn-danger { color: var(--ws-danger); }
.ws-btn-danger:hover { background: #fef2f2; border-color: #fecaca; }
.ws-btn-red { background: var(--ws-danger); border-color: var(--ws-danger); color: #fff; }
.ws-btn-red:hover { background: #b91c1c; }
.ws-btn-sm { min-height: 28px; padding: 4px 12px; font-size: var(--ws-xs); }
.ws-icon-btn { width: 32px; min-height: 32px; padding: 0; border-radius: var(--ws-radius-nav); }
.ws-topbar .ws-menu-btn { display: none; }
.ws-icon-btn.is-disabled { opacity: .35; pointer-events: none; }
.ws-btn-row { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ws-btn-row form { margin: 0; }
.ws-input, .ws-select, .ws-textarea {
  width: 100%; min-height: 34px; border: 1px solid var(--ws-line); border-radius: var(--ws-radius-nav);
  background: var(--ws-surface); padding: 7px 10px; font-size: var(--ws-md); color: var(--ws-ink);
  transition: border-color var(--ws-dur-instant) var(--ws-ease-out), box-shadow var(--ws-dur-instant) var(--ws-ease-out);
}
.ws-input::placeholder, .ws-textarea::placeholder { color: var(--ws-ink-3); }
.ws-select {
  appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239e9e9e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.ws-textarea { min-height: 112px; resize: vertical; line-height: 1.5; }
.ws-input:focus, .ws-select:focus, .ws-textarea:focus { outline: none; border-color: var(--ws-accent); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }
.ws-label { display: block; margin-bottom: 6px; color: var(--ws-ink-2); font-size: var(--ws-xs); font-weight: 500; }
.ws-help { color: var(--ws-ink-2); font-size: var(--ws-sm); }

/* ---------- page head ---------- */
.ws-page[hidden] { display: none !important; }
.ws-page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; }
.ws-eyebrow { margin-bottom: 6px; color: var(--ws-ink-3); font-size: var(--ws-xs); }
.ws-h1 { color: var(--ws-ink); font-size: var(--ws-lg); font-weight: 500; line-height: 1.2; }
.ws-sub { margin-top: 6px; color: var(--ws-ink-2); font-size: var(--ws-md); max-width: 68ch; }
.ws-patch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--ws-ink-2); font-size: var(--ws-sm); }
.ws-patch-label { color: var(--ws-ink); font-weight: 500; }
.ws-patch-updated { color: var(--ws-ink-3); }
.ws-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: var(--ws-radius-pill); background: var(--ws-accent-soft); color: var(--ws-accent-ink); font-size: var(--ws-xs); font-weight: 500; }
.ws-flash { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; padding: 10px 14px; border-radius: var(--ws-radius-card); background: #f0fdf4; color: var(--ws-success-ink); font-size: var(--ws-sm); }
.ws-flash.is-error { background: #fef2f2; color: #991b1b; }
.ws-flash.is-key { background: var(--ws-accent-soft); color: var(--ws-ink); flex-direction: column; }

/* ---------- welcome, stats, focus ---------- */
.ws-welcome { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; margin-bottom: 16px; border-radius: var(--ws-radius-card); background: var(--ws-bg); }
.ws-welcome-icon { flex: none; width: 36px; height: 36px; border-radius: var(--ws-radius-nav); display: grid; place-items: center; background: var(--ws-surface); color: var(--ws-accent-strong); }
.ws-welcome h2 { margin-bottom: 2px; color: var(--ws-ink); font-size: var(--ws-md); font-weight: 500; }
.ws-welcome p, .ws-welcome ol { color: var(--ws-ink-2); font-size: var(--ws-sm); }
.ws-welcome ol { margin-top: 6px; padding-left: 18px; }
.ws-welcome .ws-btn { margin-left: auto; }
/* /account's attention card: the icon and the call to action share the top row (icon left, button right,
   centred on each other), the heading and text run full width below. Holds at 320 px. */
.ws-welcome--cta { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "icon cta" "copy copy"; align-items: center; gap: 12px 14px; }
.ws-welcome--cta .ws-welcome-icon { grid-area: icon; }
.ws-welcome--cta > div { grid-area: copy; }
.ws-welcome--cta .ws-btn { grid-area: cta; justify-self: end; margin-left: 0; }

.ws-stat-row { --sp-stat-min: 180px; margin-bottom: 16px; }
.ws-stat-link { text-decoration: none; transition: border-color var(--ws-dur-instant) var(--ws-ease-out), box-shadow var(--ws-dur-instant) var(--ws-ease-out); }
.ws-stat-link:hover { border-color: #d6d6d6; box-shadow: var(--ws-shadow-soft); }
.ws-batch-stats { --sp-stat-min: 140px; margin-bottom: 14px; }

.ws-focus { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; margin-bottom: 24px; }
.ws-focus-main, .ws-focus-next { padding: 20px; border: 1px solid var(--ws-line); border-radius: var(--ws-radius-card); background: var(--ws-surface); display: flex; flex-direction: column; gap: 14px; }
.ws-focus-title { color: var(--ws-ink); font-size: var(--ws-md); font-weight: 500; }
.ws-since { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--ws-ink-2); font-size: var(--ws-md); }
.ws-since b { color: var(--ws-ink); font-size: var(--ws-lg); font-weight: 500; font-variant-numeric: tabular-nums; margin-right: 4px; }
.ws-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ws-chips-center { justify-content: center; margin-bottom: 4px; }
.ws-chips-label { color: var(--ws-ink-3); font-size: var(--ws-xs); margin-right: 2px; }
.ws-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--ws-radius-pill); background: var(--ws-bg); color: var(--ws-ink-2); font-size: var(--ws-xs); text-decoration: none; transition: background var(--ws-dur-instant) var(--ws-ease-out); }
.ws-chip:hover { background: var(--ws-hover); color: var(--ws-ink); }
.ws-chip b { color: var(--ws-ink); font-variant-numeric: tabular-nums; }
.ws-pipe { display: flex; flex-direction: column; gap: 8px; }
.ws-pipe-bar { display: flex; gap: 2px; height: 6px; border-radius: var(--ws-radius-pill); overflow: hidden; background: var(--ws-line-soft); }
.ws-pipe-bar span { display: block; height: 100%; min-width: 3px; }
.ws-pipe-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 0; list-style: none; color: var(--ws-ink-2); font-size: var(--ws-xs); }
.ws-pipe-legend li { display: inline-flex; align-items: center; gap: 6px; }
.ws-pipe-legend b { color: var(--ws-ink); font-variant-numeric: tabular-nums; }
.ws-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
[data-status="new"].ws-dot, .ws-pipe-bar [data-status="new"] { background: var(--ws-stage-new); }
[data-status="to_contact"].ws-dot, .ws-pipe-bar [data-status="to_contact"] { background: var(--ws-stage-chosen); }
[data-status="letter_sent"].ws-dot, .ws-pipe-bar [data-status="letter_sent"] { background: var(--ws-stage-letter); }
[data-status="contacted"].ws-dot, .ws-pipe-bar [data-status="contacted"] { background: var(--ws-stage-contacted); }
[data-status="quoted"].ws-dot, .ws-pipe-bar [data-status="quoted"] { background: var(--ws-stage-quoted); }
[data-status="won"].ws-dot, .ws-pipe-bar [data-status="won"] { background: var(--ws-stage-won); }
[data-status="not_interested"].ws-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ws-stage-new); }
.ws-pipe-bar [data-status="not_interested"] { background: var(--ws-stage-closed); }
.ws-actions { display: flex; flex-direction: column; gap: 8px; padding: 0; list-style: none; }
.ws-action { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border-radius: var(--ws-radius-card); background: var(--ws-bg); }
.ws-action-icon { width: 36px; height: 36px; border-radius: var(--ws-radius-nav); display: grid; place-items: center; background: var(--ws-surface); color: var(--ws-ink-2); }
.ws-action[data-action="letters"] .ws-action-icon, .ws-action[data-action="review"] .ws-action-icon { color: var(--ws-accent-strong); }
.ws-action-title { color: var(--ws-ink); font-size: var(--ws-md); font-weight: 500; }
.ws-action-detail { margin-top: 2px; color: var(--ws-ink-2); font-size: var(--ws-xs); }
.ws-action-ctas { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.ws-action-ctas form { margin: 0; }
.ws-action-ctas .ws-btn { width: 100%; }
.ws-allclear { padding: 14px; border-radius: var(--ws-radius-card); background: var(--ws-bg); color: var(--ws-ink-2); font-size: var(--ws-sm); }
/* Demand Radar's step-by-step guide (radar-guide.ejs): a modal with one step at
   a time when JavaScript runs; a plain card listing every step when it does not. */
.ws-guide { width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--ws-radius-panel); background: var(--ws-surface); color: var(--ws-ink); box-shadow: var(--ws-shadow-float); overflow: auto; }
/* Not (yet) a modal: JavaScript off, or before radar-guide.js runs. Float it over the page. */
.ws-guide:not(.is-modal)[open] { position: fixed; inset: 16px; z-index: 200; height: fit-content; margin: auto; border: 1px solid var(--ws-line); }
.ws-guide::backdrop { background: rgba(0, 0, 0, 0.32); }
.ws-guide.is-modal[open] { animation: ws-guide-in var(--ws-dur-enter) var(--ws-ease-out); }
@keyframes ws-guide-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.ws-guide-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 18px 0 24px; }
.ws-guide-head form { margin: 0; }
.ws-guide-count { margin-top: 2px; color: var(--ws-ink-3); font-size: var(--ws-xs); }
.ws-guide-steps { display: grid; gap: 18px; margin: 0; padding: 12px 24px 4px; list-style: none; }
.ws-guide.is-modal .ws-guide-steps { min-height: 228px; }
.ws-guide-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; }
.ws-guide-step[hidden] { display: none; }
.ws-guide-n { width: 28px; height: 28px; border-radius: var(--ws-radius-pill); display: grid; place-items: center; background: var(--ws-accent-soft); color: var(--ws-accent-ink); font-size: var(--ws-sm); font-weight: 500; }
.ws-guide-step h3 { margin-top: 3px; color: var(--ws-ink); font-size: var(--ws-md); font-weight: 500; }
.ws-guide-step p, .ws-guide-step ul { margin-top: 8px; color: var(--ws-ink-2); font-size: var(--ws-sm); line-height: 1.55; }
.ws-guide-step ul { padding-left: 18px; }
.ws-guide-step b { color: var(--ws-ink); font-weight: 500; }
.ws-guide-step .ws-btn, .ws-guide-step form { margin-top: 12px; }
.ws-guide-big { color: var(--ws-ink-2); }
.ws-guide-big b { color: var(--ws-accent-ink); font-size: 40px; line-height: 1; letter-spacing: -0.8px; font-variant-numeric: tabular-nums; margin-right: 6px; }
.ws-guide-rule { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-radius: var(--ws-radius-card); background: var(--ws-accent-wash); color: var(--ws-accent-ink) !important; }
.ws-guide-rule .ws-i { flex: none; margin-top: 2px; }
.ws-guide-foot { display: flex; align-items: center; gap: 10px; padding: 16px 24px 20px; }
.ws-guide-foot form { margin: 0 0 0 auto; }
.ws-guide-foot [data-guide-next] { margin-left: auto; }
.ws-guide-foot [hidden] { display: none; }
.ws-guide-dots { display: flex; gap: 6px; margin: 0 auto; }
.ws-guide-dots span { width: 6px; height: 6px; border-radius: var(--ws-radius-pill); background: var(--ws-line); transition: background var(--ws-dur-quick) var(--ws-ease-out); }
.ws-guide-dots span.is-on { background: var(--ws-accent-strong); }
html:not(.js) .ws-guide-foot form { margin-left: 0; }
/* The headline tile: the one number to act on. */
.sp-stat.is-headline { background: var(--ws-accent-wash); border-color: var(--ws-accent-soft); }
.sp-stat.is-headline .sp-stat__value { color: var(--ws-accent-ink); }

/* Free accounts on /account: the trial card under the feed, the quiet
   objection-letter line, and the Plans page (Free / Starter / Pro). Amber
   only on Pro and the trial button; everything else stays in the ink scale. */
.ws-trial { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px 16px; align-items: start; margin: 0 0 16px; padding: 18px; border: 1px solid var(--ws-accent-soft); border-radius: var(--ws-radius-card); background: var(--ws-accent-wash); }
.ws-trial .ws-welcome-icon { color: var(--ws-accent-strong); }
/* Inside the feed, after the second application: a full-width row, not a data row. */
.ws-table tbody tr.ws-trial-row, .ws-table tbody tr.ws-trial-row:hover { background: transparent; }
.ws-table td[data-col="trial"] { padding: 12px 0; }
.ws-trial-row .ws-trial { margin: 0; }
.ws-trial h2 { margin: 0 0 4px; color: var(--ws-ink); font-size: var(--ws-md); font-weight: 500; }
.ws-trial p { margin: 0; color: var(--ws-ink-2); font-size: var(--ws-sm); }
.ws-trial-save { margin-top: 12px; grid-template-columns: minmax(120px, 220px) auto; justify-content: start; }
.ws-trial-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.ws-trial-actions .ws-help { max-width: 220px; font-size: var(--ws-xs); }
@media (max-width: 760px) {
  .ws-table tbody tr.ws-trial-row { display: block; padding: 0; border: 0; border-radius: 0; background: transparent; }
  .ws-table td[data-col="trial"] { display: block; padding: 0; }
  .ws-trial { grid-template-columns: minmax(0, 1fr); }
  .ws-trial .ws-welcome-icon { display: none; }
  .ws-trial-actions { align-items: stretch; text-align: left; }
  .ws-trial-actions .ws-btn { justify-content: center; }
  .ws-trial-actions .ws-help { max-width: none; }
  .ws-trial-save { grid-template-columns: minmax(0, 1fr) auto; }
}
.ws-upsell-note { display: flex; gap: 8px; align-items: flex-start; margin: 10px 2px 0; }
.ws-upsell-note .ws-i, .ws-plans-biz .ws-i { flex: none; margin-top: 3px; color: var(--ws-ink-3); }
.ws-plan-period { margin-left: auto; }
.ws-plans-where-row { grid-template-columns: minmax(120px, 240px) 120px; justify-content: start; }
.ws-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: stretch; }
.ws-plan { display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--ws-line); border-radius: var(--ws-radius-card); background: var(--ws-surface); }
.ws-plan.is-pro { border-color: var(--ws-accent); box-shadow: var(--ws-shadow-soft); background: linear-gradient(var(--ws-accent-wash), var(--ws-surface) 45%); }
.ws-plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ws-plan-head h2 { margin: 0; color: var(--ws-ink); font-size: var(--ws-md); font-weight: 500; }
.ws-tag-pro { background: var(--ws-accent-soft); color: var(--ws-accent-ink); }
.ws-plan-price { margin: 0 0 6px; color: var(--ws-ink-2); font-size: var(--ws-sm); }
.ws-plan-price b { color: var(--ws-ink); font-size: var(--ws-lg); font-weight: 500; font-variant-numeric: tabular-nums; }
.ws-plan > .ws-help { margin: 0 0 12px; }
.ws-plan-list { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; color: var(--ws-ink); font-size: var(--ws-sm); }
.ws-plan-list li { display: flex; gap: 8px; align-items: flex-start; }
.ws-plan-list .ws-i { flex: none; margin-top: 2px; color: var(--ws-success-ink); }
.ws-plan-list li.is-off { color: var(--ws-ink-2); }
.ws-plan-list li.is-off .ws-i { color: var(--ws-ink-3); }
.ws-plan-cta { margin-top: auto; justify-content: center; width: 100%; }
.ws-plan-then { margin: 8px 0 0; color: var(--ws-ink-3); font-size: var(--ws-xs); text-align: center; }
.ws-plans-biz { display: flex; gap: 8px; align-items: flex-start; margin: 16px 2px 0; }
@media (max-width: 900px) {
  .ws-plans { grid-template-columns: minmax(0, 1fr); }
  .ws-plan.is-pro { order: -1; }
  .ws-plan:first-child { order: 1; }
  .ws-plan-period { margin-left: 0; }
}
@media (max-width: 480px) {
  .ws-plans-where-row { grid-template-columns: minmax(0, 1fr) 110px; }
}

/* ---------- view tabs + toolbar ---------- */
.ws-results { display: flex; flex-direction: column; }
.ws-viewbar { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; }
.ws-tabs {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
  padding-right: 24px;
}
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--ws-radius-pill);
  color: var(--ws-ink-2); font-size: var(--ws-sm); text-decoration: none; white-space: nowrap;
  transition: background var(--ws-dur-instant) var(--ws-ease-out), color var(--ws-dur-instant) var(--ws-ease-out);
}
.ws-tab .ws-i { color: var(--ws-ink-3); }
.ws-tab:hover { background: var(--ws-bg); color: var(--ws-ink); }
.ws-tab[aria-current="page"] { background: var(--ws-hover); color: var(--ws-ink); font-weight: 500; }
.ws-tab[aria-current="page"] .ws-i { color: var(--ws-ink); }
.ws-tab-count { color: var(--ws-ink-3); font-size: var(--ws-xs); font-weight: 400; font-variant-numeric: tabular-nums; }
.ws-viewbar-actions { flex: none; display: flex; align-items: center; gap: 6px; }
.ws-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 0 10px; border-bottom: 1px solid var(--ws-line-soft); }
.ws-search { position: relative; flex: 1 1 190px; max-width: 300px; }
.ws-search .ws-i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ws-ink-3); }
.ws-search .ws-input { padding-left: 32px; font-size: var(--ws-sm); }
.ws-filter { flex: 0 1 auto; }
.ws-filter .ws-select { width: auto; max-width: 150px; min-height: 32px; padding-top: 5px; padding-bottom: 5px; font-size: var(--ws-sm); text-overflow: ellipsis; }
.ws-filter .ws-select.is-set { border-color: #fcd34d; background-color: #fffbeb; }
.ws-sort { position: relative; }
.ws-sort > .ws-i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ws-ink-3); pointer-events: none; }
.ws-sort .ws-select { padding-left: 30px; border-color: transparent; background-color: transparent; color: var(--ws-ink-2); }
.ws-sort .ws-select:hover { background-color: var(--ws-bg); }
.ws-count-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 8px; color: var(--ws-ink-3); font-size: var(--ws-xs); }
.ws-count-line a { color: var(--ws-ink); text-decoration: underline; text-decoration-color: var(--ws-line); text-underline-offset: 3px; }
.ws-more { position: relative; }
.ws-more > summary { list-style: none; }
.ws-more > summary::-webkit-details-marker { display: none; }
.ws-more > summary.is-set { border-color: #fcd34d; background: #fffbeb; }
.ws-more-pop { position: absolute; left: 0; top: calc(100% + 6px); z-index: 30; width: 260px; padding: 14px; display: flex; flex-direction: column; gap: 10px; border-radius: var(--ws-radius-card); background: var(--ws-surface); border: 1px solid var(--ws-line); box-shadow: var(--ws-shadow-float); }
.ws-more-pop .ws-filter .ws-select { width: 100%; max-width: none; }
.ws-saveview { position: relative; }
.ws-saveview > summary { list-style: none; }
.ws-saveview > summary::-webkit-details-marker { display: none; }
.ws-saveview-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 290px; padding: 14px; border-radius: var(--ws-radius-card); background: var(--ws-surface); border: 1px solid var(--ws-line); box-shadow: var(--ws-shadow-float); }
.ws-saveview-pop form { display: flex; flex-direction: column; gap: 8px; }

/* ---------- the table ---------- */
.ws-table-wrap { overflow-x: auto; }
.ws-table { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 900px; }
.ws-table th {
  text-align: left; font-weight: 500; font-size: var(--ws-xs); color: var(--ws-ink-3);
  border-bottom: 1px solid var(--ws-line-soft); padding: 8px 10px; white-space: nowrap;
}
.ws-table th .ws-i { margin-right: 5px; color: var(--ws-ink-3); }
.ws-table th a { text-decoration: none; display: inline-flex; align-items: center; }
.ws-table th a:hover, .ws-table th[aria-sort] { color: var(--ws-ink); }
.ws-table td { padding: 10px; border-bottom: 1px solid var(--ws-line-soft); vertical-align: middle; font-size: var(--ws-md); }
.ws-table tbody tr { transition: background var(--ws-dur-instant) var(--ws-ease-out); }
.ws-table tbody tr:hover, .ws-table tbody tr.is-selected { background: #fafafa; }
.ws-table tbody tr.is-selected { box-shadow: inset 2px 0 0 var(--ws-accent); }
.ws-col-status { width: 150px; }
.ws-col-link { width: 44px; text-align: center; }

/* ---------- ticking rows ---------- */
/* Geometry from the Elements Library checkbox (16px, 4px corners, ink when on). */
.ws-check {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; cursor: pointer;
  width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--ws-control-edge); background: var(--ws-surface) center / 11px 11px no-repeat;
  transition: background-color var(--ws-dur-instant) var(--ws-ease-out), border-color var(--ws-dur-instant) var(--ws-ease-out);
}
.ws-check:hover { border-color: var(--ws-ink-2); }
.ws-check:checked {
  background-color: var(--ws-ink); border-color: var(--ws-ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}
.ws-check:indeterminate {
  background-color: var(--ws-ink); border-color: var(--ws-ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E");
}
.ws-check:focus-visible { border-radius: 4px; }
.ws-check-hit { display: inline-grid; place-items: center; width: 32px; height: 32px; margin: -8px; border-radius: var(--ws-radius-nav); cursor: pointer; }
@media (hover: hover) { .ws-check-hit:hover { background: var(--ws-hover); } }
.ws-check-fake { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--ws-line); }
.ws-table .ws-col-check { width: 30px; padding-left: 14px; padding-right: 2px; }
.ws-table tbody tr.is-checked, .ws-table tbody tr.is-checked:hover { background: var(--ws-accent-wash); }

/* The bar for ticked rows. Without JavaScript it is a plain toolbar above the
   table; with it, it floats at the bottom and only shows while rows are ticked. */
.ws-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 10px; padding: 8px 10px; border-radius: var(--ws-radius-card); background: var(--ws-bg); font-size: var(--ws-sm); }
.ws-bulk-count { display: flex; align-items: center; gap: 6px; color: var(--ws-ink-2); min-width: 0; }
.ws-bulk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ws-bulk-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 6px 12px; border-radius: var(--ws-radius-pill);
  border: 1px solid var(--ws-line); background: var(--ws-surface); color: var(--ws-ink); font-size: var(--ws-sm); font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background var(--ws-dur-instant) var(--ws-ease-out), opacity var(--ws-dur-instant) var(--ws-ease-out);
}
.ws-bulk-btn:hover { background: var(--ws-hover); }
.ws-bulk-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--ws-line); }
.js .ws-bulk {
  position: fixed; z-index: 45; left: 50%; bottom: 20px; transform: translateX(-50%);
  width: max-content; max-width: calc(100vw - 32px); margin: 0; padding: 6px 6px 6px 16px; gap: 6px 10px; flex-wrap: nowrap;
  background: #262626; color: #fff; box-shadow: var(--ws-shadow-float), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  animation: ws-bulk-in var(--ws-dur-enter) var(--ws-ease-out);
}
.js .ws-bulk:not(.is-active) { display: none; }
.js .ws-bulk.is-steady { animation: none; }
@keyframes ws-bulk-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.js .ws-bulk-count { color: #fff; }
.ws-bulk-n { font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ws-bulk-link { border: 0; background: none; padding: 4px 6px; border-radius: var(--ws-radius-nav); color: var(--ws-stage-letter); font-size: var(--ws-sm); cursor: pointer; white-space: nowrap; text-decoration: underline; text-underline-offset: 3px; }
.ws-bulk-link[hidden] { display: none; }
.ws-bulk-x { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: var(--ws-radius-pill); background: none; color: rgba(255, 255, 255, 0.7); cursor: pointer; }
.ws-bulk-x:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.js .ws-bulk-actions { flex-wrap: nowrap; }
.js .ws-bulk-btn { border-color: transparent; background: transparent; color: #fff; }
.js .ws-bulk-btn:hover { background: rgba(255, 255, 255, 0.12); }
.js .ws-bulk-btn .ws-i { color: rgba(255, 255, 255, 0.7); }
.js .ws-bulk-sep { background: rgba(255, 255, 255, 0.18); }
.ws-bulk.is-busy .ws-bulk-btn { opacity: .5; pointer-events: none; }
.js body.has-bulk .ws-toasts { bottom: 84px; }
.js body.has-bulk .ws-content { padding-bottom: 120px; }
/* Centred on the content, not the window: the sidebar takes the left. */
@media (min-width: 901px) {
  .js .ws-bulk { left: calc(var(--ws-sidebar) + (100vw - var(--ws-sidebar)) / 2); max-width: calc(100vw - var(--ws-sidebar) - 32px); }
}
/* With a row open: between the sidebar and the panel on wide screens, out of the way on narrower ones. */
@media (min-width: 1200px) {
  .js body:has(#ws-panel) .ws-bulk { left: calc(var(--ws-sidebar) + (100vw - var(--ws-sidebar) - var(--ws-panel) - 16px) / 2); max-width: calc(100vw - var(--ws-sidebar) - var(--ws-panel) - 48px); flex-wrap: wrap; }
}
@media (max-width: 1199px) {
  .js body:has(#ws-panel) .ws-bulk { display: none; }
}
.ws-flag-letters { color: var(--ws-ink-2); }
.ws-panel-pick { gap: 8px; cursor: pointer; }
.ws-panel-pick .ws-check { width: 14px; height: 14px; background-size: 10px 10px; }
.js .ws-panel-bar .ws-panel-pick { margin-left: auto; }
.js .ws-panel-bar .ws-panel-pick ~ .ws-btn:last-child { margin-left: 0; }
.ws-inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0; }
.ws-addr { display: flex; align-items: center; gap: 8px; min-width: 220px; }
.ws-addr-link { flex: 1; min-width: 0; text-decoration: none; color: var(--ws-ink); }
.ws-addr-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; font-weight: 500; }
.ws-addr-link:hover .ws-addr-text { text-decoration: underline; text-decoration-color: var(--ws-line); text-underline-offset: 3px; }
.ws-addr-meta { display: block; margin-top: 2px; color: var(--ws-ink-3); font-size: var(--ws-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.ws-open {
  flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--ws-radius-pill);
  border: 1px solid var(--ws-line); background: var(--ws-surface); color: var(--ws-ink-2); font-size: var(--ws-xs);
  opacity: 0; transition: opacity var(--ws-dur-instant) var(--ws-ease-out);
}
.ws-table tbody tr:hover .ws-open, .ws-addr-link:focus-visible + .ws-open, .ws-table tbody tr.is-selected .ws-open { opacity: 1; }
.ws-new-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ws-accent); }
.ws-work-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ws-tag { display: inline-flex; align-items: center; max-width: 220px; padding: 2px 10px; border-radius: var(--ws-radius-pill); background: var(--ws-hover); color: var(--ws-ink); font-size: var(--ws-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-tag-paused { background: var(--ws-accent-soft); color: var(--ws-accent-ink); }
.ws-flag { display: inline-flex; align-items: center; gap: 4px; color: var(--ws-accent-ink); font-size: var(--ws-xs); white-space: nowrap; }
.ws-flag .ws-i { width: 12px; height: 12px; }
.ws-flag[data-quality="paperwork"] { color: var(--ws-ink-3); }
.ws-cell-meta { display: block; max-width: 300px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ws-ink-2); font-size: var(--ws-xs); }
/* Two lines of the description, so a row can be read without opening it. */
.ws-desc-line { max-width: 420px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.ws-appstatus { color: var(--ws-ink-2); }
.ws-appstatus[data-tone="good"] { color: var(--ws-success-ink); }
.ws-appstatus[data-tone="bad"] { color: var(--ws-danger); }
.ws-note-preview { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ws-ink-2); font-size: var(--ws-sm); }
.ws-has-notes { display: none; flex: none; color: var(--ws-ink-3); }
/* Narrower screens: notes live in the panel (and the CSV); a mark shows a row has some. */
@media (max-width: 1500px) and (min-width: 761px) {
  .ws-table .ws-col-notes, .ws-table td[data-col="notes"] { display: none; }
  .ws-has-notes { display: inline-flex; }
}
.ws-ext { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--ws-radius-nav); color: var(--ws-ink-3); text-decoration: none; transition: background var(--ws-dur-instant) var(--ws-ease-out), color var(--ws-dur-instant) var(--ws-ease-out); }
.ws-ext:hover { background: var(--ws-hover); color: var(--ws-ink); }

/* Status: a quiet pill; the dot carries the stage, the word carries the meaning. */
.ws-status-form { display: flex; align-items: center; gap: 6px; margin: 0; }
.ws-status {
  appearance: none; -webkit-appearance: none; cursor: pointer; border: 0; max-width: 150px;
  min-height: 28px; padding: 4px 28px 4px 24px; border-radius: var(--ws-radius-pill);
  background-color: var(--ws-hover); color: var(--ws-ink); font-size: var(--ws-sm); font-weight: 500;
  background-image: radial-gradient(circle, var(--ws-stage-new) 0 3.5px, transparent 4px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239e9e9e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat, no-repeat; background-size: 8px 8px, 10px 10px; background-position: 10px center, right 10px center;
  transition: background-color var(--ws-dur-instant) var(--ws-ease-out);
}
.ws-status:hover { background-color: #ececec; }
.ws-status[data-status="to_contact"] { background-image: radial-gradient(circle, var(--ws-stage-chosen) 0 3.5px, transparent 4px), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239e9e9e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.ws-status[data-status="letter_sent"] { background-image: radial-gradient(circle, var(--ws-stage-letter) 0 3.5px, transparent 4px), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239e9e9e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.ws-status[data-status="contacted"] { background-image: radial-gradient(circle, var(--ws-stage-contacted) 0 3.5px, transparent 4px), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239e9e9e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.ws-status[data-status="quoted"] { background-image: radial-gradient(circle, var(--ws-stage-quoted) 0 3.5px, transparent 4px), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239e9e9e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.ws-status[data-status="won"] { background-color: #ecfdf3; color: var(--ws-success-ink); background-image: radial-gradient(circle, var(--ws-stage-won) 0 3.5px, transparent 4px), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239e9e9e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.ws-status[data-status="not_interested"] { background-color: transparent; color: var(--ws-ink-3); box-shadow: inset 0 0 0 1px var(--ws-line); }
.ws-status option { color: var(--ws-ink); background: #fff; }
.ws-status.is-saving { opacity: .6; }
.ws-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 10px; border-radius: var(--ws-radius-pill); background: var(--ws-hover); color: var(--ws-ink); font-size: var(--ws-sm); font-weight: 500; }
.ws-pill[data-status="won"] { background: #ecfdf3; color: var(--ws-success-ink); }

.ws-pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 2px 0; color: var(--ws-ink-3); font-size: var(--ws-xs); }
.ws-pager-links { display: flex; gap: 6px; }

.ws-example td { color: var(--ws-ink-2); }
.ws-example-tag { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: var(--ws-radius-pill); background: var(--ws-accent-soft); color: var(--ws-accent-ink); font-size: var(--ws-xs); font-weight: 500; vertical-align: 1px; }
.ws-empty { border-bottom: 1px solid var(--ws-line-soft); }
/* The element's action slot is a button; ours are links to the right page. */
a.sp-empty__action { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- row panel: a floating sheet ---------- */
.ws-panel {
  position: fixed; top: 8px; right: 8px; bottom: 8px; z-index: 40; width: min(var(--ws-panel), calc(100vw - 16px));
  background: var(--ws-surface); border-radius: var(--ws-radius-card); box-shadow: var(--ws-shadow-float), 0 0 0 1px rgba(0, 0, 0, 0.04);
  display: flex; flex-direction: column; animation: ws-sheet-in var(--ws-dur-enter) var(--ws-ease-out);
}
@keyframes ws-sheet-in { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.ws-panel-bar { display: flex; align-items: center; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--ws-line-soft); }
.ws-panel-bar .ws-btn:last-child { margin-left: auto; }
.ws-panel-where { margin-left: 6px; color: var(--ws-ink-3); font-size: var(--ws-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-panel-body { flex: 1; overflow-y: auto; padding: 22px 24px 28px; }
.ws-panel h2 { margin-bottom: 4px; color: var(--ws-ink); font-size: var(--ws-lg); font-weight: 500; line-height: 1.2; }
.ws-panel-sub { margin-bottom: 18px; color: var(--ws-ink-3); font-size: var(--ws-sm); }
.ws-props { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 2px 10px; margin-bottom: 16px; }
.ws-props dt { display: flex; align-items: center; gap: 8px; min-height: 34px; color: var(--ws-ink-2); font-size: var(--ws-sm); }
.ws-props dt .ws-i { color: var(--ws-ink-3); }
.ws-props dd { min-height: 34px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--ws-ink); font-size: var(--ws-sm); }
.ws-why { line-height: 1.4; }
.ws-note { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 16px; padding: 10px 12px; border-radius: var(--ws-radius-nav); background: var(--ws-accent-wash); color: var(--ws-accent-ink); font-size: var(--ws-sm); }
.ws-note .ws-i { margin-top: 2px; }
.ws-note[data-quality="paperwork"] { background: var(--ws-bg); color: var(--ws-ink-2); }
.ws-section-title { margin: 20px 0 8px; color: var(--ws-ink-3); font-size: var(--ws-xs); font-weight: 500; }
.ws-desc { padding: 12px 14px; border-radius: var(--ws-radius-nav); background: var(--ws-bg); color: var(--ws-ink); font-size: var(--ws-md); line-height: 1.55; }
.ws-notes-form { display: flex; flex-direction: column; gap: 8px; }
.ws-notes-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ws-ink-3); font-size: var(--ws-xs); }
.ws-timeline { position: relative; padding: 0; list-style: none; }
.ws-timeline li { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 10px; padding-bottom: 12px; }
.ws-timeline li::before { content: ''; position: absolute; left: 12.5px; top: 26px; bottom: 0; width: 1px; background: var(--ws-line); }
.ws-timeline li:last-child::before { display: none; }
.ws-tl-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--ws-bg); color: var(--ws-ink-3); }
.ws-timeline li.is-mine .ws-tl-icon { background: var(--ws-accent-soft); color: var(--ws-accent-ink); }
.ws-timeline li.is-future { opacity: .7; }
.ws-tl-text { margin-top: 3px; color: var(--ws-ink); font-size: var(--ws-sm); }
.ws-tl-date { color: var(--ws-ink-3); font-size: var(--ws-xs); }
.ws-scrim { display: none; }

/* ---------- settings pages ---------- */
.ws-card { padding: 20px; margin-bottom: 16px; border: 1px solid var(--ws-line); border-radius: var(--ws-radius-card); background: var(--ws-surface); }
.ws-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ws-card h2 { display: flex; align-items: center; gap: 8px; color: var(--ws-ink); font-size: var(--ws-md); font-weight: 500; }
.ws-card h2 .ws-i { color: var(--ws-ink-3); }
.ws-card p { margin-bottom: 12px; }
.ws-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ws-grid-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.ws-list { display: flex; flex-direction: column; gap: 8px; }
.ws-item { padding: 12px; border: 1px solid var(--ws-line-soft); border-radius: var(--ws-radius-card); background: var(--ws-surface); }
.ws-item-muted { background: var(--ws-bg); border-color: transparent; }
.ws-row-form { display: grid; grid-template-columns: minmax(120px, 1fr) 140px auto auto; gap: 8px; align-items: center; }
/* A label round a checkbox ("Enabled", "New proposals only"). Not .ws-check: that is the 16 px box itself. */
.ws-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--ws-ink-2); font-size: var(--ws-sm); cursor: pointer; }
.ws-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.ws-topic-check { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: var(--ws-radius-pill); background: var(--ws-bg); color: var(--ws-ink-2); font-size: var(--ws-xs); }
.ws-code { display: block; overflow-x: auto; white-space: pre; padding: 10px 12px; border-radius: var(--ws-radius-nav); background: #262626; color: #fde68a; font-family: var(--ws-mono); font-size: var(--ws-xs); letter-spacing: 0; }
.ws-code-light { background: var(--ws-surface); color: var(--ws-ink); border: 1px solid #fde68a; }
.ws-simple-table { width: 100%; border-collapse: collapse; font-size: var(--ws-sm); }
.ws-simple-table th, .ws-simple-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--ws-line-soft); }
.ws-simple-table th { color: var(--ws-ink-3); font-weight: 500; font-size: var(--ws-xs); }
.ws-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ws-step { display: block; padding: 14px; border-radius: var(--ws-radius-card); background: var(--ws-bg); text-decoration: none; }
.ws-step b { display: flex; align-items: center; gap: 8px; color: var(--ws-ink); font-size: var(--ws-sm); font-weight: 500; }
.ws-step span:not(.ws-step-icon) { display: block; margin-top: 4px; color: var(--ws-ink-2); font-size: var(--ws-xs); }
.ws-step-icon { color: var(--ws-ink-3); display: inline-flex; }
.ws-step-icon.is-done { color: var(--ws-success); }
.ws-cancel [data-cancel-step].hidden { display: none; }
.ws-radio { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--ws-ink-2); font-size: var(--ws-sm); }
details.ws-details { padding: 12px 14px; border-radius: var(--ws-radius-card); background: var(--ws-bg); }
details.ws-details > summary { cursor: pointer; color: var(--ws-ink); font-size: var(--ws-sm); font-weight: 500; }

/* ---------- toasts ---------- */
.ws-toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.ws-toast { pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--ws-radius-pill); background: #262626; color: #fff; font-size: var(--ws-sm); box-shadow: var(--ws-shadow-float); animation: ws-toast-in var(--ws-dur-quick) var(--ws-ease-out); }
.ws-toast.is-error { background: #991b1b; }
.ws-toast-action { border: 0; background: none; padding: 0 0 0 4px; color: var(--ws-stage-letter); font-size: var(--ws-sm); font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@keyframes ws-toast-in { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .ws-focus { grid-template-columns: minmax(0, 1fr); }
  .ws-grid-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .ws-app { grid-template-columns: minmax(0, 1fr); }
  .ws-sidebar {
    position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); height: auto;
    background: var(--ws-bg); transform: translateX(-102%); transition: transform var(--ws-dur-enter) var(--ws-ease-out);
    box-shadow: var(--ws-shadow-float);
  }
  .ws-sidebar.is-open { transform: none; }
  .ws-topbar .ws-menu-btn { display: inline-flex; }
  .ws-scrim.is-open { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, 0.24); }
  .ws-main { margin: 0; border-radius: 0; min-height: 100vh; box-shadow: none; }
  /* Phone top bar: one line, fixed height, always pinned. Only the page title
     shows; the workspace name lives in the sidebar. */
  .ws-topbar { height: 52px; min-height: 52px; padding: 4px 12px 4px 16px; border-radius: 0; flex-wrap: nowrap; }
  .ws-crumbs { flex: 1; }
  .ws-crumbs > span { display: none; }
  .ws-crumbs strong { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ws-content { padding: 20px 16px 56px; }
  .ws-steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .ws-stat-row { --sp-stat-min: 150px; }
  .ws-focus-main, .ws-focus-next { padding: 16px; }
  .ws-guide-head { padding: 14px 12px 0 16px; }
  .ws-guide-steps { padding: 10px 16px 4px; }
  .ws-guide-foot { padding: 14px 16px 16px; }
  .ws-action { grid-template-columns: 36px minmax(0, 1fr); }
  .ws-action-ctas { grid-column: 1 / -1; flex-direction: row; }
  .ws-action-ctas .ws-btn { width: auto; }
  .ws-viewbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .ws-viewbar-actions { order: -1; justify-content: flex-end; }
  /* Icon-only on phones; the label stays for screen readers. */
  .ws-viewbar-actions .ws-btn-text, .ws-topbar-actions .ws-btn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ws-viewbar-actions .ws-btn, .ws-topbar-actions .ws-btn { width: 34px; padding: 0; }
  .ws-sort { margin-right: auto; }
  .ws-search { flex-basis: 100%; max-width: none; }
  .ws-filter { flex: 1 1 calc(50% - 8px); }
  .ws-filter .ws-select { width: 100%; max-width: none; }
  .ws-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .ws-row-form { grid-template-columns: minmax(0, 1fr) 110px; }
  .ws-props { grid-template-columns: 124px minmax(0, 1fr); }
  .ws-panel { inset: 0; width: 100vw; border-radius: 0; }
  .ws-welcome { flex-wrap: wrap; }
  .ws-welcome .ws-btn { margin-left: 0; }

  /* table -> cards */
  .ws-table-wrap { overflow: visible; }
  .ws-table { min-width: 0; display: block; }
  .ws-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ws-table tbody { display: flex; flex-direction: column; gap: 10px; padding-top: 10px; }
  .ws-table tbody tr {
    display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; grid-template-areas: "check addr addr" ". work work" ". meta status";
    gap: 10px 12px; padding: 14px; border: 1px solid var(--ws-line); border-radius: var(--ws-radius-card); background: var(--ws-surface);
  }
  .ws-table td[data-col="check"] { grid-area: check; width: auto; padding: 2px 0 0; }
  .ws-check-hit { width: 40px; height: 40px; margin: -12px; }
  .ws-table tbody tr.is-checked { border-color: #fcd9a0; }
  .ws-table tbody tr.is-selected { box-shadow: inset 2px 0 0 var(--ws-accent); }
  .ws-table td { display: block; padding: 0; border: 0; }
  .ws-table td[data-col="status"] { grid-area: status; justify-self: end; align-self: end; }
  .ws-table td[data-col="address"] { grid-area: addr; }
  .ws-table td[data-col="work"] { grid-area: work; }
  .ws-table td[data-col="area"], .ws-table td[data-col="window"] { grid-area: meta; font-size: var(--ws-sm); align-self: end; }
  .ws-table td[data-col="received"], .ws-table td[data-col="notes"], .ws-table td[data-col="link"] { display: none; }
  .ws-addr { min-width: 0; }
  .ws-addr-text, .ws-addr-meta { max-width: none; white-space: normal; }
  .ws-cell-meta, .ws-desc-line { max-width: none; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .ws-open { display: none; }
  .ws-col-status, .ws-col-link { width: auto; }

  .js .ws-bulk { left: 8px; right: 8px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); transform: none; width: auto; max-width: none; flex-wrap: wrap; padding: 10px; }
  @keyframes ws-bulk-in-phone { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
  .js .ws-bulk { animation-name: ws-bulk-in-phone; }
  .js .ws-bulk-count { flex: 1 1 100%; padding-left: 6px; }
  .js .ws-bulk-x { margin-left: auto; }
  .js .ws-bulk-actions { flex: 1 1 100%; flex-wrap: wrap; }
  .js .ws-bulk-btn { flex: 1 1 auto; justify-content: center; }
  .js .ws-bulk-sep { display: none; }
  .js body.has-bulk .ws-toasts { bottom: 150px; }
  .js body.has-bulk .ws-content { padding-bottom: 170px; }
}

/* ---------- sign-in pages (login, sign-up, magic link, checkout cancelled) ---------- */
.ws-auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 48px 16px 32px; }
.ws-auth-card { width: 100%; max-width: 440px; padding: 28px; border: 1px solid var(--ws-line); border-radius: var(--ws-radius-card); background: var(--ws-surface); box-shadow: var(--ws-shadow-soft); }
.ws-auth-card .ws-sub { margin-bottom: 4px; }
.ws-auth-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; margin-bottom: 14px; border-radius: var(--ws-radius-nav); background: var(--ws-accent-wash); color: var(--ws-accent-strong); }
.ws-auth-form { display: grid; gap: 14px; margin-top: 20px; }
.ws-auth-form .ws-input, .ws-auth-form .ws-btn { width: 100%; }
.ws-auth-form .ws-btn { justify-content: center; min-height: 40px; }
.ws-auth-static { padding: 9px 12px; border-radius: var(--ws-radius-nav); background: var(--ws-bg); color: var(--ws-ink-2); font-size: var(--ws-md); overflow-wrap: anywhere; }
.ws-auth-or { display: flex; align-items: center; gap: 10px; margin: 18px 0; color: var(--ws-ink-3); font-size: var(--ws-xs); }
.ws-auth-or::before, .ws-auth-or::after { content: ""; flex: 1; height: 1px; background: var(--ws-line); }
.ws-auth-note { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--ws-line-soft); color: var(--ws-ink-2); font-size: var(--ws-sm); }
.ws-auth-note p + p { margin-top: 6px; }
.ws-auth-list { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; color: var(--ws-ink-2); font-size: var(--ws-sm); }
.ws-auth-list li { display: flex; align-items: flex-start; gap: 8px; }
.ws-auth-list .ws-i { flex: none; margin-top: 2px; color: var(--ws-accent-strong); }
.ws-auth-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; color: var(--ws-ink-3); font-size: var(--ws-xs); }
.ws-auth-foot a { color: inherit; }
.ws-auth-google { min-height: 40px; }
.ws-auth-hint { margin: 0; color: var(--ws-ink-2); font-size: var(--ws-sm); }
.ws-auth-hint.is-error { color: #991b1b; }
.ws-auth-hint[hidden], .ws-auth-alt[hidden] { display: none; }
/* Email-first login: the password field opens below the email (0fr to 1fr rows),
   inside the email's own grid cell so a closed field costs no gap. The 3px
   pad keeps the focus ring clear of the clip. */
.ws-auth-fields > label, .ws-auth-reveal-pad > label { display: block; }
.ws-auth-reveal { display: grid; grid-template-rows: 0fr; opacity: 0; transform: translateY(-4px);
  transition: grid-template-rows var(--ws-dur-enter) var(--ws-ease-out), margin-bottom var(--ws-dur-enter) var(--ws-ease-out), opacity var(--ws-dur-enter) var(--ws-ease-out), transform var(--ws-dur-enter) var(--ws-ease-out); }
.ws-auth-reveal.is-open { grid-template-rows: 1fr; margin-bottom: -3px; opacity: 1; transform: none; }
.ws-auth-reveal-inner { min-height: 0; overflow: hidden; margin: 0 -3px; }
.ws-auth-reveal-pad { padding: 14px 3px 3px; }
.ws-auth-alt { margin: -4px 0 0; color: var(--ws-ink-2); font-size: var(--ws-sm); text-align: center; }
.ws-auth-textbtn { padding: 0; border: 0; background: none; color: var(--ws-ink); font: inherit; font-weight: 500; text-decoration: underline; text-decoration-color: var(--ws-line); text-underline-offset: 3px; cursor: pointer; }
.ws-auth-textbtn:hover { text-decoration-color: currentColor; }
.ws-auth-form .ws-btn[disabled] { opacity: .6; cursor: progress; }
@media (prefers-reduced-motion: reduce) { .ws-auth-reveal { transition: none; transform: none; } }
/* Help + cross-link tiles under a sign-in card (partials/workspace/auth-help.ejs). */
.ws-auth-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 440px; margin-top: -10px; }
.ws-auth-tile { display: block; padding: 14px 16px; border: 1px solid var(--ws-line); border-radius: var(--ws-radius-card); color: var(--ws-ink-2); font-size: var(--ws-xs); line-height: 1.5; text-decoration: none; }
.ws-auth-tile p { margin: 0; overflow-wrap: anywhere; }
.ws-auth-tile p.ws-auth-tile-title { margin-bottom: 2px; }
.ws-auth-tile .ws-link { font-weight: 500; white-space: nowrap; }
.ws-auth-tile.is-link { transition: background var(--ws-dur-instant) var(--ws-ease-out), border-color var(--ws-dur-instant) var(--ws-ease-out); }
.ws-auth-tile.is-link:hover { background: var(--ws-surface); border-color: var(--ws-control-edge); }
.ws-auth-tile-title { display: flex; align-items: center; gap: 6px; color: var(--ws-ink); font-size: var(--ws-sm); font-weight: 500; }
.ws-auth-tile-title .ws-i { color: var(--ws-ink-3); }
@media (max-width: 480px) { .ws-auth-tiles { grid-template-columns: 1fr; } }

.ws-hello { align-items: center; flex-wrap: wrap; background: var(--ws-accent-soft); color: var(--ws-ink); }
.ws-hello-copy { flex: 1 1 240px; }
.ws-hello-actions { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.ws-hello-close { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: var(--ws-radius-nav); background: transparent; color: var(--ws-ink-3); cursor: pointer; }
.ws-hello-close:hover { background: var(--ws-surface); color: var(--ws-ink); }
/* A read-only table without tick boxes (homeowner feed): cards use the full width on phones. */
@media (max-width: 760px) {
  .ws-table-plain tbody tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "addr addr" "work work" "meta status"; }
  .ws-table-plain td[data-col="received"] { display: block; grid-area: status; justify-self: end; align-self: end; color: var(--ws-ink-3); font-size: var(--ws-sm); }
}
@media (max-width: 480px) { .ws-auth { padding-top: 32px; } .ws-auth-card { padding: 22px 18px; } }

/* Watched postcodes: edit row (postcode, distance, save) plus delete, one line;
   44px tap targets on phones. */
.ws-watch-edit { display: flex; gap: 8px; align-items: center; }
.ws-watch-edit .ws-row-form { flex: 1; min-width: 0; }
@media (max-width: 760px) {
  .ws-watch-edit .ws-row-form { grid-template-columns: minmax(0, 1fr) 88px 44px; }
  .ws-watch-add { grid-template-columns: minmax(0, 1fr) 88px auto !important; }
  .ws-watch-edit .ws-input, .ws-watch-edit .ws-select, .ws-watch-add .ws-input, .ws-watch-add .ws-select { min-height: 44px; }
  .ws-watch-edit .ws-btn, .ws-watch-add .ws-btn, .ws-watch-pause .ws-btn { min-height: 44px; min-width: 44px; }
}

/* The cookie banner (consent.js) is fixed to the bottom while it is open:
   leave room so the last buttons on a sign-in page can be scrolled clear. */
body:has(> .pwc-banner) .ws-auth { padding-bottom: 220px; }
@media (max-width: 600px) { body:has(> .pwc-banner) .ws-auth { padding-bottom: 300px; } }

/* ---------- With the site's pill header (Ben, 17 Oct: "put it in the dashboard too") ----------
   The pill (public/assets/pill/pill.css) is fixed at the top on a solid band
   in the page colour; the sidebar and the page's own bar are pinned just under
   it, so the pill, the page title and Help stay in view while you scroll.
   The pill carries the logo, so the sidebar's own is hidden. */
.ws-body.has-pill::before { content: ""; position: fixed; top: 0; left: 0; right: 0; height: var(--pill-clear); background: var(--ws-bg); z-index: 55; }
.ws-body.has-pill .ws-app { padding-top: var(--pill-clear); }
.ws-body.has-pill .ws-sidebar { top: var(--pill-clear); height: calc(100vh - var(--pill-clear)); }
.ws-body.has-pill .ws-sidebar > .ws-brand { display: none; }
.ws-body.has-pill .ws-main { margin-top: 0; min-height: calc(100vh - var(--pill-clear) - 8px); }
.ws-body.has-pill .ws-topbar { top: var(--pill-clear); }
.ws-body.has-pill .ws-page, .ws-body.has-pill .ws-page [id] { scroll-margin-top: calc(var(--pill-clear) + 68px); }
.ws-body.has-pill .ws-panel { top: calc(var(--pill-clear)); }
/* One menu: on phones the pill's button opens the drawer, which then carries
   the site links; the page bar keeps the title and Help. */
.ws-nav-site { display: none; }
@media (max-width: 900px) {
  .ws-body.has-pill .ws-nav-site { display: block; }
  .ws-body.has-pill .ws-sidebar { top: 0; height: auto; z-index: 70; }
  .ws-body.has-pill .ws-sidebar > .ws-brand { display: flex; }
  .ws-body.has-pill .ws-scrim.is-open { z-index: 65; }
  .ws-body.has-pill .ws-main { min-height: calc(100vh - var(--pill-clear)); }
  .ws-body.has-pill .ws-panel { top: 0; z-index: 70; }
}

/* ---------- Phones: safe areas and 44 px tap targets ----------
   viewport-fit=cover (head.ejs) makes iOS report its safe areas: keep the
   home indicator, the notch and the rounded corners clear of controls. */
.ws-body { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.ws-toasts { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
.ws-content { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
.ws-auth { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 900px) {
  .ws-sidebar { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  /* Everything you tap is at least 44 x 44 on a phone; desktop is unchanged. */
  .ws-menu-btn, .ws-topbar-actions .ws-btn { min-width: 44px; min-height: 44px; }
  .ws-nav-link { min-height: 44px; }
  .ws-btn, .ws-bulk-btn, .ws-tab { min-height: 44px; }
  .ws-btn, .ws-viewbar-actions .ws-btn { min-width: 44px; }
  .ws-viewbar-actions .ws-btn { width: auto; }
  .ws-filter .ws-select, .ws-sort .ws-select { min-height: 44px; height: auto; }
  .ws-nav-del { width: 44px; height: 44px; opacity: .6; }
  .ws-icon-btn { min-width: 44px; }
  .ws-input, .ws-select, .ws-status { min-height: 44px; }
  .ws-topic-check, .ws-toggle, .ws-radio { min-height: 44px; }
  .ws-topic-check { padding: 0 14px; }
  .ws-check-hit { width: 44px; height: 44px; margin: -14px; }
  .ws-bulk-x { width: 44px; height: 44px; }
  .ws-ext { width: 44px; height: 44px; }
  .ws-pager a, .ws-pager button { min-height: 44px; display: inline-flex; align-items: center; }
  /* The rule form's switches stack, each on its own 44 px row, with the button under them. */
  form .ws-checks:has(> .ws-toggle) { flex-direction: column; align-items: stretch; gap: 0; }
  form .ws-checks:has(> .ws-toggle) > .ws-btn { margin-top: 8px; align-self: flex-start; }
  /* Sign-in pages */
  .ws-auth-form .ws-input, .ws-auth-form .ws-btn, .ws-auth .ws-btn, .ws-auth-google { min-height: 44px; }
  .ws-auth-foot a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
  /* Logos that link home, and links that stand on their own as controls (not
     words inside a sentence): a 44 px tall hit area. */
  .pw-pill-brand, .ws-brand { min-height: 44px; }
  .ws-auth-note a, .ws-auth-card > p > a, .ws-card > a.ws-link, .ws-card > p > a.ws-link:only-child { display: inline-flex; align-items: center; min-height: 44px; }
  details > summary { display: flex; align-items: center; min-height: 44px; }
  .ws-addr-link { min-height: 44px; display: flex; flex-direction: column; justify-content: center; }
  .ws-table th a { min-height: 44px; }
  a.ws-chip { min-height: 44px; }
  .ws-tap { display: inline-flex; align-items: center; min-height: 44px; }
  .ws-simple-table a.ws-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; }
  /* The cookie banner's policy link (consent.js), on these pages only. */
  .ws-body .pwc-banner a { display: inline-flex; align-items: center; min-height: 44px; }
}
