/* Approved F1–F7 browser host geometry; all visible controls use the Mac DS. */
body.auth-page { margin:0; height:var(--auth-viewport-height,100dvh); min-height:0; overflow:hidden; background:var(--surface-ground); color:var(--text-primary); display:grid; grid-template-columns:minmax(0,1fr); }
.auth-main { grid-area:1/1; padding:0; min-height:0; display:grid; place-items:center; }
.auth-main .join { --jp-x:max(var(--sp-5),calc((100% - 361px)/2)); --auth-primary-bottom:var(--sp-16); --auth-row-height:var(--btn-h-44); --auth-secondary-height:0px; --auth-hint-height:0px; position:relative; display:flex; flex-direction:column; width:100%; max-width:none; height:min(720px,var(--auth-viewport-height,100dvh)); max-height:none; margin:0; padding:0; border:0; border-radius:0; box-shadow:none; background:var(--surface-ground); transform:none; animation:none; overflow:visible; }
#auth-panel[data-layout="login"] { --auth-head-top:152px; }
.auth-header { position:absolute; inset:0 0 auto; height:var(--sp-12); margin:0; padding-inline:var(--sp-5); display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; z-index:3; }
.auth-home { grid-area:1/2; }
@media(min-width:768px) {
  .auth-page:not(:has(#beta-panel[data-page="approved"]:not([hidden]))) .auth-home { display:none; }
}
.auth-home svg { display:block; width:84px; height:auto; }
/* Back stays on the left. On mobile, progress uses the centered logo slot. */
.auth-back-slot { grid-area:1/1; justify-self:start; display:flex; align-items:center; }
.auth-header #beta-progress { grid-area:1/2; position:static; margin:0; transform:none; }
.auth-header:has(#beta-progress:not([hidden])) .auth-home { display:none; }
.auth-art { display:none; }
.auth-ds-subview { height:100%; min-height:0; width:100%; }
.auth-ds-subview [data-setup-page] { padding-bottom:calc(var(--auth-primary-bottom) + var(--auth-row-height) + var(--auth-secondary-height) + var(--auth-hint-height) + var(--sp-6)); }
/* The desktop body scrolls behind the fixed DS BottomBar. Extra space at
   the end lets the last tile clear the fade and the entire action group. */
@media (min-width: 768px) {
  #auth-panel:not([data-layout="login"]) .auth-ds-subview [data-setup-page] {
    display:block;
    height:100% !important;
    overflow:hidden !important;
    padding-bottom:0 !important;
  }
  #auth-panel:not([data-layout="login"]) .auth-ds-subview [data-setup-page-body] {
    height:100%;
    overflow-y:auto;
    padding-bottom:calc(var(--auth-primary-bottom) + var(--auth-row-height) + var(--auth-secondary-height) + var(--auth-hint-height) + var(--sp-6)) !important;
  }
  #auth-panel:not([data-layout="login"]) .auth-ds-subview [data-bottom-bar] {
    position:absolute !important;
    inset:auto 0 0 !important;
    width:100%;
  }
}
.auth-ds-subview [data-setup-page-body] { padding-bottom:0 !important; margin:0; }
.auth-main .join__scroll { --jp-x:max(var(--sp-5),calc((100% - 361px)/2)); display:flex; flex-direction:column; gap:var(--sp-8); height:auto; max-height:none; margin:0; padding:0 var(--jp-x); overflow:visible; flex:none; }
.auth-page .join__header { position:relative; display:flex; flex-direction:column; align-items:center; gap:var(--sp-3); margin:0; padding:0; }
.auth-page .join__mark { display:none; }
.auth-page .join__title { margin:0; color:var(--text-primary); font:var(--weight-medium) var(--fs-title-page)/var(--lh-title-page) var(--font-serif); text-align:center; }
.auth-page .join__title:focus { outline:none; }
.auth-page .join__desc { margin:0; color:var(--text-secondary); font:var(--fs-body)/var(--lh-body) var(--font-ui); text-align:center; }
.auth-page [hidden] { display:none !important; }
.auth-page :focus-visible:not(.jd-ds-input) { outline:var(--focus-ring-w) solid var(--focus-ring-color); outline-offset:var(--focus-ring-offset); }
.auth-ds-field,.auth-ds-control { display:contents; }
/* Use the shared placeholder token for all DS inputs on the auth surface. */
.auth-page .jd-ds-input::placeholder { color:var(--text-placeholder); opacity:1; }

#auth-sso { display:flex; flex-direction:column; gap:var(--sp-3); }
.auth-main #auth-email-form { gap:var(--sp-2); }
.auth-code-actions { margin:0; }
.auth-status { margin:0; min-height:0; }
.auth-status:empty,.auth-status:has([data-jd-input-helper]:empty),.auth-status:has([data-setup-status] > span:empty) { display:none; }
/* The bar runs to the frame bottom and keeps the 64 (phone: safe area + 16) as its own padding, so its ground
   also covers the strip under the buttons and scrolled content never shows through there (= iOS CtaDock). */
.auth-ds-subview [data-bottom-bar] { position:absolute !important; inset:auto 0 0 !important; margin:0 !important; width:100%; padding-bottom:var(--auth-primary-bottom) !important; box-sizing:border-box; }
.auth-ds-dock { position:relative; padding:0 var(--jp-x); }
.auth-primary-row { width:100%; }
.auth-primary-row button,.auth-ds-download { width:100% !important; min-height:var(--btn-h-44); box-sizing:border-box; }
.auth-ds-download { display:flex; justify-content:center; align-items:center; text-decoration:none; }
.auth-secondary-row { display:block; width:100%; padding-top:var(--sp-3); } /* secondary below the primary (spec H) */
.auth-secondary-row[hidden] { display:none; }
.auth-secondary-row button,.auth-secondary-row .auth-ds-download { width:100% !important; min-height:var(--btn-h-44); box-sizing:border-box; }
.auth-dock-hints { display:flex; flex-direction:column; gap:var(--sp-2); }
.auth-dock-hints:not(:has(> :not([hidden]):not(:empty))) { display:none; }
.auth-dock-hints:has(> :not([hidden]):not(:empty)) { padding-bottom:var(--sp-3); }
.auth-dock-hints:has([data-inline-error]) { padding-bottom:0; }
.auth-dock-note { position:absolute; inset:100% 0 auto; height:var(--sp-10); display:flex; justify-content:center; align-items:center; text-align:center; }
.auth-ds-back { display:contents; }
#beta-home { display:none !important; }
/* Spec H account layer: at the bottom of the window (left column), never inside the content frame. */
.auth-bottom-layer { position:fixed; left:0; bottom:var(--top-slot-bottom); width:var(--auth-left-width); display:flex; flex-direction:column; align-items:center; gap:var(--sp-2); z-index:calc(var(--z-sticky, 100) + 1); }
.auth-bottom-layer:not(:has(> :not([hidden]))) { display:none; }
.beta-onboarding { display:flex; justify-content:center; }
.beta-onboarding--with-ads { flex-direction:column; align-items:center; gap:var(--sp-1); }
.auth-account [data-textlink-row] { align-items:baseline !important; gap:0 var(--sp-1) !important; }
.auth-account [data-textlink-row] > span { line-height:var(--lh-caption); }
/* Login pages: every clickable control uses the hand cursor (2026-11-13, the user).
   Beat the desktop DS rule that keeps in-place buttons on the arrow. Text fields stay the I-beam;
   disabled controls stay the arrow. */
@media (hover:hover) and (pointer:fine) {
  [data-platform="desktop"] body.auth-page :is(
    button,
    a[href],
    [role="button"],
    [role="link"],
    [role="checkbox"],
    [role="radio"],
    [role="switch"],
    [role="tab"],
    [role="menuitem"],
    [data-textlink],
    [data-jd-button],
    [data-survey-tile],
    label:has(input[type="checkbox"]),
    label:has(input[type="radio"]),
    input[type="checkbox"],
    input[type="radio"],
    .jd-gbtn,
    .jdds-social,
    [data-consent-check],
    .beta-marketing
  ):not(:disabled):not([aria-disabled="true"]):not([data-disabled="1"]) { cursor:pointer !important; }
  [data-platform="desktop"] body.auth-page :is(
    button,
    a[href],
    [role="button"],
    [role="link"],
    [role="checkbox"],
    [role="radio"],
    [role="switch"],
    [data-textlink],
    [data-jd-button],
    [data-survey-tile],
    .jd-gbtn,
    .jdds-social,
    [data-consent-check],
    .beta-marketing
  ):not(:disabled):not([aria-disabled="true"]):not([data-disabled="1"]) * { cursor:pointer !important; }
  [data-platform="desktop"] body.auth-page :is(
    textarea,
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
    [contenteditable="true"]
  ):not(:disabled):not([aria-disabled="true"]),
  [data-platform="desktop"] body.auth-page :is(
    textarea,
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"])
  ):not(:disabled) * { cursor:text !important; }
  [data-platform="desktop"] body.auth-page :is(button:disabled,[aria-disabled="true"],[data-disabled="1"]),
  [data-platform="desktop"] body.auth-page :is(button:disabled,[aria-disabled="true"],[data-disabled="1"]) * { cursor:default !important; }
  [data-platform="desktop"] body.auth-page [data-textlink]:not(:disabled):not([aria-disabled="true"]):active {
    text-decoration:underline;
    text-decoration-thickness:2px;
  }
}
.auth-new-note { margin:0; text-align:center; }
#auth-panel[data-layout="login"] [data-bottom-bar] { display:none; }
#auth-panel[data-layout="login"] [data-setup-page] { padding-bottom:var(--sp-16); }
#auth-panel [data-setup-page-body] { padding-top:var(--auth-head-top) !important; }
#beta-header[data-ds-heading] > :is(#beta-title, #beta-description) { display:none; }
.auth-result-hero { width:100%; display:grid; justify-items:center; }
.auth-result-hero:has(> [data-hero-disc]) { gap:var(--sp-6); }
/* The heading receives focus for announcements; the ring belongs on controls. */
#beta-visible-title:focus { outline:none; }
.auth-ds-step [data-legal-line] { line-height:var(--lh-compact) !important; }
.beta-marketing [data-consent-check] { align-items:center !important; gap:var(--sp-2) !important; }
.beta-marketing [data-consent-box] { margin-top:0 !important; }
.auth-dock-note:has(> #beta-install-help:not([hidden])) { height:auto; min-height:var(--sp-10); flex-direction:column; padding-block:var(--sp-2); }
.auth-loading-disc { display:grid; place-items:center; width:96px; aspect-ratio:1; border-radius:var(--radius-circle); background:var(--soft-icon); }
.auth-result-hero p { overflow-wrap:anywhere; white-space:pre-line; }
.auth-result-paragraph { display:block; }
.auth-result-paragraph + .auth-result-paragraph { margin-top:var(--sp-2); }
.auth-tertiary { display:flex; flex-direction:column; align-items:center; text-align:center; gap:var(--sp-3); }
@media(min-width:1080px) {
  body.auth-page { grid-template-columns:minmax(0,1.618fr) minmax(0,1fr); }
  .auth-header { width:calc(100% * 1.618 / 2.618); box-sizing:border-box; }
  /* Match the Mac sign-in artwork: keep its warm ink veil in both themes. */
  .auth-art { --auth-art-veil:rgba(35,33,30,0.30); grid-area:1/2; display:grid; margin:var(--sp-4); min-height:0; }
  #auth-brand-motion > [data-jd-card] { display:grid; place-items:center; corner-shape:var(--shape) !important; }
  #auth-brand-motion [data-illustration-clip] { grid-area:1/1; min-height:0; }
  #auth-brand-motion [data-illustration-clip] img { object-fit:cover !important; }
  #auth-brand-motion [data-illustration-clip]::after { content:""; position:absolute; inset:0; background:var(--auth-art-veil); }
  #auth-brand-motion > [data-jd-card] > :last-child { grid-area:1/1; position:relative; width:50% !important; }
  #auth-brand-motion svg { width:100%; height:auto; }
}
@media(min-width:768px) and (max-height:599px) {
  #auth-panel { --auth-head-top:60px; }
}
@media(max-width:767px) {
  .auth-main .join,.auth-main .join__scroll { --jp-x:var(--sp-5); }
  .auth-main .join { height:var(--auth-viewport-height,100dvh); --auth-primary-bottom:calc(env(safe-area-inset-bottom) + var(--sp-4)); --auth-row-height:var(--btn-full-h); }
  .auth-page .join__title { font-size:var(--fs-title-hero); line-height:var(--lh-title-hero); }
  .auth-primary-row button,.auth-ds-download,.auth-secondary-row button,.auth-secondary-row .auth-ds-download { min-height:var(--btn-full-h); }
}
@media(max-width:767px) and (orientation:landscape), (max-width:767px) and (max-height:499px) {
  body.auth-page { overflow:auto; }
  .auth-main .join { height:auto; min-height:var(--auth-viewport-height,100dvh); --auth-head-top:60px; }
  .auth-ds-subview [data-setup-page] { overflow:visible !important; padding-bottom:0; }
  .auth-ds-subview [data-bottom-bar] { position:relative !important; inset:auto !important; padding-block:var(--sp-6) calc(env(safe-area-inset-bottom) + var(--sp-4)); }
  .auth-dock-note { position:static; }
}
/* The DS fade stays at the viewport anchors while SetupPage scrolls underneath. */
body.auth-page { --auth-left-width:100vw; position:relative; top:var(--auth-viewport-top,0px); }
.auth-ds-subview [data-bottom-bar] { position:fixed !important; inset:auto auto max(0px,(var(--auth-viewport-height,100dvh) - 720px)/2) 0 !important; width:var(--auth-left-width); }
/* Cover the actual scroll viewport edges. Desktop navigation sits above the
   centered canvas, so its own lower edge is not the clipping boundary. */
.auth-scroll-edges { position:absolute; inset:0; pointer-events:none; }
.auth-scroll-edge { position:absolute; inset-inline:0; height:var(--sp-1); z-index:2; opacity:0;
  transition:opacity var(--motion-state) var(--ease-standard); }
.auth-scroll-edge--top { top:var(--auth-scroll-top, 0px); }
.auth-scroll-edge--bottom { bottom:var(--auth-scroll-bottom, 0px); }
.auth-scroll-edges[data-top="true"] .auth-scroll-edge--top,
#auth-panel[data-layout="login"] .auth-scroll-edges[data-bottom="true"] .auth-scroll-edge--bottom { opacity:1; }
@media(prefers-reduced-motion:reduce) { .auth-scroll-edge { transition:none; } }
@media(prefers-reduced-transparency:reduce) { .auth-scroll-edge [data-scroll-edge-blur] { display:none; } }
#auth-panel[data-flow-dock="true"] .auth-scroll-edges { display:none; }
@media(min-width:1080px) { body.auth-page { --auth-left-width:calc(100vw * 1.618 / 2.618); } }
@media(max-width:767px) {
  .auth-ds-subview [data-bottom-bar] { bottom:0 !important; }
  #auth-panel[data-flow-dock="true"] { height:auto; min-height:var(--auth-viewport-height,100dvh); }
  #auth-panel[data-flow-dock="true"] [data-setup-page] { overflow:visible !important; padding-bottom:0; }
  #auth-panel[data-flow-dock="true"] [data-bottom-bar] { position:relative !important; inset:auto !important; width:100%; padding-block:var(--sp-6) calc(env(safe-area-inset-bottom) + var(--sp-4)); }
  #auth-panel[data-flow-dock="true"] .auth-dock-note { position:static; }
}
@media(max-width:767px) {
  /* F7: the phone dock ends with the secondary TextLink note. */
  .auth-ds-dock { display:flex; flex-direction:column; }
  .auth-dock-note { position:static; }
  .auth-ds-subview [data-setup-page] { padding-bottom:calc(var(--auth-primary-bottom) + var(--auth-row-height) + var(--auth-secondary-height) + var(--auth-hint-height) + var(--auth-note-height,0px) + var(--sp-6)); }
}
.auth-dock-note:not(:has(button:not([hidden]),a:not([hidden]))) { height:0; }
/* Desktop: the absolute note was collapsing to 0 height, so the text link sat flush
   against the primary button. Keep the same 12px gap the phone dock already has. */
@media (min-width: 768px) {
  .auth-dock-note:has(button:not([hidden]), a:not([hidden])) {
    bottom: auto;
    top: 100%;
    margin-top: var(--sp-3);
    height: auto;
  }
}
@media(max-width:767px) { .auth-dock-account .auth-account { padding-top:var(--sp-3); } }
/* r263 shared steps: SignInStep / CodeStep draw their own title, status and resend, as on Mac. The page header,
   the status line and the old code actions stay as the controller's wiring and show on the other pages only. */
#auth-panel:has(#auth-email-form:not([hidden]),#auth-code-form:not([hidden])) .join__header,
#auth-panel:has(#auth-email-form:not([hidden]),#auth-code-form:not([hidden])) #auth-status,
#auth-code-actions,.auth-resend-status,#auth-sso { display:none !important; }
.auth-ds-step { display:flex; flex-direction:column; align-items:center; }
/* The step column is min(361, 100% − 48) for Mac's wide pane; on the web it spans the page's own 361 / phone column. */
.auth-ds-step { width:calc(100% + var(--sp-12)); margin-inline:calc(-1 * var(--sp-6)); }
/* Navigation layer breathing room (designer 11-11: back and logo sat on the edge). Phone: a 64 bar, the 44 back
   10 from the top and 20 from the side (the page gutter); desktop: a 24 inset. */
.auth-header { height:var(--sp-16); }
@media(min-width:768px) { .auth-header { height:auto; padding:var(--sp-6) var(--sp-6) 0; } }
/* A form action that failed (security check, submit): the DS InlineError sits centred over the button, as Mac's
   SignInStep centres its error; a page that failed to load says why in its description instead (beta/view.js). */
.auth-dock-hints [data-inline-error] { justify-content:center; text-align:center; }
.auth-dock-hints [data-inline-error] > :last-child { flex:0 1 auto !important; }
/* DS Icon's optical scale lives in an SVG style attribute, which this page's CSP (style-src 'self') drops. The same
   rule, static: the glyph group scales about its view box centre by (1 + .25·sf-native)·sf-adj, as in the DS. */
.auth-page svg[role="presentation"][viewBox] > g:only-child { transform:scale(calc((1 + .25 * var(--sf-native, 1)) * var(--sf-adj, 1))); transform-origin:50% 50%; transform-box:view-box; }

#beta-visible-backup-code { font:600 28px/36px Menlo,Consolas,monospace !important; overflow-wrap:anywhere; }

/* Pin only the challenge under the wait title. Leave the dock, and the phone
   account line inside it, at the bottom of the page. A zero-height silent
   widget still leaves the existing wait layout intact. */
#auth-panel[data-challenge-visible="true"]:has(#beta-panel[data-initial-wait]) #beta-challenge {
  position:fixed;
  top:var(--auth-wait-challenge-top);
  left:0;
  width:var(--auth-left-width);
  display:flex;
  justify-content:center;
  z-index:4;
  pointer-events:auto;
}

/* 2026-11-13 preview: invite code is its own step before sign-in, same column as login. */
/* Signed-in and signed-out invite share #auth-invite-step. Never stack it with the
   application or login forms. The signed-in account line stays; pre-login hides the bottom layer. */
:root[data-invite-step] .auth-ds-step,
:root[data-invite-step] #auth-loading,
:root[data-invite-step] #auth-invite-toggle,
:root[data-invite-step] #auth-signed-in { display:none !important; }
:root[data-invite-step]:not([data-invite-step="signed-in"]) .auth-bottom-layer { display:none !important; }
:root[data-invite-step="signed-in"] #beta-onboarding { display:none !important; }
:root[data-invite-step] #beta-panel { display:none !important; }
:root[data-invite-step] .join__scroll { gap:0; }
.auth-invite-step {
  display:flex; flex-direction:column; align-items:center; text-align:center;
  width:calc(100% + var(--sp-12)); margin-inline:calc(-1 * var(--sp-6));
  box-sizing:border-box;
}
.auth-invite-step[hidden] { display:none !important; }
.auth-invite-step__title {
  margin:0; font-family:var(--font-serif);
  font-size:var(--fp-title-fs, var(--fs-title-page,28px));
  line-height:var(--fp-title-lh, var(--lh-title-page,34px));
  font-weight:500; color:var(--text-primary); text-wrap:balance;
}
.auth-invite-step__desc {
  margin:0; padding-top:8px; font-size:var(--fs-label); line-height:var(--lh-label);
  color:var(--text-tertiary); text-wrap:pretty;
}
.auth-invite-step__form { display:flex; flex-direction:column; gap:var(--sp-3); width:min(361px, calc(100% - var(--sp-12))); margin-top:var(--sp-8); }
.auth-invite-field > .beta-field-error { margin:0; }
@media(min-width:768px) {
  :root[data-invite-step] .auth-ds-dock { display:grid; }
}
/* Invite entry sits under Continue, legal line stays last with extra space. */
.auth-ds-control:has(#auth-invite-toggle),
#auth-invite-toggle {
  display:flex;
  justify-content:center;
  width:100%;
  margin-top:0;
}
.auth-ds-control:has(#auth-invite-apply),
#auth-invite-apply {
  display:flex;
  justify-content:center;
  width:100%;
}
#auth-invite-toggle[hidden],
.auth-ds-control:has(#auth-invite-toggle[hidden]) { display:none !important; }
.auth-ds-step:has(#auth-invite-toggle:not([hidden])) [data-legal-line] { margin-top:var(--sp-5) !important; }

#beta-header > .auth-ds-control:has(#beta-backup-toggle:not([hidden])) { display:block; width:100%; margin-top:var(--sp-3); }
#beta-header:has(> #beta-backup:not([hidden])) { gap:var(--sp-3); }
#beta-header > #beta-backup { margin-top:var(--sp-3); }

@media(max-width:767px) {
  .auth-header { padding-top:env(safe-area-inset-top); }
  .auth-ds-step,.auth-invite-step { width:calc(100% + 2 * var(--jp-x)); margin-inline:calc(-1 * var(--jp-x)); }
  :root[data-invite-step] #auth-panel:not([data-flow-dock="true"]) [data-bottom-bar] { position:fixed !important; }
  .auth-ds-dock { gap:var(--sp-3); }
  .auth-scroll-edge--top { height:var(--auth-scroll-top-height, var(--sp-16)); }
  .auth-dock-hints [data-inline-error] { padding-bottom:0 !important; }
  #auth-panel:not([data-flow-dock="true"]) .auth-dock-account:has(.auth-account:not([hidden])) {
    background:var(--surface-ground);
    box-shadow:0 var(--sp-4) 0 var(--sp-4) var(--surface-ground);
  }
  .auth-dock-note-slot:not(:has(#beta-install-help:not([hidden]))) {
    margin-top:calc(var(--sp-2) * -1);
  }
  .auth-dock-note-slot:not(:has(#beta-install-help:not([hidden]))) .auth-dock-note { height:auto; }
  .auth-dock-note :is(button, a) { min-height:var(--btn-h-44, 44px); }
  .auth-dock-note [data-textlink] { box-sizing:border-box; padding-bottom:var(--sp-2) !important; }
  .auth-ds-dock > :not(:has(> :not([hidden]))),
  .auth-ds-dock > :has(> .auth-primary-row):not(:has(:is(button,a):not([hidden], [hidden] *))),
  .auth-dock-note-slot:not(:has(:is(button,a):not([hidden], [hidden] *))),
  .auth-ds-dock > :has(> .auth-dock-account):not(:has(.auth-account:not([hidden]))) { display:none; }
  .auth-secondary-row,.auth-dock-account .auth-account { padding-top:0; }
  .auth-bottom-layer { bottom:calc(var(--top-slot-bottom) + env(safe-area-inset-bottom)); padding-inline:var(--sp-5); box-sizing:border-box; }
  #auth-panel[data-layout="login"]:not([data-flow-dock="true"]) [data-setup-page] { padding-bottom:calc(var(--sp-16) + env(safe-area-inset-bottom)); }
  #auth-panel[data-flow-dock="true"] [data-bottom-bar] { padding-bottom:calc(var(--sp-4) + env(safe-area-inset-bottom)) !important; }
  body.auth-page:has(#auth-panel[data-flow-dock="true"]) { overflow:auto; }
  body.auth-page:has(#auth-panel[data-flow-dock="true"]) .auth-bottom-layer { position:static; grid-area:2/1; padding-bottom:calc(var(--sp-4) + env(safe-area-inset-bottom)); }
}
