/* A dedicated authentication surface; business pages keep their own layout. */
html:has(body.is-auth-page) {
  scrollbar-gutter: auto;
  scrollbar-width: none;
}
html:has(body.is-auth-page)::-webkit-scrollbar {
  display: none;
}
body.is-auth-page > .header,
body.is-auth-page #back-to-top {
  display: none !important;
}
body.is-auth-page .workspace {
  --auth-page-top-space: clamp(48px, 8vh, 88px);
  position: relative;
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: var(--auth-page-top-space) 24px 32px;
  gap: 0;
  justify-content: flex-start;
  background: var(--accent);
}
.auth-page {
  width: 100%;
  min-width: 0;
}
.auth-page-shell {
  width: min(100%, 1000px);
  margin: 0 auto;
  padding-right: var(--panel-shadow);
  padding-bottom: var(--panel-shadow);
}
.auth-page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
  align-items: start;
  gap: clamp(36px, 4vw, 48px);
}
.auth-page-intro {
  --auth-art-size: min(100%, 350px, 42vh);
  container-type: inline-size;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 20px;
  min-width: 0;
  /* Center the brand group on the viewport, independently of the form height. */
  height: calc(100vh - 2 * var(--auth-page-top-space));
  min-height: 500px;
}
.auth-page-slogan {
  margin: 0;
  font-family: var(--ui-font-heading);
  font-size: clamp(32px, 12cqw, 56px);
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: -0.025em;
}
.auth-page-slogan > span {
  display: block;
}
.auth-page-account {
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: calc(100vh - 2 * var(--auth-page-top-space));
}
.auth-page-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
.auth-page-wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1.2;
}
.auth-page-wordmark strong {
  font-family: var(--ui-font-heading);
  font-size: 24px;
  font-weight: 900;
}
.auth-page-wordmark > span {
  font-family: var(--ui-font-body);
  font-size: 13px;
  font-weight: 900;
}
.auth-page-line-field {
  position: relative;
  width: var(--auth-art-size);
  aspect-ratio: 1;
  touch-action: pan-y pinch-zoom;
}
.auth-page-line-field canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.auth-page-art-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  font-family: var(--ui-font-heading);
  font-size: clamp(40px, 14cqw, 72px);
  font-weight: 900;
}
.auth-page .auth-page-line-field:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 6px;
}
.auth-page-back {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  left: max(24px, env(safe-area-inset-left));
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
  min-width: 0;
  min-height: 44px;
  padding: 8px 16px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  text-decoration: none;
}
.auth-page-card {
  min-width: 0;
  padding: 28px;
  border: var(--line) solid var(--ink);
  background: var(--paper);
  box-shadow: var(--panel-shadow) var(--panel-shadow) 0 var(--ink);
}
.auth-page-accessible-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.auth-page-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-right: var(--press);
  padding-bottom: var(--press);
  margin-bottom: 20px;
}
.auth-page-tabs .gallery-button {
  --button-base-depth: 2px;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding-inline: 8px;
  border-width: var(--ui-control-border, 2px);
  font-size: 14px;
}
.auth-page-tabs .gallery-button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--ink);
}
.auth-page-form {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
}
.auth-page-form label {
  display: grid;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.4;
}
.auth-page-form > label,
.auth-page-password-field {
  /* Keep the same help-text space below every input, even when it is empty. */
  grid-template-rows: auto auto minmax(18px, auto);
  row-gap: 4px;
}
.auth-page-password-field {
  display: grid;
  min-width: 0;
}
.auth-page-password-control {
  position: relative;
  min-width: 0;
}
.auth-page .auth-page-password-control > input {
  padding-inline-end: 56px;
}
.auth-page-password-control > input::-ms-reveal {
  display: none;
}
.auth-page-password-toggle {
  position: absolute;
  inset-block: var(--line);
  inset-inline-end: var(--line);
  display: grid;
  place-items: center;
  width: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.auth-page-password-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.auth-page-password-toggle[aria-pressed="false"] .auth-page-eye-slash {
  display: none;
}
.auth-page-password-toggle:hover:not(:disabled) {
  background: var(--accent);
}
.auth-page-password-toggle:focus-visible {
  outline: var(--ui-divider) solid var(--ink);
  outline-offset: -4px;
}
.auth-page-password-toggle:disabled {
  cursor: wait;
}
.auth-page-form input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.auth-page-form .field-hint {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 18px;
}
.auth-page-confirm-password-error.form-error {
  margin: 0;
  overflow-wrap: anywhere;
}
.auth-page-form .auth-page-submit {
  width: calc(100% - var(--press));
  min-width: 0;
  min-height: 52px;
  margin-bottom: var(--press);
  border-width: var(--ui-control-border, 2px);
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
}
.auth-page-text-button {
  display: block;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}
.auth-page-forgot {
  margin: 12px 0 -8px auto;
}
.auth-page-text-button:disabled {
  cursor: wait;
}
.auth-page :is(a, summary, .auth-page-text-button):focus-visible {
  outline: var(--ui-divider) solid var(--ink);
  outline-offset: 4px;
}
.auth-page-message.form-error {
  margin: 0 0 20px;
  padding: 12px 14px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
#auth-page-retry {
  margin-top: -12px;
  margin-bottom: 16px;
}
.auth-page-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
}
.auth-page-status-mark {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  background: var(--accent);
}
@media (max-width: 900px) {
  .auth-page-back {
    position: static;
    display: flex;
    margin-bottom: 28px;
  }
  .auth-page-account {
    min-height: 0;
  }
  .auth-page-shell {
    width: min(100%, 480px);
  }
  .auth-page-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .auth-page-intro {
    --auth-art-size: min(100%, 280px);
    height: auto;
    min-height: 0;
    gap: 16px;
  }
  .auth-page-slogan {
    font-size: clamp(28px, 6vw, 40px);
    line-height: 1.4;
  }
  .auth-page-wordmark strong {
    font-size: 22px;
  }
  .auth-page-wordmark > span {
    font-size: 13px;
  }
}
@media (max-width: 767px) {
  body.is-auth-page .workspace {
    padding: 28px 20px 36px;
  }
  .auth-page-card {
    padding: 24px;
  }
  .auth-page-tabs {
    gap: 12px;
    margin-bottom: 20px;
  }
}
@media (max-width: 374px) {
  body.is-auth-page .workspace {
    padding-inline: 16px;
  }
  .auth-page-card {
    padding: 20px;
  }
  .auth-page-wordmark strong {
    font-size: 20px;
  }
  .auth-page-back {
    font-size: 12px;
  }
}
#session-login-dialog {
  width: min(1100px, calc(100vw - 24px));
  height: min(850px, calc(100dvh - 24px));
  max-width: none; max-height: none; padding: 12px;
  border: 3px solid #111; background: white;
}
#session-login-dialog[open] { display: flex; flex-direction: column; gap: 12px; }
#session-login-dialog > button { align-self: flex-end; flex-shrink: 0; }
#account-reauth-frame { border: 0; width: 100%; flex: 1; min-height: 0; }
#session-login-dialog::backdrop { background: rgb(0 0 0 / .45); }
