/* Home CRM tiles, layered: one dark CRM screen and the piece that opens from the SAME record in front of it.
   The front piece overlaps only the dark gutter of the screen behind it (never its content). Slight offset, no tilt, no glow, no float.
   Dark is the CRM's default look. Additive: only touches .ftile figure.lyr and the CRM section layout. */
:root:not(#_):not(#__) .fxs-in{grid-template-columns:1fr;gap:clamp(28px,4vw,48px)}
:root:not(#_):not(#__) .fxs-head{position:static;max-width:760px}
:root:not(#_):not(#__) .fxs-grid{gap:20px}
@media (min-width:601px){:root:not(#_):not(#__) .fxs-grid{align-items:start}}
@media (min-width:601px) and (max-width:900px){:root:not(#_):not(#__) .fxs-grid{grid-template-columns:1fr}}

:root:not(#_):not(#__) .ftile figure.lyr{--g:9cqw;container-type:inline-size;margin:0;padding:clamp(14px,3.4%,22px);display:grid;grid-template-columns:repeat(12,minmax(0,1fr));align-items:start;background:#101319;aspect-ratio:auto;overflow:hidden}
:root:not(#_):not(#__) .ftile figure.lyr img{display:block;width:100%;height:auto;object-fit:fill;transform:none;border-radius:0}
.lyr .l-hero,.lyr .l-front{display:block;min-width:0;grid-row:1}
.lyr .l-hero{background:#0b0d11;border-radius:12px;box-shadow:0 0 0 1px rgba(255,255,255,.07);padding:12px var(--g) var(--g) 12px;overflow:hidden}
.lyr .l-hero img{border-radius:8px}
.lyr .l-front{position:relative;z-index:2;background:#16191f;border-radius:12px;overflow:hidden;box-shadow:0 0 0 1px rgba(255,255,255,.12),0 14px 28px -14px rgba(0,0,0,.65)}
.ftile figure.lyr figcaption{grid-column:1/-1;grid-row:2;margin:14px 0 -2px;padding:0;font-size:13px;line-height:1.4;color:#aab3c2;background:none;border:0}

/* a: hero left, front right and lower (side by side, one column of overlap = the hero's gutter) */
.lyr-a .l-hero{grid-column:1/7}.lyr-a .l-front{grid-column:6/13;align-self:end;margin-top:34px}
/* e: mirrored: hero right, front left and lower */
.lyr-e .l-hero{grid-column:7/13;padding:12px 12px var(--g) calc(var(--g) + 18px)}.lyr-e .l-front{grid-column:1/8;align-self:end;margin-top:34px}
/* stacked: the opened piece steps down over the screen's bottom gutter */
.lyr-b .l-hero,.lyr-c .l-hero,.lyr-f .l-hero{grid-row:1}
.lyr-b .l-front,.lyr-c .l-front,.lyr-f .l-front{grid-row:2;margin-top:calc(var(--g) * -.7)}
.lyr-b .l-hero{grid-column:1/13}.lyr-b .l-front{grid-column:1/9}
.lyr-c .l-hero{grid-column:1/11}.lyr-c .l-front{grid-column:4/13}
.lyr-f .l-hero{grid-column:1/13}.lyr-f .l-front{grid-column:4/13}
/* d: the opened piece on top, the screen under it */
.lyr-d .l-front{grid-row:1;grid-column:4/13}
.lyr-d .l-hero{grid-row:2;grid-column:1/11;padding:var(--g) var(--g) 12px 12px;margin-top:calc(var(--g) * -.7)}
.ftile figure.lyr figcaption{grid-row:auto}

/* phones: one column, screen first, opened piece steps down over its bottom gutter; both wide enough to read */
@media (max-width:640px){
  :root:not(#_):not(#__) .ftile figure.lyr{--g:30px;padding:14px}
  .ftile .lyr .l-hero{grid-row:1;grid-column:1/-1;padding:10px 10px var(--g) 10px;margin:0}
  .ftile .lyr .l-front{grid-row:2;grid-column:2/-1;align-self:auto;margin:calc(var(--g) * -.7) 0 0}
  .lyr-b .l-front{grid-column:1/-2}
}
/* hover: the front piece lifts a few pixels. Off for touch and reduced motion. */
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
  .lyr .l-front{transition:translate .3s cubic-bezier(.22,1,.36,1)}
  .ftile:hover .lyr .l-front{translate:0 -4px}
}
