/* Sign-in and help pages: the workspace's paper, ink and terracotta. theme.js sets data-theme from the
   visitor's choice (Light by default) before the first paint; without it, the pages stay light. */
:root{
  color-scheme:light;
  --app:#f4f3f0;--sheet:#fdfdfb;--field:#ffffff;
  --text:#1c1c1a;--text-2:#5c5b57;--text-3:#8f8d88;
  --border:rgba(28,28,26,.09);--border-2:rgba(28,28,26,.16);--fill:rgba(28,28,26,.05);
  --primary:#1c1c1a;--primary-hover:#3a3935;--on-primary:#ffffff;
  --accent:#b84a32;--accent-soft:rgba(184,74,50,.08);--danger:#b3261e;--focus:rgba(184,74,50,.5);
  --shadow:0 1px 2px rgba(36,40,34,.05),0 28px 60px -40px rgba(36,40,34,.42);
  --serif:"Iowan Old Style","Palatino Linotype",Palatino,"Book Antiqua",Georgia,serif;
  --sans:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --logo:url(/favicon.png);
  /* The website's spacing and line-height scale (apps/website/styles.css): margins and gaps use these steps,
     paddings the same 4px grid. Chinese editions raise the line-heights at the end. */
  --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:20px;--space-6:24px;
  --space-7:32px;--space-8:40px;--space-9:48px;--space-10:64px;--space-11:96px;
  --lh-heading:1.2;--lh-snug:1.35;--lh-ui:1.5;--lh-body:1.6;
}
:root[data-theme=dark]{
  color-scheme:dark;
  --app:#121311;--sheet:#1a1b19;--field:#232422;
  --text:#ededeb;--text-2:#a7a6a1;--text-3:#7a7975;
  --border:rgba(255,255,255,.08);--border-2:rgba(255,255,255,.15);--fill:rgba(255,255,255,.07);
  --primary:#f2f1ee;--primary-hover:#ffffff;--on-primary:#1c1c1a;
  --accent:#ec8a6f;--accent-soft:rgba(236,138,111,.1);--danger:#ff8a80;--focus:rgba(236,138,111,.6);
  --shadow:0 0 0 1px rgba(0,0,0,.3);
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{min-height:100vh;min-height:100dvh;margin:0;background:var(--app);color:var(--text);font:15px/var(--lh-ui) var(--sans);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
[hidden]{display:none!important}
.theme-switching *,.theme-switching *::before,.theme-switching *::after{transition:none!important}
a{color:inherit}
button,input{font:inherit;color:inherit}
button{cursor:pointer;-webkit-tap-highlight-color:transparent}
button:disabled{cursor:default;opacity:.45}
:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
.brand{display:inline-flex;align-items:center;gap:var(--space-2);color:var(--text);font:600 19px/1 var(--serif);letter-spacing:-.015em;text-decoration:none;white-space:nowrap}
.mark{flex:none;width:28px;height:28px;background:var(--text);-webkit-mask:var(--logo) center/contain no-repeat;mask:var(--logo) center/contain no-repeat}

/* Buttons and fields */
.button{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-3);height:46px;padding:0 20px;border:1px solid var(--border-2);border-radius:999px;background:transparent;font-size:15px;font-weight:560;text-decoration:none;white-space:nowrap;transition:background-color .15s,border-color .15s,transform .12s}
.button:hover:not(:disabled){background:var(--fill)}
.button:active:not(:disabled){transform:scale(.985)}
.button.primary{border-color:var(--primary);background:var(--primary);color:var(--on-primary)}
.button.primary:hover:not(:disabled){border-color:var(--primary-hover);background:var(--primary-hover)}
.button.small{height:36px;padding:0 16px;font-size:14px}
.button.block{width:100%}
.button svg{flex:none;width:18px;height:18px}
.link{padding:2px 0;border:0;background:none;color:var(--text-2);font-size:14px;text-decoration:underline;text-decoration-color:var(--border-2);text-underline-offset:3px}
.link:hover{color:var(--text);text-decoration-color:currentColor}
.field{display:block;margin:0 0 var(--space-4)}
.field span{display:block;margin:0 0 var(--space-2);font-size:13.5px;font-weight:560;color:var(--text-2)}
.field input{display:block;width:100%;height:46px;padding:0 16px;border:1px solid var(--border-2);border-radius:12px;background:var(--field);outline:none;transition:border-color .15s,box-shadow .15s}
.field input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
.field .field-head{display:flex;align-items:baseline;justify-content:space-between;gap:var(--space-3);margin:0 0 var(--space-2);font-size:13.5px}
.field-head label{font-weight:560;color:var(--text-2)}
.field-head .link{font-size:13px}
/* The pressed button spins while its request runs and while the next page loads. */
.button.busy{position:relative;color:transparent}
.button.busy:disabled{opacity:1}
.button.busy svg{visibility:hidden}
.button.busy::after{content:"";position:absolute;top:50%;left:50%;width:18px;height:18px;margin:-9px 0 0 -9px;border:2px solid var(--border-2);border-top-color:var(--text);border-radius:50%;animation:spin .7s linear infinite}
.button.primary.busy::after{border-color:color-mix(in srgb,var(--on-primary) 30%,transparent);border-top-color:var(--on-primary)}

/* Sign in: one card that changes with the step */
body.auth{display:flex;flex-direction:column;align-items:center;padding:clamp(28px,9vh,96px) 20px 32px}
.auth>.brand{margin-bottom:var(--space-6)}
.auth-card{width:min(420px,100%);padding:32px;border:1px solid var(--border);border-radius:22px;background:var(--sheet);box-shadow:var(--shadow)}
.auth-head{margin-bottom:var(--space-6);text-align:center}
.auth-head h1{margin:0;font:600 28px/var(--lh-heading) var(--serif);letter-spacing:-.02em}
.auth-head p{margin:var(--space-2) 0 0;font-size:14.5px;color:var(--text-2);text-wrap:balance}
.auth-head strong{color:var(--text);font-weight:620}
.or{display:flex;align-items:center;gap:var(--space-3);margin:var(--space-5) 0;font-size:12.5px;color:var(--text-3)}
.or::before,.or::after{content:"";flex:1;height:1px;background:var(--border)}
#login .button,#reset-password .button,#accept .button{margin-top:var(--space-2)}
.auth-links{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--space-2) var(--space-5);margin-top:var(--space-5)}
.auth-alt{margin:var(--space-6) -32px -10px;padding:20px 32px 0;border-top:1px solid var(--border);font-size:14px;color:var(--text-2);text-align:center}
/* theme.js marks a remembered sign-in, so the card shows the check instead of the form until login.js runs. */
:root[data-signed-in] .auth-card[data-state=initial]>*{display:none!important}
:root[data-signed-in] .auth-card[data-state=initial]>.loading{display:grid!important}
.note{margin:0 0 var(--space-5);padding:12px 16px;border-radius:12px;background:var(--fill);font-size:13.5px;color:var(--text-2);text-align:center}
.note:empty{display:none}
.note[data-tone=error]{background:var(--accent-soft);color:var(--danger)}
/* Consent: the app and ScoreStarling side by side, the account, what the app may do, two short facts, the answer. */
.pair{display:flex;align-items:center;justify-content:center;gap:var(--space-2);margin-bottom:var(--space-5)}
.tile{display:grid;place-items:center;width:48px;height:48px;border:1px solid var(--border);border-radius:14px;background:var(--fill);font:600 22px/1 var(--serif);color:var(--text)}
.tile.ours{background:var(--sheet)}
.tile .mark{width:26px;height:26px}
.pair-line{width:28px;border-top:2px dotted var(--border-2)}
.consent-head h1{text-wrap:balance;overflow-wrap:anywhere}
.grants,.facts{margin:0;padding:0;list-style:none}
.grants{display:grid;gap:var(--space-3);margin-bottom:var(--space-5)}
.grants li,.facts li{display:flex;align-items:flex-start;gap:var(--space-3)}
.grants li{font-size:14.5px}
.grants svg,.facts svg{flex:none;width:18px;height:18px;margin-top:2px;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.grants svg{stroke:var(--accent)}
.facts{display:grid;gap:var(--space-2);text-wrap:pretty;padding:12px 16px;border-radius:12px;background:var(--fill);font-size:13px;color:var(--text-2)}
.facts svg{width:16px;height:16px;stroke:var(--text-3);stroke-width:1.8}
.facts li[hidden]{display:none}
#destination{overflow-wrap:anywhere}
.fine{margin:0 0 var(--space-3);font-size:13px;color:var(--text-2)}
.fine:empty{display:none}
/* A line under a button (the terms when creating an account) sits a step below it, centred like the card. */
.button+.fine{margin:var(--space-3) 0 0;text-align:center}
.row{display:flex;gap:var(--space-3);margin-top:var(--space-5)}
.row .button{flex:1}
.loading{display:grid;place-items:center;min-height:120px}
.spinner{width:22px;height:22px;border:2px solid var(--border-2);border-top-color:var(--text-2);border-radius:50%;animation:spin .8s linear infinite}
.auth-foot{margin-top:var(--space-6);font-size:13px}
.auth-foot nav{display:flex;flex-wrap:wrap;justify-content:center;gap:var(--space-2) var(--space-5)}
.auth-foot a{color:var(--text-2);text-decoration:none}
.auth-foot a:hover{color:var(--text)}

/* System, Light and Dark switch from account.js: page footers and the account menu */
.theme-switch{display:inline-flex;flex:none;gap:2px;padding:3px;border:1px solid var(--border);border-radius:999px;background:var(--sheet)}
.theme-option{display:grid;place-items:center;width:32px;height:26px;padding:0;border:0;border-radius:999px;background:transparent;color:var(--text-3);transition:background-color .15s,color .15s}
.theme-option:hover{color:var(--text)}
.theme-option[aria-checked=true]{background:var(--fill);color:var(--text)}
.theme-option .account-icon{width:15px;height:15px}

/* Help and legal pages: the public site's header (brand, its pages, account links) */
.doc-bar{position:sticky;top:0;z-index:5;border-bottom:1px solid var(--border);background:color-mix(in srgb,var(--app) 86%,transparent);-webkit-backdrop-filter:saturate(1.4) blur(14px);backdrop-filter:saturate(1.4) blur(14px)}
.doc-bar-inner,.doc-foot-inner{width:min(1240px,100% - clamp(40px,8vw,96px));margin:0 auto}
.doc-bar-inner{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:var(--space-6);height:72px}
.doc-bar .brand{justify-self:start;font-size:21px}
.doc-bar .mark{width:30px;height:30px}
.doc-bar nav{display:flex;align-items:center;font-size:14.5px;white-space:nowrap}
.doc-bar nav a:not(.button){color:var(--text-2);text-decoration:none}
.doc-bar nav a:not(.button):hover{color:var(--text)}
.doc-nav{gap:var(--space-7)}
.doc-nav a{position:relative}
.doc-nav a::after{content:"";position:absolute;left:0;right:0;bottom:-5px;height:1px;background:currentColor;transform:scaleX(0);transform-origin:left;transition:transform .35s cubic-bezier(.2,.7,.2,1)}
.doc-nav a:hover::after{transform:scaleX(1)}
.doc-actions{justify-self:end;gap:var(--space-5)}
.prose{width:min(680px,100% - 40px);margin:0 auto;padding:64px 0 96px}
.prose h1{margin:0 0 var(--space-5);font:600 clamp(38px,7vw,52px)/1.05 var(--serif);letter-spacing:-.025em}
.updated{margin:0 0 var(--space-8);font-size:14px;color:var(--text-3)}
.prose h2{margin:var(--space-9) 0 var(--space-3);font:600 22px/var(--lh-heading) var(--serif);letter-spacing:-.01em}
.prose p{margin:0 0 var(--space-4);font-size:16px;line-height:var(--lh-body);color:var(--text-2)}
.prose a:not(.button){color:var(--accent);text-decoration-thickness:1px;text-underline-offset:3px}
.prose .button{margin:var(--space-2) 0 var(--space-1)}
.doc-foot{border-top:1px solid var(--border)}
.doc-foot-inner{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--space-4);padding:24px 0 32px;font-size:13.5px;color:var(--text-3)}
.doc-foot nav{display:flex;flex-wrap:wrap;gap:var(--space-2) var(--space-5)}
.doc-foot a{color:var(--text-2);text-decoration:none}
.doc-foot a:hover,.doc-foot a[aria-current=page]{color:var(--text)}

/* Who is approving: the signed-in account in one slim row, shown above what the app asks for. */
.who{display:flex;align-items:center;gap:var(--space-3);margin:0 0 var(--space-5);padding:8px;border:1px solid var(--border);border-radius:999px}
.who .account-avatar{width:32px;height:32px;font-size:14px}
.who-text{display:flex;flex-direction:column;min-width:0;flex:1}
.who-text strong{overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}
.who-text span{overflow:hidden;font-size:12.5px;color:var(--text-2);text-overflow:ellipsis;white-space:nowrap}
.who .link{flex:none;height:32px;padding:0 12px;border:1px solid var(--border-2);border-radius:999px;font-size:13px;text-decoration:none;transition:background-color .15s,color .15s}
.who .link:hover{background:var(--fill);color:var(--text)}

/* Account pages (admin, billing): white panels whose content sits in rows. */
.panel{margin-top:var(--space-6);padding:24px 32px;border:1px solid var(--border);border-radius:22px;background:var(--sheet);box-shadow:var(--shadow)}
.panel h2{margin:0 0 var(--space-5);font:600 22px/var(--lh-heading) var(--serif);letter-spacing:-.01em}
.panel>.fine{margin:0}
.count{font:500 14px var(--sans);color:var(--text-3)}
.items{margin:var(--space-5) 0 0;padding:0;list-style:none}
.items li{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:var(--space-2) var(--space-4);padding:16px 0;border-top:1px solid var(--border)}
.items strong{display:block;font-weight:600}
.items .fine{margin:2px 0 0}
.items .empty{color:var(--text-3);font-size:14px}
.badge{display:inline-block;padding:2px 12px;border-radius:999px;background:var(--fill);font-size:12.5px;color:var(--text-2);white-space:nowrap}
.badge.on{background:var(--accent-soft);color:var(--accent)}
@media (max-width:520px){.panel{padding:24px 20px;border-radius:20px}}

/* Signed-in header: account.js swaps "Sign in" for this avatar menu (the workspace and website mirror it). */
.account{position:relative;display:flex}
.account-button{display:grid;place-items:center;width:36px;height:36px;padding:0;border:0;border-radius:50%;background:none}
.account-avatar{display:grid;place-items:center;flex:none;width:34px;height:34px;border-radius:50%;background:var(--accent-soft);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 28%,transparent);color:var(--accent);font:640 14px/1 var(--sans)}
.account-button:hover .account-avatar,.account-button[aria-expanded=true] .account-avatar{box-shadow:inset 0 0 0 1px var(--accent)}
.account-menu{position:absolute;top:calc(100% + 10px);right:0;z-index:10;width:260px;max-width:calc(100vw - 32px);padding:8px;border:1px solid var(--border);border-radius:16px;background:var(--sheet);box-shadow:0 1px 2px rgba(0,0,0,.06),0 24px 48px -20px rgba(0,0,0,.35)}
.account-avatar{position:relative;overflow:hidden}
.account-avatar img{position:absolute;inset:0;width:100%;height:100%;border-radius:50%;object-fit:cover}
.account-avatar.has-image{color:transparent}
.account-menu:focus{outline:none}
.account-head{display:flex;align-items:center;gap:var(--space-3);padding:8px 8px 12px}
.account-who{display:flex;flex-direction:column;gap:1px;min-width:0}
.account-caption{font-size:12px;color:var(--text-3)}
.account-email{overflow:hidden;font-size:14px;font-weight:600;text-overflow:ellipsis;white-space:nowrap}
.account-section{margin-top:var(--space-1);padding-top:4px;border-top:1px solid var(--border)}
.account-item{display:flex;align-items:center;gap:var(--space-3);width:100%;height:38px;padding:0 12px;border:0;border-radius:10px;background:none;font-size:14.5px;color:var(--text);text-align:left;text-decoration:none}
.account-item:hover,.account-item:focus-visible{background:var(--fill);outline:none}
.doc-bar .account-menu .account-item{color:var(--text)}
.account-item .account-icon{width:18px;height:18px;color:var(--text-2)}
.account-theme{display:flex;align-items:center;justify-content:space-between;gap:var(--space-3);padding:8px 4px 2px 12px}
.account-theme-label{font-size:14.5px}
.account-theme .theme-switch{border:0;background:var(--fill)}
.account-theme .theme-option[aria-checked=true]{background:var(--sheet);box-shadow:0 1px 2px rgba(0,0,0,.12)}
/* Language, under the theme: a row naming the choice that opens the languages in the menu's place, with Back
   above them and a check on the chosen one. */
.account-theme+.account-language{margin-top:0;border-top:0}
.account-value{margin-left:auto;font-size:13px;color:var(--text-3);white-space:nowrap}
.account-item .account-value+.account-icon{width:15px;height:15px;margin-left:-4px;color:var(--text-3)}
.account-back{font-weight:600}
.account-languages .account-back{margin-bottom:var(--space-1);border-radius:10px 10px 0 0;box-shadow:0 1px 0 var(--border)}
.account-languages [role=menuitemradio] .account-icon{visibility:hidden;color:var(--accent)}
.account-languages [role=menuitemradio][aria-checked=true] .account-icon{visibility:visible}
/* Until account.js answers, a remembered account keeps "Sign in" from flashing. */
:root[data-signed-in] .doc-actions [data-signin]{visibility:hidden}

/* Narrow screens keep the site's pages in the footer. */
@media (max-width:960px){
  .doc-bar-inner{grid-template-columns:1fr auto}
  .doc-bar .doc-nav{display:none}
}
@media (max-width:520px){
  .auth-card{padding:24px 24px;border-radius:20px}
  .auth-head h1{font-size:25px}
  .doc-bar-inner{height:64px}
  .doc-bar .brand{font-size:19px}
  .doc-bar .mark{width:28px;height:28px}
  /* "Open workspace" already leads signed-out visitors to sign in. */
  .doc-actions a:not(.button){display:none}
  .prose{padding:48px 0 64px}
}
@media (max-width:359px){.doc-bar .brand span:last-child{display:none}}
/* Signed in, the avatar joins Open workspace: on phones the bird alone stands for the brand, so both still fit. */
@media (max-width:480px){:root[data-signed-in] .doc-bar .brand span:last-child{display:none}}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
@keyframes spin{to{transform:rotate(360deg)}}
/* Placeholders while a page's data loads, the same shimmer as the workspace's (ui.css): shaped like what replaces them. */
.skeleton{display:block;border-radius:8px;background:linear-gradient(90deg,var(--fill) 30%,var(--border) 50%,var(--fill) 70%);background-size:300% 100%;animation:shimmer 1.4s ease-in-out infinite}
.skeleton.title{width:38%;height:14px}
.skeleton.text{width:62%;height:10px;margin-top:var(--space-2)}
.skeleton.pill{flex:none;width:92px;height:32px;border-radius:999px}
.skeleton.cell{width:72%;height:11px}
@keyframes shimmer{0%{background-position:100% 0}100%{background-position:0 0}}
@media (prefers-reduced-motion:reduce){.skeleton{animation:none}}

/* Email verification uses the existing auth card and shared controls. */
#code{font-family:ui-monospace,"SF Mono",Menlo,monospace;font-size:24px;letter-spacing:.15em;text-align:center}
#verify-code .button{margin-top:var(--space-2)}

/* Chinese editions (apps/website/publish.py writes apps/web/zh-hans/ and zh-hant/): each platform's Chinese faces after
   the Latin ones, never Windows' SimSun; Han characters stand upright, are never tracked tight and get a taller line. */
:root:lang(zh-Hans){
  --serif:"Iowan Old Style","Palatino Linotype",Palatino,"Book Antiqua",Georgia,"Songti SC","Source Han Serif SC","Noto Serif CJK SC","Noto Serif SC","PingFang SC","Microsoft YaHei",serif;
  --sans:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans CJK SC","Noto Sans SC",Roboto,"Helvetica Neue",Arial,sans-serif;
}
:root:lang(zh-Hant){
  --serif:"Iowan Old Style","Palatino Linotype",Palatino,"Book Antiqua",Georgia,"Songti TC","Source Han Serif TC","Noto Serif CJK TC","Noto Serif TC","PingFang TC","Microsoft JhengHei",serif;
  --sans:ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang TC","Hiragino Sans CNS","Microsoft JhengHei","Noto Sans CJK TC","Noto Sans TC",Roboto,"Helvetica Neue",Arial,sans-serif;
}
:root:lang(zh){font-synthesis-style:none;--lh-heading:1.3;--lh-snug:1.45;--lh-ui:1.6;--lh-body:1.75}
:root:lang(zh) body{line-height:var(--lh-ui)}
:root:lang(zh) :is(h1,h2,h3){letter-spacing:0;line-height:1.3}
:root:lang(zh) :is(em,i){font-style:normal}
