/* ============================================================
   CALLENDER LAB — CLIENT PORTAL THEME
   Client-only skin layered over portal.css. The admin dashboard
   loads portal.css WITHOUT this file, so nothing here can reach it.

   Direction: the main site's "Luxury Dark Editorial" palette
   (red / white / grey / black) brought into a working surface —
   a near-black navigation rail against bright reading panels,
   one saturated accent, and real elevation instead of flat greys.
   ============================================================ */

/* ---------- 0. Fonts ------------------------------------------
   Self-hosted so the portal never depends on fonts.googleapis.com:
   it renders identically offline, behind a strict CSP, and without
   a third-party request. Both files are variable (weight 400–800). */

@font-face{font-family:'Sora';font-style:normal;font-weight:400 800;font-display:swap;src:url("/assets/fonts/sora-latin.woff2") format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Sora';font-style:normal;font-weight:400 800;font-display:swap;src:url("/assets/fonts/sora-latin-ext.woff2") format("woff2");unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}
@font-face{font-family:'Manrope';font-style:normal;font-weight:400 800;font-display:swap;src:url("/assets/fonts/manrope-latin.woff2") format("woff2");unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD}
@font-face{font-family:'Manrope';font-style:normal;font-weight:400 800;font-display:swap;src:url("/assets/fonts/manrope-latin-ext.woff2") format("woff2");unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF}

/* ---------- 1. Tokens ---------------------------------------- */

.portal-body {
  color-scheme: light;

  --p-accent: #e02434;
  --p-accent-hot: #ff3b4d;
  --p-accent-deep: #a8101e;
  --p-accent-weak: #fdecee;
  --p-accent-line: #f4c4c9;
  --p-accent-solid: #d41f2e;   /* a red that always carries white text */
  --p-on-accent: #ffffff;

  --p-ink: #0b0b0c;
  --p-ink-2: #35353a;
  --p-muted: #6a6a72;
  --p-faint: #9b9ba3;

  --p-bg: #f1f1ef;
  --p-surface: #ffffff;
  --p-surface-2: #f8f8f6;
  --p-surface-3: #e9e9e5;
  --p-line: #e4e4e0;
  --p-line-2: #d3d3ce;

  --p-rail: #0b0b0c;
  --p-rail-2: #171719;
  --p-rail-3: #232327;
  --p-rail-ink: #f4f4f2;
  --p-rail-muted: #8e8e96;

  --p-ok: #12714a;
  --p-ok-weak: #e6f5ec;
  --p-ok-line: #bfe3ce;
  --p-warn: #8a5300;
  --p-warn-weak: #fdf3e3;
  --p-warn-line: #ecd5aa;

  /* "This one is mine / selected" blocks. A near-black chip in light mode,
     a raised slate chip in dark mode — never an inversion that strands
     light text on a light fill. */
  --p-invert-bg: #0b0b0c;
  --p-invert-line: #0b0b0c;
  --p-invert-ink: #f6f6f4;
  --p-invert-ink-2: #c9c9c6;
  --p-invert-faint: rgba(255, 255, 255, .55);

  --p-shadow-1: 0 1px 2px rgba(11, 11, 12, .05);
  --p-shadow-2: 0 2px 4px rgba(11, 11, 12, .05), 0 8px 20px rgba(11, 11, 12, .06);
  --p-shadow-3: 0 10px 20px rgba(11, 11, 12, .08), 0 28px 60px rgba(11, 11, 12, .12);
  --p-ring: 0 0 0 3px rgba(224, 36, 52, .22);

  --p-r-sm: 8px;
  --p-r: 12px;
  --p-r-lg: 18px;

  --p-head: "Sora", "PortalSans", system-ui, sans-serif;
  --p-body: "Manrope", "PortalSans", system-ui, sans-serif;

  --p-ease: cubic-bezier(.22, .61, .36, 1);
  --p-spring: cubic-bezier(.34, 1.3, .54, 1);

  /* Legacy names portal.css still references. */
  --portal-ink: var(--p-ink);
  --portal-soft-ink: var(--p-ink-2);
  --portal-muted: var(--p-muted);
  --portal-accent: var(--p-accent);
  --portal-border: var(--p-line);
  --portal-surface: var(--p-surface);
  --portal-subtle: var(--p-surface-2);

  background: var(--p-bg);
  color: var(--p-ink);
  font-family: var(--p-body);
  font-size: 15px;
  letter-spacing: -.005em;
}

html[data-portal-theme="dark"] .portal-body {
  color-scheme: dark;

  --p-accent: #ff3b4d;
  --p-accent-hot: #ff6472;
  --p-accent-deep: #ff8f99;
  --p-accent-weak: #2a1114;
  --p-accent-line: #5c1d24;
  --p-accent-solid: #c81b29;

  --p-ink: #f4f4f2;
  --p-ink-2: #cfcfcb;
  --p-muted: #9a9a9f;
  --p-faint: #6e6e75;

  --p-bg: #08080a;
  --p-surface: #121214;
  --p-surface-2: #17171a;
  --p-surface-3: #202024;
  --p-line: #26262b;
  --p-line-2: #343439;

  --p-rail: #0d0d10;
  --p-rail-2: #151518;
  --p-rail-3: #232328;

  --p-ok: #52d99a;
  --p-ok-weak: #0f2419;
  --p-ok-line: #1e4733;
  --p-warn: #e5b461;
  --p-warn-weak: #2a2113;
  --p-warn-line: #4e3d1d;

  --p-invert-bg: #2c2c35;
  --p-invert-line: #3d3d48;
  --p-invert-ink: #f6f6f4;
  --p-invert-ink-2: #d4d4d1;
  --p-invert-faint: rgba(255, 255, 255, .5);

  --p-shadow-1: 0 1px 2px rgba(0, 0, 0, .5);
  --p-shadow-2: 0 2px 6px rgba(0, 0, 0, .5), 0 10px 26px rgba(0, 0, 0, .45);
  --p-shadow-3: 0 12px 28px rgba(0, 0, 0, .55), 0 32px 70px rgba(0, 0, 0, .6);
  --p-ring: 0 0 0 3px rgba(255, 59, 77, .3);
}

/* Colour-only transition when the theme flips. */
html[data-portal-theming] .portal-body,
html[data-portal-theming] .portal-body * {
  transition: background-color .3s var(--p-ease), border-color .3s var(--p-ease),
              color .3s var(--p-ease), box-shadow .3s var(--p-ease) !important;
}

/* ---------- 2. Typography ------------------------------------
   Tracking is tightened only as far as each size can carry it, and
   line-heights leave room for descenders, so nothing crowds or clips. */

.portal-body {
  text-rendering: optimizeLegibility;
  font-synthesis: none;              /* never fake a weight we did not load */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.portal-body h1,
.portal-body h2,
.portal-body h3,
.portal-body h4 {
  font-family: var(--p-head);
  font-weight: 700;
  color: var(--p-ink);
  overflow-wrap: break-word;
  text-wrap: pretty;
}
.portal-body h1 { font-size: clamp(30px, 3.1vw, 44px); font-weight: 800; letter-spacing: -.028em; line-height: 1.1; }
.portal-body h2 { font-size: 26px; letter-spacing: -.022em; line-height: 1.2; }
.portal-body h3 { font-size: 20px; letter-spacing: -.016em; line-height: 1.3; }
.portal-body h4 { font-size: 16px; letter-spacing: -.01em; line-height: 1.35; }
.portal-body strong, .portal-body b { font-weight: 700; }
.portal-body p { line-height: 1.65; overflow-wrap: break-word; }
.portal-body small { line-height: 1.5; }

.portal-body .portal-eyebrow,
.portal-body .portal-sidebar-caption {
  font-family: var(--p-head);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .13em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--p-faint);
}

.portal-body .portal-muted,
.portal-body .portal-back { color: var(--p-muted) !important; }

.portal-body ::selection { background: var(--p-accent); color: #fff; }
.portal-body :focus-visible {
  outline: 2px solid var(--p-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 3. Form controls --------------------------------- */

.portal-body input,
.portal-body select,
.portal-body textarea,
.portal-body .portal-composer input[type=number],
.portal-body .portal-composer input[type=search] {
  background: var(--p-surface);
  border: 1px solid var(--p-line-2);
  border-radius: var(--p-r-sm);
  color: var(--p-ink);
  caret-color: var(--p-accent);
  accent-color: var(--p-accent);
  transition: border-color .18s var(--p-ease), box-shadow .18s var(--p-ease), background .18s var(--p-ease);
}
.portal-body input:hover:not([readonly]):not(:disabled),
.portal-body textarea:hover:not(:disabled),
.portal-body select:hover:not(:disabled) { border-color: var(--p-faint); }
.portal-body input:focus,
.portal-body select:focus,
.portal-body textarea:focus {
  outline: none;
  border-color: var(--p-accent);
  box-shadow: var(--p-ring);
}
.portal-body input::placeholder,
.portal-body textarea::placeholder { color: var(--p-faint); opacity: 1; }
.portal-body input[readonly] { background: var(--p-surface-2); color: var(--p-muted); }
.portal-body input[type=checkbox] { accent-color: var(--p-accent); }
.portal-body label { font-family: var(--p-head); font-weight: 600; letter-spacing: -.01em; }
.portal-body summary::marker { color: var(--p-accent); }

/* ---------- 4. Buttons --------------------------------------- */

.portal-body .portal-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  font-family: var(--p-head);
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--p-line-2);
  background: var(--p-surface);
  color: var(--p-ink);
  box-shadow: var(--p-shadow-1);
  transition: background .18s var(--p-ease), border-color .18s var(--p-ease),
              transform .18s var(--p-spring), box-shadow .18s var(--p-ease), color .18s var(--p-ease);
}
.portal-body .portal-btn:hover {
  background: var(--p-surface-2);
  border-color: var(--p-ink);
  transform: translateY(-2px);
  box-shadow: var(--p-shadow-2);
}
.portal-body .portal-btn:active { transform: translateY(0) scale(.985); }

.portal-body .portal-btn--primary {
  background: var(--p-accent-solid);
  border-color: var(--p-accent-solid);
  color: var(--p-on-accent) !important;
  box-shadow: 0 1px 2px rgba(168, 16, 30, .3), 0 6px 18px rgba(224, 36, 52, .28);
}
.portal-body .portal-btn--primary:hover {
  background: var(--p-accent-hot);
  border-color: var(--p-accent-hot);
  box-shadow: 0 3px 8px rgba(168, 16, 30, .32), 0 12px 30px rgba(224, 36, 52, .36);
}
.portal-body .portal-btn--light {
  background: var(--p-ink);
  border-color: var(--p-ink);
  color: var(--p-bg) !important;
}
.portal-body .portal-btn--light:hover { background: var(--p-rail-3); border-color: var(--p-rail-3); }
.portal-body .portal-btn:disabled {
  opacity: .5;
  transform: none !important;
  box-shadow: none;
  filter: saturate(.3);
}

/* Click ripple (injected by portal.js). */
.portal-ripple {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  transform: scale(0);
  background: currentColor;
  opacity: .22;
  pointer-events: none;
  animation: portal-ripple .55s var(--p-ease) forwards;
}
@keyframes portal-ripple { to { transform: scale(2.6); opacity: 0; } }

.portal-body .portal-text-button {
  background: none;
  border: 0;
  padding: 0;
  color: var(--p-muted);
  font-size: 12px;
  font-family: var(--p-head);
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: color .18s, border-color .18s;
}
.portal-body .portal-text-button:hover:not(:disabled) {
  color: var(--p-accent);
  border-bottom-color: var(--p-accent);
}

/* ---------- 5. The rail (high-contrast sidebar) --------------- */

.portal-body .portal-shell { grid-template-columns: 252px minmax(0, 1fr); }

.portal-body .portal-sidebar {
  background: var(--p-rail);
  border-right: 1px solid #000;
  color: var(--p-rail-ink);
  padding: 30px 20px 20px;
  background-image:
    radial-gradient(130% 70% at 0% 0%, rgba(224, 36, 52, .16), transparent 60%),
    linear-gradient(180deg, var(--p-rail-2), var(--p-rail));
}
.portal-body .portal-sidebar .portal-brand { --mark: 46px; }
.portal-body .portal-sidebar-caption { color: var(--p-rail-muted); margin-top: 16px; }

.portal-body .portal-sidebar nav { margin-top: 34px; gap: 2px; }
.portal-body .portal-sidebar nav a {
  position: relative;
  color: var(--p-rail-muted);
  font-family: var(--p-head);
  font-weight: 600;
  font-size: 13px;
  border-radius: 10px;
  padding: 11px 14px;
  overflow: hidden;
  transition: color .18s var(--p-ease), background .18s var(--p-ease), transform .18s var(--p-spring);
}
.portal-body .portal-sidebar nav a > span { display: flex; align-items: center; gap: 11px; }
/* Leading icon glyph, filled in by portal.js. */
.portal-body .portal-nav-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: grid;
  place-items: center;
  color: inherit;
  opacity: .85;
  transition: transform .25s var(--p-spring), opacity .18s;
}
.portal-body .portal-nav-icon svg { width: 16px; height: 16px; display: block; }
.portal-body .portal-sidebar nav a:hover .portal-nav-icon { transform: translateY(-1px) scale(1.12); opacity: 1; }

.portal-body .portal-sidebar nav a:not([aria-current]):hover {
  background: rgba(255, 255, 255, .06);
  color: var(--p-rail-ink);
  transform: translateX(2px);
}
.portal-body .portal-sidebar nav a[aria-current] {
  background: rgba(255, 255, 255, .1);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.portal-body .portal-sidebar nav a[aria-current]::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 3px; height: 20px;
  background: var(--p-accent-hot);
  border-radius: 0 3px 3px 0;
  transform: translateY(-50%);
  animation: portal-nav-in .4s var(--p-spring);
}
@keyframes portal-nav-in { from { height: 0; opacity: 0; } to { height: 20px; opacity: 1; } }

.portal-body .portal-sidebar nav b {
  background: var(--p-accent-solid);
  color: #fff;
  font-family: var(--p-head);
  font-size: 10px;
  font-weight: 700;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  box-shadow: 0 0 0 0 rgba(224, 36, 52, .55);
  animation: portal-badge-pulse 2.6s var(--p-ease) infinite;
}
@keyframes portal-badge-pulse {
  0%, 70%, 100% { box-shadow: 0 0 0 0 rgba(224, 36, 52, .5); }
  35% { box-shadow: 0 0 0 7px rgba(224, 36, 52, 0); }
}

.portal-body .portal-sidebar-bottom > p {
  font-family: var(--p-head);
  font-weight: 700;
  font-size: 17px;
  color: var(--p-rail-ink);
  letter-spacing: -.03em;
}
.portal-body .portal-sidebar-bottom > a {
  color: var(--p-rail-muted);
  border-bottom: 1px solid rgba(255, 255, 255, .2);
  transition: color .18s, border-color .18s;
}
.portal-body .portal-sidebar-bottom > a:hover { color: var(--p-accent-hot); border-bottom-color: var(--p-accent-hot); }

.portal-body .portal-identity {
  border-top: 1px solid rgba(255, 255, 255, .1);
  border-bottom: 0;
  margin-top: 22px;
  padding-top: 18px;
}
.portal-body .portal-identity strong { color: var(--p-rail-ink); font-family: var(--p-head); }
.portal-body .portal-identity small { color: var(--p-rail-muted); }
.portal-body .portal-avatar {
  background: linear-gradient(145deg, var(--p-accent-solid), #8c1019);
  color: #fff;
  font-family: var(--p-head);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(224, 36, 52, .35);
}
.portal-body .portal-sidebar .portal-text-button { color: var(--p-rail-muted); }
.portal-body .portal-sidebar .portal-text-button:hover:not(:disabled) { color: var(--p-accent-hot); }

/* ---------- 6. Topbar ---------------------------------------- */

.portal-body .portal-topbar {
  background: color-mix(in srgb, var(--p-bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--p-line);
  position: sticky;
  top: 0;
  z-index: 4;
  gap: 18px;
  font-family: var(--p-head);
  font-weight: 600;
}
.portal-body .portal-topbar > span { display: flex; align-items: center; gap: 8px; white-space: nowrap; min-width: 0; }
.portal-body .portal-topbar-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* ⌘K search trigger */
.portal-body .portal-cmd-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 210px;
  height: 38px;
  padding: 0 8px 0 13px;
  border: 1px solid var(--p-line-2);
  border-radius: 999px;
  background: var(--p-surface);
  color: var(--p-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  transition: border-color .18s, box-shadow .18s, color .18s;
}
.portal-body .portal-cmd-trigger:hover { border-color: var(--p-ink); color: var(--p-ink); box-shadow: var(--p-shadow-1); }
.portal-body .portal-cmd-trigger svg { width: 14px; height: 14px; flex: 0 0 14px; }
.portal-body .portal-cmd-trigger span { flex: 1; text-align: left; }
.portal-body .portal-kbd {
  font-family: var(--p-head);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--p-surface-3);
  color: var(--p-muted);
  border: 1px solid var(--p-line);
  line-height: 1;
  white-space: nowrap;
}

.portal-body .portal-icon-btn {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--p-line-2);
  background: var(--p-surface);
  color: var(--p-ink);
  transition: background .18s, border-color .18s, transform .22s var(--p-spring), color .18s;
}
.portal-body .portal-icon-btn:hover { border-color: var(--p-ink); transform: translateY(-2px); }
.portal-body .portal-icon-btn:active { transform: scale(.92); }
.portal-body .portal-icon-btn svg { width: 17px; height: 17px; }
.portal-body .portal-icon-btn .portal-moon { display: none; }
html[data-portal-theme="dark"] .portal-body .portal-icon-btn .portal-moon { display: block; }
html[data-portal-theme="dark"] .portal-body .portal-icon-btn .portal-sun { display: none; }

.portal-body .portal-topbar a.portal-topbar-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--p-ink);
  color: var(--p-bg);
  font-size: 12px;
  white-space: nowrap;
  transition: background .18s, transform .18s var(--p-spring), box-shadow .18s;
}
.portal-body .portal-topbar a.portal-topbar-cta:hover {
  background: var(--p-accent-solid);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(224, 36, 52, .3);
}
.portal-body .portal-topbar a.portal-topbar-cta span { margin-left: 0; }

/* Mobile rail toggle — hidden on desktop. */
.portal-body .portal-rail-toggle { display: none; }

/* ---------- 7. Page heading ---------------------------------- */

.portal-body .portal-page-heading { margin-bottom: 26px; }
.portal-body .portal-page-heading .portal-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--p-accent);
}
.portal-body .portal-page-heading .portal-eyebrow::before {
  content: '';
  width: 16px;
  height: 2px;
  background: var(--p-accent);
  border-radius: 2px;
}
.portal-body .portal-page-heading p { color: var(--p-muted); font-size: 13.5px; }

/* ---------- 8. Panels & cards -------------------------------- */

.portal-body .portal-panel,
.portal-body .portal-quote-card,
.portal-body .portal-service {
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r);
  box-shadow: var(--p-shadow-1);
}
.portal-body .portal-panel { border-radius: var(--p-r-lg); }
.portal-body .portal-panel > p { color: var(--p-muted); }

/* ---------- 9. Hero ------------------------------------------ */

.portal-body .portal-hero {
  background: var(--p-rail);
  color: #f4f4f2;
  border: 1px solid #000;
  border-radius: var(--p-r-lg);
  box-shadow: var(--p-shadow-3);
  background-image:
    radial-gradient(90% 120% at 100% 0%, rgba(224, 36, 52, .3), transparent 55%),
    radial-gradient(70% 90% at 0% 100%, rgba(255, 255, 255, .07), transparent 60%),
    linear-gradient(145deg, #17171a, #0b0b0c 60%);
}
/* Faint engineering grid for texture. */
.portal-body .portal-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(120% 100% at 80% 10%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(120% 100% at 80% 10%, #000, transparent 75%);
  pointer-events: none;
}
.portal-body .portal-hero h2 { color: #fff; font-family: var(--p-head); font-weight: 800; }
.portal-body .portal-hero p { color: #b6b6b8; font-size: 13px; }
.portal-body .portal-hero .portal-eyebrow { color: var(--p-accent-hot); }
.portal-body .portal-hero .portal-btn--light {
  background: #fff;
  border-color: #fff;
  color: #0b0b0c !important;
}
.portal-body .portal-hero .portal-btn--light:hover {
  background: var(--p-accent-solid);
  border-color: var(--p-accent-solid);
  color: #fff !important;
}
.portal-body .portal-art-ring {
  border-color: rgba(224, 36, 52, .55);
  box-shadow: 0 0 0 22px transparent, 0 0 0 23px rgba(255, 255, 255, .09),
              0 0 0 45px transparent, 0 0 0 46px rgba(224, 36, 52, .25);
  opacity: 1;
  animation: portal-drift 22s var(--p-ease) infinite alternate;
}
.portal-body .portal-art-square {
  background: linear-gradient(140deg, var(--p-accent), var(--p-accent-deep));
  border-radius: 6px;
  box-shadow: 0 20px 50px rgba(224, 36, 52, .35);
  animation: portal-tilt 16s var(--p-ease) infinite alternate;
}
.portal-body .portal-art-caption { color: rgba(255, 255, 255, .5); font-family: var(--p-head); }
@keyframes portal-drift { to { transform: translate3d(-16px, 14px, 0) scale(1.06); } }
@keyframes portal-tilt { from { transform: rotate(-18deg); } to { transform: rotate(-4deg) translateY(-14px); } }

/* ---------- 10. Stat cards (Jobber-style accent bars) --------- */

.portal-body .portal-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  border: 0;
  padding: 0;
  margin: 22px 0 34px;
}
.portal-body .portal-stats > a {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 20px 20px 18px;
  border: 1px solid var(--p-line);
  border-radius: var(--p-r);
  background: var(--p-surface);
  box-shadow: var(--p-shadow-1);
  transition: transform .25s var(--p-spring), box-shadow .25s var(--p-ease), border-color .2s;
}
.portal-body .portal-stats > a::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--stat-accent, var(--p-ink));
  transform: scaleX(1);
  transform-origin: left;
  transition: height .25s var(--p-ease);
}
.portal-body .portal-stats > a:nth-child(1) { --stat-accent: var(--p-ink); }
.portal-body .portal-stats > a:nth-child(2) { --stat-accent: var(--p-accent); }
.portal-body .portal-stats > a:nth-child(3) { --stat-accent: #6a6a72; }
.portal-body .portal-stats > a:hover {
  transform: translateY(-4px);
  box-shadow: var(--p-shadow-2);
  border-color: var(--p-line-2);
}
.portal-body .portal-stats > a:hover::before { height: 5px; }
.portal-body .portal-stats > a > span {
  font-family: var(--p-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--p-muted) !important;
}
.portal-body .portal-stats strong {
  font-family: var(--p-head);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -.05em;
  line-height: 1.05;
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--p-ink);
}
.portal-body .portal-stats small {
  display: block;
  margin: 8px 0 0;
  font-size: 11px;
  font-weight: 500;
  color: var(--p-muted) !important;
}
/* Corner chevron that slides in on hover. */
.portal-body .portal-stats > a::after {
  content: '→';
  position: absolute;
  right: 18px;
  top: 18px;
  font-size: 15px;
  color: var(--stat-accent, var(--p-ink));
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity .2s var(--p-ease), transform .25s var(--p-spring);
}
.portal-body .portal-stats > a:hover::after { opacity: 1; transform: translateX(0); }

/* ---------- 11. Section headings ------------------------------ */

.portal-body .portal-section-heading { padding-bottom: 12px; border-bottom: 1px solid var(--p-line); }
.portal-body .portal-section-heading h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  display: flex;
  align-items: center;
  gap: 9px;
}
.portal-body .portal-section-heading h2::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--p-accent);
}
.portal-body .portal-section-heading > a {
  font-family: var(--p-head);
  font-weight: 600;
  color: var(--p-muted);
  display: inline-flex;
  gap: 5px;
  transition: color .18s, gap .18s;
}
.portal-body .portal-section-heading > a::after { content: '→'; transition: transform .2s var(--p-ease); }
.portal-body .portal-section-heading > a:hover { color: var(--p-accent); }
.portal-body .portal-section-heading > a:hover::after { transform: translateX(3px); }

/* ---------- 12. Quote cards ----------------------------------- */

.portal-body .portal-quote-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  display: flex;
  flex-direction: column;
  transition: transform .25s var(--p-spring), box-shadow .25s var(--p-ease), border-color .2s;
}
/* Footer sits on the bottom edge so money and CTA line up across cards. */
.portal-body .portal-quote-card .portal-card-bottom { margin-top: auto; padding-top: 22px; }
.portal-body .portal-quote-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--p-accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .3s var(--p-ease);
}
.portal-body .portal-quote-card:hover {
  transform: translateY(-4px);
  border-color: var(--p-line-2);
  box-shadow: var(--p-shadow-2);
}
.portal-body .portal-quote-card:hover::before { transform: scaleY(1); }
.portal-body .portal-quote-card h3 { font-size: 22px; margin: 18px 0 8px; }
.portal-body .portal-quote-card > p { color: var(--p-muted); font-size: 12px; margin: 0 0 18px; }
.portal-body .portal-card-bottom strong {
  font-family: var(--p-head);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
}
.portal-body .portal-card-bottom small { color: var(--p-muted); }
.portal-body .portal-card-open {
  border: 1px solid var(--p-line-2);
  border-radius: 999px;
  padding: 8px 15px;
  font-family: var(--p-head);
  font-weight: 600;
  font-size: 11px;
  color: var(--p-ink);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background .2s, color .2s, border-color .2s, gap .2s;
}
.portal-body .portal-card-open::after { content: '→'; transition: transform .22s var(--p-ease); }
.portal-body .portal-quote-card:hover .portal-card-open {
  background: var(--p-ink);
  border-color: var(--p-ink);
  color: var(--p-bg);
}
.portal-body .portal-quote-card:hover .portal-card-open::after { transform: translateX(3px); }
.portal-body .portal-quote-card > .portal-muted { font-size: 10px; }

/* Thin progress rail on each quote card. */
.portal-body .portal-card-progress {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: var(--p-surface-3);
  overflow: hidden;
  margin: 0 0 9px;
}
.portal-body .portal-card-progress i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--p-accent), var(--p-accent-hot));
  transform-origin: left;
  animation: portal-grow .9s var(--p-ease) both;
}
.portal-body .portal-card-progress[data-pct="25"] i { width: 25%; }
.portal-body .portal-card-progress[data-pct="45"] i { width: 45%; }
.portal-body .portal-card-progress[data-pct="50"] i { width: 50%; }
.portal-body .portal-card-progress[data-pct="70"] i { width: 70%; }
.portal-body .portal-card-progress[data-pct="90"] i { width: 90%; }
.portal-body .portal-card-progress[data-pct="100"] i { width: 100%; background: var(--p-ink); }
@keyframes portal-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.portal-body .portal-card-progress + .portal-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--p-head);
  font-weight: 600;
  letter-spacing: .07em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--p-faint);
  margin: 0;
  gap: 12px;
}
.portal-body .portal-progress-label span:last-child { flex: 0 0 auto; font-variant-numeric: tabular-nums; }

/* ---------- 13. Status pills --------------------------------- */

.portal-body .portal-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--p-surface-3);
  border: 1px solid var(--p-line-2);
  border-radius: 999px;
  padding: 5px 11px;
  font-family: var(--p-head);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--p-ink-2);
}
.portal-body .portal-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 6px;
}
.portal-body [data-status="review_requested"] .portal-pill,
.portal-body .portal-pill--action {
  background: var(--p-accent-weak);
  border-color: var(--p-accent-line);
  color: var(--p-accent-deep);
}
.portal-body [data-status="review_requested"] .portal-pill::before { animation: portal-blink 1.8s var(--p-ease) infinite; }
@keyframes portal-blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.portal-body [data-status="client_reviewed"] .portal-pill {
  background: var(--p-ok-weak);
  border-color: var(--p-ok-line);
  color: var(--p-ok);
}

/* ---------- 14. Tabs with sliding indicator ------------------- */

.portal-body .portal-tabs {
  position: relative;
  gap: 4px;
  border: 1px solid var(--p-line);
  background: var(--p-surface-2);
  border-radius: 999px;
  padding: 5px;
  width: fit-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.portal-body .portal-tabs::-webkit-scrollbar { display: none; }
.portal-body .portal-tabs button {
  position: relative;
  z-index: 1;
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  font-family: var(--p-head);
  font-size: 12px;
  font-weight: 600;
  color: var(--p-muted);
  white-space: nowrap;
  transition: color .22s var(--p-ease);
}
.portal-body .portal-tabs button:hover { color: var(--p-ink); }
.portal-body .portal-tabs .is-active { color: var(--p-on-accent); border-bottom-color: transparent; }
.portal-body .portal-tabs b {
  background: rgba(0, 0, 0, .08);
  color: inherit;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
}
.portal-body .portal-tabs .is-active b { background: rgba(255, 255, 255, .22); }
/* The pill that slides between tabs (positioned by portal.js). */
.portal-body .portal-tab-marker {
  position: absolute;
  z-index: 0;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--p-accent-solid);
  box-shadow: 0 2px 10px rgba(224, 36, 52, .35);
  transition: transform .34s var(--p-spring), width .34s var(--p-spring);
  pointer-events: none;
}
.portal-body .portal-tab-marker[data-ready] { transition: transform .34s var(--p-spring), width .34s var(--p-spring); }

/* ---------- 15. Quote composer -------------------------------- */

.portal-body .portal-quote-meta {
  gap: 14px;
  padding: 12px 16px;
  background: var(--p-surface);
  border: 1px solid var(--p-line);
  border-radius: 999px;
  width: fit-content;
  max-width: 100%;
  font-size: 11.5px;
  box-shadow: var(--p-shadow-1);
}
.portal-body .portal-quote-meta a {
  color: var(--p-ink);
  text-decoration: none;
  border-bottom: 1px solid var(--p-line-2);
  padding-bottom: 1px;
  transition: color .18s, border-color .18s;
}
.portal-body .portal-quote-meta a:hover { color: var(--p-accent); border-bottom-color: var(--p-accent); }

/* Progress stepper (injected by portal.js on the quote view). */
.portal-body .portal-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 0 0 26px;
  padding: 14px 20px;
  border: 1px solid var(--p-line);
  border-radius: var(--p-r);
  background: var(--p-surface);
  box-shadow: var(--p-shadow-1);
  overflow-x: auto;
  scrollbar-width: none;
}
.portal-body .portal-stepper::-webkit-scrollbar { display: none; }
.portal-body .portal-step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--p-head);
  font-size: 12px;
  font-weight: 600;
  color: var(--p-faint);
  white-space: nowrap;
}
.portal-body .portal-step i {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--p-line-2);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  transition: background .25s, border-color .25s, color .25s, transform .3s var(--p-spring);
}
.portal-body .portal-step--done { color: var(--p-ink); }
.portal-body .portal-step--done i { background: var(--p-ink); border-color: var(--p-ink); color: var(--p-bg); }
.portal-body .portal-step--now { color: var(--p-accent-deep); }
.portal-body .portal-step--now i {
  background: var(--p-accent-solid);
  border-color: var(--p-accent-solid);
  color: #fff;
  transform: scale(1.12);
  box-shadow: 0 0 0 4px var(--p-accent-weak);
}
.portal-body .portal-step-line {
  flex: 1;
  min-width: 26px;
  height: 1.5px;
  margin: 0 14px;
  background: var(--p-line-2);
  border-radius: 2px;
}
.portal-body .portal-step-line--done { background: var(--p-ink); }

.portal-body .portal-step-label > b {
  border: 0;
  background: var(--p-ink);
  color: var(--p-bg);
  font-family: var(--p-head);
  font-weight: 700;
  width: 32px;
  height: 32px;
}
.portal-body .portal-step-label > span { font-family: var(--p-head); font-weight: 700; }
.portal-body .portal-step-label small { color: var(--p-muted); font-weight: 500; }

/* Search + selection counter */
.portal-body .portal-service-tools > span {
  padding: 9px 14px;
  background: var(--p-ink);
  color: var(--p-bg) !important;
  border-radius: 999px;
  font-family: var(--p-head);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .03em;
  transition: transform .3s var(--p-spring), background .2s;
}
.portal-body .portal-service-tools > span.is-bumped { transform: scale(1.12); background: var(--p-accent-solid); color: #fff !important; }
.portal-body .portal-search input { padding-left: 38px; }
.portal-body .portal-search { position: relative; }
.portal-body .portal-search::after {
  content: '';
  position: absolute;
  left: 14px;
  bottom: 15px;
  width: 15px;
  height: 15px;
  background: currentColor;
  color: var(--p-faint);
  mask: var(--p-search-icon) center/contain no-repeat;
  -webkit-mask: var(--p-search-icon) center/contain no-repeat;
  pointer-events: none;
}
.portal-body {
  --p-search-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.6-3.6'/%3E%3C/svg%3E");
}

/* Feature / category grouping */
.portal-body .portal-feature > header {
  padding: 0 0 14px;
  border-bottom: 2px solid var(--p-ink);
  margin-bottom: 22px;
}
.portal-body .portal-feature > header h2 { font-size: 24px; }
.portal-body .portal-category > h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--p-muted);
}
.portal-body .portal-category > h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--p-line);
}

/* Service cards */
.portal-body .portal-service {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform .22s var(--p-spring), box-shadow .22s var(--p-ease),
              border-color .2s var(--p-ease), background .2s var(--p-ease);
}
.portal-body .portal-services[disabled] .portal-service { cursor: default; }
.portal-body .portal-service:hover {
  border-color: var(--p-line-2);
  box-shadow: var(--p-shadow-2);
  transform: translateY(-2px);
}
.portal-body .portal-service.is-selected {
  border-color: var(--p-accent-line);
  background: linear-gradient(90deg, var(--p-accent-weak), var(--p-surface) 42%);
  box-shadow: inset 4px 0 0 var(--p-accent), var(--p-shadow-1);
}
.portal-body .portal-service.is-selected .portal-service-choice > span { color: var(--p-accent-deep); }
.portal-body .portal-service.is-pop { animation: portal-pop .4s var(--p-spring); }
@keyframes portal-pop { 0% { transform: scale(1); } 45% { transform: scale(1.015); } 100% { transform: scale(1); } }
.portal-body .portal-service-choice > span { font-family: var(--p-head); transition: color .2s; }
.portal-body .portal-service-top > b { font-family: var(--p-head); font-size: 14px; font-variant-numeric: tabular-nums; }
.portal-body .portal-service > p { color: var(--p-muted); }
.portal-body .portal-service .portal-staff { color: var(--p-muted); }
.portal-body .portal-service-bottom { border-top: 1px dashed var(--p-line-2); }
.portal-body .portal-service-bottom > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--p-head);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--p-faint) !important;
}
.portal-body .portal-service.is-selected .portal-service-bottom > span { color: var(--p-accent-deep) !important; }

/* Quantity stepper (buttons injected by portal.js) */
.portal-body .portal-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--p-line-2);
  border-radius: 999px;
  overflow: hidden;
  background: var(--p-surface);
}
.portal-body .portal-qty button {
  width: 30px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--p-ink);
  font-family: var(--p-head);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  transition: background .15s, color .15s;
}
.portal-body .portal-qty button:hover:not(:disabled) { background: var(--p-ink); color: var(--p-bg); }
.portal-body .portal-qty button:disabled { opacity: .35; }
.portal-body .portal-qty input[type=number] {
  width: 56px !important;
  min-height: 32px !important;
  border: 0 !important;
  border-left: 1px solid var(--p-line) !important;
  border-right: 1px solid var(--p-line) !important;
  border-radius: 0 !important;
  text-align: center;
  box-shadow: none !important;
  font-family: var(--p-head);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 4px !important;
  -moz-appearance: textfield;
}
.portal-body .portal-qty input[type=number]::-webkit-outer-spin-button,
.portal-body .portal-qty input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.portal-body .portal-qty:focus-within { border-color: var(--p-accent); box-shadow: var(--p-ring); }

.portal-body .portal-dependency {
  background: var(--p-surface-2);
  border: 1px solid var(--p-line);
  border-left: 3px solid var(--p-ink);
  border-radius: var(--p-r-sm);
  color: var(--p-ink-2);
}

/* ---------- 16. Estimate panel -------------------------------- */

.portal-body .portal-estimate .portal-panel {
  position: relative;
  border: 1px solid var(--p-line);
  box-shadow: var(--p-shadow-2);
  overflow: hidden;
  padding-top: 30px;
}
/* Absolutely placed so it always meets the panel's top edge, whatever the
   padding is — a negative margin has to guess, and guessed wrong. */
.portal-body .portal-estimate .portal-panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--p-accent), var(--p-accent-hot), var(--p-ink));
}
.portal-body .portal-total {
  font-family: var(--p-head);
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -.055em;
  color: var(--p-ink);
  font-variant-numeric: tabular-nums;
  transition: transform .3s var(--p-spring);
}
.portal-body .portal-total.is-bumped { transform: scale(1.04); color: var(--p-accent); }
.portal-body .portal-price-lines {
  border-top: 1px solid var(--p-line);
  border-bottom: 1px solid var(--p-line);
}
.portal-body .portal-price-lines > div { color: var(--p-ink-2); }
.portal-body .portal-price-lines > div:not(.portal-role-line) b { font-family: var(--p-head); font-weight: 700; }
.portal-body .portal-price-lines small,
.portal-body .portal-price-lines .portal-role-line { color: var(--p-muted); }
.portal-body .portal-billing p { color: var(--p-muted); }
.portal-body .portal-minimum {
  background: var(--p-surface-2);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-sm);
  color: var(--p-muted);
}
.portal-body .portal-minimum--unmet {
  background: var(--p-warn-weak);
  border: 1px solid var(--p-warn-line);
  color: var(--p-warn);
  font-weight: 600;
}
.portal-body .portal-estimate-status {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--p-muted);
  font-size: 11px;
  line-height: 1.6;
}
.portal-body .portal-estimate-status::before {
  content: '';
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--p-ok);
  transition: background .2s;
}
.portal-body .portal-estimate-status.is-busy::before { background: var(--p-accent); animation: portal-blink 1s infinite; }
.portal-body .portal-estimate-status.is-error { color: var(--p-accent-deep); font-weight: 700; }
.portal-body .portal-estimate-status.is-error::before { background: var(--p-accent); }
.portal-body .portal-next {
  background: var(--p-surface-2);
  border: 1px dashed var(--p-line-2);
  border-radius: var(--p-r);
  padding: 18px;
  color: var(--p-muted);
}
.portal-body .portal-next b { color: var(--p-ink); font-family: var(--p-head); }

/* Shimmer while the estimate recalculates. */
.portal-body [data-estimate-summary].is-loading { position: relative; }
.portal-body [data-estimate-summary].is-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--p-r-sm);
  background: linear-gradient(100deg, transparent 20%, color-mix(in srgb, var(--p-accent) 10%, transparent) 50%, transparent 80%);
  background-size: 220% 100%;
  animation: portal-shimmer 1.1s linear infinite;
  pointer-events: none;
}
@keyframes portal-shimmer { from { background-position: 180% 0; } to { background-position: -80% 0; } }

/* ---------- 17. History timeline ------------------------------ */

.portal-body .portal-history > details {
  border: 1px solid var(--p-line);
  border-radius: var(--p-r);
  padding: 14px 18px;
  margin-bottom: 10px;
  background: var(--p-surface-2);
  transition: border-color .2s, background .2s;
}
.portal-body .portal-history > details:hover { border-color: var(--p-line-2); }
.portal-body .portal-history > details[open] { background: var(--p-surface); border-color: var(--p-line-2); box-shadow: var(--p-shadow-1); }
.portal-body .portal-history summary { font-family: var(--p-head); font-weight: 700; }
.portal-body .portal-history summary small { color: var(--p-muted); font-weight: 500; }
.portal-body .portal-history summary::after {
  font-family: var(--p-head);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--p-accent);
}
.portal-body .portal-history li { color: var(--p-ink-2); }
.portal-body .portal-history details details {
  background: var(--p-surface-2);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-sm);
}
.portal-body .portal-history details[open] > ul,
.portal-body .portal-history details[open] > p { animation: portal-fade-up .32s var(--p-ease) both; }

/* ---------- 18. Review page ---------------------------------- */

.portal-body .portal-lead { color: var(--p-ink-2); font-size: 15px; }
.portal-body .portal-change-list { list-style: none; padding: 0; }
.portal-body .portal-change-list li {
  position: relative;
  padding: 10px 0 10px 28px;
  border-bottom: 1px solid var(--p-line);
  color: var(--p-ink-2);
  font-size: 13px;
  line-height: 1.6;
  animation: portal-fade-up .4s var(--p-ease) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}
.portal-body .portal-change-list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 17px;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--p-accent);
}
.portal-body .portal-contact-review > div { border-bottom: 1px solid var(--p-line); }
.portal-body .portal-contact-review dt { color: var(--p-muted); font-family: var(--p-head); font-weight: 600; }
.portal-body .portal-contact-review dd { font-weight: 600; }
.portal-body .portal-check {
  background: var(--p-surface-2);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-sm);
  padding: 14px;
  transition: border-color .2s, background .2s;
}
.portal-body .portal-check:hover { border-color: var(--p-line-2); }
.portal-body .portal-check:has(input:checked) {
  background: var(--p-accent-weak);
  border-color: var(--p-accent-line);
}

/* ---------- 19. Messages ------------------------------------- */

.portal-body .portal-conversation {
  border: 1px solid transparent;
  border-bottom: 1px solid var(--p-line);
  border-radius: var(--p-r-sm);
  transition: background .18s, border-color .18s, transform .2s var(--p-ease);
}
.portal-body .portal-conversation:hover { background: var(--p-surface); border-color: var(--p-line); transform: translateX(3px); }
.portal-body .portal-conversation.is-active {
  background: var(--p-invert-bg);
  border-color: var(--p-invert-line);
  color: var(--p-invert-ink);
}
.portal-body .portal-conversation.is-active b { color: var(--p-invert-ink); }
.portal-body .portal-conversation.is-active small { color: var(--p-invert-faint) !important; }
.portal-body .portal-conversation.is-active:hover { transform: none; }
.portal-body .portal-conversation b { font-family: var(--p-head); font-weight: 600; }
.portal-body .portal-conversation small { color: var(--p-muted); }
.portal-body .portal-conversation i { background: var(--p-accent); box-shadow: 0 0 0 3px var(--p-accent-weak); }

.portal-body .portal-conversation-content { padding: 0; box-shadow: var(--p-shadow-2); }
.portal-body .portal-conversation-header { border-bottom: 1px solid var(--p-line); background: var(--p-surface-2); }
.portal-body .portal-conversation-header a { color: var(--p-accent); font-weight: 600; }
.portal-body .portal-message-stream {
  background:
    radial-gradient(circle at 1px 1px, var(--p-line) 1px, transparent 0) 0 0/22px 22px;
}
.portal-body .portal-message {
  background: var(--p-surface-2);
  border: 1px solid var(--p-line);
  border-radius: 4px 16px 16px 16px;
  box-shadow: var(--p-shadow-1);
  animation: portal-fade-up .4s var(--p-ease) both;
}
.portal-body .portal-message--you {
  background: var(--p-invert-bg);
  border-color: var(--p-invert-line);
  border-radius: 16px 4px 16px 16px;
}
.portal-body .portal-message--you b { color: var(--p-invert-ink) !important; }
.portal-body .portal-message--you p { color: var(--p-invert-ink-2) !important; }
.portal-body .portal-message--you time { color: var(--p-invert-faint) !important; }
.portal-body .portal-message header b { font-family: var(--p-head); font-weight: 700; }
.portal-body .portal-message p { color: var(--p-ink-2); }
.portal-body .portal-reply { border-top: 1px solid var(--p-line); background: var(--p-surface-2); }
.portal-body .portal-reply textarea { transition: height .15s var(--p-ease), border-color .18s, box-shadow .18s; }
.portal-body .portal-reply small { color: var(--p-muted); }
.portal-body .portal-char-count {
  font-family: var(--p-head);
  font-size: 10px;
  font-weight: 700;
  color: var(--p-faint);
  font-variant-numeric: tabular-nums;
}
.portal-body .portal-char-count.is-near { color: var(--p-warn); }
.portal-body .portal-char-count.is-over { color: var(--p-accent); }

/* ---------- 20. Account -------------------------------------- */

.portal-body .portal-account-note {
  background: var(--p-rail);
  border-color: #000;
  color: #f4f4f2;
  background-image:
    radial-gradient(90% 90% at 100% 0%, rgba(224, 36, 52, .25), transparent 60%),
    linear-gradient(160deg, #17171a, #0b0b0c);
}
.portal-body .portal-account-note h2 { color: #fff; }
.portal-body .portal-account-note p { color: #b6b6b8; }
.portal-body .portal-account-note .portal-eyebrow { color: var(--p-accent-hot); }
.portal-body .portal-account-note a { color: #fff; }
.portal-body .portal-account-email {
  background: var(--p-surface-2);
  border: 1px solid var(--p-line);
  border-radius: var(--p-r-sm);
  color: var(--p-ink-2);
}

/* ---------- 21. Alerts & empty states ------------------------- */

.portal-body .portal-alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  background: var(--p-accent-weak);
  border: 1px solid var(--p-accent-line);
  border-left: 4px solid var(--p-accent);
  border-radius: var(--p-r-sm);
  color: var(--p-accent-deep);
  font-weight: 500;
  animation: portal-fade-up .35s var(--p-ease) both;
}
.portal-body .portal-alert::before { content: '!'; font-family: var(--p-head); font-weight: 800; }
.portal-body .portal-alert--success {
  background: var(--p-ok-weak);
  border-color: var(--p-ok-line);
  border-left-color: var(--p-ok);
  color: var(--p-ok);
}
.portal-body .portal-alert--success::before { content: '✓'; }
.portal-body .portal-alert--soft {
  background: var(--p-surface-2);
  border-color: var(--p-line);
  border-left-color: var(--p-ink);
  color: var(--p-ink-2);
}
.portal-body .portal-alert--soft::before { content: 'i'; }

.portal-body .portal-empty {
  border: 1px dashed var(--p-line-2);
  background: var(--p-surface-2);
  box-shadow: none;
}
.portal-body .portal-empty a {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--p-ink);
  color: var(--p-bg);
  font-family: var(--p-head);
  font-weight: 600;
  text-decoration: none !important;
  transition: background .18s, transform .2s var(--p-spring);
}
.portal-body .portal-empty a:hover { background: var(--p-accent-solid); color: #fff; transform: translateY(-2px); }

/* ---------- 22. Toasts --------------------------------------- */

.portal-toasts {
  position: fixed;
  z-index: 60;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  width: min(340px, calc(100vw - 40px));
  pointer-events: none;
}
.portal-toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  border-radius: var(--p-r);
  background: var(--p-rail);
  color: #f4f4f2;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow: var(--p-shadow-3);
  font-family: var(--p-head);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  pointer-events: auto;
  animation: portal-toast-in .4s var(--p-spring) both;
}
.portal-toast.is-out { animation: portal-toast-out .3s var(--p-ease) both; }
.portal-toast i {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--p-ok);
  color: #fff;
  font-size: 11px;
  font-style: normal;
}
.portal-toast--error i { background: var(--p-accent-hot); }
.portal-toast--info i { background: #5a5a63; }
.portal-toast button {
  margin-left: auto;
  background: none;
  border: 0;
  color: rgba(255, 255, 255, .55);
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  transition: color .15s;
}
.portal-toast button:hover { color: #fff; }
@keyframes portal-toast-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes portal-toast-out { to { opacity: 0; transform: translateX(26px); } }

/* ---------- 23. Command palette ------------------------------- */

.portal-cmdk {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: start center;
  padding: clamp(50px, 12vh, 130px) 18px 18px;
  background: rgba(8, 8, 10, .5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: portal-fade .2s var(--p-ease) both;
}
.portal-cmdk[hidden] { display: none !important; }
.portal-cmdk-box {
  width: min(560px, 100%);
  background: var(--p-surface);
  border: 1px solid var(--p-line-2);
  border-radius: var(--p-r-lg);
  box-shadow: var(--p-shadow-3);
  overflow: hidden;
  animation: portal-cmdk-in .3s var(--p-spring) both;
}
@keyframes portal-cmdk-in { from { opacity: 0; transform: translateY(-14px) scale(.97); } }
@keyframes portal-fade { from { opacity: 0; } }
.portal-cmdk-box > input {
  border: 0 !important;
  border-bottom: 1px solid var(--p-line) !important;
  border-radius: 0 !important;
  min-height: 56px !important;
  font-family: var(--p-head);
  font-size: 15px !important;
  font-weight: 600;
  box-shadow: none !important;
  padding: 0 18px !important;
}
.portal-cmdk-list { max-height: min(50vh, 380px); overflow-y: auto; padding: 8px; }
.portal-cmdk-group {
  padding: 10px 10px 4px;
  font-family: var(--p-head);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--p-faint);
}
.portal-cmdk-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: var(--p-r-sm);
  background: none;
  color: var(--p-ink);
  font-family: var(--p-head);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: background .13s;
}
.portal-cmdk-item small { color: var(--p-muted); font-weight: 500; margin-left: auto; font-size: 11px; }
.portal-cmdk-item svg { width: 15px; height: 15px; flex: 0 0 15px; color: var(--p-muted); }
.portal-cmdk-item[aria-selected="true"] { background: var(--p-accent-solid); color: #fff; }
.portal-cmdk-item[aria-selected="true"] small,
.portal-cmdk-item[aria-selected="true"] svg { color: rgba(255, 255, 255, .8); }
.portal-cmdk-empty { padding: 26px 14px; text-align: center; color: var(--p-muted); font-size: 13px; }
.portal-cmdk-foot {
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--p-line);
  background: var(--p-surface-2);
  font-size: 10.5px;
  color: var(--p-muted);
}
.portal-cmdk-foot span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 24. Back to top ----------------------------------- */

.portal-totop {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--p-line-2);
  background: var(--p-surface);
  color: var(--p-ink);
  box-shadow: var(--p-shadow-2);
  opacity: 0;
  transform: translateY(14px) scale(.9);
  pointer-events: none;
  transition: opacity .25s var(--p-ease), transform .3s var(--p-spring), background .2s, color .2s;
}
.portal-totop.is-on { opacity: 1; transform: none; pointer-events: auto; }
.portal-totop:hover { background: var(--p-ink); color: var(--p-bg); }
.portal-totop svg { width: 17px; height: 17px; }
.portal-body:has(.portal-toasts .portal-toast) .portal-totop { bottom: 86px; }

/* ---------- 25. Scroll reveal --------------------------------- */

.portal-body [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .4s var(--p-ease), transform .4s var(--p-ease);
  transition-delay: var(--reveal-delay, 0ms);
}
.portal-body [data-reveal].is-in { opacity: 1; transform: none; }
@keyframes portal-fade-up { from { opacity: 0; transform: translateY(10px); } }

/* ---------- 26. Footer, misc ---------------------------------- */

.portal-body .portal-footer {
  border-top: 1px solid var(--p-line);
  color: var(--p-muted);
  font-family: var(--p-head);
  font-weight: 600;
  letter-spacing: .06em;
  align-items: center;
}
.portal-body .portal-thread-mini {
  border-top: 1px solid var(--p-line);
  padding: 14px 10px 14px 0;
  border-radius: var(--p-r-sm);
  transition: background .16s, padding .16s;
}
.portal-body .portal-thread-mini:hover { background: var(--p-surface-2); padding-left: 10px; }
.portal-body .portal-thread-mini b { font-family: var(--p-head); font-weight: 600; }
.portal-body .portal-thread-mini small { color: var(--p-muted); }

.portal-body .portal-preview {
  background: var(--p-invert-bg);
  color: var(--p-invert-ink);
  border-bottom: 1px solid var(--p-invert-line);
  font-family: var(--p-head);
  font-weight: 600;
  align-items: center;
}
.portal-body .portal-preview button { color: var(--p-accent-hot); }
.portal-body .portal-mobile-estimate {
  background: var(--p-surface);
  border-top: 1px solid var(--p-line-2);
  box-shadow: 0 -8px 34px rgba(11, 11, 12, .12);
}
.portal-body .portal-mobile-estimate b { font-family: var(--p-head); font-weight: 800; letter-spacing: -.04em; }
.portal-body .portal-mobile-estimate small { color: var(--p-muted); }
.portal-body .portal-skip { background: var(--p-ink); color: var(--p-bg); border-radius: var(--p-r-sm); }

/* Scrollbars inside the workspace. */
.portal-body .portal-message-stream,
.portal-body .portal-cmdk-list { scrollbar-width: thin; scrollbar-color: var(--p-line-2) transparent; }
.portal-body .portal-message-stream::-webkit-scrollbar,
.portal-body .portal-cmdk-list::-webkit-scrollbar { width: 9px; }
.portal-body .portal-message-stream::-webkit-scrollbar-thumb,
.portal-body .portal-cmdk-list::-webkit-scrollbar-thumb {
  background: var(--p-line-2);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 99px;
}

/* ---------- 27. Auth screen ----------------------------------- */

.portal-body .portal-auth-story {
  background: var(--p-rail);
  color: #f4f4f2;
  background-image:
    radial-gradient(80% 90% at 100% 0%, rgba(224, 36, 52, .3), transparent 55%),
    linear-gradient(160deg, #17171a, #0b0b0c 65%);
}
.portal-body .portal-auth-story::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(110% 90% at 70% 20%, #000, transparent 72%);
  -webkit-mask-image: radial-gradient(110% 90% at 70% 20%, #000, transparent 72%);
}
.portal-body .portal-auth-story:after {
  border-color: rgba(224, 36, 52, .45);
  box-shadow: 0 0 0 45px transparent, 0 0 0 46px rgba(255, 255, 255, .08);
  animation: portal-drift 24s var(--p-ease) infinite alternate;
}
.portal-body .portal-auth-story h1 { color: #fff; font-weight: 800; }
.portal-body .portal-auth-story .portal-eyebrow { color: var(--p-accent-hot); }
.portal-body .portal-auth-story p,
.portal-body .portal-auth-caption,
.portal-body .portal-auth-story > small { color: #a9a9ad; }
.portal-body .portal-auth-caption span {
  padding: 7px 13px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  font-family: var(--p-head);
  font-weight: 600;
}
.portal-body .portal-auth-form { background: var(--p-bg); border-color: var(--p-line); }
.portal-body .portal-auth-card h2 { font-weight: 800; }
.portal-body .portal-auth-card > p { color: var(--p-muted); }
.portal-body .portal-auth-card .portal-btn--primary { width: 100%; }
.portal-body .portal-auth-footer { color: var(--p-faint); }
/* ---------- 27b. Logo mark ------------------------------------
   assets/logo.png is a full-bleed circular CL monogram, so it is
   sized as a round mark rather than a wordmark lockup. ---------- */

.portal-body .portal-brand {
  --mark: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--mark);
  height: var(--mark);
  max-width: none;
  flex: 0 0 auto;
  border-radius: 50%;
  line-height: 0;
  font-size: 0;
  transition: transform .3s var(--p-spring), box-shadow .3s var(--p-ease);
}
.portal-body .portal-brand img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 50%;
  object-fit: contain;
}
.portal-body .portal-brand:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--p-accent) 22%, transparent);
}
.portal-body .portal-brand:active { transform: scale(.97); }
.portal-body .portal-brand--lg { --mark: 62px; }
.portal-body .portal-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--p-head);
  font-weight: 600;
  transition: gap .18s, color .18s;
}
.portal-body .portal-back::before { content: '←'; transition: transform .2s; }
.portal-body .portal-back:hover { color: var(--p-accent) !important; }
.portal-body .portal-back:hover::before { transform: translateX(-3px); }

/* Password strength meter (injected by portal.js on activation). */
.portal-body .portal-strength { margin-top: -8px; }
.portal-body .portal-strength-bar {
  height: 4px;
  border-radius: 999px;
  background: var(--p-surface-3);
  overflow: hidden;
}
.portal-body .portal-strength-bar i {
  display: block;
  height: 100%;
  width: var(--pct, 0%);
  border-radius: 999px;
  background: var(--bar, var(--p-accent));
  transition: width .3s var(--p-ease), background .3s;
}
.portal-body .portal-strength span {
  display: block;
  margin-top: 6px;
  font-family: var(--p-head);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--p-muted);
}

/* ---------- 27c. Legibility pass ------------------------------
   portal.css leans on 8–10px text and very tight tracking, which
   crowds and clips once real type is loaded. Everything below lifts
   those to readable sizes and gives each one room to breathe. ---- */

/* Display numerals: tabular, generously spaced, never clipped. */
.portal-body .portal-total,
.portal-body .portal-stats strong,
.portal-body .portal-card-bottom strong,
.portal-body .portal-mobile-estimate b {
  letter-spacing: -.025em;
  line-height: 1.18;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.portal-body .portal-total { font-size: 38px; }

/* letter-spacing in em resolves against the PARENT's font-size, so small text
   nested inside display numerals inherits a ~1px negative value and loses its
   word spaces. Every nested run gets its tracking reset to its own scale. */
.portal-body strong small,
.portal-body b small,
.portal-body h1 small,
.portal-body h2 small,
.portal-body h3 small,
.portal-body h4 small {
  letter-spacing: normal;
  word-spacing: normal;
  font-variant-numeric: normal;
  font-weight: 500;
}

/* Big editorial headlines: room for descenders. */
.portal-body .portal-hero h2 { letter-spacing: -.028em; line-height: 1.1; }
.portal-body .portal-auth-story h1 { letter-spacing: -.028em; line-height: 1.12; }
.portal-body .portal-auth-card h2 { font-size: 36px; letter-spacing: -.028em; line-height: 1.14; }
.portal-body .portal-account-note h2 { font-size: 28px; line-height: 1.2; }
.portal-body .portal-quote-card h3 { letter-spacing: -.018em; line-height: 1.25; }
.portal-body .portal-conversation-header h2 { font-size: 22px; line-height: 1.25; }
.portal-body .portal-feature > header h2 { line-height: 1.22; }
.portal-body .portal-art-caption { font-size: 17px; line-height: 1.25; letter-spacing: -.01em; }
.portal-body .portal-sidebar-bottom > p { line-height: 1.35; }

/* Secondary and meta text: nothing below 10.5px. */
.portal-body .portal-topbar { font-size: 12px; letter-spacing: 0; }
.portal-body .portal-btn { font-size: 12.5px !important; letter-spacing: -.005em; }
.portal-body .portal-hero p { font-size: 13.5px; line-height: 1.7; }
.portal-body .portal-hero .portal-eyebrow { font-size: 10.5px; }
.portal-body .portal-hero .portal-btn { font-size: 12px !important; min-height: 44px; padding: 11px 20px; }
.portal-body .portal-quote-card > p { font-size: 12.5px; line-height: 1.55; }
.portal-body .portal-quote-card > .portal-muted { font-size: 11px; }
.portal-body .portal-card-bottom small { font-size: 11px; }
.portal-body .portal-thread-mini { font-size: 13px; }
.portal-body .portal-thread-mini small { font-size: 11px; }
.portal-body .portal-conversation { font-size: 13px; }
.portal-body .portal-conversation small { font-size: 11px; }
.portal-body .portal-message p { font-size: 13.5px; line-height: 1.7; }
.portal-body .portal-message header { font-size: 12px; }
.portal-body .portal-message time { font-size: 10.5px; }
.portal-body .portal-reply small { font-size: 11px; }
.portal-body .portal-footer { font-size: 10.5px; letter-spacing: .05em; }
.portal-body .portal-auth-footer { font-size: 10px !important; letter-spacing: .09em; }
.portal-body .portal-auth-caption { font-size: 11px; }
.portal-body .portal-auth-story p { font-size: 14px; line-height: 1.8; }
.portal-body .portal-service > p { font-size: 13px; line-height: 1.6; }
.portal-body .portal-service .portal-staff { font-size: 11px; line-height: 1.65; }
.portal-body .portal-service-bottom > span { font-size: 10.5px; letter-spacing: .06em; }
.portal-body .portal-service-bottom label { font-size: 11px !important; }
.portal-body .portal-service-tools > span { font-size: 11px; }
.portal-body .portal-dependency { font-size: 11.5px; line-height: 1.55; }
.portal-body .portal-feature > header p,
.portal-body .portal-category > p,
.portal-body .portal-subcategory > p { font-size: 12.5px; line-height: 1.6; }
.portal-body .portal-feature small,
.portal-body .portal-category > small { font-size: 11.5px; }
.portal-body .portal-price-lines > div { font-size: 12px; line-height: 1.6; }
.portal-body .portal-price-lines small { font-size: 10.5px; line-height: 1.5; }
.portal-body .portal-price-lines .portal-role-line { font-size: 10.5px; }
.portal-body .portal-billing { font-size: 11.5px; }
.portal-body .portal-billing p { font-size: 10.5px; line-height: 1.6; }
.portal-body .portal-minimum { font-size: 11.5px; line-height: 1.55; }
.portal-body .portal-estimate-status { font-size: 11.5px; }
.portal-body .portal-estimate .portal-panel > small { font-size: 11px; }
.portal-body .portal-next { font-size: 12px; line-height: 1.6; }
.portal-body .portal-next b { font-size: 13px; }
.portal-body .portal-fine { font-size: 11.5px; line-height: 1.65; }
.portal-body .portal-quote-meta { font-size: 12px; line-height: 1.6; }
.portal-body .portal-history summary { font-size: 13px; }
.portal-body .portal-history summary small { font-size: 11px; }
.portal-body .portal-history li,
.portal-body .portal-history details p { font-size: 12.5px; line-height: 1.75; }
.portal-body .portal-contact-review > div { font-size: 12.5px; line-height: 1.6; }
.portal-body .portal-check { font-size: 12px !important; line-height: 1.6; }
.portal-body .portal-page-heading p { line-height: 1.6; }
.portal-body .portal-section-heading > a { font-size: 12px; }
.portal-body .portal-step-label > span { font-size: 16px; line-height: 1.35; }
.portal-body .portal-step-label small { font-size: 11.5px; line-height: 1.5; }
.portal-body label { font-size: 13px; line-height: 1.55; }

/* Nothing in a flex row may squash or clip its neighbour. */
.portal-body .portal-card-bottom,
.portal-body .portal-service-top,
.portal-body .portal-service-bottom,
.portal-body .portal-price-lines > div,
.portal-body .portal-history summary,
.portal-body .portal-contact-review > div,
.portal-body .portal-section-heading,
.portal-body .portal-page-heading { min-width: 0; }
.portal-body .portal-card-bottom > span:first-child,
.portal-body .portal-price-lines > div > span:first-child,
.portal-body .portal-history summary > span:first-child,
.portal-body .portal-service-choice > span { min-width: 0; overflow-wrap: break-word; }
.portal-body .portal-card-open,
.portal-body .portal-service-top > b,
.portal-body .portal-price-lines b { flex: 0 0 auto; }
.portal-body .portal-identity > div { min-width: 0; }
.portal-body .portal-identity strong,
.portal-body .portal-conversation b,
.portal-body .portal-thread-mini b { overflow-wrap: anywhere; }
.portal-body .portal-quote-meta { white-space: normal; }
/* Email addresses are the longest value in the contact form, so give that
   field the full row instead of letting it scroll inside half a column. */
.portal-body .portal-form-grid label:has(select) { order: 2; }
.portal-body .portal-form-grid label:has(input[type=email]) { order: 3; grid-column: 1 / -1; }
.portal-body .portal-form-grid input { text-overflow: ellipsis; }
/* Reserve two label lines so every stat numeral sits on the same baseline,
   however long the label is. */
.portal-body .portal-stats > a > span {
  line-height: 1.45;
  padding-right: 26px;
  min-height: 2.9em;
}
.portal-body .portal-stats > a { justify-content: flex-start; }
.portal-body .portal-stats strong { margin-top: auto; padding-top: 6px; }

/* ---------- 28. Responsive ------------------------------------ */

@media (max-width: 1150px) {
  .portal-body .portal-shell { grid-template-columns: 218px minmax(0, 1fr); }
  .portal-body .portal-cmd-trigger { min-width: 150px; }
  .portal-body .portal-stats strong { font-size: 34px; }
}

@media (max-width: 950px) {
  .portal-body .portal-stats { grid-template-columns: 1fr; }
  .portal-body .portal-conversations { gap: 10px; }
  .portal-body .portal-conversation { min-width: 190px; border: 1px solid var(--p-line); }
}

@media (max-width: 760px) {
  /* The rail becomes a slide-in drawer. */
  .portal-body .portal-shell { display: block; }
  .portal-body .portal-sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 272px;
    height: 100%;
    max-width: 84vw;
    z-index: 50;
    padding: 24px 18px;
    border: 0;
    border-right: 1px solid #000;
    transform: translateX(-102%);
    transition: transform .34s var(--p-ease);
    overflow-y: auto;
    display: flex;
  }
  .portal-body.portal-rail-open .portal-sidebar { transform: none; box-shadow: var(--p-shadow-3); }
  .portal-body .portal-sidebar-caption { display: block; }
  .portal-body .portal-sidebar nav { display: grid; margin: 26px -6px 0; }
  .portal-body .portal-sidebar nav a { justify-content: space-between; border-radius: 10px; font-size: 13px; padding: 12px 14px; }
  .portal-body .portal-sidebar nav a > span[aria-hidden] { display: flex; }
  .portal-body .portal-sidebar-bottom { display: block; }
  .portal-rail-scrim {
    position: fixed;
    inset: 0;
    z-index: 49;
    background: rgba(8, 8, 10, .55);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s var(--p-ease);
  }
  .portal-body.portal-rail-open .portal-rail-scrim { opacity: 1; pointer-events: auto; }
  .portal-body.portal-rail-open { overflow: hidden; }

  .portal-body .portal-rail-toggle { display: grid; }
  .portal-body .portal-topbar { height: 62px; padding: 0 18px; }
  .portal-body .portal-topbar > span .portal-muted { display: none; }
  .portal-body .portal-cmd-trigger { min-width: 0; width: 38px; padding: 0; justify-content: center; }
  .portal-body .portal-cmd-trigger span,
  .portal-body .portal-cmd-trigger .portal-kbd { display: none; }
  .portal-body .portal-topbar a.portal-topbar-cta { padding: 0 12px; font-size: 11px; }
  .portal-body .portal-main { padding: 24px 18px 0; }
  .portal-body .portal-stats strong { font-size: 38px; }
  .portal-body .portal-tabs { width: 100%; }

  /* Meta chips stack instead of wrapping into a ragged pill. */
  .portal-body .portal-quote-meta {
    border-radius: var(--p-r);
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    width: 100%;
    padding: 14px 16px;
  }

  /* Only the current step keeps its label, so all three fit without scrolling. */
  .portal-body .portal-stepper { padding: 12px 16px; overflow: visible; }
  .portal-body .portal-step:not(.portal-step--now) { font-size: 0; gap: 0; }
  .portal-body .portal-step:not(.portal-step--now) i { font-size: 11px; }
  .portal-body .portal-step-line { min-width: 14px; margin: 0 10px; }
  .portal-toasts { right: 12px; left: 12px; bottom: 12px; width: auto; }
  .portal-totop { display: none; }
}

/* ---------- 29. Motion & print -------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .portal-body *,
  .portal-body *::before,
  .portal-body *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .portal-body [data-reveal] { opacity: 1; transform: none; }
}

@media print {
  .portal-body .portal-sidebar,
  .portal-body .portal-topbar,
  .portal-toasts,
  .portal-totop,
  .portal-cmdk,
  .portal-body .portal-mobile-estimate { display: none !important; }
  .portal-body .portal-shell { display: block; }
  .portal-body [data-reveal] { opacity: 1 !important; transform: none !important; }
}
