/* g69 estimated-level preview: the interactive weekly rhythm card.
   Shared by the home hero and the localized half-life guides. Theme tokens only (see _style.css). */

.lvl{margin:28px 0;padding:22px 22px 18px;border:1px solid var(--line);border-radius:24px;background:
  radial-gradient(120% 90% at 100% 0%,var(--frostbg) 0%,transparent 55%),var(--card);
  box-shadow:0 1px 0 var(--line),0 18px 40px -18px var(--pop-shadow);color:var(--ink);font-family:var(--font-body);position:relative;overflow:hidden}
.lvl *{box-sizing:border-box}
.lvl-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 16px;margin-bottom:10px}
.lvl-k{margin:0;font:700 .78rem/1.2 var(--font-display);letter-spacing:.08em;text-transform:uppercase;color:var(--primary)}
.lvl-k b{display:block;margin-top:4px;font-size:1.25rem;letter-spacing:-.01em;text-transform:none;color:var(--ink)}
.lvl-chips{display:flex;flex-wrap:wrap;gap:8px}
.lvl-chips button{min-height:44px;padding:0 16px;border-radius:999px;border:1px solid var(--line-strong);background:var(--surface-subtle);
  color:var(--ink);font:600 .9rem/1 var(--font-body);cursor:pointer;transition:background .2s var(--ease-out),border-color .2s,color .2s,transform .2s var(--ease-out)}
.lvl-chips button:hover{border-color:var(--primary)}
.lvl-chips button:active{transform:scale(.97)}
.lvl-chips button[aria-checked="true"]{background:var(--primary);border-color:var(--primary);color:var(--on-primary);box-shadow:0 6px 16px -6px var(--pshadow)}
.lvl-chips button[aria-checked="true"]::before{content:"✓ ";font-weight:800}
.lvl-chips button:focus-visible,.lvl-range:focus-visible,.lvl-replay:focus-visible{outline:3px solid var(--sky);outline-offset:2px}

.lvl-plot{position:relative}
.lvl svg{display:block;width:100%;height:auto;overflow:visible;touch-action:pan-y}
.lvl .g-grid{stroke:var(--line);stroke-width:1}
.lvl .g-band{fill:var(--frostbg);opacity:.9}
.lvl .g-bandline{stroke:var(--primary);stroke-width:1;stroke-dasharray:3 5;opacity:.45}
.lvl .g-area{fill:url(#lvlFill)}
.lvl .g-stop-a{stop-color:var(--primary);stop-opacity:.28}
.lvl .g-stop-b{stop-color:var(--primary);stop-opacity:0}
.lvl .g-line{fill:none;stroke:var(--primary);stroke-width:3;stroke-linejoin:round;stroke-linecap:round}
.lvl .g-dose{fill:var(--card);stroke:var(--primary);stroke-width:2}
.lvl .g-wk{fill:var(--ink2);font:600 11px/1 var(--font-body)}
.lvl .g-bandlbl{fill:var(--primary);font:700 10.5px/1 var(--font-body);letter-spacing:.02em}
.lvl .g-guide{stroke:var(--ink);stroke-width:1;stroke-dasharray:2 4;opacity:.35}
.lvl .g-knob{fill:var(--primary);stroke:var(--card);stroke-width:3;filter:drop-shadow(0 3px 6px var(--pshadow))}
.lvl.is-drawing .g-line{animation:lvlDraw 1.6s var(--ease-out) both}
.lvl.is-drawing .g-area{animation:lvlFade 1.6s var(--ease-out) both}
@keyframes lvlDraw{from{stroke-dashoffset:var(--len,2000)}to{stroke-dashoffset:0}}
@keyframes lvlFade{from{opacity:0}to{opacity:1}}

.lvl-read{display:flex;align-items:center;gap:10px;min-height:44px;margin:6px 0 2px;font:600 1rem/1.3 var(--font-body);color:var(--ink)}
.lvl-read img{width:36px;height:36px;flex:none;transition:transform .35s var(--ease-out)}
.lvl-read.bump img{transform:translateY(-4px) rotate(-6deg)}
.lvl-read span{font-variant-numeric:tabular-nums}
.lvl-range{width:100%;margin:4px 0 0;accent-color:var(--primary);min-height:44px;cursor:ew-resize}

.lvl-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:10px 0 0}
.lvl-stats div{padding:12px 14px;border-radius:16px;background:var(--stat)}
.lvl-stats b{display:block;font:800 1.35rem/1.1 var(--font-display);color:var(--ink);font-variant-numeric:tabular-nums}
.lvl-stats span{display:block;margin-top:4px;font-size:.85rem;line-height:1.35;color:var(--ink2)}

.lvl-foot{display:flex;flex-wrap:wrap;align-items:flex-start;gap:10px 16px;margin-top:12px}
.lvl-replay{min-height:44px;padding:0 16px;border-radius:999px;border:1px solid var(--line-strong);background:transparent;color:var(--ink);font:600 .9rem/1 var(--font-body);cursor:pointer}
.lvl-math{flex:1 1 260px;font-size:.9rem;color:var(--ink2)}
.lvl-math summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:700;color:var(--primary)}
.lvl-math p{margin:4px 0 0;line-height:1.5}
.lvl-math code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.85rem;background:var(--stat);padding:2px 6px;border-radius:6px;white-space:normal}
.lvl figcaption{margin-top:12px;font-size:.85rem;color:var(--ink2)}

.lvl-cta{display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px;margin-top:16px;padding:16px;border-radius:18px;background:var(--surface-subtle);border:1px solid var(--line)}
.lvl-cta p{flex:1 1 220px;margin:0;font-weight:600;line-height:1.4}
.lvl-cta p small{display:block;margin-top:2px;font-weight:500;color:var(--ink2)}
.lvl-cta a{display:inline-flex;align-items:center;justify-content:center;min-height:48px;padding:0 22px;border-radius:999px;background:var(--primary);color:var(--on-primary);
  font:700 1rem/1 var(--font-body);text-decoration:none;box-shadow:0 4px 0 var(--primary-ledge),0 10px 22px -10px var(--pshadow);transition:transform .15s var(--ease-out),background .2s}
.lvl-cta a:hover{background:var(--primary-hover)}
.lvl-cta a:active{transform:translateY(2px);box-shadow:0 2px 0 var(--primary-ledge)}

/* Home: the preview sits right under the hero */
.lvl-sec{padding:12px 20px 40px}
.lvl-sec .lvl{max-width:880px;margin:0 auto}
.lvl-sec h2{max-width:880px;margin:0 auto 6px;font:800 var(--text-heading)/1.1 var(--font-display);letter-spacing:-.02em;text-align:center}
.lvl-sec .lvl-sub{max-width:640px;margin:0 auto 18px;text-align:center;color:var(--ink2)}

[dir="rtl"] .lvl-read img{transform:scaleX(-1)}
[dir="rtl"] .lvl-read.bump img{transform:scaleX(-1) translateY(-4px) rotate(-6deg)}

@media (max-width:560px){.lvl{padding:18px 14px 14px;border-radius:20px}.lvl-stats b{font-size:1.15rem}}
@media (prefers-reduced-motion:reduce){.lvl.is-drawing .g-line,.lvl.is-drawing .g-area{animation:none}.lvl-read img,.lvl-chips button{transition:none}}
