/* stories.css — the two scroll stories, "Edit once" (#learn) and "Set one goal" (#ads): Maya in the Claude app beside
   the Loopr app, one pinned screen per step (site.js Loopr.scrollSteps, stories.js).
   Big and simple on purpose: each step makes one point, said in the big line over each window (.dm-pt) and ringed
   in the window (.hl). Every class starts with dm- so the demo windows never pick up the page's own styles.
   Colour: the Loopr window uses the brand tokens only, so it follows both themes. The Claude window keeps Claude's own
   light look in both themes on purpose (visitors should recognise the tool they use today); its few colours are named
   once below. */

.dm-sec{padding:0;margin-top:clamp(48px,9vh,112px)}   /* room above the pinned screen; outside the scroll run, so steps keep their timing */
.dm-sec .pin{justify-content:center}
/* reduced motion: no pinning, the last step on one screen */
.dm-sec:not(.scrolly) .pin{height:calc(100svh - 79px);overflow:hidden}
@media (max-width:820px){.dm-sec:not(.scrolly) .pin{height:calc(100svh - 65px)}}
/* the design sizes (1280 × 670 laptop, 390 × 806 phone); stories.js zooms them to the screen. Inside them every size is
   its design value, never vw / vh (those would grow twice) */
.dm-in.dm-fit{height:670px;width:1280px;max-width:none;max-height:none;flex:none;padding:18px 64px 14px}
.dm-in.dm-fitp{height:806px;width:390px;max-width:none;max-height:none;flex:none;padding-top:12px;padding-bottom:10px}
.dm-in{height:100%;max-height:900px;display:flex;flex-direction:column}
.dm-t{font-size:40px;line-height:1.08;letter-spacing:-.03em;margin:0 0 14px;max-width:none}
.dm-fitp .dm-t{font-size:28px;margin-bottom:12px}
.dm-i{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none;display:inline-block}

/* the thin step indicator: each label jumps to its step */
.dm-steps{display:flex;gap:10px;margin:0 0 18px}
.dm-steps button{flex:1;display:grid;grid-template-columns:auto 1fr;align-items:baseline;row-gap:7px;padding:0 0 2px;border:0;background:none;font:inherit;font-size:14px;line-height:1.3;color:var(--meta);text-align:left;cursor:pointer;transition:color var(--t-fast) var(--ease)}
.dm-steps button::before{content:"";grid-column:1/-1;height:2px;border-radius:2px;background:var(--line-2);transition:background var(--t-base) var(--ease)}
.dm-steps button:hover{color:var(--ink)}
.dm-steps button.done::before{background:color-mix(in srgb,var(--ink) 35%,transparent)}
.dm-steps button.on{color:var(--ink);font-weight:500}
.dm-steps button.on::before{background:var(--ink)}
.dm-steps b{font-family:var(--font-mono);font-weight:500;font-size:12px;margin-right:6px}
.dm-sw{display:none}

.dm-duo{flex:1 1 auto;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:36px}
.dm-col{display:flex;flex-direction:column;gap:12px;min-height:0;min-width:0}
/* the one point of this step, per side */
.dm-pt{margin:0;font-family:var(--font-display);font-weight:600;font-size:27px;line-height:1.15;letter-spacing:-.025em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;animation:dm-rise 360ms var(--ease) both}
.dm-col.cc .dm-pt{color:var(--err)}
.dm-col.lo .dm-pt{color:var(--best-text)}
.dm-cap{margin:12px 0 0;display:flex;justify-content:flex-end;font-size:12px;line-height:1.3;color:var(--meta)}
.dm-cap small{font-size:inherit}

/* ---------- a window (Claude and Loopr) ---------- */
.dm-win{--dm-shadow:0 1px 1px rgba(20,20,15,.04),0 24px 48px -28px rgba(20,20,15,.35);
  flex:1;min-height:0;display:flex;flex-direction:column;border-radius:16px;overflow:hidden;border:1px solid var(--line-2);box-shadow:var(--dm-shadow)}
:root:not([data-theme="light"]) .dm-win{--dm-shadow:0 24px 48px -28px rgba(0,0,0,.8)}
.dm-win .tl{display:flex;gap:7px;flex:none}
.dm-win .tl i{width:12px;height:12px;border-radius:50%;background:#FF5F57}
.dm-win .tl i:nth-child(2){background:#FEBC2E}.dm-win .tl i:nth-child(3){background:#28C840}
.dm-body{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column}

/* ================= Claude (light, like the app): the chats list on the left, one chat open ================= */
.dm-cw{--c-bg:#FAF9F5;--c-side:#F0EEE6;--c-on:#E4E0D4;--c-ink:#29261B;--c-mute:#5E5A4E;--c-meta:#8C8878;--c-line:#E2DED3;--c-bub:#EAE6DB;--c-acc:#D97757;
  --c-white:#FFFFFF;--c-bad:#B5352F;--c-bad-bg:#F6D9CF;--c-serif:Georgia,"Times New Roman",serif;
  flex-direction:row;background:var(--c-bg);color:var(--c-ink);border-color:rgba(20,20,15,.14)}
.dm-side{width:178px;flex:none;display:flex;flex-direction:column;padding:16px 10px;background:var(--c-side);border-right:1px solid var(--c-line);overflow:hidden}
.dm-side .tl{margin:0 6px 18px}
.dm-side .lg{display:flex;align-items:center;gap:8px;padding:0 6px;font-family:var(--c-serif);font-size:19px;margin-bottom:14px}
.dm-side .lg svg{width:20px;height:20px}
.dm-side .nc{display:flex;align-items:center;gap:9px;padding:6px;font-size:14px;font-weight:500}
.dm-side .nc i{width:24px;height:24px;border-radius:50%;background:var(--c-acc);color:var(--c-white);display:grid;place-items:center}
.dm-side .nc .dm-i{width:14px;height:14px;stroke-width:2.6}
.dm-side small{font-size:12px;color:var(--c-meta);padding:16px 8px 6px}
.dm-side ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.dm-side li{font-size:14px;line-height:1.25;padding:8px;border-radius:8px;color:var(--c-mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dm-side li.on{background:var(--c-on);color:var(--c-ink);font-weight:500}
.dm-main{flex:1;min-width:0;display:flex;flex-direction:column}
.dm-ttl{flex:none;margin:0;padding:16px 24px 0;font-size:15px;font-weight:500;color:var(--c-mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dm-chat{padding:16px 24px 18px;justify-content:flex-end;gap:18px}
.dm-chat > *{margin:0;flex:none}
.dm-u{align-self:flex-end;max-width:88%;background:var(--c-bub);border-radius:20px;padding:12px 18px;font-size:19px;line-height:1.4}
.dm-u .dm-q{display:block;margin-bottom:4px;font-size:.84em;color:var(--c-mute);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}   /* the customer email Maya pasted in */
.dm-a{align-self:flex-start;display:flex;gap:12px;max-width:100%;font-family:var(--c-serif);font-size:20px;line-height:1.45;border-radius:12px}
.dm-a svg{width:22px;height:22px;flex:none;margin-top:4px}
.dm-a p{margin:0}
.dm-a.hl{padding:6px 10px;margin:-6px -10px}
.dm-chat mark{background:var(--c-bad-bg);color:inherit;border-radius:4px;padding:0 4px}
.dm-cw .hl{box-shadow:0 0 0 2.5px var(--c-bad),0 0 0 8px color-mix(in srgb,var(--c-bad) 14%,transparent)}
.dm-cmp{flex:none;margin:0 18px 18px;height:54px;border:1px solid var(--c-line);border-radius:16px;background:var(--c-white);display:flex;align-items:center;padding:0 10px 0 18px;font-size:16px;color:var(--c-meta);box-shadow:0 2px 6px rgba(60,50,30,.05)}
.dm-cmp i{margin-left:auto;width:34px;height:34px;flex:none;border-radius:10px;background:var(--c-acc);color:var(--c-white);display:grid;place-items:center}
.dm-cmp .dm-i{stroke-width:2.4}
.dm-cmp.hl{color:var(--c-ink);font-size:18px}
/* Maya typing the same words again, letter by letter */
.dm-typed{display:inline-block;white-space:nowrap;overflow:hidden;vertical-align:bottom;max-width:12em;animation:dm-type 1.1s steps(20,end) .3s both}
@keyframes dm-type{from{max-width:0}}
.dm-caret{display:inline-block;width:2px;height:1.05em;vertical-align:-3px;background:currentColor;margin-left:2px;animation:dm-blink 1s steps(1) infinite}
@keyframes dm-blink{50%{opacity:0}}

/* ================= the Loopr app: one agent's screen, no sidebar ================= */
.dm-lw{background:var(--bg);color:var(--ink)}
.dm-bar{height:58px;flex:none;display:flex;align-items:center;gap:16px;padding:0 20px 0 16px;border-bottom:1px solid var(--line);white-space:nowrap}
.dm-bar .wm{display:flex;align-items:flex-end;padding-right:16px;border-right:1px solid var(--line-2);font-family:var(--font-display);font-weight:700;font-size:19px;letter-spacing:-.03em;line-height:1}
.dm-bar .ag{display:inline-flex;align-items:center;gap:9px;font-family:var(--font-display);font-weight:600;font-size:21px;letter-spacing:-.02em;line-height:1.1}
.dm-bar .ag i{width:9px;height:9px;border-radius:50%;background:var(--live);box-shadow:0 0 0 4px var(--live-soft)}
.dm-bar .cn{margin-left:auto;display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;min-width:0}
.dm-bar .cn .dm-i{width:14px;height:14px}
.dm-lw .dm-body{padding:18px 22px 20px;gap:12px}
.dm-lw .dm-body > *{flex:none;margin:0}
.dm-lw .hl{box-shadow:0 0 0 2.5px var(--best),0 0 0 8px var(--best-soft)}
.dm-lw ins{text-decoration:none;background:var(--live-soft);border-radius:4px;padding:0 3px}
.dm-lw del{color:var(--meta);text-decoration-color:var(--err);text-decoration-thickness:2px}
.dm-lesson{display:flex;align-items:center;gap:10px;padding:11px 16px;border-radius:12px;background:var(--best-soft);color:var(--best-text);font-size:16px;font-weight:600;line-height:1.35}
.dm-lesson .dm-i{width:18px;height:18px}

/* #learn: the customer emails on "Support replies", each with its drafted reply */
.dm-card{border:1px solid var(--line);border-radius:14px;background:var(--surface);padding:16px 20px;display:flex;flex-direction:column;gap:10px;position:relative}
.dm-card .dm-ck{font-size:13px;font-weight:600;color:var(--muted)}
.dm-card p{margin:0;font-size:17px;line-height:1.4}
.dm-card.dm-sm{padding:12px 18px;gap:4px}
.dm-card.dm-sm p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dm-card.dm-sm:not(.upd) p{color:var(--muted)}
/* the email on the left, what Loopr did on the right; on a narrow card the tag drops under the email */
.dm-card .dm-hd{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:2px 12px}
.dm-card .tag{display:inline-flex;align-items:center;gap:5px;font-size:13px;font-weight:600;color:var(--best-text)}
.dm-card .tag .dm-i{width:14px;height:14px}
.dm-card .tag.ed,.dm-card .tag.mine{color:var(--muted);font-weight:500}
.dm-card.upd{border-color:transparent}
.dm-card.on{border-color:transparent;padding:18px 20px 20px}
.dm-ed{font-size:21px;line-height:1.45;outline:none;cursor:text;border-radius:8px;margin:0 -6px;padding:2px 6px;max-height:4.4em;overflow-y:auto}   /* a long visitor edit scrolls inside the card instead of pushing the other replies out */
.dm-ed:focus{box-shadow:none}   /* the card's purple ring already shows it is being edited */
.dm-learned{display:flex;flex-direction:column;gap:6px;padding:14px 18px;border-radius:14px;background:var(--best-soft);color:var(--best-text)}
.dm-learned small{font-size:13px;font-weight:600;opacity:.8}
.dm-learned p{margin:0;display:flex;align-items:center;gap:10px;font-family:var(--font-display);font-size:22px;font-weight:600;letter-spacing:-.02em;line-height:1.2}
.dm-learned .dm-i{width:20px;height:20px}

/* #ads: the goal on top, its chart, today's bet and the past bets */
.dm-goal{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 18px;border-radius:14px;background:var(--surface)}
.dm-goal p{margin:0;font-family:var(--font-display);font-weight:600;font-size:25px;letter-spacing:-.025em;line-height:1.15}
.dm-goal .now{display:flex;align-items:baseline;gap:8px;flex:none}
.dm-goal small{font-size:14px;color:var(--muted)}
.dm-goal b{font-family:var(--font-display);font-weight:600;font-size:34px;letter-spacing:-.04em;line-height:1;color:var(--live-text);font-variant-numeric:tabular-nums}
.dm-chart{position:relative;flex:1 1 auto!important;min-height:60px;margin:10px 4px 2px!important}
.dm-chart svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}
.dm-chart .bl{stroke:var(--line-2);stroke-width:1;vector-effect:non-scaling-stroke}
.dm-chart .gl{stroke:var(--best);stroke-width:2;stroke-dasharray:7 7;vector-effect:non-scaling-stroke}
.dm-chart .ln{fill:none;stroke:var(--live);stroke-width:3.5;stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke;animation:dm-wipe 900ms var(--ease) both}
@keyframes dm-wipe{from{clip-path:inset(-10% 100% -10% 0)}to{clip-path:inset(-10% 0 -10% 0)}}
.dm-chart .gt{position:absolute;right:0;transform:translateY(-130%);font-size:13px;font-weight:600;color:var(--best-text)}
.dm-chart .dot{position:absolute;width:13px;height:13px;margin:-6.5px 0 0 -6.5px;border-radius:50%;background:var(--live);box-shadow:0 0 0 5px var(--live-soft);animation:dm-rise 300ms var(--ease) 700ms both}
.dm-bets{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;align-items:start}
.dm-bets small{font-size:13px;font-weight:600;color:var(--muted)}
.dm-today{border:1px solid var(--line);border-radius:14px;background:var(--surface);padding:12px 16px 14px;display:flex;flex-direction:column;gap:6px}
.dm-today.hl{border-color:transparent}
.dm-today b{font-size:17px;font-weight:600;line-height:1.3}
.dm-today .pg{height:6px;border-radius:3px;background:var(--surface-2);overflow:hidden;margin-top:2px}
.dm-today .pg u{display:block;height:100%;border-radius:3px;background:var(--best)}
.dm-today .d{font-size:13px;color:var(--muted)}
.dm-past{display:flex;flex-direction:column;gap:6px;padding:12px 2px 0}
.dm-past ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:7px}
.dm-past li{display:flex;align-items:center;justify-content:space-between;gap:10px}
.dm-past li b{font-size:15px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dm-past .pill{flex:none;font-size:13px;font-weight:600;padding:3px 10px;border-radius:var(--r-pill);white-space:nowrap;font-variant-numeric:tabular-nums}
.dm-past .kept .pill{background:var(--live-soft);color:var(--live-text)}
.dm-past .stop b{color:var(--muted)}
.dm-past .stop .pill{background:var(--surface-2);color:var(--muted)}
.dm-past .none{margin:0;font-size:15px;color:var(--meta)}
/* #ads day 21: the one question it brings to Maya, with her Approve already pressed */
.dm-lw .dm-body:has(.dm-ask){gap:10px}
.dm-body:has(.dm-ask) .dm-chart{margin:6px 4px 0!important}
.dm-body:has(.dm-ask) .dm-past ul{gap:4px}
.dm-ask{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:10px 12px 10px 18px;border-radius:14px;background:var(--surface)}
.dm-ask p{margin:0;display:flex;flex-direction:column;gap:2px;min-width:0}
.dm-ask p b{font-size:17px;font-weight:600;line-height:1.3}
.dm-ask p span{font-size:14px;color:var(--muted)}
.dm-ask .ok{flex:none;display:flex;flex-direction:column;align-items:center;gap:3px}
.dm-ask .dm-ap{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 16px;border-radius:var(--r-pill);background:var(--btn-bg);color:var(--btn-fg);font-size:15px;font-weight:600;transform:scale(.96);box-shadow:inset 0 2px 4px rgba(0,0,0,.28)}
.dm-ask .dm-ap .dm-i{width:15px;height:15px;stroke-width:2.6}
.dm-ask small{font-size:12px;color:var(--muted);white-space:nowrap}
.dm-zero{display:flex;align-items:center;gap:10px;padding:11px 16px;border-radius:12px;background:var(--live-soft);color:var(--live-text);font-size:17px;font-weight:600}
.dm-zero .dm-i{width:18px;height:18px;stroke-width:2.4}

/* one orchestrated moment per step: what changed rises in, in order */
.dm-new{animation:dm-rise 360ms var(--ease) both;animation-delay:calc(min(var(--d,0), 4) * 70ms)}
@keyframes dm-rise{from{opacity:0;transform:translateY(8px)}}
.dm-sw button.ping::after{content:"";position:absolute;top:-2px;right:-2px;width:8px;height:8px;border-radius:50%;background:var(--best);box-shadow:0 0 0 3px var(--best-soft)}

/* ================= phones and narrow screens: one window at a time ================= */
@media (max-width:820px){
  .dm-steps{gap:6px;margin-bottom:12px}
  .dm-steps button{font-size:13px;white-space:nowrap}
  .dm-sw{display:inline-flex;align-self:flex-start;padding:3px;border:1px solid var(--line-2);border-radius:var(--r-pill);gap:2px;margin:0 0 12px}
  .dm-sw button{position:relative;font:inherit;font-size:14px;font-weight:500;line-height:1;min-height:40px;padding:0 18px;border:0;border-radius:var(--r-pill);background:none;color:var(--muted);cursor:pointer}
  .dm-sw button.on{background:var(--btn-bg);color:var(--btn-fg)}
  .dm-duo{display:flex;flex-direction:column}
  .dm-col{flex:1;gap:10px}
  .dm-duo[data-side="claude"] .dm-col.lo,.dm-duo[data-side="loopr"] .dm-col.cc{display:none}
  .dm-pt{font-size:24px;white-space:normal}
  .dm-cap{margin-top:8px}
  .dm-side{width:116px;padding:12px 6px}
  .dm-side .tl{display:none}
  .dm-side .lg{font-size:17px;margin-bottom:10px}
  .dm-side .nc{font-size:13px;gap:7px;padding:4px 6px}
  .dm-side small{padding:12px 6px 4px}
  .dm-side li{font-size:13px;padding:7px 6px}
  .dm-ttl{padding:12px 16px 0;font-size:14px}
  .dm-chat{padding:12px 16px 14px;gap:16px}
  .dm-u{font-size:17px;padding:11px 16px;max-width:96%}
  .dm-u .dm-q{white-space:normal}
  .dm-a{font-size:18px;gap:9px}
  .dm-a svg{width:18px;height:18px;margin-top:3px}
  .dm-cmp{margin:0 12px 12px;height:50px;padding:0 8px 0 14px}
  .dm-cmp.hl{font-size:15px}
  .dm-cmp i{width:30px;height:30px}
  .dm-bar{height:auto;padding:12px 16px;flex-wrap:wrap;row-gap:6px;gap:12px}
  .dm-bar .tl{display:none}
  .dm-bar .wm{padding-right:12px}
  .dm-bar .ag{font-size:19px}
  .dm-bar .cn{margin-left:0;flex-basis:100%;font-size:12.5px}
  .dm-lw .dm-body{padding:14px 16px 18px}
  .dm-card{padding:14px 16px}
  .dm-card.dm-sm{padding:11px 16px}
  .dm-card.dm-sm p{white-space:normal}
  .dm-card p{font-size:16px}
  .dm-ed{font-size:18px}
  .dm-learned p{font-size:20px}
  .dm-goal{flex-direction:column;align-items:flex-start;gap:4px;padding:12px 16px}
  .dm-goal p{font-size:22px}
  .dm-goal b{font-size:30px}
  .dm-bets{grid-template-columns:1fr;gap:10px}
  .dm-past{padding:2px 2px 0}
  /* the ads screen is the fullest on a phone: tighter rows, the bet's day as text only */
  .dm-lw .dm-body:has(.dm-goal){gap:9px;padding-top:12px;padding-bottom:14px}
  .dm-goal{padding:10px 16px}
  .dm-chart{min-height:44px;margin:8px 4px 0!important}
  .dm-today{padding:10px 16px;gap:3px}
  .dm-today .pg{display:none}
  .dm-past ul{gap:4px}
  .dm-zero{padding:9px 14px;font-size:16px}
  /* day 21 on a phone: the question takes the place of today's bet, its Approve under it */
  .dm-body:has(.dm-ask) .dm-today{display:none}
  .dm-ask{flex-direction:column;align-items:stretch;gap:8px;padding:12px 16px}
  .dm-ask p b{font-size:16px}
  .dm-ask p span{font-size:13px}
  .dm-ask .ok{flex-direction:row;gap:10px}
}
@media (max-width:380px){.dm-steps button{font-size:12px}.dm-sw button{padding:0 14px}}
@media (prefers-reduced-motion:reduce){.dm-caret,.dm-new,.dm-pt,.dm-typed,.dm-chart .ln,.dm-chart .dot{animation:none}.dm-steps button,.dm-steps button::before{transition:none}}

.dm-goal .now b.zero{color:var(--muted)}   /* day 1: nothing has moved yet, so no green */
