:root{--mono:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;--h1:25px}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;color-scheme:light}
body{margin:0;font:400 16px/1.5 var(--font);color:var(--on-surface);background:var(--bg)}
h1{font-size:var(--h1);line-height:1.2;font-weight:var(--h1-w);letter-spacing:var(--h1-ls);margin:0 0 8px}
p{margin:0}
.lead{color:var(--on-surface-var);margin:0 0 24px;max-width:60ch}
.field{margin:0 0 16px}
.field>label,.label{display:block;font-size:14px;line-height:1.4;font-weight:600;margin:0 0 4px;color:var(--on-surface)}
.hint{font-size:14px;line-height:1.4;color:var(--on-surface-var);margin:0 0 8px}
.hint--after{margin:8px 0 0}
input[type=email],input[type=password],input[type=text]{display:block;width:100%;min-height:48px;padding:11px 12px;
  font:inherit;color:var(--on-surface);background:var(--field-bg);border:1px solid var(--outline);border-radius:var(--r-field)}
input[aria-invalid=true]{border:2px solid var(--error);padding:10px 11px}
.code-input{font-family:var(--mono);font-size:24px;letter-spacing:.25em;max-width:240px}
.code-input--recovery{letter-spacing:.08em;max-width:280px}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
input:focus-visible{outline-offset:1px}
.error{display:flex;gap:8px;align-items:flex-start;color:var(--error);font-size:14px;line-height:1.4;margin:8px 0 0}
.error svg{flex:none;width:20px;height:20px}
.actions{display:flex;flex-direction:column;gap:12px;margin:24px 0 0}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:12px;min-height:48px;padding:12px 24px;
  font:inherit;font-weight:600;line-height:1.25;text-align:center;text-decoration:none;cursor:pointer;
  border:1px solid transparent;border-radius:var(--r-btn)}
.btn-primary{background:var(--primary);color:var(--on-primary)}
.btn-outline{background:var(--field-bg);color:var(--on-surface);border-color:var(--outline)}
.g-mark{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;
  border:1.5px solid var(--on-surface-var);font-size:13px;font-weight:700;line-height:1}
.google .btn{width:100%}
.or{display:flex;align-items:center;gap:16px;margin:24px 0;color:var(--on-surface-var);font-size:14px}
.or::before,.or::after{content:"";flex:1;border-top:1px solid var(--divider)}
.links{list-style:none;margin:16px 0 0;padding:0}
.link{display:inline-flex;align-items:center;min-height:44px;color:var(--link);font-weight:500;
  text-decoration:underline;text-underline-offset:3px}
.step{font-size:14px;font-weight:600;color:var(--on-surface-var);margin:0 0 8px}
.setup{margin:0;padding:0;list-style:none;counter-reset:s}
.setup>li{counter-increment:s;position:relative;padding:0 0 0 40px;margin:0 0 32px}
.setup>li::before{content:counter(s);position:absolute;left:0;top:0;width:28px;height:28px;border-radius:50%;
  display:grid;place-items:center;font-size:14px;font-weight:700;background:var(--chip);color:var(--on-chip)}
.setup-t{font-weight:600;margin:2px 0 16px}
.setup-t--sub{font-weight:400;color:var(--on-surface-var);margin:16px 0 8px}
.qr-wrap{display:inline-block;line-height:0;border:1px solid var(--divider);border-radius:var(--r-qr);overflow:hidden}
.qr-wrap svg{display:block;width:212px;height:212px}
.key,.codes{background:var(--code-bg);color:var(--on-surface);border-radius:var(--r-field)}
.key{font-family:var(--mono);font-size:18px;line-height:1.6;padding:12px 16px;word-spacing:.2em;max-width:22em;
  user-select:all;-webkit-user-select:all}
.notice{border-left:4px solid var(--on-surface-var);padding:4px 0 4px 16px;margin:0 0 24px;max-width:60ch}
.codes{list-style:none;margin:0 0 24px;padding:16px;display:grid;grid-template-columns:repeat(2,max-content);
  gap:8px 32px;font-family:var(--mono);font-size:18px;line-height:1.6}
.code-n{display:inline-block;min-width:2.2em;color:var(--on-surface-var);font-size:14px}
.check{display:flex;gap:12px;align-items:center;min-height:48px}
.check input{width:24px;height:24px;margin:0;flex:none;accent-color:var(--primary)}
.check label{font-weight:600}
.foot{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 16px;
  font-size:14px;color:var(--on-surface-var)}
.theme{border:0;margin:0;padding:0;display:flex;align-items:center;gap:8px;min-inline-size:0}
.theme legend{float:left;margin-right:4px;padding:0}
.seg{display:inline-flex;border:1px solid var(--outline);border-radius:var(--r-btn);overflow:hidden}
.seg input{position:absolute;opacity:0;width:1px;height:1px}
.seg label{display:inline-flex;align-items:center;min-height:44px;padding:0 14px;cursor:pointer;color:var(--on-surface)}
.seg label+input+label{border-left:1px solid var(--outline)}
.seg input:checked+label{background:var(--chip);color:var(--on-chip);font-weight:600}
.seg input:focus-visible+label{outline:3px solid var(--focus);outline-offset:-3px}
@media (min-width:960px){.btn,.seg label{min-height:44px}}
@media (prefers-reduced-motion:no-preference){.btn,.link,.seg label{transition:background-color .15s ease-out,color .15s ease-out}}

.shell{min-height:100vh;display:grid;grid-template-rows:auto 1fr auto}
.tenant{background:var(--brand-bg);color:var(--on-brand);padding:24px 16px}
.tenant-name{display:block;font-size:25px;font-weight:700;line-height:1.2;letter-spacing:-.01em}
.tenant-sub{display:block;font-size:14px;color:var(--brand-sub);margin-top:4px}
.card{width:100%;max-width:440px;margin:0 auto;padding:32px 16px}
.foot{width:100%;max-width:440px;margin:0 auto;padding:0 16px 24px}
@media (min-width:600px){.tenant{padding:32px 24px}.card{padding:48px 24px}.foot{padding:0 24px 32px}}
@media (max-height:480px) and (max-width:959px){.tenant{padding:12px 24px;display:flex;align-items:baseline;gap:8px}
  .tenant-name{font-size:20px}.tenant-sub{margin:0}.card{padding-top:24px}}
@media (min-width:960px){
  .shell{grid-template-columns:minmax(320px,5fr) 7fr;grid-template-rows:1fr auto}
  .tenant{grid-row:1 / span 2;display:flex;flex-direction:column;justify-content:flex-end;padding:48px}
  .tenant-name{font-size:39px}
  .tenant-sub{font-size:16px}
  .card{align-self:center;padding:48px 32px}
  .foot{padding:0 32px 32px}
}
@media (max-width:420px){.qr-wrap svg{width:180px;height:180px}}

h1,.tenant-name{font-family:var(--font-heading)}
.tenant-name{letter-spacing:var(--h1-ls)}
.btn{font-size:var(--btn-size);font-weight:var(--btn-weight);text-transform:var(--btn-transform);letter-spacing:var(--btn-tracking)}
.logo{display:block;max-width:240px;max-height:56px}
.logo-dark{display:none}
@media (prefers-color-scheme:dark){:root:not(:has(#th-light:checked)) .logo-light{display:none}:root:not(:has(#th-light:checked)) .logo-dark{display:block}}
:root:has(#th-dark:checked) .logo-light{display:none}
:root:has(#th-dark:checked) .logo-dark{display:block}
.actions--stack{margin-top:24px}
@media (max-width:599px){
  body[data-screen=mfa-setup] .tenant{display:flex;align-items:baseline;gap:8px;padding:12px 16px}
  body[data-screen=mfa-setup] .tenant-name{font-size:20px}
  body[data-screen=mfa-setup] .tenant-sub{margin:0}
  body[data-screen=mfa-setup] .card{padding-top:16px}
  body[data-screen=mfa-setup] .lead{margin-bottom:16px}
  body[data-screen=mfa-setup] .setup>li{margin-bottom:20px}
  body[data-screen=mfa-setup] .setup-t{margin-bottom:8px}
  body[data-screen=mfa-setup] .setup-t--sub{margin:12px 0 6px}
  body[data-screen=mfa-setup] .qr-wrap svg,body[data-screen=mfa-setup] .qr{width:160px;height:160px}
  body[data-screen=mfa-setup] .key{font-size:16px;line-height:1.5;padding:8px 12px}
  body[data-screen=mfa-setup] .hint{margin-bottom:4px}
  body[data-screen=mfa-setup] .actions{margin-top:16px}
}
@media (min-width:960px){
  body[data-screen=mfa-setup] .card{padding-block:32px}
  body[data-screen=mfa-setup] .setup>li{margin-bottom:24px}
}
@media (max-height:500px) and (min-width:600px) and (max-width:959px){
  body[data-screen=mfa-setup] .card{max-width:760px}
  body[data-screen=mfa-setup] .setup{display:grid;grid-template-columns:auto 1fr;gap:0 32px;align-items:start}
  body[data-screen=mfa-setup] .setup>li{margin-bottom:0}
  body[data-screen=mfa-setup] .qr-wrap svg,body[data-screen=mfa-setup] .qr{width:160px;height:160px}
  body[data-screen=mfa-setup] .key{font-size:16px;line-height:1.5;padding:8px 12px}
  body[data-screen=mfa-setup] .lead{margin-bottom:16px}
}
body[data-screen=mfa-setup] .setup-phone{display:none}
@media (max-width:599px){
  body[data-screen=mfa-setup] .setup-wide{display:none}
  body[data-screen=mfa-setup] .setup-phone{display:block}
  body[data-screen=mfa-setup] .btn-app{width:100%}
  body[data-screen=mfa-setup] .btn-app svg{flex:none}
  body[data-screen=mfa-setup] .other{margin:12px 0 0}
  body[data-screen=mfa-setup] .other summary{display:flex;align-items:center;gap:8px;min-height:44px;cursor:pointer;color:var(--link);
    font-weight:500;text-decoration:underline;text-underline-offset:3px;list-style:none}
  body[data-screen=mfa-setup] .other summary::-webkit-details-marker{display:none}
  body[data-screen=mfa-setup] .other summary::before{content:"";width:8px;height:8px;border:solid currentColor;border-width:0 2px 2px 0;
    transform:rotate(-45deg);margin:0 4px 0 2px;flex:none}
  body[data-screen=mfa-setup] .other[open] summary::before{transform:rotate(45deg)}
  body[data-screen=mfa-setup] .other{margin-top:4px}
  body[data-screen=mfa-setup] .setup .form{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px;align-items:end}
  body[data-screen=mfa-setup] .setup .form .field,body[data-screen=mfa-setup] .setup .form .actions{display:contents}
  body[data-screen=mfa-setup] .setup .form label,body[data-screen=mfa-setup] .setup .form .hint,body[data-screen=mfa-setup] .setup .form .error{grid-column:1 / -1}
  body[data-screen=mfa-setup] .setup .form .code-input{max-width:none}
  body[data-screen=mfa-setup] .setup .form .error{margin-top:8px;order:9}
  body[data-screen=mfa-setup] .setup .form .btn-primary{padding-inline:20px}
}
@media (max-width:599px) and (max-height:700px){body[data-screen=mfa-setup] .lead{display:none}body[data-screen=mfa-setup] h1{font-size:22px;margin-bottom:12px}body[data-screen=mfa-setup] .card{padding-top:12px}}
