:root {
  --paper: #fff;
  --ink: #111;
  --muted: #606060;
  --line: #d9d9d9;
  --error: #9f231e;
  --gutter: clamp(24px, 4vw, 72px);
  font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 90px; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { border: 0; border-radius: 0; background: none; cursor: pointer; }
button:disabled { opacity: .45; cursor: wait; }
button, a, input, select, summary { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }
[hidden] { display: none !important; }

header, footer { display: grid; grid-template-columns: 1fr 1fr; align-items: start; padding: 24px var(--gutter); font-size: 15px; }
header button { text-align: left; justify-self: start; min-height: 44px; padding: 0; }
.account-header { position: sticky; top: 0; background: var(--paper); z-index: 80; grid-template-columns: 1fr auto; padding-top: 14px; padding-bottom: 14px; border-bottom: 1px solid #efefef; }
.small-logo { font-weight: 700; line-height: 44px; letter-spacing: -.04em; }
main { display: grid; grid-template-columns: 1fr 1fr; padding: clamp(40px, 8vh, 100px) var(--gutter) 100px; min-height: calc(100svh - 155px); }
h1 { font-size: clamp(56px, 8vw, 130px); line-height: .87; letter-spacing: -.065em; font-weight: 700; margin: 0; }
h1 span { display: block; }
.identity p { margin: 30px 0; font-size: 16px; }
.registration { width: 100%; max-width: 480px; min-width: 0; padding-right: 12px; }
h2 { font-size: clamp(30px, 3vw, 42px); font-weight: 400; letter-spacing: -.045em; margin: 0 0 35px; }
h2:focus { outline: none; }
h3 { font-size: 18px; font-weight: 400; margin: 28px 0 10px; }
#modeSwitch { margin: -20px 0 20px; }
.auth-mode-switch { min-height: 44px; padding: 0; color: var(--ink); text-align: center; font-size: 14px; line-height: 1.65; }
.auth-mode-switch .mode-question, .auth-mode-switch .mode-or { color: #969696; }
.auth-mode-switch .mode-signup, .auth-mode-switch .mode-signin { text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.auth-mode-switch.is-login .mode-signup, .auth-mode-switch:not(.is-login) .mode-signin { text-decoration-color: currentColor; }

/* One shared baseline and type scale, like a ruled project index. */
.form-fields { border-top: 1px solid var(--ink); margin-bottom: 24px; }
.field {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  column-gap: 16px;
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid var(--ink);
  min-width: 0;
}
.field label { font-size: 14px; font-weight: 400; line-height: 1.35; }
.field label span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.field input, .field select {
  display: block;
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background-color: var(--paper);
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  letter-spacing: 0;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  cursor: pointer;
  padding-right: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23111' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 16px;
}
.field input::placeholder { color: var(--muted); opacity: 1; }
.field input:focus, .field select:focus { outline: none; border-bottom-color: var(--ink); box-shadow: 0 1px 0 var(--ink); }
.field input[aria-invalid=true], .field select[aria-invalid=true] { border-bottom-color: var(--error); }
.field input[aria-invalid=true]:focus, .field select[aria-invalid=true]:focus { box-shadow: 0 1px 0 var(--error); }
.field-error { display: block; color: var(--error); font-size: 13px; line-height: 1.5; }
.field-error:empty { display: none; }
.field > .field-error, .field > .secondary, .field > .note { grid-column: 2; }
.field > .field-error { padding: 2px 0 5px; }
.field > .note { margin: 0 0 5px; font-size: 12px; }
#verifyForm > .field:first-of-type { border-top: 1px solid var(--ink); }
#verifyForm > .submit { margin-top: 24px; }
#code { font-variant-numeric: tabular-nums; letter-spacing: .12em; }

.permissions { margin: 24px 0; }
.permissions label { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; min-height: 44px; cursor: pointer; font-size: 13px; font-weight: 400; line-height: 1.5; }
.permissions label > span { min-width: 0; }
.permissions input {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  cursor: pointer;
}
.permissions input:checked {
  background-color: var(--ink);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='m3 7 2.5 2.5L11 4' fill='none' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
}
.permissions > .field-error { margin: 0 0 8px 28px; }
.submit { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: 100%; min-height: 52px; background: var(--ink); color: var(--paper); padding: 13px 16px; text-align: left; font-size: 16px; line-height: 24px; }
.submit span { font-size: 24px; line-height: 1; }
.secondary { min-height: 44px; padding: 10px 0; text-align: left; font-size: 14px; line-height: 1.5; text-decoration: underline; text-underline-offset: 4px; }
.note, .status, #verifyHint, #accessStatus, #accountName { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.note { color: var(--muted); margin: 14px 0; }
.beta-intro { margin: 0 0 24px; max-width: 38ch; }
#emailNote { font-size: 13px; margin-top: 12px; }
.status { color: var(--muted); }
.status.error { color: var(--error); }
.status:empty { display: none; }

.auth-choices { display: grid; gap: 10px; }
.provider-button { display: flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid #747775; background: var(--paper); color: #1f1f1f; width: 100%; min-height: 52px; padding: 13px 16px; font-size: 16px; line-height: 24px; }
.provider-button svg { flex-shrink: 0; }
.provider-apple { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.email-choice { border-color: var(--line); }
.email-choice.is-expanded { border-color: var(--ink); }
#emailFields { margin-top: 28px; }
.provider-button, .submit { transition: transform 140ms cubic-bezier(.23,1,.32,1), background-color 140ms ease; }
.provider-button:active, .submit:active { transform: scale(.98); }
.auth-options { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 12px; }
#accountPassword { display: block; }
.account-details { margin: 24px 0; font-size: 14px; line-height: 1.5; border-top: 1px solid var(--ink); }
.account-details div { display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--ink); }
.account-details dt { color: var(--muted); }
.account-details dd { margin: 0; overflow-wrap: anywhere; }

details { font-size: 13px; line-height: 1.55; margin-top: 28px; border-top: 1px solid var(--line); padding-top: 8px; }
summary { cursor: pointer; min-height: 44px; padding: 12px 0; }
details a { text-decoration: underline; text-underline-offset: 3px; }
#privacy { scroll-margin-top: 24px; }
footer { border-top: 1px solid var(--line); font-size: 13px; }
footer a { justify-self: start; }
#privacyLink { min-height: 44px; display: inline-flex; align-items: center; justify-self: end; padding: 0; font-size: inherit; text-decoration: none; }
footer > span { line-height: 44px; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.no-script { padding: 24px; }

.identity, h2 { animation: arrive 700ms cubic-bezier(.23,1,.32,1) both; }
.identity { animation-delay: 30ms; }
h2 { animation-delay: 110ms; }
form { animation: arrive 220ms cubic-bezier(.23,1,.32,1) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (hover:hover) and (pointer:fine) {
  .provider-button:hover { background: #f8f8f8; }
  .provider-apple:hover, .submit:hover { background: #292929; }
}
@media (max-width:700px) {
  header { grid-template-columns: 1fr auto; }
  main { grid-template-columns: 1fr; gap: 42px; padding-top: 36px; padding-bottom: 60px; }
  h1 { font-size: 66px; }
  .identity p { margin: 18px 0 0; }
  .registration { max-width: none; padding: 0; }
  h2 { font-size: 32px; margin-bottom: 26px; }
  .field { grid-template-columns: 96px minmax(0, 1fr); gap: 0 12px; }
  footer { grid-template-columns: 1fr auto; }
}
@media (max-width:380px) {
  .field { grid-template-columns: 84px minmax(0, 1fr); gap: 0 10px; }
  .field label { font-size: 13px; }
}
@media (forced-colors:active) {
  .field input:focus, .field select:focus { border-bottom: 2px solid Highlight; box-shadow: none; }
  .field select { appearance: auto; background-image: none; padding-right: 0; }
  .permissions input { appearance: auto; background: none; accent-color: auto; }
}
@media (prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Landing shell: the supplied black/white beta comp, rebuilt as a responsive interface. */
.auth-view { background: linear-gradient(90deg, var(--ink) 0 50%, var(--paper) 50%); }
.auth-view .account-header { display: none; }
.auth-view main { min-height: 100svh; padding: 0; }
.auth-view .identity {
  position: sticky;
  top: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding: clamp(34px, 5vw, 86px);
  background: var(--ink);
  color: var(--paper);
}
.auth-view .identity h1 { font-size: clamp(72px, 8.1vw, 132px); }
.auth-view .identity p { position: absolute; left: clamp(34px, 5vw, 86px); bottom: clamp(30px, 4vw, 68px); margin: 0; font-size: clamp(34px, 4.8vw, 72px); letter-spacing: -.055em; }
.auth-view .registration {
  align-self: center;
  justify-self: center;
  width: min(100% - 48px, 440px);
  max-width: 440px;
  padding: 72px 0 112px;
}
.auth-view h2 { margin-bottom: 28px; text-align: center; }
.auth-view #modeSwitch { margin: 24px 0 0; }
.auth-view .beta-intro { display: none; }
.auth-view .provider-button { min-height: 46px; padding: 10px 16px; border-color: #e5e3e1; border-radius: 7px; background: #e9e7e5; font-size: 14px; }
.auth-view .auth-mode-switch { display: block; width: 100%; margin: 24px 0 0; font-size: 14px; line-height: 1.7; }
.auth-view .email-choice { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.auth-view .provider-apple { background: #e9e7e5; color: var(--ink); border-color: #e5e3e1; }
.auth-view #emailFields { margin-top: 30px; }
.auth-view footer {
  position: fixed;
  z-index: 4;
  right: 0;
  bottom: 0;
  width: 50%;
  padding: 22px clamp(24px, 3vw, 54px);
  border: 0;
  background: var(--paper);
  grid-template-columns: 1fr auto auto;
  gap: 22px;
}
.auth-view footer a { justify-self: end; }
.auth-view #privacy:not([open]) { display: none; }
.auth-view #privacy[open] {
  position: fixed;
  z-index: 100;
  right: 0;
  bottom: 0;
  width: 50%;
  max-height: min(72svh, 720px);
  margin: 0;
  padding: 0 clamp(24px, 3vw, 54px) 34px;
  overflow: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 0 -18px 40px rgb(0 0 0 / 8%);
  animation: data-drawer-in 220ms cubic-bezier(.23,1,.32,1) both;
}
.auth-view #privacy summary { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 20px 0 14px; background: var(--paper); font-size: 16px; }
.auth-view #privacy summary::after { content: "Close"; font-size: 13px; font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
@keyframes data-drawer-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@media (hover:hover) and (pointer:fine) {
  .auth-view .provider-button:hover { background: #dedbd8; }
  .auth-view .email-choice:hover { background: #292929; }
}
@media (max-width:700px) {
  .auth-view { background: var(--paper); }
  .auth-view main { gap: 0; }
  .auth-view .identity { position: relative; min-height: 42svh; padding: 32px 24px; justify-content: center; }
  .auth-view .identity h1 { font-size: clamp(64px, 21vw, 86px); }
  .auth-view .identity p { left: 24px; bottom: 24px; font-size: 24px; letter-spacing: -.03em; }
  .auth-view .registration { width: 100%; max-width: none; padding: 54px 24px 78px; }
  .auth-view footer { position: static; width: 100%; padding: 18px 24px; border-top: 1px solid var(--line); }
  .auth-view #privacy[open] { left: 0; width: 100vw; max-height: 78svh; padding: 0 24px 28px; }
}

/* Account: identity, one action, then three short groups. */
#accountName { margin: 0 0 20px; }
#accessStatus:empty { display: none; }
#account h3 { font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 32px 0 4px; }
.account-details { margin: 0; }
.account-details div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 12px 0; border-bottom: 1px solid #e6e6e6; font-size: 14px; line-height: 1.5; }
.account-details dt { color: var(--muted); }
.account-details dd { margin: 0; overflow-wrap: anywhere; }
.account-actions { display: flex; flex-wrap: wrap; gap: 0 28px; }
#account .permissions { margin: 4px 0 0; }
.account-links { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 36px 0 0; font-size: 14px; }
.account-links a { min-height: 44px; display: inline-flex; align-items: center; text-underline-offset: 4px; }

/* Phones get a compact identity block and full-width, readable form controls. */
@media (max-width:700px) {
  :root { --gutter: 20px; }
  .account-header { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 8px; }
  main { gap: 32px; padding-top: 28px; padding-bottom: max(40px, env(safe-area-inset-bottom)); }
  .auth-view main { min-height: auto; }
  .auth-view .identity { min-height: 0; padding: calc(28px + env(safe-area-inset-top)) var(--gutter) 28px; flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 24px; }
  .auth-view .identity h1 { font-size: clamp(56px, 17vw, 76px); }
  .auth-view .identity p { position: static; flex-shrink: 0; font-size: 22px; margin: 0; }
  .auth-view .registration { padding: 32px var(--gutter) 40px; }
  .auth-view h2 { font-size: 32px; margin-bottom: 24px; }
  .auth-view .provider-button { min-height: 52px; font-size: 16px; }
  .auth-view .auth-mode-switch { font-size: 15px; margin-top: 20px; }
  .field { grid-template-columns: minmax(0,1fr); gap: 0; padding: 10px 0 4px; }
  .field label { font-size: 13px; }
  .field label span { display: inline; margin-left: 8px; }
  .field > .field-error, .field > .secondary, .field > .note { grid-column: 1; }
  .field input, .field select { scroll-margin-block: 100px; }
  .permissions label { font-size: 14px; gap: 12px; padding: 10px 0; }
  .permissions input { flex-basis: 20px; width: 20px; height: 20px; }
  .account-details div { grid-template-columns: 90px minmax(0,1fr); gap: 12px; }
  .auth-view footer, footer { gap: 8px 16px; padding: 12px var(--gutter) max(16px,env(safe-area-inset-bottom)); }
  footer a { display: inline-flex; align-items: center; min-height: 44px; }
  .auth-view #privacy[open] { width: 100%; max-height: 85dvh; padding: 0 var(--gutter) max(24px,env(safe-area-inset-bottom)); }
  .auth-view #privacy summary { min-height: 56px; }
}
