/* Segment stylesheet: entry. Owned by the entry segment; shared tokens and components live in /static/gw.css.
   Colours only via var(--gw-*) tokens.
   Screens: /login, /login sent, /m/<tok> (confirm, switch, expired), /onboarding, /install, /offline. */

/* ---------- Shared entry frame: brand mark, art, head ---------- */
.gw-entry{display:flex;flex-direction:column}
.gw-entry-brand{display:flex;align-items:center;min-height:44px;margin:0 0 20px}
.gw-entry-brand--center{justify-content:center}
.gw-entry-head{margin-bottom:24px}
.gw-entry-head .gw-h1{font-size:30px;line-height:1.15;letter-spacing:-.005em}
.gw-entry-hero{width:calc(100% + 24px);max-width:420px;margin:-4px -12px 12px;height:auto}
/* The art's ground ellipse is cut at the canvas edge: fade both sides so it melts into the paper */
.gw-entry-hero,.gw-entry-done__art{-webkit-mask-image:linear-gradient(90deg,transparent 0,#000 12%,#000 88%,transparent 100%);mask-image:linear-gradient(90deg,transparent 0,#000 12%,#000 88%,transparent 100%)}
/* Confirm hero (link-open, 640x400) in the shared 780:400 frame letterboxed to ~240px of ink. Cover-fit at the
   column bleed instead: the drawing spans x~54..343 like the login desk, the frame is 198px tall (login 188),
   and the 25% anchor keeps the check-mark rays (y16) while trimming only the faded ground shadow. */
.gw-entry-hero.gw-entry-hero--fill{aspect-ratio:640/346;object-fit:cover;object-position:50% 25%}
.gw-entry-art{width:min(300px,80%);height:auto;margin:0 0 16px}
.gw-entry-artwrap{position:relative;align-self:flex-start;width:min(300px,80%);margin:0 0 16px}
.gw-entry-artwrap .gw-entry-art{width:100%;margin:0}
/* Envelope art (sent / expired) on the same frame as the notebook hero: full column width, the
   drawn shapes start at the text edge and stand about as tall as the login hero (~175px at 390).
   link-sent.webp is 640x400 with its drawing at x70-580, y67-386: the negative margins crop that
   transparent padding (percent margins resolve against the column width). */
.gw-entry-envelope{align-self:stretch;width:100%;max-width:342px;margin:0 0 20px}
.gw-entry-envelope .gw-entry-art{width:102.6%;max-width:none;margin:-10.8% 0 -2.4% -11.1%}
.gw-entry-envelope .gw-entry-badge{right:16%;bottom:2%}
.gw-entry-badge{position:absolute;right:6%;bottom:10%;width:44px;height:44px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:var(--gw-surface);color:var(--gw-cau-fg);box-shadow:var(--gw-shadow-lift),0 0 0 4px var(--gw-bg)}
.gw-entry-badge .gw-icon{width:22px;height:22px}
.gw-entry-note{margin:0 0 20px}
.gw-entry-note>.gw-icon{flex:none;width:20px;height:20px;margin-top:1px;color:var(--gw-accent)}

/* Calm entrance: art first, then the head, then the action */
@media (prefers-reduced-motion:no-preference){
  .gw-entry-hero,.gw-entry-art,.gw-entry-artwrap,.gw-offline__art,.gw-entry-done__art{animation:gw-entry-in .7s var(--gw-ease-out) both}
  .gw-entry-head,.gw-entry-week,.gw-entry-ids{animation:gw-entry-in .6s var(--gw-ease-out) .08s both}
  .gw-entry-form,.gw-entry-steps,.gw-entry-actions,.gw-onboard{animation:gw-entry-in .6s var(--gw-ease-out) .16s both}
  .gw-entry-week__d--1{animation:gw-entry-pop .5s var(--gw-ease-out) .45s both}
}
@keyframes gw-entry-in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes gw-entry-pop{from{transform:scale(.8)}60%{transform:scale(1.06)}to{transform:none}}

/* ---------- Login form ---------- */
.gw-entry-form{display:flex;flex-direction:column;gap:16px}
.gw-entry-control{position:relative}
.gw-entry-control>.gw-icon{position:absolute;left:16px;top:50%;width:20px;height:20px;margin-top:-10px;color:var(--gw-subtle);pointer-events:none;transition:color .2s var(--gw-ease)}
.gw-login-input{display:block;width:100%;min-height:56px;padding:0 16px 0 48px;border:1.5px solid var(--gw-line);border-radius:var(--gw-r-field);background:var(--gw-surface);color:var(--gw-ink);font:400 17px/22px var(--gw-font-ui);transition:border-color .2s var(--gw-ease),box-shadow .2s var(--gw-ease)}
.gw-login-input::placeholder{color:var(--gw-subtle);opacity:.8}
.gw-login-input:focus{outline:2px solid var(--gw-accent);outline-offset:2px;border-color:var(--gw-accent)}
.gw-entry-control:focus-within>.gw-icon{color:var(--gw-accent)}
/* Left-aligned with the page; the icon pins to the first line so a wrapped line never orphans it */
.gw-entry-assure{display:flex;align-items:flex-start;justify-content:flex-start;gap:8px;margin:0;font-size:.875rem;line-height:1.43;color:var(--gw-subtle);text-align:left}
.gw-entry-assure>.gw-icon{flex:none;width:1.143em;height:1.143em;margin-top:.143em;color:var(--gw-accent)}
.gw-entry-hint{margin-top:28px}

/* ---------- Login sent: three short steps ---------- */
.gw-entry-steps{list-style:none;margin:-4px 0 28px;padding:0;display:flex;flex-direction:column;gap:12px}
.gw-entry-steps li{display:flex;text-wrap:pretty;gap:12px;align-items:flex-start;font-size:1rem;line-height:1.5;color:var(--gw-muted)}
.gw-entry-steps__n{flex:none;width:1.846em;height:1.846em;margin-top:.04em;border-radius:50%;background:var(--gw-tint);color:var(--gw-accent-ink);font-size:.8125em;font-weight:800;line-height:1.846em;text-align:center}

/* ---------- Confirm / switch: identity rows ---------- */
.gw-entry-ids{display:flex;flex-direction:column;gap:10px;margin:0 0 24px}
.gw-entry-id{position:relative;display:flex;align-items:center;gap:14px;min-height:64px;padding:14px 16px;background:var(--gw-surface);border:1px solid var(--gw-line);border-radius:var(--gw-r-box);box-shadow:var(--gw-shadow-card)}
.gw-entry-id__av{flex:none;width:40px;height:40px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:var(--gw-tint);color:var(--gw-accent-ink);font:600 18px/1 var(--gw-font-display)}
.gw-entry-id__av .gw-icon{width:20px;height:20px}
.gw-entry-id__txt{margin:0;min-width:0;font-size:16px;line-height:22px;font-weight:600;color:var(--gw-ink);overflow-wrap:anywhere}
.gw-entry-id__txt b{display:block;margin-top:2px;font-weight:700;color:var(--gw-ink)}
.gw-entry-id__lbl{display:block;font-size:14px;line-height:20px;font-weight:600;color:var(--gw-subtle)}
.gw-entry-ids .gw-entry-id:has(b) .gw-entry-id__txt{font-size:14px;line-height:20px;font-weight:600;color:var(--gw-subtle)}
.gw-entry-ids .gw-entry-id:has(b) .gw-entry-id__txt b{font-size:16px;line-height:22px}
.gw-entry-ids .gw-entry-id:last-child:has(b){border-color:var(--gw-seaglass);box-shadow:0 0 0 3px var(--gw-tint)}
/* The account the link would switch to: accent avatar (gw.css .gw-avatar--target) on a tinted row */
.gw-entry-id--target{background:color-mix(in srgb,var(--gw-tint) 45%,var(--gw-surface))}
.gw-entry-id__av.gw-avatar--target{background:var(--gw-accent);color:var(--gw-surface)}
.gw-entry-id__av.gw-avatar--target .gw-icon{width:18px;height:18px}
.gw-entry-actions{display:flex;flex-direction:column;gap:12px}
.gw-entry-actions form{margin:0}
.gw-entry-actions .gw-btn{text-align:center}

/* ---------- Onboarding ---------- */
.gw-entry-week{margin:-4px 0 24px;padding:16px 16px 14px;border-radius:var(--gw-r-card);background:var(--gw-hero-teal);border:1px solid var(--gw-line)}
.gw-entry-week__row{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.gw-entry-week__d{container-type:inline-size;display:flex;align-items:center;justify-content:center;aspect-ratio:1;max-height:44px;min-height:2em;overflow:hidden;border-radius:12px;font:700 .8125rem/1 var(--gw-font-ui);color:var(--gw-muted);background:var(--gw-surface);border:1px solid var(--gw-line)}
.gw-entry-week__d--1{background:var(--gw-accent);border-color:var(--gw-accent);color:var(--gw-surface);box-shadow:var(--gw-glow)}
/* Decorative "week shape": shot day in accent, then the week settles through the neutral week tokens.
   Never the caution palette: in this product caution colour means "tell your prescriber". */
.gw-entry-week__d--2,.gw-entry-week__d--3{background:var(--gw-week-1);border-color:var(--gw-week-edge);color:var(--gw-week-fg)}
.gw-entry-week__d--4,.gw-entry-week__d--5{background:var(--gw-week-2);border-color:var(--gw-week-edge);color:var(--gw-week-fg)}
.gw-entry-week__d--6,.gw-entry-week__d--7{background:var(--gw-week-3);border-color:var(--gw-week-edge);color:var(--gw-week-fg)}
.gw-entry-week__t{display:block;width:100%;text-align:center;white-space:nowrap}
/* Large text: the chip keeps its cell, the label shortens (Thu, Th, T) instead of crushing */
@container (max-width:2.3em){.gw-entry-week__x3{display:none}}
@container (max-width:1.45em){.gw-entry-week__x2{display:none}}
.gw-entry-week__cap{margin:12px 0 0;font-size:.875rem;line-height:1.43;font-weight:600;color:var(--gw-accent-ink)}

/* Fields grouped into two cards: "Your medication" and "Your routine". The partial renders bare
   <div>s, so the groups are drawn with :has() on the control each div holds. */
.gw-onboard{display:flex;flex-direction:column}
.gw-onboard-fields{display:flex;flex-direction:column}
.gw-onboard-fields>div{padding:10px 20px;background:var(--gw-surface);border-inline:1px solid var(--gw-line)}
/* Rows inside a card carry no top border at all: a surface-coloured top border mitred over the side
   hairlines and notched the card edge at every field join. Card-start rows declare their own. */
.gw-onboard-fields>div+div{border-top:0}
/* The submit dock (80px + safe area) is sticky at the bottom: focus scrolling and anchor jumps
   stop above it so it never covers the field being edited. */
html:has(.gw-onboard){scroll-padding-bottom:calc(96px + env(safe-area-inset-bottom,0px))}
.gw-onboard-fields>div .gw-field-label{margin:0 0 8px}
.gw-onboard-fields>div .gw-help{margin:6px 0 0;font-size:14px;line-height:20px;color:var(--gw-subtle)}
.gw-onboard-fields>div:has(#medication),
.gw-onboard-fields>div:has(#shot_day){padding-top:18px;border-top:1px solid var(--gw-line);border-radius:var(--gw-r-card) var(--gw-r-card) 0 0}
.gw-onboard-fields>div:has(#shot_day){margin-top:16px}
.gw-onboard-fields>div:has(#medication)::before,
.gw-onboard-fields>div:has(#shot_day)::before{display:block;margin:0 0 14px;font-size:.8125em;line-height:1.23;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--gw-subtle)}
.gw-onboard-fields>div:has(#medication)::before{content:"Your medication"}
.gw-onboard-fields>div:has(#shot_day)::before{content:"Your routine"}
.gw-onboard-fields>div:has(#dose_mg),
.gw-onboard-fields>div:last-child{padding-bottom:20px;border-bottom:1px solid var(--gw-line);border-radius:0 0 var(--gw-r-card) var(--gw-r-card)}
/* A daily injection or pill has no weekly shot day: hide that select (its value stays "" and is
   still submitted, exactly as before) and start the routine card at the time of day. */
.gw-onboard:has(#how_take option[value="pill"]:checked) .gw-onboard-fields>div:has(#shot_day:not([aria-invalid])),
.gw-onboard:has(#how_take option[value="daily_injection"]:checked) .gw-onboard-fields>div:has(#shot_day:not([aria-invalid])){display:none}
.gw-onboard:has(#how_take option[value="pill"]:checked) .gw-onboard-fields>div:has(#shot_window),
.gw-onboard:has(#how_take option[value="daily_injection"]:checked) .gw-onboard-fields>div:has(#shot_window){margin-top:16px;padding-top:18px;border-top:1px solid var(--gw-line);border-radius:var(--gw-r-card) var(--gw-r-card) 0 0}
.gw-onboard:has(#how_take option[value="pill"]:checked) .gw-onboard-fields>div:has(#shot_window)::before,
.gw-onboard:has(#how_take option[value="daily_injection"]:checked) .gw-onboard-fields>div:has(#shot_window)::before{content:"Your routine";display:block;margin:0 0 14px;font-size:.8125em;line-height:1.23;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--gw-subtle)}
.gw-onboard-cta{margin-top:20px}
.gw-onboard-cta>.gw-btn{min-height:56px}

/* ---------- Install ---------- */
.gw-entry-top{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 12px}
.gw-entry-top .gw-back{margin:0 0 0 -6px}

.gw-entry-install .gw-pagehead{margin-bottom:0}
/* Multi-line: the icon pins to the first line (20px icon on a 20px line box), like the assurance lines */
.gw-entry-pre{align-items:flex-start;padding:12px 14px;font-size:15px;line-height:20px}
.gw-entry-pre>.gw-icon{flex:none;width:20px;height:20px;margin-top:0;color:var(--gw-accent)}
.gw-entry-install .gw-a2hs{gap:12px}
.gw-entry-install .gw-a2hs-step{row-gap:16px;align-items:center}
.gw-entry-install .gw-a2hs-text .gw-title{line-height:24px}
.gw-entry-install .gw-a2hs-step>.gw-a2hs-n{align-self:start;margin-top:-2px}
.gw-entry-install .gw-a2hs-art{border:0;background:var(--gw-bg-deep)}
.gw-entry-install .gw-a2hs-sheet{background:var(--gw-bg-deep)}
.gw-entry-install .gw-a2hs-sheet .gw-a2hs-row{border-bottom-color:var(--gw-line)}
.gw-entry-steps-head{margin:4px 0 -12px}
/* Chrome toolbar: the shared rule sizes every non-URL span as an 18px tab square, the dots too */
.gw-entry-install .gw-a2hs-toolbar>.gw-a2hs-dots{width:36px;height:36px;border:0;border-radius:10px}
.gw-entry-install .gw-a2hs-toolbar>.gw-a2hs-dots .gw-icon{width:22px;height:22px}
.gw-entry-install .gw-a2hs-toolbar .gw-a2hs-url{padding:6px 14px}
.gw-entry-menuart{padding:10px 0 0}
.gw-entry-menuart .gw-a2hs-menu{margin:0 auto 10px;max-width:260px}
.gw-entry-menuart .gw-a2hs-row{min-height:40px}
/* The highlighted row is a pill with its own 2px ring: the row above drops its divider and the pill
   gets clear paper above and below, so the hairline never runs into the ring. */
.gw-entry-menuart .gw-a2hs-row:has(+ .is-hot){border-bottom:0}
.gw-entry-menuart .gw-a2hs-row.is-hot{margin-block:6px}
.gw-entry-menuart .gw-a2hs-row.is-hot .gw-icon{width:20px;height:20px}
/* Installed (standalone): one success moment, no second route back to the plan */
.gw-entry-install:has([data-state="installed"]:not([hidden])) .gw-entry-top{justify-content:center;margin-bottom:20px}
.gw-entry-install:has([data-state="installed"]:not([hidden])) .gw-entry-top .gw-back{display:none}
.gw-entry-done{display:flex;flex-direction:column;align-items:center;gap:8px;padding-top:12px;text-align:center}
/* Same hero frame as /login (.gw-spot--hero + .gw-entry-hero), centred by the column */
.gw-entry-done .gw-entry-hero{margin:-4px -12px 8px}
.gw-entry-done .gw-body{margin:0 0 16px}

/* ---------- Offline ---------- */
.gw-offline{margin:0;padding:0;align-items:center;text-align:center;gap:0;background:none;border:0}
.gw-offline .gw-entry-brand{margin-bottom:40px}
.gw-offline .gw-offline__art{width:min(342px,100%);max-width:100%;height:auto;margin:0 0 24px;border-radius:0}
.gw-offline .gw-h1{margin:0 0 8px}
.gw-offline .gw-body{max-width:30ch;margin:0 0 28px}
.gw-offline .gw-btn{margin:0}
