/* ==========================================================================
   Automation Tactics · Prospect Portal
   Theme + layout layer on top of vendored Basecoat (assets/vendor/basecoat).

   Basecoat reads the shadcn-style CSS variables below (--background,
   --primary, --radius, …). Everything prefixed `p-` is portal layout that
   Basecoat does not provide. Surfaces come from
   01-marketing/brand/design-system/DESIGN.md; accents are a softened
   portal-specific ramp (steel blue primary instead of the brand red).

   Theme model: light-only on every page, including the landing. There is
   no dark surface and no runtime theme switching.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Theme tokens
   -------------------------------------------------------------------------- */

:root {
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Exo 2", var(--font-sans);
  --radius: 0.5rem;
  --p-sidebar-w: 15.5rem;

  /* App palette: light, soft accents */
  --background: #f4f6f7;
  --foreground: #0d1b2a;
  --card: #ffffff;
  --card-foreground: #0d1b2a;
  --popover: #ffffff;
  --popover-foreground: #0d1b2a;
  --primary: #40709d;
  --primary-foreground: #ffffff;
  --secondary: #e2e7ea;
  --secondary-foreground: #0d1b2a;
  --muted: #edf0f2;
  --muted-foreground: #587389;
  --accent: #edf0f2;
  --accent-foreground: #0d1b2a;
  --destructive: #c25e5e;
  --border: #d9e1e6;
  --input: #c5d0d8;
  --ring: #40709d;

  --positive: #4e9b6f;
  --warning: #c08a45;

}


/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4,
.card > header > h2 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

::selection {
  background: var(--primary);
  color: var(--primary-foreground);
}

.p-form-grid { display: grid; gap: 1.1rem; }

/* --------------------------------------------------------------------------
   3. Shell: app frame (left sidebar + drawer), mobile bar, container, footer
   -------------------------------------------------------------------------- */

/* The app rail. NEVER class it `sidebar`: the vendored basecoat.all.min.js
   auto-registers that selector and would hijack the element. Mobile-first:
   the base state is a closed drawer; the >=56rem query pins it open, so
   breakpoint crossings can never strand stale drawer state. */
.p-sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(17rem, 85vw);
  background: var(--card);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 0.25s ease, visibility 0s linear 0.25s;
}

body.p-drawer-open .p-sidebar {
  transform: none;
  visibility: visible;
  transition: transform 0.25s ease;
}

body.p-drawer-open { overflow: hidden; }

.p-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgb(13 27 42 / 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

body.p-drawer-open .p-backdrop { opacity: 1; pointer-events: auto; }

.p-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.p-brand img { height: 1.05rem; width: auto; display: block; }

.p-brand .badge { transform: translateY(1px); }

.p-sidebar > .p-brand { padding: 1.05rem 1.35rem 0.95rem; flex-shrink: 0; }

/* Middle region is the ONLY scroll area: brand and footer stay pinned,
   and the account popover never gets clipped by a root overflow. */
.p-side-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.35rem 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.p-nav { display: grid; gap: 2px; }

.p-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: none;
  padding: 0.5rem 0.65rem;
  border-radius: calc(var(--radius) - 2px);
  transition: color 0.15s, background-color 0.15s;
}

.p-nav a svg { flex-shrink: 0; color: var(--muted-foreground); transition: color 0.15s; }

.p-nav a:hover { color: var(--foreground); background: var(--accent); }
.p-nav a:hover svg { color: var(--foreground); }

.p-nav a[aria-current="page"] {
  color: var(--foreground);
  font-weight: 600;
  background: color-mix(in srgb, var(--primary) 11%, transparent);
}

.p-nav a[aria-current="page"] svg { color: var(--primary); }

.p-nav hr { border: 0; border-top: 1px solid var(--border); margin: 0.55rem 0.35rem; }

.p-side-label {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  padding: 0.1rem 0.65rem 0.2rem;
}

.p-side-progress {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--background);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.p-side-progress:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }

.p-side-progress-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
}

#sidebar-progress-pct { font-variant-numeric: tabular-nums; color: var(--foreground); }

.p-side-foot {
  margin-top: auto;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  padding: 0.85rem 0.75rem;
  display: grid;
  gap: 0.6rem;
}

.p-side-foot > .btn { width: 100%; }
.p-side-foot .dropdown-menu { display: flex; width: 100%; }
.p-side-foot .dropdown-menu > [data-popover] { min-width: 100%; }

.p-user-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.45rem 0.5rem;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}

.p-user-row:hover { background: var(--accent); }

.p-user-meta { flex: 1; min-width: 0; line-height: 1.25; }

.p-user-meta strong {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-user-meta span {
  display: block;
  font-size: 0.72rem;
  color: var(--muted-foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.p-user-row > svg { color: var(--muted-foreground); flex-shrink: 0; }

/* Slim bar shown only under the drawer breakpoint */
.p-mobilebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

@media (min-width: 56rem) {
  body:has(.p-sidebar) { padding-inline-start: var(--p-sidebar-w); }
  .p-sidebar { width: var(--p-sidebar-w); transform: none; visibility: visible; transition: none; z-index: 30; }
  .p-backdrop, .p-mobilebar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .p-sidebar, .p-backdrop { transition: none; }
}

.p-shell {
  width: 100%;
  max-width: 72rem;
  margin-inline: auto;
  padding: 2rem 1.25rem 3.5rem;
  flex: 1;
}

.p-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.p-footer-inner {
  max-width: 72rem;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}

.p-footer a { color: inherit; }
.p-footer a:hover { color: var(--foreground); }


/* --------------------------------------------------------------------------
   4. Headings, kickers, helpers
   -------------------------------------------------------------------------- */

.p-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.p-kicker::before {
  content: "";
  width: 1.4rem;
  height: 3px;
  background: var(--primary);
  border-radius: 999px;
}

.p-page-head { margin-bottom: 1.75rem; }
.p-page-head h1 { font-size: 1.75rem; font-weight: 700; margin: 0.35rem 0 0.4rem; }
.p-page-head p { color: var(--muted-foreground); max-width: 46rem; margin: 0; }

.p-hint { color: var(--muted-foreground); font-size: 0.8125rem; }
.p-strong { font-weight: 600; }

.p-stack > * + * { margin-top: 1.25rem; }
.p-cluster { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

.p-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.p-grid-main {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 56rem) {
  .p-grid-main { grid-template-columns: 1.6fr 1fr; align-items: start; }
}

/* --------------------------------------------------------------------------
   5. Login page
   -------------------------------------------------------------------------- */

/* Gate hero. Three bands: a slim top bar, the split hero, a slim foot.
   Accent is the brand Signal Red so the homepage CTA and this page agree;
   change --gate-accent alone to reshade the whole hero. */
:root { --gate-accent: #fd1528; --gate-line: #d9e1e6; --gate-field: #c5d0d8; --gate-panel: #f4f6f7; --gate-faint: #94a7b5; }

.p-gate-bar,
.p-gate-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1.25rem, 4.4vw, 4rem);
}

.p-gate-bar { border-bottom: 1px solid var(--gate-line); }
.p-gate-foot { border-top: 1px solid var(--gate-line); }
.p-gate-bar .p-brand img { height: 1.35rem; width: auto; display: block; }

.p-gate-tag,
.p-gate-motto {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.p-gate-motto { color: var(--gate-faint); }
.p-gate-motto b { color: var(--gate-accent); font-weight: 600; }

.p-login {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
  width: 100%;
  max-width: 75rem;
  margin-inline: auto;
  padding: clamp(3rem, 7vw, 6rem) clamp(1.25rem, 4.4vw, 4rem);
}

@media (min-width: 60rem) {
  .p-login { grid-template-columns: 58fr 42fr; gap: 6rem; }
}

.p-hero-eyebrow {
  display: block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gate-accent);
}

.p-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.4vw, 3.5rem);
  line-height: 1.07;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 1.25rem 0 0;
  text-wrap: pretty;
}

.p-hero h1 span { color: var(--gate-faint); font-weight: 600; }

.p-hero-rule {
  display: block;
  width: 5.5rem;
  height: 3px;
  background: var(--gate-accent);
  transform: skewX(-12deg);
  margin: 1.5rem 0 0;
}

.p-hero-blurb {
  font-size: 1rem;
  line-height: 1.5;
  color: var(--muted-foreground);
  max-width: 30rem;
  margin: 1.5rem 0 2.5rem;
}

.p-login-side { display: flex; justify-content: center; }
.p-login-card { width: 100%; max-width: 26rem; }

/* Example showcase on the gate: the portal's proof piece, featured before
   sign-up, as a flat panel with the step chips from the real map. */
.p-example {
  background: var(--gate-panel);
  border-left: 3px solid var(--gate-accent);
  border-radius: 4px;
  padding: 1.5rem;
  display: grid;
  gap: 0.5rem;
  justify-items: start;
  max-width: 36rem;
}

.p-example-kicker {
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.p-example-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.27;
  margin-bottom: 0.5rem;
}

.p-chips {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.p-chip {
  border: 1px solid var(--gate-field);
  background: #fff;
  color: var(--muted-foreground);
  border-radius: 2px;
  padding: 0.5rem 0.875rem;
  font-family: ui-monospace, "JetBrains Mono", Menlo, monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.p-chip.is-hot { border-color: var(--gate-accent); color: var(--gate-accent); }
.p-chip-arrow { color: var(--gate-faint); font-size: 0.8rem; }

.p-example-meta {
  font-size: 0.8125rem;
  line-height: 1.54;
  color: var(--gate-faint);
  margin: 1rem 0 0;
}

/* The gate is the marketing face of the app: white page, panels for the
   two cards, and the accent on the one button that matters. */
body:has(.p-gate-bar) { background: #fff; }

.p-login-card {
  width: 100%;
  max-width: 26rem;
  background: var(--gate-panel);
  border-color: var(--gate-line);
  border-radius: 4px;
  box-shadow: none;
  padding: 2rem;
}

.p-login-card > header,
.p-login-card > section,
.p-login-card > footer { padding: 0; }
.p-login-card > header h2 { font-family: var(--font-display); font-size: 1.375rem; font-weight: 700; line-height: 1.27; }
.p-login-card > header p { font-size: 0.875rem; line-height: 1.43; color: var(--muted-foreground); margin: 0.5rem 0 1.5rem; }
.p-login-card > footer { margin-top: 1rem; justify-content: center; }

.p-login-card .field label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--foreground);
}

.p-login-card .field input {
  background: #fff;
  border-color: var(--gate-field);
  border-radius: 2px;
  padding: 0.75rem 0.875rem;
  font-size: 0.9375rem;
}

.p-gate-submit {
  margin-top: 0.5rem;
  background: var(--gate-accent);
  border-color: var(--gate-accent);
  border-radius: 2px;
  padding-block: 0.875rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.p-gate-submit:hover { background: #d6101f; border-color: #d6101f; }

.p-example-art { width: 100%; height: auto; margin: 0.25rem 0 0.1rem; }

.p-example .p-cluster { margin-top: 0.35rem; }

/* Dashboard: featured example band (owns the "Open the example" CTA) */
.p-example-band {
  flex-direction: row;
  align-items: center;
  gap: 2.25rem;
  padding: 1.5rem 1.85rem;
}

.p-example-band .p-example-art { flex: 0 0 15rem; max-width: 15rem; margin: 0; }

.p-example-band-copy { display: grid; gap: 0.4rem; justify-items: start; }

.p-example-band-copy p { margin: 0; color: var(--muted-foreground); max-width: 40rem; }

.p-example-band-copy .btn { margin-top: 0.4rem; }

@media (max-width: 40rem) {
  .p-example-band { flex-direction: column; align-items: stretch; gap: 1.25rem; }
  .p-example-band .p-example-art { flex-basis: auto; max-width: 18rem; }
}

/* Landing pitch (index.html, below the gate) */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }



.p-scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-decoration: none;
}

.p-scroll-cue:hover { color: var(--foreground); }

.p-pitch { border-top: 1px solid var(--border); background: var(--card); }

.p-pitch-inner {
  max-width: 72rem;
  margin-inline: auto;
  padding: 5rem 1.5rem 5.5rem;
  display: grid;
  gap: 5.5rem;
}

.p-pitch-kicker {
  display: block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.8rem;
}

.p-pitch h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 1rem;
  max-width: 46rem;
}

.p-pitch-intro > p { color: var(--muted-foreground); font-size: 1.05rem; max-width: 44rem; margin: 0 0 2.75rem; }

.p-statband {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1.5rem 2.5rem;
  border-block: 1px solid var(--border);
  padding: 1.6rem 0;
}

.p-stat { display: grid; gap: 0.35rem; align-content: start; }

.p-stat-value {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.p-statband-note { margin-top: 0.9rem; }
.p-statband-note a { color: inherit; }
.p-statband-note a:hover { color: var(--foreground); }

.p-pitch-row { display: grid; gap: 2rem; align-items: center; }

@media (min-width: 56rem) {
  .p-pitch-row { grid-template-columns: 5fr 7fr; gap: 4rem; }
  .p-pitch-row.p-flip .p-pitch-copy { order: 2; }
}

.p-pitch-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  color: color-mix(in srgb, var(--primary) 32%, var(--border));
  margin-bottom: 0.9rem;
}

.p-pitch-copy h3 { font-size: 1.45rem; font-weight: 700; margin: 0 0 0.6rem; letter-spacing: -0.01em; }
.p-pitch-copy p { color: var(--muted-foreground); margin: 0; max-width: 30rem; }

.p-shot {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background: var(--card);
  box-shadow: 0 24px 48px -16px rgba(13, 27, 42, 0.22);
  overflow: hidden;
}

.p-shot-bar {
  display: flex;
  gap: 5px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--background);
}

.p-shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--border); display: block; }

.p-shot img { display: block; width: 100%; }

.p-quotes { display: grid; gap: 1.25rem; margin-top: 1.5rem; }

@media (min-width: 56rem) {
  .p-quotes { grid-template-columns: 1fr 1fr; }
}

.p-quote {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background: var(--background);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.p-quote p { margin: 0; font-size: 1rem; line-height: 1.6; font-weight: 500; }
.p-quote footer strong { color: var(--foreground); }

.p-pitch-cta {
  background: var(--foreground);
  color: #ffffff;
  border-radius: calc(var(--radius) + 8px);
  padding: 3.5rem 2rem 3.75rem;
  text-align: center;
  display: grid;
  gap: 0.4rem;
  justify-items: center;
}

.p-pitch-cta h2 { color: #ffffff; margin: 0; }
.p-pitch-cta p { color: rgb(255 255 255 / 0.72); margin: 0 0 1.4rem; }

/* --------------------------------------------------------------------------
   6. Progress, stages, checklists
   -------------------------------------------------------------------------- */


/* Per-checklist summary rows on the dashboard */
.p-summary-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border);
}

.p-summary-row:first-of-type { border-top: 0; }

.p-summary-row > div { flex: 1; min-width: 0; }
.p-summary-row .progress { max-width: 10rem; }

.p-summary-title { font-weight: 600; font-size: 0.9375rem; display: block; }

/* Checklist items (checklists.html) */
.p-checklist { display: grid; gap: 0.25rem; }

.p-checklist .field {
  padding: 0.75rem 0.85rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background-color 0.15s, border-color 0.15s;
}

.p-checklist > .field:hover { background: var(--accent); }

/* Strike only the item's title, never the answer-field labels beneath it */
.p-checklist > .field:has(> input:checked) > section > label {
  color: var(--muted-foreground);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--muted-foreground) 55%, transparent);
}

.p-checklist > .field > section > label { cursor: pointer; font-weight: 500; }

/* Inline field validation errors (profile gate) */
.p-field-error { color: var(--destructive); font-size: 0.8125rem; margin: 0.2rem 0 0; }

/* Auto items: the checkbox is an indicator, not a control */
.p-auto-check { pointer-events: none; }

/* One assisted answer box per item */
.p-answer {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.6rem;
  max-width: 36rem;
}

.p-answer textarea {
  resize: vertical;
  min-height: 3.2rem;
  overflow: hidden;
}

.p-answer-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.p-assist { color: var(--primary); }
.p-assist:disabled { opacity: 0.6; }
.p-assist svg { color: var(--primary); }

/* --------------------------------------------------------------------------
   7. Steps, service cards, misc
   -------------------------------------------------------------------------- */


/* Workflow prep page (workflow-prep.html) */
.p-hw { list-style: none; margin: 0; padding: 0; }

.p-hw li {
  position: relative;
  display: flex;
  gap: 1rem;
  padding-bottom: 1.5rem;
}

.p-hw li:last-child { padding-bottom: 0; }

.p-hw li::before {
  content: "";
  position: absolute;
  left: calc(1rem - 1px);
  top: 2.2rem;
  bottom: 0.2rem;
  width: 2px;
  background: var(--border);
}

.p-hw li:last-child::before { display: none; }

.p-hw-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.p-hw strong { display: block; margin: 0.3rem 0 0.15rem; }
.p-hw p { margin: 0; font-size: 0.875rem; color: var(--muted-foreground); max-width: 34rem; }

.p-capture-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}

.p-capture-list li {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  font-size: 0.9375rem;
}

.p-capture-list li::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
  transform: translateY(-1px);
}


.p-service-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: calc(var(--radius) - 2px);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.p-price-note {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
}

.p-avatar {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

.p-menu-user {
  padding: 0.35rem 0.5rem 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.p-menu-user strong { display: block; }
.p-menu-user span { color: var(--muted-foreground); font-size: 0.75rem; }

/* Cards used as full-height flex columns so footers align in a grid row */
.p-grid .card, .p-grid-main .card { height: 100%; }
.card > section:last-of-type { flex: 1; }
.p-grid .card > footer { margin-top: auto; }

/* --------------------------------------------------------------------------
   8. Help desk: ask tiles, SLA panel, ticket queue, plans
   -------------------------------------------------------------------------- */

.p-ask-tiles {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.p-ask-tile { display: block; cursor: pointer; }

.p-ask-tile input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.p-ask-tile-face {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
  height: 100%;
}

.p-ask-tile:hover .p-ask-tile-face { background: var(--accent); }

.p-ask-tile input:checked + .p-ask-tile-face {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary), inset 3px 0 0 0 var(--primary);
}

.p-ask-tile input:focus-visible + .p-ask-tile-face {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Outcome picker (funnel step) reuses the ask-tile look in a wider grid */
.p-outcomes {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  max-width: 66rem;
}

.p-outcomes .p-ask-tile-face { padding: 0.85rem 1rem; gap: 0.3rem; }

/* Dashboard "working toward" strip */
#outcome-strip { margin-top: 0.85rem; row-gap: 0.4rem; }
#outcome-strip a.p-hint { text-decoration: underline; text-underline-offset: 3px; }
#outcome-strip a.p-hint:hover { color: var(--foreground); }

/* SLA panel */
.p-sla-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.p-sla-pill::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--positive);
}

.p-sla-value {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.p-sla-value + .p-hint { margin-top: 0.35rem; }

/* Ticket queue */
.p-ticket {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}

.p-ticket + .p-ticket { margin-top: 0.6rem; }

.p-ticket[data-status="open"] { border-inline-start: 3px solid var(--primary); }
.p-ticket[data-status="in-progress"] { border-inline-start: 3px solid var(--warning); }
.p-ticket[data-status="resolved"] { border-inline-start: 3px solid var(--positive); }

.p-ticket-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.p-ticket-head:hover { background: var(--accent); }

.p-ticket-id {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.p-ticket-subject {
  font-weight: 600;
  font-size: 0.9375rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p-ticket-head .p-hint { flex-shrink: 0; }

.p-ticket-body {
  padding: 0.35rem 0.9rem 0.9rem;
  border-top: 1px solid var(--border);
}

.p-ticket-sla { margin: 0.6rem 0 0; }

/* Activity log */
.p-activity {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.p-activity-item {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  padding: 0.6rem 0.75rem;
  background: var(--background);
}

.p-activity-item[data-who="desk"] {
  background: color-mix(in srgb, var(--primary) 6%, var(--background));
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}

.p-activity-item[data-who="system"] { border-style: dashed; }

.p-activity-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.25rem;
}

.p-activity-item[data-who="desk"] .p-activity-meta span:first-child { color: var(--primary); }

.p-activity-item p { margin: 0; font-size: 0.875rem; line-height: 1.5; }

.p-ticket-reply { display: grid; gap: 0.6rem; margin-top: 0.5rem; }

/* Plans strip */
.p-plan[data-current="true"] { border-color: var(--primary); }

.p-plan-response { margin: 0 0 0.35rem; font-size: 0.875rem; color: var(--muted-foreground); }

.p-plan-response span {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--foreground);
  margin-inline-end: 0.3rem;
}

/* Empty state */
.p-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
}

.p-empty p { margin: 0.15rem 0; }
