/* ============================================================
   CRM Hygiene (first pass): two pieces brought over from v2
   (page-crm-hygiene-v2.css), kept on v2's hy- prefix so nothing in
   pages.css reaches them and they reach nothing else.
   1. "One company": lines drop from the four duplicate records and
      converge on a dashed box, under the first pass's .dupes grid.
   2. The autonomy slider, in place of the three-stop .levels track.
   Lavender accent, no gradients.
   ============================================================ */

/* ------------------------------------------------------------
   1. One company. The brace is a grid with the same columns and gap
   as .dupes, so each stub sits exactly under a card's centre at every
   width; the bar runs between the outer stubs and a drop runs from
   its middle to the box. --n follows .dupes' column count.
   ------------------------------------------------------------ */
.hy-one { --n: 4; --hy-gap: 16px; --hy-w: 1.5px; }
.hy-brace { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: var(--hy-gap); height: 36px; margin-top: 20px; }
.hy-brace i { justify-self: center; width: var(--hy-w); height: calc(18px + var(--hy-w) / 2); background: var(--lavender-400); }
.hy-brace b { position: absolute; display: block; background: var(--lavender-400); }
/* Each half of the bar runs from an outer stub to the middle */
.hy-brace .hy-brace-l, .hy-brace .hy-brace-r { top: calc(18px - var(--hy-w) / 2); height: var(--hy-w); }
.hy-brace .hy-brace-l { left: calc((100% - (var(--n) - 1) * var(--hy-gap)) / var(--n) / 2 - var(--hy-w) / 2); right: 50%; }
.hy-brace .hy-brace-r { right: calc((100% - (var(--n) - 1) * var(--hy-gap)) / var(--n) / 2 - var(--hy-w) / 2); left: 50%; }
.hy-brace .hy-brace-drop { left: 50%; top: calc(18px - var(--hy-w) / 2); bottom: 0; width: var(--hy-w); margin-left: calc(var(--hy-w) / -2); }

.hy-one-box { position: relative; width: min(340px, 100%); margin: 6px auto 0; padding: 17px 24px 18px; text-align: center; }
.hy-one-frame { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hy-one-frame rect { fill: var(--lavender-50); stroke: var(--lavender-400); stroke-width: 1.2; stroke-dasharray: 5 7; }
.hy-one-box p { position: relative; }
.hy-one-name { font-family: var(--serif); font-weight: 450; font-size: 1.1875rem; line-height: 1.3; letter-spacing: -0.01em; color: var(--ink-900); }
.hy-one-sub { margin-top: 4px; font-size: 0.8125rem; font-weight: 450; color: var(--ink-600); }

/* Same breakpoints as .dupes in pages.css: two columns, then one */
@media (max-width: 1000px) {
    .hy-one { --n: 2; }
    .hy-brace i:nth-child(n+3) { display: none; }
}
@media (max-width: 560px) {
    .hy-one { --n: 1; }
    .hy-brace i:nth-child(n+2) { display: none; }
}

/* Plays once (the page script adds .is-shown): the stubs drop from the
   records, the bar closes in from both ends, the drop runs to the box,
   and the box arrives. The records' own arrival is v17's stagger. */
html.js .hy-one .hy-brace i { transform: scaleY(0); transform-origin: center top; transition: transform 0.28s ease-in 0.35s; }
html.js .hy-one .hy-brace-l { transform: scaleX(0); transform-origin: left center; transition: transform 0.45s cubic-bezier(0.45, 0, 0.55, 1) 0.63s; }
html.js .hy-one .hy-brace-r { transform: scaleX(0); transform-origin: right center; transition: transform 0.45s cubic-bezier(0.45, 0, 0.55, 1) 0.63s; }
html.js .hy-one .hy-brace-drop { transform: scaleY(0); transform-origin: center top; transition: transform 0.25s ease-out 1.08s; }
html.js .hy-one .hy-one-box { opacity: 0; transform: translateY(8px); transition: opacity 0.7s var(--ease-out) 1.3s, transform 0.7s var(--ease-out) 1.3s; }
html.js .hy-one.is-shown .hy-brace i, html.js .hy-one.is-shown .hy-brace b, html.js .hy-one.is-shown .hy-one-box { opacity: 1; transform: none; }

/* ------------------------------------------------------------
   2. Autonomy slider: one control, three modes
   ------------------------------------------------------------ */
.hy-rail { position: relative; height: 4px; border-radius: 2px; background: var(--ink-200); margin: 8px 30px 48px; cursor: pointer; touch-action: none; }
.hy-rail::after { content: ""; position: absolute; left: 0; right: 0; top: -14px; bottom: -14px; } /* a bigger target */
.hy-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 2px; background: var(--lavender-500); transition: width 0.4s var(--ease-out); }
.hy-stop { position: absolute; top: 50%; width: 10px; height: 10px; border-radius: 50%; background: #fff; border: 1px solid var(--ink-300); transform: translate(-50%, -50%); transition: transform 0.3s ease, border-color 0.3s ease; z-index: 1; }
.hy-stop.is-near { transform: translate(-50%, -50%) scale(1.5); border-color: var(--lavender-500); }
.hy-thumb { position: absolute; top: 50%; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--lavender-600); box-shadow: 0 1px 3px rgba(30, 35, 48, 0.16); transform: translate(-50%, -50%); cursor: grab; touch-action: none; z-index: 2; transition: left 0.4s var(--ease-out); }
.hy-slider.is-dragging .hy-thumb { transition: none; cursor: grabbing; }
.hy-slider.is-dragging .hy-fill { transition: none; }

.hy-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.hy-mode { padding: 28px; border: 1px solid transparent; border-radius: var(--r-card); cursor: pointer; transition: background-color 0.35s ease, border-color 0.35s ease; }
.hy-mode:not(.is-on):hover { background: rgba(255, 255, 255, 0.55); }
.hy-mode.is-on { background: #fff; border-color: var(--line); }
.hy-mode:focus-visible { outline: 2px solid var(--lavender-500); outline-offset: 2px; }
.hy-mode .hy-mode-name { font-family: var(--serif); font-weight: 450; font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink-900); margin-bottom: 10px; }
.hy-mode .hy-mode-desc { font-size: 0.9375rem; line-height: 1.65; color: var(--ink-600); }
@media (max-width: 860px) { .hy-modes { grid-template-columns: 1fr; gap: 8px; } .hy-mode { padding: 22px; } .hy-rail { margin: 0 12px 36px; } }

/* The rail and the modes rise in as they reach the screen (60ms apart) */
html.js .hy-rv { opacity: 0; transform: translateY(12px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out), background-color 0.35s ease, border-color 0.35s ease; transition-delay: calc(var(--i, 0) * 60ms); }
html.js .hy-rv.is-shown { opacity: 1; transform: none; }
html.js .hy-mode.hy-rv.is-settled { transition: background-color 0.35s ease, border-color 0.35s ease; }

@media (prefers-reduced-motion: reduce) {
    html.js .hy-rv, html.js .hy-one .hy-brace i, html.js .hy-one .hy-brace b, html.js .hy-one .hy-one-box { opacity: 1 !important; transform: none !important; transition: none !important; }
    .hy-thumb, .hy-fill, .hy-stop, .hy-mode { transition: none !important; }
}

/* ---- Your CRM: four cards. Three platforms, each with the records the
   agents work on there, and a dashed card that welcomes every other CRM ---- */
.crm-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.crm-card { display: flex; flex-direction: column; min-height: 164px; padding: 26px 24px 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); transition: border-color .25s ease, transform .25s var(--ease-out), box-shadow .25s ease; }
.crm-card h3 { font-family: var(--serif); font-weight: 450; font-size: 1.75rem; line-height: 1.1; letter-spacing: -0.015em; color: var(--ink-900); }
.crm-card p { margin-top: auto; padding-top: 28px; font-size: 0.9375rem; line-height: 1.5; color: var(--ink-600); }
.crm-card--other { background: transparent; border-style: dashed; border-color: var(--lavender-300); }
.crm-card--other h3 { font-size: 1.25rem; color: var(--lavender-800); }
.crm-card--other p { margin-top: 12px; padding-top: 0; font-size: 0.875rem; }
.crm-card-link { margin-top: auto; padding-top: 16px; font-size: 0.875rem; font-weight: 500; color: var(--lavender-700); }
.crm-card-link span { display: inline-block; transition: transform .2s ease; }
.crm-card-link:hover span { transform: translateX(3px); }
@media (hover: hover) {
    .crm-card:not(.crm-card--other):hover { border-color: var(--lavender-300); transform: translateY(-2px); box-shadow: 0 14px 32px rgba(46, 36, 80, 0.07); }
}
@media (max-width: 1000px) { .crm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .crm-cards { grid-template-columns: 1fr; } .crm-card { min-height: 0; } .crm-card p { padding-top: 16px; } }
@media (prefers-reduced-motion: reduce) { .crm-card { transition: none; } .crm-card:hover { transform: none !important; } }

/* ---- Console: same proportions as the CRM Migration console (sidebar
   width, padding, type size, spacing) ---- */
.page--crm-hygiene .plate--console { padding-top: 88px; }
.page--crm-hygiene .app--findings { grid-template-columns: 316px minmax(0, 1fr); min-height: 0; font-size: 14px; }
.page--crm-hygiene .app--findings .app-side { padding: 18px 12px 24px; }
.page--crm-hygiene .app--findings .app-side-label { padding: 18px 12px 10px; }
.page--crm-hygiene .app--findings .app-side a { padding: 11px 12px; margin-bottom: 4px; font-size: 14px; line-height: 1.45; border-radius: var(--r); }
.page--crm-hygiene .app--findings .app-main { padding: 32px 36px 36px; }
.page--crm-hygiene .app--findings .finding { padding: 26px 28px 24px; }
.page--crm-hygiene .app--findings .finding-top h4 { font-size: 16px; }
.page--crm-hygiene .app--findings .finding > p { margin-top: 10px; font-size: 14px; color: var(--ink-600); }
.page--crm-hygiene .app--findings .finding dl { margin-top: 20px; padding-top: 18px; gap: 12px 18px; grid-template-columns: 104px 1fr; }
.page--crm-hygiene .app--findings .finding dd { font-size: 14px; }
.page--crm-hygiene .app--findings .finding-fix { margin-top: 20px; padding-top: 18px; }
.page--crm-hygiene .app--findings .finding-fix p { font-size: 14px; }
.page--crm-hygiene .app--findings .finding-actions { margin-top: 22px; }
@media (max-width: 1000px) { .page--crm-hygiene .app--findings { grid-template-columns: 240px minmax(0, 1fr); } }
@media (max-width: 900px) { .page--crm-hygiene .app--findings { grid-template-columns: minmax(0, 1fr); } .page--crm-hygiene .app--findings .app-side a { margin-bottom: 0; } }

/* ---- Autonomy: the original three dots on one line, fully drawn and
   static (no hover, no scroll animation) ---- */
html.js .levels.levels--static::after { transform: none; transition: none; }
/* The platform cards aren't clickable, so they don't react on hover */
@media (hover: hover) { .crm-card:not(.crm-card--other):hover { border-color: var(--line); transform: none; box-shadow: none; } }
/* Console, tighter: less sky around it and less padding inside, so the
   sections above and below stay close */
.page--crm-hygiene .plate--console { margin-top: 64px; padding: 48px 56px 0; }
.page--crm-hygiene .app--findings .app-main { padding: 24px 28px 28px; }
.page--crm-hygiene .app--findings .finding { padding: 20px 24px 20px; }
.page--crm-hygiene .app--findings .finding dl { margin-top: 16px; padding-top: 14px; gap: 10px 18px; }
.page--crm-hygiene .app--findings .finding-fix { margin-top: 16px; padding-top: 14px; }
.page--crm-hygiene .app--findings .finding-actions { margin-top: 18px; }
@media (max-width: 640px) { .page--crm-hygiene .plate--console { padding: 24px 16px 0; } }
/* The line ends at the last dot instead of running to the edge
   (3 columns, 48px gaps: the third dot's centre sits (100% - 120px) / 3
   from the right) */
@media (min-width: 761px) { .levels.levels--static::before, .levels.levels--static::after { right: calc((100% - 120px) / 3); } }
/* 13) the console has its own section; it needs no extra gap above */
.section--console { padding-top: 96px; padding-bottom: 104px; }
.section--console .plate--console { margin-top: 0; }

/* ---- Your CRM: each platform's data model drawn small on one schema
   canvas (replaces the four platform cards). Lines draw in on arrival. ---- */
.schemas { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px; padding: 44px 48px 40px; background-color: #fff; background-image: radial-gradient(circle, var(--ink-100) 1px, transparent 1.2px); background-size: 18px 18px; background-position: 9px 9px; border: 1px solid var(--line); border-radius: var(--r-card); }
.schema-col h3 { font-family: var(--serif); font-weight: 450; font-size: 1.75rem; line-height: 1.1; letter-spacing: -0.015em; color: var(--ink-900); }
.schema { display: block; width: 100%; height: auto; margin: 28px 0 22px; overflow: visible; }
.schema-col p { font-size: 0.9375rem; line-height: 1.55; color: var(--ink-600); max-width: 34ch; }
.sc-node rect { fill: #fff; stroke: var(--ink-200); stroke-width: 1; }
.sc-node text { font-family: var(--font); font-size: 13px; font-weight: 500; fill: var(--ink-800); text-anchor: middle; }
.sc-node--custom rect { fill: var(--lavender-50); stroke: var(--lavender-400); stroke-dasharray: 4 3; }
.sc-node--custom text { fill: var(--lavender-800); }
.sc-ln { fill: none; stroke: var(--lavender-400); stroke-width: 1.5; stroke-linecap: round; }
.sc-ln--dash { stroke-dasharray: 0.02 0.02; }
.sc-arrow { fill: none; stroke: var(--lavender-500); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sc-note { font-family: var(--font); font-size: 11px; font-weight: 500; fill: var(--lavender-700); text-anchor: middle; }
html.js .schemas .sc-ln:not(.sc-ln--dash) { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1s cubic-bezier(0.65, 0, 0.35, 1) 0.3s; }
html.js .schemas .sc-ln--dash, html.js .schemas .sc-arrow, html.js .schemas .sc-note { opacity: 0; transition: opacity .6s ease 1s; }
html.js .schemas.is-shown .sc-ln:not(.sc-ln--dash) { stroke-dashoffset: 0; }
html.js .schemas.is-shown .sc-ln--dash, html.js .schemas.is-shown .sc-arrow, html.js .schemas.is-shown .sc-note { opacity: 1; }
.schemas-note { margin-top: 28px; max-width: 80ch; color: var(--ink-600); }
.schemas-note strong { font-weight: 600; color: var(--ink-900); }
.schemas-note a { color: var(--lavender-700); border-bottom: 1px solid var(--lavender-200); }
.schemas-note a:hover { border-bottom-color: var(--lavender-700); }
@media (max-width: 1000px) { .schemas { grid-template-columns: 1fr; gap: 48px; padding: 32px 28px; } .schema { max-width: 340px; } }
@media (prefers-reduced-motion: reduce) { html.js .schemas .sc-ln, html.js .schemas .sc-arrow, html.js .schemas .sc-note { transition: none; stroke-dashoffset: 0; opacity: 1; } }
.callout--systems { margin-top: 24px; }

/* Autonomy track: the line runs past the last stop to the edge and ends in an
   arrowhead, so it reads as a scale of increasing autonomy, not a dead end */
@media (min-width: 761px) {
    .levels.levels--static::before, .levels.levels--static::after { right: 2px; }
    .levels.levels--static li:last-child::after { content: ""; position: absolute; right: 1px; top: 3px; width: 10px; height: 10px; box-sizing: border-box; border-top: 2px solid var(--lavender-500); border-right: 2px solid var(--lavender-500); border-radius: 1px; transform: rotate(45deg); }
}

/* ---- When to start: four moments on one line, each under its own rule.
   The titles take the shared 22px card-title rule in pages.css. ---- */
.hy-when { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 40px; }
.hy-when li { padding-top: 24px; border-top: 1px solid var(--ink-300); }
.hy-when p { margin-top: 12px; color: var(--ink-600); }
.hy-when a { color: var(--lavender-700); border-bottom: 1px solid var(--lavender-200); }
.hy-when a:hover { border-bottom-color: var(--lavender-700); }
@media (max-width: 1000px) { .hy-when { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 40px; } }
@media (max-width: 560px) { .hy-when { grid-template-columns: 1fr; gap: 28px; } }
